Skip to content

Commit

Permalink
Fix: tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dwasse committed Jul 24, 2024
1 parent aa87eab commit 367bd6f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions services/rfq/relayer/pricer/fee_pricer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
fetcherMocks "github.com/synapsecns/sanguine/ethergo/submitter/mocks"
"github.com/synapsecns/sanguine/services/rfq/relayer/pricer"
priceMocks "github.com/synapsecns/sanguine/services/rfq/relayer/pricer/mocks"
"github.com/synapsecns/sanguine/services/rfq/relayer/relconfig"
)

var defaultPrices = map[string]float64{"ETH": 2000., "USDC": 1., "MATIC": 0.5}
Expand Down Expand Up @@ -261,8 +262,8 @@ func (s *PricerSuite) TestGetGasPrice() {

func (s *PricerSuite) TestGetTotalFeeWithMultiplier() {
// Override the fixed fee multiplier to greater than 1.
s.config.BaseChainConfig.QuoteFixedFeeMultiplier = 2
s.config.BaseChainConfig.RelayFixedFeeMultiplier = 4
s.config.BaseChainConfig.QuoteFixedFeeMultiplier = relconfig.NewFloatPtr(2)
s.config.BaseChainConfig.RelayFixedFeeMultiplier = relconfig.NewFloatPtr(4)

// Build a new FeePricer with a mocked client for fetching gas price.
clientFetcher := new(fetcherMocks.ClientFetcher)
Expand Down Expand Up @@ -295,7 +296,7 @@ func (s *PricerSuite) TestGetTotalFeeWithMultiplier() {
s.Equal(expectedFee, fee)

// Override the fixed fee multiplier to less than 1; should default to 1.
s.config.BaseChainConfig.QuoteFixedFeeMultiplier = -1
s.config.BaseChainConfig.QuoteFixedFeeMultiplier = relconfig.NewFloatPtr(-1)

// Build a new FeePricer with a mocked client for fetching gas price.
clientOrigin.On(testsuite.GetFunctionName(clientOrigin.SuggestGasPrice), mock.Anything).Once().Return(headerOrigin, nil)
Expand All @@ -314,7 +315,7 @@ func (s *PricerSuite) TestGetTotalFeeWithMultiplier() {
s.Equal(expectedFee, fee)

// Reset the fixed fee multiplier to zero; should default to 1
s.config.BaseChainConfig.QuoteFixedFeeMultiplier = 0
s.config.BaseChainConfig.QuoteFixedFeeMultiplier = relconfig.NewFloatPtr(0)

// Build a new FeePricer with a mocked client for fetching gas price.
clientOrigin.On(testsuite.GetFunctionName(clientOrigin.SuggestGasPrice), mock.Anything).Once().Return(headerOrigin, nil)
Expand Down
2 changes: 1 addition & 1 deletion services/rfq/relayer/quoter/quoter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ func (s *QuoterSuite) TestGetOriginAmount() {
balance := big.NewInt(1000_000_000) // 1000 USDC

setQuoteParams := func(quotePct, quoteOffset float64, minQuoteAmount string) {
s.config.BaseChainConfig.QuotePct = quotePct
s.config.BaseChainConfig.QuotePct = &quotePct
destTokenCfg := s.config.Chains[dest].Tokens["USDC"]
destTokenCfg.MinQuoteAmount = minQuoteAmount
originTokenCfg := s.config.Chains[origin].Tokens["USDC"]
Expand Down

0 comments on commit 367bd6f

Please sign in to comment.