Skip to content

Commit

Permalink
add datil test and prod support (#72)
Browse files Browse the repository at this point in the history
* add datil test and prod support

* run test on 3 networks sequentially

* ci isnt running

* max parallel 1
  • Loading branch information
glitch003 authored Feb 25, 2025
1 parent 0e0b969 commit 1e9da07
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ on:
jobs:
test:
runs-on: ubuntu-latest
strategy:
max-parallel: 1
matrix:
network: [datil-dev, datil-test, datil]

services:
redis:
Expand Down Expand Up @@ -40,7 +44,7 @@ jobs:
echo "LIT_TXSENDER_RPC_URL=${{ secrets.LIT_TXSENDER_RPC_URL }}" >> .env
echo "LIT_TXSENDER_ADDRESS=${{ secrets.LIT_TXSENDER_ADDRESS }}" >> .env
echo "LIT_TXSENDER_PRIVATE_KEY=${{ secrets.LIT_TXSENDER_PRIVATE_KEY }}" >> .env
echo "NETWORK=datil-dev" >> .env
echo "NETWORK=${{ matrix.network }}" >> .env
- name: Run tests
run: yarn test
14 changes: 11 additions & 3 deletions lit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -325,13 +325,21 @@ export async function mintPKP({
// first get mint cost
const mintCost = await pkpNft.mintCost();

if (config.network === "datil-dev") {
if (
config.network === "datil-dev" ||
config.network === "datil-test" ||
config.network === "datil"
) {
// use PKP helper v2
const abiJson = JSON.parse(
fs.readFileSync("./contracts/datil-dev/PKPHelperV2.json", "utf8"),
);
const pkpHelperContractAddress =
"0x82b48Ddb284cfd9627BA9A29E9Dc605fE654B805";
const pkpHelperV2Addresses = {
"datil-dev": "0x82b48Ddb284cfd9627BA9A29E9Dc605fE654B805",
"datil-test": "0x41837a630BD22F893a6bE3ecBE2101Ca2f32ed6b",
datil: "0x3f24953B66Ed4089c6B25Be8C7a83262d6f6255C",
};
const pkpHelperContractAddress = pkpHelperV2Addresses[config.network];
const pkpHelper = new ethers.Contract(
pkpHelperContractAddress,
abiJson.abi,
Expand Down

0 comments on commit 1e9da07

Please sign in to comment.