Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
remove the TEST in macro
Browse files Browse the repository at this point in the history
  • Loading branch information
Guanqun Lu committed Sep 7, 2018
1 parent ce10ecd commit d8a096f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions substrate/environmental/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 <H: $h> { _private_field: $crate::imp::PhantomData<H> }

Expand All @@ -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)]
Expand Down Expand Up @@ -376,6 +376,6 @@ mod tests {
}).unwrap();

assert_eq!(out, 6 + 42);
environmental!(TEST foo<Plus>: trait Multiplier<ConcretePlus>);
environmental!(foo<Plus>: trait Multiplier<ConcretePlus>);
}
}
2 changes: 1 addition & 1 deletion substrate/executor/src/wasm_executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Vec<_>, UserError>>()?;
// TODO: remove this KeccakHasher
let r = ordered_trie_root::<KeccakHasher, _, _>(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(())
},
Expand Down
2 changes: 1 addition & 1 deletion substrate/runtime-io/with_std.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ use hashdb::Hasher;

// TODO: use the real error, not NoError.

environmental!(TEST ext_raw<Hasher> : trait Externalities<KeccakHasher>);
environmental!(ext_raw<Hasher> : trait Externalities<KeccakHasher>);
#[allow(non_camel_case_types)]
type ext = ext_raw<KeccakHasher>;

Expand Down

0 comments on commit d8a096f

Please sign in to comment.