pub struct Deployment {
pub chain_id: u64,
pub payment_pool: Address,
}Expand description
The PaymentPool deployment the store’s seller-side state is bound to.
The PaymentPool deployment a row belongs to: the chain and contract
address that make up the voucher EIP-712 domain.
A row is only meaningful against the deployment that wrote it. Two deployments that share a contract address on different chains, or a chain with different contract addresses, are different deployments.
Fields§
§chain_id: u64EIP-712 chainId of the voucher domain.
payment_pool: AddressThe PaymentPool contract, the voucher domain’s verifyingContract.
The nonzero check lives at the config boundary
(decdn_common::address::parse_nonzero_address); a new construction
site validates there, not here.
Implementations§
Source§impl Deployment
impl Deployment
Sourcepub const ENCODED_LEN: usize = 28
pub const ENCODED_LEN: usize = 28
Byte width of an encoded Deployment: 8 + 20.
Sourcepub fn voucher_domain(self) -> Eip712Domain
pub fn voucher_domain(self) -> Eip712Domain
The voucher EIP-712 domain of this deployment.
Sourcepub fn to_bytes(self) -> [u8; 28]
pub fn to_bytes(self) -> [u8; 28]
Encode as chain_id (8 bytes, big-endian) ‖ payment_pool (20 bytes).
Sourcepub fn from_bytes(bytes: &[u8]) -> Result<Deployment, StoreError>
pub fn from_bytes(bytes: &[u8]) -> Result<Deployment, StoreError>
Decode the Self::to_bytes form.
§Errors
StoreError::Corrupt for any width other than Self::ENCODED_LEN:
a deployment decides which rows a reader trusts, so bytes this binary
cannot read must not decode to some deployment.
Trait Implementations§
Source§impl Clone for Deployment
impl Clone for Deployment
Source§fn clone(&self) -> Deployment
fn clone(&self) -> Deployment
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for Deployment
Source§impl Debug for Deployment
impl Debug for Deployment
impl Eq for Deployment
Source§impl Hash for Deployment
impl Hash for Deployment
Source§impl PartialEq for Deployment
impl PartialEq for Deployment
impl StructuralPartialEq for Deployment
Auto Trait Implementations§
impl Freeze for Deployment
impl RefUnwindSafe for Deployment
impl Send for Deployment
impl Sync for Deployment
impl Unpin for Deployment
impl UnsafeUnpin for Deployment
impl UnwindSafe for Deployment
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§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request