Skip to content

Commit

Permalink
fix: sending batches of payable usage
Browse files Browse the repository at this point in the history
  • Loading branch information
yahortsaryk committed Nov 28, 2024
1 parent 56cb9ed commit 1dbdace
Show file tree
Hide file tree
Showing 2 changed files with 145 additions and 289 deletions.
8 changes: 2 additions & 6 deletions pallets/ddc-payouts/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -629,8 +629,7 @@ pub mod pallet {
})
.collect::<Vec<_>>();

let batch_hash =
Self::create_merkle_root(&cluster_id, era_id, payers_batch.as_slice())?;
let batch_hash = Self::create_merkle_root(payers_batch.as_slice())?;

let is_verified = Self::proof_merkle_leaf(
payers_merkle_root,
Expand Down Expand Up @@ -664,8 +663,7 @@ pub mod pallet {
})
.collect::<Vec<_>>();

let batch_hash =
Self::create_merkle_root(&cluster_id, era_id, payees_batch.as_slice())?;
let batch_hash = Self::create_merkle_root(payees_batch.as_slice())?;

let is_verified = Self::proof_merkle_leaf(
payees_merkle_root,
Expand All @@ -679,8 +677,6 @@ pub mod pallet {
}

pub(crate) fn create_merkle_root(
cluster_id: &ClusterId,
era_id: DdcEra,
leaves: &[PayableUsageHash],
) -> Result<PayableUsageHash, DispatchError> {
if leaves.is_empty() {
Expand Down
Loading

0 comments on commit 1dbdace

Please sign in to comment.