From bc7c0dc3652c233ffa5639e2eea10fab9674ca22 Mon Sep 17 00:00:00 2001 From: Jordan Last Date: Wed, 8 Jan 2025 10:12:35 -0700 Subject: [PATCH] attempt to fix type errors in bitcoin_psbt through packing --- .../demo/basic_bitcoin/package-lock.json | 2 ++ .../demo/basic_bitcoin/package.json | 1 + .../experimental/demo/bitcoin_psbt/.gitignore | 1 + .../demo/bitcoin_psbt/jest.config.js | 2 +- .../demo/bitcoin_psbt/package-lock.json | 24 ++++++++----------- .../demo/bitcoin_psbt/package.json | 2 +- .../demo/bitcoin_psbt/test/pretest.ts | 10 ++++---- 7 files changed, 21 insertions(+), 21 deletions(-) diff --git a/examples/experimental/demo/basic_bitcoin/package-lock.json b/examples/experimental/demo/basic_bitcoin/package-lock.json index 22115b3f9b..36842fdbe1 100644 --- a/examples/experimental/demo/basic_bitcoin/package-lock.json +++ b/examples/experimental/demo/basic_bitcoin/package-lock.json @@ -1,10 +1,12 @@ { "name": "basic_bitcoin", + "version": "0.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "basic_bitcoin", + "version": "0.0.0", "hasInstallScript": true, "dependencies": { "azle": "0.24.1", diff --git a/examples/experimental/demo/basic_bitcoin/package.json b/examples/experimental/demo/basic_bitcoin/package.json index 78ccd67ed0..be6aca71e5 100644 --- a/examples/experimental/demo/basic_bitcoin/package.json +++ b/examples/experimental/demo/basic_bitcoin/package.json @@ -1,5 +1,6 @@ { "name": "basic_bitcoin", + "version": "0.0.0", "scripts": { "install": "./scripts/install.sh", "pretest": "tsx test/pretest.ts", diff --git a/examples/experimental/demo/bitcoin_psbt/.gitignore b/examples/experimental/demo/bitcoin_psbt/.gitignore index d85448bfd1..96d235f8c8 100644 --- a/examples/experimental/demo/bitcoin_psbt/.gitignore +++ b/examples/experimental/demo/bitcoin_psbt/.gitignore @@ -1,5 +1,6 @@ .azle .bitcoin .dfx +basic_bitcoin-0.0.0.tgz dfx_generated node_modules diff --git a/examples/experimental/demo/bitcoin_psbt/jest.config.js b/examples/experimental/demo/bitcoin_psbt/jest.config.js index 43cb5d4f5d..7c3bb47267 100644 --- a/examples/experimental/demo/bitcoin_psbt/jest.config.js +++ b/examples/experimental/demo/bitcoin_psbt/jest.config.js @@ -7,5 +7,5 @@ module.exports = { '^.+\\.ts$': ['ts-jest', { isolatedModules: true }], '^.+\\.js$': 'ts-jest' }, - transformIgnorePatterns: ['/node_modules/(?!(azle)/)'] // Make sure azle is transformed + transformIgnorePatterns: ['/node_modules/(?!(azle|basic_bitcoin)/)'] // Make sure azle is transformed }; diff --git a/examples/experimental/demo/bitcoin_psbt/package-lock.json b/examples/experimental/demo/bitcoin_psbt/package-lock.json index ec801c4b0c..e5c62ce517 100644 --- a/examples/experimental/demo/bitcoin_psbt/package-lock.json +++ b/examples/experimental/demo/bitcoin_psbt/package-lock.json @@ -8,7 +8,7 @@ "dependencies": { "@bitcoin-js/tiny-secp256k1-asmjs": "^2.2.3", "azle": "0.24.1", - "basic_bitcoin": "file:../basic_bitcoin", + "basic_bitcoin": "file:basic_bitcoin-0.0.0.tgz", "bitcoinjs-lib": "^6.1.5", "express": "^4.18.2", "tiny-secp256k1": "^2.2.3" @@ -17,17 +17,6 @@ "@types/express": "^4.17.21" } }, - "../basic_bitcoin": { - "hasInstallScript": true, - "dependencies": { - "azle": "0.24.1", - "bitcoinjs-lib": "^6.1.5", - "express": "^4.18.2" - }, - "devDependencies": { - "@types/express": "^4.17.21" - } - }, "node_modules/@adraffy/ens-normalize": { "version": "1.10.1", "resolved": "https://registry.npmjs.org/@adraffy/ens-normalize/-/ens-normalize-1.10.1.tgz", @@ -844,8 +833,15 @@ "license": "MIT" }, "node_modules/basic_bitcoin": { - "resolved": "../basic_bitcoin", - "link": true + "version": "0.0.0", + "resolved": "file:basic_bitcoin-0.0.0.tgz", + "integrity": "sha512-xVMKhEKuL9G87V5JJWNJuBoYUYEinQ44K6pfr+ZGP3Bo7KVgB+iT5MR5d/QNlvgM51v9Vo+13efRkizfiZQxxg==", + "hasInstallScript": true, + "dependencies": { + "azle": "0.24.1", + "bitcoinjs-lib": "^6.1.5", + "express": "^4.18.2" + } }, "node_modules/bech32": { "version": "2.0.0", diff --git a/examples/experimental/demo/bitcoin_psbt/package.json b/examples/experimental/demo/bitcoin_psbt/package.json index 0dee5a5196..1b37a485b1 100644 --- a/examples/experimental/demo/bitcoin_psbt/package.json +++ b/examples/experimental/demo/bitcoin_psbt/package.json @@ -18,7 +18,7 @@ "dependencies": { "@bitcoin-js/tiny-secp256k1-asmjs": "^2.2.3", "azle": "0.24.1", - "basic_bitcoin": "file:../basic_bitcoin", + "basic_bitcoin": "file:basic_bitcoin-0.0.0.tgz", "bitcoinjs-lib": "^6.1.5", "express": "^4.18.2", "tiny-secp256k1": "^2.2.3" diff --git a/examples/experimental/demo/bitcoin_psbt/test/pretest.ts b/examples/experimental/demo/bitcoin_psbt/test/pretest.ts index ecc2d1b307..2ee3e53501 100644 --- a/examples/experimental/demo/bitcoin_psbt/test/pretest.ts +++ b/examples/experimental/demo/bitcoin_psbt/test/pretest.ts @@ -1,11 +1,11 @@ -import { linkAndInstallPatch } from 'azle/test/jest_link'; import { execSync } from 'child_process'; -import { join } from 'path'; function pretest(): void { - linkAndInstallPatch( - join('examples', 'experimental', 'demo', 'basic_bitcoin') - ); + execSync(`npm install $(npm pack ../basic_bitcoin)`); + + if (process.env.AZLE_END_TO_END_TEST_LINK_AZLE !== 'false') { + execSync(`npm link azle`); + } execSync(`dfx canister uninstall-code bitcoin_psbt || true`, { stdio: 'inherit'