Skip to content

Commit

Permalink
chore: review feedback improvements
Browse files Browse the repository at this point in the history
Co-authored-by: @red-0ne

Co-authored-by: Redouane Lakrache <[email protected]>
  • Loading branch information
bryanchriswhite and red-0ne authored Jun 27, 2024
1 parent 8f3a903 commit 3cbed1d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion tests/integration/tokenomics/tokenomics_example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func TestTokenomicsIntegrationExample(t *testing.T) {

// Need to wait until the earliest claim commit height
currentBlockHeight := integrationApp.GetSdkCtx().BlockHeight()
numBlocksUntilClaimWindowIsOpen := int(earliestClaimCommitHeight - currentBlockHeight) //+ 1)
numBlocksUntilClaimWindowIsOpen := int(earliestClaimCommitHeight - currentBlockHeight)
for i := 0; i < numBlocksUntilClaimWindowIsOpen; i++ {
integrationApp.NextBlock(t)
}
Expand Down
2 changes: 1 addition & 1 deletion x/proof/keeper/msg_server_create_claim_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func TestMsgServer_CreateClaim_Success(t *testing.T) {
) int64
}{
{
desc: "claim message height equals earliest claim commit height",
desc: "claim message height equals supplier's earliest claim commit height",
getClaimMsgHeight: func(sharedParams *sharedtypes.Params, queryHeight int64) int64 {
return shared.GetEarliestSupplierClaimCommitHeight(
sharedParams,
Expand Down
2 changes: 1 addition & 1 deletion x/proof/keeper/msg_server_submit_proof_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func TestMsgServer_SubmitProof_Success(t *testing.T) {
) int64
}{
{
desc: "proof message height equals proof window open height",
desc: "proof message height equals supplier's earliest proof commit height",
getProofMsgHeight: func(sharedParams *sharedtypes.Params, queryHeight int64, supplierAddr string) int64 {
return shared.GetEarliestSupplierProofCommitHeight(
sharedParams,
Expand Down
8 changes: 6 additions & 2 deletions x/proof/keeper/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,11 @@ func (k msgServer) validateClaimWindow(
sdkCtx := cosmostypes.UnwrapSDKContext(ctx)
currentHeight := sdkCtx.BlockHeight()

// Ensure the current block height is ON or AFTER the earliest claim commit height.
// Ensure the current block height is ON or AFTER the supplier's earliest claim commit height.
// TODO_BLOCKER(@bryanchriswhite, @red-0ne): Enforce an additional "latest
// supplier claim/proof commit offset" such that all suppliers have the same
// "supplier claim/proof commit window" size.
// See: https://github.com/pokt-network/poktroll/pull/620/files#r1656548473.
if currentHeight < earliestClaimCommitHeight {
return types.ErrProofClaimOutsideOfWindow.Wrapf(
"current block height (%d) is less than the session's earliest claim commit height (%d)",
Expand Down Expand Up @@ -176,7 +180,7 @@ func (k msgServer) validateProofWindow(
sdkCtx := cosmostypes.UnwrapSDKContext(ctx)
currentHeight := sdkCtx.BlockHeight()

// Ensure the current block height is ON or AFTER the proof window open height.
// Ensure the current block height is ON or AFTER the earliest proof commit height.
if currentHeight < earliestProofCommitHeight {
return types.ErrProofProofOutsideOfWindow.Wrapf(
"current block height (%d) is less than session's earliest proof commit height (%d)",
Expand Down

0 comments on commit 3cbed1d

Please sign in to comment.