[][src]Struct grin_wallet_impls::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 stop(&mut self)[src]

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> Unpin for WalletProxy<C, K> where
    C: Unpin,
    K: Unpin

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

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

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

Blanket Implementations

impl<T> From<T> for T[src]

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

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.

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

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

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

impl<T> UnsafeAny for T where
    T: Any

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> Erased for T

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

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