Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

merkle-tree: fix build when targeting bpf (bp #16335) #16342

Merged
merged 3 commits into from
Apr 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion merkle-tree/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,13 @@ documentation = "https://docs.rs/solana-merkle-tree"
edition = "2018"

[dependencies]
solana-sdk = { path = "../sdk", version = "=1.6.5" }
solana-program = { path = "../sdk/program", version = "=1.6.5" }
fast-math = "0.1"

# This can go once the BPF toolchain target Rust 1.42.0+
[target.bpfel-unknown-unknown.dependencies]
matches = "0.1.8"

[dev-dependencies]
hex = "0.4.2"

Expand Down
2 changes: 2 additions & 0 deletions merkle-tree/Xargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[target.bpfel-unknown-unknown.dependencies.std]
features = []
5 changes: 5 additions & 0 deletions merkle-tree/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#![allow(clippy::integer_arithmetic)]

#[cfg(target_arch = "bpf")]
#[macro_use]
extern crate matches;

pub mod merkle_tree;
pub use merkle_tree::MerkleTree;
2 changes: 1 addition & 1 deletion merkle-tree/src/merkle_tree.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use solana_sdk::hash::{hashv, Hash};
use solana_program::hash::{hashv, Hash};

// We need to discern between leaf and intermediate nodes to prevent trivial second
// pre-image attacks.
Expand Down