Skip to content

Commit 430873a

Browse files
authored
add utility pallet (#168)
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.
1 parent 87a3d76 commit 430873a

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-0
lines changed

Cargo.lock

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

runtime/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ sp-session = { git = "https://github.com/paritytech/substrate", package = "sp-se
3636
sp-std = { git = "https://github.com/paritytech/substrate", package = "sp-std", default-features = false, branch = "polkadot-v0.9.34" }
3737
sp-transaction-pool = { git = "https://github.com/paritytech/substrate", package = "sp-transaction-pool", default-features = false, branch = "polkadot-v0.9.34" }
3838
sp-version = { git = "https://github.com/paritytech/substrate", package = "sp-version", default-features = false, branch = "polkadot-v0.9.34" }
39+
pallet-utility = { git = "https://github.com/paritytech/substrate", package = "pallet-utility", default-features = false, branch = "polkadot-v0.9.34" }
3940

4041
# Used for the node's RPCs
4142
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" }

runtime/src/lib.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,13 @@ parameter_types! {
319319
pub Schedule: pallet_contracts::Schedule<Runtime> = Default::default();
320320
}
321321

322+
impl pallet_utility::Config for Runtime {
323+
type RuntimeEvent = RuntimeEvent;
324+
type RuntimeCall = RuntimeCall;
325+
type PalletsOrigin = OriginCaller;
326+
type WeightInfo = pallet_utility::weights::SubstrateWeight<Runtime>;
327+
}
328+
322329
impl pallet_contracts::Config for Runtime {
323330
type Time = Timestamp;
324331
type Randomness = RandomnessCollectiveFlip;
@@ -364,6 +371,7 @@ construct_runtime!(
364371
UncheckedExtrinsic = UncheckedExtrinsic,
365372
{
366373
System: frame_system,
374+
Utility: pallet_utility,
367375
RandomnessCollectiveFlip: pallet_randomness_collective_flip,
368376
Timestamp: pallet_timestamp,
369377
Balances: pallet_balances,

0 commit comments

Comments
 (0)