Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
hwray committed Nov 15, 2024
1 parent c1edfaf commit 15d37f9
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 21 deletions.
10 changes: 6 additions & 4 deletions protocol/app/msgs/internal_msgs.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,12 @@ var (
"/dydxprotocol.govplus.MsgSlashValidatorResponse": nil,

// listing
"/dydxprotocol.listing.MsgSetMarketsHardCap": &listing.MsgSetMarketsHardCap{},
"/dydxprotocol.listing.MsgSetMarketsHardCapResponse": nil,
"/dydxprotocol.listing.MsgSetListingVaultDepositParams": &listing.MsgSetListingVaultDepositParams{},
"/dydxprotocol.listing.MsgSetListingVaultDepositParamsResponse": nil,
"/dydxprotocol.listing.MsgSetMarketsHardCap": &listing.MsgSetMarketsHardCap{},
"/dydxprotocol.listing.MsgSetMarketsHardCapResponse": nil,
"/dydxprotocol.listing.MsgSetListingVaultDepositParams": &listing.MsgSetListingVaultDepositParams{},
"/dydxprotocol.listing.MsgSetListingVaultDepositParamsResponse": nil,
"/dydxprotocol.listing.MsgUpgradeIsolatedPerpetualToCross": &listing.MsgUpgradeIsolatedPerpetualToCross{},
"/dydxprotocol.listing.MsgUpgradeIsolatedPerpetualToCrossResponse": nil,

// perpetuals
"/dydxprotocol.perpetuals.MsgCreatePerpetual": &perpetuals.MsgCreatePerpetual{},
Expand Down
2 changes: 2 additions & 0 deletions protocol/app/msgs/internal_msgs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ func TestInternalMsgSamples_Gov_Key(t *testing.T) {
"/dydxprotocol.listing.MsgSetListingVaultDepositParamsResponse",
"/dydxprotocol.listing.MsgSetMarketsHardCap",
"/dydxprotocol.listing.MsgSetMarketsHardCapResponse",
"/dydxprotocol.listing.MsgUpgradeIsolatedPerpetualToCross",
"/dydxprotocol.listing.MsgUpgradeIsolatedPerpetualToCrossResponse",

// perpeutals
"/dydxprotocol.perpetuals.MsgCreatePerpetual",
Expand Down
6 changes: 0 additions & 6 deletions protocol/app/msgs/unsupported_msgs.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
gov "github.com/cosmos/cosmos-sdk/x/gov/types/v1"
govbeta "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"
icacontrollertypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/controller/types"
listingtypes "github.com/dydxprotocol/v4-chain/protocol/x/listing/types"
vaulttypes "github.com/dydxprotocol/v4-chain/protocol/x/vault/types"
)

Expand All @@ -31,11 +30,6 @@ var (
MsgUpdateParams{},
"/ibc.applications.interchain_accounts.controller.v1.MsgUpdateParamsResponse": nil,

// WIP
"/dydxprotocol.listing.MsgUpgradeIsolatedPerpetualToCross": &listingtypes.
MsgUpgradeIsolatedPerpetualToCross{},
"/dydxprotocol.listing.MsgUpgradeIsolatedPerpetualToCrossResponse": nil,

// vault
// MsgSetVaultQuotingParams is deprecated since v6.x and replaced by MsgSetVaultParams.
// nolint:staticcheck
Expand Down
4 changes: 0 additions & 4 deletions protocol/app/msgs/unsupported_msgs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ func TestUnsupportedMsgSamples_Key(t *testing.T) {
"/dydxprotocol.vault.MsgSetVaultQuotingParams",
"/dydxprotocol.vault.MsgUpdateParams",

// WIP
"/dydxprotocol.listing.MsgUpgradeIsolatedPerpetualToCross",
"/dydxprotocol.listing.MsgUpgradeIsolatedPerpetualToCrossResponse",

// ICA Controller messages
"/ibc.applications.interchain_accounts.controller.v1.MsgRegisterInterchainAccount",
"/ibc.applications.interchain_accounts.controller.v1.MsgRegisterInterchainAccountResponse",
Expand Down
1 change: 1 addition & 0 deletions protocol/lib/ante/internal_msg.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ func IsInternalMsg(msg sdk.Msg) bool {
// listing
*listing.MsgSetMarketsHardCap,
*listing.MsgSetListingVaultDepositParams,
*listing.MsgUpgradeIsolatedPerpetualToCross,

// perpetuals
*perpetuals.MsgCreatePerpetual,
Expand Down
4 changes: 1 addition & 3 deletions protocol/lib/ante/nested_msg_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (
"github.com/dydxprotocol/v4-chain/protocol/lib"
"github.com/dydxprotocol/v4-chain/protocol/lib/ante"
testmsgs "github.com/dydxprotocol/v4-chain/protocol/testutil/msgs"
listingtypes "github.com/dydxprotocol/v4-chain/protocol/x/listing/types"
vaulttypes "github.com/dydxprotocol/v4-chain/protocol/x/vault/types"

"github.com/stretchr/testify/require"
Expand Down Expand Up @@ -77,8 +76,7 @@ func TestIsDydxMsg_Invalid(t *testing.T) {
// nolint:staticcheck
"/dydxprotocol.vault.MsgSetVaultQuotingParams": &vaulttypes.MsgSetVaultQuotingParams{},
// nolint:staticcheck
"/dydxprotocol.vault.MsgUpdateParams": &vaulttypes.MsgUpdateParams{},
"/dydxprotocol.listing.MsgUpgradeIsolatedPerpetualToCross": &listingtypes.MsgUpgradeIsolatedPerpetualToCross{},
"/dydxprotocol.vault.MsgUpdateParams": &vaulttypes.MsgUpdateParams{},
},
)
allMsgsMinusDydx := lib.MergeAllMapsMustHaveDistinctKeys(appmsgs.AllowMsgs, appmsgs.DisallowMsgs)
Expand Down
5 changes: 1 addition & 4 deletions protocol/lib/ante/unsupported_msgs.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
gov "github.com/cosmos/cosmos-sdk/x/gov/types/v1"
govbeta "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"
icacontrollertypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/controller/types"
listingtypes "github.com/dydxprotocol/v4-chain/protocol/x/listing/types"
vaulttypes "github.com/dydxprotocol/v4-chain/protocol/x/vault/types"
)

Expand All @@ -26,9 +25,7 @@ func IsUnsupportedMsg(msg sdk.Msg) bool {
// nolint:staticcheck
*vaulttypes.MsgSetVaultQuotingParams,
// nolint:staticcheck
*vaulttypes.MsgUpdateParams,
// WIP
*listingtypes.MsgUpgradeIsolatedPerpetualToCross:
*vaulttypes.MsgUpdateParams:
return true
}
return false
Expand Down

0 comments on commit 15d37f9

Please sign in to comment.