Skip to content

Commit

Permalink
fix pallet claims benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
Roznovjak committed Nov 9, 2023
1 parent 7042d35 commit 628ea58
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions pallets/claims/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,12 @@ benchmarks! {
let eth_address = EthereumAddress(hex!["8202c0af5962b750123ce1a9b12e1c30a4973557"]);

let initial_balance = T::Currency::free_balance(&caller);
let amount_to_claim = 1_000_000_000_000_000_000_u128;

Claims::<T>::insert(eth_address, T::CurrencyBalance::from(1_000_000_000_000_000_000_u128).into());
Claims::<T>::insert(eth_address, T::CurrencyBalance::from(amount_to_claim).into());
}: _(RawOrigin::Signed(caller.clone()), EcdsaSignature(signature))
verify {
let expected_balance = T::CurrencyBalance::from(1_010_000_000_000_000_000_u128);

#[cfg(test)]
let expected_balance = T::CurrencyBalance::from(1_000_000_000_000_000_000_u128);

assert_eq!(T::Currency::free_balance(&caller), initial_balance + expected_balance.into());
assert_eq!(T::Currency::free_balance(&caller), initial_balance + T::CurrencyBalance::from(amount_to_claim).into());
assert_eq!(Claims::<T>::get(eth_address), T::CurrencyBalance::from(0u128).into());
}
}
Expand Down

0 comments on commit 628ea58

Please sign in to comment.