Skip to content

Commit

Permalink
fix rust-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
noandrea committed Jul 24, 2024
1 parent 5037f6f commit 9f5b31c
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 62 deletions.
48 changes: 24 additions & 24 deletions runtime/moonbase/tests/integration_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1072,7 +1072,7 @@ fn is_contributor_via_precompile() {
contributor: Address(BOB.into()),
},
)
.expect_cost(1000)
.expect_cost(1669)
.expect_no_logs()
.execute_returns(false);

Expand All @@ -1085,7 +1085,7 @@ fn is_contributor_via_precompile() {
contributor: Address(CHARLIE.into()),
},
)
.expect_cost(1000)
.expect_cost(1669)
.expect_no_logs()
.execute_returns(true);
})
Expand Down Expand Up @@ -1156,7 +1156,7 @@ fn reward_info_via_precompile() {
contributor: Address(AccountId::from(CHARLIE).into()),
},
)
.expect_cost(1000)
.expect_cost(1669)
.expect_no_logs()
.execute_returns((expected_total, expected_claimed));
})
Expand Down Expand Up @@ -1309,7 +1309,7 @@ fn xcm_asset_erc20_precompiles_supply_and_balance() {
asset_precompile_address,
ForeignAssetsPCall::total_supply {},
)
.expect_cost(2000)
.expect_cost(3338)
.expect_no_logs()
.execute_returns(U256::from(1000 * UNIT));

Expand All @@ -1322,7 +1322,7 @@ fn xcm_asset_erc20_precompiles_supply_and_balance() {
who: Address(ALICE.into()),
},
)
.expect_cost(2000)
.expect_cost(3338)
.expect_no_logs()
.execute_returns(U256::from(1000 * UNIT));
});
Expand Down Expand Up @@ -1367,7 +1367,7 @@ fn xcm_asset_erc20_precompiles_transfer() {
value: { 400 * UNIT }.into(),
},
)
.expect_cost(24342)
.expect_cost(24695)
.expect_log(log3(
asset_precompile_address,
SELECTOR_LOG_TRANSFER,
Expand All @@ -1386,7 +1386,7 @@ fn xcm_asset_erc20_precompiles_transfer() {
who: Address(BOB.into()),
},
)
.expect_cost(2000)
.expect_cost(3338)
.expect_no_logs()
.execute_returns(U256::from(400 * UNIT));
});
Expand Down Expand Up @@ -1431,7 +1431,7 @@ fn xcm_asset_erc20_precompiles_approve() {
value: { 400 * UNIT }.into(),
},
)
.expect_cost(14424)
.expect_cost(15604)
.expect_log(log3(
asset_precompile_address,
SELECTOR_LOG_APPROVAL,
Expand All @@ -1452,7 +1452,7 @@ fn xcm_asset_erc20_precompiles_approve() {
value: { 400 * UNIT }.into(),
},
)
.expect_cost(29686)
.expect_cost(29960)
.expect_log(log3(
asset_precompile_address,
SELECTOR_LOG_TRANSFER,
Expand All @@ -1471,7 +1471,7 @@ fn xcm_asset_erc20_precompiles_approve() {
who: Address(CHARLIE.into()),
},
)
.expect_cost(2000)
.expect_cost(3338)
.expect_no_logs()
.execute_returns(U256::from(400 * UNIT));
});
Expand Down Expand Up @@ -1530,7 +1530,7 @@ fn xtokens_precompiles_transfer() {
weight: 4_000_000,
},
)
.expect_cost(57639)
.expect_cost(59490)
.expect_no_logs()
.execute_returns(())
})
Expand Down Expand Up @@ -1582,7 +1582,7 @@ fn xtokens_precompiles_transfer_multiasset() {
weight: 4_000_000,
},
)
.expect_cost(57639)
.expect_cost(59490)
.expect_no_logs()
.execute_returns(());
})
Expand Down Expand Up @@ -1750,7 +1750,7 @@ fn initial_gas_fee_is_correct() {
TransactionPaymentAsGasPrice::min_gas_price(),
(
10_000_000_000u128.into(),
Weight::from_parts(25_000_000u64, 0)
Weight::from_parts(41_742_000u64, 0)
)
);
});
Expand Down Expand Up @@ -2171,7 +2171,7 @@ fn transact_through_signed_precompile_works_v1() {
call: bytes.into(),
},
)
.expect_cost(17555)
.expect_cost(21415)
.expect_no_logs()
.execute_returns(());
});
Expand Down Expand Up @@ -2211,7 +2211,7 @@ fn transact_through_signed_precompile_works_v2() {
overall_weight: total_weight,
},
)
.expect_cost(17555)
.expect_cost(21415)
.expect_no_logs()
.execute_returns(());
});
Expand Down Expand Up @@ -2293,7 +2293,7 @@ fn author_mapping_precompile_associate_update_and_clear() {
nimbus_id: [1u8; 32].into(),
},
)
.expect_cost(15126)
.expect_cost(14219)
.expect_no_logs()
.execute_returns(());

