Skip to content

Commit 5d20679

Browse files
Merge pull request #176 from HathorNetwork/release-candidate
Release v1.6.2
2 parents dd9ae3f + 96d8167 commit 5d20679

Some content is hidden

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

63 files changed

+3270
-3966
lines changed

.codebuild/buildspec.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ env:
1414
CONFIRM_FIRST_ADDRESS: true
1515
VOIDED_TX_OFFSET: 20
1616
TX_HISTORY_MAX_COUNT: 50
17+
CREATE_NFT_MAX_RETRIES: 3
1718
dev_DEFAULT_SERVER: "https://wallet-service.private-nodes.testnet.hathor.network/v1a/"
1819
dev_WS_DOMAIN: "ws.dev.wallet-service.testnet.hathor.network"
1920
dev_NETWORK: "testnet"
@@ -173,7 +174,7 @@ phases:
173174
commands:
174175
- npm install -g yarn
175176
- corepack enable
176-
- yarn set version stable
177+
- yarn set version 4.1.0
177178
- yarn install
178179
pre_build:
179180
commands:

.dockerignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
dist/
2-
node_modules/
32
__tests__/
43
.git/
54
.github/
@@ -8,4 +7,5 @@ flake.*
87
node_modules/
98
packages/daemon/dist/
109
packages/daemon/node_modules/
10+
packages/common/node_modules/
1111
packages/wallet-service

.github/workflows/main.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
nix_path: nixpkgs=channel:nixos-unstable
4141
extra_nix_config: |
4242
experimental-features = nix-command flakes
43-
43+
4444
- name: Cache Nix
4545
uses: DeterminateSystems/magic-nix-cache-action@v2
4646

@@ -59,6 +59,10 @@ jobs:
5959
CI_DB_HOST: 127.0.0.1
6060
CI_DB_PORT: 3306
6161

62+
- name: Run tests on the common modules project
63+
run: |
64+
nix develop . -c yarn workspace @wallet-service/common run test
65+
6266
- name: Run tests on the daemon
6367
run: |
6468
nix develop . -c yarn workspace sync-daemon run test

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,11 @@ dist
77
coverage/
88
packages/daemon/dist
99
packages/daemon/node_modules
10+
packages/common/node_modules
1011
packages/wallet-service/node_modules
1112
packages/wallet-service/.serverless
1213
packages/wallet-service/.webpack
1314
packages/wallet-service/.env*
15+
packages/wallet-service/.warmup
1416
.yarn/
17+
.env.*

.yarnrc.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ compressionLevel: mixed
22

33
enableGlobalCache: false
44

5-
nmHoistingLimits: dependencies
5+
# Without this setting, the common package is hoisted in the root node_modules, causing the serverless-monorepo plugin to fail
6+
nmHoistingLimits: workspaces
67

78
nodeLinker: node-modules

Dockerfile

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,32 +4,37 @@
44
# arising from the use of this software.
55
# This software cannot be redistributed unless explicitly agreed in writing with the authors.
66

7-
87
# Build phase
98
FROM node:20-alpine AS builder
109

1110
WORKDIR /app
1211

13-
RUN apk update && apk add python3 g++ make
12+
RUN apk update && apk add python3 g++ make py3-setuptools
1413

1514
COPY . .
1615

17-
# Use the last stable berry version:
18-
RUN yarn set version stable
16+
RUN corepack enable
17+
18+
# Use the same version as flake's
19+
RUN yarn set version 4.1.0
1920

20-
# This will install dependencies for the sync-daemon, devDependencies included:
21-
RUN yarn workspaces focus sync-daemon
21+
# This will install dependencies for all packages, except for the lambdas since
22+
# they are ignored in .dockerignore
23+
RUN yarn install
2224

23-
RUN yarn workspace sync-daemon build
25+
RUN yarn workspace sync-daemon run build
2426

25-
# This will remove all dependencies and install production deps only:
26-
RUN yarn workspaces focus sync-daemon --production
27+
# This will remove all dev dependencies and install production deps only
28+
RUN yarn workspaces focus -A --production
2729

