PaymentGenerator

Trait PaymentGenerator 

Source
pub trait PaymentGenerator: Display + Send {
    // Required methods
    fn payment_start(&self) -> Option<Duration>;
    fn payment_count(&self) -> Option<u64>;
    fn next_payment_wait(&self) -> Result<Duration, PaymentGenerationError>;
    fn payment_amount(
        &self,
        destination_capacity: Option<u64>,
    ) -> Result<u64, PaymentGenerationError>;
}

Required Methods§

Source

fn payment_start(&self) -> Option<Duration>

Returns the time that the payments should start

Source

fn payment_count(&self) -> Option<u64>

Returns the number of payments that should be made

Source

fn next_payment_wait(&self) -> Result<Duration, PaymentGenerationError>

Returns the number of seconds that a node should wait until firing its next payment.

Source

fn payment_amount( &self, destination_capacity: Option<u64>, ) -> Result<u64, PaymentGenerationError>

Returns a payment amount based, with a destination capacity optionally provided to inform the amount picked.

Implementors§