Skip to content

Commit

Permalink
logs
Browse files Browse the repository at this point in the history
  • Loading branch information
leonz789 committed Nov 12, 2024
1 parent b60d52c commit 062b5f4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions x/oracle/keeper/nonce.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ func (k Keeper) RemoveNonceWithFeederIDForAll(ctx sdk.Context, feederID uint64)
// CheckAndIncreaseNonce check and increase the nonce for a specific validator and feederID
func (k Keeper) CheckAndIncreaseNonce(ctx sdk.Context, validator string, feederID uint64, nonce uint32) (prevNonce uint32, err error) {
if nonce > uint32(common.MaxNonce) {
return 0, fmt.Errorf("nonce is too large, should be no more than:%d, got:%d", common.MaxNonce, nonce)
return 0, fmt.Errorf("nonce_check_failed: max_exceeded: limit=%d received=%d", common.MaxNonce, nonce)
}
store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.NonceKeyPrefix))
if n, found := k.getNonce(store, validator); found {
Expand All @@ -122,12 +122,12 @@ func (k Keeper) CheckAndIncreaseNonce(ctx sdk.Context, validator string, feederI
k.setNonce(store, n)
return nonce - 1, nil
}
return v.Value, fmt.Errorf("nonce is not consecutive, expected:%d, got:%d", v.Value+1, nonce)
return v.Value, fmt.Errorf("nonce_check_failed: non_consecutive: expected=%d received=%d", v.Value+1, nonce)
}
}
return 0, fmt.Errorf("feederID not found in vaildator's nonce list, consAddr:%s, feederID:%d", validator, feederID)
return 0, fmt.Errorf("nonce_check_failed: feeder_not_found: validator=%s feeder_id=%d", validator, feederID)
}
return 0, fmt.Errorf("validator for the consKey which signed the create-price tx is not included in active validator set, signer consAddr:%s", validator)
return 0, fmt.Errorf("nonce_check_failed: validator_not_active: validator=%s tx_type=create-price", validator)
}

// internal usage for avoiding duplicated 'NewStore'
Expand Down

0 comments on commit 062b5f4

Please sign in to comment.