diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index b9ffdf8c..ddafa227 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -24,7 +24,7 @@ jobs: run: cargo fmt --all --check - name: Install cargo-deny - run: cargo install cargo-deny + run: cargo install --locked cargo-deny - name: Check bans run: cargo-deny --all-features check bans diff --git a/Cargo.toml b/Cargo.toml index 7a4799ff..ea529c9c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -50,6 +50,10 @@ anchor-client = "0.28.0" anyhow = "1.0.32" [patch.crates-io] -curve25519-dalek = { git = "https://github.com/dhruvja/curve25519-dalek", branch = "master" } aes-gcm-siv = { git = "https://github.com/dhruvja/AEADs", branch = "main-aes-gcm-siv-v0.10.3" } +curve25519-dalek = { git = "https://github.com/dhruvja/curve25519-dalek", branch = "master" } + +# eyre has a mutable global variable which is something Solana +# programs cannot have. tendermint crate enables eyre; patch it to +# version that doesn’t do that. tendermint = { git = "https://github.com/mina86/tendermint-rs.git", branch = "33.2-sans-eyre" } diff --git a/common/lib/src/varint.rs b/common/lib/src/varint.rs index aa76a235..63f6b4bd 100644 --- a/common/lib/src/varint.rs +++ b/common/lib/src/varint.rs @@ -113,6 +113,7 @@ impl borsh::BorshDeserialize for VarInt { } } + /// Small on-stack buffer. /// /// # Example 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]);