Use BlockNonce type for marshaling nonce fields for blocks

pull/3550/head
SebastianJ 4 years ago
parent 72ae4da105
commit 28d025fdaf
  1. 7
      rpc/eth/types.go

@ -8,6 +8,7 @@ import (
"github.com/ethereum/go-ethereum/common/hexutil"
ethtypes "github.com/ethereum/go-ethereum/core/types"
"github.com/harmony-one/harmony/core/types"
hmytypes "github.com/harmony-one/harmony/core/types"
internal_common "github.com/harmony-one/harmony/internal/common"
rpc_common "github.com/harmony-one/harmony/rpc/common"
)
@ -17,7 +18,7 @@ type Block struct {
Number *hexutil.Big `json:"number"`
Hash common.Hash `json:"hash"`
ParentHash common.Hash `json:"parentHash"`
Nonce uint64 `json:"nonce"`
Nonce hmytypes.BlockNonce `json:"nonce"`
MixHash common.Hash `json:"mixHash"`
//UncleHash common.Hash `json:"sha3Uncles" - used in Ethereum RPC:s
LogsBloom ethtypes.Bloom `json:"logsBloom"`
@ -161,12 +162,12 @@ func newBlock(b *types.Block, leader common.Address) *Block {
Number: (*hexutil.Big)(head.Number()),
Hash: b.Hash(),
ParentHash: head.ParentHash(),
Nonce: 0, // Remove this because we don't have it in our header
Nonce: hmytypes.BlockNonce{}, // Legacy comment from hmy -> eth RPC porting: "Remove this because we don't have it in our header"
MixHash: head.MixDigest(),
LogsBloom: head.Bloom(),
StateRoot: head.Root(),
Miner: leader,
Difficulty: (*hexutil.Big)(big.NewInt(0)), // Remove this because we don't have it in our header
Difficulty: (*hexutil.Big)(big.NewInt(0)), // Legacy comment from hmy -> eth RPC porting: "Remove this because we don't have it in our header"
ExtraData: hexutil.Bytes(head.Extra()),
Size: hexutil.Uint64(b.Size()),
GasLimit: hexutil.Uint64(head.GasLimit()),

Loading…
Cancel
Save