Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
add u32 type annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
drahnr committed Oct 26, 2020
1 parent 4d93bfb commit 09ce053
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions runtime/common/src/claims.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1184,15 +1184,15 @@ mod benchmarking {
fn create_claim<T: Trait>(input: u32) -> DispatchResult {
let secret_key = secp256k1::SecretKey::parse(&keccak_256(&input.encode())).unwrap();
let eth_address = eth(&secret_key);
let vesting = Some((100_000.into(), 1_000.into(), 100.into()));
let vesting = Some((100_000u32.into(), 1_000u32.into(), 100u32.into()));
super::Module::<T>::mint_claim(RawOrigin::Root.into(), eth_address, VALUE.into(), vesting, None)?;
Ok(())
}

fn create_claim_attest<T: Trait>(input: u32) -> DispatchResult {
let secret_key = secp256k1::SecretKey::parse(&keccak_256(&input.encode())).unwrap();
let eth_address = eth(&secret_key);
let vesting = Some((100_000.into(), 1_000.into(), 100.into()));
let vesting = Some((100_000u32.into(), 1_000u32.into(), 100u32.into()));
super::Module::<T>::mint_claim(
RawOrigin::Root.into(),
eth_address,
Expand All @@ -1218,7 +1218,7 @@ mod benchmarking {
let secret_key = secp256k1::SecretKey::parse(&keccak_256(&u.encode())).unwrap();
let eth_address = eth(&secret_key);
let account: T::AccountId = account("user", u, SEED);
let vesting = Some((100_000.into(), 1_000.into(), 100.into()));
let vesting = Some((100_000u32.into(), 1_000u32.into(), 100u32.into()));
let signature = sig::<T>(&secret_key, &account.encode(), &[][..]);
super::Module::<T>::mint_claim(RawOrigin::Root.into(), eth_address, VALUE.into(), vesting, None)?;
assert_eq!(Claims::<T>::get(eth_address), Some(VALUE.into()));
Expand All @@ -1231,7 +1231,7 @@ mod benchmarking {
mint_claim {
let c in ...;
let eth_address = account("eth_address", c, SEED);
let vesting = Some((100_000.into(), 1_000.into(), 100.into()));
let vesting = Some((100_000u32.into(), 1_000u32.into(), 100u32.into()));
let statement = StatementKind::Regular;
}: _(RawOrigin::Root, eth_address, VALUE.into(), vesting, Some(statement))
verify {
Expand Down Expand Up @@ -1262,7 +1262,7 @@ mod benchmarking {
let secret_key = secp256k1::SecretKey::parse(&keccak_256(&attest_u.encode())).unwrap();
let eth_address = eth(&secret_key);
let account: T::AccountId = account("user", u, SEED);
let vesting = Some((100_000.into(), 1_000.into(), 100.into()));
let vesting = Some((100_000u32.into(), 1_000u32.into(), 100u32.into()));
let statement = StatementKind::Regular;
let signature = sig::<T>(&secret_key, &account.encode(), statement.to_text());
super::Module::<T>::mint_claim(RawOrigin::Root.into(), eth_address, VALUE.into(), vesting, Some(statement))?;
Expand Down

0 comments on commit 09ce053

Please sign in to comment.