Skip to content

Commit

Permalink
feat: add unit test for creating and signing vault related transactions
Browse files Browse the repository at this point in the history
  • Loading branch information
Polybius93 committed Jun 3, 2024
1 parent 51e2ab0 commit 425ac8b
Show file tree
Hide file tree
Showing 9 changed files with 1,695 additions and 361 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/code-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,13 @@ jobs:

- name: Commit Message
uses: wagoid/commitlint-github-action@v4

test-unit:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/provision

- name: Unit Test
run: yarn test
8 changes: 8 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export default {
preset: 'ts-jest',
testEnvironment: 'node',
testMatch: ['**/?(*.)+(spec|test).ts'],
moduleNameMapper: {
'^(\\.\\.?\\/.+)\\.js$': '$1',
},
};
10 changes: 6 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"type": "module",
"name": "dlc-btc-lib",
"version": "1.0.3",
"version": "1.0.4",
"description": "This library provides a comprehensive set of interfaces and functions for minting dlcBTC tokens on supported blockchains.",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand All @@ -19,8 +19,7 @@
"scripts": {
"clean": "rm -rf dist && rm -rf node_modules",
"build": "tsc",
"start": "node dist/example.js",
"test": "ts-node index.ts",
"test": "jest",
"lint": "concurrently -g 'yarn lint:eslint' 'yarn lint:prettier' 'yarn run lint:typecheck'",
"lint:eslint": "eslint \"src/**/*.{js,ts}\"",
"lint:eslint:fix": "eslint --fix \"src/**/*.{js,ts}\"",
Expand All @@ -42,18 +41,21 @@
"@ledgerhq/hw-transport-node-hid": "^6.28.6",
"@ledgerhq/hw-transport-webusb": "^6.28.6",
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
"@types/jest": "^29.5.12",
"@types/prompts": "^2.4.9",
"concurrently": "^8.2.2",
"eslint": "^9.1.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.3",
"jest": "^29.7.0",
"lint": "^0.8.19",
"ls-lint": "^0.1.2",
"prettier": "^3.2.5",
"prettier-eslint": "^16.3.0",
"ts-jest": "^29.1.4",
"ts-node": "^10.9.2",
"typecheck": "^0.1.2",
"typescript": "4.7.4",
"typescript": "^5.4.5",
"typescript-eslint": "^7.7.0"
},
"dependencies": {
Expand Down
37 changes: 0 additions & 37 deletions src/constants/example-constants.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/dlc-handlers/software-wallet-dlc-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export class SoftwareWalletDLCHandler {
const taprootMultisigPayment = createTaprootMultisigPayment(
unspendableDerivedPublicKey,
attestorDerivedPublicKey,
Buffer.from(this.taprootDerivedPublicKey),
Buffer.from(this.taprootDerivedPublicKey, 'hex'),
this.bitcoinNetwork
);

Expand Down
250 changes: 0 additions & 250 deletions src/example.ts

This file was deleted.

Loading

0 comments on commit 425ac8b

Please sign in to comment.