Skip to content

Commit

Permalink
update slinky => connect/v2 (#63)
Browse files Browse the repository at this point in the history
  • Loading branch information
beer-1 authored Sep 25, 2024
1 parent 0cedab5 commit 103c787
Show file tree
Hide file tree
Showing 21 changed files with 2,275 additions and 528 deletions.
10 changes: 5 additions & 5 deletions app/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ import (
ibcexported "github.com/cosmos/ibc-go/v8/modules/core/exported"
ibctypes "github.com/cosmos/ibc-go/v8/modules/core/types"

l2slinky "github.com/initia-labs/OPinit/x/opchild/l2slinky"
l2connect "github.com/initia-labs/OPinit/x/opchild/l2connect"
opchildtypes "github.com/initia-labs/OPinit/x/opchild/types"
"github.com/initia-labs/initia/app/genesis_markets"

auctiontypes "github.com/skip-mev/block-sdk/v2/x/auction/types"
slinkytypes "github.com/skip-mev/slinky/pkg/types"
marketmaptypes "github.com/skip-mev/slinky/x/marketmap/types"
oracletypes "github.com/skip-mev/slinky/x/oracle/types"
connecttypes "github.com/skip-mev/connect/v2/pkg/types"
marketmaptypes "github.com/skip-mev/connect/v2/x/marketmap/types"
oracletypes "github.com/skip-mev/connect/v2/x/oracle/types"

evmtypes "github.com/initia-labs/minievm/x/evm/types"
)
Expand Down Expand Up @@ -77,7 +77,7 @@ func (genState GenesisState) AddMarketData(cdc codec.JSONCodec, ac address.Codec

// Initialize all markets plus ReservedCPTimestamp
currencyPairGenesis := make([]oracletypes.CurrencyPairGenesis, len(markets)+1)
cp, err := slinkytypes.CurrencyPairFromString(l2slinky.ReservedCPTimestamp)
cp, err := connecttypes.CurrencyPairFromString(l2connect.ReservedCPTimestamp)
if err != nil {
panic(err)
}
Expand Down
10 changes: 5 additions & 5 deletions app/keepers/keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,10 @@ import (
// skip imports
auctionkeeper "github.com/skip-mev/block-sdk/v2/x/auction/keeper"
auctiontypes "github.com/skip-mev/block-sdk/v2/x/auction/types"
marketmapkeeper "github.com/skip-mev/slinky/x/marketmap/keeper"
marketmaptypes "github.com/skip-mev/slinky/x/marketmap/types"
oraclekeeper "github.com/skip-mev/slinky/x/oracle/keeper"
oracletypes "github.com/skip-mev/slinky/x/oracle/types"
marketmapkeeper "github.com/skip-mev/connect/v2/x/marketmap/keeper"
marketmaptypes "github.com/skip-mev/connect/v2/x/marketmap/types"
oraclekeeper "github.com/skip-mev/connect/v2/x/oracle/keeper"
oracletypes "github.com/skip-mev/connect/v2/x/oracle/types"

// local imports
"github.com/initia-labs/minievm/app/ante"
Expand Down Expand Up @@ -120,7 +120,7 @@ type AppKeepers struct {
OPChildKeeper *opchildkeeper.Keeper
AuctionKeeper *auctionkeeper.Keeper // x/auction keeper used to process bids for POB auctions
PacketForwardKeeper *packetforwardkeeper.Keeper
OracleKeeper *oraclekeeper.Keeper // x/oracle keeper used for the slinky oracle
OracleKeeper *oraclekeeper.Keeper // x/oracle keeper used for the connect oracle
MarketMapKeeper *marketmapkeeper.Keeper
IBCHooksKeeper *ibchookskeeper.Keeper
ForwardingKeeper *forwardingkeeper.Keeper
Expand Down
4 changes: 2 additions & 2 deletions app/keepers/keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ import (

// skip imports
auctiontypes "github.com/skip-mev/block-sdk/v2/x/auction/types"
marketmaptypes "github.com/skip-mev/slinky/x/marketmap/types"
oracletypes "github.com/skip-mev/slinky/x/oracle/types"
marketmaptypes "github.com/skip-mev/connect/v2/x/marketmap/types"
oracletypes "github.com/skip-mev/connect/v2/x/oracle/types"

// noble forwarding keeper
forwardingtypes "github.com/noble-assets/forwarding/v2/x/forwarding/types"
Expand Down
12 changes: 6 additions & 6 deletions app/modules.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ import (
// skip imports
"github.com/skip-mev/block-sdk/v2/x/auction"
auctiontypes "github.com/skip-mev/block-sdk/v2/x/auction/types"
marketmap "github.com/skip-mev/slinky/x/marketmap"
marketmaptypes "github.com/skip-mev/slinky/x/marketmap/types"
"github.com/skip-mev/slinky/x/oracle"
oracletypes "github.com/skip-mev/slinky/x/oracle/types"
marketmap "github.com/skip-mev/connect/v2/x/marketmap"
marketmaptypes "github.com/skip-mev/connect/v2/x/marketmap/types"
"github.com/skip-mev/connect/v2/x/oracle"
oracletypes "github.com/skip-mev/connect/v2/x/oracle/types"

// local imports
"github.com/initia-labs/minievm/x/bank"
Expand All @@ -78,7 +78,7 @@ var maccPerms = map[string][]string{
auctiontypes.ModuleName: nil,
opchildtypes.ModuleName: {authtypes.Minter, authtypes.Burner},

// slinky oracle permissions
// connect oracle permissions
oracletypes.ModuleName: nil,

// this is only for testing
Expand Down Expand Up @@ -114,7 +114,7 @@ func appModules(
packetforward.NewAppModule(app.PacketForwardKeeper, nil),
ibchooks.NewAppModule(app.appCodec, *app.IBCHooksKeeper),
forwarding.NewAppModule(app.ForwardingKeeper),
// slinky modules
// connect modules
oracle.NewAppModule(app.appCodec, *app.OracleKeeper),
marketmap.NewAppModule(app.appCodec, app.MarketMapKeeper),
}
Expand Down
4 changes: 2 additions & 2 deletions client/docs/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,10 @@
}
},
{
"url": "./tmp-swagger-gen/slinky/oracle/v1/query.swagger.json"
"url": "./tmp-swagger-gen/connect/oracle/v2/query.swagger.json"
},
{
"url": "./tmp-swagger-gen/slinky/marketmap/v1/query.swagger.json",
"url": "./tmp-swagger-gen/connect/marketmap/v2/query.swagger.json",
"operationIds": {
"rename": {
"Params": "MarketMapParams"
Expand Down
2 changes: 1 addition & 1 deletion client/docs/statik/statik.go

Large diffs are not rendered by default.

78 changes: 35 additions & 43 deletions client/docs/swagger-ui/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39745,7 +39745,7 @@ paths:
type: string
tags:
- Query
/slinky/oracle/v1/get_all_tickers:
/connect/oracle/v2/get_all_tickers:
get:
summary: >-
Get all the currency pairs the x/oracle module is tracking price-data
Expand Down Expand Up @@ -39800,7 +39800,7 @@ paths:
format: byte
tags:
- Query
/slinky/oracle/v1/get_currency_pair_mapping:
/connect/oracle/v2/get_currency_pair_mapping:
get:
summary: >-
Get the mapping of currency pair ID -> currency pair. This is useful for
Expand Down Expand Up @@ -39862,7 +39862,7 @@ paths:
format: byte
tags:
- Query
/slinky/oracle/v1/get_price:
/connect/oracle/v2/get_price:
get:
summary: >-
Given a CurrencyPair (or its identifier) return the latest QuotePrice
Expand Down Expand Up @@ -39915,10 +39915,8 @@ paths:
decimals represents the number of decimals that the
quote-price is

represented in. For Pairs where ETHEREUM is the quote this
will be 18,

otherwise it will be 8.
represented in. It is used to scale the QuotePrice to its
proper value.
id:
type: string
format: uint64
Expand Down Expand Up @@ -39951,17 +39949,14 @@ paths:
type: string
format: byte
parameters:
- name: currency_pair.Base
in: query
required: false
type: string
- name: currency_pair.Quote
- name: currency_pair
description: CurrencyPair represents the pair that the user wishes to query.
in: query
required: false
type: string
tags:
- Query
/slinky/oracle/v1/get_prices:
/connect/oracle/v2/get_prices:
get:
operationId: GetPrices
responses:
Expand Down Expand Up @@ -40015,10 +40010,8 @@ paths:
decimals represents the number of decimals that the
quote-price is

represented in. For Pairs where ETHEREUM is the quote
this will be 18,

otherwise it will be 8.
represented in. It is used to scale the QuotePrice to
its proper value.
id:
type: string
format: uint64
Expand Down Expand Up @@ -40065,7 +40058,7 @@ paths:
collectionFormat: multi
tags:
- Query
/slinky/marketmap/v1/last_updated:
/connect/marketmap/v2/last_updated:
get:
summary: LastUpdated returns the last height the market map was updated at.
operationId: LastUpdated
Expand Down Expand Up @@ -40107,7 +40100,7 @@ paths:
format: byte
tags:
- Query
/slinky/marketmap/v1/market:
/connect/marketmap/v2/market:
get:
summary: |-
Market returns a market stored in the x/marketmap
Expand Down Expand Up @@ -40276,7 +40269,7 @@ paths:
type: string
tags:
- Query
/slinky/marketmap/v1/marketmap:
/connect/marketmap/v2/marketmap:
get:
summary: |-
MarketMap returns the full market map stored in the x/marketmap
Expand Down Expand Up @@ -40467,7 +40460,7 @@ paths:
format: byte
tags:
- Query
/slinky/marketmap/v1/params:
/connect/marketmap/v2/params:
get:
summary: Params returns the current x/marketmap module parameters.
operationId: MarketMapParams
Expand Down Expand Up @@ -68530,7 +68523,7 @@ definitions:
type: boolean
title: whether to return data trace
title: TraceOption is the option for tracing
slinky.oracle.v1.GetAllCurrencyPairsResponse:
connect.oracle.v2.GetAllCurrencyPairsResponse:
type: object
properties:
currency_pairs:
Expand All @@ -68550,7 +68543,7 @@ definitions:
description: |-
GetAllCurrencyPairsResponse returns all CurrencyPairs that the module is
currently tracking.
slinky.oracle.v1.GetCurrencyPairMappingResponse:
connect.oracle.v2.GetCurrencyPairMappingResponse:
type: object
properties:
currency_pair_mapping:
Expand All @@ -68575,7 +68568,7 @@ definitions:
description: >-
GetCurrencyPairMappingResponse is the GetCurrencyPairMapping response
type.
slinky.oracle.v1.GetPriceResponse:
connect.oracle.v2.GetPriceResponse:
type: object
properties:
price:
Expand Down Expand Up @@ -68608,10 +68601,11 @@ definitions:
decimals:
type: string
format: uint64
description: |-
description: >-
decimals represents the number of decimals that the quote-price is
represented in. For Pairs where ETHEREUM is the quote this will be 18,
otherwise it will be 8.

represented in. It is used to scale the QuotePrice to its proper
value.
id:
type: string
format: uint64
Expand All @@ -68621,7 +68615,7 @@ definitions:
from

the x/oracle query service.
slinky.oracle.v1.GetPricesResponse:
connect.oracle.v2.GetPricesResponse:
type: object
properties:
prices:
Expand Down Expand Up @@ -68668,10 +68662,8 @@ definitions:
decimals represents the number of decimals that the quote-price
is

represented in. For Pairs where ETHEREUM is the quote this will
be 18,

otherwise it will be 8.
represented in. It is used to scale the QuotePrice to its proper
value.
id:
type: string
format: uint64
Expand All @@ -68686,7 +68678,7 @@ definitions:
from

the x/oracle query service.
slinky.oracle.v1.QuotePrice:
connect.oracle.v2.QuotePrice:
type: object
properties:
price:
Expand All @@ -68710,7 +68702,7 @@ definitions:
CurrencyPair,

where price represents the price of Base in terms of Quote
slinky.types.v1.CurrencyPair:
connect.types.v2.CurrencyPair:
type: object
properties:
Base:
Expand All @@ -68720,7 +68712,7 @@ definitions:
title: |-
CurrencyPair is the standard representation of a pair of assets, where one
(Base) is priced in terms of the other (Quote)
slinky.marketmap.v1.LastUpdatedResponse:
connect.marketmap.v2.LastUpdatedResponse:
type: object
properties:
last_updated:
Expand All @@ -68729,7 +68721,7 @@ definitions:
description: |-
LastUpdatedResponse is the response type for the Query/LastUpdated RPC
method.
slinky.marketmap.v1.Market:
connect.marketmap.v2.Market:
type: object
properties:
ticker:
Expand Down Expand Up @@ -68850,7 +68842,7 @@ definitions:
ProviderConfigs is the list of provider-specific configs for this
Market.
description: Market encapsulates a Ticker and its provider-specific configuration.
slinky.marketmap.v1.MarketMap:
connect.marketmap.v2.MarketMap:
type: object
properties:
markets:
Expand Down Expand Up @@ -68984,7 +68976,7 @@ definitions:

to be stored on-chain.
description: MarketMap maps ticker strings to their Markets.
slinky.marketmap.v1.MarketMapResponse:
connect.marketmap.v2.MarketMapResponse:
type: object
properties:
market_map:
Expand Down Expand Up @@ -69139,7 +69131,7 @@ definitions:
type: string
description: ChainId is the chain identifier for the market map.
description: MarketMapResponse is the query response for the MarketMap query.
slinky.marketmap.v1.MarketResponse:
connect.marketmap.v2.MarketResponse:
type: object
properties:
market:
Expand Down Expand Up @@ -69266,7 +69258,7 @@ definitions:
ProviderConfigs is the list of provider-specific configs for this
Market.
description: MarketResponse is the query response for the Market query.
slinky.marketmap.v1.Params:
connect.marketmap.v2.Params:
type: object
properties:
market_authorities:
Expand All @@ -69285,7 +69277,7 @@ definitions:
list. Only governance can add to the MarketAuthorities or change the
Admin.
description: Params defines the parameters for the x/marketmap module.
slinky.marketmap.v1.ParamsResponse:
connect.marketmap.v2.ParamsResponse:
type: object
properties:
params:
Expand All @@ -69310,7 +69302,7 @@ definitions:
the Admin.
description: Params defines the parameters for the x/marketmap module.
description: ParamsResponse is the response type for the Query/Params RPC method.
slinky.marketmap.v1.ProviderConfig:
connect.marketmap.v2.ProviderConfig:
type: object
properties:
name:
Expand Down Expand Up @@ -69365,7 +69357,7 @@ definitions:
description: |-
MetadataJSON is a string of JSON that encodes any extra configuration
for the given provider config.
slinky.marketmap.v1.Ticker:
connect.marketmap.v2.Ticker:
type: object
properties:
currency_pair:
Expand Down
Loading

0 comments on commit 103c787

Please sign in to comment.