pub struct ContractInfo<P>where
P: ProxyObjNew,{
pub scenario_address_expr: AddressKey,
/* private fields */
}
Expand description
Bundles a representation of a contract with the contract proxy, so that it can be easily called in the context of a blockchain mock.
Fields§
§scenario_address_expr: AddressKey
Implementations§
Source§impl<P> ContractInfo<P>where
P: ProxyObjNew,
impl<P> ContractInfo<P>where
P: ProxyObjNew,
pub fn new<A>(address_expr: A) -> ContractInfo<P>where
AddressKey: From<A>,
pub fn to_address(&self) -> Address
Trait Implementations§
Source§impl<Env, P> AnnotatedValue<Env, ManagedAddress<<Env as TxEnv>::Api>> for &ContractInfo<P>where
Env: TxEnv,
P: ProxyObjNew,
impl<Env, P> AnnotatedValue<Env, ManagedAddress<<Env as TxEnv>::Api>> for &ContractInfo<P>where
Env: TxEnv,
P: ProxyObjNew,
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<P> Deref for ContractInfo<P>where
P: ProxyObjNew,
impl<P> Deref for ContractInfo<P>where
P: ProxyObjNew,
Source§impl<P> DerefMut for ContractInfo<P>where
P: ProxyObjNew,
impl<P> DerefMut for ContractInfo<P>where
P: ProxyObjNew,
Source§impl<P> From<&ContractInfo<P>> for AddressValuewhere
P: ProxyObjNew,
impl<P> From<&ContractInfo<P>> for AddressValuewhere
P: ProxyObjNew,
Source§fn from(from: &ContractInfo<P>) -> AddressValue
fn from(from: &ContractInfo<P>) -> AddressValue
Converts to this type from the input type.
Source§impl<P> From<ContractInfo<P>> for AddressValuewhere
P: ProxyObjNew,
impl<P> From<ContractInfo<P>> for AddressValuewhere
P: ProxyObjNew,
Source§fn from(from: ContractInfo<P>) -> AddressValue
fn from(from: ContractInfo<P>) -> AddressValue
Converts to this type from the input type.
Source§impl<P> TopEncode for ContractInfo<P>where
P: ProxyObjNew,
impl<P> TopEncode for ContractInfo<P>where
P: ProxyObjNew,
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<P, Env> TxFrom<Env> for &ContractInfo<P>where
Env: TxEnv,
P: ProxyObjNew,
impl<P, Env> TxFrom<Env> for &ContractInfo<P>where
Env: TxEnv,
P: ProxyObjNew,
fn resolve_address(&self, _env: &Env) -> ManagedAddress<<Env as TxEnv>::Api>
Source§impl<P, Env> TxToSpecified<Env> for &ContractInfo<P>where
Env: TxEnv,
P: ProxyObjNew,
impl<P, Env> TxToSpecified<Env> for &ContractInfo<P>where
Env: TxEnv,
P: ProxyObjNew,
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<P, Env> TxFromSpecified<Env> for &ContractInfo<P>where
Env: TxEnv,
P: ProxyObjNew,
impl<P, Env> TxTo<Env> for &ContractInfo<P>where
Env: TxEnv,
P: ProxyObjNew,
impl<P> TypeAbiFrom<&ContractInfo<P>> for Addresswhere
P: ProxyObjNew,
impl<M, P> TypeAbiFrom<&ContractInfo<P>> for ManagedAddress<M>where
M: ManagedTypeApi,
P: ProxyObjNew,
impl<P> TypeAbiFrom<ContractInfo<P>> for Addresswhere
P: ProxyObjNew,
impl<M, P> TypeAbiFrom<ContractInfo<P>> for ManagedAddress<M>where
M: ManagedTypeApi,
P: ProxyObjNew,
Auto Trait Implementations§
impl<P> Freeze for ContractInfo<P>
impl<P> RefUnwindSafe for ContractInfo<P>
impl<P> Send for ContractInfo<P>
impl<P> Sync for ContractInfo<P>
impl<P> Unpin for ContractInfo<P>
impl<P> UnwindSafe for ContractInfo<P>
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> 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 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 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.