Skip to content

Commit

Permalink
update files
Browse files Browse the repository at this point in the history
  • Loading branch information
AlphaGamingArcade committed Dec 11, 2024
1 parent ada38b4 commit de7a3b1
Show file tree
Hide file tree
Showing 10 changed files with 637 additions and 963 deletions.
496 changes: 131 additions & 365 deletions Cargo.lock

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@ workspace = true
targets = ["x86_64-unknown-linux-gnu"]

[dependencies]
bs58 = { version = "0.5.1" }
clap = { version = "4.5.3", features = ["derive"] }
futures = { version = "0.3.30", features = ["thread-pool"] }
serde_json = { version = "1.0.114", default-features = true }
serde_json = { version = "1.0.114", default-features = true, features = ["alloc"] }
jsonrpsee = { version = "0.22", features = ["server"] }

# substrate client
Expand Down
25 changes: 16 additions & 9 deletions node/src/chain_spec.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use aga_runtime::{AccountId, RuntimeGenesisConfig, Signature, WASM_BINARY, opaque::SessionKeys};
use aga_runtime::{AccountId, RuntimeGenesisConfig, Signature, WASM_BINARY, Balance, opaque::SessionKeys };
use sc_service::ChainType;
use sp_consensus_aura::sr25519::AuthorityId as AuraId;
use sp_consensus_grandpa::AuthorityId as GrandpaId;
Expand Down Expand Up @@ -32,10 +32,11 @@ where
AccountPublic::from(get_from_seed::<TPublic>(seed)).into_account()
}

/// Generate an Aura authority key.
// /// Generate an Aura authority key.
// pub fn authority_keys_from_seed(s: &str) -> (AuraId, GrandpaId) {
// (get_from_seed::<AuraId>(s), get_from_seed::<GrandpaId>(s))
// }

fn session_keys(aura: AuraId, grandpa: GrandpaId) -> SessionKeys {
SessionKeys { aura, grandpa }
}
Expand Down Expand Up @@ -106,6 +107,8 @@ pub fn local_testnet_config() -> Result<ChainSpec, String> {
.build())
}

const INITIAL_BALANCE: Balance = 100_000_000_000_000_000_000_000;

/// Configure initial storage state for FRAME modules.
fn testnet_genesis(
initial_authorities: Vec<(AccountId, AuraId, GrandpaId)>,
Expand All @@ -115,16 +118,21 @@ fn testnet_genesis(
) -> serde_json::Value {
serde_json::json!({
"balances": {
// Configure endowed accounts with initial balance of 1 << 60.
"balances": endowed_accounts.iter().cloned().map(|k| (k, 1u64 << 60)).collect::<Vec<_>>(),
// Configure endowed accounts with initial balance.
"balances": endowed_accounts.iter().cloned().map(|k| (k, INITIAL_BALANCE)).collect::<Vec<_>>(),
},
"validatorSet": {
"initialValidators": initial_authorities.iter().map(|x| (x.0.clone())).collect::<Vec<_>>(),
"initialValidators": initial_authorities.iter().map(|x| x.0.clone()).collect::<Vec<_>>(),
},
"session": {
"keys": initial_authorities.iter().map(|x| {
(x.0.clone(), x.0.clone(), session_keys(x.1.clone(), x.2.clone()))
}).collect::<Vec<_>>(),
"keys": initial_authorities
.iter()
.map(|x| (
x.0.clone(),
x.0.clone(),
session_keys(x.1.clone(), x.2.clone())
))
.collect::<Vec<_>>(),
},
"aura": {
"authorities": [],
Expand All @@ -133,7 +141,6 @@ fn testnet_genesis(
"authorities": [],
},
"sudo": {
// Assign network admin rights.
"key": Some(root_key),
}
})
Expand Down
5 changes: 1 addition & 4 deletions primitives/aga/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,4 @@ pub enum TransferType {
pub trait DecimalConverter {
fn convert_to(amount: u128, decimal: u8) -> u128;
fn convert_from(amount: u128, decimal: u8) -> u128;
}

/// Simple index type with which we can count sessions.
pub type SessionIndex = u32;
}
18 changes: 6 additions & 12 deletions runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,10 @@ pallet-transaction-payment = { git = "https://github.com/paritytech/polkadot-sdk
# asset conversion
pallet-asset-conversion = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-v1.9.0", default-features = false }
pallet-asset-conversion-tx-payment = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-v1.9.0", default-features = false }
pallet-asset-rate = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-v1.9.0", default-features = false }

# Validator management
sp-staking = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-v1.9.0", default-features = false }
pallet-session = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-v1.9.0", default-features = false, features = ['historical'] }
pallet-node-authorization = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-v1.9.0", default-features = false}
pallet-validator-set = { package = "substrate-validator-set", version = "1.1.0", git = "https://github.com/gautamdhameja/substrate-validator-set", tag = "polkadot-v1.9.0", default-features = false }
pallet-validator-set = { version = '1.1.0', git = "https://github.com/AlphaGamingArcade/substrate-validator-set.git", package = "substrate-validator-set", tag = "polkadot-v1.9.0-2", default-features = false }
pallet-session = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-v1.9.0" }

# primitives
hex-literal = { version = "0.4.1", default-features = false }
Expand All @@ -74,7 +71,7 @@ sp-offchain = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "p
sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-v1.9.0", default-features = false, features = [
"serde",
] }
sp-session = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-v1.9.0", default-features = false}
sp-session = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-v1.9.0", default-features = false }
sp-std = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-v1.9.0", default-features = false }
sp-storage = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-v1.9.0", default-features = false }
sp-transaction-pool = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-v1.9.0", default-features = false }
Expand All @@ -100,8 +97,6 @@ aga-bridge = { path = "../pallets/bridge", default-features = false}
pallet-treasury = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-v1.9.0", default-features = false }
aga-primitives = { path = "../primitives/aga", default-features = false }

log = "0.4"

[build-dependencies]
substrate-wasm-builder = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-v1.9.0", optional = true }

Expand Down Expand Up @@ -130,20 +125,19 @@ std = [
"pallet-transaction-payment/std",
"pallet-asset-conversion/std",
"pallet-asset-conversion-tx-payment/std",
"pallet-asset-rate/std",

"pallet-assets/std",
"pallet-authorship/std",
"pallet-contracts/std",
"pallet-utility/std",
"pallet-session/std",
"pallet-node-authorization/std",
"pallet-validator-set/std",

"aga-access-segregator/std",
"aga-bridge/std",
"aga-primitives/std",

"pallet-validator-set/std",
"pallet-session/std",

"sp-api/std",
"sp-block-builder/std",
"sp-consensus-aura/std",
Expand Down
121 changes: 0 additions & 121 deletions runtime/src/assets_config.rs

This file was deleted.

10 changes: 10 additions & 0 deletions runtime/src/benchmarks.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#[cfg(feature = "runtime-benchmarks")]
mod benches {
frame_benchmarking::define_benchmarks!(
[frame_benchmarking, BaselineBench::<Runtime>]
[frame_system, SystemBench::<Runtime>]
[pallet_balances, Balances]
[pallet_timestamp, Timestamp]
[pallet_sudo, Sudo]
);
}
Loading

0 comments on commit de7a3b1

Please sign in to comment.