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 const fn new(name: &'a str) -> TestSCAddress<'a>
Source§impl TestSCAddress<'_>
impl TestSCAddress<'_>
pub fn to_address(&self) -> Address
pub fn to_managed_address<Api>(&self) -> ManagedAddress<Api>where
Api: ManagedTypeApi,
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 as TxEnv>::Api>
Source§fn to_value(&self, _env: &Env) -> ManagedAddress<<Env as TxEnv>::Api>
fn to_value(&self, _env: &Env) -> ManagedAddress<<Env as TxEnv>::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 From<TestSCAddress<'_>> for AddressValue
impl From<TestSCAddress<'_>> for AddressValue
Source§fn from(from: TestSCAddress<'_>) -> AddressValue
fn from(from: TestSCAddress<'_>) -> AddressValue
Converts to this type from the input type.
Source§impl PartialEq<Address> for TestSCAddress<'_>
impl PartialEq<Address> for TestSCAddress<'_>
Source§impl<Api> PartialEq<ManagedAddress<Api>> for TestSCAddress<'_>where
Api: ManagedTypeApi,
impl<Api> PartialEq<ManagedAddress<Api>> for TestSCAddress<'_>where
Api: ManagedTypeApi,
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> PartialEq<TestSCAddress<'a>> for ManagedAddress<Api>where
Api: ManagedTypeApi,
impl<'a, Api> PartialEq<TestSCAddress<'a>> for ManagedAddress<Api>where
Api: ManagedTypeApi,
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 as EncodeErrorHandler>::HandledErr>where
O: TopEncodeOutput,
H: EncodeErrorHandler,
fn top_encode_or_handle_err<O, H>(
&self,
output: O,
h: H,
) -> Result<(), <H as EncodeErrorHandler>::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 as TxEnv>::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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.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> InterpretableFrom<&T> for Twhere
T: Clone,
impl<T> InterpretableFrom<&T> for Twhere
T: Clone,
fn interpret_from(from: &T, _context: &InterpreterContext) -> T
Source§impl<T> InterpretableFrom<T> for T
impl<T> InterpretableFrom<T> for T
fn interpret_from(from: T, _context: &InterpreterContext) -> T
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 moreSource§impl<T> ReconstructableFrom<&T> for Twhere
T: Clone,
impl<T> ReconstructableFrom<&T> for Twhere
T: Clone,
fn reconstruct_from(from: &T, _builder: &ReconstructorContext) -> T
Source§impl<T> ReconstructableFrom<T> for T
impl<T> ReconstructableFrom<T> for T
fn reconstruct_from(from: T, _builder: &ReconstructorContext) -> T
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.