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: AddressKeyImplementations§
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 output.
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§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§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> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ReconstructableFrom<T> for T
impl<T> ReconstructableFrom<T> for T
fn reconstruct_from(from: T, _builder: &ReconstructorContext) -> T
Source§impl<R> Rng for R
impl<R> Rng for R
Source§fn random<T>(&mut self) -> Twhere
StandardUniform: Distribution<T>,
fn random<T>(&mut self) -> Twhere
StandardUniform: Distribution<T>,
Return a random value via the
StandardUniform distribution. Read moreSource§fn random_iter<T>(self) -> Iter<StandardUniform, Self, T>
fn random_iter<T>(self) -> Iter<StandardUniform, Self, T>
Source§fn random_range<T, R>(&mut self, range: R) -> Twhere
T: SampleUniform,
R: SampleRange<T>,
fn random_range<T, R>(&mut self, range: R) -> Twhere
T: SampleUniform,
R: SampleRange<T>,
Generate a random value in the given range. Read more
Source§fn random_bool(&mut self, p: f64) -> bool
fn random_bool(&mut self, p: f64) -> bool
Return a bool with a probability
p of being true. Read moreSource§fn random_ratio(&mut self, numerator: u32, denominator: u32) -> bool
fn random_ratio(&mut self, numerator: u32, denominator: u32) -> bool
Return a bool with a probability of
numerator/denominator of being
true. Read moreSource§fn sample<T, D>(&mut self, distr: D) -> Twhere
D: Distribution<T>,
fn sample<T, D>(&mut self, distr: D) -> Twhere
D: Distribution<T>,
Sample a new value, using the given distribution. Read more
Source§fn sample_iter<T, D>(self, distr: D) -> Iter<D, Self, T>where
D: Distribution<T>,
Self: Sized,
fn sample_iter<T, D>(self, distr: D) -> Iter<D, Self, T>where
D: Distribution<T>,
Self: Sized,
Create an iterator that generates values using the given distribution. Read more
Source§fn gen<T>(&mut self) -> Twhere
StandardUniform: Distribution<T>,
fn gen<T>(&mut self) -> Twhere
StandardUniform: Distribution<T>,
👎Deprecated since 0.9.0: Renamed to
random to avoid conflict with the new gen keyword in Rust 2024.Alias for
Rng::random.Source§fn gen_range<T, R>(&mut self, range: R) -> Twhere
T: SampleUniform,
R: SampleRange<T>,
fn gen_range<T, R>(&mut self, range: R) -> Twhere
T: SampleUniform,
R: SampleRange<T>,
👎Deprecated since 0.9.0: Renamed to
random_rangeAlias for
Rng::random_range.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 output.
Source§impl<R> TryRngCore for R
impl<R> TryRngCore for R
Source§type Error = Infallible
type Error = Infallible
The type returned in the event of a RNG error.
Source§fn try_next_u32(&mut self) -> Result<u32, <R as TryRngCore>::Error>
fn try_next_u32(&mut self) -> Result<u32, <R as TryRngCore>::Error>
Return the next random
u32.Source§fn try_next_u64(&mut self) -> Result<u64, <R as TryRngCore>::Error>
fn try_next_u64(&mut self) -> Result<u64, <R as TryRngCore>::Error>
Return the next random
u64.Source§fn try_fill_bytes(
&mut self,
dst: &mut [u8],
) -> Result<(), <R as TryRngCore>::Error>
fn try_fill_bytes( &mut self, dst: &mut [u8], ) -> Result<(), <R as TryRngCore>::Error>
Fill
dest entirely with random data.Source§fn unwrap_mut(&mut self) -> UnwrapMut<'_, Self>
fn unwrap_mut(&mut self) -> UnwrapMut<'_, Self>
Wrap RNG with the
UnwrapMut wrapper.Source§fn read_adapter(&mut self) -> RngReadAdapter<'_, Self>where
Self: Sized,
fn read_adapter(&mut self) -> RngReadAdapter<'_, Self>where
Self: Sized,
Convert an
RngCore to a RngReadAdapter.