pub struct MultiSmartContractSignatureVerifier { /* private fields */ }Expand description
Routes signature checks to a verifier selected by chain ID.
Each configured key is an eip155:<chain> identifier. A missing route is a
retryable configuration/provider error so callers can distinguish it from a
bad signature.
Implementations§
Source§impl MultiSmartContractSignatureVerifier
impl MultiSmartContractSignatureVerifier
Sourcepub fn new(urls: HashMap<String, Url>) -> Result<Self, VerifierError>
pub fn new(urls: HashMap<String, Url>) -> Result<Self, VerifierError>
Build RPC verifiers from chain IDs and endpoint URLs.
URL parsing and provider construction errors are returned before a partially configured verifier is created.
Sourcepub fn new_providers(
providers: HashMap<String, DynProvider>,
) -> Result<Self, VerifierError>
pub fn new_providers( providers: HashMap<String, DynProvider>, ) -> Result<Self, VerifierError>
Build RPC verifiers from already-created providers.
The provider map is consumed and keyed by the caller’s chain IDs.
Sourcepub fn new_from_env() -> Result<Self, VerifierError>
pub fn new_from_env() -> Result<Self, VerifierError>
Load the default chain routes, apply environment overrides, and add Anvil.
Sourcepub fn new_from_file(path: impl AsRef<Path>) -> Result<Self, VerifierError>
pub fn new_from_file(path: impl AsRef<Path>) -> Result<Self, VerifierError>
Load chain routes from a JSON file.
The file must contain a map from chain ID to URL. Environment upgrades are not applied by this constructor.
Sourcepub fn upgrade(self) -> Result<Self, VerifierError>
pub fn upgrade(self) -> Result<Self, VerifierError>
Replace default routes with environment overrides when present.
This also registers the configured Anvil endpoint. A malformed chain ID or endpoint prevents the verifier from being returned.
Sourcepub fn add_verifier(
&mut self,
id: String,
url: String,
) -> Result<(), VerifierError>
pub fn add_verifier( &mut self, id: String, url: String, ) -> Result<(), VerifierError>
Add or replace one chain verifier backed by an RPC URL.
Trait Implementations§
Source§impl SmartContractSignatureVerifier for MultiSmartContractSignatureVerifier
impl SmartContractSignatureVerifier for MultiSmartContractSignatureVerifier
Source§fn is_valid_signature<'life0, 'async_trait>(
&'life0 self,
account_id: AccountId,
hash: [u8; 32],
signature: Bytes,
block_number: Option<BlockNumber>,
) -> Pin<Box<dyn Future<Output = Result<ValidationResponse, VerifierError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn is_valid_signature<'life0, 'async_trait>(
&'life0 self,
account_id: AccountId,
hash: [u8; 32],
signature: Bytes,
block_number: Option<BlockNumber>,
) -> Pin<Box<dyn Future<Output = Result<ValidationResponse, VerifierError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Auto Trait Implementations§
impl Freeze for MultiSmartContractSignatureVerifier
impl !RefUnwindSafe for MultiSmartContractSignatureVerifier
impl Send for MultiSmartContractSignatureVerifier
impl Sync for MultiSmartContractSignatureVerifier
impl Unpin for MultiSmartContractSignatureVerifier
impl UnsafeUnpin for MultiSmartContractSignatureVerifier
impl !UnwindSafe for MultiSmartContractSignatureVerifier
Blanket Implementations§
§impl<T> AggregateExpressionMethods for T
impl<T> AggregateExpressionMethods for T
§fn aggregate_distinct(self) -> Self::Outputwhere
Self: DistinctDsl,
fn aggregate_distinct(self) -> Self::Outputwhere
Self: DistinctDsl,
DISTINCT modifier for aggregate functions Read more§fn aggregate_all(self) -> Self::Outputwhere
Self: AllDsl,
fn aggregate_all(self) -> Self::Outputwhere
Self: AllDsl,
ALL modifier for aggregate functions Read more§fn aggregate_filter<P>(self, f: P) -> Self::Outputwhere
P: AsExpression<Bool>,
Self: FilterDsl<<P as AsExpression<Bool>>::Expression>,
fn aggregate_filter<P>(self, f: P) -> Self::Outputwhere
P: AsExpression<Bool>,
Self: FilterDsl<<P as AsExpression<Bool>>::Expression>,
§fn aggregate_order<O>(self, o: O) -> Self::Outputwhere
Self: OrderAggregateDsl<O>,
fn aggregate_order<O>(self, o: O) -> Self::Outputwhere
Self: OrderAggregateDsl<O>,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<T> IntoSql for T
impl<T> IntoSql for T
§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].