all: regenerate codecs with gencodec commit 90983d99de (#15830)

Fixes #15777 because null is now allowed for hexutil.Bytes.
This commit is contained in:
Felix Lange
2018-01-08 14:13:22 +01:00
committed by Péter Szilágyi
parent 5c2f1e0014
commit 9d06026c19
18 changed files with 96 additions and 96 deletions

View File

@ -56,7 +56,7 @@ func (g *Genesis) UnmarshalJSON(input []byte) error {
Config *params.ChainConfig `json:"config"`
Nonce *math.HexOrDecimal64 `json:"nonce"`
Timestamp *math.HexOrDecimal64 `json:"timestamp"`
ExtraData hexutil.Bytes `json:"extraData"`
ExtraData *hexutil.Bytes `json:"extraData"`
GasLimit *math.HexOrDecimal64 `json:"gasLimit" gencodec:"required"`
Difficulty *math.HexOrDecimal256 `json:"difficulty" gencodec:"required"`
Mixhash *common.Hash `json:"mixHash"`
@ -80,7 +80,7 @@ func (g *Genesis) UnmarshalJSON(input []byte) error {
g.Timestamp = uint64(*dec.Timestamp)
}
if dec.ExtraData != nil {
g.ExtraData = dec.ExtraData
g.ExtraData = *dec.ExtraData
}
if dec.GasLimit == nil {
return errors.New("missing required field 'gasLimit' for Genesis")

View File

@ -38,18 +38,18 @@ func (g GenesisAccount) MarshalJSON() ([]byte, error) {
func (g *GenesisAccount) UnmarshalJSON(input []byte) error {
type GenesisAccount struct {
Code hexutil.Bytes `json:"code,omitempty"`
Code *hexutil.Bytes `json:"code,omitempty"`
Storage map[storageJSON]storageJSON `json:"storage,omitempty"`
Balance *math.HexOrDecimal256 `json:"balance" gencodec:"required"`
Nonce *math.HexOrDecimal64 `json:"nonce,omitempty"`
PrivateKey hexutil.Bytes `json:"secretKey,omitempty"`
PrivateKey *hexutil.Bytes `json:"secretKey,omitempty"`
}
var dec GenesisAccount
if err := json.Unmarshal(input, &dec); err != nil {
return err
}
if dec.Code != nil {
g.Code = dec.Code
g.Code = *dec.Code
}
if dec.Storage != nil {
g.Storage = make(map[common.Hash]common.Hash, len(dec.Storage))
@ -65,7 +65,7 @@ func (g *GenesisAccount) UnmarshalJSON(input []byte) error {
g.Nonce = uint64(*dec.Nonce)
}
if dec.PrivateKey != nil {
g.PrivateKey = dec.PrivateKey
g.PrivateKey = *dec.PrivateKey
}
return nil
}

View File

@ -66,7 +66,7 @@ func (h *Header) UnmarshalJSON(input []byte) error {
GasLimit *hexutil.Uint64 `json:"gasLimit" gencodec:"required"`
GasUsed *hexutil.Uint64 `json:"gasUsed" gencodec:"required"`
Time *hexutil.Big `json:"timestamp" gencodec:"required"`
Extra hexutil.Bytes `json:"extraData" gencodec:"required"`
Extra *hexutil.Bytes `json:"extraData" gencodec:"required"`
MixDigest *common.Hash `json:"mixHash" gencodec:"required"`
Nonce *BlockNonce `json:"nonce" gencodec:"required"`
}
@ -125,7 +125,7 @@ func (h *Header) UnmarshalJSON(input []byte) error {
if dec.Extra == nil {
return errors.New("missing required field 'extraData' for Header")
}
h.Extra = dec.Extra
h.Extra = *dec.Extra
if dec.MixDigest == nil {
return errors.New("missing required field 'mixHash' for Header")
}

View File

@ -41,7 +41,7 @@ func (l *Log) UnmarshalJSON(input []byte) error {
type Log struct {
Address *common.Address `json:"address" gencodec:"required"`
Topics []common.Hash `json:"topics" gencodec:"required"`
Data hexutil.Bytes `json:"data" gencodec:"required"`
Data *hexutil.Bytes `json:"data" gencodec:"required"`
BlockNumber *hexutil.Uint64 `json:"blockNumber"`
TxHash *common.Hash `json:"transactionHash" gencodec:"required"`
TxIndex *hexutil.Uint `json:"transactionIndex" gencodec:"required"`
@ -64,7 +64,7 @@ func (l *Log) UnmarshalJSON(input []byte) error {
if dec.Data == nil {
return errors.New("missing required field 'data' for Log")
}
l.Data = dec.Data
l.Data = *dec.Data
if dec.BlockNumber != nil {
l.BlockNumber = uint64(*dec.BlockNumber)
}

View File

@ -37,7 +37,7 @@ func (r Receipt) MarshalJSON() ([]byte, error) {
func (r *Receipt) UnmarshalJSON(input []byte) error {
type Receipt struct {
PostState hexutil.Bytes `json:"root"`
PostState *hexutil.Bytes `json:"root"`
Status *hexutil.Uint `json:"status"`
CumulativeGasUsed *hexutil.Uint64 `json:"cumulativeGasUsed" gencodec:"required"`
Bloom *Bloom `json:"logsBloom" gencodec:"required"`
@ -51,7 +51,7 @@ func (r *Receipt) UnmarshalJSON(input []byte) error {
return err
}
if dec.PostState != nil {
r.PostState = dec.PostState
r.PostState = *dec.PostState
}
if dec.Status != nil {
r.Status = uint(*dec.Status)

View File

@ -47,7 +47,7 @@ func (t *txdata) UnmarshalJSON(input []byte) error {
GasLimit *hexutil.Uint64 `json:"gas" gencodec:"required"`
Recipient *common.Address `json:"to" rlp:"nil"`
Amount *hexutil.Big `json:"value" gencodec:"required"`
Payload hexutil.Bytes `json:"input" gencodec:"required"`
Payload *hexutil.Bytes `json:"input" gencodec:"required"`
V *hexutil.Big `json:"v" gencodec:"required"`
R *hexutil.Big `json:"r" gencodec:"required"`
S *hexutil.Big `json:"s" gencodec:"required"`
@ -79,7 +79,7 @@ func (t *txdata) UnmarshalJSON(input []byte) error {
if dec.Payload == nil {
return errors.New("missing required field 'input' for txdata")
}
t.Payload = dec.Payload
t.Payload = *dec.Payload
if dec.V == nil {
return errors.New("missing required field 'v' for txdata")
}

View File

@ -55,7 +55,7 @@ func (s *StructLog) UnmarshalJSON(input []byte) error {
Op *OpCode `json:"op"`
Gas *math.HexOrDecimal64 `json:"gas"`
GasCost *math.HexOrDecimal64 `json:"gasCost"`
Memory hexutil.Bytes `json:"memory"`
Memory *hexutil.Bytes `json:"memory"`
MemorySize *int `json:"memSize"`
Stack []*math.HexOrDecimal256 `json:"stack"`
Storage map[common.Hash]common.Hash `json:"-"`
@ -79,7 +79,7 @@ func (s *StructLog) UnmarshalJSON(input []byte) error {
s.GasCost = uint64(*dec.GasCost)
}
if dec.Memory != nil {
s.Memory = dec.Memory
s.Memory = *dec.Memory
}
if dec.MemorySize != nil {
s.MemorySize = *dec.MemorySize