mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 10:22:23 +00:00
fix StateAccount.EncodeRLP (#648)
This commit is contained in:
parent
edb91fee55
commit
669e096e47
1 changed files with 21 additions and 20 deletions
|
|
@ -1,25 +1,26 @@
|
|||
// TODO: fix me
|
||||
// Code generated by rlpgen. DO NOT EDIT.
|
||||
|
||||
package types
|
||||
|
||||
// import "github.com/ethereum/go-ethereum/rlp"
|
||||
// import "io"
|
||||
import "github.com/ethereum/go-ethereum/rlp"
|
||||
import "io"
|
||||
|
||||
// func (obj *StateAccount) EncodeRLP(_w io.Writer) error {
|
||||
// w := rlp.NewEncoderBuffer(_w)
|
||||
// _tmp0 := w.List()
|
||||
// w.WriteUint64(obj.Nonce)
|
||||
// if obj.Balance == nil {
|
||||
// w.Write(rlp.EmptyString)
|
||||
// } else {
|
||||
// if obj.Balance.Sign() == -1 {
|
||||
// return rlp.ErrNegativeBigInt
|
||||
// }
|
||||
// w.WriteBigInt(obj.Balance)
|
||||
// }
|
||||
// w.WriteBytes(obj.Root[:])
|
||||
// w.WriteBytes(obj.CodeHash)
|
||||
// w.ListEnd(_tmp0)
|
||||
// return w.Flush()
|
||||
// }
|
||||
func (obj *StateAccount) EncodeRLP(_w io.Writer) error {
|
||||
w := rlp.NewEncoderBuffer(_w)
|
||||
_tmp0 := w.List()
|
||||
w.WriteUint64(obj.Nonce)
|
||||
if obj.Balance == nil {
|
||||
w.Write(rlp.EmptyString)
|
||||
} else {
|
||||
if obj.Balance.Sign() == -1 {
|
||||
return rlp.ErrNegativeBigInt
|
||||
}
|
||||
w.WriteBigInt(obj.Balance)
|
||||
}
|
||||
w.WriteBytes(obj.Root[:])
|
||||
w.WriteBytes(obj.KeccakCodeHash)
|
||||
w.WriteBytes(obj.PoseidonCodeHash)
|
||||
w.WriteUint64(obj.CodeSize)
|
||||
w.ListEnd(_tmp0)
|
||||
return w.Flush()
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue