Skip to content

Commit

Permalink
Update to ABCILastResponseskey (#9253)
Browse files Browse the repository at this point in the history
* update last responses key

Co-authored-by: samricotta <[email protected]>
  • Loading branch information
tnasu and samricotta committed Jul 18, 2023
1 parent cca63c8 commit 5e34cc3
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 @@ -42,12 +42,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 @@ -424,7 +424,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 @@ -487,7 +487,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 5e34cc3

Please sign in to comment.