Skip to content

Commit

Permalink
[CORE-686] - Pricefeed integration tests bugfix (#657)
Browse files Browse the repository at this point in the history
* Fix bug with client integration tests that wasn't validating price equality for price expectations.
  • Loading branch information
clemire authored Oct 18, 2023
1 parent 315890f commit a715432
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions protocol/daemons/pricefeed/client/client_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ func (s *PriceDaemonIntegrationTestSuite) SetupTest() {
s.exchangeServer.SetPrice(exchange_config.MARKET_LINK_USD, 3_000_000)

// Set USDT to 90 cents.
s.exchangeServer.SetPrice(exchange_config.MARKET_USDT_USD, 900_000_000)
s.exchangeServer.SetPrice(exchange_config.MARKET_USDT_USD, .9)

// Save daemon flags to use for client startup.
s.daemonFlags = flags.GetDefaultDaemonFlags()
Expand Down Expand Up @@ -356,17 +356,19 @@ func (s *PriceDaemonIntegrationTestSuite) expectPricesWithTimeout(
if len(prices) != len(expectedPrices) {
continue
}

allPricesMatch := true

for marketId, expectedPrice := range expectedPrices {
actualPrice, ok := prices[marketId]
if !ok {
continue
}

if actualPrice != expectedPrice {
continue
if !ok || actualPrice != expectedPrice {
allPricesMatch = false
break
}
}
return
if allPricesMatch {
return
}
}
}

Expand Down

0 comments on commit a715432

Please sign in to comment.