Skip to content

Commit 5eeea44

Browse files
authored
Merge pull request #237 from hirosystems/develop
release to beta
2 parents 1aa1603 + 2ddb2c7 commit 5eeea44

File tree

78 files changed

+4458
-16111
lines changed

Some content is hidden

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

78 files changed

+4458
-16111
lines changed

.eslintrc.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,15 @@ module.exports = {
99
ecmaVersion: 2020,
1010
sourceType: 'module',
1111
},
12-
ignorePatterns: ['*.config.js', 'config/*', '*.mjs', 'tests/*.js', 'client/*'],
12+
ignorePatterns: [
13+
'*.config.js',
14+
'config/*',
15+
'*.mjs',
16+
'tests/**/*.js',
17+
'client/*',
18+
'coverage/*',
19+
'dist/*',
20+
],
1321
plugins: ['@typescript-eslint', 'eslint-plugin-tsdoc', 'prettier'],
1422
rules: {
1523
'prettier/prettier': 'error',

.github/workflows/ci.yml

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ jobs:
1818
lint:
1919
runs-on: ubuntu-latest
2020
steps:
21-
- uses: actions/checkout@v3
21+
- uses: actions/checkout@v4
2222

2323
- name: Use Node.js
2424
uses: actions/setup-node@v4
2525
with:
2626
node-version-file: '.nvmrc'
2727

2828
- name: Cache node modules
29-
uses: actions/cache@v3
29+
uses: actions/cache@v4
3030
env:
3131
cache-name: cache-node-modules
3232
with:
@@ -49,10 +49,15 @@ jobs:
4949
run: npm run lint:prettier
5050

5151
test:
52+
strategy:
53+
fail-fast: false
54+
matrix:
55+
suite: [admin, api, chainhook, token-queue]
5256
runs-on: ubuntu-latest
5357
env:
5458
API_HOST: 127.0.0.1
5559
API_PORT: 3000
60+
PROMETHEUS_PORT: 9154
5661
PGHOST: 127.0.0.1
5762
PGPORT: 5432
5863
PGUSER: postgres
@@ -66,7 +71,7 @@ jobs:
6671
STACKS_NODE_RPC_HOST: 127.0.0.1
6772
STACKS_NODE_RPC_PORT: 24440
6873
steps:
69-
- uses: actions/checkout@v3
74+
- uses: actions/checkout@v4
7075
with:
7176
fetch-depth: 0
7277

@@ -76,7 +81,7 @@ jobs:
7681
node-version-file: '.nvmrc'
7782

7883
- name: Cache node modules
79-
uses: actions/cache@v3
84+
uses: actions/cache@v4
8085
env:
8186
cache-name: cache-node-modules
8287
with:
@@ -99,10 +104,12 @@ jobs:
99104
npm run testenv:logs -- --no-color &> docker-compose-logs.txt &
100105
101106
- name: Run tests
102-
run: npm run test -- --coverage
107+
run: npm run test:${{ matrix.suite }} -- --coverage
103108

104109
- name: Upload coverage to Codecov
105-
uses: codecov/codecov-action@v3
110+
uses: codecov/codecov-action@v4
111+
with:
112+
token: ${{ secrets.CODECOV_TOKEN }}
106113

107114
- name: Print integration environment logs
108115
run: cat docker-compose-logs.txt
@@ -118,14 +125,14 @@ jobs:
118125
- lint
119126
- test
120127
steps:
121-
- uses: actions/checkout@v3
128+
- uses: actions/checkout@v4
122129
with:
123130
token: ${{ secrets.GH_TOKEN || secrets.GITHUB_TOKEN }}
124131
fetch-depth: 0
125132
persist-credentials: false
126133

127134
- name: Semantic Release
128-
uses: cycjimmy/semantic-release-action@v3
135+
uses: cycjimmy/semantic-release-action@v4
129136
id: semantic
130137
# Only run on non-PR events or only PRs that aren't from forks
131138
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
18
1+
20

.vscode/launch.json

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,5 +75,69 @@
7575
"preLaunchTask": "npm: testenv:run",
7676
"postDebugTask": "npm: testenv:stop",
7777
},
78+
{
79+
"type": "node",
80+
"request": "launch",
81+
"name": "Jest: Admin",
82+
"program": "${workspaceFolder}/node_modules/jest/bin/jest",
83+
"args": [
84+
"--testTimeout=3600000",
85+
"--runInBand",
86+
"--no-cache",
87+
"${workspaceFolder}/tests/admin/"
88+
],
89+
"outputCapture": "std",
90+
"console": "integratedTerminal",
91+
"preLaunchTask": "npm: testenv:run",
92+
"postDebugTask": "npm: testenv:stop",
93+
},
94+
{
95+
"type": "node",
96+
"request": "launch",
97+
"name": "Jest: API",
98+
"program": "${workspaceFolder}/node_modules/jest/bin/jest",
99+
"args": [
100+
"--testTimeout=3600000",
101+
"--runInBand",
102+
"--no-cache",
103+
"${workspaceFolder}/tests/api/"
104+
],
105+
"outputCapture": "std",
106+
"console": "integratedTerminal",
107+
"preLaunchTask": "npm: testenv:run",
108+
"postDebugTask": "npm: testenv:stop",
109+
},
110+
{
111+
"type": "node",
112+
"request": "launch",
113+
"name": "Jest: Chainhook",
114+
"program": "${workspaceFolder}/node_modules/jest/bin/jest",
115+
"args": [
116+
"--testTimeout=3600000",
117+
"--runInBand",
118+
"--no-cache",
119+
"${workspaceFolder}/tests/chainhook/",
120+
],
121+
"outputCapture": "std",
122+
"console": "integratedTerminal",
123+
"preLaunchTask": "npm: testenv:run",
124+
"postDebugTask": "npm: testenv:stop",
125+
},
126+
{
127+
"type": "node",
128+
"request": "launch",
129+
"name": "Jest: Token Queue",
130+
"program": "${workspaceFolder}/node_modules/jest/bin/jest",
131+
"args": [
132+
"--testTimeout=3600000",
133+
"--runInBand",
134+
"--no-cache",
135+
"${workspaceFolder}/tests/token-queue/"
136+
],
137+
"outputCapture": "std",
138+
"console": "integratedTerminal",
139+
"preLaunchTask": "npm: testenv:run",
140+
"postDebugTask": "npm: testenv:stop",
141+
},
78142
]
79143
}

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:18-alpine
1+
FROM node:20-alpine
22

