Skip to content

Commit

Permalink
expose wasm execution method on subxt client config (#230)
Browse files Browse the repository at this point in the history
Signed-off-by: Gregory Hill <gregorydhill@outlook.com>
  • Loading branch information
gregdhill authored Feb 19, 2021
1 parent de859e7 commit e524c2d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
3 changes: 3 additions & 0 deletions client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ serde_json = "1.0.61"
sp-keyring = "3.0.0"
thiserror = "1.0.23"

[target.'cfg(target_arch="x86_64")'.dependencies]
sc-service = { version = "0.9.0", default-features = false, features = ["wasmtime"] }

[dev-dependencies]
async-std = { version = "1.8.0", features = ["attributes"] }
env_logger = "0.8.2"
Expand Down
7 changes: 6 additions & 1 deletion client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ use sc_service::{
NetworkConfiguration,
TaskType,
TelemetryEndpoints,
WasmExecutionMethod,
},
ChainSpec,
Configuration,
Expand Down Expand Up @@ -217,6 +218,8 @@ pub struct SubxtClientConfig<C: ChainSpec + 'static> {
pub role: Role,
/// Enable telemetry on the given port.
pub telemetry: Option<u16>,
/// Wasm execution method
pub wasm_method: WasmExecutionMethod,
}

impl<C: ChainSpec + 'static> SubxtClientConfig<C> {
Expand Down Expand Up @@ -287,7 +290,7 @@ impl<C: ChainSpec + 'static> SubxtClientConfig<C> {
tracing_receiver: Default::default(),
tracing_targets: Default::default(),
transaction_pool: Default::default(),
wasm_method: Default::default(),
wasm_method: self.wasm_method,
base_path: Default::default(),
informant_output_format: Default::default(),
state_pruning: Default::default(),
Expand Down Expand Up @@ -362,6 +365,7 @@ mod tests {
chain_spec,
role: Role::Light,
telemetry: None,
wasm_method: Default::default(),
};
let client = ClientBuilder::<NodeTemplateRuntime>::new()
.set_client(
Expand Down Expand Up @@ -395,6 +399,7 @@ mod tests {
chain_spec: test_node::chain_spec::development_config().unwrap(),
role: Role::Authority(AccountKeyring::Alice),
telemetry: None,
wasm_method: Default::default(),
};
let client = ClientBuilder::<NodeTemplateRuntime>::new()
.set_client(
Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,7 @@ mod tests {
chain_spec: test_node::chain_spec::development_config().unwrap(),
role: Role::Authority(key),
telemetry: None,
wasm_method: Default::default(),
};
let client = ClientBuilder::new()
.set_client(
Expand Down

0 comments on commit e524c2d

Please sign in to comment.