PaymentRuntime

Struct PaymentRuntime 

Source
pub struct PaymentRuntime {
    pub setup: PaymentSetup,
    pub shared_state: Arc<Mutex<SharedState>>,
    pub wake: Arc<Notify>,
    pub driver_broadcast_sender: Option<Sender<DriverEvent>>,
    pub driver_mpsc_sender: Option<Sender<DriverEvent>>,
    pub raw_event_sender: Sender<DriverEvent>,
    /* private fields */
}

Fields§

§setup: PaymentSetup§shared_state: Arc<Mutex<SharedState>>§wake: Arc<Notify>§driver_broadcast_sender: Option<Sender<DriverEvent>>§driver_mpsc_sender: Option<Sender<DriverEvent>>§raw_event_sender: Sender<DriverEvent>

Implementations§

Source§

impl PaymentRuntime

Source

pub async fn new( payment_runtime_args: PaymentRuntimeArgs, signer: Arc<Box<dyn Signer + Send + Sync + 'static>>, ) -> Result<PaymentRuntime, PaymentError>

Source

pub fn is_any_task_running(&self) -> bool

Source

pub fn is_any_task_finished(&self) -> bool

Source

pub async fn join_tasks(&self) -> Result<(), JoinError>

Source

pub fn abort_tasks(&self)

Source

pub fn add_account( &self, payment_account: SignerAccount, extra_testing: Option<ExtraOptionsForTesting>, options: AdditionalOptions, ) -> bool

Source

pub async fn get_unpaid_token_amount( &self, chain_name: String, sender: Address, ) -> Result<U256, PaymentError>

Source

pub async fn validate_deposit( &self, chain_name: String, deposit_id: DepositId, validate_args: BTreeMap<String, String>, ) -> Result<ValidateDepositResult, PaymentError>

Source

pub async fn deposit_details( &self, chain_name: String, deposit_id: DepositId, ) -> Result<DepositDetails, PaymentError>

Source

pub async fn get_token_balance( &self, chain_name: String, address: Address, block_number: Option<u64>, ) -> Result<GetBalanceResult, PaymentError>

Source

pub async fn force_check_endpoint_info( &self, network: Option<String>, resolve: bool, verify: bool, wait: bool, ) -> Result<(), PaymentError>

Force sources and enpoints check depending on input. If wait is set to false, it is nonblocking.

Source

pub fn get_rpc_sources( &self, network: Option<String>, ) -> Result<BTreeMap<String, Web3ExternalSources>, PaymentError>

Source

pub fn get_rpc_endpoints( &self, network: Option<String>, ) -> Result<BTreeMap<String, Vec<Web3FullNodeData>>, PaymentError>

Source

pub async fn transfer_guess_account( &self, transfer_args: TransferArgs, ) -> Result<(), PaymentError>

Source

pub async fn transfer_with_account( &self, account: &SignerAccount, transfer_args: TransferArgs, ) -> Result<(), PaymentError>

Source

pub async fn distribute_gas( &self, chain_name: &str, from: Address, ) -> Result<(), PaymentError>

Source

pub async fn mint_golem_token( &self, chain_name: &str, from: Address, ) -> Result<(), PaymentError>

Source

pub async fn get_status(&self) -> Vec<StatusProperty>

Source

pub fn get_chain(&self, chain_id: i64) -> Option<&ChainSetup>

Source

pub fn network_name(&self, chain_id: i64) -> Option<&str>

Source

pub async fn verify_transaction( &self, chain_id: i64, tx_hash: H256, sender: Address, receiver: Address, amount: U256, ) -> Result<VerifyTransactionResult, PaymentError>

Source

pub async fn close_deposit( &self, chain_name: &str, from: Address, deposit_id: DepositId, ) -> Result<(), PaymentError>

Source

pub fn chains(&self) -> Vec<i64>

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> 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<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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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 more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

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>,

Source§

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<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> ErasedDestructor for T
where T: 'static,