[][src]Struct grin_wallet::test_framework::WalletProxy

pub struct WalletProxy<C, K> where
    C: NodeClient,
    K: Keychain
{ pub chain_dir: String, pub chain: Arc<Chain>, pub wallets: HashMap<String, (Sender<WalletProxyMessage>, Arc<Mutex<dyn WalletInst<LocalWalletClient, K>>>)>, pub tx: Sender<WalletProxyMessage>, pub rx: Receiver<WalletProxyMessage>, pub running: Arc<AtomicBool>, // some fields omitted }

communicates with a chain instance or other wallet listener APIs via message queues

Fields

chain_dir: String

directory to create the chain in

chain: Arc<Chain>

handle to chain itself

wallets: HashMap<String, (Sender<WalletProxyMessage>, Arc<Mutex<dyn WalletInst<LocalWalletClient, K>>>)>

list of interested wallets

tx: Sender<WalletProxyMessage>

simulate json send to another client address, method, payload (simulate HTTP request)

rx: Receiver<WalletProxyMessage>

simulate json receiving

running: Arc<AtomicBool>

queue control

Methods

impl<C, K> WalletProxy<C, K> where
    C: NodeClient,
    K: Keychain
[src]

pub fn new(chain_dir: &str) -> Self
[src]

Create a new client that will communicate with the given grin node

pub fn add_wallet(
    &mut self,
    addr: &str,
    tx: Sender<WalletProxyMessage>,
    wallet: Arc<Mutex<dyn WalletInst<LocalWalletClient, K>>>
)
[src]

Add wallet with a given "address"

pub fn run(&mut self) -> Result<(), Error>
[src]

Run the incoming message queue and respond more or less synchronously

Auto Trait Implementations

impl<C, K> Send for WalletProxy<C, K>

impl<C, K> !Sync for WalletProxy<C, K>

Blanket Implementations

impl<T> From for T
[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Erased for T

impl<T> UnsafeAny for T where
    T: Any

impl<T> SafeBorrow for T where
    T: ?Sized

impl<T> Same for T

type Output = T

Should always be Self