soroban_sdk::testutils

Trait Ledger

Source
pub trait Ledger {
    // Required methods
    fn set(&self, l: LedgerInfo);
    fn set_protocol_version(&self, protocol_version: u32);
    fn set_sequence_number(&self, sequence_number: u32);
    fn set_timestamp(&self, timestamp: u64);
    fn set_network_id(&self, network_id: [u8; 32]);
    fn set_base_reserve(&self, base_reserve: u32);
    fn set_min_temp_entry_ttl(&self, min_temp_entry_ttl: u32);
    fn set_min_persistent_entry_ttl(&self, min_persistent_entry_ttl: u32);
    fn set_max_entry_ttl(&self, max_entry_ttl: u32);
    fn get(&self) -> LedgerInfo;
    fn with_mut<F>(&self, f: F)
       where F: FnMut(&mut LedgerInfo);
}
Available on crate feature testutils only.
Expand description

Test utilities for Ledger.

Required Methods§

Source

fn set(&self, l: LedgerInfo)

Set ledger info.

Source

fn set_protocol_version(&self, protocol_version: u32)

Sets the protocol version.

Source

fn set_sequence_number(&self, sequence_number: u32)

Sets the sequence number.

Source

fn set_timestamp(&self, timestamp: u64)

Sets the timestamp.

Source

fn set_network_id(&self, network_id: [u8; 32])

Sets the network ID.

Source

fn set_base_reserve(&self, base_reserve: u32)

Sets the base reserve.

Source

fn set_min_temp_entry_ttl(&self, min_temp_entry_ttl: u32)

Sets the minimum temporary entry time-to-live.

Source

fn set_min_persistent_entry_ttl(&self, min_persistent_entry_ttl: u32)

Sets the minimum persistent entry time-to-live.

Source

fn set_max_entry_ttl(&self, max_entry_ttl: u32)

Sets the maximum entry time-to-live.

Source

fn get(&self) -> LedgerInfo

Get ledger info.

Source

fn with_mut<F>(&self, f: F)
where F: FnMut(&mut LedgerInfo),

Modify the ledger info.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§