Skip to content

Commit

Permalink
Merge pull request #180 from multiversx/merge-rc-v1.5-freeze-account
Browse files Browse the repository at this point in the history
Merge rc v1.5 freeze account
  • Loading branch information
AdoAdoAdo authored Mar 8, 2023
2 parents d6f693e + 7ebd461 commit 12c2650
Show file tree
Hide file tree
Showing 8 changed files with 398 additions and 255 deletions.
255 changes: 0 additions & 255 deletions core/mock/headerHandlerStub.go

This file was deleted.

34 changes: 34 additions & 0 deletions data/block/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
package block

import (
"fmt"
"math/big"

"github.com/multiversx/mx-chain-core-go/data"
Expand Down Expand Up @@ -581,3 +582,36 @@ func (h *Header) GetAdditionalData() headerVersionData.HeaderAdditionalData {
// no extra data for the initial version of shard block header
return nil
}

// CheckFieldsForNil checks a predefined set of fields for nil values
func (h *Header) CheckFieldsForNil() error {
if h == nil {
return data.ErrNilPointerReceiver
}
if h.PrevHash == nil {
return fmt.Errorf("%w in Header.PrevHash", data.ErrNilValue)
}
if h.PrevRandSeed == nil {
return fmt.Errorf("%w in Header.PrevRandSeed", data.ErrNilValue)
}
if h.RandSeed == nil {
return fmt.Errorf("%w in Header.RandSeed", data.ErrNilValue)
}
if h.RootHash == nil {
return fmt.Errorf("%w in Header.RootHash", data.ErrNilValue)
}
if h.ChainID == nil {
return fmt.Errorf("%w in Header.ChainID", data.ErrNilValue)
}
if h.SoftwareVersion == nil {
return fmt.Errorf("%w in Header.SoftwareVersion", data.ErrNilValue)
}
if h.AccumulatedFees == nil {
return fmt.Errorf("%w in Header.AccumulatedFees", data.ErrNilValue)
}
if h.DeveloperFees == nil {
return fmt.Errorf("%w in Header.DeveloperFees", data.ErrNilValue)
}

return nil
}
Loading

0 comments on commit 12c2650

Please sign in to comment.