Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

changed osmosis swap type URL #1275

Merged
merged 8 commits into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dockernet/config/ica_host.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"/ibc.applications.transfer.v1.MsgTransfer",
"/cosmwasm.wasm.v1.MsgExecuteContract",
"/cosmwasm.wasm.v1.MsgInstantiateContract",
"/osmosis.gamm.v1beta1.MsgSwapExactAmountIn"
"/osmosis.poolmanager.v1beta1.MsgSwapExactAmountIn"
]
}
}
Expand Down
88 changes: 0 additions & 88 deletions proto/osmosis/gamm/v1beta1/osmosis.proto

This file was deleted.

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
Loading
Loading