Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into dAppStaking-Bonus…
Browse files Browse the repository at this point in the history
…-rewards-mechanism-rework-AstarNetwork#1379
  • Loading branch information
sylvaincormier committed Nov 28, 2024
2 parents b4ae4c0 + fc3dbf8 commit 1c3ea75
Show file tree
Hide file tree
Showing 12 changed files with 83 additions and 69 deletions.
8 changes: 4 additions & 4 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 runtime/astar/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "astar-runtime"
version = "5.45.0"
version = "5.46.0"
build = "build.rs"
authors.workspace = true
edition.workspace = true
Expand Down
25 changes: 12 additions & 13 deletions runtime/astar/src/genesis_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,25 +40,24 @@ pub fn default_config(para_id: u32) -> serde_json::Value {
let dave = GenesisAccount::<sr25519::Public>::from_seed("Dave");
let eve = GenesisAccount::<sr25519::Public>::from_seed("Eve");

let balances: Vec<(AccountId, Balance)> = vec![
(alice.account_id(), 1_000_000_000 * ASTR),
(bob.account_id(), 1_000_000_000 * ASTR),
(
TreasuryPalletId::get().into_account_truncating(),
1_000_000_000 * ASTR,
),
(
CommunityTreasuryPalletId::get().into_account_truncating(),
1_000_000_000 * ASTR,
),
];

let authorities = vec![&alice, &bob];
let accounts = vec![&alice, &bob, &charlie, &dave, &eve]
.iter()
.map(|x| x.account_id())
.collect::<Vec<_>>();

let balances = accounts
.iter()
.chain(
vec![
TreasuryPalletId::get().into_account_truncating(),
CommunityTreasuryPalletId::get().into_account_truncating(),
]
.iter(),
)
.map(|x| (x.clone(), 1_000_000_000 * ASTR))
.collect::<Vec<_>>();

let config = RuntimeGenesisConfig {
system: Default::default(),
sudo: SudoConfig {
Expand Down
13 changes: 12 additions & 1 deletion runtime/astar/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("astar"),
impl_name: create_runtime_str!("astar"),
authoring_version: 1,
spec_version: 1000,
spec_version: 1100,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 3,
Expand Down Expand Up @@ -1045,6 +1045,8 @@ pub enum ProxyType {
DappStaking,
/// Only claim_staker call from pallet DappStaking allowed for proxy account
StakerRewardClaim,
/// All governance related calls allowed for proxy account
Governance,
}

impl Default for ProxyType {
Expand Down Expand Up @@ -1116,6 +1118,15 @@ impl InstanceFilter<RuntimeCall> for ProxyType {
)
)
}
ProxyType::Governance => {
matches!(
c,
RuntimeCall::Democracy(..)
| RuntimeCall::Council(..)
| RuntimeCall::TechnicalCommittee(..)
| RuntimeCall::CommunityCouncil(..)
)
}
}
}

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.45.0"
version = "5.46.0"
build = "build.rs"
authors.workspace = true
edition.workspace = true
Expand Down
35 changes: 16 additions & 19 deletions runtime/local/src/genesis_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,30 +44,27 @@ pub fn default_config() -> serde_json::Value {
let dave = GenesisAccount::<sr25519::Public>::from_seed("Dave");
let eve = GenesisAccount::<sr25519::Public>::from_seed("Eve");

let balances: Vec<(AccountId, Balance)> = vec![
(alice.account_id(), 1_000_000_000 * AST),
(bob.account_id(), 1_000_000_000 * AST),
(
TreasuryPalletId::get().into_account_truncating(),
1_000_000_000 * AST,
),
(
CommunityTreasuryPalletId::get().into_account_truncating(),
1_000_000_000 * AST,
),
(
// Private key: 0x01ab6e801c06e59ca97a14fc0a1978b27fa366fc87450e0b65459dd3515b7391
// H160 public address: 0xaaafB3972B05630fCceE866eC69CdADd9baC2771
AccountId::from_ss58check("5FQedkNQcF2fJPwkB6Z1ZcMgGti4vcJQNs6x85YPv3VhjBBT").unwrap(),
1_000_000_000 * AST,
),
];

let accounts = vec![&alice, &bob, &charlie, &dave, &eve]
.iter()
.map(|x| x.account_id())
.collect::<Vec<_>>();

let balances = accounts
.iter()
.chain(
vec![
TreasuryPalletId::get().into_account_truncating(),
CommunityTreasuryPalletId::get().into_account_truncating(),
// Private key: 0x01ab6e801c06e59ca97a14fc0a1978b27fa366fc87450e0b65459dd3515b7391
// H160 public address: 0xaaafB3972B05630fCceE866eC69CdADd9baC2771
AccountId::from_ss58check("5FQedkNQcF2fJPwkB6Z1ZcMgGti4vcJQNs6x85YPv3VhjBBT")
.expect("Invalid SS58 address"),
]
.iter(),
)
.map(|x| (x.clone(), 1_000_000_000 * AST))
.collect::<Vec<_>>();

let config = RuntimeGenesisConfig {
system: Default::default(),
sudo: SudoConfig {
Expand Down
11 changes: 11 additions & 0 deletions runtime/local/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -793,6 +793,8 @@ pub enum ProxyType {
DappStaking,
/// Only claim_staker call from pallet DappStaking allowed for proxy account
StakerRewardClaim,
/// All governance related calls allowed for proxy account
Governance,
}

impl Default for ProxyType {
Expand Down Expand Up @@ -855,6 +857,15 @@ impl InstanceFilter<RuntimeCall> for ProxyType {
)
)
}
ProxyType::Governance => {
matches!(
c,
RuntimeCall::Democracy(..)
| RuntimeCall::Council(..)
| RuntimeCall::TechnicalCommittee(..)
| RuntimeCall::CommunityCouncil(..)
)
}
}
}

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.45.0"
version = "5.46.0"
build = "build.rs"
authors.workspace = true
edition.workspace = true
Expand Down
25 changes: 12 additions & 13 deletions runtime/shibuya/src/genesis_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,25 +40,24 @@ pub fn default_config(para_id: u32) -> serde_json::Value {
let dave = GenesisAccount::<sr25519::Public>::from_seed("Dave");
let eve = GenesisAccount::<sr25519::Public>::from_seed("Eve");

let balances: Vec<(AccountId, Balance)> = vec![
(alice.account_id(), 1_000_000_000 * SBY),
(bob.account_id(), 1_000_000_000 * SBY),
(
TreasuryPalletId::get().into_account_truncating(),
1_000_000_000 * SBY,
),
(
CommunityTreasuryPalletId::get().into_account_truncating(),
1_000_000_000 * SBY,
),
];

let authorities = vec![&alice, &bob];
let accounts = vec![&alice, &bob, &charlie, &dave, &eve]
.iter()
.map(|x| x.account_id())
.collect::<Vec<_>>();

let balances = accounts
.iter()
.chain(
vec![
TreasuryPalletId::get().into_account_truncating(),
CommunityTreasuryPalletId::get().into_account_truncating(),
]
.iter(),
)
.map(|x| (x.clone(), 1_000_000_000 * SBY))
.collect::<Vec<_>>();

let config = RuntimeGenesisConfig {
system: Default::default(),
sudo: SudoConfig {
Expand Down
20 changes: 11 additions & 9 deletions runtime/shibuya/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("shibuya"),
impl_name: create_runtime_str!("shibuya"),
authoring_version: 1,
spec_version: 1000,
spec_version: 1100,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 3,
Expand Down Expand Up @@ -1014,7 +1014,7 @@ pub enum ProxyType {
Balances,
/// All Runtime calls from Pallet Assets allowed for proxy account
Assets,
/// Not used at the moment, but kept for backwards compatibility.
/// All governance related calls allowed for proxy account
Governance,
/// Only provide_judgement call from pallet identity allowed for proxy account
IdentityJudgement,
Expand Down Expand Up @@ -1103,8 +1103,15 @@ impl InstanceFilter<RuntimeCall> for ProxyType {
)
)
}
// Not used at the moment, but kept for backwards compatibility.
ProxyType::Governance => false,
ProxyType::Governance => {
matches!(
c,
RuntimeCall::Democracy(..)
| RuntimeCall::Council(..)
| RuntimeCall::TechnicalCommittee(..)
| RuntimeCall::CommunityCouncil(..)
)
}
}
}

