Skip to content

Commit

Permalink
Merge pull request #29 from mento-protocol/fix/alfajores-tests
Browse files Browse the repository at this point in the history
fix: alfajores tests
  • Loading branch information
bowd authored Oct 28, 2024
2 parents 9c9a1a0 + 6faeb4c commit 3d786dc
Show file tree
Hide file tree
Showing 6 changed files with 3,374 additions and 2,711 deletions.
11 changes: 6 additions & 5 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
FRACTAL_CLIENT_ID=
MERKLE_PROOF=
AIRGRAB_TESTER=
FRACTAL_CLIENT_ID=I28eze1-UTsP66nYyBDgiRrGCA7Oe6cRFkl7Gk0Gr1A
MERKLE_PROOF=0xf8d9b226b9be1169068d7e6a5c782d5a105845be6d24660c8d2a359a647a6a21,0x041d74aab7f8290e57877f9949b2e3359b67926915bf2a02aff9b565bbf06b42,0x242cb12490b41185805e6f10d8dae649091cbb7bf36eaab99c9c47d4e5b5d146,0xce0dd5a33990e628098f19315fef8ee5e14c3f7a5907522a7e8ce22ad3fab6cc,0xcda804badef15f652778fc4e2180edf25cc74f28383213e43b5e0d266ab0e514,0x42efb7926f1de99a13768d571b87d28b6e039605949c90bf0ba1e7daedac0994,0x2fa2e414c9564c2a5d7385c59a0956d4f52bc2e12f0659c6726e0ef9722709f0,0x8013a27860368a50da779c68f312461cd408606fe3d9b4293a65e264d4745277,0x076c9b529a8a6964bc3ab6733aa49760008e57e00f0445716a0dabe79d4447c4,0x18cc00f9cc90a5910565661f1d3fef114735cac20a30f58701de3aada67d16e4,0xd0bbe41399a26dc188fe0f93854ababbb74426c2efdb7bb9fd9afc24ffeccdf5,0xb4041035d0c6f74606f5a223eb52e3ba047f2fd126351ee08f8e422e41ba4e2c,0xfbe29c72e9229c304de46bd9ac54a5661e6b4a030ec81fb9e72b439e9a3969e8,0x596d38a973ec032b78ed6c1c9d316208dcda8b2dc3df8bf01e3ebbf6d817b1b6,0xa9c375963cc09be3caa5fbd6801b7e265895f4295f08b89c8a766abdfe051b97
AIRGRAB_TESTER=0x6ecA86711a89b769b99eddc438eE4D775b034575
AIRGRAB_TESTER_PK=
RESTRICTED_COUNTRIES=
DEPLOYER=
RESTRICTED_COUNTRIES=CD,CU,GB,IR,KP,ML,MM,SS,SY,US,YE
DEPLOYER=0x56fd3f2bee130e9867942d0f463a16fbe49b8d81

23 changes: 18 additions & 5 deletions config/networks.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
export type NetworkName = 'alfajores' | 'baklava' | 'celo';
export type NetworkName = 'alfajores' | 'celo';

export type NetworkConfig = {
chainId: number;
url: string;
hardfork: string;
gasSettings: {
initialBaseFeePerGas?: number;
gasPrice?: number;
};
};

export type Networks = {
Expand All @@ -13,13 +18,21 @@ export const networks: Networks = {
alfajores: {
chainId: 44787,
url: 'https://alfajores-forno.celo-testnet.org',
},
baklava: {
chainId: 62320,
url: 'https://baklava-forno.celo-testnet.org',
// L2 CELO is full EIP-1559 and 'cancun' compliant
// so we need to set initialBaseFeePerGas to have
// free txs, but the setting fails on mainnet.
hardfork: 'cancun',
gasSettings: {
initialBaseFeePerGas: 0,
gasPrice: 0,
},
},
celo: {
chainId: 42220,
url: 'https://forno.celo.org',
hardfork: 'berlin',
gasSettings: {
gasPrice: 0,
},
},
};
10 changes: 6 additions & 4 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,19 @@ function getNetworkConfig(): NetworkConfig {
return networks[network as NetworkName];
}

const targetNetwork = getNetworkConfig();

const config: HardhatUserConfig = {
defaultNetwork: 'hardhat',
networks: {
hardhat: {
forking: {
enabled: true,
url: getNetworkConfig().url,
url: targetNetwork.url,
},
chainId: getNetworkConfig().chainId,
hardfork: 'berlin',
gasPrice: 0,
chainId: targetNetwork.chainId,
hardfork: targetNetwork.hardfork,
...targetNetwork.gasSettings,
},
},
solidity: {
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"scripts": {
"test": "NETWORK=celo pnpm exec hardhat test",
"test:alfajores": "NETWORK=alfajores pnpm exec hardhat test",
"test:baklava": "NETWORK=baklava pnpm exec hardhat test",
"build": "NETWORK=celo hardhat compile && pnpm tsc",
"lint": "pnpm run prettier:check && pnpm run eslint:check",
"prettier:check": "prettier --config \"./.prettierrc.json\" --check \"**/*.ts\"",
Expand Down
Loading

0 comments on commit 3d786dc

Please sign in to comment.