Skip to content

Commit

Permalink
Test
Browse files Browse the repository at this point in the history
  • Loading branch information
Rigidity committed Sep 24, 2024
1 parent 5f2d81f commit 3860854
Show file tree
Hide file tree
Showing 7 changed files with 214 additions and 9 deletions.
34 changes: 34 additions & 0 deletions napi/.tsimp/daemon/log
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/Users/rigidity/Desktop/wallet-sdk/napi/node_modules/.pnpm/[email protected]/node_modules/typescript/lib/typescript.js:21622
let moduleResolution = compilerOptions.moduleResolution;
^

TypeError: Cannot read properties of undefined (reading 'moduleResolution')
at computeValue (/Users/rigidity/Desktop/wallet-sdk/napi/node_modules/.pnpm/[email protected]/node_modules/typescript/lib/typescript.js:21622:46)
at importSyntaxAffectsModuleResolution (/Users/rigidity/Desktop/wallet-sdk/napi/node_modules/.pnpm/[email protected]/node_modules/typescript/lib/typescript.js:21599:28)
at getDefaultResolutionModeForFileWorker (/Users/rigidity/Desktop/wallet-sdk/napi/node_modules/.pnpm/[email protected]/node_modules/typescript/lib/typescript.js:127780:10)
at Object.getMode (/Users/rigidity/Desktop/wallet-sdk/napi/node_modules/.pnpm/[email protected]/node_modules/typescript/lib/typescript.js:124407:85)
at Object.resolveTypeReferenceDirectiveReferences (file:///Users/rigidity/Desktop/wallet-sdk/napi/node_modules/.pnpm/[email protected][email protected]/node_modules/tsimp/dist/esm/service/resolve-type-reference-directive-references.js:24:45)
at resolveTypeReferenceDirectiveNamesWorker (/Users/rigidity/Desktop/wallet-sdk/napi/node_modules/.pnpm/[email protected]/node_modules/typescript/lib/typescript.js:125232:20)
at resolveNamesReusingOldState (/Users/rigidity/Desktop/wallet-sdk/napi/node_modules/.pnpm/[email protected]/node_modules/typescript/lib/typescript.js:125354:14)
at resolveTypeReferenceDirectiveNamesReusingOldState (/Users/rigidity/Desktop/wallet-sdk/napi/node_modules/.pnpm/[email protected]/node_modules/typescript/lib/typescript.js:125325:12)
at processTypeReferenceDirectives (/Users/rigidity/Desktop/wallet-sdk/napi/node_modules/.pnpm/[email protected]/node_modules/typescript/lib/typescript.js:126706:156)
at findSourceFileWorker (/Users/rigidity/Desktop/wallet-sdk/napi/node_modules/.pnpm/[email protected]/node_modules/typescript/lib/typescript.js:126595:9)

Node.js v21.7.0
/Users/rigidity/Desktop/wallet-sdk/napi/node_modules/.pnpm/[email protected]/node_modules/typescript/lib/typescript.js:21622
let moduleResolution = compilerOptions.moduleResolution;
^

TypeError: Cannot read properties of undefined (reading 'moduleResolution')
at computeValue (/Users/rigidity/Desktop/wallet-sdk/napi/node_modules/.pnpm/[email protected]/node_modules/typescript/lib/typescript.js:21622:46)
at importSyntaxAffectsModuleResolution (/Users/rigidity/Desktop/wallet-sdk/napi/node_modules/.pnpm/[email protected]/node_modules/typescript/lib/typescript.js:21599:28)
at getDefaultResolutionModeForFileWorker (/Users/rigidity/Desktop/wallet-sdk/napi/node_modules/.pnpm/[email protected]/node_modules/typescript/lib/typescript.js:127780:10)
at Object.getMode (/Users/rigidity/Desktop/wallet-sdk/napi/node_modules/.pnpm/[email protected]/node_modules/typescript/lib/typescript.js:124407:85)
at Object.resolveTypeReferenceDirectiveReferences (file:///Users/rigidity/Desktop/wallet-sdk/napi/node_modules/.pnpm/[email protected][email protected]/node_modules/tsimp/dist/esm/service/resolve-type-reference-directive-references.js:24:45)
at resolveTypeReferenceDirectiveNamesWorker (/Users/rigidity/Desktop/wallet-sdk/napi/node_modules/.pnpm/[email protected]/node_modules/typescript/lib/typescript.js:125232:20)
at resolveNamesReusingOldState (/Users/rigidity/Desktop/wallet-sdk/napi/node_modules/.pnpm/[email protected]/node_modules/typescript/lib/typescript.js:125354:14)
at resolveTypeReferenceDirectiveNamesReusingOldState (/Users/rigidity/Desktop/wallet-sdk/napi/node_modules/.pnpm/[email protected]/node_modules/typescript/lib/typescript.js:125325:12)
at processTypeReferenceDirectives (/Users/rigidity/Desktop/wallet-sdk/napi/node_modules/.pnpm/[email protected]/node_modules/typescript/lib/typescript.js:126706:156)
at findSourceFileWorker (/Users/rigidity/Desktop/wallet-sdk/napi/node_modules/.pnpm/[email protected]/node_modules/typescript/lib/typescript.js:126595:9)

Node.js v21.7.0
1 change: 1 addition & 0 deletions napi/.tsimp/daemon/mtime
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1727156457864
7 changes: 0 additions & 7 deletions napi/__test__/index.spec.mjs

This file was deleted.

25 changes: 25 additions & 0 deletions napi/__test__/index.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import test from "ava";

import { toCoinId } from "../index.js";

test("calculate coin id", (t) => {
const coinId = toCoinId({
parentCoinInfo: Buffer.from(
"4bf5122f344554c53bde2ebb8cd2b7e3d1600ad631c385a5d7cce23c7785459a",
"hex"
),
puzzleHash: Buffer.from(
"dbc1b4c900ffe48d575b5da5c638040125f65db0fe3e24494b76ea986457d986",
"hex"
),
amount: 100n,
});
t.true(
Buffer.from(coinId).equals(
Buffer.from(
"fd3e669c27be9d634fe79f1f7d7d8aaacc3597b855cffea1d708f4642f1d542a",
"hex"
)
)
);
});
12 changes: 10 additions & 2 deletions napi/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,17 @@
},
"devDependencies": {
"@napi-rs/cli": "^2.18.4",
"ava": "^6.0.1"
"@types/node": "^22.6.1",
"ava": "^6.0.1",
"ts-node": "^10.9.2"
},
"ava": {
"timeout": "3m"
"timeout": "3m",
"extensions": [
"ts"
],
"require": [
"ts-node/register"
]
}
}
136 changes: 136 additions & 0 deletions napi/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions napi/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"compilerOptions": {
"types": ["node"],
"target": "ESNext",
"module": "NodeNext",
"moduleResolution": "NodeNext"
}
}

0 comments on commit 3860854

Please sign in to comment.