Skip to content

Commit

Permalink
fix: wip latest sbtc spec
Browse files Browse the repository at this point in the history
  • Loading branch information
janniks committed Nov 28, 2024
1 parent 053a426 commit 6886e6e
Show file tree
Hide file tree
Showing 12 changed files with 13,173 additions and 12,708 deletions.
24,838 changes: 12,505 additions & 12,333 deletions package-lock.json

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions packages/internal/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"private": true,
"name": "@stacks/internal",
"version": "7.0.3",
"main": "./src/index.ts",
"scripts": {
"start": "tsc -b tsconfig.build.json --watch --verbose",
"typecheck": "tsc --noEmit",
Expand All @@ -11,6 +13,5 @@
"@stacks/network": "^7.0.2",
"@stacks/stacking": "^7.0.3",
"jest-fetch-mock": "^3.0.3"
},
"version": "7.0.3"
}
}
16 changes: 16 additions & 0 deletions packages/internal/src/apiMockingHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Configuration, TransactionsApi } from '@stacks/blockchain-api-client';
import { STACKS_TESTNET } from '@stacks/network';
import { MockResponseInitFunction } from 'jest-fetch-mock';
import { StackingClient } from '@stacks/stacking';
import fs from 'fs';

// NOTES
// Capture traffic via the fetchWrapper
Expand Down Expand Up @@ -185,3 +186,18 @@ export function getFetchMockBroadcast() {
.find((m: any) => m[0].endsWith('/transactions'));
return JSON.parse(broadcast[1].body);
}

export function enableFetchLogging() {
const fetchOriginal = globalThis.fetch;
(globalThis.fetch as any) = async (input: string | Request, init?: RequestInit) => {
const r = await fetchOriginal(input, init);
const response = await r
.clone()
.json()
.catch(() => r.clone().text());
const url = input instanceof Request ? input.url : input;
const log = `'${url}': \`${JSON.stringify(response)}\`,`;
fs.appendFileSync('network.txt', `${log}\n`);
return r;
};
}
29 changes: 15 additions & 14 deletions packages/sbtc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,30 @@
"pack": "npm pack",
"prepublishOnly": "npm run test && NODE_ENV=production npm run build",
"start": "tsc -b tsconfig.build.json --watch --verbose",
"test": "echo 'tests disabled'",
"test": "vitest",
"test:watch": "jest --watch --coverage=false",
"typecheck": "tsc --noEmit",
"typecheck:watch": "npm run typecheck -- --watch"
},
"dependencies": {
"@btc-helpers/rpc": "^2.0.0",
"@noble/secp256k1": "^2.0.0",
"@scure/base": "^1.1.3",
"@scure/btc-signer": "^1.1.0",
"@stacks/common": "^6.7.0",
"@stacks/encryption": "^6.7.0",
"@stacks/transactions": "^6.7.0",
"@noble/secp256k1": "^2.1.0",
"@scure/base": "^1.1.9",
"@scure/btc-signer": "^1.4.0",
"@stacks/common": "^7.0.2",
"@stacks/encryption": "^7.0.2",
"@stacks/network": "^7.0.2",
"@stacks/transactions": "^7.0.2",
"c32check": "^2.0.0",
"micro-packed": "^0.3.2"
"micro-packed": "^0.6.3"
},
"devDependencies": {
"@scure/bip32": "^1.3.2",
"@scure/bip39": "^1.2.1",
"jest-fetch-mock": "^3.0.3",
"rimraf": "^3.0.2",
"sbtc-bridge-lib": "latest",
"vitest": "^0.34.6"
"@scure/bip32": "^1.5.0",
"@scure/bip39": "^1.4.0",
"@stacks/internal": "file:../internal",
"rimraf": "^6.0.1",
"vitest": "^2.1.5",
"vitest-fetch-mock": "^0.4.2"
},
"sideEffects": false,
"typings": "dist/index.d.ts",
Expand Down
Loading

0 comments on commit 6886e6e

Please sign in to comment.