Add methods param for RPC state_traceBlock (#9642)

* Add methods param for RPC state_traceBlock

Signed-off-by: koushiro <koushiro.cqx@gmail.com>

* rename event_values_filter arg

Signed-off-by: koushiro <koushiro.cqx@gmail.com>

* Add some doc

Signed-off-by: koushiro <koushiro.cqx@gmail.com>

* Add some doc

Signed-off-by: koushiro <koushiro.cqx@gmail.com>

* Fix doc

Signed-off-by: koushiro <koushiro.cqx@gmail.com>

* format

Signed-off-by: koushiro <koushiro.cqx@gmail.com>
This commit is contained in:
Qinxuan Chen
2021-08-30 19:52:26 +08:00
committed by GitHub
parent ac2468c47b
commit 847d264c33
6 changed files with 68 additions and 8 deletions
+3 -1
View File
@@ -178,6 +178,7 @@ where
block: Block::Hash,
targets: Option<String>,
storage_keys: Option<String>,
methods: Option<String>,
) -> FutureResult<sp_rpc::tracing::TraceBlockResponse>;
}
@@ -413,12 +414,13 @@ where
block: Block::Hash,
targets: Option<String>,
storage_keys: Option<String>,
methods: Option<String>,
) -> FutureResult<sp_rpc::tracing::TraceBlockResponse> {
if let Err(err) = self.deny_unsafe.check_if_safe() {
return async move { Err(err.into()) }.boxed()
}
self.backend.trace_block(block, targets, storage_keys)
self.backend.trace_block(block, targets, storage_keys, methods)
}
}
@@ -581,12 +581,14 @@ where
block: Block::Hash,
targets: Option<String>,
storage_keys: Option<String>,
methods: Option<String>,
) -> FutureResult<sp_rpc::tracing::TraceBlockResponse> {
let block_executor = sc_tracing::block::BlockExecutor::new(
self.client.clone(),
block,
targets,
storage_keys,
methods,
self.rpc_max_payload,
);
let r = block_executor
@@ -449,6 +449,7 @@ where
_block: Block::Hash,
_targets: Option<String>,
_storage_keys: Option<String>,
_methods: Option<String>,
) -> FutureResult<sp_rpc::tracing::TraceBlockResponse> {
async move { Err(client_err(ClientError::NotAvailableOnLightClient)) }.boxed()
}