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

Commit

Permalink
fix tests where age was in ms instead of # of blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
goastler committed May 19, 2023
1 parent ed24130 commit 3891dbb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions contracts/captcha/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1612,7 +1612,7 @@ pub mod captcha {
set_caller(get_admin_account(0));
// now construct the contract instance
let mut contract =
Captcha::new_unguarded(STAKE_THRESHOLD, STAKE_THRESHOLD, 10, 1000000, 0, 1000);
Captcha::new_unguarded(STAKE_THRESHOLD, STAKE_THRESHOLD, 10, 255, 0, 1000);
// set the caller back to the unused acc
set_caller(get_unused_account());
// check the contract was created with the correct account
Expand All @@ -1630,7 +1630,7 @@ pub mod captcha {
212, 53, 147, 199, 21, 253, 211, 28, 97, 20, 26, 189, 4, 169, 159, 214, 130,
44, 133, 88, 133, 76, 205, 227, 154, 86, 132, 231, 165, 109, 162, 125,
]));
let contract = Captcha::new(STAKE_THRESHOLD, STAKE_THRESHOLD, 10, 1000000, 0, 1000);
let contract = Captcha::new(STAKE_THRESHOLD, STAKE_THRESHOLD, 10, 255, 0, 1000);
// should construct successfully
}

Expand All @@ -1642,7 +1642,7 @@ pub mod captcha {

// only able to instantiate from the alice account
set_caller(default_accounts().bob);
let contract = Captcha::new(STAKE_THRESHOLD, STAKE_THRESHOLD, 10, 1000000, 0, 1000);
let contract = Captcha::new(STAKE_THRESHOLD, STAKE_THRESHOLD, 10, 255, 0, 1000);
// should fail to construct and panic
}

Expand All @@ -1658,7 +1658,7 @@ pub mod captcha {
assert_eq!(contract.dapp_stake_threshold, STAKE_THRESHOLD);
assert_eq!(contract.admin, get_admin_account(0));
assert_eq!(contract.max_user_history_len, 10);
assert_eq!(contract.max_user_history_age, 10);
assert_eq!(contract.max_user_history_age, 255);
assert_eq!(contract.min_num_active_providers, 0);
assert_eq!(contract.max_provider_fee, 1000);

Expand Down

0 comments on commit 3891dbb

Please sign in to comment.