Skip to content

Commit

Permalink
Fix ADAR extrinsic fee (#726)
Browse files Browse the repository at this point in the history
* Fix ADAR extrinsic fee

* Optimize mul
  • Loading branch information
vovac12 authored Sep 15, 2023
1 parent f9b1a14 commit 8465c4b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -259,10 +259,10 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("sora-substrate"),
impl_name: create_runtime_str!("sora-substrate"),
authoring_version: 1,
spec_version: 61,
spec_version: 62,
impl_version: 1,
apis: RUNTIME_API_VERSIONS,
transaction_version: 61,
transaction_version: 62,
state_version: 0,
};

Expand Down
6 changes: 4 additions & 2 deletions runtime/src/xor_fee_impls.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use core::cmp::{Eq, PartialEq};
use pallet_utility::Call as UtilityCall;
use sp_runtime::traits::Zero;
use sp_runtime::DispatchResult;

use crate::*;
Expand Down Expand Up @@ -73,8 +74,9 @@ impl CustomFees {
swap_batches
.iter()
.map(|x| x.receivers.len() as Balance)
.sum::<Balance>()
* SMALL_FEE,
.fold(Balance::zero(), |acc, x| acc.saturating_add(x))
.saturating_mul(SMALL_FEE)
.max(SMALL_FEE),
),
RuntimeCall::Assets(assets::Call::register { .. })
| RuntimeCall::EthBridge(eth_bridge::Call::transfer_to_sidechain { .. })
Expand Down

0 comments on commit 8465c4b

Please sign in to comment.