Skip to content

Commit

Permalink
ETH RPC: receipts: use correct txtype in receipts (filecoin-project#1…
Browse files Browse the repository at this point in the history
…2332)

* fix bug in receipt for txtype for legacy txns

* update ChangeLog

* Update CHANGELOG.md

Co-authored-by: Rod Vagg <[email protected]>

---------

Co-authored-by: Rod Vagg <[email protected]>
  • Loading branch information
2 people authored and ribasushi committed Aug 16, 2024
1 parent fa2f318 commit 1943f83
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions itests/eth_legacy_transactions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ func TestLegacyValueTransferValidSignature(t *testing.T) {
require.EqualValues(t, ethAddr, receipt.From)
require.EqualValues(t, ethAddr2, *receipt.To)
require.EqualValues(t, hash, receipt.TransactionHash)
require.EqualValues(t, ethtypes.EthLegacyTxType, receipt.Type)

// Success.
require.EqualValues(t, ethtypes.EthUint64(0x1), receipt.Status)
Expand Down Expand Up @@ -227,6 +228,7 @@ func TestLegacyEIP155ValueTransferValidSignature(t *testing.T) {
require.EqualValues(t, ethAddr, receipt.From)
require.EqualValues(t, ethAddr2, *receipt.To)
require.EqualValues(t, hash, receipt.TransactionHash)
require.EqualValues(t, ethtypes.EthLegacyTxType, receipt.Type)

// Success.
require.EqualValues(t, ethtypes.EthUint64(0x1), receipt.Status)
Expand Down
1 change: 1 addition & 0 deletions itests/eth_transactions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ func TestValueTransferValidSignature(t *testing.T) {
require.EqualValues(t, ethAddr, receipt.From)
require.EqualValues(t, ethAddr2, *receipt.To)
require.EqualValues(t, hash, receipt.TransactionHash)
require.EqualValues(t, ethtypes.EIP1559TxType, receipt.Type)

// Success.
require.EqualValues(t, ethtypes.EthUint64(0x1), receipt.Status)
Expand Down
2 changes: 1 addition & 1 deletion node/impl/full/eth_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,7 @@ func newEthTxReceipt(ctx context.Context, tx ethtypes.EthTx, lookup *api.MsgLook
TransactionIndex: transactionIndex,
BlockHash: blockHash,
BlockNumber: blockNumber,
Type: ethtypes.EthUint64(2),
Type: tx.Type,
Logs: []ethtypes.EthLog{}, // empty log array is compulsory when no logs, or libraries like ethers.js break
LogsBloom: ethtypes.NewEmptyEthBloom(),
}
Expand Down

0 comments on commit 1943f83

Please sign in to comment.