Expand Down Expand Up @@ -1542,11 +1549,6 @@ impl pallet_migrations::Config for Runtime {
#[cfg(feature = "runtime-benchmarks")]
impl vesting_mbm::Config for Runtime {}

impl cumulus_pallet_xcmp_queue::migration::v5::V5Config for Runtime {
// This must be the same as the `ChannelInfo` from the `Config`:
type ChannelList = ParachainSystem;
}

construct_runtime!(
pub struct Runtime
{
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.45.0"
version = "5.46.0"
build = "build.rs"
authors.workspace = true
edition.workspace = true
Expand Down
7 changes: 1 addition & 6 deletions runtime/shiden/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("shiden"),
impl_name: create_runtime_str!("shiden"),
authoring_version: 1,
spec_version: 1000,
spec_version: 1100,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 3,
Expand Down Expand Up @@ -1211,11 +1211,6 @@ impl pallet_migrations::Config for Runtime {
type WeightInfo = pallet_migrations::weights::SubstrateWeight<Runtime>;
}

impl cumulus_pallet_xcmp_queue::migration::v5::V5Config for Runtime {
// This must be the same as the `ChannelInfo` from the `Config`:
type ChannelList = ParachainSystem;
}

construct_runtime!(
pub struct Runtime
{
Expand Down

0 comments on commit 1c3ea75

Please sign in to comment.