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 TestSCAddress<'_>
impl TestSCAddress<'_>
pub fn to_address(&self) -> Address
pub fn to_managed_address<Api: ManagedTypeApi>(&self) -> ManagedAddress<Api>
Source§impl TestSCAddress<'_>
impl TestSCAddress<'_>
pub fn eval_to_array(&self) -> [u8; 32]
pub fn eval_to_expr(&self) -> String
Trait Implementations§
Source§impl<Env> AnnotatedValue<Env, ManagedAddress<<Env as TxEnv>::Api>> for TestSCAddress<'_>where
Env: TxEnv,
impl<Env> AnnotatedValue<Env, ManagedAddress<<Env as TxEnv>::Api>> for TestSCAddress<'_>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 PartialEq<Address> for TestSCAddress<'_>
impl PartialEq<Address> for TestSCAddress<'_>
Source§impl<Api: ManagedTypeApi> PartialEq<ManagedAddress<Api>> for TestSCAddress<'_>
impl<Api: ManagedTypeApi> PartialEq<ManagedAddress<Api>> for TestSCAddress<'_>
Source§impl PartialEq<TestAddress<'_>> for TestSCAddress<'_>
impl PartialEq<TestAddress<'_>> for TestSCAddress<'_>
Source§impl PartialEq<TestSCAddress<'_>> for TestAddress<'_>
impl PartialEq<TestSCAddress<'_>> for TestAddress<'_>
Source§impl<'a> PartialEq<TestSCAddress<'a>> for Address
impl<'a> PartialEq<TestSCAddress<'a>> for Address
Source§impl<'a, Api: ManagedTypeApi> PartialEq<TestSCAddress<'a>> for ManagedAddress<Api>
impl<'a, Api: ManagedTypeApi> PartialEq<TestSCAddress<'a>> for ManagedAddress<Api>
Source§impl<'a> PartialEq for TestSCAddress<'a>
impl<'a> PartialEq for TestSCAddress<'a>
Source§impl TopEncode for TestSCAddress<'_>
impl TopEncode for TestSCAddress<'_>
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<Env> TxFrom<Env> for TestSCAddress<'_>where
Env: TxEnv,
impl<Env> TxFrom<Env> for TestSCAddress<'_>where
Env: TxEnv,
fn resolve_address(&self, _env: &Env) -> ManagedAddress<Env::Api>
Source§impl<Env> TxToSpecified<Env> for TestSCAddress<'_>where
Env: TxEnv,
impl<Env> TxToSpecified<Env> for TestSCAddress<'_>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<Env> TxFromSpecified<Env> for TestSCAddress<'_>where
Env: TxEnv,
impl<Env> TxTo<Env> for TestSCAddress<'_>where
Env: TxEnv,
impl<Api> TypeAbiFrom<TestSCAddress<'_>> 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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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.