pub enum EvmNetwork {
ArbitrumOne,
ArbitrumSepoliaTest,
Custom(CustomNetwork),
}Variants§
Implementations§
Source§impl Network
impl Network
pub fn new(local: bool) -> Result<Network, Error>
pub fn new_custom( rpc_url: &str, payment_token_addr: &str, payment_vault_addr: &str, ) -> Network
pub fn identifier(&self) -> &str
pub fn rpc_url(&self) -> &Url
pub fn payment_token_address(&self) -> &Address
Sourcepub fn payment_vault_address(&self) -> &Address
pub fn payment_vault_address(&self) -> &Address
Unified payment vault address (handles both single-node and merkle payments).
Sourcepub fn estimate_merkle_payment_cost(
&self,
depth: u8,
pool_commitments: &[PoolCommitment],
) -> Uint<256, 4>
pub fn estimate_merkle_payment_cost( &self, depth: u8, pool_commitments: &[PoolCommitment], ) -> Uint<256, 4>
Estimate the cost of a Merkle tree batch locally.
Estimates the worst-case cost of a Merkle tree payment locally.
The Solidity contract charges median16(quotes) * (1 << depth) for the
winning pool. The only unknown is which pool wins, so the worst case is
the pool with the highest median(prices) * 2^depth. No on-chain call
is made.
§Arguments
depth- The Merkle tree depthpool_commitments- Vector of pool commitments with prices (one per reward pool)
§Returns
- Worst-case cost estimate in AttoTokens
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Network
impl<'de> Deserialize<'de> for Network
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Network, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Network, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for Network
impl Serialize for Network
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for Network
Auto Trait Implementations§
impl Freeze for Network
impl RefUnwindSafe for Network
impl Send for Network
impl Sync for Network
impl Unpin for Network
impl UnsafeUnpin for Network
impl UnwindSafe for Network
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.