ETH RPC: receipts: use correct txtype in receipts (#12332)

* fix bug in receipt for txtype for legacy txns

* update ChangeLog

* Update CHANGELOG.md

Co-authored-by: Rod Vagg <rod@vagg.org>

---------

Co-authored-by: Rod Vagg <rod@vagg.org>
This commit is contained in:
Aarsh Shah
2024-08-01 15:36:44 +04:00
committed by GitHub
parent ba07505963
commit 1177717127
4 changed files with 5 additions and 1 deletions

View File

@ -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

View File

@ -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)
@ -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)

View File

@ -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)

View File

@ -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(),
}