Skip to content

Commit

Permalink
add utility pallet (#168)
Browse files Browse the repository at this point in the history
The utility pallet is required for batch transactions to work in
polkadot-js and should therefore be included in the substrate contracts
node.

See
polkadot-js/api#4801 (comment)
for details.
  • Loading branch information
forgetso authored Jan 25, 2023
1 parent 87a3d76 commit 430873a
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ sp-session = { git = "https://github.com/paritytech/substrate", package = "sp-se
sp-std = { git = "https://github.com/paritytech/substrate", package = "sp-std", default-features = false, branch = "polkadot-v0.9.34" }
sp-transaction-pool = { git = "https://github.com/paritytech/substrate", package = "sp-transaction-pool", default-features = false, branch = "polkadot-v0.9.34" }
sp-version = { git = "https://github.com/paritytech/substrate", package = "sp-version", default-features = false, branch = "polkadot-v0.9.34" }
pallet-utility = { git = "https://github.com/paritytech/substrate", package = "pallet-utility", default-features = false, branch = "polkadot-v0.9.34" }

# Used for the node's RPCs
frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", package = "frame-system-rpc-runtime-api", default-features = false, branch = "polkadot-v0.9.34" }
Expand Down
8 changes: 8 additions & 0 deletions runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,13 @@ parameter_types! {
pub Schedule: pallet_contracts::Schedule<Runtime> = Default::default();
}

impl pallet_utility::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type RuntimeCall = RuntimeCall;
type PalletsOrigin = OriginCaller;
type WeightInfo = pallet_utility::weights::SubstrateWeight<Runtime>;
}

impl pallet_contracts::Config for Runtime {
type Time = Timestamp;
type Randomness = RandomnessCollectiveFlip;
Expand Down Expand Up @@ -364,6 +371,7 @@ construct_runtime!(
UncheckedExtrinsic = UncheckedExtrinsic,
{
System: frame_system,
Utility: pallet_utility,
RandomnessCollectiveFlip: pallet_randomness_collective_flip,
Timestamp: pallet_timestamp,
Balances: pallet_balances,
Expand Down

0 comments on commit 430873a

Please sign in to comment.