Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transaction fee paid fix #1479

Merged
merged 4 commits into from
Jun 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 4 additions & 14 deletions pallets/runtime/develop/src/runtime.rs
Expand Up @@ -4,10 +4,7 @@ use crate::constants::time::*;
use codec::Encode;
use core::convert::TryFrom;
use frame_support::{
construct_runtime,
dispatch::DispatchResult,
parameter_types,
traits::{tokens::imbalance::SplitTwoWays, KeyOwnerProofSystem},
construct_runtime, dispatch::DispatchResult, parameter_types, traits::KeyOwnerProofSystem,
weights::Weight,
};
use pallet_asset::checkpoint as pallet_checkpoint;
Expand All @@ -24,7 +21,7 @@ use polymesh_runtime_common::{
impls::Author,
merge_active_and_inactive,
runtime::{GovernanceCommittee, BENCHMARK_MAX_INCREASE, VMO},
AvailableBlockRatio, MaximumBlockWeight, NegativeImbalance,
AvailableBlockRatio, MaximumBlockWeight,
};
use sp_runtime::transaction_validity::TransactionPriority;
use sp_runtime::{
Expand Down Expand Up @@ -143,15 +140,8 @@ parameter_types! {
pub const MaxNumberOfNFTsMoves: u32 = 100;
}

/// Splits fees 80/20 between treasury and block author.
pub type DealWithFees = SplitTwoWays<
Balance,
NegativeImbalance<Runtime>,
Treasury, // 4 parts (80%) goes to the treasury.
Author<Runtime>, // 1 part (20%) goes to the block author.
4,
1,
>;
/// 100% goes to the block author.
pub type DealWithFees = Author<Runtime>;

// Staking:
pallet_staking_reward_curve::build! {
Expand Down
17 changes: 4 additions & 13 deletions pallets/runtime/mainnet/src/runtime.rs
Expand Up @@ -3,9 +3,7 @@
use crate::constants::time::*;
use codec::Encode;
use frame_support::{
construct_runtime, parameter_types,
traits::{tokens::imbalance::SplitTwoWays, KeyOwnerProofSystem},
weights::Weight,
construct_runtime, parameter_types, traits::KeyOwnerProofSystem, weights::Weight,
};
use pallet_asset::checkpoint as pallet_checkpoint;
use pallet_corporate_actions::ballot as pallet_corporate_ballot;
Expand All @@ -21,7 +19,7 @@ use polymesh_runtime_common::{
impls::Author,
merge_active_and_inactive,
runtime::{GovernanceCommittee, BENCHMARK_MAX_INCREASE, VMO},
AvailableBlockRatio, MaximumBlockWeight, NegativeImbalance,
AvailableBlockRatio, MaximumBlockWeight,
};
use sp_runtime::transaction_validity::TransactionPriority;
use sp_runtime::{
Expand Down Expand Up @@ -140,15 +138,8 @@ parameter_types! {
pub const MaxNumberOfNFTsMoves: u32 = 100;
}

/// Splits fees 80/20 between treasury and block author.
pub type DealWithFees = SplitTwoWays<
Balance,
NegativeImbalance<Runtime>,
Treasury, // 4 parts (80%) goes to the treasury.
Author<Runtime>, // 1 part (20%) goes to the block author.
4,
1,
>;
/// 100% goes to the block author.
pub type DealWithFees = Author<Runtime>;

// Staking:
pallet_staking_reward_curve::build! {
Expand Down
17 changes: 4 additions & 13 deletions pallets/runtime/testnet/src/runtime.rs
Expand Up @@ -8,9 +8,7 @@ use frame_support::traits::OnRuntimeUpgrade;

use core::convert::TryFrom;
use frame_support::{
construct_runtime, parameter_types,
traits::{tokens::imbalance::SplitTwoWays, KeyOwnerProofSystem},
weights::Weight,
construct_runtime, parameter_types, traits::KeyOwnerProofSystem, weights::Weight,
};
use pallet_asset::checkpoint as pallet_checkpoint;
use pallet_corporate_actions::ballot as pallet_corporate_ballot;
Expand All @@ -26,7 +24,7 @@ use polymesh_runtime_common::{
impls::Author,
merge_active_and_inactive,
runtime::{GovernanceCommittee, BENCHMARK_MAX_INCREASE, VMO},
AvailableBlockRatio, MaximumBlockWeight, NegativeImbalance,
AvailableBlockRatio, MaximumBlockWeight,
};
use sp_runtime::transaction_validity::TransactionPriority;
use sp_runtime::{
Expand Down Expand Up @@ -146,15 +144,8 @@ parameter_types! {
pub const MaxNumberOfNFTsMoves: u32 = 100;
}

/// Splits fees 80/20 between treasury and block author.
pub type DealWithFees = SplitTwoWays<
Balance,
NegativeImbalance<Runtime>,
Treasury, // 4 parts (80%) goes to the treasury.
Author<Runtime>, // 1 part (20%) goes to the block author.
4,
1,
>;
/// 100% goes to the block author.
pub type DealWithFees = Author<Runtime>;

// Staking:
pallet_staking_reward_curve::build! {
Expand Down
2 changes: 1 addition & 1 deletion pallets/transaction-payment/src/lib.rs
Expand Up @@ -854,7 +854,7 @@ where
&fee_key, info, post_info, actual_fee, tip, imbalance,
)?;
Module::<T>::deposit_event(Event::<T>::TransactionFeePaid {
who,
who: fee_key,
actual_fee,
tip,
});
Expand Down