Skip to content

Commit

Permalink
Refactor of some things (#60)
Browse files Browse the repository at this point in the history
* add new pkphelper v2 abi

* adding some optional params to the minting endpoint

* Rename mintPKP function

* Rename mintPKPv2 function

* unified minting into 1 function

* rename function

* added some terrible tests

* tests work

* add CI tests

* add .env.example

* use yarn
  • Loading branch information
glitch003 authored Feb 13, 2025
1 parent 198baa6 commit 313ebc9
Show file tree
Hide file tree
Showing 20 changed files with 3,166 additions and 806 deletions.
4 changes: 4 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
LIT_TXSENDER_RPC_URL=
LIT_TXSENDER_ADDRESS=
LIT_TXSENDER_PRIVATE_KEY=
NETWORK=
46 changes: 46 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Tests

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
test:
runs-on: ubuntu-latest

services:
redis:
image: redis
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4

- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: "18"
cache: "yarn"

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Create env file
run: |
echo "PORT=8080" >> .env
echo "REDIS_URL=redis://localhost:6379" >> .env
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
- name: Run tests
run: yarn test
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
node_modules
.env*
.env
.env.local
dist
.DS_Store
*.pem
2 changes: 1 addition & 1 deletion config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const baseConfig = {
CAYENNE_PKP_PERMISSIONS_ADDRESS ||
"0x9a0a6DD9D229eEfa5119cEB237c90D843d5e1003",
},
network: NETWORK || "cayenne",
network: NETWORK || "datil-dev",
useSoloNet: USE_SOLO_NET === "true",
expectedOrigins: EXPECTED_ORIGINS?.split(",") || ["http://localhost:3000"],
};
Expand Down
Loading

0 comments on commit 313ebc9

Please sign in to comment.