Add Deposit and Withdraw Events to Balances Pallet (#9425)

* add Deposit and Withdraw events to balances

+ add deposit_event() calls where appropriate to signal fund movement
+ adjust and extend tests

* line length

* move events to the end to avoid changing indices

* bump spec_version

* cargo fmt

* adjust block import bench to new event count

* fix node executor tests

* adjust import bench comment

* fix typo and formatting

* adjust event number

* fix copy pasta

* fix contracts pallets tests

* cargo fmt

* WIP fix events in tests

* fix offences tests

* fix tests

* cargo +nightly fmt

* fix contracts pallets tests

* cargo +nightly fmt

* fix offences tests

* formatting and compile fixes

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
This commit is contained in:
Alexander Popiak
2021-10-11 16:23:10 +02:00
committed by GitHub
parent 19a656e156
commit 32900294ba
9 changed files with 217 additions and 75 deletions
@@ -385,6 +385,11 @@ fn full_native_block_import_works() {
})),
topics: vec![],
},
EventRecord {
phase: Phase::ApplyExtrinsic(1),
event: Event::Balances(pallet_balances::Event::Withdraw(alice().into(), fees)),
topics: vec![],
},
EventRecord {
phase: Phase::ApplyExtrinsic(1),
event: Event::Balances(pallet_balances::Event::Transfer(
@@ -394,6 +399,14 @@ fn full_native_block_import_works() {
)),
topics: vec![],
},
EventRecord {
phase: Phase::ApplyExtrinsic(1),
event: Event::Balances(pallet_balances::Event::Deposit(
pallet_treasury::Pallet::<Runtime>::account_id(),
fees * 8 / 10,
)),
topics: vec![],
},
EventRecord {
phase: Phase::ApplyExtrinsic(1),
event: Event::Treasury(pallet_treasury::Event::Deposit(fees * 8 / 10)),
@@ -439,6 +452,11 @@ fn full_native_block_import_works() {
})),
topics: vec![],
},
EventRecord {
phase: Phase::ApplyExtrinsic(1),
event: Event::Balances(pallet_balances::Event::Withdraw(bob().into(), fees)),
topics: vec![],
},
EventRecord {
phase: Phase::ApplyExtrinsic(1),
event: Event::Balances(pallet_balances::Event::Transfer(
@@ -448,6 +466,14 @@ fn full_native_block_import_works() {
)),
topics: vec![],
},
EventRecord {
phase: Phase::ApplyExtrinsic(1),
event: Event::Balances(pallet_balances::Event::Deposit(
pallet_treasury::Pallet::<Runtime>::account_id(),
fees * 8 / 10,
)),
topics: vec![],
},
EventRecord {
phase: Phase::ApplyExtrinsic(1),
event: Event::Treasury(pallet_treasury::Event::Deposit(fees * 8 / 10)),
@@ -461,6 +487,11 @@ fn full_native_block_import_works() {
})),
topics: vec![],
},
EventRecord {
phase: Phase::ApplyExtrinsic(2),
event: Event::Balances(pallet_balances::Event::Withdraw(alice().into(), fees)),
topics: vec![],
},
EventRecord {
phase: Phase::ApplyExtrinsic(2),
event: Event::Balances(pallet_balances::Event::Transfer(
@@ -470,6 +501,14 @@ fn full_native_block_import_works() {
)),
topics: vec![],
},
EventRecord {
phase: Phase::ApplyExtrinsic(2),
event: Event::Balances(pallet_balances::Event::Deposit(
pallet_treasury::Pallet::<Runtime>::account_id(),
fees * 8 / 10,
)),
topics: vec![],
},
EventRecord {
phase: Phase::ApplyExtrinsic(2),
event: Event::Treasury(pallet_treasury::Event::Deposit(fees * 8 / 10)),