Struct multiversx_sc::types::TestSCAddress
source · pub struct TestSCAddress<'a> { /* private fields */ }
Expand description
Encodes a dummy SC address, to be used for tests.
It is designed to be usable from contracts (especiall test contracts), with a minimal footprint. For this reason, its inner structure is subject to change.
Implementations§
source§impl<'a> TestSCAddress<'a>
impl<'a> TestSCAddress<'a>
pub fn to_address(&self) -> Address
source§impl<'a> TestSCAddress<'a>
impl<'a> TestSCAddress<'a>
pub fn eval_to_array(&self) -> [u8; 32]
pub fn eval_to_expr(&self) -> String
Trait Implementations§
source§impl<'a, Env> AnnotatedValue<Env, ManagedAddress<<Env as TxEnv>::Api>> for TestSCAddress<'a>where
Env: TxEnv,
impl<'a, Env> AnnotatedValue<Env, ManagedAddress<<Env as TxEnv>::Api>> for TestSCAddress<'a>where
Env: TxEnv,
fn annotation(&self, _env: &Env) -> ManagedBuffer<Env::Api>
source§fn to_value(&self, _env: &Env) -> ManagedAddress<Env::Api>
fn to_value(&self, _env: &Env) -> ManagedAddress<Env::Api>
Produces the value from a reference of the annotated type. Might involve a
.clone()
in some cases.source§fn into_value(self, env: &Env) -> T
fn into_value(self, env: &Env) -> T
Consumes annotated value to produce actual value. Read more
source§impl<'a> Clone for TestSCAddress<'a>
impl<'a> Clone for TestSCAddress<'a>
source§fn clone(&self) -> TestSCAddress<'a>
fn clone(&self) -> TestSCAddress<'a>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<'a> Debug for TestSCAddress<'a>
impl<'a> Debug for TestSCAddress<'a>
source§impl<'a> PartialEq for TestSCAddress<'a>
impl<'a> PartialEq for TestSCAddress<'a>
source§fn eq(&self, other: &TestSCAddress<'a>) -> bool
fn eq(&self, other: &TestSCAddress<'a>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<'a> TopEncode for TestSCAddress<'a>
impl<'a> TopEncode for TestSCAddress<'a>
source§fn top_encode_or_handle_err<O, H>(
&self,
output: O,
h: H
) -> Result<(), H::HandledErr>where
O: TopEncodeOutput,
H: EncodeErrorHandler,
fn top_encode_or_handle_err<O, H>(
&self,
output: O,
h: H
) -> Result<(), H::HandledErr>where
O: TopEncodeOutput,
H: EncodeErrorHandler,
Version of
top_encode
that can handle errors as soon as they occur.
For instance in can exit immediately and make sure that if it returns, it is a success.
By not deferring error handling, this can lead to somewhat smaller bytecode.source§fn top_encode<O>(&self, output: O) -> Result<(), EncodeError>where
O: TopEncodeOutput,
fn top_encode<O>(&self, output: O) -> Result<(), EncodeError>where
O: TopEncodeOutput,
Attempt to serialize the value to ouput.
source§impl<'a, Env> TxFrom<Env> for TestSCAddress<'a>where
Env: TxEnv,
impl<'a, Env> TxFrom<Env> for TestSCAddress<'a>where
Env: TxEnv,
fn resolve_address(&self, _env: &Env) -> ManagedAddress<Env::Api>
source§impl<'a, Env> TxToSpecified<Env> for TestSCAddress<'a>where
Env: TxEnv,
impl<'a, Env> TxToSpecified<Env> for TestSCAddress<'a>where
Env: TxEnv,
source§fn with_address_ref<F, R>(&self, env: &Env, f: F) -> R
fn with_address_ref<F, R>(&self, env: &Env, f: F) -> R
Avoids a clone when performing transfer-execute. Read more
impl<'a> Copy for TestSCAddress<'a>
impl<'a> Eq for TestSCAddress<'a>
impl<'a> StructuralPartialEq for TestSCAddress<'a>
impl<'a, Env> TxFromSpecified<Env> for TestSCAddress<'a>where
Env: TxEnv,
impl<'a, Env> TxTo<Env> for TestSCAddress<'a>where
Env: TxEnv,
impl<'a, Api> TypeAbiFrom<TestSCAddress<'a>> for ManagedAddress<Api>where
Api: ManagedTypeApi,
Auto Trait Implementations§
impl<'a> Freeze for TestSCAddress<'a>
impl<'a> RefUnwindSafe for TestSCAddress<'a>
impl<'a> Send for TestSCAddress<'a>
impl<'a> Sync for TestSCAddress<'a>
impl<'a> Unpin for TestSCAddress<'a>
impl<'a> UnwindSafe for TestSCAddress<'a>
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> SCCodec for Twhere
T: TopEncode,
impl<T> SCCodec for Twhere
T: TopEncode,
fn fmt<F>(&self, f: &mut F)where
F: FormatByteReceiver,
source§impl<T> TopEncodeMulti for Twhere
T: TopEncode,
impl<T> TopEncodeMulti for Twhere
T: TopEncode,
source§fn multi_encode_or_handle_err<O, H>(
&self,
output: &mut O,
h: H
) -> Result<(), <H as EncodeErrorHandler>::HandledErr>where
O: TopEncodeMultiOutput,
H: EncodeErrorHandler,
fn multi_encode_or_handle_err<O, H>(
&self,
output: &mut O,
h: H
) -> Result<(), <H as EncodeErrorHandler>::HandledErr>where
O: TopEncodeMultiOutput,
H: EncodeErrorHandler,
Version of
top_encode
that can handle errors as soon as they occur.
For instance in can exit immediately and make sure that if it returns, it is a success.
By not deferring error handling, this can lead to somewhat smaller bytecode.source§fn multi_encode<O>(&self, output: &mut O) -> Result<(), EncodeError>where
O: TopEncodeMultiOutput,
fn multi_encode<O>(&self, output: &mut O) -> Result<(), EncodeError>where
O: TopEncodeMultiOutput,
Attempt to serialize the value to ouput.