Skip to content

Commit

Permalink
fixup! review: feedback improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
bryanchriswhite committed Mar 22, 2024
1 parent 7b28d62 commit a5dca2b
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions x/proof/keeper/msg_server_create_claim_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ import (
sharedtypes "github.com/pokt-network/poktroll/x/shared/types"
)

var defaultMerkleRoot = []byte{0, 1, 0, 1}

func TestMsgServer_CreateClaim_Success(t *testing.T) {
// Set block height to 1 so there is a valid session on-chain.
blockHeightOpt := keepertest.WithBlockHeight(1)
Expand Down Expand Up @@ -56,7 +58,7 @@ func TestMsgServer_CreateClaim_Success(t *testing.T) {
supplierAddr,
appAddr,
service,
nil,
defaultMerkleRoot,
)
createClaimRes, err := srv.CreateClaim(ctx, claimMsg)
require.NoError(t, err)
Expand Down Expand Up @@ -161,7 +163,7 @@ func TestMsgServer_CreateClaim_Error(t *testing.T) {
supplierAddr,
appAddr,
service,
nil,
defaultMerkleRoot,
)
},
expectedErr: status.Error(
Expand All @@ -182,7 +184,7 @@ func TestMsgServer_CreateClaim_Error(t *testing.T) {
wrongSupplierAddr,
appAddr,
service,
nil,
defaultMerkleRoot,
)
},
expectedErr: status.Error(
Expand All @@ -203,7 +205,7 @@ func TestMsgServer_CreateClaim_Error(t *testing.T) {
randSupplierAddr,
appAddr,
service,
nil,
defaultMerkleRoot,
)
},
expectedErr: status.Error(
Expand All @@ -224,7 +226,7 @@ func TestMsgServer_CreateClaim_Error(t *testing.T) {
// Use an application address not included in the session.
wrongAppAddr,
service,
nil,
defaultMerkleRoot,
)
},
expectedErr: status.Error(
Expand All @@ -245,7 +247,7 @@ func TestMsgServer_CreateClaim_Error(t *testing.T) {
// Use an application address that's nonexistent on-chain.
randAppAddr,
service,
nil,
defaultMerkleRoot,
)
},
expectedErr: status.Error(
Expand Down Expand Up @@ -278,10 +280,6 @@ func newTestClaimMsg(
) *types.MsgCreateClaim {
t.Helper()

if merkleRoot == nil {
merkleRoot = []byte{0, 1, 0, 1}
}

return types.NewMsgCreateClaim(
supplierAddr,
&sessiontypes.SessionHeader{
Expand Down

0 comments on commit a5dca2b

Please sign in to comment.