rename call_runtime() returned error (#13412)

This commit is contained in:
Sasha Gryaznov
2023-02-20 17:45:54 +02:00
committed by GitHub
parent bd8cb7ba2d
commit ac13aaeb2f
@@ -115,7 +115,7 @@ pub enum ReturnCode {
/// The contract that was called is no contract (a plain account). /// The contract that was called is no contract (a plain account).
NotCallable = 8, NotCallable = 8,
/// The call dispatched by `seal_call_runtime` was executed but returned an error. /// The call dispatched by `seal_call_runtime` was executed but returned an error.
CallRuntimeReturnedError = 10, CallRuntimeFailed = 10,
/// ECDSA pubkey recovery failed (most probably wrong recovery id or signature), or /// ECDSA pubkey recovery failed (most probably wrong recovery id or signature), or
/// ECDSA compressed pubkey conversion into Ethereum address failed (most probably /// ECDSA compressed pubkey conversion into Ethereum address failed (most probably
/// wrong pubkey provided). /// wrong pubkey provided).
@@ -2404,21 +2404,21 @@ pub mod env {
/// ///
/// # Parameters /// # Parameters
/// ///
/// - `input_ptr`: the pointer into the linear memory where the input data is placed. /// - `call_ptr`: the pointer into the linear memory where the input data is placed.
/// - `input_len`: the length of the input data in bytes. /// - `call_len`: the length of the input data in bytes.
/// ///
/// # Return Value /// # Return Value
/// ///
/// Returns `ReturnCode::Success` when the dispatchable was succesfully executed and /// Returns `ReturnCode::Success` when the dispatchable was succesfully executed and
/// returned `Ok`. When the dispatchable was exeuted but returned an error /// returned `Ok`. When the dispatchable was exeuted but returned an error
/// `ReturnCode::CallRuntimeReturnedError` is returned. The full error is not /// `ReturnCode::CallRuntimeFailed` is returned. The full error is not
/// provided because it is not guaranteed to be stable. /// provided because it is not guaranteed to be stable.
/// ///
/// # Comparison with `ChainExtension` /// # Comparison with `ChainExtension`
/// ///
/// Just as a chain extension this API allows the runtime to extend the functionality /// Just as a chain extension this API allows the runtime to extend the functionality
/// of contracts. While making use of this function is generelly easier it cannot be /// of contracts. While making use of this function is generally easier it cannot be
/// used in call cases. Consider writing a chain extension if you need to do perform /// used in all cases. Consider writing a chain extension if you need to do perform
/// one of the following tasks: /// one of the following tasks:
/// ///
/// - Return data. /// - Return data.
@@ -2444,7 +2444,7 @@ pub mod env {
ctx.adjust_gas(charged, RuntimeCosts::CallRuntime(actual_weight)); ctx.adjust_gas(charged, RuntimeCosts::CallRuntime(actual_weight));
match result { match result {
Ok(_) => Ok(ReturnCode::Success), Ok(_) => Ok(ReturnCode::Success),
Err(_) => Ok(ReturnCode::CallRuntimeReturnedError), Err(_) => Ok(ReturnCode::CallRuntimeFailed),
} }
} }