-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
93f30a2
commit 17a264f
Showing
24 changed files
with
2,245 additions
and
18 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(), | ||
); | ||
} | ||
} |
Oops, something went wrong.