Skip to content

Commit

Permalink
Cleanup Query Response Validation
Browse files Browse the repository at this point in the history
  • Loading branch information
joelsmith-2019 committed Oct 6, 2023
1 parent cbf3252 commit 0b8bae7
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions x/feepay/keeper/querier_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,12 @@ func (s *IntegrationTestSuite) TestQueryContract() {

// Ensure no error and response exists
s.Require().NoError(err)
s.Require().NotNil(res)
s.Require().Equal(res, &types.QueryFeePayContractResponse{
FeePayContract: &types.FeePayContract{
ContractAddress: contractAddr,
WalletLimit: 1,
},
})
})
}

Expand Down Expand Up @@ -71,7 +76,12 @@ func (s *IntegrationTestSuite) TestQueryContracts() {

// Ensure no error and response exists
s.Require().NoError(err)
s.Require().NotNil(res)
s.Require().Equal(res, &types.QueryFeePayContractResponse{
FeePayContract: &types.FeePayContract{
ContractAddress: contractAddr,
WalletLimit: 1,
},
})

// Append to lists
contractAddressList = append(contractAddressList, contractAddr)
Expand Down Expand Up @@ -169,7 +179,6 @@ func (s *IntegrationTestSuite) TestQueryEligibility() {

// Should error, contract should have no funds
s.Require().NoError(err)
s.Require().NotNil(res)
s.Require().True(res.Eligible)
})

Expand Down Expand Up @@ -220,7 +229,6 @@ func (s *IntegrationTestSuite) TestQueryUses() {

// Ensure no error and response is false, contract should have no funds
s.Require().NoError(err)
s.Require().NotNil(res)
s.Require().Equal(uint64(0), res.Uses)
})
}

0 comments on commit 0b8bae7

Please sign in to comment.