mirror of
https://github.com/tendermint/tendermint.git
synced 2026-01-04 12:13:57 +00:00
dep: update tm-db to 0.4.0 (#4289)
* dep: update tm-db to 0.4.0 - update 0.4.0 as it is a breaking change and cannot be handled by depndabot Signed-off-by: Marko Baricevic <marbar3778@yahoo.com> * more work towards error handling * error and emtpy bytes handling * work on tests * add changelog entry, change some error handling * address some pr comments * panic in a few more places * move error higher up * redo some error handling * fix some bz == nil to len(bz) == 0 * change statebytes
This commit is contained in:
@@ -1158,12 +1158,15 @@ func LoadStateFromDBOrGenesisDocProvider(
|
||||
|
||||
// panics if failed to unmarshal bytes
|
||||
func loadGenesisDoc(db dbm.DB) (*types.GenesisDoc, error) {
|
||||
b := db.Get(genesisDocKey)
|
||||
b, err := db.Get(genesisDocKey)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
if len(b) == 0 {
|
||||
return nil, errors.New("genesis doc not found")
|
||||
}
|
||||
var genDoc *types.GenesisDoc
|
||||
err := cdc.UnmarshalJSON(b, &genDoc)
|
||||
err = cdc.UnmarshalJSON(b, &genDoc)
|
||||
if err != nil {
|
||||
panic(fmt.Sprintf("Failed to load genesis doc due to unmarshaling error: %v (bytes: %X)", err, b))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user