Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Prev Previous commit
Next Next commit
Merge branch 'master' into ser-contract-polish-runtime
  • Loading branch information
gavofyork authored Sep 1, 2018
commit 7c3e888950480aa5ec3a35295f01b37f6a16e2e6
14 changes: 7 additions & 7 deletions substrate/runtime/contract/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,9 @@ fn contract_transfer_oog() {
);

// Transaction level transfer should succeed.
assert_eq!(Staking::free_balance(&1), 14);
assert_eq!(Balances::free_balance(&1), 14);
// But `ext_call` should not.
assert_eq!(Staking::free_balance(&CONTRACT_SHOULD_TRANSFER_TO), 0);
assert_eq!(Balances::free_balance(&CONTRACT_SHOULD_TRANSFER_TO), 0);
});
}

Expand Down Expand Up @@ -250,7 +250,7 @@ fn contract_transfer_max_depth() {
// 2 * 135 * 100 - base gas fee for call (by transaction) multiplied by max depth (100).
100_000_000 - 3 - (2 * 10 * 100) - (2 * 135 * 100),
);
assert_eq!(Staking::free_balance(&CONTRACT_SHOULD_TRANSFER_TO), 14);
assert_eq!(Balances::free_balance(&CONTRACT_SHOULD_TRANSFER_TO), 14);
});
}

Expand Down Expand Up @@ -366,9 +366,9 @@ fn contract_create() {
// ((21 / 2) * 2) - price per account creation
let expected_gas_after_create =
100_000_000 - 11 - (2 * 139) - (2 * 135) - (2 * 175) - ((21 / 2) * 2);
assert_eq!(Staking::free_balance(&0), expected_gas_after_create);
assert_eq!(Staking::free_balance(&1), 8);
assert_eq!(Staking::free_balance(&derived_address), 3);
assert_eq!(Balances::free_balance(&0), expected_gas_after_create);
assert_eq!(Balances::free_balance(&1), 8);
assert_eq!(Balances::free_balance(&derived_address), 3);

// Initiate transfer to the newly created contract.
assert_ok!(Contract::call(&0, derived_address, 22, 100_000, Vec::new()));
Expand Down Expand Up @@ -415,7 +415,7 @@ fn top_level_create() {
// (3 * 175) - base gas fee for create (175) (top level) multipled by gas price (3)
// ((21 / 3) * 3) - price for contract creation
assert_eq!(
Staking::free_balance(&0),
Balances::free_balance(&0),
100_000_000 - 11 - (3 * 129) - (3 * 175) - ((21 / 3) * 3)
);
assert_eq!(Balances::free_balance(&derived_address), 30 + 11);
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.