mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 17:31:05 +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:
@@ -14,11 +14,16 @@ targets = ["x86_64-unknown-linux-gnu"]
|
||||
|
||||
[dependencies]
|
||||
bitflags = "1.0"
|
||||
codec = { package = "parity-scale-codec", version = "2.2.0", default-features = false, features = ["derive", "max-encoded-len"] }
|
||||
codec = { package = "parity-scale-codec", version = "2.2.0", default-features = false, features = [
|
||||
"derive",
|
||||
"max-encoded-len",
|
||||
] }
|
||||
log = { version = "0.4", default-features = false }
|
||||
pwasm-utils = { version = "0.18", default-features = false }
|
||||
serde = { version = "1", optional = true, features = ["derive"] }
|
||||
smallvec = { version = "1", default-features = false, features = ["const_generics"] }
|
||||
smallvec = { version = "1", default-features = false, features = [
|
||||
"const_generics",
|
||||
] }
|
||||
wasmi-validation = { version = "0.4", default-features = false }
|
||||
|
||||
# Only used in benchmarking to generate random contract code
|
||||
@@ -40,7 +45,6 @@ sp-std = { version = "4.0.0-dev", default-features = false, path = "../../primit
|
||||
[dev-dependencies]
|
||||
assert_matches = "1"
|
||||
hex-literal = "0.3"
|
||||
paste = "1"
|
||||
pretty_assertions = "0.7"
|
||||
wat = "1"
|
||||
|
||||
|
||||
@@ -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