Skip to content

Commit

Permalink
Add Multisignature pallet to runtime (#152)
Browse files Browse the repository at this point in the history
* Fix chain properties metadata not inserting into chainspec

* Add pallet-multisig to runtime
  • Loading branch information
Ayden Brewer committed Jun 23, 2023
1 parent d3c611d commit bc8e9e3
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 4 deletions.
19 changes: 18 additions & 1 deletion Cargo.lock

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

4 changes: 2 additions & 2 deletions node/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ pub fn finney_mainnet_config() -> Result<ChainSpec, String> {
Some("bittensor"),
None,
// Properties
None,
Some(properties),
// Extensions
None,
))
Expand Down Expand Up @@ -280,7 +280,7 @@ pub fn finney_testnet_config() -> Result<ChainSpec, String> {
Some("bittensor"),
None,
// Properties
None,
Some(properties),
// Extensions
None,
))
Expand Down
5 changes: 5 additions & 0 deletions runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ sp-std = { version = "5.0.0", default-features = false, git = "https://github.co
sp-transaction-pool = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" }
sp-version = { version = "5.0.0", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" }

# Multisig
pallet-multisig = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" }

# Used for the node subtensor's RPCs
frame-system-rpc-runtime-api = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" }
pallet-transaction-payment-rpc-runtime-api = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.39" }
Expand Down Expand Up @@ -80,6 +83,7 @@ std = [
"pallet-transaction-payment-rpc-runtime-api/std",
"pallet-transaction-payment/std",
"pallet-utility/std",
"pallet-multisig/std",
"sp-api/std",
"sp-block-builder/std",
"sp-consensus-aura/std",
Expand Down Expand Up @@ -119,4 +123,5 @@ try-runtime = [
"pallet-transaction-payment/try-runtime",
"pallet-utility/try-runtime",
"pallet-subtensor/try-runtime",
"pallet-multisig/try-runtime",
]
21 changes: 20 additions & 1 deletion runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,24 @@ impl pallet_sudo::Config for Runtime {
type RuntimeCall = RuntimeCall;
}

parameter_types! {
// One storage item; key size is 32; value is size 4+4+16+32 bytes = 56 bytes.
pub const DepositBase: Balance = (1) as Balance * 2_000 * 10_000_000 + (88 as Balance) * 100 * 1_000_000;
// Additional storage item size of 32 bytes.
pub const DepositFactor: Balance = (0) as Balance * 2_000 * 10_000_000 + (32 as Balance) * 100 * 1_000_000;
pub const MaxSignatories: u32 = 100;
}

impl pallet_multisig::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type RuntimeCall = RuntimeCall;
type Currency = Balances;
type DepositBase = DepositBase;
type DepositFactor = DepositFactor;
type MaxSignatories = MaxSignatories;
type WeightInfo = pallet_multisig::weights::SubstrateWeight<Runtime>;
}

// Configure the pallet subtensor.
parameter_types! {
pub const SubtensorInitialRho: u16 = 10;
Expand Down Expand Up @@ -418,7 +436,8 @@ construct_runtime!(
TransactionPayment: pallet_transaction_payment,
Sudo: pallet_sudo,
SubtensorModule: pallet_subtensor,
Utility: pallet_utility
Utility: pallet_utility,
Multisig: pallet_multisig
}
);

Expand Down

0 comments on commit bc8e9e3

Please sign in to comment.