Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hardcode heimdall url #152

Merged
merged 2 commits into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .github/workflows/test-app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,3 @@ jobs:
browser: chrome
start: yarn dev
wait-on: "http://localhost:3000"
env:
NEXT_PUBLIC_HEIMDALL_URL: "${{ secrets.HEIMDALL_URL }}"
CYPRESS_HEIMDALL_URL: "${{ secrets.HEIMDALL_URL }}"

14 changes: 0 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,6 @@ Visit your local instance of ABI Ninja at: `http://localhost:3000`.

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.

## Setting Up Cypress Environment

Before running the tests, you need to set up your Cypress environment:

1. Copy the example environment file:

```
cp cypress.env.example.json cypress.env.json
```

2. Edit `cypress.env.json` and fill in heimdall_url


## Running Tests

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

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


## Contributing to ABI Ninja

We welcome contributions to ABI Ninja!
Expand Down
3 changes: 0 additions & 3 deletions packages/nextjs/cypress.env.example.json

This file was deleted.

3 changes: 2 additions & 1 deletion packages/nextjs/cypress/support/commands.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
/// <reference types="cypress" />
import { HEIMDALL_API_URL } from "~~/utils/constants";

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

cy.request({
method: "GET",
url: `${Cypress.env("HEIMDALL_URL")}/${contractAddress}?rpc_url=${rpcUrl}`,
url: `${HEIMDALL_API_URL}/${contractAddress}?rpc_url=${rpcUrl}`,
failOnStatusCode: false,
timeout: 30000,
}).then(response => {
Expand Down
5 changes: 2 additions & 3 deletions packages/nextjs/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { AddressInput } from "~~/components/scaffold-eth";
import useFetchContractAbi from "~~/hooks/useFetchContractAbi";
import { useAbiNinjaState } from "~~/services/store/store";
import { parseAndCorrectJSON } from "~~/utils/abi";
import { HEIMDALL_API_URL } from "~~/utils/constants";
import { notification } from "~~/utils/scaffold-eth";

enum TabName {
Expand Down Expand Up @@ -131,9 +132,7 @@ const Home: NextPage = () => {
const fetchAbiFromHeimdall = async (contractAddress: Address) => {
try {
const rpcUrlWithoutHttps = publicClient?.chain.rpcUrls.default.http[0].substring(8);
const response = await fetch(
`${process.env.NEXT_PUBLIC_HEIMDALL_URL}/${contractAddress}?rpc_url=${rpcUrlWithoutHttps}`,
);
const response = await fetch(`${HEIMDALL_API_URL}/${contractAddress}?rpc_url=${rpcUrlWithoutHttps}`);
const abi = await response.json();
if (abi.length === 0) {
notification.error("Failed to fetch ABI from Heimdall. Please try again or enter ABI manually.");
Expand Down
1 change: 1 addition & 0 deletions packages/nextjs/utils/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const HEIMDALL_API_URL = "https://heimdall-api-v2.fly.dev";
Loading