mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-16 00:21:05 +00:00
Fix error handling in sandboxing/contracts modules (#744)
* Fix error handling in sandboxing/contracts modules * Add some docs. * Add some tests. * grammar
This commit is contained in:
committed by
Gav Wood
parent
400a22ebe5
commit
488830e81a
@@ -190,7 +190,12 @@ pub struct Instance<T> {
|
||||
}
|
||||
|
||||
impl<T> Instance<T> {
|
||||
/// Instantiate a module with the given [`EnvironmentDefinitionBuilder`].
|
||||
/// Instantiate a module with the given [`EnvironmentDefinitionBuilder`]. It will
|
||||
/// run the `start` function with the given `state`.
|
||||
///
|
||||
/// Returns `Err(Error::Module)` if this module can't be instantiated with the given
|
||||
/// environment. If execution of `start` function generated a trap, then `Err(Error::Execution)` will
|
||||
/// be returned.
|
||||
///
|
||||
/// [`EnvironmentDefinitionBuilder`]: struct.EnvironmentDefinitionBuilder.html
|
||||
pub fn new(code: &[u8], env_def_builder: &EnvironmentDefinitionBuilder<T>, state: &mut T) -> Result<Instance<T>, Error> {
|
||||
|
||||
Reference in New Issue
Block a user