From 4631aaa07743ea402dfdd279284369e3c2424fc2 Mon Sep 17 00:00:00 2001 From: Michal Nazarewicz Date: Fri, 13 Oct 2023 13:49:57 +0200 Subject: [PATCH] reduce diff noise --- common/sealable-trie/src/nodes.rs | 1 + common/sealable-trie/src/proof/serialisation.rs | 1 + common/sealable-trie/src/trie.rs | 1 + solana/trie-example/src/lib.rs | 1 + solana/trie-example/src/trie.rs | 3 +++ 5 files changed, 7 insertions(+) diff --git a/common/sealable-trie/src/nodes.rs b/common/sealable-trie/src/nodes.rs index c2396512..e714f9fd 100644 --- a/common/sealable-trie/src/nodes.rs +++ b/common/sealable-trie/src/nodes.rs @@ -483,6 +483,7 @@ impl<'a> ValueRef<'a, bool> { pub fn sealed(self) -> Self { Self { is_sealed: true, hash: self.hash } } } + // ============================================================================= // Conversions diff --git a/common/sealable-trie/src/proof/serialisation.rs b/common/sealable-trie/src/proof/serialisation.rs index 21776a53..ebc393d7 100644 --- a/common/sealable-trie/src/proof/serialisation.rs +++ b/common/sealable-trie/src/proof/serialisation.rs @@ -281,6 +281,7 @@ fn invalid_data(msg: String) -> io::Error { io::Error::new(io::ErrorKind::InvalidData, msg) } + #[test] fn test_item_borsh() { #[track_caller] diff --git a/common/sealable-trie/src/trie.rs b/common/sealable-trie/src/trie.rs index 1e3fc246..2257bc5b 100644 --- a/common/sealable-trie/src/trie.rs +++ b/common/sealable-trie/src/trie.rs @@ -328,6 +328,7 @@ impl> Trie { } } + #[cfg(test)] impl Trie> { /// Creates a test trie using a TestAllocator with given capacity. diff --git a/solana/trie-example/src/lib.rs b/solana/trie-example/src/lib.rs index ce808e9d..c28564d8 100644 --- a/solana/trie-example/src/lib.rs +++ b/solana/trie-example/src/lib.rs @@ -72,6 +72,7 @@ impl TrieResultExt for Result { } } + /// Instruction to execute. pub(crate) enum Instruction<'a> { // Encoding: diff --git a/solana/trie-example/src/trie.rs b/solana/trie-example/src/trie.rs index 57a83a5d..6456879c 100644 --- a/solana/trie-example/src/trie.rs +++ b/solana/trie-example/src/trie.rs @@ -211,6 +211,8 @@ impl<'a, 'b> memory::Allocator for Allocator<'a, 'b> { } } + + impl<'a, 'b> core::ops::Deref for AccountTrie<'a, 'b> { type Target = sealable_trie::Trie>; fn deref(&self) -> &Self::Target { &self.0 } @@ -247,6 +249,7 @@ fn write( right } + #[test] fn test_header_encoding() { const ONE: CryptoHash = CryptoHash([1; 32]);