Test enumerted trie root.

This commit is contained in:
Gav
2018-01-31 06:52:40 +01:00
parent 2cd54ce820
commit 9cc7c5a9b2
4 changed files with 10 additions and 5 deletions
+7 -2
View File
@@ -8,7 +8,8 @@ use alloc::vec::Vec;
#[macro_use]
extern crate runtime_std;
use runtime_std::{set_storage, storage, print, blake2_256, twox_128, twox_256, ed25519_verify};
use runtime_std::{set_storage, storage, print, blake2_256, twox_128, twox_256, ed25519_verify,
enumerated_trie_root};
fn test_blake2_256(input: &[u8]) -> Vec<u8> {
blake2_256(&input).to_vec()
@@ -29,6 +30,10 @@ fn test_ed25519_verify(input: &[u8]) -> Vec<u8> {
[ed25519_verify(sig, &msg[..], pubkey) as u8].to_vec()
}
fn test_enumerated_trie_root(_input: &[u8]) -> Vec<u8> {
enumerated_trie_root(&[&b"zero"[..], &b"one"[..], &b"two"[..]]).to_vec()
}
fn test_data_in(input: &[u8]) -> Vec<u8> {
print("set_storage");
set_storage(b"input", &input);
@@ -59,4 +64,4 @@ fn test_conditional_panic(input: &[u8]) -> Vec<u8> {
}
impl_stubs!(test_data_in, test_empty_return, test_panic, test_conditional_panic,
test_blake2_256, test_twox_256, test_twox_128, test_ed25519_verify);
test_blake2_256, test_twox_256, test_twox_128, test_ed25519_verify, test_enumerated_trie_root);