Emit Bonded event when rebonding (#9040)

* Emit `Bonded` event when rebonding

* fix borrow checker

* cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_staking --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/staking/src/weights.rs --template=./.maintain/frame-weight-template.hbs

Co-authored-by: Parity Bot <admin@parity.io>
This commit is contained in:
Shawn Tabrizi
2021-06-08 10:02:57 -04:00
committed by GitHub
parent a4bfd40a1b
commit 28bfba142e
2 changed files with 110 additions and 109 deletions
+1
View File
@@ -1820,6 +1820,7 @@ decl_module! {
// last check: the new active amount of ledger must be more than ED.
ensure!(ledger.active >= T::Currency::minimum_balance(), Error::<T>::InsufficientValue);
Self::deposit_event(RawEvent::Bonded(ledger.stash.clone(), value));
Self::update_ledger(&controller, &ledger);
Ok(Some(
35 * WEIGHT_PER_MICROS