Skip to content

Commit

Permalink
fix(x/cwerrors): send fees from the sender account instead of contrac…
Browse files Browse the repository at this point in the history
…t account (#562)

* send fees from the sender account instaed of contract account

* fixing test
  • Loading branch information
spoo-bar authored Apr 19, 2024
1 parent 942ccbe commit c2f92ce
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ Contains all the PRs that improved the code without changing the behaviors.
- [#539](https://github.com/archway-network/archway/pull/539) - Remediations for x/callback audit
- [#552](https://github.com/archway-network/archway/pull/552) - Fix issue with x/callback callback error code was not identified correctly when setting cwerrors
- [#559](https://github.com/archway-network/archway/pull/559) - Fixing wrong bond denom being considered for x/callback and x/cwerrors fees
- [#562](https://github.com/archway-network/archway/pull/562) - Fixing the account from which x/cwerrors subscription fees are deducted


## [v6.0.0](https://github.com/archway-network/archway/releases/tag/v6.0.0)
Expand Down
2 changes: 1 addition & 1 deletion x/cwerrors/keeper/msg_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func (s *KeeperTestSuite) TestSubscribeToError() {
testCase: "FAIL: account doesnt have enough balance",
input: func() *types.MsgSubscribeToError {
return &types.MsgSubscribeToError{
Sender: contractAdminAcc.Address.String(),
Sender: contractAddr.String(),
ContractAddress: contractAddr.String(),
Fee: sdk.NewInt64Coin(sdk.DefaultBondDenom, 101),
}
Expand Down
2 changes: 1 addition & 1 deletion x/cwerrors/keeper/subscriptions.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func (k Keeper) SetSubscription(ctx sdk.Context, sender, contractAddress sdk.Acc
if fee.IsLT(params.SubscriptionFee) {
return -1, types.ErrInsufficientSubscriptionFee
}
err = k.bankKeeper.SendCoinsFromAccountToModule(ctx, contractAddress, authtypes.FeeCollectorName, sdk.NewCoins(fee))
err = k.bankKeeper.SendCoinsFromAccountToModule(ctx, sender, authtypes.FeeCollectorName, sdk.NewCoins(fee))
if err != nil {
return -1, err
}
Expand Down

0 comments on commit c2f92ce

Please sign in to comment.