pub trait EnsureOriginWithArg<OuterOrigin, Argument> {
type Success;
// Required methods
fn try_origin(
o: OuterOrigin,
a: &Argument,
) -> Result<Self::Success, OuterOrigin>;
fn try_successful_origin(a: &Argument) -> Result<OuterOrigin, ()>;
// Provided method
fn ensure_origin(
o: OuterOrigin,
a: &Argument,
) -> Result<Self::Success, BadOrigin> { ... }
}
Expand description
Some sort of check on the origin is performed by this object.
Required Associated Types§
type Success
type Success
A return type.
Required Methods§
fn try_origin(
o: OuterOrigin,
a: &Argument,
) -> Result<Self::Success, OuterOrigin>
fn try_origin( o: OuterOrigin, a: &Argument, ) -> Result<Self::Success, OuterOrigin>
Perform the origin check, returning the origin value if unsuccessful. This allows chaining.
fn try_successful_origin(a: &Argument) -> Result<OuterOrigin, ()>
fn try_successful_origin(a: &Argument) -> Result<OuterOrigin, ()>
Attempt to get an outer origin capable of passing try_origin
check. May return Err
if it
is impossible.
** Should be used for benchmarking only!!! **
Provided Methods§
fn ensure_origin(
o: OuterOrigin,
a: &Argument,
) -> Result<Self::Success, BadOrigin>
fn ensure_origin( o: OuterOrigin, a: &Argument, ) -> Result<Self::Success, BadOrigin>
Perform the origin check.
Object Safety§
This trait is not object safe.