-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
28206f1
commit fcdabed
Showing
5 changed files
with
54 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import { | ||
LocalhostProvider, | ||
QuoteTokens, | ||
SignerAccount4, | ||
TestFactory, | ||
wei, | ||
ZeroExApiSwapQuote, | ||
} from './utils' | ||
|
||
const { btc2x, eth } = QuoteTokens | ||
const zeroExApi = ZeroExApiSwapQuote | ||
|
||
describe('BTC2X (mainnet)', () => { | ||
let factory: TestFactory | ||
beforeEach(async () => { | ||
const provider = LocalhostProvider | ||
const signer = SignerAccount4 | ||
factory = new TestFactory(provider, signer, zeroExApi) | ||
}) | ||
|
||
test('can mint with ETH', async () => { | ||
await factory.fetchQuote({ | ||
isMinting: true, | ||
inputToken: eth, | ||
outputToken: btc2x, | ||
indexTokenAmount: wei('1'), | ||
slippage: 0.5, | ||
}) | ||
await factory.executeTx() | ||
}) | ||
|
||
test('can redeem with ETH', async () => { | ||
await factory.fetchQuote({ | ||
isMinting: false, | ||
inputToken: btc2x, | ||
outputToken: eth, | ||
indexTokenAmount: wei('1'), | ||
slippage: 0.5, | ||
}) | ||
await factory.executeTx() | ||
}) | ||
}) |
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