Skip to content

Commit

Permalink
fix: fee split between tresury and author and update chainID for main…
Browse files Browse the repository at this point in the history
…net (#166)

Signed-off-by: karanvir12 <[email protected]>
  • Loading branch information
karanvir12 authored Jun 27, 2024
1 parent b4e9a9c commit 3af8a3d
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 534 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion runtime/firechain-mainnet-runtime/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "firechain-mainnet-runtime"
version = "1.0.0"
version = "1.0.6"
authors = ["5ire Team <[email protected]>"]
description = "5ire chain Mainnet runtime"
edition = "2021"
Expand Down
21 changes: 9 additions & 12 deletions runtime/firechain-mainnet-runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
// and set impl_version to 0. If only runtime
// implementation changes and behavior does not, then leave spec_version as
// is and increment impl_version.
spec_version: 100,
spec_version: 106,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 2,
Expand All @@ -189,21 +189,18 @@ pub struct DealWithFees;
impl OnUnbalanced<NegativeImbalance> for DealWithFees {
fn on_unbalanceds<B>(mut fees_then_tips: impl Iterator<Item = NegativeImbalance>) {
if let Some(fees) = fees_then_tips.next() {
// for fees, 80% to treasury, 20% to author
let mut split = fees.ration(80, 20);
// for fees, 100% to treasury
let mut split = fees;
if let Some(tips) = fees_then_tips.next() {
// for tips, if any, 80% to treasury, 20% to author (though this can be anything)
tips.ration_merge_into(80, 20, &mut split);
// for tips, if any, 100% to treasury (though this can be anything)
tips.merge_into(&mut split);
}
Treasury::on_unbalanced(split.0);
Author::on_unbalanced(split.1);
Treasury::on_unbalanced(split);
}
}
fn on_nonzero_unbalanced(amount: NegativeImbalance) {
// for fees, 80% to treasury, 20% to author
let split = amount.ration(80, 20);
Treasury::on_unbalanced(split.0);
Author::on_unbalanced(split.1);
// for fees, 100% to treasury
Treasury::on_unbalanced(amount);
}
}

Expand Down Expand Up @@ -1634,7 +1631,7 @@ pub const GAS_PER_SECOND: u64 = 40_000_000;
pub const WEIGHT_PER_GAS: u64 = WEIGHT_REF_TIME_PER_SECOND / GAS_PER_SECOND;

parameter_types! {
pub const ChainId: u64 = 997;
pub const ChainId: u64 = 995;
pub BlockGasLimit: U256 = U256::from(NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT.ref_time()/ WEIGHT_PER_GAS);
pub const GasLimitPovSizeRatio: u64 = 4;
pub PrecompilesValue: FrontierPrecompiles<Runtime> = FrontierPrecompiles::<_>::new();
Expand Down
260 changes: 0 additions & 260 deletions specs/5ire-mainnet-chain-spec-raw.json

This file was deleted.

260 changes: 0 additions & 260 deletions specs/5ire-mainnet-chain-spec.json

This file was deleted.

0 comments on commit 3af8a3d

Please sign in to comment.