33
WORKDIR /app
44
COPY . .

config/image-cache.js

Lines changed: 0 additions & 147 deletions
This file was deleted.

docker/docker-compose.dev.postgres.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: '3.7'
22
services:
33
postgres:
4-
image: "postgres:14"
4+
image: "postgres:15"
55
ports:
66
- "5432:5432"
77
environment:

migrations/1670264425574_smart-contracts.ts

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,26 +13,37 @@ export function up(pgm: MigrationBuilder): void {
1313
principal: {
1414
type: 'text',
1515
notNull: true,
16+
unique: true,
1617
},
1718
sip: {
1819
type: 'sip_number',
1920
notNull: true,
2021
},
21-
abi: {
22-
type: 'jsonb',
22+
token_count: {
23+
type: 'numeric',
24+
},
25+
fungible_token_name: {
26+
type: 'text',
27+
},
28+
non_fungible_token_name: {
29+
type: 'text',
30+
},
31+
block_height: {
32+
type: 'int',
33+
notNull: true,
34+
},
35+
index_block_hash: {
36+
type: 'text',
2337
notNull: true,
2438
},
2539
tx_id: {
2640
type: 'text',
2741
notNull: true,
2842
},
29-
block_height: {
43+
tx_index: {
3044
type: 'int',
3145
notNull: true,
3246
},
33-
token_count: {
34-
type: 'numeric',
35-
},
3647
created_at: {
3748
type: 'timestamptz',
3849
default: pgm.func('(NOW())'),
@@ -42,7 +53,5 @@ export function up(pgm: MigrationBuilder): void {
4253
type: 'timestamptz',
4354
},
4455
});
45-
pgm.createConstraint('smart_contracts', 'smart_contracts_principal_unique', 'UNIQUE(principal)');
4656
pgm.createIndex('smart_contracts', [{ name: 'block_height', sort: 'DESC' }]);
47-
pgm.createIndex('smart_contracts', ['principal']);
4857
}

0 commit comments

Comments
 (0)