Skip to content

Commit

Permalink
Fixes set latest data commitment nonce (#481)
Browse files Browse the repository at this point in the history
* fixes set latest data commitment nonce

* add todo
  • Loading branch information
rach-id committed Jun 10, 2022
1 parent d537ff4 commit b8ebb36
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion x/qgb/keeper/keeper_data_commitment.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,9 @@ func (k Keeper) StoreDataCommitment(ctx sdk.Context, dc types.DataCommitment) {
// expected that this value will only increase it panics on an attempt
// to decrement
func (k Keeper) SetLatestDataCommitmentNonce(ctx sdk.Context, nonce uint64) {
// TODO add test
// this is purely an increasing counter and should never decrease
if k.CheckLatestValsetNonce(ctx) && k.GetLatestValsetNonce(ctx) > nonce {
if k.CheckLatestDataCommitmentNonce(ctx) && k.GetLatestDataCommitmentNonce(ctx) > nonce {
panic("Decrementing data commitment nonce!")
}

Expand Down

0 comments on commit b8ebb36

Please sign in to comment.