Skip to content

Commit

Permalink
PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
PierreOssun committed Nov 13, 2023
1 parent 49eb2a5 commit a1132af
Show file tree
Hide file tree
Showing 13 changed files with 26 additions and 41 deletions.
10 changes: 5 additions & 5 deletions 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 bin/collator/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "astar-collator"
version = "5.25.0"
version = "5.24.0"
description = "Astar collator implementation in Rust."
build = "build.rs"
default-run = "astar-collator"
Expand Down
6 changes: 3 additions & 3 deletions bin/collator/src/local/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
//! Chain specifications.
use local_runtime::{
wasm_binary_unwrap, AccountId, AuraConfig, AuraId, BalancesConfig, BlockRewardConfig, RewardDistributionConfig,
wasm_binary_unwrap, AccountId, AuraConfig, AuraId, BalancesConfig, BlockRewardConfig,
CouncilConfig, DemocracyConfig, EVMConfig, GenesisConfig, GrandpaConfig, GrandpaId,
Precompiles, Signature, SudoConfig, SystemConfig, TechnicalCommitteeConfig, TreasuryConfig,
VestingConfig,
Precompiles, RewardDistributionConfig, Signature, SudoConfig, SystemConfig,
TechnicalCommitteeConfig, TreasuryConfig, VestingConfig,
};
use sc_service::ChainType;
use sp_core::{crypto::Ss58Codec, sr25519, Pair, Public};
Expand Down
7 changes: 4 additions & 3 deletions bin/collator/src/parachain/chain_spec/shibuya.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@
use cumulus_primitives_core::ParaId;
use sc_service::ChainType;
use shibuya_runtime::{
wasm_binary_unwrap, AccountId, AuraConfig, AuraId, Balance, BalancesConfig, BlockRewardConfig, RewardDistributionConfig,
wasm_binary_unwrap, AccountId, AuraConfig, AuraId, Balance, BalancesConfig, BlockRewardConfig,
CollatorSelectionConfig, CouncilConfig, DemocracyConfig, EVMChainIdConfig, EVMConfig,
GenesisConfig, ParachainInfoConfig, Precompiles, SessionConfig, SessionKeys, Signature,
SudoConfig, SystemConfig, TechnicalCommitteeConfig, TreasuryConfig, VestingConfig, SBY,
GenesisConfig, ParachainInfoConfig, Precompiles, RewardDistributionConfig, SessionConfig,
SessionKeys, Signature, SudoConfig, SystemConfig, TechnicalCommitteeConfig, TreasuryConfig,
VestingConfig, SBY,
};
use sp_core::{sr25519, Pair, Public};

Expand Down
3 changes: 2 additions & 1 deletion pallets/block-rewards-hybrid/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ pub mod pallet {
collators_reward,
}
}

/// Distribute reward between beneficiaries.
///
/// # Arguments
Expand Down Expand Up @@ -348,7 +349,7 @@ impl RewardDistributionConfig {
/// Represents rewards distribution balances for each beneficiary
#[derive(PartialEq, Eq, Clone, Encode, Decode, RuntimeDebug, TypeInfo, MaxEncodedLen)]
#[cfg_attr(feature = "std", derive(serde::Serialize, serde::Deserialize))]
struct Rewards {
pub struct Rewards {
treasury_reward: Balance,
staker_reward: Balance,
dapps_reward: Balance,
Expand Down
25 changes: 4 additions & 21 deletions pallets/block-rewards-hybrid/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ impl FreeBalanceSnapshot {
post_reward_state.treasury
);
assert_eq!(
self.stakers + rewards.base_staker_reward + rewards.adjustable_staker_reward,
self.stakers + rewards.staker_reward,
post_reward_state.stakers
);
assert_eq!(
Expand All @@ -399,16 +399,6 @@ impl FreeBalanceSnapshot {
}
}

/// Represents reward distribution balances for a single distribution.
#[derive(PartialEq, Eq, Clone, RuntimeDebug)]
struct Rewards {
treasury_reward: Balance,
base_staker_reward: Balance,
dapps_reward: Balance,
collators_reward: Balance,
adjustable_staker_reward: Balance,
}

impl Rewards {
/// Pre-calculates the reward distribution, using the provided `RewardDistributionConfig`.
/// Method assumes that total issuance will be increased by `BLOCK_REWARD`.
Expand Down Expand Up @@ -439,22 +429,15 @@ impl Rewards {
// Adjustable reward portions
let adjustable_staker_reward = factor * adjustable_reward;

let staker_reward = base_staker_reward + adjustable_staker_reward;

Self {
treasury_reward,
base_staker_reward,
staker_reward,
dapps_reward,
collators_reward,
adjustable_staker_reward,
}
}

fn sum(&self) -> Balance {
self.base_staker_reward
+ self.adjustable_staker_reward
+ self.collators_reward
+ self.dapps_reward
+ self.treasury_reward
}
}

fn adjust_tvl(desired_percent: u128) {
Expand Down
2 changes: 1 addition & 1 deletion runtime/astar/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "astar-runtime"
version = "5.25.0"
version = "5.24.0"
build = "build.rs"
authors.workspace = true
edition.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion runtime/astar/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("astar"),
impl_name: create_runtime_str!("astar"),
authoring_version: 1,
spec_version: 72,
spec_version: 71,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 2,
Expand Down
2 changes: 1 addition & 1 deletion runtime/local/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "local-runtime"
version = "5.25.0"
version = "5.24.0"
build = "build.rs"
authors.workspace = true
edition.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion runtime/shibuya/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "shibuya-runtime"
version = "5.25.0"
version = "5.24.0"
build = "build.rs"
authors.workspace = true
edition.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion runtime/shibuya/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("shibuya"),
impl_name: create_runtime_str!("shibuya"),
authoring_version: 1,
spec_version: 115,
spec_version: 114,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 2,
Expand Down
2 changes: 1 addition & 1 deletion runtime/shiden/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "shiden-runtime"
version = "5.25.0"
version = "5.24.0"
build = "build.rs"
authors.workspace = true
edition.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion runtime/shiden/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("shiden"),
impl_name: create_runtime_str!("shiden"),
authoring_version: 1,
spec_version: 112,
spec_version: 111,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 2,
Expand Down

0 comments on commit a1132af

Please sign in to comment.