Skip to content

Commit

Permalink
Remove duplicate balance deposit event from block author tx fees portion
Browse files Browse the repository at this point in the history
  • Loading branch information
bernardo-xxnet committed Jan 3, 2022
1 parent 5733619 commit b07d9f5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 15 deletions.
8 changes: 3 additions & 5 deletions runtime/phoenixx/src/impls.rs
Expand Up @@ -17,15 +17,13 @@

//! Some configurable implementations as associated type for the substrate runtime.

use frame_support::traits::{OnUnbalanced, Currency, Imbalance};
use crate::{Balances, Authorship, NegativeImbalance, Runtime};
use frame_support::traits::{OnUnbalanced, Currency};
use crate::{Balances, Authorship, NegativeImbalance};

pub struct Author;
impl OnUnbalanced<NegativeImbalance> for Author {
fn on_nonzero_unbalanced(amount: NegativeImbalance) {
let numeric_amount = amount.peek();
Balances::resolve_creating(&Authorship::author(), amount);
<frame_system::Pallet<Runtime>>::deposit_event(pallet_balances::Event::Deposit(Authorship::author(), numeric_amount))
Balances::resolve_creating(&Authorship::author(), amount)
}
}

Expand Down
8 changes: 3 additions & 5 deletions runtime/protonet/src/impls.rs
Expand Up @@ -17,15 +17,13 @@

//! Some configurable implementations as associated type for the substrate runtime.

use frame_support::traits::{OnUnbalanced, Currency, Imbalance};
use crate::{Balances, Authorship, NegativeImbalance, Runtime};
use frame_support::traits::{OnUnbalanced, Currency};
use crate::{Balances, Authorship, NegativeImbalance};

pub struct Author;
impl OnUnbalanced<NegativeImbalance> for Author {
fn on_nonzero_unbalanced(amount: NegativeImbalance) {
let numeric_amount = amount.peek();
Balances::resolve_creating(&Authorship::author(), amount);
<frame_system::Pallet<Runtime>>::deposit_event(pallet_balances::Event::Deposit(Authorship::author(), numeric_amount))
Balances::resolve_creating(&Authorship::author(), amount)
}
}

Expand Down
8 changes: 3 additions & 5 deletions runtime/xxnetwork/src/impls.rs
Expand Up @@ -17,15 +17,13 @@

//! Some configurable implementations as associated type for the substrate runtime.

use frame_support::traits::{OnUnbalanced, Currency, Imbalance};
use crate::{Balances, Authorship, NegativeImbalance, Runtime};
use frame_support::traits::{OnUnbalanced, Currency};
use crate::{Balances, Authorship, NegativeImbalance};

pub struct Author;
impl OnUnbalanced<NegativeImbalance> for Author {
fn on_nonzero_unbalanced(amount: NegativeImbalance) {
let numeric_amount = amount.peek();
Balances::resolve_creating(&Authorship::author(), amount);
<frame_system::Pallet<Runtime>>::deposit_event(pallet_balances::Event::Deposit(Authorship::author(), numeric_amount))
Balances::resolve_creating(&Authorship::author(), amount)
}
}

Expand Down

0 comments on commit b07d9f5

Please sign in to comment.