Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
chenyaoy committed Oct 21, 2024
1 parent 6c340a3 commit 48e3d0a
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 12 deletions.
4 changes: 4 additions & 0 deletions protocol/app/testdata/default_genesis_state.json
Original file line number Diff line number Diff line change
Expand Up @@ -405,14 +405,18 @@
"prices": {
"market_params": [
{
"exchange_config_json": "{\"exchanges\":[{\"exchangeName\":\"Binance\",\"ticker\":\"\\\"BTCUSDT\\\"\"},{\"exchangeName\":\"BinanceUS\",\"ticker\":\"\\\"BTCUSD\\\"\"},{\"exchangeName\":\"Bitfinex\",\"ticker\":\"tBTCUSD\"},{\"exchangeName\":\"Bitstamp\",\"ticker\":\"BTC/USD\"},{\"exchangeName\":\"Bybit\",\"ticker\":\"BTCUSDT\"},{\"exchangeName\":\"CoinbasePro\",\"ticker\":\"BTC-USD\"},{\"exchangeName\":\"CryptoCom\",\"ticker\":\"BTC_USD\"},{\"exchangeName\":\"Kraken\",\"ticker\":\"XXBTZUSD\"},{\"exchangeName\":\"Okx\",\"ticker\":\"BTC-USDT\"}]}",
"exponent": -5,
"id": 0,
"min_exchanges": 1,
"min_price_change_ppm": 1000,
"pair": "BTC-USD"
},
{
"exchange_config_json": "{\"exchanges\":[{\"exchangeName\":\"Binance\",\"ticker\":\"\\\"ETHUSDT\\\"\"},{\"exchangeName\":\"BinanceUS\",\"ticker\":\"\\\"ETHUSD\\\"\"},{\"exchangeName\":\"Bitfinex\",\"ticker\":\"tETHUSD\"},{\"exchangeName\":\"Bitstamp\",\"ticker\":\"ETH/USD\"},{\"exchangeName\":\"Bybit\",\"ticker\":\"ETHUSDT\"},{\"exchangeName\":\"CoinbasePro\",\"ticker\":\"ETH-USD\"},{\"exchangeName\":\"CryptoCom\",\"ticker\":\"ETH_USD\"},{\"exchangeName\":\"Kraken\",\"ticker\":\"XETHZUSD\"},{\"exchangeName\":\"Okx\",\"ticker\":\"ETH-USDT\"}]}",
"exponent": -6,
"id": 1,
"min_exchanges": 1,
"min_price_change_ppm": 1000,
"pair": "ETH-USD"
}
Expand Down
20 changes: 12 additions & 8 deletions protocol/x/prices/types/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,20 @@ func DefaultGenesis() *GenesisState {
return &GenesisState{
MarketParams: []MarketParam{
{
Exponent: -5,
Id: 0,
MinPriceChangePpm: 1000,
Pair: "BTC-USD",
ExchangeConfigJson: "{\"exchanges\":[{\"exchangeName\":\"Binance\",\"ticker\":\"\\\"BTCUSDT\\\"\"},{\"exchangeName\":\"BinanceUS\",\"ticker\":\"\\\"BTCUSD\\\"\"},{\"exchangeName\":\"Bitfinex\",\"ticker\":\"tBTCUSD\"},{\"exchangeName\":\"Bitstamp\",\"ticker\":\"BTC/USD\"},{\"exchangeName\":\"Bybit\",\"ticker\":\"BTCUSDT\"},{\"exchangeName\":\"CoinbasePro\",\"ticker\":\"BTC-USD\"},{\"exchangeName\":\"CryptoCom\",\"ticker\":\"BTC_USD\"},{\"exchangeName\":\"Kraken\",\"ticker\":\"XXBTZUSD\"},{\"exchangeName\":\"Okx\",\"ticker\":\"BTC-USDT\"}]}", //nolint:lll
Exponent: -5,
Id: 0,
MinExchanges: 1,
MinPriceChangePpm: 1000,
Pair: "BTC-USD",
},
{
Exponent: -6,
Id: 1,
MinPriceChangePpm: 1000,
Pair: "ETH-USD",
ExchangeConfigJson: "{\"exchanges\":[{\"exchangeName\":\"Binance\",\"ticker\":\"\\\"ETHUSDT\\\"\"},{\"exchangeName\":\"BinanceUS\",\"ticker\":\"\\\"ETHUSD\\\"\"},{\"exchangeName\":\"Bitfinex\",\"ticker\":\"tETHUSD\"},{\"exchangeName\":\"Bitstamp\",\"ticker\":\"ETH/USD\"},{\"exchangeName\":\"Bybit\",\"ticker\":\"ETHUSDT\"},{\"exchangeName\":\"CoinbasePro\",\"ticker\":\"ETH-USD\"},{\"exchangeName\":\"CryptoCom\",\"ticker\":\"ETH_USD\"},{\"exchangeName\":\"Kraken\",\"ticker\":\"XETHZUSD\"},{\"exchangeName\":\"Okx\",\"ticker\":\"ETH-USDT\"}]}", //nolint:lll
Exponent: -6,
Id: 1,
MinExchanges: 1,
MinPriceChangePpm: 1000,
Pair: "ETH-USD",
},
},
MarketPrices: []MarketPrice{
Expand Down
10 changes: 6 additions & 4 deletions protocol/x/rewards/keeper/keeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -986,10 +986,12 @@ func TestProcessRewardsForBlock(t *testing.T) {
ctx,
&tApp.App.PricesKeeper,
pricestypes.MarketParam{
Id: testRewardTokenMarketId,
Pair: testRewardTokenMarket,
Exponent: tc.tokenPrice.Exponent,
MinPriceChangePpm: uint32(50),
Id: testRewardTokenMarketId,
Pair: testRewardTokenMarket,
Exponent: tc.tokenPrice.Exponent,
MinExchanges: uint32(1),
MinPriceChangePpm: uint32(50),
ExchangeConfigJson: "{}",
},
tc.tokenPrice,
)
Expand Down

0 comments on commit 48e3d0a

Please sign in to comment.