Trait concordium_std::HasCommonData
source · pub trait HasCommonData {
type PolicyType: HasPolicy;
type MetadataType: HasChainMetadata;
type ParamType: HasParameter + Read;
type PolicyIteratorType: ExactSizeIterator<Item = Self::PolicyType>;
// Required methods
fn policies(&self) -> Self::PolicyIteratorType;
fn metadata(&self) -> &Self::MetadataType;
fn parameter_cursor(&self) -> Self::ParamType;
}
Expand description
Common data accessible to both init and receive methods.
§Deprecation notice
This trait is deprecated along with
crate::test_infrastructure
.
Use InitContext
or
ReceiveContext
instead unless you intend
to use the deprecated test infrastructure.
See the crate documentation for more details.
Required Associated Types§
type PolicyType: HasPolicy
type MetadataType: HasChainMetadata
type ParamType: HasParameter + Read
type PolicyIteratorType: ExactSizeIterator<Item = Self::PolicyType>
Required Methods§
sourcefn policies(&self) -> Self::PolicyIteratorType
fn policies(&self) -> Self::PolicyIteratorType
Policies of the sender of the message. For init methods this is the would-be creator of the contract, for the receive this is the policies of the immediate sender.
In the latter case, if the sender is an account then it is the policies of the account, if it is a contract then it is the policies of the creator of the contract.
sourcefn metadata(&self) -> &Self::MetadataType
fn metadata(&self) -> &Self::MetadataType
Get the reference to chain metadata
sourcefn parameter_cursor(&self) -> Self::ParamType
fn parameter_cursor(&self) -> Self::ParamType
Get the cursor to the parameter.