-
Notifications
You must be signed in to change notification settings - Fork 114
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
Showing
23 changed files
with
1,799 additions
and
60 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
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
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
31 changes: 31 additions & 0 deletions
31
packages/integration-tests/tests/api/before-all/deposit.test.ts
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,31 @@ | ||
import { localConfig } from "../../../src/config"; | ||
import { Buffer } from "../../../src/entities"; | ||
import { Logger } from "../../../src/entities"; | ||
import { Helper } from "../../../src/helper"; | ||
import { Playbook } from "../../../src/playbook/playbook"; | ||
|
||
describe("Deposit", () => { | ||
const playbook = new Playbook(); | ||
const helper = new Helper(); | ||
const bufferRoute = "src/playbook/"; | ||
|
||
let result: string; | ||
let token: string; | ||
jest.setTimeout(localConfig.extendedTimeout); | ||
|
||
//@id633 | ||
it("Make a deposit with 0.0000001 ETH ", async () => { | ||
result = await playbook.depositETH("0.0000001"); | ||
await expect(result).not.toBeUndefined(); | ||
await expect(result.includes(Logger.txHashStartsWith)).toBe(true); | ||
}); | ||
|
||
//@id638 | ||
it("Make a deposit with the Custom token ", async () => { | ||
const bufferFile = bufferRoute + Buffer.L1; | ||
token = await helper.getStringFromFile(bufferFile); | ||
result = await playbook.depositERC20("100", token, 18); | ||
await expect(result).not.toBeUndefined(); | ||
await expect(result.includes(Logger.txHashStartsWith)).toBe(true); | ||
}); | ||
}); |
48 changes: 48 additions & 0 deletions
48
packages/integration-tests/tests/api/before-all/tokens.test.ts
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,48 @@ | ||
import * as request from "supertest"; | ||
import { setTimeout } from "timers/promises"; | ||
|
||
import { environment } from "../../../src/config"; | ||
import { localConfig } from "../../../src/config"; | ||
import { Logger, Token } from "../../../src/entities"; | ||
import { Playbook } from "../../../src/playbook/playbook"; | ||
|
||
describe("Tokens", () => { | ||
jest.setTimeout(localConfig.standardTimeout); | ||
|
||
let deployedToken: string; | ||
|
||
describe("Deploy/check the custom ERC20 tokens", () => { | ||
const playbook = new Playbook(); | ||
|
||
//@id603 | ||
it("Deploy custom ERC20 token to L2", async () => { | ||
deployedToken = await playbook.deployERC20toL2(); | ||
expect(deployedToken).toContain(Logger.txHashStartsWith); | ||
}); | ||
|
||
//@id1456 | ||
it("Verify deployed to L2 custom token via /tokens/{tokenAddress}", async () => { | ||
await setTimeout(localConfig.extendedPause); //works unstable without timeout | ||
const apiRoute = `/tokens/${deployedToken}`; | ||
|
||
return request(environment.blockExplorerAPI) | ||
.get(apiRoute) | ||
.expect(200) | ||
.expect((res) => | ||
expect(res.body).toStrictEqual({ | ||
l2Address: deployedToken, | ||
l1Address: null, | ||
symbol: Token.customL2TokenSymbol, | ||
name: Token.customL2TokenName, | ||
decimals: Token.customL2TokenDecimals, | ||
}) | ||
); | ||
}); | ||
|
||
//@id657 | ||
it("Deploy custom ERC20 token to L1", async () => { | ||
deployedToken = await playbook.deployERC20toL1(); | ||
expect(deployedToken).toContain(Logger.txHashStartsWith); | ||
}); | ||
}); | ||
}); |
Oops, something went wrong.