Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion code/Cargo.lock

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

2 changes: 0 additions & 2 deletions code/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,10 @@ frame-benchmarking-cli = { git = "https://github.com/ComposableFi/substrate", re
frame-election-provider-support = { git = "https://github.com/ComposableFi/substrate", rev = "c74d73bfe1e4f725b3f7d81c997ba9c940bf6005", default-features = false }
frame-executive = { git = "https://github.com/ComposableFi/substrate", rev = "c74d73bfe1e4f725b3f7d81c997ba9c940bf6005", default-features = false }
frame-support = { git = "https://github.com/ComposableFi/substrate", rev = "c74d73bfe1e4f725b3f7d81c997ba9c940bf6005", default-features = false }
support = { package = "frame-support", git = "https://github.com/ComposableFi/substrate", rev = "c74d73bfe1e4f725b3f7d81c997ba9c940bf6005", default-features = false }
frame-support-procedural = { git = "https://github.com/ComposableFi/substrate", rev = "c74d73bfe1e4f725b3f7d81c997ba9c940bf6005", default-features = false }
frame-support-procedural-tools = { git = "https://github.com/ComposableFi/substrate", rev = "c74d73bfe1e4f725b3f7d81c997ba9c940bf6005", default-features = false }
frame-support-procedural-tools-derive = { git = "https://github.com/ComposableFi/substrate", rev = "c74d73bfe1e4f725b3f7d81c997ba9c940bf6005", default-features = false }
frame-system = { git = "https://github.com/ComposableFi/substrate", rev = "c74d73bfe1e4f725b3f7d81c997ba9c940bf6005", default-features = false }
system = { package = "frame-system", git = "https://github.com/ComposableFi/substrate", rev = "c74d73bfe1e4f725b3f7d81c997ba9c940bf6005", default-features = false }
frame-system-benchmarking = { git = "https://github.com/ComposableFi/substrate", rev = "c74d73bfe1e4f725b3f7d81c997ba9c940bf6005", default-features = false }
frame-system-rpc-runtime-api = { git = "https://github.com/ComposableFi/substrate", rev = "c74d73bfe1e4f725b3f7d81c997ba9c940bf6005", default-features = false }
system-rpc-runtime-api = { package = "frame-system-rpc-runtime-api", git = "https://github.com/ComposableFi/substrate", rev = "c74d73bfe1e4f725b3f7d81c997ba9c940bf6005", default-features = false }
Expand Down
9 changes: 4 additions & 5 deletions code/parachain/frame/call-filter/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ sp-io = { default-features = false, workspace = true }
sp-runtime = { default-features = false, workspace = true }
sp-std = { default-features = false, workspace = true }
sp-core = { default-features = false, workspace = true }
support = { package = "frame-support", default-features = false, workspace = true }
system = { package = "frame-system", default-features = false, workspace = true }
frame-support = { workspace = true }
frame-system = { workspace = true }

[dev-dependencies]
pallet-balances = { workspace = true }
Expand All @@ -29,13 +29,12 @@ sp-io = { workspace = true }
default = ["std"]
std = [
"codec/std",
"frame-support/std",
"frame-system/std",
"scale-info/std",
"serde",
"sp-core/std",
"sp-io/std",
"sp-runtime/std",
"sp-std/std",
"support/std",
"support/std",
"system/std",
]
14 changes: 7 additions & 7 deletions code/parachain/frame/call-filter/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,31 +15,31 @@

mod prelude;
mod types;
pub use pallet::*;
use support::{
use frame_support::{
dispatch::{CallMetadata, GetCallMetadata},
pallet_prelude::*,
traits::{Contains, PalletInfoAccess},
transactional,
};
use system::pallet_prelude::*;
use frame_system::pallet_prelude::*;
pub use pallet::*;
pub use types::*;
use weights::WeightInfo;
mod mock;
mod tests;
mod weights;

#[support::pallet]
#[frame_support::pallet]
pub mod pallet {
use super::*;
use prelude::*;

type CallFilterEntryOf<T> = CallFilterEntry<<T as Config>::MaxStringSize>;

#[pallet::config]
pub trait Config: system::Config {
pub trait Config: frame_system::Config {
/// Overarching event type
type RuntimeEvent: From<Event<Self>> + IsType<<Self as system::Config>::RuntimeEvent>;
type RuntimeEvent: From<Event<Self>> + IsType<<Self as frame_system::Config>::RuntimeEvent>;

/// Origin which can disable extrinsic for being executed.
/// Consider be same or more allowed than EnableOrigin.
Expand Down Expand Up @@ -176,7 +176,7 @@ pub mod pallet {

impl<T: Config> Contains<T::RuntimeCall> for Pallet<T>
where
<T as system::Config>::RuntimeCall: GetCallMetadata,
<T as frame_system::Config>::RuntimeCall: GetCallMetadata,
{
fn contains(call: &T::RuntimeCall) -> bool {
let CallMetadata { function_name, pallet_name } = call.get_call_metadata();
Expand Down
14 changes: 7 additions & 7 deletions code/parachain/frame/call-filter/src/mock.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#![cfg(test)]

use super::*;
use frame_support::{construct_runtime, ord_parameter_types, parameter_types, traits::Everything};
use frame_system::EnsureSignedBy;
use sp_core::H256;
use sp_runtime::{testing::Header, traits::IdentityLookup};
use support::{construct_runtime, ord_parameter_types, parameter_types, traits::Everything};
use system::EnsureSignedBy;

pub type AccountId = u128;
pub type Balance = u128;
Expand All @@ -18,7 +18,7 @@ parameter_types! {
pub const BlockHashCount: u64 = 250;
}

impl system::Config for Runtime {
impl frame_system::Config for Runtime {
type RuntimeOrigin = RuntimeOrigin;
type Index = u64;
type BlockNumber = u64;
Expand Down Expand Up @@ -83,16 +83,16 @@ impl Config for Runtime {
type MaxStringSize = MaxStringSize;
}

type UncheckedExtrinsic = system::mocking::MockUncheckedExtrinsic<Runtime>;
type Block = system::mocking::MockBlock<Runtime>;
type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic<Runtime>;
type Block = frame_system::mocking::MockBlock<Runtime>;

construct_runtime!(
pub enum Runtime where
Block = Block,
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic
{
System: system::{Pallet, Call, Config, Storage, Event<T>},
System: frame_system::{Pallet, Call, Config, Storage, Event<T>},
Filter: call_filter::{Pallet, Storage, Call, Event<T>},
Balances: pallet_balances::{Pallet, Storage, Call, Event<T>},
}
Expand All @@ -108,7 +108,7 @@ impl Default for ExtBuilder {

impl ExtBuilder {
pub fn build(self) -> sp_io::TestExternalities {
let t = system::GenesisConfig::default().build_storage::<Runtime>().unwrap();
let t = frame_system::GenesisConfig::default().build_storage::<Runtime>().unwrap();
t.into()
}
}
2 changes: 1 addition & 1 deletion code/parachain/frame/call-filter/src/prelude.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
pub use frame_support::{dispatch::DispatchResult, pallet_prelude::*, BoundedVec};
pub use sp_core::Get;
pub use sp_std::prelude::*;
pub use support::{dispatch::DispatchResult, pallet_prelude::*, BoundedVec};
4 changes: 2 additions & 2 deletions code/parachain/frame/call-filter/src/tests.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#![cfg(test)]

use super::*;
use frame_support::{assert_noop, assert_ok};
use mock::{RuntimeEvent, *};
use sp_runtime::traits::BadOrigin;
use support::{assert_noop, assert_ok};

const BALANCE_TRANSFER: &<Runtime as system::Config>::RuntimeCall =
const BALANCE_TRANSFER: &<Runtime as frame_system::Config>::RuntimeCall =
&mock::RuntimeCall::Balances(pallet_balances::Call::transfer { dest: ALICE, value: 10 });
#[test]
fn pause_transaction_work() {
Expand Down
2 changes: 1 addition & 1 deletion code/parachain/frame/call-filter/src/weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#![allow(unused_imports)]
#![allow(clippy::unnecessary_cast)]

use support::{traits::Get, weights::{Weight, constants::RocksDbWeight}};
use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}};
use sp_std::marker::PhantomData;

pub trait WeightInfo {
Expand Down
1 change: 0 additions & 1 deletion code/utils/common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ version = "0.1.0"
[dependencies]
sp-core = { workspace = true }
sp-runtime = { workspace = true }
system = { workspace = true }
composable-runtime = { path = "../../parachain/runtime/composable" }
derive_more = "0.99.17"
picasso-runtime = { path = "../../parachain/runtime/picasso" }
Expand Down