remove unused error InvalidCode and improve docs (#11383)

This commit is contained in:
yjh
2022-05-16 16:25:34 +08:00
committed by GitHub
parent a5d0a65bf4
commit bf694d3c0e
3 changed files with 2 additions and 9 deletions
@@ -43,9 +43,6 @@ pub enum Error {
#[error("Method not found: '{0}'")]
MethodNotFound(String),
#[error("Invalid Code (expected single byte): '{0}'")]
InvalidCode(String),
#[error("On-chain runtime does not specify version")]
VersionInvalid,
@@ -191,8 +191,6 @@ impl RuntimeCache {
/// This uses internal cache to find available instance or create a new one.
/// # Parameters
///
/// `code` - Provides external code or tells the executor to fetch it from storage.
///
/// `runtime_code` - The runtime wasm code used setup the runtime.
///
/// `default_heap_pages` - Number of 64KB pages to allocate for Wasm execution.
@@ -201,8 +199,6 @@ impl RuntimeCache {
///
/// `allow_missing_func_imports` - Ignore missing function imports.
///
/// `max_runtime_instances` - The size of the instances cache.
///
/// `f` - Function to execute.
///
/// `H` - A compile-time list of host functions to expose to the runtime.
@@ -210,7 +206,7 @@ impl RuntimeCache {
/// # Returns result of `f` wrapped in an additional result.
/// In case of failure one of two errors can be returned:
///
/// `Err::InvalidCode` is returned for runtime code issues.
/// `Err::RuntimeConstruction` is returned for runtime construction issues.
///
/// `Error::InvalidMemoryReference` is returned if no memory export with the
/// identifier `memory` can be found in the runtime.
+1 -1
View File
@@ -1299,7 +1299,7 @@ mod tests {
sp_version::RuntimeVersion { spec_version: 1, ..Default::default() }
});
// set block number to non zero so events are not exlcuded
// set block number to non zero so events are not excluded
System::set_block_number(1);
Executive::initialize_block(&Header::new(