Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
Allow try-runtime for contracts-rococo (#1906)
Browse files Browse the repository at this point in the history
* Enable try-runtime for contracts-rococo

* Fix typo from merge
  • Loading branch information
athei authored Nov 27, 2022
1 parent 5459d7a commit 9614493
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
6 changes: 6 additions & 0 deletions polkadot-parachain/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -626,6 +626,12 @@ pub fn run() -> Result<()> {
task_manager,
))
}),
Runtime::ContractsRococo => runner.async_run(|config| {
Ok((
cmd.run::<Block, crate::service::ContractsRococoRuntimeExecutor>(config),
task_manager,
))
}),
_ => Err("Chain doesn't support try-runtime".into()),
}
},
Expand Down
15 changes: 15 additions & 0 deletions polkadot-parachain/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,21 @@ impl sc_executor::NativeExecutionDispatch for CollectivesPolkadotRuntimeExecutor
}
}

// Native contracts executor instance.
pub struct ContractsRococoRuntimeExecutor;

impl sc_executor::NativeExecutionDispatch for ContractsRococoRuntimeExecutor {
type ExtendHostFunctions = frame_benchmarking::benchmarking::HostFunctions;

fn dispatch(method: &str, data: &[u8]) -> Option<Vec<u8>> {
contracts_rococo_runtime::api::dispatch(method, data)
}

fn native_version() -> sc_executor::NativeVersion {
contracts_rococo_runtime::native_version()
}
}

/// Starts a `ServiceBuilder` for a full service.
///
/// Use this macro if you don't actually need the full service, but just the builder in order to
Expand Down

0 comments on commit 9614493

Please sign in to comment.