diff --git a/core/state_processor.go b/core/state_processor.go index f757e0db06..26332e07f9 100644 --- a/core/state_processor.go +++ b/core/state_processor.go @@ -110,7 +110,7 @@ func applyTransaction(msg types.Message, config *params.ChainConfig, bc ChainCon // Create a new receipt for the transaction, storing the intermediate root and gas used // by the tx. - receipt := &types.Receipt{Type: tx.Type(), PostState: root, CumulativeGasUsed: *usedGas} + receipt := &types.Receipt{Type: tx.Type(), PostState: root, CumulativeGasUsed: *usedGas, Err: result.Err} if result.Failed() { receipt.Status = types.ReceiptStatusFailed } else { diff --git a/core/types/receipt.go b/core/types/receipt.go index e04259b9d8..402697d6fc 100644 --- a/core/types/receipt.go +++ b/core/types/receipt.go @@ -70,6 +70,7 @@ type Receipt struct { BlockHash common.Hash `json:"blockHash,omitempty"` BlockNumber *big.Int `json:"blockNumber,omitempty"` TransactionIndex uint `json:"transactionIndex"` + Err error `json:"error"` } type receiptMarshaling struct { diff --git a/eth/api_pre_exec.go b/eth/api_pre_exec.go index 64d7d44231..9c1cfaf236 100644 --- a/eth/api_pre_exec.go +++ b/eth/api_pre_exec.go @@ -135,7 +135,7 @@ func (api *PreExecAPI) GetLogs(ctx context.Context, origin *PreExecTx) (*types.R if err != nil { return nil, err } - return receipt, nil + return receipt, receipt.Err } // TraceTransaction tracing pre-exec transaction object.