Struct zenith_types::Zenith::ZenithInstance
source · pub struct ZenithInstance<T, P, N = Ethereum> { /* private fields */ }Expand description
A Zenith instance.
Contains type-safe methods for interacting with an on-chain instance of the
Zenith contract located at a given address, using a given
provider P.
If the contract bytecode is available (see the sol!
documentation on how to provide it), the deploy and deploy_builder methods can
be used to deploy a new instance of the contract.
See the module-level documentation for all the available methods.
Implementations§
source§impl<T: Transport + Clone, P: Provider<T, N>, N: Network> ZenithInstance<T, P, N>
impl<T: Transport + Clone, P: Provider<T, N>, N: Network> ZenithInstance<T, P, N>
Instantiation and getters/setters.
sourcepub const fn new(address: Address, provider: P) -> Self
pub const fn new(address: Address, provider: P) -> Self
Creates a new wrapper around an on-chain Zenith contract instance.
See the wrapper’s documentation for more details.
sourcepub fn set_address(&mut self, address: Address)
pub fn set_address(&mut self, address: Address)
Sets the address.
source§impl<T, P: Clone, N> ZenithInstance<T, &P, N>
impl<T, P: Clone, N> ZenithInstance<T, &P, N>
sourcepub fn with_cloned_provider(self) -> ZenithInstance<T, P, N>
pub fn with_cloned_provider(self) -> ZenithInstance<T, P, N>
Clones the provider and returns a new instance with the cloned provider.
source§impl<T: Transport + Clone, P: Provider<T, N>, N: Network> ZenithInstance<T, P, N>
impl<T: Transport + Clone, P: Provider<T, N>, N: Network> ZenithInstance<T, P, N>
Function calls.
sourcepub fn call_builder<C: SolCall>(&self, call: &C) -> SolCallBuilder<T, &P, C, N>
pub fn call_builder<C: SolCall>(&self, call: &C) -> SolCallBuilder<T, &P, C, N>
Creates a new call builder using this contract instance’s provider and address.
Note that the call can be any function call, not just those defined in this contract. Prefer using the other methods for building type-safe contract calls.
sourcepub fn addSequencer(
&self,
sequencer: Address,
) -> SolCallBuilder<T, &P, addSequencerCall, N>
pub fn addSequencer( &self, sequencer: Address, ) -> SolCallBuilder<T, &P, addSequencerCall, N>
Creates a new call builder for the [addSequencer] function.
sourcepub fn blockCommitment(
&self,
header: <BlockHeader as SolType>::RustType,
) -> SolCallBuilder<T, &P, blockCommitmentCall, N>
pub fn blockCommitment( &self, header: <BlockHeader as SolType>::RustType, ) -> SolCallBuilder<T, &P, blockCommitmentCall, N>
Creates a new call builder for the [blockCommitment] function.
sourcepub fn deployBlockNumber(
&self,
) -> SolCallBuilder<T, &P, deployBlockNumberCall, N>
pub fn deployBlockNumber( &self, ) -> SolCallBuilder<T, &P, deployBlockNumberCall, N>
Creates a new call builder for the [deployBlockNumber] function.
sourcepub fn isSequencer(
&self,
_0: Address,
) -> SolCallBuilder<T, &P, isSequencerCall, N>
pub fn isSequencer( &self, _0: Address, ) -> SolCallBuilder<T, &P, isSequencerCall, N>
Creates a new call builder for the [isSequencer] function.
sourcepub fn lastSubmittedAtBlock(
&self,
_0: U256,
) -> SolCallBuilder<T, &P, lastSubmittedAtBlockCall, N>
pub fn lastSubmittedAtBlock( &self, _0: U256, ) -> SolCallBuilder<T, &P, lastSubmittedAtBlockCall, N>
Creates a new call builder for the [lastSubmittedAtBlock] function.
sourcepub fn removeSequencer(
&self,
sequencer: Address,
) -> SolCallBuilder<T, &P, removeSequencerCall, N>
pub fn removeSequencer( &self, sequencer: Address, ) -> SolCallBuilder<T, &P, removeSequencerCall, N>
Creates a new call builder for the [removeSequencer] function.
sourcepub fn sequencerAdmin(&self) -> SolCallBuilder<T, &P, sequencerAdminCall, N>
pub fn sequencerAdmin(&self) -> SolCallBuilder<T, &P, sequencerAdminCall, N>
Creates a new call builder for the [sequencerAdmin] function.
sourcepub fn submitBlock(
&self,
header: <BlockHeader as SolType>::RustType,
v: u8,
r: FixedBytes<32>,
s: FixedBytes<32>,
_4: Bytes,
) -> SolCallBuilder<T, &P, submitBlockCall, N>
pub fn submitBlock( &self, header: <BlockHeader as SolType>::RustType, v: u8, r: FixedBytes<32>, s: FixedBytes<32>, _4: Bytes, ) -> SolCallBuilder<T, &P, submitBlockCall, N>
Creates a new call builder for the [submitBlock] function.
source§impl<T: Transport + Clone, P: Provider<T, N>, N: Network> ZenithInstance<T, P, N>
impl<T: Transport + Clone, P: Provider<T, N>, N: Network> ZenithInstance<T, P, N>
Event filters.
sourcepub fn event_filter<E: SolEvent>(&self) -> Event<T, &P, E, N>
pub fn event_filter<E: SolEvent>(&self) -> Event<T, &P, E, N>
Creates a new event filter using this contract instance’s provider and address.
Note that the type can be any event, not just those defined in this contract. Prefer using the other methods for building type-safe event filters.
sourcepub fn BlockSubmitted_filter(&self) -> Event<T, &P, BlockSubmitted, N>
pub fn BlockSubmitted_filter(&self) -> Event<T, &P, BlockSubmitted, N>
Creates a new event filter for the BlockSubmitted event.
sourcepub fn SequencerSet_filter(&self) -> Event<T, &P, SequencerSet, N>
pub fn SequencerSet_filter(&self) -> Event<T, &P, SequencerSet, N>
Creates a new event filter for the SequencerSet event.
Trait Implementations§
Auto Trait Implementations§
impl<T, P, N> Freeze for ZenithInstance<T, P, N>where
P: Freeze,
impl<T, P, N> RefUnwindSafe for ZenithInstance<T, P, N>
impl<T, P, N> Send for ZenithInstance<T, P, N>
impl<T, P, N> Sync for ZenithInstance<T, P, N>
impl<T, P, N> Unpin for ZenithInstance<T, P, N>
impl<T, P, N> UnwindSafe for ZenithInstance<T, P, N>
Blanket Implementations§
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§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