Skip to content

Commit

Permalink
ethrpc: Add missing fields to EthTx
Browse files Browse the repository at this point in the history
  • Loading branch information
magik6k committed Feb 9, 2023
1 parent 9339267 commit 0efd461
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
4 changes: 3 additions & 1 deletion chain/types/ethtypes/eth_transactions.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ type EthTx struct {
Gas EthUint64 `json:"gas"`
MaxFeePerGas EthBigInt `json:"maxFeePerGas"`
MaxPriorityFeePerGas EthBigInt `json:"maxPriorityFeePerGas"`
V EthBigInt `json:"v"`
AccessList []EthHash `json:"accessList"`
V EthBigInt `json:"yParity"`
R EthBigInt `json:"r"`
S EthBigInt `json:"s"`
}
Expand Down Expand Up @@ -86,6 +87,7 @@ func EthTxFromSignedEthMessage(smsg *types.SignedMessage) (EthTx, error) {
Gas: EthUint64(txArgs.GasLimit),
MaxFeePerGas: EthBigInt(txArgs.MaxFeePerGas),
MaxPriorityFeePerGas: EthBigInt(txArgs.MaxPriorityFeePerGas),
AccessList: []EthHash{},
V: v,
R: r,
S: s,
Expand Down
9 changes: 0 additions & 9 deletions itests/eth_conformance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,6 @@ func TestEthOpenRPCConformance(t *testing.T) {
require.NoError(t, err)
defer closer()

const skipUntilIssue10106 = "Skipped until EthTx is updated, see https://github.com/filecoin-project/lotus/issues/10106"

testCases := []struct {
method string
variant string // suffix applied to the test name to distinguish different variants of a method call
Expand Down Expand Up @@ -227,7 +225,6 @@ func TestEthOpenRPCConformance(t *testing.T) {
call: func(a *ethAPIRaw) (json.RawMessage, error) {
return ethapi.EthGetBlockByHash(context.Background(), blockHashWithMessage, true)
},
skipReason: skipUntilIssue10106,
},

{
Expand All @@ -236,7 +233,6 @@ func TestEthOpenRPCConformance(t *testing.T) {
call: func(a *ethAPIRaw) (json.RawMessage, error) {
return ethapi.EthGetBlockByNumber(context.Background(), "earliest", true)
},
skipReason: skipUntilIssue10106,
},

{
Expand All @@ -245,15 +241,13 @@ func TestEthOpenRPCConformance(t *testing.T) {
call: func(a *ethAPIRaw) (json.RawMessage, error) {
return ethapi.EthGetBlockByNumber(context.Background(), "pending", true)
},
skipReason: skipUntilIssue10106,
},

{
method: "eth_getBlockByNumber",
call: func(a *ethAPIRaw) (json.RawMessage, error) {
return ethapi.EthGetBlockByNumber(context.Background(), blockNumberWithMessage.Hex(), true)
},
skipReason: skipUntilIssue10106,
},

{
Expand Down Expand Up @@ -329,23 +323,20 @@ func TestEthOpenRPCConformance(t *testing.T) {
call: func(a *ethAPIRaw) (json.RawMessage, error) {
return ethapi.EthGetTransactionByBlockHashAndIndex(context.Background(), blockHashWithMessage, ethtypes.EthUint64(0))
},
skipReason: skipUntilIssue10106,
},

{
method: "eth_getTransactionByBlockNumberAndIndex",
call: func(a *ethAPIRaw) (json.RawMessage, error) {
return ethapi.EthGetTransactionByBlockNumberAndIndex(context.Background(), blockNumberWithMessage, ethtypes.EthUint64(0))
},
skipReason: skipUntilIssue10106,
},

{
method: "eth_getTransactionByHash",
call: func(a *ethAPIRaw) (json.RawMessage, error) {
return ethapi.EthGetTransactionByHash(context.Background(), &messageWithEvents)
},
skipReason: skipUntilIssue10106,
},

{
Expand Down
1 change: 1 addition & 0 deletions node/impl/full/eth.go
Original file line number Diff line number Diff line change
Expand Up @@ -1757,6 +1757,7 @@ func ethTxFromNativeMessage(ctx context.Context, msg *types.Message, sa StateAPI
Gas: ethtypes.EthUint64(msg.GasLimit),
MaxFeePerGas: ethtypes.EthBigInt(msg.GasFeeCap),
MaxPriorityFeePerGas: ethtypes.EthBigInt(msg.GasPremium),
AccessList: []ethtypes.EthHash{},
}
}

Expand Down

0 comments on commit 0efd461

Please sign in to comment.