Struct oasis_runtime_sdk_contracts::Module
source · pub struct Module<Cfg: Config> { /* private fields */ }
Implementations§
source§impl<Cfg: Config> Module<Cfg>
impl<Cfg: Config> Module<Cfg>
pub fn tx_upload<C: Context>( ctx: &C, body: Upload, ) -> Result<UploadResult, Error>
pub fn tx_instantiate<C: Context>( ctx: &C, body: Instantiate, ) -> Result<InstantiateResult, Error>
pub fn tx_call<C: Context>(ctx: &C, body: Call) -> Result<CallResult, Error>
pub fn tx_change_upgrade_policy<C: Context>( ctx: &C, body: ChangeUpgradePolicy, ) -> Result<(), Error>
pub fn tx_upgrade<C: Context>(ctx: &C, body: Upgrade) -> Result<(), Error>
pub fn query_code<C: Context>(_ctx: &C, args: CodeQuery) -> Result<Code, Error>
pub fn query_code_storage<C: Context>( _ctx: &C, args: CodeStorageQuery, ) -> Result<CodeStorageQueryResult, Error>
pub fn query_instance<C: Context>( _ctx: &C, args: InstanceQuery, ) -> Result<Instance, Error>
pub fn query_instance_storage<C: Context>( ctx: &C, args: InstanceStorageQuery, ) -> Result<InstanceStorageQueryResult, Error>
pub fn query_instance_raw_storage<C: Context>( ctx: &C, args: InstanceRawStorageQuery, ) -> Result<InstanceRawStorageQueryResult, Error>
pub fn query_public_key<C: Context>( _ctx: &C, _args: PublicKeyQuery, ) -> Result<PublicKeyQueryResult, Error>
pub fn query_custom<C: Context>( ctx: &C, args: CustomQuery, ) -> Result<CustomQueryResult, Error>
Trait Implementations§
source§impl<Cfg: Config> BlockHandler for Module<Cfg>
impl<Cfg: Config> BlockHandler for Module<Cfg>
source§impl<Cfg: Config> InvariantHandler for Module<Cfg>
impl<Cfg: Config> InvariantHandler for Module<Cfg>
source§impl<Cfg: Config> MethodHandler for Module<Cfg>
impl<Cfg: Config> MethodHandler for Module<Cfg>
source§fn dispatch_call<C: Context>(
ctx: &C,
method: &str,
body: Value,
) -> DispatchResult<Value, CallResult>
fn dispatch_call<C: Context>( ctx: &C, method: &str, body: Value, ) -> DispatchResult<Value, CallResult>
Dispatch a call.
source§fn dispatch_query<C: Context>(
ctx: &C,
method: &str,
args: Value,
) -> DispatchResult<Value, Result<Value, RuntimeError>>
fn dispatch_query<C: Context>( ctx: &C, method: &str, args: Value, ) -> DispatchResult<Value, Result<Value, RuntimeError>>
Dispatch a query.
source§fn supported_methods() -> Vec<MethodHandlerInfo>
fn supported_methods() -> Vec<MethodHandlerInfo>
Lists the names of all RPC methods exposed by this module. The result is informational
only. An empty return vector means that the implementor does not care to list the methods,
or the implementor is a tuple of modules.
source§fn is_expensive_query(method: &str) -> bool
fn is_expensive_query(method: &str) -> bool
Checks whether the given query method is tagged as expensive.
source§fn is_allowed_interactive_call(method: &str) -> bool
fn is_allowed_interactive_call(method: &str) -> bool
Checks whether the given call is allowed to be called interactively via read-only
transactions.
source§fn prefetch(
_prefixes: &mut BTreeSet<Prefix>,
_method: &str,
body: Value,
_auth_info: &AuthInfo,
) -> DispatchResult<Value, Result<(), Error>>
fn prefetch( _prefixes: &mut BTreeSet<Prefix>, _method: &str, body: Value, _auth_info: &AuthInfo, ) -> DispatchResult<Value, Result<(), Error>>
Add storage prefixes to prefetch.
source§fn dispatch_message_result<C>(
_ctx: &C,
_handler_name: &str,
result: MessageResult,
) -> DispatchResult<MessageResult, ()>where
C: Context,
fn dispatch_message_result<C>(
_ctx: &C,
_handler_name: &str,
result: MessageResult,
) -> DispatchResult<MessageResult, ()>where
C: Context,
Dispatch a message result.
source§fn is_allowed_private_km_query(_method: &str) -> bool
fn is_allowed_private_km_query(_method: &str) -> bool
Checks whether the given query is allowed to access private key manager state.
source§impl<Cfg: Config> MigrationHandler for Module<Cfg>
impl<Cfg: Config> MigrationHandler for Module<Cfg>
source§impl<Cfg: Config> Module for Module<Cfg>
impl<Cfg: Config> Module for Module<Cfg>
§type Parameters = Parameters
type Parameters = Parameters
Module parameters.
source§fn params() -> Self::Parameters
fn params() -> Self::Parameters
Return the module’s parameters.
source§fn set_params(params: Self::Parameters)
fn set_params(params: Self::Parameters)
Set the module’s parameters.
source§impl<Cfg: Config> TransactionHandler for Module<Cfg>
impl<Cfg: Config> TransactionHandler for Module<Cfg>
source§fn approve_raw_tx<C>(_ctx: &C, _tx: &[u8]) -> Result<(), Error>where
C: Context,
fn approve_raw_tx<C>(_ctx: &C, _tx: &[u8]) -> Result<(), Error>where
C: Context,
Judge if a raw transaction is good enough to undergo decoding.
This takes place before even decoding the transaction.
source§fn approve_unverified_tx<C>(
_ctx: &C,
_utx: &UnverifiedTransaction,
) -> Result<(), Error>where
C: Context,
fn approve_unverified_tx<C>(
_ctx: &C,
_utx: &UnverifiedTransaction,
) -> Result<(), Error>where
C: Context,
Judge if an unverified transaction is good enough to undergo verification.
This takes place before even verifying signatures.
source§fn decode_tx<C>(
_ctx: &C,
_scheme: &str,
_body: &[u8],
) -> Result<Option<Transaction>, Error>where
C: Context,
fn decode_tx<C>(
_ctx: &C,
_scheme: &str,
_body: &[u8],
) -> Result<Option<Transaction>, Error>where
C: Context,
Decode a transaction that was sent with module-controlled decoding and verify any
signatures. Read more
source§fn authenticate_tx<C>(
_ctx: &C,
_tx: &Transaction,
) -> Result<AuthDecision, Error>where
C: Context,
fn authenticate_tx<C>(
_ctx: &C,
_tx: &Transaction,
) -> Result<AuthDecision, Error>where
C: Context,
Authenticate a transaction. Read more
source§fn before_handle_call<C>(_ctx: &C, _call: &Call) -> Result<(), Error>where
C: Context,
fn before_handle_call<C>(_ctx: &C, _call: &Call) -> Result<(), Error>where
C: Context,
Perform any action after authentication, within the transaction context. Read more
Perform any action after authentication and decoding, within the transaction context. Read more
source§fn after_handle_call<C>(
_ctx: &C,
result: CallResult,
) -> Result<CallResult, Error>where
C: Context,
fn after_handle_call<C>(
_ctx: &C,
result: CallResult,
) -> Result<CallResult, Error>where
C: Context,
Perform any action after call, within the transaction context. Read more
source§fn after_dispatch_tx<C>(
_ctx: &C,
_tx_auth_info: &AuthInfo,
_result: &CallResult,
)where
C: Context,
fn after_dispatch_tx<C>(
_ctx: &C,
_tx_auth_info: &AuthInfo,
_result: &CallResult,
)where
C: Context,
Perform any action after dispatching the transaction, in batch context.
Auto Trait Implementations§
impl<Cfg> Freeze for Module<Cfg>
impl<Cfg> RefUnwindSafe for Module<Cfg>where
Cfg: RefUnwindSafe,
impl<Cfg> Send for Module<Cfg>where
Cfg: Send,
impl<Cfg> Sync for Module<Cfg>where
Cfg: Sync,
impl<Cfg> Unpin for Module<Cfg>where
Cfg: Unpin,
impl<Cfg> UnwindSafe for Module<Cfg>where
Cfg: UnwindSafe,
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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<M> ModuleInfoHandler for Mwhere
M: Module + MethodHandler,
impl<M> ModuleInfoHandler for Mwhere
M: Module + MethodHandler,
source§fn module_info<C>(_ctx: &C) -> BTreeMap<String, ModuleInfo>where
C: Context,
fn module_info<C>(_ctx: &C) -> BTreeMap<String, ModuleInfo>where
C: Context,
Reports info about the module (or modules, if
Self
is a tuple).