Skip to content

Commit

Permalink
Fix for trace transaction (ethereum#228)
Browse files Browse the repository at this point in the history
  • Loading branch information
smartcontracts authored Feb 28, 2021
1 parent 8b348d7 commit 573ba36
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion core/state_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func ApplyTransaction(config *params.ChainConfig, bc ChainContext, author *commo
}
} else {
decompressor := config.StateDump.Accounts["OVM_SequencerEntrypoint"]
msg, err = asOvmMessage(tx, types.MakeSigner(config, header.Number), decompressor.Address)
msg, err = AsOvmMessage(tx, types.MakeSigner(config, header.Number), decompressor.Address)
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion core/state_transition_ovm.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func toExecutionManagerRun(evm *vm.EVM, msg Message) (Message, error) {
return outputmsg, nil
}

func asOvmMessage(tx *types.Transaction, signer types.Signer, decompressor common.Address) (Message, error) {
func AsOvmMessage(tx *types.Transaction, signer types.Signer, decompressor common.Address) (Message, error) {
msg, err := tx.AsMessage(signer)
if err != nil {
// This should only be allowed to pass if the transaction is in the ctc
Expand Down
10 changes: 9 additions & 1 deletion eth/api_tracer.go
Original file line number Diff line number Diff line change
Expand Up @@ -805,7 +805,15 @@ func (api *PrivateDebugAPI) computeTxEnv(blockHash common.Hash, txIndex int, ree

for idx, tx := range block.Transactions() {
// Assemble the transaction call message and return if the requested offset
msg, _ := tx.AsMessage(signer)
var msg core.Message
if !vm.UsingOVM {
msg, _ = tx.AsMessage(signer)
} else {
msg, err = core.AsOvmMessage(tx, signer, common.HexToAddress("0x4200000000000000000000000000000000000005"))
if err != nil {
return nil, vm.Context{}, nil, err
}
}
context := core.NewEVMContext(msg, block.Header(), api.eth.blockchain, nil)
if idx == txIndex {
return msg, context, statedb, nil
Expand Down

0 comments on commit 573ba36

Please sign in to comment.