mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
Revert "core/types: go generate (#27196)"
This reverts commit 2984cb3ae0.
This commit is contained in:
parent
77d6c6f6f0
commit
58a2b18756
2 changed files with 2 additions and 19 deletions
|
|
@ -33,7 +33,6 @@ func (h Header) MarshalJSON() ([]byte, error) {
|
|||
Nonce BlockNonce `json:"nonce"`
|
||||
BaseFee *hexutil.Big `json:"baseFeePerGas" rlp:"optional"`
|
||||
WithdrawalsHash *common.Hash `json:"withdrawalsRoot" rlp:"optional"`
|
||||
ExcessDataGas *big.Int `json:"excessDataGas" rlp:"optional"`
|
||||
Hash common.Hash `json:"hash"`
|
||||
}
|
||||
var enc Header
|
||||
|
|
@ -54,7 +53,6 @@ func (h Header) MarshalJSON() ([]byte, error) {
|
|||
enc.Nonce = h.Nonce
|
||||
enc.BaseFee = (*hexutil.Big)(h.BaseFee)
|
||||
enc.WithdrawalsHash = h.WithdrawalsHash
|
||||
enc.ExcessDataGas = h.ExcessDataGas
|
||||
enc.Hash = h.Hash()
|
||||
return json.Marshal(&enc)
|
||||
}
|
||||
|
|
@ -79,7 +77,6 @@ func (h *Header) UnmarshalJSON(input []byte) error {
|
|||
Nonce *BlockNonce `json:"nonce"`
|
||||
BaseFee *hexutil.Big `json:"baseFeePerGas" rlp:"optional"`
|
||||
WithdrawalsHash *common.Hash `json:"withdrawalsRoot" rlp:"optional"`
|
||||
ExcessDataGas *big.Int `json:"excessDataGas" rlp:"optional"`
|
||||
}
|
||||
var dec Header
|
||||
if err := json.Unmarshal(input, &dec); err != nil {
|
||||
|
|
@ -148,8 +145,5 @@ func (h *Header) UnmarshalJSON(input []byte) error {
|
|||
if dec.WithdrawalsHash != nil {
|
||||
h.WithdrawalsHash = dec.WithdrawalsHash
|
||||
}
|
||||
if dec.ExcessDataGas != nil {
|
||||
h.ExcessDataGas = dec.ExcessDataGas
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,8 +42,7 @@ func (obj *Header) EncodeRLP(_w io.Writer) error {
|
|||
w.WriteBytes(obj.Nonce[:])
|
||||
_tmp1 := obj.BaseFee != nil
|
||||
_tmp2 := obj.WithdrawalsHash != nil
|
||||
_tmp3 := obj.ExcessDataGas != nil
|
||||
if _tmp1 || _tmp2 || _tmp3 {
|
||||
if _tmp1 || _tmp2 {
|
||||
if obj.BaseFee == nil {
|
||||
w.Write(rlp.EmptyString)
|
||||
} else {
|
||||
|
|
@ -53,23 +52,13 @@ func (obj *Header) EncodeRLP(_w io.Writer) error {
|
|||
w.WriteBigInt(obj.BaseFee)
|
||||
}
|
||||
}
|
||||
if _tmp2 || _tmp3 {
|
||||
if _tmp2 {
|
||||
if obj.WithdrawalsHash == nil {
|
||||
w.Write([]byte{0x80})
|
||||
} else {
|
||||
w.WriteBytes(obj.WithdrawalsHash[:])
|
||||
}
|
||||
}
|
||||
if _tmp3 {
|
||||
if obj.ExcessDataGas == nil {
|
||||
w.Write(rlp.EmptyString)
|
||||
} else {
|
||||
if obj.ExcessDataGas.Sign() == -1 {
|
||||
return rlp.ErrNegativeBigInt
|
||||
}
|
||||
w.WriteBigInt(obj.ExcessDataGas)
|
||||
}
|
||||
}
|
||||
w.ListEnd(_tmp0)
|
||||
return w.Flush()
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue