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>

source

pub const fn new(name: &'a str) -> Self

source§

impl<'a> TestSCAddress<'a>

source

pub fn to_address(&self) -> Address

source§

impl<'a> TestSCAddress<'a>

source

pub fn eval_to_array(&self) -> [u8; 32]

source

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,

source§

fn annotation(&self, _env: &Env) -> ManagedBuffer<Env::Api>

source§

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

Consumes annotated value to produce actual value. Read more
source§

fn with_value_ref<F, R>(&self, env: &Env, f: F) -> R
where F: FnOnce(&T) -> R,

Can be used when working with references only. Read more
source§

impl<'a> Clone for TestSCAddress<'a>

source§

fn clone(&self) -> TestSCAddress<'a>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'a> Debug for TestSCAddress<'a>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'a> PartialEq for TestSCAddress<'a>

source§

fn eq(&self, other: &TestSCAddress<'a>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<'a> TopEncode for TestSCAddress<'a>

source§

fn top_encode_or_handle_err<O, H>( &self, output: O, h: H ) -> Result<(), H::HandledErr>

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,

Attempt to serialize the value to ouput.
source§

impl<'a, Env> TxFrom<Env> for TestSCAddress<'a>
where Env: TxEnv,

source§

impl<'a, Env> TxToSpecified<Env> for TestSCAddress<'a>
where Env: TxEnv,

source§

fn with_address_ref<F, R>(&self, env: &Env, f: F) -> R
where F: FnOnce(&ManagedAddress<Env::Api>) -> R,

Avoids a clone when performing transfer-execute. Read more
source§

impl<'a> Copy for TestSCAddress<'a>

source§

impl<'a> Eq for TestSCAddress<'a>

source§

impl<'a> StructuralPartialEq for TestSCAddress<'a>

source§

impl<'a, Env> TxFromSpecified<Env> for TestSCAddress<'a>
where Env: TxEnv,

source§

impl<'a, Env> TxTo<Env> for TestSCAddress<'a>
where Env: TxEnv,

source§

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> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> SCCodec for T
where T: TopEncode,

source§

fn fmt<F>(&self, f: &mut F)

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> TopEncodeMulti for T
where T: TopEncode,

source§

fn multi_encode_or_handle_err<O, H>( &self, output: &mut O, h: H ) -> Result<(), <H as EncodeErrorHandler>::HandledErr>

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>

Attempt to serialize the value to ouput.
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<O, T> ProxyArg<O> for T
where O: TypeAbiFrom<T>, T: TopEncodeMulti,