Skip to content

Commit

Permalink
Feat/frameworks upgrade (#2297)
Browse files Browse the repository at this point in the history
Co-authored-by: Alex Gomez <alex@aave.com>
Co-authored-by: Joaquin Battilana <battilanajn@gmail.com>
Co-authored-by: Mark Grothe <grothem@gmail.com>
  • Loading branch information
4 people authored Jan 2, 2025
1 parent 114e728 commit c81300e
Show file tree
Hide file tree
Showing 175 changed files with 21,084 additions and 18,501 deletions.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID=
NEXT_PUBLIC_MIXPANEL=
NEXT_PUBLIC_FIAT_ON_RAMP=true
NEXT_PUBLIC_SUBGRAPH_API_KEY=
NEXT_PUBLIC_IS_CYPRESS_ENABLED=false
5 changes: 5 additions & 0 deletions .github/actions/build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ inputs:
description: subgraph api key
required: false
default: ''
NEXT_PUBLIC_IS_CYPRESS_ENABLED:
description: enables cypress
required: false
default: 'true'

runs:
using: 'composite'
Expand Down Expand Up @@ -84,3 +88,4 @@ runs:
NEXT_PUBLIC_FIAT_ON_RAMP: 'false'
NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID: '${{ inputs.NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID }}'
NEXT_PUBLIC_SUBGRAPH_API_KEY: '${{ inputs.NEXT_PUBLIC_SUBGRAPH_API_KEY }}'
NEXT_PUBLIC_IS_CYPRESS_ENABLED: '${{ inputs.NEXT_PUBLIC_IS_CYPRESS_ENABLED }}'
3 changes: 3 additions & 0 deletions .github/actions/upload-artifacts/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,14 @@ runs:
name: pr
path: __pr/
retention-days: 10

- name: store static build
uses: actions/upload-artifact@6673cd052c4cd6fcf4b4e6e60ea986c889389535 # v3.0.0
with:
name: '${{ inputs.BUILD_ARTIFACT_NAME }}'
path: out/
retention-days: 10

- name: store nextjs build
if: inputs.NEXTJS_BUILD == 'true'
uses: actions/upload-artifact@6673cd052c4cd6fcf4b4e6e60ea986c889389535 # v3.0.0
Expand All @@ -44,3 +46,4 @@ runs:
.next
!.next/cache
retention-days: 10

1 change: 1 addition & 0 deletions .github/workflows/build-test-deploy-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ jobs:
NEXT_PUBLIC_FIAT_ON_RAMP: 'false'
NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID: ${{ secrets.WALLET_CONNECT_PROJECT_ID }}
NEXT_PUBLIC_SUBGRAPH_API_KEY: ${{ secrets.NEXT_PUBLIC_SUBGRAPH_API_KEY }}
NEXT_PUBLIC_IS_CYPRESS_ENABLED: 'true'

- name: Upload artifacts
uses: ./.github/actions/upload-artifacts
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/build-test-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ jobs:
NEXT_PUBLIC_FIAT_ON_RAMP: 'false'
NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID: ${{ secrets.WALLET_CONNECT_PROJECT_ID }}
NEXT_PUBLIC_SUBGRAPH_API_KEY: ${{ secrets.NEXT_PUBLIC_SUBGRAPH_API_KEY }}
NEXT_PUBLIC_IS_CYPRESS_ENABLED: 'false'

- name: Upload artifacts
uses: ./.github/actions/upload-artifacts
Expand Down Expand Up @@ -113,7 +114,7 @@ jobs:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2

- name: download build
uses: actions/download-artifact@fb598a63ae348fa914e94cd0ff38f362e927b741 # v3.0.0
uses: actions/download-artifact@v4.1.8 # v3.0.0
with:
name: nextjs_build
path: .next
Expand All @@ -136,7 +137,7 @@ jobs:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2

- name: download build
uses: actions/download-artifact@fb598a63ae348fa914e94cd0ff38f362e927b741 # v3.0.0
uses: actions/download-artifact@v4.1.8 # v3.0.0
with:
name: out
path: out
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@ jobs:
uses: actions/checkout@v3
- name: 'Dependency Review'
uses: actions/dependency-review-action@v2
with:
fail-on-severity: critical
14 changes: 4 additions & 10 deletions .github/workflows/update-prod-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,16 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
environment: [
{
name: 'Production',
domain: 'app.aave.com',
artifact: 'out',
build_path: 'out'
}
]
environment:
[{ name: 'Production', domain: 'app.aave.com', artifact: 'out', build_path: 'out' }]
environment:
name: ${{ matrix.environment.name }}
url: https://${{ matrix.environment.domain }}
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2

- name: download build
uses: actions/download-artifact@fb598a63ae348fa914e94cd0ff38f362e927b741 # v3.0.0
uses: actions/download-artifact@v4.1.8 # v3.0.0
with:
name: ${{ matrix.environment.artifact }}
path: ${{ matrix.environment.build_path }}
Expand Down Expand Up @@ -64,4 +58,4 @@ jobs:
artifacts: app.tar.gz
bodyFile: release-notes.md
commit: '${{ github.sha }}'
tag: '${{ env.TAG }}'
tag: '${{ env.TAG }}'
1 change: 1 addition & 0 deletions custom.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ namespace NodeJS {
NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID: string;
NEXT_PUBLIC_FIAT_ON_RAMP: string;
NEXT_PUBLIC_SUBGRAPH_API_KEY: string;
NEXT_PUBLIC_IS_CYPRESS_ENABLED: string;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const testData = {
],
};

describe('METIS GENERAL SPEC', () => {
describe.skip('METIS GENERAL SPEC', () => {
const skipTestState = skipState(false);
configEnvMetis('0xea4198Fa2BD2b459967E72f508ff42dDaBb0ff27');
dashboardAssetValuesVerification(testData.dashboard, skipTestState);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const testData = {
],
};

describe('SCROLL GENERAL SPEC', () => {
describe.skip('SCROLL GENERAL SPEC', () => {
const skipTestState = skipState(false);
configEnvScroll('0xF93457533efd041D2A5200A82ccA718Fcdc42103');
dashboardAssetValuesVerification(testData.dashboard, skipTestState);
Expand Down
41 changes: 0 additions & 41 deletions cypress/e2e/2-settings/wallet-connect.cy.ts

This file was deleted.

1 change: 1 addition & 0 deletions cypress/e2e/3-stake-governance/stake.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ testCases.forEach(
const skipTestState = skipState(false);
configEnvWithTenderlyMainnetFork({
tokens: [{ tokenAddress: testCase.asset.address }],
urlSuffix: '/staking',
});
stake(
{
Expand Down
4 changes: 2 additions & 2 deletions cypress/e2e/4-gho-ethereum/helpers/token.helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,12 @@ const donors: Donors = {
},
aMATICPolygonV2: {
name: 'aMATIC',
donorWalletAddress: '0x7068Ea5255cb05931EFa8026Bd04b18F3DeB8b0B',
donorWalletAddress: '0xaFDAbFb6227507fF6522b8a242168F6b5F353a6E',
tokenAddress: '0x8dF3aad3a84da6b69A4DA8aeC3eA40d9091B2Ac4',
},
aAVAXAvalancheV2: {
name: 'aAVAX',
donorWalletAddress: '0xe5dbFF893E6120C0d013FB046cd755990E4BE9a9',
donorWalletAddress: '0x36cc7B13029B5DEe4034745FB4F24034f3F2ffc6',
tokenAddress: '0xDFE521292EcE2A4f44242efBcD66Bc594CA9714B',
},
};
Expand Down
1 change: 1 addition & 0 deletions cypress/support/commands.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'cypress-wait-until';
// import { Provider } from '@ethersproject/providers';

import { CustomizedBridge } from './tools/bridge';

Expand Down
13 changes: 11 additions & 2 deletions cypress/support/steps/configuration.steps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,15 @@ export const configEnvWithTenderly = ({
unpause,
wallet,
enableTestnet = false,
urlSuffix = '',
}: {
chainId: number;
market: string;
tokens?: { tokenAddress: string; donorAddress?: string; tokenCount?: string }[];
unpause?: boolean;
wallet?: { address: string; privateKey: string };
enableTestnet?: boolean;
urlSuffix?: string;
}) => {
const tenderly = new TenderlyFork({ forkNetworkID: chainId });
const walletAddress: string = wallet != null ? wallet.address : DEFAULT_TEST_ACCOUNT.address;
Expand Down Expand Up @@ -51,10 +53,15 @@ export const configEnvWithTenderly = ({
}
});
before('Open main page', () => {
let url = URL as string;
if (urlSuffix) {
url = `${url}/${urlSuffix}`;
}

const rpc = tenderly.get_rpc_url();
provider = new JsonRpcProvider(rpc, 3030);
signer = new Wallet(privateKey, provider);
cy.visit(URL, {
cy.visit(url, {
onBeforeLoad(win) {
// eslint-disable-next-line
(win as any).ethereum = new CustomizedBridge(signer, provider);
Expand Down Expand Up @@ -100,13 +107,15 @@ const createConfigWithTenderlyFork =
tokens,
v3,
wallet,
urlSuffix,
}: {
market?: string;
tokens?: { tokenAddress: string }[];
v3?: boolean;
wallet?: { address: string; privateKey: string };
urlSuffix?: string;
}) =>
configEnvWithTenderly({ chainId, market, tokens, unpause: v3, wallet });
configEnvWithTenderly({ chainId, market, tokens, unpause: v3, wallet, urlSuffix });

export const configEnvWithTenderlyMainnetFork = createConfigWithTenderlyFork(
ChainId.mainnet,
Expand Down
1 change: 0 additions & 1 deletion cypress/support/steps/stake.steps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ export const stake = (
return describe(`Stake ${_shortName}`, () => {
skipSetup({ skip, updateSkipStatus });
it(`Open staking page`, () => {
cy.get('[data-cy="menuStake"]').click();
if (asset.shortName === 'GHO') cy.wait(5000);
cy.get(`button[value="${tabValue}"]`).then(($clickable) => {
if ($clickable.prop('disabled')) return;
Expand Down
25 changes: 16 additions & 9 deletions cypress/support/tools/bridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export class CustomizedBridge extends Eip1193Bridge {
chainId: number;

constructor(signer: Signer, provider?: providers.Provider, chainId?: number) {
super(signer, provider);
super(signer as any, provider);
this.chainId = chainId || 3030;
}

Expand Down Expand Up @@ -76,14 +76,17 @@ export class CustomizedBridge extends Eip1193Bridge {
);
return tx;
}
if (method === 'eth_chainId') {
if (isCallbackForm) {
// @ts-ignore
callback(null, { result: this.chainId });
} else {
return Promise.resolve(this.chainId);
}
}
// if (method === 'eth_chainId') {
// const result = await this.provider.getNetwork();
// const chainId = utils.hexValue(result.chainId);

// if (isCallbackForm) {
// // @ts-ignore
// callback(null, { result: chainId });
// } else {
// return Promise.resolve(chainId);
// }
// }
if (method === 'eth_sendTransaction') {
if (!this.signer) {
throw new Error('eth_sendTransaction requires an account');
Expand All @@ -98,6 +101,10 @@ export class CustomizedBridge extends Eip1193Bridge {
const req = JsonRpcProvider.hexlifyTransaction(params[0], { from: true, gas: true });

req.gasLimit = req.gas;
// @ts-ignore
// Work around to force the chainId to be used for the fork environments
req.chainId = this.chainId;

delete req.gas;

const tx = await this.signer.sendTransaction(req);
Expand Down
1 change: 1 addition & 0 deletions cypress/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"compilerOptions": {
"noEmit": true,
"types": ["cypress", "cypress-wait-until"],
"sourceMap": false,
},
"include": [
"../node_modules/cypress",
Expand Down
23 changes: 23 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,33 @@ module.exports = withBundleAnalyzer({
],
});
config.experiments = { topLevelAwait: true };
config.resolve.fallback = { fs: false, net: false, tls: false };
return config;
},
reactStrictMode: true,
// assetPrefix: "./",
trailingSlash: true,
pageExtensions,
// NOTE: Needed for SAFE testing locally
// async headers() {
// return [
// {
// source: '/manifest.json',
// headers: [
// {
// key: 'Access-Control-Allow-Origin',
// value: '*',
// },
// {
// key: 'Access-Control-Allow-Methods',
// value: 'GET',
// },
// {
// key: 'Access-Control-Allow-Headers',
// value: 'X-Requested-With, content-type, Authorization',
// },
// ],
// },
// ];
// },
});
Loading

0 comments on commit c81300e

Please sign in to comment.