Skip to content

Commit 885ab95

Browse files
ali-behjatiswimricky
authored andcommitted
fixup! pyth: introduce pyth accumulator library
1 parent 28647f6 commit 885ab95

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

runtime/src/bank.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2514,6 +2514,7 @@ impl Bank {
25142514
byteorder::ReadBytesExt,
25152515
pythnet_sdk::{
25162516
accumulators::{merkle::MerkleAccumulator, Accumulator},
2517+
hashers::keccak256_160::Keccak160,
25172518
pythnet::PYTH_PID,
25182519
MESSAGE_BUFFER_PID,
25192520
},
@@ -2603,7 +2604,7 @@ impl Bank {
26032604
// Generate a Message owned by Wormhole to be sent cross-chain. This short-circuits the
26042605
// Wormhole message generation code that would normally be called, but the Guardian
26052606
// set filters our messages so this does not pose a security risk.
2606-
if let Some(accumulator) = MerkleAccumulator::from_set(accounts) {
2607+
if let Some(accumulator) = MerkleAccumulator::<Keccak160>::from_set(accounts) {
26072608
self.post_accumulator_attestation(accumulator, ring_index)?;
26082609
}
26092610

@@ -2617,7 +2618,9 @@ impl Bank {
26172618
/// TODO: Safe integer conversion checks if any are missed.
26182619
fn post_accumulator_attestation(
26192620
&self,
2620-
acc: pythnet_sdk::accumulators::merkle::MerkleAccumulator,
2621+
acc: pythnet_sdk::accumulators::merkle::MerkleAccumulator<
2622+
pythnet_sdk::hashers::keccak256_160::Keccak160,
2623+
>,
26212624
ring_index: u32,
26222625
) -> std::result::Result<(), AccumulatorUpdateError> {
26232626
use {

0 commit comments

Comments
 (0)