Skip to content

Commit cf2c048

Browse files
hardcode heimdall url (#152)
1 parent 170630b commit cf2c048

File tree

7 files changed

+5
-26
lines changed

7 files changed

+5
-26
lines changed

.github/workflows/test-app.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,3 @@ jobs:
2222
browser: chrome
2323
start: yarn dev
2424
wait-on: "http://localhost:3000"
25-
env:
26-
NEXT_PUBLIC_HEIMDALL_URL: "${{ secrets.HEIMDALL_URL }}"
27-
CYPRESS_HEIMDALL_URL: "${{ secrets.HEIMDALL_URL }}"
28-

README.md

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -46,19 +46,6 @@ Visit your local instance of ABI Ninja at: `http://localhost:3000`.
4646

4747
ABI Ninja uses Cypress for end-to-end testing. Our test suite covers user flows and ensures the application works correctly across different networks and contract types. The test suite will automatically run on pull requests.
4848

49-
## Setting Up Cypress Environment
50-
51-
Before running the tests, you need to set up your Cypress environment:
52-
53-
1. Copy the example environment file:
54-
55-
```
56-
cp cypress.env.example.json cypress.env.json
57-
```
58-
59-
2. Edit `cypress.env.json` and fill in heimdall_url
60-
61-
6249
## Running Tests
6350

6451
To run the Cypress tests:
@@ -98,7 +85,6 @@ When adding new features or modifying existing ones, please update or add corres
9885

9986
For more information on writing Cypress tests, refer to the Cypress Documentation.
10087

101-
10288
## Contributing to ABI Ninja
10389

10490
We welcome contributions to ABI Ninja!

packages/nextjs/.env.example

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ NEXT_PUBLIC_ARBITRUM_ETHERSCAN_API_KEY=
1717
NEXT_PUBLIC_ZKSYNC_ETHERSCAN_API_KEY=
1818
NEXT_PUBLIC_SCROLL_ETHERSCAN_API_KEY=
1919
NEXT_PUBLIC_BASE_ETHERSCAN_API_KEY=
20-
NEXT_PUBLIC_HEIMDALL_URL=
2120

2221
NEXT_PUBLIC_ALCHEMY_API_KEY=
2322
NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID=

packages/nextjs/cypress.env.example.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

packages/nextjs/cypress/support/commands.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
/// <reference types="cypress" />
2+
import { HEIMDALL_API_URL } from "~~/utils/constants";
23

34
Cypress.Commands.add("wakeUpHeimdall", () => {
45
const contractAddress = "0x759c0e9d7858566df8ab751026bedce462ff42df";
56
const rpcUrl = "1rpc.io/sepolia";
67

78
cy.request({
89
method: "GET",
9-
url: `${Cypress.env("HEIMDALL_URL")}/${contractAddress}?rpc_url=${rpcUrl}`,
10+
url: `${HEIMDALL_API_URL}/${contractAddress}?rpc_url=${rpcUrl}`,
1011
failOnStatusCode: false,
1112
timeout: 30000,
1213
}).then(response => {

packages/nextjs/pages/index.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import { AddressInput } from "~~/components/scaffold-eth";
1515
import useFetchContractAbi from "~~/hooks/useFetchContractAbi";
1616
import { useAbiNinjaState } from "~~/services/store/store";
1717
import { parseAndCorrectJSON } from "~~/utils/abi";
18+
import { HEIMDALL_API_URL } from "~~/utils/constants";
1819
import { notification } from "~~/utils/scaffold-eth";
1920

2021
enum TabName {
@@ -131,9 +132,7 @@ const Home: NextPage = () => {
131132
const fetchAbiFromHeimdall = async (contractAddress: Address) => {
132133
try {
133134
const rpcUrlWithoutHttps = publicClient?.chain.rpcUrls.default.http[0].substring(8);
134-
const response = await fetch(
135-
`${process.env.NEXT_PUBLIC_HEIMDALL_URL}/${contractAddress}?rpc_url=${rpcUrlWithoutHttps}`,
136-
);
135+
const response = await fetch(`${HEIMDALL_API_URL}/${contractAddress}?rpc_url=${rpcUrlWithoutHttps}`);
137136
const abi = await response.json();
138137
if (abi.length === 0) {
139138
notification.error("Failed to fetch ABI from Heimdall. Please try again or enter ABI manually.");

packages/nextjs/utils/constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const HEIMDALL_API_URL = "https://heimdall-api-v2.fly.dev";

0 commit comments

Comments
 (0)