Expand All @@ -2315,7 +2315,7 @@ fn author_mapping_precompile_associate_update_and_clear() {
new_nimbus_id: [2u8; 32].into(),
},
)
.expect_cost(14728)
.expect_cost(13821)
.expect_no_logs()
.execute_returns(());

Expand All @@ -2336,7 +2336,7 @@ fn author_mapping_precompile_associate_update_and_clear() {
nimbus_id: [2u8; 32].into(),
},
)
.expect_cost(15189)
.expect_cost(14282)
.expect_no_logs()
.execute_returns(());

Expand Down Expand Up @@ -2379,7 +2379,7 @@ fn author_mapping_register_and_set_keys() {
.into(),
},
)
.expect_cost(16262)
.expect_cost(16025)
.expect_no_logs()
.execute_returns(());

Expand All @@ -2404,7 +2404,7 @@ fn author_mapping_register_and_set_keys() {
.into(),
},
)
.expect_cost(16262)
.expect_cost(16025)
.expect_no_logs()
.execute_returns(());

Expand Down Expand Up @@ -2435,7 +2435,7 @@ fn test_xcm_utils_ml_tp_account() {
location: Location::parent(),
},
)
.expect_cost(1000)
.expect_cost(1669)
.expect_no_logs()
.execute_returns(Address(expected_address_parent));

Expand All @@ -2455,7 +2455,7 @@ fn test_xcm_utils_ml_tp_account() {
location: parachain_2000_multilocation,
},
)
.expect_cost(1000)
.expect_cost(1669)
.expect_no_logs()
.execute_returns(Address(expected_address_parachain));

Expand Down Expand Up @@ -2485,7 +2485,7 @@ fn test_xcm_utils_ml_tp_account() {
location: alice_in_parachain_2000_multilocation,
},
)
.expect_cost(1000)
.expect_cost(1669)
.expect_no_logs()
.execute_returns(Address(expected_address_alice_in_parachain_2000));
});
Expand Down Expand Up @@ -2525,7 +2525,7 @@ fn test_xcm_utils_get_units_per_second() {

Precompiles::new()
.prepare_test(ALICE, xcm_utils_precompile_address, input)
.expect_cost(1000)
.expect_cost(1669)
.expect_no_logs()
.execute_returns(expected_units);
});
Expand Down
38 changes: 19 additions & 19 deletions runtime/moonbeam/tests/integration_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1101,7 +1101,7 @@ fn is_contributor_via_precompile() {
contributor: Address(AccountId::from(BOB).into()),
},
)
.expect_cost(1000)
.expect_cost(1669)
.expect_no_logs()
.execute_returns(false);

Expand All @@ -1114,7 +1114,7 @@ fn is_contributor_via_precompile() {
contributor: Address(AccountId::from(CHARLIE).into()),
},
)
.expect_cost(1000)
.expect_cost(1669)
.expect_no_logs()
.execute_returns(true);
})
Expand Down Expand Up @@ -1186,7 +1186,7 @@ fn reward_info_via_precompile() {
contributor: Address(AccountId::from(CHARLIE).into()),
},
)
.expect_cost(1000)
.expect_cost(1669)
.expect_no_logs()
.execute_returns((expected_total, expected_claimed));
})
Expand Down Expand Up @@ -1379,7 +1379,7 @@ fn initial_gas_fee_is_correct() {
TransactionPaymentAsGasPrice::min_gas_price(),
(
125_000_000_000u128.into(),
Weight::from_parts(25_000_000u64, 0)
Weight::from_parts(41_742_000u64, 0)
)
);
});
Expand All @@ -1401,7 +1401,7 @@ fn min_gas_fee_is_correct() {
TransactionPaymentAsGasPrice::min_gas_price(),
(
125_000_000_000u128.into(),
Weight::from_parts(25_000_000u64, 0)
Weight::from_parts(41_742_000u64, 0)
)
);
});
Expand Down Expand Up @@ -1721,7 +1721,7 @@ fn xcm_asset_erc20_precompiles_supply_and_balance() {
asset_precompile_address,
ForeignAssetsPCall::total_supply {},
)
.expect_cost(2000)
.expect_cost(3338)
.expect_no_logs()
.execute_returns(U256::from(1000 * GLMR));

