This repository was archived by the owner on Sep 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make integration tests more extensible (#344)
- Loading branch information
Showing
15 changed files
with
504 additions
and
506 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
export let forcePortion = false; | ||
|
||
export const setGlobalForcePortion = (_forcePortion: boolean) => forcePortion = _forcePortion; | ||
export const setGlobalForcePortion = (_forcePortion: boolean) => (forcePortion = _forcePortion); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
import { BigNumber } from "ethers"; | ||
import { BigNumber as BN } from "bignumber.js"; | ||
import { ClassicQuoteDataJSON, Quote } from "../entities"; | ||
import { BigNumber as BN } from 'bignumber.js'; | ||
import { BigNumber } from 'ethers'; | ||
import { ClassicQuoteDataJSON, Quote } from '../entities'; | ||
|
||
// quoteSizeUSD = (multiple of gas-cost-equivalent quote token) * (gas cost in USD) | ||
export function getQuoteSizeEstimateUSD(classicQuote: Quote) { | ||
const classicQuoteData = classicQuote.toJSON() as ClassicQuoteDataJSON; | ||
const classicQuoteData = classicQuote.toJSON() as ClassicQuoteDataJSON; | ||
return new BN( | ||
BigNumber.from(classicQuoteData.quoteGasAdjusted) | ||
.div(BigNumber.from(classicQuoteData.gasUseEstimateQuote)).toString()) | ||
.times(new BN(classicQuoteData.gasUseEstimateUSD)); | ||
.div(BigNumber.from(classicQuoteData.gasUseEstimateQuote)) | ||
.toString() | ||
).times(new BN(classicQuoteData.gasUseEstimateUSD)); | ||
} |
Oops, something went wrong.