mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-23 05:06:43 +00:00
use big int for block number
This commit is contained in:
parent
baa9835ee8
commit
14d351fe19
2 changed files with 6 additions and 6 deletions
|
|
@ -881,7 +881,7 @@ type CallError struct {
|
||||||
|
|
||||||
// SimulateBlockResult represents the result of a simulated block.
|
// SimulateBlockResult represents the result of a simulated block.
|
||||||
type SimulateBlockResult struct {
|
type SimulateBlockResult struct {
|
||||||
Number uint64 `json:"number"`
|
Number *big.Int `json:"number"`
|
||||||
Hash common.Hash `json:"hash"`
|
Hash common.Hash `json:"hash"`
|
||||||
Timestamp uint64 `json:"timestamp"`
|
Timestamp uint64 `json:"timestamp"`
|
||||||
GasLimit uint64 `json:"gasLimit"`
|
GasLimit uint64 `json:"gasLimit"`
|
||||||
|
|
@ -892,7 +892,7 @@ type SimulateBlockResult struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
type simulateBlockResultMarshaling struct {
|
type simulateBlockResultMarshaling struct {
|
||||||
Number hexutil.Uint64
|
Number *hexutil.Big
|
||||||
Timestamp hexutil.Uint64
|
Timestamp hexutil.Uint64
|
||||||
GasLimit hexutil.Uint64
|
GasLimit hexutil.Uint64
|
||||||
GasUsed hexutil.Uint64
|
GasUsed hexutil.Uint64
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ var _ = (*simulateBlockResultMarshaling)(nil)
|
||||||
// MarshalJSON marshals as JSON.
|
// MarshalJSON marshals as JSON.
|
||||||
func (s SimulateBlockResult) MarshalJSON() ([]byte, error) {
|
func (s SimulateBlockResult) MarshalJSON() ([]byte, error) {
|
||||||
type SimulateBlockResult struct {
|
type SimulateBlockResult struct {
|
||||||
Number hexutil.Uint64 `json:"number"`
|
Number *hexutil.Big `json:"number"`
|
||||||
Hash common.Hash `json:"hash"`
|
Hash common.Hash `json:"hash"`
|
||||||
Timestamp hexutil.Uint64 `json:"timestamp"`
|
Timestamp hexutil.Uint64 `json:"timestamp"`
|
||||||
GasLimit hexutil.Uint64 `json:"gasLimit"`
|
GasLimit hexutil.Uint64 `json:"gasLimit"`
|
||||||
|
|
@ -25,7 +25,7 @@ func (s SimulateBlockResult) MarshalJSON() ([]byte, error) {
|
||||||
Calls []SimulateCallResult `json:"calls"`
|
Calls []SimulateCallResult `json:"calls"`
|
||||||
}
|
}
|
||||||
var enc SimulateBlockResult
|
var enc SimulateBlockResult
|
||||||
enc.Number = hexutil.Uint64(s.Number)
|
enc.Number = (*hexutil.Big)(s.Number)
|
||||||
enc.Hash = s.Hash
|
enc.Hash = s.Hash
|
||||||
enc.Timestamp = hexutil.Uint64(s.Timestamp)
|
enc.Timestamp = hexutil.Uint64(s.Timestamp)
|
||||||
enc.GasLimit = hexutil.Uint64(s.GasLimit)
|
enc.GasLimit = hexutil.Uint64(s.GasLimit)
|
||||||
|
|
@ -39,7 +39,7 @@ func (s SimulateBlockResult) MarshalJSON() ([]byte, error) {
|
||||||
// UnmarshalJSON unmarshals from JSON.
|
// UnmarshalJSON unmarshals from JSON.
|
||||||
func (s *SimulateBlockResult) UnmarshalJSON(input []byte) error {
|
func (s *SimulateBlockResult) UnmarshalJSON(input []byte) error {
|
||||||
type SimulateBlockResult struct {
|
type SimulateBlockResult struct {
|
||||||
Number *hexutil.Uint64 `json:"number"`
|
Number *hexutil.Big `json:"number"`
|
||||||
Hash *common.Hash `json:"hash"`
|
Hash *common.Hash `json:"hash"`
|
||||||
Timestamp *hexutil.Uint64 `json:"timestamp"`
|
Timestamp *hexutil.Uint64 `json:"timestamp"`
|
||||||
GasLimit *hexutil.Uint64 `json:"gasLimit"`
|
GasLimit *hexutil.Uint64 `json:"gasLimit"`
|
||||||
|
|
@ -53,7 +53,7 @@ func (s *SimulateBlockResult) UnmarshalJSON(input []byte) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if dec.Number != nil {
|
if dec.Number != nil {
|
||||||
s.Number = uint64(*dec.Number)
|
s.Number = (*big.Int)(dec.Number)
|
||||||
}
|
}
|
||||||
if dec.Hash != nil {
|
if dec.Hash != nil {
|
||||||
s.Hash = *dec.Hash
|
s.Hash = *dec.Hash
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue