Skip to content

Commit d79f47d

Browse files
add wallet contribution against moksha testnet
1 parent 6fdf059 commit d79f47d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+13482
-701
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Backend Build
2+
3+
on:
4+
push:
5+
paths:
6+
- 'backend/**'
7+
pull_request:
8+
paths:
9+
- 'backend/**'
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
19+
- name: Setup Go
20+
uses: actions/setup-go@v4
21+
with:
22+
go-version: '1.21'
23+
cache: true
24+
25+
- name: Install dependencies
26+
run: |
27+
cd backend
28+
go mod download
29+
30+
- name: Build backend
31+
run: |
32+
cd backend
33+
go build -v .
34+
35+
- name: Run tests
36+
run: |
37+
cd backend
38+
go test -v ./...
39+
40+
- name: Check for race conditions
41+
run: |
42+
cd backend
43+
go test -race -v ./...
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Chrome Extension Check
2+
3+
on:
4+
push:
5+
paths:
6+
- 'chrome-extension/**'
7+
pull_request:
8+
paths:
9+
- 'chrome-extension/**'
10+
11+
jobs:
12+
validate:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
19+
- name: Setup Node.js
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: '18'
23+
24+
- name: Validate manifest.json
25+
run: |
26+
cd chrome-extension
27+
node -e "
28+
const manifest = require('./manifest.json');
29+
if (!manifest.name || !manifest.version || !manifest.manifest_version) {
30+
console.error('Invalid manifest.json: missing required fields');
31+
process.exit(1);
32+
}
33+
console.log('Manifest validation passed');
34+
"
35+
36+
- name: Check for required files
37+
run: |
38+
cd chrome-extension
39+
required_files=(
40+
'manifest.json'
41+
'background/background.js'
42+
'popup/popup.html'
43+
'popup/popup.js'
44+
'content/content.js'
45+
'icons/logo.png'
46+
)
47+
48+
for file in "${required_files[@]}"; do
49+
if [ ! -f "$file" ]; then
50+
echo "Missing required file: $file"
51+
exit 1
52+
fi
53+
done
54+
echo "All required files present"
55+
56+
- name: Validate JavaScript syntax
57+
run: |
58+
cd chrome-extension
59+
node -c background/background.js
60+
node -c popup/popup.js
61+
node -c content/content.js
62+
echo "JavaScript syntax validation passed"
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Contracts Pipeline
2+
3+
on:
4+
push:
5+
paths:
6+
- 'contracts/**'
7+
pull_request:
8+
paths:
9+
- 'contracts/**'
10+
11+
jobs:
12+
test:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
19+
- name: Setup Node.js
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: '18'
23+
cache: 'npm'
24+
cache-dependency-path: contracts/package-lock.json
25+
26+
- name: Install dependencies
27+
run: |
28+
cd contracts
29+
npm ci
30+
31+
- name: Compile contracts
32+
run: |
33+
cd contracts
34+
npx hardhat compile
35+
36+
- name: Run tests
37+
run: |
38+
cd contracts
39+
npx hardhat test
40+
41+
- name: Check contract size
42+
run: |
43+
cd contracts
44+
npx hardhat size-contracts

.github/workflows/main.yml

Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
name: Main CI Pipeline
2+
3+
on:
4+
push:
5+
branches: [ main, develop ]
6+
pull_request:
7+
branches: [ main, develop ]
8+
9+
jobs:
10+
web-lint:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
16+
- name: Setup Node.js
17+
uses: actions/setup-node@v4
18+
with:
19+
node-version: '18'
20+
cache: 'npm'
21+
cache-dependency-path: web/package-lock.json
22+
23+
- name: Install dependencies
24+
run: |
25+
cd web
26+
npm ci
27+
28+
- name: Run ESLint
29+
run: |
30+
cd web
31+
npm run lint
32+
33+
- name: Check TypeScript
34+
run: |
35+
cd web
36+
npx tsc --noEmit
37+
38+
backend-build:
39+
runs-on: ubuntu-latest
40+
steps:
41+
- name: Checkout code
42+
uses: actions/checkout@v4
43+
44+
- name: Setup Go
45+
uses: actions/setup-go@v4
46+
with:
47+
go-version: '1.21'
48+
cache: true
49+
50+
- name: Install dependencies
51+
run: |
52+
cd backend
53+
go mod download
54+
55+
- name: Build backend
56+
run: |
57+
cd backend
58+
go build -v .
59+
60+
- name: Run tests
61+
run: |
62+
cd backend
63+
go test -v ./...
64+
65+
contracts-test:
66+
runs-on: ubuntu-latest
67+
steps:
68+
- name: Checkout code
69+
uses: actions/checkout@v4
70+
71+
- name: Setup Node.js
72+
uses: actions/setup-node@v4
73+
with:
74+
node-version: '18'
75+
cache: 'npm'
76+
cache-dependency-path: contracts/package-lock.json
77+
78+
- name: Install dependencies
79+
run: |
80+
cd contracts
81+
npm ci
82+
83+
- name: Compile contracts
84+
run: |
85+
cd contracts
86+
npx hardhat compile
87+
88+
- name: Run tests
89+
run: |
90+
cd contracts
91+
npx hardhat test
92+
93+
chrome-extension-validate:
94+
runs-on: ubuntu-latest
95+
steps:
96+
- name: Checkout code
97+
uses: actions/checkout@v4
98+
99+
- name: Setup Node.js
100+
uses: actions/setup-node@v4
101+
with:
102+
node-version: '18'
103+
104+
- name: Validate manifest.json
105+
run: |
106+
cd chrome-extension
107+
node -e "
108+
const manifest = require('./manifest.json');
109+
if (!manifest.name || !manifest.version || !manifest.manifest_version) {
110+
console.error('Invalid manifest.json: missing required fields');
111+
process.exit(1);
112+
}
113+
console.log('✅ Manifest validation passed');
114+
"
115+
116+
- name: Check for required files
117+
run: |
118+
cd chrome-extension
119+
required_files=(
120+
'manifest.json'
121+
'background/background.js'
122+
'popup/popup.html'
123+
'popup/popup.js'
124+
'content/content.js'
125+
'icons/logo.png'
126+
)
127+
128+
for file in "${required_files[@]}"; do
129+
if [ ! -f "$file" ]; then
130+
echo "❌ Missing required file: $file"
131+
exit 1
132+
fi
133+
done
134+
echo "✅ All required files present"
135+
136+
- name: Validate JavaScript syntax
137+
run: |
138+
cd chrome-extension
139+
node -c background/background.js
140+
node -c popup/popup.js
141+
node -c content/content.js
142+
echo "✅ JavaScript syntax validation passed"

.github/workflows/web-lint.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Web Lint Checks
2+
3+
on:
4+
push:
5+
paths:
6+
- 'web/**'
7+
pull_request:
8+
paths:
9+
- 'web/**'
10+
11+
jobs:
12+
lint:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
19+
- name: Setup Node.js
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: '18'
23+
cache: 'npm'
24+
cache-dependency-path: web/package-lock.json
25+
26+
- name: Install dependencies
27+
run: |
28+
cd web
29+
npm ci
30+
31+
- name: Run ESLint
32+
run: |
33+
cd web
34+
npm run lint
35+
36+
- name: Check TypeScript
37+
run: |
38+
cd web
39+
npx tsc --noEmit

backend/.env.example

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
MONGODB_URI=
1+
MONGODB_URI=
2+
JWT_SECRET=
3+
REGISTRY_CONTRACT_ADDRESS=

0 commit comments

Comments
 (0)