Struct raiden_blockchain::proxies::ProxyManager

source ·
pub struct ProxyManager {
    pub tokens: RwLock<HashMap<Address, TokenProxy<Http>>>,
    pub token_networks: RwLock<HashMap<Address, TokenNetworkProxy<Http>>>,
    pub token_network_registries: RwLock<HashMap<Address, TokenNetworkRegistryProxy<Http>>>,
    pub secret_registries: RwLock<HashMap<Address, SecretRegistryProxy<Http>>>,
    pub service_registries: RwLock<HashMap<Address, ServiceRegistryProxy<Http>>>,
    pub user_deposit: RwLock<HashMap<Address, UserDeposit<Http>>>,
    /* private fields */
}
Expand description

The proxy singleton manager.

Makes sure that every proxy to a specific contract address has one and only one instance.

Fields§

§tokens: RwLock<HashMap<Address, TokenProxy<Http>>>§token_networks: RwLock<HashMap<Address, TokenNetworkProxy<Http>>>§token_network_registries: RwLock<HashMap<Address, TokenNetworkRegistryProxy<Http>>>§secret_registries: RwLock<HashMap<Address, SecretRegistryProxy<Http>>>§service_registries: RwLock<HashMap<Address, ServiceRegistryProxy<Http>>>§user_deposit: RwLock<HashMap<Address, UserDeposit<Http>>>

Implementations§

source§

impl ProxyManager

source

pub fn new( web3: Web3<Http>, contracts_manager: Arc<ContractsManager> ) -> Result<Self, ProxyError>

Returns a new instance of ProxyManager.

source

pub fn web3(&self) -> Web3<Http>

Returns a copy of Web3 instance.

source

pub fn gas_metadata(&self) -> Arc<GasMetadata>

Returns gas metadata.

source

pub async fn token_network_registry( &self, token_network_registry_address: TokenNetworkRegistryAddress ) -> Result<TokenNetworkRegistryProxy<Http>, ContractDefError>

Creates and returns the proxy for the token network registry.

source

pub async fn secret_registry( &self, secret_registry_address: SecretRegistryAddress ) -> Result<SecretRegistryProxy<Http>, ContractDefError>

Creates and returns the proxy for the secret registry.

source

pub async fn service_registry( &self, service_registry_address: Address ) -> Result<ServiceRegistryProxy<Http>, ContractDefError>

Creates and returns the proxy for the service registry.

source

pub async fn user_deposit( &self, user_deposit_address: Address ) -> Result<UserDeposit<Http>, ContractDefError>

Creates and returns the proxy for the user deposit contract.

source

pub async fn token( &self, token_address: TokenAddress ) -> Result<TokenProxy<Http>, ContractDefError>

Creates and returns the proxy for the token contract.

source

pub async fn token_network( &self, token_address: TokenAddress, token_network_address: TokenNetworkAddress ) -> Result<TokenNetworkProxy<Http>, ContractDefError>

Creates and returns the proxy for the token network contract.

source

pub async fn payment_channel( &self, channel_state: &ChannelState ) -> Result<ChannelProxy<Http>, ContractDefError>

Creates and returns the proxy for the channel proxy.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Az for T

source§

fn az<Dst>(self) -> Dst
where T: Cast<Dst>,

Casts the value.
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<Src, Dst> CastFrom<Src> for Dst
where Src: Cast<Dst>,

source§

fn cast_from(src: Src) -> Dst

Casts the value.
source§

impl<T> CheckedAs for T

source§

fn checked_as<Dst>(self) -> Option<Dst>
where T: CheckedCast<Dst>,

Casts the value.
source§

impl<Src, Dst> CheckedCastFrom<Src> for Dst
where Src: CheckedCast<Dst>,

source§

fn checked_cast_from(src: Src) -> Option<Dst>

Casts the value.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> OverflowingAs for T

source§

fn overflowing_as<Dst>(self) -> (Dst, bool)
where T: OverflowingCast<Dst>,

Casts the value.
source§

impl<Src, Dst> OverflowingCastFrom<Src> for Dst
where Src: OverflowingCast<Dst>,

source§

fn overflowing_cast_from(src: Src) -> (Dst, bool)

Casts the value.
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> SaturatingAs for T

source§

fn saturating_as<Dst>(self) -> Dst
where T: SaturatingCast<Dst>,

Casts the value.
source§

impl<Src, Dst> SaturatingCastFrom<Src> for Dst
where Src: SaturatingCast<Dst>,

source§

fn saturating_cast_from(src: Src) -> Dst

Casts the value.
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> UnwrappedAs for T

source§

fn unwrapped_as<Dst>(self) -> Dst
where T: UnwrappedCast<Dst>,

Casts the value.
source§

impl<Src, Dst> UnwrappedCastFrom<Src> for Dst
where Src: UnwrappedCast<Dst>,

source§

fn unwrapped_cast_from(src: Src) -> Dst

Casts the value.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> WrappingAs for T

source§

fn wrapping_as<Dst>(self) -> Dst
where T: WrappingCast<Dst>,

Casts the value.
source§

impl<Src, Dst> WrappingCastFrom<Src> for Dst
where Src: WrappingCast<Dst>,

source§

fn wrapping_cast_from(src: Src) -> Dst

Casts the value.