mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 01:11:10 +00:00
Get rid of core::string in sr-std. (#783)
This commit is contained in:
committed by
Gav Wood
parent
25393abef8
commit
28cc4d0fd6
@@ -280,6 +280,6 @@ mod tests {
|
||||
);
|
||||
|
||||
let env = init_env::<MockExt>();
|
||||
assert!(env.funcs.get("ext_gas").is_some());
|
||||
assert!(env.funcs.get(&b"ext_gas"[..]).is_some());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,6 @@ use super::{SpecialTrap, BalanceOf, CreateReceipt, Ext, GasMeterResult, Runtime}
|
||||
use codec::{Encode, Decode};
|
||||
use parity_wasm::elements::{FunctionType, ValueType};
|
||||
use rstd::prelude::*;
|
||||
use rstd::string::String;
|
||||
use rstd::collections::btree_map::BTreeMap;
|
||||
use runtime_primitives::traits::{As, CheckedMul};
|
||||
use sandbox::{self, TypedValue};
|
||||
@@ -75,7 +74,7 @@ impl ConvertibleToWasm for u64 {
|
||||
/// which can be imported and called by the module.
|
||||
pub(crate) struct HostFunctionSet<E: Ext> {
|
||||
/// Functions which defined in the environment.
|
||||
pub funcs: BTreeMap<String, HostFunction<E>>,
|
||||
pub funcs: BTreeMap<Vec<u8>, HostFunction<E>>,
|
||||
}
|
||||
impl<E: Ext> HostFunctionSet<E> {
|
||||
pub fn new() -> Self {
|
||||
|
||||
@@ -138,7 +138,7 @@ impl<'a, T: Trait> ContractModule<'a, T> {
|
||||
|
||||
let ext_func = env
|
||||
.funcs
|
||||
.get(import.field())
|
||||
.get(import.field().as_bytes())
|
||||
.ok_or_else(|| Error::Instantiate)?;
|
||||
if !ext_func.func_type_matches(func_ty) {
|
||||
return Err(Error::Instantiate);
|
||||
|
||||
Reference in New Issue
Block a user