Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
remove successful_origin func of EnsureOrigin trait
  • Loading branch information
muharem committed Jan 19, 2023
commit 325232fa887b4ba086909cf9dcd3940fc4301f99
15 changes: 2 additions & 13 deletions frame/support/src/traits/dispatch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,8 @@ pub trait EnsureOrigin<OuterOrigin> {
/// Perform the origin check.
fn try_origin(o: OuterOrigin) -> Result<Self::Success, OuterOrigin>;

/// Returns an outer origin capable of passing `try_origin` check.
///
/// NOTE: This should generally *NOT* be reimplemented. Instead implement
/// `try_successful_origin`.
///
/// ** Should be used for benchmarking only!!! **
#[cfg(feature = "runtime-benchmarks")]
fn successful_origin() -> OuterOrigin {
Self::try_successful_origin().expect("No origin exists which can satisfy the guard")
}

/// Attept to get an outer origin capable of passing `try_origin` check. May return `Err` if it
/// is impossible. Default implementation just uses `successful_origin()`.
/// Attempt to get an outer origin capable of passing `try_origin` check. May return `Err` if it
/// is impossible. Default implementation returns `Err`.
///
/// ** Should be used for benchmarking only!!! **
#[cfg(feature = "runtime-benchmarks")]
Expand Down