From a5dca2b320ff42caab0d40bd4cbea80537fc7f2a Mon Sep 17 00:00:00 2001 From: Bryan White Date: Fri, 22 Mar 2024 21:30:25 +0100 Subject: [PATCH] fixup! review: feedback improvement --- x/proof/keeper/msg_server_create_claim_test.go | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/x/proof/keeper/msg_server_create_claim_test.go b/x/proof/keeper/msg_server_create_claim_test.go index 6ad1f59d7..6aef6b5a3 100644 --- a/x/proof/keeper/msg_server_create_claim_test.go +++ b/x/proof/keeper/msg_server_create_claim_test.go @@ -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) @@ -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) @@ -161,7 +163,7 @@ func TestMsgServer_CreateClaim_Error(t *testing.T) { supplierAddr, appAddr, service, - nil, + defaultMerkleRoot, ) }, expectedErr: status.Error( @@ -182,7 +184,7 @@ func TestMsgServer_CreateClaim_Error(t *testing.T) { wrongSupplierAddr, appAddr, service, - nil, + defaultMerkleRoot, ) }, expectedErr: status.Error( @@ -203,7 +205,7 @@ func TestMsgServer_CreateClaim_Error(t *testing.T) { randSupplierAddr, appAddr, service, - nil, + defaultMerkleRoot, ) }, expectedErr: status.Error( @@ -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( @@ -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( @@ -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{