mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 02:17:58 +00:00
depend-o-pocalipse (#9450)
Remove unneeded dependencies and dev-dependencies. Made self_destruct test not dependent on wasm bin size. Updated code related to deprecated warning on tracing-subscriber `scope()` ( See https://github.com/tokio-rs/tracing/issues/1429 )
This commit is contained in:
@@ -1644,10 +1644,28 @@ fn self_destruct_works() {
|
||||
|
||||
// The call triggers rent collection that reduces the amount of balance
|
||||
// that remains for the beneficiary.
|
||||
let balance_after_rent = 93_086;
|
||||
let mut events = System::events();
|
||||
let balance_after_rent = 99_000;
|
||||
|
||||
// The actual figure will bounce about with wasm compiler updates as the rent depends on
|
||||
// the compiled wasm size, so we replace it with a fixed value
|
||||
// as rent isn't what we're testing for in this test.
|
||||
let mut actual_balance_after_rent = 99_000;
|
||||
if let Event::Balances(pallet_balances::Event::Transfer(_, _, ref mut actual_bal)) =
|
||||
&mut events[1].event
|
||||
{
|
||||
std::mem::swap(&mut actual_balance_after_rent, actual_bal);
|
||||
assert!(
|
||||
(90_000..99_000).contains(&actual_balance_after_rent),
|
||||
"expected less than 100_000: {}",
|
||||
actual_balance_after_rent
|
||||
);
|
||||
} else {
|
||||
assert!(false);
|
||||
}
|
||||
|
||||
pretty_assertions::assert_eq!(
|
||||
System::events(),
|
||||
events,
|
||||
vec![
|
||||
EventRecord {
|
||||
phase: Phase::Initialization,
|
||||
@@ -1673,7 +1691,7 @@ fn self_destruct_works() {
|
||||
event: Event::Contracts(crate::Event::Terminated(addr.clone(), DJANGO)),
|
||||
topics: vec![],
|
||||
},
|
||||
]
|
||||
],
|
||||
);
|
||||
|
||||
// Check that account is gone
|
||||
@@ -1681,7 +1699,7 @@ fn self_destruct_works() {
|
||||
|
||||
// check that the beneficiary (django) got remaining balance
|
||||
// some rent was deducted before termination
|
||||
assert_eq!(Balances::free_balance(DJANGO), 1_000_000 + balance_after_rent);
|
||||
assert_eq!(Balances::free_balance(DJANGO), 1_000_000 + actual_balance_after_rent);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user