Closed yejiayu closed 5 years ago
Look good to me. I will test it on vm next day.
Paniced in some test cases. Quick recurrent:
use cita_trie::trie::Trie;
let mut memdb = cita_trie::db::MemoryDB::new();
let mut trie = cita_trie::trie::PatriciaTrie::new(
&mut memdb,
cita_trie::codec::RLPNodeCodec::default(),
);
trie.insert(b"test", b"test").unwrap();
trie.insert(b"test1", b"test").unwrap();
trie.insert(b"test2", b"test").unwrap();
trie.insert(b"test23", b"test").unwrap();
trie.insert(b"test33", b"test").unwrap();
trie.insert(b"test44", b"test").unwrap();
let r = trie.root().unwrap();
println!("{:?}", trie.get(b"test"));
thread 'main' panicked at 'index out of bounds: the len is 16 but the index is 16', C:\src\cita-trie\src\node.rs:90:10
note: Run with `RUST_BACKTRACE=1` for a backtrace.
ping @mohanson
cc @mohanson