Skip to content

Commit

Permalink
Merge pull request #28 from functionland/feature/update
Browse files Browse the repository at this point in the history
Remove the Authorization pallet
  • Loading branch information
ehsan6sha authored Oct 4, 2023
2 parents dc9a41b + 9483b63 commit 19f10bb
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 89 deletions.
18 changes: 0 additions & 18 deletions Cargo.lock

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

22 changes: 1 addition & 21 deletions customSpec.json

Large diffs are not rendered by default.

6 changes: 1 addition & 5 deletions customSpecRaw.json

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ serde_json = "1.0.96"
#SBP-M1 review: unused?
getrandom = { version = "0.2", features = ["js"] }
tokio = { version = "1.22.0" }
#SBP-M1 review: outdated
bs58 = { version = "0.4.0" }

sc-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" }
Expand Down
23 changes: 1 addition & 22 deletions node/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@ use sc_service::ChainType;
use serde_json::json;
use sp_consensus_aura::sr25519::AuthorityId as AuraId;
use sp_consensus_grandpa::AuthorityId as GrandpaId;
use sp_core::OpaquePeerId;
use sp_core::{sr25519, Pair, Public};
use sp_runtime::traits::{IdentifyAccount, Verify};
use sugarfunge_runtime::{
opaque::SessionKeys, AccountId, AuraConfig, Balance, BalancesConfig, CouncilConfig,
GenesisConfig, GrandpaConfig, NodeAuthorizationConfig, SessionConfig, Signature, SudoConfig,
GenesisConfig, GrandpaConfig, SessionConfig, Signature, SudoConfig,
SystemConfig, ValidatorSetConfig, DOLLARS, WASM_BINARY,
};

Expand Down Expand Up @@ -214,25 +213,5 @@ fn testnet_genesis(
// Assign network admin rights.
key: Some(root_key),
},
node_authorization: NodeAuthorizationConfig {
nodes: vec![
(
OpaquePeerId(
bs58::decode("12D3KooWBeXV65svCyknCvG1yLxXVFwRxzBLqvBJnUF6W84BLugv")
.into_vec()
.unwrap(),
),
endowed_accounts[0].clone(),
),
(
OpaquePeerId(
bs58::decode("12D3KooWJ7NJ2FkY9nAXNWue1qmeR9XEVDNsLRop9F2bwBpuFjxs")
.into_vec()
.unwrap(),
),
endowed_accounts[1].clone(),
),
],
},
}
}
2 changes: 0 additions & 2 deletions runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ pallet-scheduler = { git = "https://github.com/paritytech/substrate", branch = "
pallet-session = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43", default-features = false, features = [
"historical",
] }
pallet-node-authorization = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.43" }

# Used for the node template's RPCs
frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43", default-features = false }
Expand Down Expand Up @@ -143,7 +142,6 @@ std = [
"pallet-contracts/std",
"pallet-contracts-primitives/std",
"pallet-collective/std",
"pallet-node-authorization/std",
#SBP-M1 review: remove blank line

"sugarfunge-validator-set/std",
Expand Down
19 changes: 0 additions & 19 deletions runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -493,24 +493,6 @@ impl fula_pool::Config for Runtime {
type MaxPoolParticipants = MaxPoolParticipants;
}

parameter_types! {
// SBP-M1 review: only used once, consider inlining
pub const MaxWellKnownNodes: u32 = 8;
// SBP-M1 review: only used once, consider inlining
pub const MaxPeerIdLength: u32 = 128;
}

impl pallet_node_authorization::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type MaxWellKnownNodes = MaxWellKnownNodes;
type MaxPeerIdLength = MaxPeerIdLength;
type AddOrigin = EnsureRoot<AccountId>;
type RemoveOrigin = EnsureRoot<AccountId>;
type SwapOrigin = EnsureRoot<AccountId>;
type ResetOrigin = EnsureRoot<AccountId>;
type WeightInfo = ();
}

construct_runtime!(
pub struct Runtime where
Block = Block,
Expand All @@ -527,7 +509,6 @@ construct_runtime!(
Sudo: pallet_sudo::{Pallet, Call, Config<T>, Storage, Event<T>},
Scheduler: pallet_scheduler::{Pallet, Call, Storage, Event<T>},
Council: pallet_collective::<Instance1>,
NodeAuthorization: pallet_node_authorization::{Pallet, Call, Storage, Event<T>, Config<T>},
ValidatorSet: validator_set::{Pallet, Call, Storage, Event<T>, Config<T>},
Session: pallet_session::{Pallet, Call, Storage, Event, Config<T>},

Expand Down

0 comments on commit 19f10bb

Please sign in to comment.