Skip to content

Commit

Permalink
fix evm tracing for older runtimes (#1307)
Browse files Browse the repository at this point in the history
  • Loading branch information
ermalkaleci authored Jul 25, 2024
1 parent b028266 commit 2280899
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
7 changes: 4 additions & 3 deletions vendor/rpc/debug/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,8 @@ where
} else {
// Old "trace_block" api did not initialize block before applying transactions,
// so we need to do it here before calling "trace_block".
api.initialize_block(parent_block_hash, &header)
#[allow(deprecated)]
api.initialize_block_before_version_5(parent_block_hash, &header)
.map_err(|e| internal_err(format!("Runtime api access error: {:?}", e)))?;

#[allow(deprecated)]
Expand Down Expand Up @@ -529,13 +530,13 @@ where
} else {
// Old "trace_transaction" api did not initialize block before applying transactions,
// so we need to do it here before calling "trace_transaction".
api.initialize_block(parent_block_hash, &header)
#[allow(deprecated)]
api.initialize_block_before_version_5(parent_block_hash, &header)
.map_err(|e| {
internal_err(format!("Runtime api access error: {:?}", e))
})?;

if trace_api_version == 4 {
// Pre pallet-message-queue
#[allow(deprecated)]
api.trace_transaction_before_version_5(
parent_block_hash,
Expand Down
5 changes: 3 additions & 2 deletions vendor/rpc/trace/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -859,7 +859,7 @@ where
// Trace the block.
let f = || -> Result<_, String> {
let result = if trace_api_version >= 5 {
// The block is initialized inside "trace_transaction"
// The block is initialized inside "trace_block"
api.trace_block(
substrate_parent_hash,
extrinsics,
Expand All @@ -869,7 +869,8 @@ where
} else {
// Old "trace_block" api did not initialize block before applying transactions,
// so we need to do it here before calling "trace_block".
api.initialize_block(substrate_parent_hash, &block_header)
#[allow(deprecated)]
api.initialize_block_before_version_5(substrate_parent_hash, &block_header)
.map_err(|e| format!("Runtime api access error: {:?}", e))?;

#[allow(deprecated)]
Expand Down

0 comments on commit 2280899

Please sign in to comment.