Expand All @@ -1734,7 +1734,7 @@ fn xcm_asset_erc20_precompiles_supply_and_balance() {
who: Address(ALICE.into()),
},
)
.expect_cost(2000)
.expect_cost(3338)
.expect_no_logs()
.execute_returns(U256::from(1000 * GLMR));
});
Expand Down Expand Up @@ -1780,7 +1780,7 @@ fn xcm_asset_erc20_precompiles_transfer() {
value: { 400 * GLMR }.into(),
},
)
.expect_cost(24342)
.expect_cost(24695)
.expect_log(log3(
asset_precompile_address,
SELECTOR_LOG_TRANSFER,
Expand All @@ -1799,7 +1799,7 @@ fn xcm_asset_erc20_precompiles_transfer() {
who: Address(BOB.into()),
},
)
.expect_cost(2000)
.expect_cost(3338)
.expect_no_logs()
.execute_returns(U256::from(400 * GLMR));
});
Expand Down Expand Up @@ -1845,7 +1845,7 @@ fn xcm_asset_erc20_precompiles_approve() {
value: { 400 * GLMR }.into(),
},
)
.expect_cost(14424)
.expect_cost(15604)
.expect_log(log3(
asset_precompile_address,
SELECTOR_LOG_APPROVAL,
Expand All @@ -1866,7 +1866,7 @@ fn xcm_asset_erc20_precompiles_approve() {
value: { 400 * GLMR }.into(),
},
)
.expect_cost(29686)
.expect_cost(29960)
.expect_log(log3(
asset_precompile_address,
SELECTOR_LOG_TRANSFER,
Expand All @@ -1885,7 +1885,7 @@ fn xcm_asset_erc20_precompiles_approve() {
who: Address(CHARLIE.into()),
},
)
.expect_cost(2000)
.expect_cost(3338)
.expect_no_logs()
.execute_returns(U256::from(400 * GLMR));
});
Expand Down Expand Up @@ -1945,7 +1945,7 @@ fn xtokens_precompile_transfer() {
weight: 4_000_000,
},
)
.expect_cost(57639)
.expect_cost(59490)
.expect_no_logs()
.execute_returns(())
})
Expand Down Expand Up @@ -1997,7 +1997,7 @@ fn xtokens_precompile_transfer_multiasset() {
weight: 4_000_000,
},
)
.expect_cost(57639)
.expect_cost(59490)
.expect_no_logs()
.execute_returns(());
})
Expand Down Expand Up @@ -2148,7 +2148,7 @@ fn transact_through_signed_precompile_works_v2() {
overall_weight: total_weight,
},
)
.expect_cost(17555)
.expect_cost(21415)
.expect_no_logs()
.execute_returns(());
});
Expand Down Expand Up @@ -2354,7 +2354,7 @@ fn test_xcm_utils_ml_tp_account() {
location: Location::parent(),
},
)
.expect_cost(1000)
.expect_cost(1669)
.expect_no_logs()
.execute_returns(Address(expected_address_parent));

Expand All @@ -2374,7 +2374,7 @@ fn test_xcm_utils_ml_tp_account() {
location: parachain_2000_location,
},
)
.expect_cost(1000)
.expect_cost(1669)
.expect_no_logs()
.execute_returns(Address(expected_address_parachain));

Expand Down Expand Up @@ -2404,7 +2404,7 @@ fn test_xcm_utils_ml_tp_account() {
location: alice_in_parachain_2000_location,
},
)
.expect_cost(1000)
.expect_cost(1669)
.expect_no_logs()
.execute_returns(Address(expected_address_alice_in_parachain_2000));
});
Expand Down Expand Up @@ -2444,7 +2444,7 @@ fn test_xcm_utils_get_units_per_second() {

Precompiles::new()
.prepare_test(ALICE, xcm_utils_precompile_address, input)
.expect_cost(1000)
.expect_cost(1669)
.expect_no_logs()
.execute_returns(expected_units);
});
Expand Down
Loading

0 comments on commit 9f5b31c

Please sign in to comment.