Skip to content

Commit

Permalink
Update to ABCILastResponseskey (#9253)
Browse files Browse the repository at this point in the history
* update last responses key
  • Loading branch information
samricotta authored Aug 15, 2022
1 parent 08f5559 commit 2740491
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions state/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ func calcABCIResponsesKey(height int64) []byte {
return []byte(fmt.Sprintf("abciResponsesKey:%v", height))
}

func calcLastABCIResponsesKey(height int64) []byte {
return []byte(fmt.Sprintf("lastABCIResponsesKey:%v", height))
}

//----------------------

var (
lastABCIResponseKey = []byte("lastABCIResponseKey")
)

//go:generate ../scripts/mockery_generate.sh Store

// Store defines the state store interface
Expand Down Expand Up @@ -410,7 +410,7 @@ func (store dbStore) LoadABCIResponses(height int64) (*tmstate.ABCIResponses, er
// This method is used for recovering in the case that we called the Commit ABCI
// method on the application but crashed before persisting the results.
func (store dbStore) LoadLastABCIResponse(height int64) (*tmstate.ABCIResponses, error) {
bz, err := store.db.Get(calcLastABCIResponsesKey(height))
bz, err := store.db.Get(lastABCIResponseKey)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -473,7 +473,7 @@ func (store dbStore) SaveABCIResponses(height int64, abciResponses *tmstate.ABCI
return err
}

return store.db.SetSync(calcLastABCIResponsesKey(height), bz)
return store.db.SetSync(lastABCIResponseKey, bz)
}

//-----------------------------------------------------------------------------
Expand Down

0 comments on commit 2740491

Please sign in to comment.