Struct grin_wallet_impls::test_framework::WalletProxy
source · pub struct WalletProxy<'a, L, C, K>{
pub chain_dir: String,
pub chain: Arc<Chain>,
pub wallets: HashMap<String, (Sender<WalletProxyMessage>, Arc<Mutex<Box<dyn WalletInst<'a, L, C, K> + 'a>>>, Option<SecretKey>)>,
pub tx: Sender<WalletProxyMessage>,
pub rx: Receiver<WalletProxyMessage>,
pub running: Arc<AtomicBool>,
}
Expand description
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<Box<dyn WalletInst<'a, L, C, K> + 'a>>>, Option<SecretKey>)>
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
Implementations§
source§impl<'a, L, C, K> WalletProxy<'a, L, C, K>
impl<'a, L, C, K> WalletProxy<'a, L, C, K>
sourcepub fn new(chain_dir: &str) -> Self
pub fn new(chain_dir: &str) -> Self
Create a new client that will communicate with the given grin node
sourcepub fn add_wallet(
&mut self,
addr: &str,
tx: Sender<WalletProxyMessage>,
wallet: Arc<Mutex<Box<dyn WalletInst<'a, L, C, K> + 'a>>>,
keychain_mask: Option<SecretKey>
)
pub fn add_wallet( &mut self, addr: &str, tx: Sender<WalletProxyMessage>, wallet: Arc<Mutex<Box<dyn WalletInst<'a, L, C, K> + 'a>>>, keychain_mask: Option<SecretKey> )
Add wallet with a given “address”
pub fn stop(&mut self)
Trait Implementations§
impl<'a, L, C, K> Send for WalletProxy<'a, L, C, K>
Auto Trait Implementations§
impl<'a, L, C, K> Freeze for WalletProxy<'a, L, C, K>
impl<'a, L, C, K> !RefUnwindSafe for WalletProxy<'a, L, C, K>
impl<'a, L, C, K> !Sync for WalletProxy<'a, L, C, K>
impl<'a, L, C, K> Unpin for WalletProxy<'a, L, C, K>
impl<'a, L, C, K> !UnwindSafe for WalletProxy<'a, L, C, K>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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