28-
FROM node:20-alpine
30+
# Run phase
31+
FROM node:20-alpine AS runner
2932

3033
WORKDIR /app
3134

32-
COPY --from=builder /app/packages/daemon/dist .
33-
COPY --from=builder /app/packages/daemon/node_modules ./node_modules
35+
# Copy only the necessary files from the build phase
36+
COPY --from=builder /app .
37+
38+
WORKDIR /app/packages/daemon/
3439

35-
CMD ["node", "index.js"]
40+
CMD ["node", "dist/index.js"]

package.json

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
22
"name": "hathor-wallet-service",
3-
"version": "1.5.0",
3+
"version": "1.6.2",
44
"workspaces": [
5+
"packages/common",
56
"packages/daemon",
67
"packages/wallet-service"
78
],
@@ -11,14 +12,34 @@
1112
"nohoist": [
1213
"**"
1314
],
14-
"repository": "git@github.com:HathorNetwork/hathor-wallet-service-sync_daemon.git",
15+
"repository": "git@github.com:HathorNetwork/hathor-wallet-service.git",
1516
"author": "André Abadesso <andre.abadesso@gmail.com>",
1617
"private": true,
1718
"devDependencies": {
18-
"dotenv": "^16.3.1",
19-
"mysql2": "^3.6.1",
20-
"sequelize": "^6.33.0",
21-
"sequelize-cli": "^6.6.1"
19+
"@types/jest": "^29.5.12",
20+
"@typescript-eslint/eslint-plugin": "^7.4.0",
21+
"@typescript-eslint/parser": "^7.4.0",
22+
"dotenv": "^16.4.5",
23+
"eslint": "^8.57.0",
24+
"eslint-config-airbnb-base": "^15.0.0",
25+
"eslint-plugin-import": "^2.29.1",
26+
"eslint-plugin-jest": "^27.9.0",
27+
"mysql2": "^3.9.3",
28+
"sequelize": "^6.37.2",
29+
"sequelize-cli": "^6.6.2"
2230
},
23-
"packageManager": "yarn@4.1.0"
31+
"packageManager": "yarn@4.1.0",
32+
"dependencies": {
33+
"@aws-sdk/client-apigatewaymanagementapi": "3.540.0",
34+
"@aws-sdk/client-lambda": "3.540.0",
35+
"@aws-sdk/client-sqs": "3.540.0",
36+
"@hathor/wallet-lib": "0.39.0",
37+
"@wallet-service/common": "1.5.0",
38+
"bip32": "^4.0.0",
39+
"bitcoinjs-lib": "^6.1.5",
40+
"bitcoinjs-message": "^2.2.0",
41+
"jest": "^29.7.0",
42+
"tiny-secp256k1": "^2.2.3",
43+
"winston": "3.13.0"
44+
}
2445
}

packages/common/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Common utils for the wallet-service

packages/wallet-service/events/nftCreationTx.ts renamed to packages/common/__tests__/events/nftCreationTx.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
/* eslint-disable @typescript-eslint/no-empty-function */
1313

1414
import { Context } from 'aws-lambda';
15-
import { Transaction } from '@src/types';
15+
import { Transaction, TxOutput } from '../../src/types';
1616

1717
/**
1818
* A sample transaction for a NFT creation, as obtained by a wallet's history methods
@@ -149,11 +149,12 @@ export function getTransaction(): Transaction {
149149
spent_by: o.spent_by,
150150
token_data: o.token_data,
151151
locked: false,
152-
})),
152+
})) as TxOutput[],
153153
height: 8,
154154
token_name: nftCreationTx.token_name,
155155
token_symbol: nftCreationTx.token_symbol,
156156
};
157+
157158
return result;
158159
}
159160

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
export const mockedAddAlert = jest.fn();
2+
export default jest.mock('@src/utils/alerting.utils', () => {
3+
const originalModule = jest.requireActual('@src/utils/alerting.utils');
4+
5+
return {
6+
...originalModule,
7+
addAlert: mockedAddAlert.mockReturnValue(Promise.resolve()),
8+
};
9+
});

0 commit comments

Comments
 (0)