Skip to content

Commit

Permalink
fix: review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
olehbairak committed Feb 27, 2024
1 parent e3aa291 commit 4735b11
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
4 changes: 4 additions & 0 deletions packages/integration-tests/src/entities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ export enum Wallets {
richWalletPrivateKey = "0x7726827caac94a7f9e1b160f7ea819f172f7b6f9d2a97f992c38edeab82d4110",
}

export enum FixedValues {
greeterContractSepolia = "0x180faDac8ce638C67640a6C29BdfB5CB60eCDB76",
}

export enum BlockExplorer {
baseUrl = "http://localhost:3010",
localNetwork = "/?network=local",
Expand Down
2 changes: 2 additions & 0 deletions packages/integration-tests/src/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ export class Helper {
return request(environment.blockExplorerAPI).get(apiRoute);
} else if (network === `sepolia`) {
return request(environment.blockExplorerSepoliaAPI).get(apiRoute);
} else {
throw new Error(`The API route for the network ${network} is undefined.`);
}
}

Expand Down
8 changes: 3 additions & 5 deletions packages/integration-tests/tests/api/contracts.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { localConfig } from "../../src/config";
import { Buffer, Wallets } from "../../src/entities";
import { Buffer, FixedValues, Wallets } from "../../src/entities";
import { Helper } from "../../src/helper";
import { Playbook } from "../../src/playbook/playbook";

Expand Down Expand Up @@ -39,8 +39,7 @@ describe("API module: Contract", () => {
//id1695
it("Verify /api?module=contract&action=getabi response", async () => {
await helper.retryTestAction(async () => {
const greeterContract = "0x180faDac8ce638C67640a6C29BdfB5CB60eCDB76";
apiRoute = `/api?module=contract&action=getabi&address=${greeterContract}`;
apiRoute = `/api?module=contract&action=getabi&address=${FixedValues.greeterContractSepolia}`;
response = await helper.performGETrequest(apiRoute, "sepolia");

expect(response.status).toBe(200);
Expand All @@ -53,8 +52,7 @@ describe("API module: Contract", () => {
//id1802
it("Verify /api?module=contract&action=getsourcecode response", async () => {
await helper.retryTestAction(async () => {
const greeterContract = "0x180faDac8ce638C67640a6C29BdfB5CB60eCDB76";
apiRoute = `/api?module=contract&action=getsourcecode&address=${greeterContract}`;
apiRoute = `/api?module=contract&action=getsourcecode&address=${FixedValues.greeterContractSepolia}`;
response = await helper.performGETrequest(apiRoute, "sepolia");

expect(response.status).toBe(200);
Expand Down

0 comments on commit 4735b11

Please sign in to comment.