Skip to content

Commit

Permalink
re-order fields for readability
Browse files Browse the repository at this point in the history
Basically:

1. Put types up-front.
2. Put potentially large fields at the bottom.

Previously, the action/result were serialized first which was...
annoying.
  • Loading branch information
Stebalien committed Feb 15, 2024
1 parent e085ca6 commit 8e1c5b8
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions chain/types/ethtypes/eth_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -987,12 +987,12 @@ func (e *EthBlockNumberOrHash) UnmarshalJSON(b []byte) error {
}

type EthTrace struct {
Action any `json:"action"`
Result any `json:"result"`
Subtraces int `json:"subtraces"`
TraceAddress []int `json:"traceAddress"`
Type string `json:"type"`
Error string `json:"error,omitempty"`
Subtraces int `json:"subtraces"`
TraceAddress []int `json:"traceAddress"`
Action any `json:"action"`
Result any `json:"result"`
}

type EthTraceBlock struct {
Expand All @@ -1016,8 +1016,8 @@ type EthCallTraceAction struct {
From EthAddress `json:"from"`
To EthAddress `json:"to"`
Gas EthUint64 `json:"gas"`
Input EthBytes `json:"input"`
Value EthBigInt `json:"value"`
Input EthBytes `json:"input"`
}

type EthCallTraceResult struct {
Expand All @@ -1028,12 +1028,12 @@ type EthCallTraceResult struct {
type EthCreateTraceAction struct {
From EthAddress `json:"from"`
Gas EthUint64 `json:"gas"`
Init EthBytes `json:"init"`
Value EthBigInt `json:"value"`
Init EthBytes `json:"init"`
}

type EthCreateTraceResult struct {
Address *EthAddress `json:"address,omitempty"`
GasUsed EthUint64 `json:"gasUsed"`
Code EthBytes `json:"code"`
Address *EthAddress `json:"address,omitempty"`
}

0 comments on commit 8e1c5b8

Please sign in to comment.