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
The reference-trie version 0.29.1 on crates.io is using an older version of trie-db (0.27.0), which is inconsistent with the version specified in the Cargo.toml file. This inconsistency may lead to ambiguity when importing external crates.
I tried to import reference-trie 0.29.1 and trie-db 0.28.0 into my code and wrote a demo, but I encountered a compilation error.
demo:
use hash_db::Hasher;
use memory_db::{HashKey, MemoryDB};
use reference_trie::{RefHasher, RefSecTrieDBMut, RefTrieDBBuilder};
use trie_db::{DBValue, Trie, TrieMut};
fn main() {
let mut memdb = MemoryDB::<RefHasher, HashKey<_>, DBValue>::default();
let mut root = Default::default();
{
let mut t = RefSecTrieDBMut::new(&mut memdb, &mut root);
t.insert(&[0x01u8, 0x23], &[0x01u8, 0x23]).unwrap();
}
let t = RefTrieDBBuilder::new(&memdb, &root).build();
assert_eq!(
t.get(&RefHasher::hash(&[0x01u8, 0x23])).unwrap().unwrap(),
vec![0x01u8, 0x23],
);
}
compilation error:
--> src/main.rs:12:11
|
12 | t.insert(&[0x01u8, 0x23], &[0x01u8, 0x23]).unwrap();
| ^^^^^^ method not found in `SecTrieDBMut<'_, ExtensionLayout>`
The reason for the error is that the version of trie-db used by the reference-trie crate is 0.27.0, which conflicts with the version specified in the Cargo.toml file mentioned in
The
reference-trie
version 0.29.1 on crates.io is using an older version oftrie-db
(0.27.0), which is inconsistent with the version specified in theCargo.toml
file. This inconsistency may lead to ambiguity when importing external crates.https://crates.io/crates/reference-trie/0.29.1/dependencies
trie/test-support/reference-trie/Cargo.toml
Line 13 in 6eb4b88
The text was updated successfully, but these errors were encountered: