diff --git a/ojo-provider-config/currency-pairs.toml b/ojo-provider-config/currency-pairs.toml index 17cd616d..1d05a8dc 100644 --- a/ojo-provider-config/currency-pairs.toml +++ b/ojo-provider-config/currency-pairs.toml @@ -99,55 +99,35 @@ base = "WETH" providers = [ "eth-uniswap" ] - quote = "USDC" -[[currency_pairs.pair_address_providers]] -address = "0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640" -provider = "eth-uniswap" [[currency_pairs]] base = "WBTC" providers = [ "eth-uniswap" ] - quote = "WETH" -[[currency_pairs.pair_address_providers]] -address = "0xcbcdf9626bc03e24f779434178a73a0b4bad62ed" -provider = "eth-uniswap" [[currency_pairs]] base = "CBETH" providers = [ "eth-uniswap" ] - quote = "WETH" -[[currency_pairs.pair_address_providers]] -address = "0x840deeef2f115cf50da625f7368c24af6fe74410" -provider = "eth-uniswap" [[currency_pairs]] base = "LINK" providers = [ "eth-uniswap" ] - quote = "WETH" -[[currency_pairs.pair_address_providers]] -address = "0xa6cc3c2531fdaa6ae1a3ca84c2855806728693e8" -provider = "eth-uniswap" [[currency_pairs]] base = "RETH" providers = [ "eth-uniswap", ] - quote = "WETH" -[[currency_pairs.pair_address_providers]] -address = "0xa4e0faA58465A2D369aa21B3e42d43374c6F9613" -provider = "eth-uniswap" [[currency_pairs]] base = "stATOM" diff --git a/ojo-provider-config/endpoints.toml b/ojo-provider-config/endpoints.toml index 7bf2e7ed..3a393b49 100644 --- a/ojo-provider-config/endpoints.toml +++ b/ojo-provider-config/endpoints.toml @@ -2,8 +2,3 @@ name = "binance" rest = "https://api1.binance.com" websocket = "stream.binance.com:9443" - -[[provider_endpoints]] -name = "eth-uniswap" -rest = "http://104.197.233.185:8000/subgraphs/name/ojo-network/unidexer" -websocket = "not supported" diff --git a/oracle/provider/uniswap.go b/oracle/provider/uniswap.go index f335a859..aa5c0dc1 100644 --- a/oracle/provider/uniswap.go +++ b/oracle/provider/uniswap.go @@ -18,7 +18,8 @@ import ( const ( uniswapWSHost = "localhost:5005" uniswapWSPath = "ws" - uniswapRestHost = "localhost:5005" + uniswapWSScheme = "ws" + uniswapRestHost = "http://localhost:5005" uniswapRestPath = "/assetpairs" uniswapAckMsg = "ack" ) @@ -79,7 +80,7 @@ func NewUniswapProvider( } wsURL := url.URL{ - Scheme: "wss", + Scheme: uniswapWSScheme, Host: endpoints.Websocket, Path: uniswapWSPath, } diff --git a/tests/integration/provider_test.go b/tests/integration/provider_test.go index 8358ea80..aa0fa806 100644 --- a/tests/integration/provider_test.go +++ b/tests/integration/provider_test.go @@ -50,16 +50,17 @@ func (s *IntegrationTestSuite) TestWebsocketProviders() { var waitGroup sync.WaitGroup for key, pairs := range cfg.ProviderPairs() { - waitGroup.Add(1) providerName := key currencyPairs := pairs + waitGroup.Add(1) go func() { defer waitGroup.Done() endpoint := endpoints[providerName] ctx, cancel := context.WithCancel(context.Background()) s.T().Logf("Checking %s provider with currency pairs %+v", providerName, currencyPairs) - pvd, _ := oracle.NewProvider(ctx, providerName, getLogger(), endpoint, currencyPairs...) + pvd, err := oracle.NewProvider(ctx, providerName, getLogger(), endpoint, currencyPairs...) + require.NoError(s.T(), err) pvd.StartConnections() time.Sleep(60 * time.Second) // wait for provider to connect and receive some prices checkForPrices(s.T(), pvd, currencyPairs, providerName.String())