Skip to content

Commit

Permalink
ETH RPC: receipts: use correct txtype in receipts (#12332)
Browse files Browse the repository at this point in the history
* 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
aarshkshah1992 and rvagg authored Aug 1, 2024
1 parent ba07505 commit 1177717
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
- https://github.com/filecoin-project/lotus/pull/12295 Upgrade to go-f3 v0.0.6
- https://github.com/filecoin-project/lotus/pull/12292: feat: p2p: allow overriding bootstrap nodes with environmemnt variable
- https://github.com/filecoin-project/lotus/pull/12319: feat: `lotus send CLI`: allow sending to ETH addresses
- https://github.com/filecoin-project/lotus/pull/12332: fix: ETH RPC: receipts: use correct txtype in receipts

## New features

Expand Down
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 @@ -98,6 +98,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 @@ -699,7 +699,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 1177717

Please sign in to comment.