Skip to content

Commit

Permalink
Fix: tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dwasse committed Oct 17, 2024
1 parent 61ad52d commit 0823e7e
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions services/rfq/relayer/quoter/quoter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -354,12 +354,12 @@ func (s *QuoterSuite) TestGetDestAmount() {
DestBalance: balance,
}
setQuoteParams := func(originQuoteOffsetBps, destQuoteOffsetBps, quoteWidthBps float64) {
s.config.BaseChainConfig.QuoteWidthBps = quoteWidthBps
tokenCfg := s.config.Chains[origin].Tokens["USDC"]
tokenCfg.QuoteOffsetBps = originQuoteOffsetBps
s.config.Chains[origin].Tokens["USDC"] = tokenCfg
tokenCfg = s.config.Chains[dest].Tokens["USDC"]
tokenCfg.QuoteOffsetBps = destQuoteOffsetBps
tokenCfg.QuoteWidthBps = quoteWidthBps
s.config.Chains[dest].Tokens["USDC"] = tokenCfg
s.manager.SetConfig(s.config)
}
Expand Down Expand Up @@ -398,12 +398,10 @@ func (s *QuoterSuite) TestGetDestAmount() {
expectedAmount = big.NewInt(960_000_000)
s.Equal(expectedAmount, destAmount)

// Set QuoteWidthBps to -100, should default to balance.
// Set QuoteWidthBps to -100, should error.
setQuoteParams(0, 0, -100)
destAmount, err = s.manager.GetDestAmount(s.GetTestContext(), balance, "USDC", input)

Check failure on line 403 in services/rfq/relayer/quoter/quoter_test.go

View workflow job for this annotation

GitHub Actions / Lint (services/rfq)

ineffectual assignment to destAmount (ineffassign)
s.NoError(err)
expectedAmount = balance
s.Equal(expectedAmount, destAmount)
s.Error(err)

// Set origin offset to 100, should return 101% of balance.
setQuoteParams(100, 0, 0)
Expand Down

0 comments on commit 0823e7e

Please sign in to comment.