Skip to content

Commit

Permalink
updated type url to use poolmanager version
Browse files Browse the repository at this point in the history
  • Loading branch information
sampocs committed Aug 27, 2024
1 parent b286f74 commit d5b2450
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions x/stakeibc/keeper/reward_converter.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ import (
"github.com/Stride-Labs/stride/v23/x/stakeibc/types"
)

const OsmosisSwapTypeUrl = "/osmosis.poolmanager.v1beta1.MsgSwapExactAmountIn"

// JSON Memo for PFM transfers
type PacketForwardMetadata struct {
Forward *ForwardMetadata `json:"forward"`
Expand Down Expand Up @@ -134,11 +136,9 @@ func (k Keeper) BuildTradeAuthzMsg(
permissionChange types.AuthzPermissionChange,
grantee string,
) (authzMsg []proto.Message, err error) {
swapMsgTypeUrl := "/" + proto.MessageName(&types.MsgSwapExactAmountIn{})

switch permissionChange {
case types.AuthzPermissionChange_GRANT:
authorization := authz.NewGenericAuthorization(swapMsgTypeUrl)
authorization := authz.NewGenericAuthorization(OsmosisSwapTypeUrl)
expiration := ctx.BlockTime().Add(time.Hour * 24 * 365 * 100) // 100 years

grant, err := authz.NewGrant(ctx.BlockTime(), authorization, &expiration)
Expand All @@ -155,7 +155,7 @@ func (k Keeper) BuildTradeAuthzMsg(
authzMsg = []proto.Message{&authz.MsgRevoke{
Granter: tradeRoute.TradeAccount.Address,
Grantee: grantee,
MsgTypeUrl: swapMsgTypeUrl,
MsgTypeUrl: OsmosisSwapTypeUrl,
}}

default:
Expand Down
2 changes: 1 addition & 1 deletion x/stakeibc/keeper/reward_converter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ func (s *KeeperTestSuite) TestBuildTradeAuthzMsg() {
},
}

expectedTypeUrl := "/osmosis.gamm.v1beta1.MsgSwapExactAmountIn"
expectedTypeUrl := "/osmosis.poolmanager.v1beta1.MsgSwapExactAmountIn"

// Test granting trade permissions
msgs, err := s.App.StakeibcKeeper.BuildTradeAuthzMsg(s.Ctx, tradeRoute, types.AuthzPermissionChange_GRANT, granteeAddress)
Expand Down

0 comments on commit d5b2450

Please sign in to comment.