feat: simapp/v2 (#20412)
Co-authored-by: marbar3778 <marbar3778@yahoo.com> Co-authored-by: Marko <marko@baricevic.me> Co-authored-by: Likhita Polavarapu <78951027+likhita-809@users.noreply.github.com> Co-authored-by: unknown unknown <unknown@unknown>
This commit is contained in:
co-authored by
marbar3778
Marko
Likhita Polavarapu
unknown unknown
parent
ca195c1527
commit
2d014b26c2
@@ -33,6 +33,10 @@ func (i *Info) Bytes() ([]byte, error) {
|
||||
binary.LittleEndian.PutUint64(heightBytes, uint64(i.Height))
|
||||
buf = append(buf, heightBytes...)
|
||||
|
||||
// TODO; permit empty hash OK for genesis block?
|
||||
if len(i.Hash) == 0 {
|
||||
i.Hash = make([]byte, hashSize)
|
||||
}
|
||||
// Encode Hash
|
||||
if len(i.Hash) != hashSize {
|
||||
return nil, errors.New("invalid hash size")
|
||||
@@ -44,6 +48,9 @@ func (i *Info) Bytes() ([]byte, error) {
|
||||
binary.LittleEndian.PutUint64(timeBytes, uint64(i.Time.Unix()))
|
||||
buf = append(buf, timeBytes...)
|
||||
|
||||
if len(i.AppHash) == 0 {
|
||||
i.AppHash = make([]byte, hashSize)
|
||||
}
|
||||
// Encode AppHash
|
||||
if len(i.Hash) != hashSize {
|
||||
return nil, errors.New("invalid hash size")
|
||||
|
||||
Reference in New Issue
Block a user