File tree 1 file changed +9
-2
lines changed
packages/bridge-controller/src
1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -167,14 +167,21 @@ export class BridgeController extends StaticIntervalPollingController<BridgePoll
167
167
168
168
if ( isValidQuoteRequest ( updatedQuoteRequest ) ) {
169
169
this . #quotesFirstFetched = Date . now ( ) ;
170
+ const providerConfig = this . #getSelectedNetworkClient( ) ?. configuration ;
170
171
171
- // Query the balance of the source token if the source chain is an EVM chain
172
172
let insufficientBal : boolean | undefined ;
173
173
if ( isSolanaChainId ( updatedQuoteRequest . srcChainId ) ) {
174
+ // If the source chain is not an EVM network, get the insufficientBal value from the params
174
175
insufficientBal = paramsToUpdate . insufficientBal ;
176
+ } else if ( providerConfig ?. rpcUrl ?. includes ( 'tenderly' ) ) {
177
+ // If the rpcUrl is a tenderly fork (e2e tests), set insufficientBal to true
178
+ // The bridge-api filters out quotes if the balance on mainnet is insufficient
179
+ // This override allows quotes to always be returned
180
+ insufficientBal = true ;
175
181
} else {
182
+ // Otherwise query the src token balance from the RPC provider
176
183
insufficientBal =
177
- paramsToUpdate . insufficientBal ||
184
+ paramsToUpdate . insufficientBal ??
178
185
! ( await this . #hasSufficientBalance( updatedQuoteRequest ) ) ;
179
186
}
180
187
You can’t perform that action at this time.
0 commit comments