You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use hash_db::Hasher;use reference_trie::{RefTrieDBMut,RefTrieDB};use trie_db::DBValue;use keccak_hasher::KeccakHasher;use memory_db::*;fnmain(){letmut memdb = MemoryDB::<KeccakHasher,HashKey<_>,_>::default();letmut root = Default::default();RefTrieDBMut::new(&mut memdb,&mut root).insert(b"foo",b"bar").unwrap();let t = RefTrieDB::new(&memdb,&root);assert!(t.contains(b"foo").unwrap());assert_eq!(t.get(b"foo").unwrap().unwrap(),b"bar".to_vec());}
But I get this error:
--> src/main.rs:10:19
|
10 | RefTrieDBMut::new(&mut memdb, &mut root).insert(b"foo", b"bar").unwrap();
| ^^^ function or associated item not found in `trie_db::triedbmut::TrieDBMut<'_, ExtensionLayout>`
And Indeed trie_db::triedbmut::TrieDBMut doesn't have a new method. Any help?
Activity
dimartiro commentedon Jan 16, 2024
@arunpatro could you solve this?