Skip to content

Commit

Permalink
feat: upgrade to connect/v2 (#2419)
Browse files Browse the repository at this point in the history
  • Loading branch information
aljo242 authored Oct 2, 2024
1 parent a9a116c commit e2438dd
Show file tree
Hide file tree
Showing 123 changed files with 584 additions and 545 deletions.
7 changes: 4 additions & 3 deletions protocol/app/ante/market_update.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
package ante

import (
"context"
"errors"
"fmt"
slinkytypes "github.com/skip-mev/slinky/pkg/types"

errorsmod "cosmossdk.io/errors"
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
mmtypes "github.com/skip-mev/slinky/x/marketmap/types"
slinkytypes "github.com/skip-mev/connect/v2/pkg/types"
mmtypes "github.com/skip-mev/connect/v2/x/marketmap/types"

slinkylibs "github.com/dydxprotocol/v4-chain/protocol/lib/slinky"
perpetualstypes "github.com/dydxprotocol/v4-chain/protocol/x/perpetuals/types"
Expand All @@ -19,7 +20,7 @@ var ErrRestrictedMarketUpdates = errors.New("cannot call MsgUpdateMarkets or Msg
"on a restricted market")

type MarketMapKeeper interface {
GetAllMarkets(ctx sdk.Context) (map[string]mmtypes.Market, error)
GetAllMarkets(ctx context.Context) (map[string]mmtypes.Market, error)
}

var (
Expand Down
4 changes: 2 additions & 2 deletions protocol/app/ante/market_update_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import (
"github.com/cosmos/cosmos-sdk/types/tx/signing"
xauthsigning "github.com/cosmos/cosmos-sdk/x/auth/signing"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
"github.com/skip-mev/slinky/pkg/types"
mmtypes "github.com/skip-mev/slinky/x/marketmap/types"
"github.com/skip-mev/connect/v2/pkg/types"
mmtypes "github.com/skip-mev/connect/v2/x/marketmap/types"
"github.com/stretchr/testify/require"

"github.com/dydxprotocol/v4-chain/protocol/app/ante"
Expand Down
2 changes: 1 addition & 1 deletion protocol/app/ante/replay_protection.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func (rpd ReplayProtectionDecorator) AnteHandle(
1,
[]gometrics.Label{metrics.GetLabelForIntValue(metrics.ExecMode, int(ctx.ExecMode()))},
)
return ctx, errorsmod.Wrapf(sdkerrors.ErrWrongSequence, err.Error())
return ctx, errorsmod.Wrap(sdkerrors.ErrWrongSequence, err.Error())
}
telemetry.IncrCounterWithLabels(
[]string{metrics.TimestampNonce, metrics.Valid, metrics.Count},
Expand Down
26 changes: 13 additions & 13 deletions protocol/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,9 @@ import (
vestmodule "github.com/dydxprotocol/v4-chain/protocol/x/vest"
vestmodulekeeper "github.com/dydxprotocol/v4-chain/protocol/x/vest/keeper"
vestmoduletypes "github.com/dydxprotocol/v4-chain/protocol/x/vest/types"
marketmapmodule "github.com/skip-mev/slinky/x/marketmap"
marketmapmodulekeeper "github.com/skip-mev/slinky/x/marketmap/keeper"
marketmapmoduletypes "github.com/skip-mev/slinky/x/marketmap/types"
marketmapmodule "github.com/skip-mev/connect/v2/x/marketmap"
marketmapmodulekeeper "github.com/skip-mev/connect/v2/x/marketmap/keeper"
marketmapmoduletypes "github.com/skip-mev/connect/v2/x/marketmap/types"

// IBC
ica "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts"
Expand All @@ -225,16 +225,16 @@ import (
"github.com/dydxprotocol/v4-chain/protocol/indexer/msgsender"

// Slinky
slinkyproposals "github.com/skip-mev/slinky/abci/proposals"
"github.com/skip-mev/slinky/abci/strategies/aggregator"
compression "github.com/skip-mev/slinky/abci/strategies/codec"
"github.com/skip-mev/slinky/abci/strategies/currencypair"
"github.com/skip-mev/slinky/abci/ve"
oracleconfig "github.com/skip-mev/slinky/oracle/config"
"github.com/skip-mev/slinky/pkg/math/voteweighted"
oracleclient "github.com/skip-mev/slinky/service/clients/oracle"
servicemetrics "github.com/skip-mev/slinky/service/metrics"
promserver "github.com/skip-mev/slinky/service/servers/prometheus"
slinkyproposals "github.com/skip-mev/connect/v2/abci/proposals"
"github.com/skip-mev/connect/v2/abci/strategies/aggregator"
compression "github.com/skip-mev/connect/v2/abci/strategies/codec"
"github.com/skip-mev/connect/v2/abci/strategies/currencypair"
"github.com/skip-mev/connect/v2/abci/ve"
oracleconfig "github.com/skip-mev/connect/v2/oracle/config"
"github.com/skip-mev/connect/v2/pkg/math/voteweighted"
oracleclient "github.com/skip-mev/connect/v2/service/clients/oracle"
servicemetrics "github.com/skip-mev/connect/v2/service/metrics"
promserver "github.com/skip-mev/connect/v2/service/servers/prometheus"

// Full Node Streaming
streaming "github.com/dydxprotocol/v4-chain/protocol/streaming"
Expand Down
2 changes: 1 addition & 1 deletion protocol/app/app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"testing"
"time"

marketmapmodule "github.com/skip-mev/slinky/x/marketmap"
marketmapmodule "github.com/skip-mev/connect/v2/x/marketmap"

evidencemodule "cosmossdk.io/x/evidence"
feegrantmodule "cosmossdk.io/x/feegrant/module"
Expand Down
2 changes: 1 addition & 1 deletion protocol/app/basic_manager/basic_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import (
subaccountsmodule "github.com/dydxprotocol/v4-chain/protocol/x/subaccounts"
vaultmodule "github.com/dydxprotocol/v4-chain/protocol/x/vault"
vestmodule "github.com/dydxprotocol/v4-chain/protocol/x/vest"
marketmapmodule "github.com/skip-mev/slinky/x/marketmap"
marketmapmodule "github.com/skip-mev/connect/v2/x/marketmap"

ica "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts"
"github.com/cosmos/ibc-go/v8/modules/apps/transfer"
Expand Down
2 changes: 1 addition & 1 deletion protocol/app/module_accounts.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
satypes "github.com/dydxprotocol/v4-chain/protocol/x/subaccounts/types"
vaultmoduletypes "github.com/dydxprotocol/v4-chain/protocol/x/vault/types"
vestmoduletypes "github.com/dydxprotocol/v4-chain/protocol/x/vest/types"
marketmapmoduletypes "github.com/skip-mev/slinky/x/marketmap/types"
marketmapmoduletypes "github.com/skip-mev/connect/v2/x/marketmap/types"

"golang.org/x/exp/maps"
)
Expand Down
2 changes: 1 addition & 1 deletion protocol/app/module_accounts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
satypes "github.com/dydxprotocol/v4-chain/protocol/x/subaccounts/types"
vaultmoduletypes "github.com/dydxprotocol/v4-chain/protocol/x/vault/types"
vestmoduletypes "github.com/dydxprotocol/v4-chain/protocol/x/vest/types"
marketmapmoduletypes "github.com/skip-mev/slinky/x/marketmap/types"
marketmapmoduletypes "github.com/skip-mev/connect/v2/x/marketmap/types"
)

func TestModuleAccountsToAddresses(t *testing.T) {
Expand Down
26 changes: 14 additions & 12 deletions protocol/app/msgs/all_msgs.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,20 @@ var (
// AllTypeMessages is a list of all messages and types that are used in the app.
// This list comes from the app's `InterfaceRegistry`.
AllTypeMessages = map[string]struct{}{
// connect marketmap messages
"/connect.marketmap.v2.MsgCreateMarkets": {},
"/connect.marketmap.v2.MsgCreateMarketsResponse": {},
"/connect.marketmap.v2.MsgParams": {},
"/connect.marketmap.v2.MsgParamsResponse": {},
"/connect.marketmap.v2.MsgRemoveMarkets": {},
"/connect.marketmap.v2.MsgRemoveMarketsResponse": {},
"/connect.marketmap.v2.MsgRemoveMarketAuthorities": {},
"/connect.marketmap.v2.MsgRemoveMarketAuthoritiesResponse": {},
"/connect.marketmap.v2.MsgUpdateMarkets": {},
"/connect.marketmap.v2.MsgUpdateMarketsResponse": {},
"/connect.marketmap.v2.MsgUpsertMarkets": {},
"/connect.marketmap.v2.MsgUpsertMarketsResponse": {},

// auth
"/cosmos.auth.v1beta1.BaseAccount": {},
"/cosmos.auth.v1beta1.ModuleAccount": {},
Expand Down Expand Up @@ -389,18 +403,6 @@ var (
"/ibc.applications.interchain_accounts.controller.v1.MsgUpdateParamsResponse": {},
"/ibc.applications.interchain_accounts.host.v1.MsgUpdateParams": {},
"/ibc.applications.interchain_accounts.host.v1.MsgUpdateParamsResponse": {},

// slinky marketmap messages
"/slinky.marketmap.v1.MsgCreateMarkets": {},
"/slinky.marketmap.v1.MsgCreateMarketsResponse": {},
"/slinky.marketmap.v1.MsgParams": {},
"/slinky.marketmap.v1.MsgParamsResponse": {},
"/slinky.marketmap.v1.MsgRemoveMarketAuthorities": {},
"/slinky.marketmap.v1.MsgRemoveMarketAuthoritiesResponse": {},
"/slinky.marketmap.v1.MsgUpdateMarkets": {},
"/slinky.marketmap.v1.MsgUpdateMarketsResponse": {},
"/slinky.marketmap.v1.MsgUpsertMarkets": {},
"/slinky.marketmap.v1.MsgUpsertMarketsResponse": {},
}

// DisallowMsgs are messages that cannot be externally submitted.
Expand Down
30 changes: 16 additions & 14 deletions protocol/app/msgs/normal_msgs.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ import (
listing "github.com/dydxprotocol/v4-chain/protocol/x/listing/types"
sending "github.com/dydxprotocol/v4-chain/protocol/x/sending/types"
vault "github.com/dydxprotocol/v4-chain/protocol/x/vault/types"
marketmapmoduletypes "github.com/skip-mev/slinky/x/marketmap/types"
marketmapmoduletypes "github.com/skip-mev/connect/v2/x/marketmap/types"
)

var (
// NormalMsgs are messages that can be submitted by external users.
NormalMsgs = lib.MergeAllMapsMustHaveDistinctKeys(NormalMsgsDefault, NormalMsgsDydxCustom, NormalMsgsSlinky)
NormalMsgs = lib.MergeAllMapsMustHaveDistinctKeys(NormalMsgsDefault, NormalMsgsDydxCustom, NormalMsgsConnect)

// Default modules
NormalMsgsDefault = map[string]sdk.Msg{
Expand Down Expand Up @@ -267,17 +267,19 @@ var (
"/dydxprotocol.vault.MsgWithdrawFromMegavaultResponse": nil,
}

NormalMsgsSlinky = map[string]sdk.Msg{
// slinky marketmap messages
"/slinky.marketmap.v1.MsgCreateMarkets": &marketmapmoduletypes.MsgCreateMarkets{},
"/slinky.marketmap.v1.MsgCreateMarketsResponse": nil,
"/slinky.marketmap.v1.MsgParams": &marketmapmoduletypes.MsgParams{},
"/slinky.marketmap.v1.MsgParamsResponse": nil,
"/slinky.marketmap.v1.MsgRemoveMarketAuthorities": &marketmapmoduletypes.MsgRemoveMarketAuthorities{},
"/slinky.marketmap.v1.MsgRemoveMarketAuthoritiesResponse": nil,
"/slinky.marketmap.v1.MsgUpdateMarkets": &marketmapmoduletypes.MsgUpdateMarkets{},
"/slinky.marketmap.v1.MsgUpdateMarketsResponse": nil,
"/slinky.marketmap.v1.MsgUpsertMarkets": &marketmapmoduletypes.MsgUpsertMarkets{},
"/slinky.marketmap.v1.MsgUpsertMarketsResponse": nil,
NormalMsgsConnect = map[string]sdk.Msg{
// connect marketmap messages
"/connect.marketmap.v2.MsgCreateMarkets": &marketmapmoduletypes.MsgCreateMarkets{},
"/connect.marketmap.v2.MsgCreateMarketsResponse": nil,
"/connect.marketmap.v2.MsgParams": &marketmapmoduletypes.MsgParams{},
"/connect.marketmap.v2.MsgParamsResponse": nil,
"/connect.marketmap.v2.MsgRemoveMarketAuthorities": &marketmapmoduletypes.MsgRemoveMarketAuthorities{},
"/connect.marketmap.v2.MsgRemoveMarketAuthoritiesResponse": nil,
"/connect.marketmap.v2.MsgRemoveMarkets": &marketmapmoduletypes.MsgRemoveMarkets{},
"/connect.marketmap.v2.MsgRemoveMarketsResponse": nil,
"/connect.marketmap.v2.MsgUpdateMarkets": &marketmapmoduletypes.MsgUpdateMarkets{},
"/connect.marketmap.v2.MsgUpdateMarketsResponse": nil,
"/connect.marketmap.v2.MsgUpsertMarkets": &marketmapmoduletypes.MsgUpsertMarkets{},
"/connect.marketmap.v2.MsgUpsertMarketsResponse": nil,
}
)
26 changes: 14 additions & 12 deletions protocol/app/msgs/normal_msgs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,20 @@ import (

func TestNormalMsgs_Key(t *testing.T) {
expectedMsgs := []string{
// connect marketmap messages
"/connect.marketmap.v2.MsgCreateMarkets",
"/connect.marketmap.v2.MsgCreateMarketsResponse",
"/connect.marketmap.v2.MsgParams",
"/connect.marketmap.v2.MsgParamsResponse",
"/connect.marketmap.v2.MsgRemoveMarketAuthorities",
"/connect.marketmap.v2.MsgRemoveMarketAuthoritiesResponse",
"/connect.marketmap.v2.MsgRemoveMarkets",
"/connect.marketmap.v2.MsgRemoveMarketsResponse",
"/connect.marketmap.v2.MsgUpdateMarkets",
"/connect.marketmap.v2.MsgUpdateMarketsResponse",
"/connect.marketmap.v2.MsgUpsertMarkets",
"/connect.marketmap.v2.MsgUpsertMarketsResponse",

// auth
"/cosmos.auth.v1beta1.BaseAccount",
"/cosmos.auth.v1beta1.ModuleAccount",
Expand Down Expand Up @@ -239,18 +253,6 @@ func TestNormalMsgs_Key(t *testing.T) {
"/ibc.lightclients.tendermint.v1.ConsensusState",
"/ibc.lightclients.tendermint.v1.Header",
"/ibc.lightclients.tendermint.v1.Misbehaviour",

// slinky marketmap messages
"/slinky.marketmap.v1.MsgCreateMarkets",
"/slinky.marketmap.v1.MsgCreateMarketsResponse",
"/slinky.marketmap.v1.MsgParams",
"/slinky.marketmap.v1.MsgParamsResponse",
"/slinky.marketmap.v1.MsgRemoveMarketAuthorities",
"/slinky.marketmap.v1.MsgRemoveMarketAuthoritiesResponse",
"/slinky.marketmap.v1.MsgUpdateMarkets",
"/slinky.marketmap.v1.MsgUpdateMarketsResponse",
"/slinky.marketmap.v1.MsgUpsertMarkets",
"/slinky.marketmap.v1.MsgUpsertMarketsResponse",
}

require.Equal(t, expectedMsgs, lib.GetSortedKeys[sort.StringSlice](msgs.NormalMsgs))
Expand Down
2 changes: 1 addition & 1 deletion protocol/app/prepare/prepare_proposal.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"github.com/dydxprotocol/v4-chain/protocol/app/prepare/prices"
"github.com/dydxprotocol/v4-chain/protocol/lib/metrics"
pricetypes "github.com/dydxprotocol/v4-chain/protocol/x/prices/types"
"github.com/skip-mev/slinky/abci/ve"
"github.com/skip-mev/connect/v2/abci/ve"
)

var (
Expand Down
14 changes: 7 additions & 7 deletions protocol/app/prepare/prepare_proposal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ import (
clobtypes "github.com/dydxprotocol/v4-chain/protocol/x/clob/types"
perpetualtypes "github.com/dydxprotocol/v4-chain/protocol/x/perpetuals/types"
pricestypes "github.com/dydxprotocol/v4-chain/protocol/x/prices/types"
"github.com/skip-mev/slinky/abci/strategies/aggregator"
aggregatormock "github.com/skip-mev/slinky/abci/strategies/aggregator/mocks"
"github.com/skip-mev/slinky/abci/strategies/codec"
strategymock "github.com/skip-mev/slinky/abci/strategies/currencypair/mocks"
slinkytestutils "github.com/skip-mev/slinky/abci/testutils"
vetypes "github.com/skip-mev/slinky/abci/ve/types"
oracletypes "github.com/skip-mev/slinky/pkg/types"
"github.com/skip-mev/connect/v2/abci/strategies/aggregator"
aggregatormock "github.com/skip-mev/connect/v2/abci/strategies/aggregator/mocks"
"github.com/skip-mev/connect/v2/abci/strategies/codec"
strategymock "github.com/skip-mev/connect/v2/abci/strategies/currencypair/mocks"
slinkytestutils "github.com/skip-mev/connect/v2/abci/testutils"
vetypes "github.com/skip-mev/connect/v2/abci/ve/types"
oracletypes "github.com/skip-mev/connect/v2/pkg/types"
"github.com/stretchr/testify/mock"
"github.com/stretchr/testify/require"
)
Expand Down
8 changes: 4 additions & 4 deletions protocol/app/prepare/prices/slinky_price_update_generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import (

sdk "github.com/cosmos/cosmos-sdk/types"
pricestypes "github.com/dydxprotocol/v4-chain/protocol/x/prices/types"
"github.com/skip-mev/slinky/abci/strategies/aggregator"
"github.com/skip-mev/slinky/abci/strategies/codec"
"github.com/skip-mev/slinky/abci/strategies/currencypair"
"github.com/skip-mev/slinky/abci/ve"
"github.com/skip-mev/connect/v2/abci/strategies/aggregator"
"github.com/skip-mev/connect/v2/abci/strategies/codec"
"github.com/skip-mev/connect/v2/abci/strategies/currencypair"
"github.com/skip-mev/connect/v2/abci/ve"
)

// SlinkyPriceUpdateGenerator is an implementation of the PriceUpdateGenerator interface. This implementation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ import (
cmtabci "github.com/cometbft/cometbft/abci/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/dydxprotocol/v4-chain/protocol/app/prepare/prices"
"github.com/skip-mev/slinky/abci/strategies/aggregator"
aggregatormock "github.com/skip-mev/slinky/abci/strategies/aggregator/mocks"
codecmock "github.com/skip-mev/slinky/abci/strategies/codec/mocks"
strategymock "github.com/skip-mev/slinky/abci/strategies/currencypair/mocks"
"github.com/skip-mev/slinky/abci/testutils"
vetypes "github.com/skip-mev/slinky/abci/ve/types"
oracletypes "github.com/skip-mev/slinky/pkg/types"
"github.com/skip-mev/connect/v2/abci/strategies/aggregator"
aggregatormock "github.com/skip-mev/connect/v2/abci/strategies/aggregator/mocks"
codecmock "github.com/skip-mev/connect/v2/abci/strategies/codec/mocks"
strategymock "github.com/skip-mev/connect/v2/abci/strategies/currencypair/mocks"
"github.com/skip-mev/connect/v2/abci/testutils"
vetypes "github.com/skip-mev/connect/v2/abci/ve/types"
oracletypes "github.com/skip-mev/connect/v2/pkg/types"
"github.com/stretchr/testify/suite"
"math/big"
"testing"
Expand Down
2 changes: 1 addition & 1 deletion protocol/app/process/slinky_market_price_decoder.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"

sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/skip-mev/slinky/abci/ve"
"github.com/skip-mev/connect/v2/abci/ve"

"github.com/dydxprotocol/v4-chain/protocol/app/constants"
"github.com/dydxprotocol/v4-chain/protocol/app/prepare/prices"
Expand Down
2 changes: 1 addition & 1 deletion protocol/app/process/slinky_market_price_decoder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"testing"

sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/skip-mev/slinky/abci/testutils"
"github.com/skip-mev/connect/v2/abci/testutils"
"github.com/stretchr/testify/suite"

"github.com/dydxprotocol/v4-chain/protocol/app/constants"
Expand Down
4 changes: 2 additions & 2 deletions protocol/app/upgrades/v6.0.0/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package v_6_0_0

import (
store "cosmossdk.io/store/types"
slinkytypes "github.com/skip-mev/slinky/pkg/types"
marketmapmoduletypes "github.com/skip-mev/slinky/x/marketmap/types"
slinkytypes "github.com/skip-mev/connect/v2/pkg/types"
marketmapmoduletypes "github.com/skip-mev/connect/v2/x/marketmap/types"

"github.com/dydxprotocol/v4-chain/protocol/app/upgrades"
accountplustypes "github.com/dydxprotocol/v4-chain/protocol/x/accountplus/types"
Expand Down
8 changes: 4 additions & 4 deletions protocol/app/upgrades/v6.0.0/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ import (
revsharetypes "github.com/dydxprotocol/v4-chain/protocol/x/revshare/types"
vaultkeeper "github.com/dydxprotocol/v4-chain/protocol/x/vault/keeper"
vaulttypes "github.com/dydxprotocol/v4-chain/protocol/x/vault/types"
"github.com/skip-mev/slinky/providers/apis/dydx"
dydxtypes "github.com/skip-mev/slinky/providers/apis/dydx/types"
marketmapkeeper "github.com/skip-mev/slinky/x/marketmap/keeper"
marketmaptypes "github.com/skip-mev/slinky/x/marketmap/types"
"github.com/skip-mev/connect/v2/providers/apis/dydx"
dydxtypes "github.com/skip-mev/connect/v2/providers/apis/dydx/types"
marketmapkeeper "github.com/skip-mev/connect/v2/x/marketmap/keeper"
marketmaptypes "github.com/skip-mev/connect/v2/x/marketmap/types"

sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
Expand Down
5 changes: 3 additions & 2 deletions protocol/app/vote_extensions/expected_keepers.go
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
package vote_extensions

import (
"context"
sdk "github.com/cosmos/cosmos-sdk/types"
oracletypes "github.com/skip-mev/slinky/pkg/types"
oracletypes "github.com/skip-mev/connect/v2/pkg/types"

pricestypes "github.com/dydxprotocol/v4-chain/protocol/x/prices/types"
)

// PricesKeeper is the expected interface for the x/price keeper used by the vote extension handlers
type PricesKeeper interface {
GetCurrencyPairFromID(ctx sdk.Context, id uint64) (cp oracletypes.CurrencyPair, found bool)
GetCurrencyPairFromID(ctx context.Context, id uint64) (cp oracletypes.CurrencyPair, found bool)
GetValidMarketPriceUpdates(ctx sdk.Context) *pricestypes.MsgUpdateMarketPrices
UpdateMarketPrices(
ctx sdk.Context,
Expand Down
5 changes: 3 additions & 2 deletions protocol/app/vote_extensions/extend_vote_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package vote_extensions

import (
"fmt"
slinkytypes "github.com/skip-mev/slinky/pkg/types"
slinkytypes "github.com/skip-mev/connect/v2/pkg/types"
"math/big"

cometabci "github.com/cometbft/cometbft/abci/types"
Expand Down Expand Up @@ -38,7 +38,8 @@ func (n NoopPriceApplier) GetPricesForValidator(_ sdk.ConsAddress) map[slinkytyp
// latest available market prices
// 4. Calling the Slinky ExtendVoteHandler to handle the rest of ExtendVote
//
// See https://github.com/skip-mev/slinky/blob/a5b1d3d3a2723e4746b5d588c512d7cc052dc0ff/abci/ve/vote_extension.go#L77
// See
// https://github.com/skip-mev/connect/v2/blob/a5b1d3d3a2723e4746b5d588c512d7cc052dc0ff/abci/ve/vote_extension.go#L77
// for the Slinky ExtendVoteHandler logic.
func (e *ExtendVoteHandler) ExtendVoteHandler() sdk.ExtendVoteHandler {
return func(ctx sdk.Context, req *cometabci.RequestExtendVote) (resp *cometabci.ResponseExtendVote, err error) {
Expand Down
Loading

0 comments on commit e2438dd

Please sign in to comment.