mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 22:51:13 +00:00
srml-contracts: Contract calls/instantiations to return exit statuses (#3320)
* srml-contracts: Rename ext_scratch_copy to ext_scratch_read. This is to disambiguate from the next ext_scratch_write function. * Remove unnecessary OutputBuf and EmptyOutputBuf. * Replace VmExecError with a result type of custom structs. * Do not drop the scratch buffer on traps and regular returns. This just reduces the number of allocations required during nested contract calls and instantiations. * Semantics for returning a status code and data from contract calls. * Remove CallReceipt and InstantiateReceipt. With forthcoming changes to return data from instantiate calls, the two types of receipts become very similar to each other and to ExecReturnValue. Instead, replace them with ExecReturnValue and a regular 2-tuple in the case of instantiation. * Modify contract function signatures to allow returning status codes. * Introduce ext_sandbox_write runtime function. * Test all the things. * Bump node runtime spec version. * Style fixes.
This commit is contained in:
@@ -53,8 +53,7 @@ mod imp {
|
||||
/// Error that can occur while using this crate.
|
||||
#[cfg_attr(feature = "std", derive(Debug))]
|
||||
pub enum Error {
|
||||
/// Module is not valid, couldn't be instantiated or it's `start` function trapped
|
||||
/// when executed.
|
||||
/// Module is not valid, couldn't be instantiated.
|
||||
Module,
|
||||
|
||||
/// Access to a memory or table was made with an address or an index which is out of bounds.
|
||||
@@ -62,7 +61,7 @@ pub enum Error {
|
||||
/// Note that if wasm module makes an out-of-bounds access then trap will occur.
|
||||
OutOfBounds,
|
||||
|
||||
/// Failed to invoke an exported function for some reason.
|
||||
/// Failed to invoke the start function or an exported function for some reason.
|
||||
Execution,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user