diff --git a/substrate/environmental/src/lib.rs b/substrate/environmental/src/lib.rs index cc42132b11301..0c1135bb8fdf3 100644 --- a/substrate/environmental/src/lib.rs +++ b/substrate/environmental/src/lib.rs @@ -217,10 +217,7 @@ macro_rules! environmental { } } }; - ($name:ident : trait $t:ident <>) => { environmental! { $name : trait @$t [] } }; - ($name:ident : trait $t:ident < $($args:ty),* $(,)* >) => { environmental! { $name : trait @$t [$($args,)*] } }; - ($name:ident : trait $t:ident) => { environmental! { $name : trait @$t [] } }; - (TEST $name:ident<$h:ident> : trait $t:ident <$ch:ty>) => { + ($name:ident<$h:ident> : trait $t:ident <$ch:ty>) => { #[allow(non_camel_case_types, dead_code)] struct $name { _private_field: $crate::imp::PhantomData } @@ -246,6 +243,9 @@ macro_rules! environmental { } } }; + ($name:ident : trait $t:ident <>) => { environmental! { $name : trait @$t [] } }; + ($name:ident : trait $t:ident < $($args:ty),* $(,)* >) => { environmental! { $name : trait @$t [$($args,)*] } }; + ($name:ident : trait $t:ident) => { environmental! { $name : trait @$t [] } }; } #[cfg(test)] @@ -376,6 +376,6 @@ mod tests { }).unwrap(); assert_eq!(out, 6 + 42); - environmental!(TEST foo: trait Multiplier); + environmental!(foo: trait Multiplier); } } diff --git a/substrate/executor/src/wasm_executor.rs b/substrate/executor/src/wasm_executor.rs index 88352f777e568..40dcff137cbdd 100644 --- a/substrate/executor/src/wasm_executor.rs +++ b/substrate/executor/src/wasm_executor.rs @@ -310,8 +310,8 @@ impl_function_executor!(this: FunctionExecutor<'e, H, E>, .map_err(|_| UserError("Invalid attempt to get memory in ext_enumerated_trie_root")) ) .collect::<::std::result::Result, UserError>>()?; + // TODO: remove this KeccakHasher let r = ordered_trie_root::(values.into_iter()); - //this.memory.set(result, &r.into()).map_err(|_| UserError("Invalid attempt to set memory in ext_enumerated_trie_root"))?; this.memory.set(result, &r[..]).map_err(|_| UserError("Invalid attempt to set memory in ext_enumerated_trie_root"))?; Ok(()) }, diff --git a/substrate/runtime-io/with_std.rs b/substrate/runtime-io/with_std.rs index 08842e1ef3c20..f4b204efb2a2a 100644 --- a/substrate/runtime-io/with_std.rs +++ b/substrate/runtime-io/with_std.rs @@ -40,7 +40,7 @@ use hashdb::Hasher; // TODO: use the real error, not NoError. -environmental!(TEST ext_raw : trait Externalities); +environmental!(ext_raw : trait Externalities); #[allow(non_camel_case_types)] type ext = ext_raw;