pub struct LwkTestEnv { /* private fields */ }Expand description
Represent a test environment with an elements node and an electrum server.
useful for testing only, wrapper over lwk_test_util::TestElectrumServer
Implementations§
Source§impl LwkTestEnv
impl LwkTestEnv
Sourcepub fn new() -> LwkTestEnv
pub fn new() -> LwkTestEnv
Creates a new test environment
Sourcepub fn send_to_address(
&self,
address: &Address,
satoshi: u64,
asset: Option<AssetId>,
) -> Txid
pub fn send_to_address( &self, address: &Address, satoshi: u64, asset: Option<AssetId>, ) -> Txid
Send satoshi to address from the node
Sourcepub fn issue_asset(&self, satoshi: u64) -> AssetId
pub fn issue_asset(&self, satoshi: u64) -> AssetId
Issue satoshi of an asset from the node
Sourcepub fn get_new_address(&self) -> Arc<Address>
pub fn get_new_address(&self) -> Arc<Address>
Get a new address from the node
Sourcepub fn electrum_url(&self) -> String
pub fn electrum_url(&self) -> String
Get the Electrum URL of the test environment
Trait Implementations§
Source§impl<UT> LiftRef<UT> for LwkTestEnv
impl<UT> LiftRef<UT> for LwkTestEnv
type LiftType = Arc<LwkTestEnv>
Source§impl<UT> LowerError<UT> for LwkTestEnv
impl<UT> LowerError<UT> for LwkTestEnv
Source§fn lower_error(obj: Self) -> RustBuffer
fn lower_error(obj: Self) -> RustBuffer
Lower this value for scaffolding function return Read more
Source§impl<UT> LowerReturn<UT> for LwkTestEnv
impl<UT> LowerReturn<UT> for LwkTestEnv
Source§type ReturnType = <Arc<LwkTestEnv> as LowerReturn<UniFfiTag>>::ReturnType
type ReturnType = <Arc<LwkTestEnv> as LowerReturn<UniFfiTag>>::ReturnType
The type that should be returned by scaffolding functions for this type. Read more
Source§fn lower_return(obj: Self) -> Result<Self::ReturnType, RustCallError>
fn lower_return(obj: Self) -> Result<Self::ReturnType, RustCallError>
Lower the return value from an scaffolding call Read more
Source§fn handle_failed_lift(
error: LiftArgsError,
) -> Result<Self::ReturnType, RustCallError>
fn handle_failed_lift( error: LiftArgsError, ) -> Result<Self::ReturnType, RustCallError>
Lower the return value for failed argument lifts Read more
Source§impl<UT> TypeId<UT> for LwkTestEnv
impl<UT> TypeId<UT> for LwkTestEnv
Auto Trait Implementations§
impl !Freeze for LwkTestEnv
impl !RefUnwindSafe for LwkTestEnv
impl Send for LwkTestEnv
impl Sync for LwkTestEnv
impl Unpin for LwkTestEnv
impl !UnwindSafe for LwkTestEnv
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, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
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