Skip to content

Commit

Permalink
fix: changed to new sentinel value name
Browse files Browse the repository at this point in the history
  • Loading branch information
Vvaradinov committed May 15, 2023
1 parent 3552971 commit aab8b18
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion modules/apps/transfer/types/transfer_authorization.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func (a TransferAuthorization) Accept(ctx sdk.Context, msg sdk.Msg) (authz.Accep
}

// If the spend limit is set to the MaxUint256 sentinel value, do not subtract the amount from the spend limit.
if allocation.SpendLimit.AmountOf(msgTransfer.Token.Denom).Equal(GetUnboundedSpendLimitSentinelValue()) {
if allocation.SpendLimit.AmountOf(msgTransfer.Token.Denom).Equal(UnboundedSpendLimit()) {
return authz.AcceptResponse{Accept: true, Delete: false, Updated: &a}, nil
}

Expand Down
6 changes: 3 additions & 3 deletions modules/apps/transfer/types/transfer_authorization_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func (suite *TypesTestSuite) TestTransferAuthorizationAccept() {
{
"success: with unlimited spend limit of max uint256",
func() {
transferAuthz.Allocations[0].SpendLimit = sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, types.GetUnboundedSpendLimitSentinelValue()))
transferAuthz.Allocations[0].SpendLimit = sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, types.UnboundedSpendLimit()))
},
func(res authz.AcceptResponse, err error) {
suite.Require().NoError(err)
Expand All @@ -97,7 +97,7 @@ func (suite *TypesTestSuite) TestTransferAuthorizationAccept() {
suite.Require().True(ok)

remainder := updatedTransferAuthz.Allocations[0].SpendLimit.AmountOf(sdk.DefaultBondDenom)
suite.Require().True(types.GetUnboundedSpendLimitSentinelValue().Equal(remainder))
suite.Require().True(types.UnboundedSpendLimit().Equal(remainder))
},
},
{
Expand Down Expand Up @@ -234,7 +234,7 @@ func (suite *TypesTestSuite) TestTransferAuthorizationValidateBasic() {
{
"success: with unlimited spend limit of max uint256",
func() {
transferAuthz.Allocations[0].SpendLimit = sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, types.GetUnboundedSpendLimitSentinelValue()))
transferAuthz.Allocations[0].SpendLimit = sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, types.UnboundedSpendLimit()))
},
true,
},
Expand Down

0 comments on commit aab8b18

Please sign in to comment.