Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(claims): update Alice's signature in claims bench test #142

Merged
merged 8 commits into from
Mar 14, 2021
12 changes: 10 additions & 2 deletions pallets/claims/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,21 @@ benchmarks! {

claim {
let alice_id = hex!["d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d"];
let signature = hex!["bcae7d4f96f71cf974c173ae936a1a79083af7f76232efbf8a568b7f990eceed73c2465bba769de959b7f6ac5690162b61eb90949901464d0fa158a83022a0741c"];

#[cfg(test)]
let alice_id = hex!["2a00000000000000"];
#[cfg(test)]
let signature = hex!["5b2b46b0162f4b4431f154c4b9fc5ba923690b98b0c2063720799da54cb35a354304102ede62977ba556f0b03e67710522d4b7523547c62fcdc5acea59c99aa41b"];

let caller = T::AccountId::decode(&mut &alice_id[..]).unwrap_or_default();
let eth_address = EthereumAddress(hex!["8202c0af5962b750123ce1a9b12e1c30a4973557"]);
let signature = hex!["ef9816023122208983c11e596446874df3d400d2f9e380a831206d0e91bfb96d54db352fbd62d3cfa8d8674cf63e6a32052ef3cab038e1e7398eac3d048ed5181c"];
Claims::<T>::insert(eth_address, T::CurrencyBalance::from(1_000_000_000_000_000_000_u128));
}: _(RawOrigin::Signed(caller.clone()), EcdsaSignature(signature))
verify {
assert_eq!(T::Currency::free_balance(&caller), T::CurrencyBalance::from(2_152_921_504_606_846_975_u128).into());
#[cfg(test)]
assert_eq!(T::Currency::free_balance(&caller), T::CurrencyBalance::from(1_000_000_000_000_000_000_u128).into());
green-jay marked this conversation as resolved.
Show resolved Hide resolved
assert_eq!(Claims::<T>::get(eth_address), T::CurrencyBalance::from(0u128).into());
}
}

Expand Down