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

Run e2e tests on alfajores #258

Merged
merged 23 commits into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
6 changes: 5 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,14 @@ jobs:
with:
version: nightly-f625d0fa7c51e65b4bf1e8f7931cd1c6e2e285e9

- name: Run e2e tests
- name: Run e2e tests local
shell: bash
run: e2e_test/run_all_tests.sh

- name: Run e2e tests alfajores
shell: bash
run: NETWORK=alfajores e2e_test/run_all_tests.sh

Lint:
runs-on: ["8-cpu","self-hosted","org"]
steps:
Expand Down
4 changes: 2 additions & 2 deletions core/celo_genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ var (
DevAddr = common.BytesToAddress(DevAddr32.Bytes())
DevAddr32 = common.HexToHash("0x42cf1bbc38BaAA3c4898ce8790e21eD2738c6A4a")

DevFeeCurrencyAddr = common.HexToAddress("0xce16") // worth half as much as native CELO
DevFeeCurrencyAddr2 = common.HexToAddress("0xce17") // worth twice as much as native CELO
DevFeeCurrencyAddr = common.HexToAddress("0x000000000000000000000000000000000000ce16") // worth half as much as native CELO
DevFeeCurrencyAddr2 = common.HexToAddress("0x000000000000000000000000000000000000ce17") // worth twice as much as native CELO
DevBalance, _ = new(big.Int).SetString("100000000000000000000", 10)
rateNumerator, _ = new(big.Int).SetString("2000000000000000000000000", 10)
rateNumerator2, _ = new(big.Int).SetString("500000000000000000000000", 10)
Expand Down
4 changes: 2 additions & 2 deletions e2e_test/debug-fee-currency/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ function deploy_fee_currency() {
exit 1
fi
# this always resets the token address for the predeployed oracle3
cast send --private-key $ACC_PRIVKEY $ORACLE3 'setExchangeRate(address, uint256, uint256)' $fee_currency 2ether 1ether &>/dev/null
cast send --private-key $ACC_PRIVKEY $FEE_CURRENCY_DIRECTORY_ADDR 'setCurrencyConfig(address, address, uint256)' $fee_currency $ORACLE3 60000 &>/dev/null
cast send --private-key $ACC_PRIVKEY $ORACLE3 'setExchangeRate(address, uint256, uint256)' $fee_currency 2ether 1ether > /dev/null
cast send --private-key $ACC_PRIVKEY $FEE_CURRENCY_DIRECTORY_ADDR 'setCurrencyConfig(address, address, uint256)' $fee_currency $ORACLE3 60000 > /dev/null
echo "$fee_currency"
)
}
Expand Down
195 changes: 159 additions & 36 deletions e2e_test/js-tests/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion e2e_test/js-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
"chai": "^5.0.0",
"ethers": "^6.10.0",
"mocha": "^10.2.0",
"viem": "^2.9.6"
"viem": "^2.21.18"
}
}
16 changes: 14 additions & 2 deletions e2e_test/js-tests/send_tx.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,29 @@ const devChain = defineChain({
},
});

var chain;
switch(process.env.NETWORK) {
case "alfajores":
chain = celoAlfajores;
break;
default:
chain = devChain;
// Code to run if no cases match
};

const account = privateKeyToAccount(privateKey);

const publicClient = createPublicClient({
account,
chain: devChain,
chain: chain,
transport: http(),
});
const walletClient = createWalletClient({
account,
chain: devChain,
chain: chain,
transport: http(),
});

function sleep(ms) {
return new Promise((resolve) => setTimeout(resolve, ms));
}
Expand Down Expand Up @@ -134,3 +145,4 @@ async function main() {
return receipt;
}
await main();
process.exit(0);
Loading
Loading