-
Notifications
You must be signed in to change notification settings - Fork 6
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
game sc tests #31
game sc tests #31
Conversation
Contract comparison - from 428c8db to d1d9f14
|
contracts/mvx-game-sc/src/owner.rs
Outdated
@@ -35,7 +35,7 @@ pub trait OwnerModule: crate::private::PrivateModule + crate::storage::StorageMo | |||
|
|||
for (winner, percentage) in val.into_iter() { | |||
let reward_per_winner = | |||
&BigUint::from(percentage) * &total_wager / &BigUint::from(100u64); | |||
&BigUint::from(percentage) * &total_wager / &BigUint::from(10000u64); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rust accepts _
character in integers, so best practice are:
10_000u64
- declare a constant with an intuitive name
.put_account( | ||
USER3_ADDR, | ||
Account::new() | ||
.nonce(4) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Starting nonces should be 1
for each account so you can more easily compute nonces with executed transactions.
caller: &str, | ||
game_sc: &mut ContractInfo<mvx_game_sc::Proxy<StaticApi>>, | ||
) -> &mut Self { | ||
self.world.sc_call( | ||
ScCallStep::new() | ||
.from(caller) | ||
.to(GAME_SC_ADDR) | ||
.esdt_transfer(TOKEN_ID, 0u64, BigUint::from(STARTING_FEE)) | ||
.esdt_transfer(TOKEN_ID, 0u64, BigUint::<StaticApi>::from(STARTING_FEE)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thinkg BigUint::from(STARTING_FEE)
should be enough. Check for the imported BigUint (because there are 2).
You should use multiversx_sc_scenario::num_bigint::BigUint
.
No description provided.