Skip to content

Commit

Permalink
message upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
AlphaGamingArcade committed Dec 2, 2024
1 parent 93f30a2 commit 17a264f
Show file tree
Hide file tree
Showing 24 changed files with 2,245 additions and 18 deletions.
142 changes: 136 additions & 6 deletions Cargo.lock

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

13 changes: 13 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,20 @@ members = [
"node",
"pallets/template",
"runtime",
"pallets/access-segregator",
"pallets/bridge",
"primitives/aga",
]
resolver = "2"

[workspace.dependencies]
primitive-types = { version = "0.13.1", default-features = false, features = ["codec", "scale-info", "num-traits"]}
aga-access-segregator = { path = "./pallets/access-segregator", default-features = false }
aga-bridge = { path = "./pallets/bridge", default-features = false }
aga-primitives = { path = "./primitives/aga", default-features = false }
pallet-authorship = { version = "38.0.0", default-features = false }
pallet-asset-conversion = { version = "20.0.0", default-features = false }
pallet-assets = { version = "40.0.0", default-features = false }
solochain-template-runtime = { path = "./runtime", default-features = false }
pallet-template = { path = "./pallets/template", default-features = false }
clap = { version = "4.5.10" }
Expand Down Expand Up @@ -64,6 +74,8 @@ pallet-grandpa = { version = "38.0.0", default-features = false }
pallet-sudo = { version = "38.0.0", default-features = false }
pallet-timestamp = { version = "37.0.0", default-features = false }
pallet-transaction-payment-rpc-runtime-api = { version = "38.0.0", default-features = false }
sp-staking = { version = "36.0.0", default-features = false }
pallet-session = { version = "38.0.0", default-features = false }
scale-info = { version = "2.11.1", default-features = false }
sp-genesis-builder = { version = "0.15.1", default-features = false }
sp-offchain = { version = "34.0.0", default-features = false }
Expand All @@ -72,3 +84,4 @@ sp-storage = { version = "21.0.0", default-features = false }
sp-transaction-pool = { version = "34.0.0", default-features = false }
sp-version = { version = "37.0.0", default-features = false }
substrate-wasm-builder = { version = "24.0.1", default-features = false }
sp-std = { version = "14.0.0", default-features = false }
6 changes: 6 additions & 0 deletions node/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,3 +115,9 @@ fn testnet_genesis(
},
})
}


// LIVE CONFIG
pub fn aga_config() -> Result<ChainSpec, String> {
ChainSpec::from_json_bytes(&include_bytes!("../../resources/aga-chain-spec-raw.json")[..])
}
1 change: 1 addition & 0 deletions node/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ impl SubstrateCli for Cli {
Ok(match id {
"dev" => Box::new(chain_spec::development_config()?),
"" | "local" => Box::new(chain_spec::local_testnet_config()?),
"aga" => Box::new(chain_spec::aga_config()?),
path =>
Box::new(chain_spec::ChainSpec::from_json_file(std::path::PathBuf::from(path))?),
})
Expand Down
48 changes: 48 additions & 0 deletions pallets/access-segregator/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
[package]
name = "aga-access-segregator"
description = "FRAME pallet template for defining custom runtime logic."
version = "0.1.0"
license = "Unlicense"
authors.workspace = true
homepage.workspace = true
repository.workspace = true
edition.workspace = true
publish = false

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

[dependencies]
codec = { features = [
"derive",
], workspace = true }
scale-info = { features = [
"derive",
], workspace = true }
frame-benchmarking = { optional = true, workspace = true }
frame-support.workspace = true
frame-system.workspace = true

[dev-dependencies]
sp-core = { default-features = true, workspace = true }
sp-io = { default-features = true, workspace = true }
sp-runtime = { default-features = true, workspace = true }

[features]
default = ["std"]
std = [
"codec/std",
"frame-benchmarking?/std",
"frame-support/std",
"frame-system/std",
"scale-info/std",
]
runtime-benchmarks = [
"frame-benchmarking/runtime-benchmarks",
"frame-support/runtime-benchmarks",
"frame-system/runtime-benchmarks",
]
try-runtime = [
"frame-support/try-runtime",
"frame-system/try-runtime",
]
29 changes: 29 additions & 0 deletions pallets/access-segregator/src/benchmarking.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// The Licensed Work is (c) 2022 Sygma
// SPDX-License-Identifier: LGPL-3.0-only

//! Sygma access-segreator pallet benchmarking.
#![cfg(feature = "runtime-benchmarks")]
use super::*;
use frame_benchmarking::v2::*;
use frame_system::RawOrigin as SystemOrigin;

use sp_std::vec;

#[benchmarks]
mod benchmarks {
use super::*;

#[benchmark]
fn grant_access() {
let caller: <T as frame_system::Config>::AccountId = whitelisted_caller();

#[extrinsic_call]
grant_access(SystemOrigin::Root, 100, b"grant_access".to_vec(), caller.clone());

assert_eq!(
ExtrinsicAccess::<T>::get(&(100, b"grant_access".to_vec())),
Some(caller).into(),
);
}
}
Loading

0 comments on commit 17a264f

Please sign in to comment.