Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update v6 branch: Add stripWitness to Transaction Issue 2169 #2170 #2171

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions .github/workflows/main_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,6 @@ jobs:
#####################
# Jobs without matrix
#####################
audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # v2
- uses: actions/setup-node@eeb10cff27034e7acf239c5d29f62154018672fd # v3
with:
node-version: 'lts/*'
registry-url: https://registry.npmjs.org/
cache: 'npm'
- run: npm ci
- run: npm run audit
coverage:
runs-on: ubuntu-latest
steps:
Expand Down
211 changes: 0 additions & 211 deletions package-lock.json

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

2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"bitcoinjs"
],
"scripts": {
"audit": "better-npm-audit audit -l high",
"build": "npm run clean && tsc -p ./tsconfig.json && npm run formatjs",
"build:tests": "npm run clean:jstests && tsc -p ./test/tsconfig.json",
"clean": "rimraf src",
Expand Down Expand Up @@ -66,7 +65,6 @@
"@types/randombytes": "^2.0.0",
"@typescript-eslint/eslint-plugin": "^5.45.0",
"@typescript-eslint/parser": "^5.45.0",
"better-npm-audit": "^3.7.3",
"bip32": "^4.0.0",
"bip39": "^3.1.0",
"bip65": "^1.0.1",
Expand Down
1 change: 1 addition & 0 deletions src/transaction.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export declare class Transaction {
addInput(hash: Buffer, index: number, sequence?: number, scriptSig?: Buffer): number;
addOutput(scriptPubKey: Buffer, value: number): number;
hasWitnesses(): boolean;
stripWitnesses(): void;
weight(): number;
virtualSize(): number;
byteLength(_ALLOW_WITNESS?: boolean): number;
Expand Down
5 changes: 5 additions & 0 deletions src/transaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,11 @@ class Transaction {
return x.witness.length !== 0;
});
}
stripWitnesses() {
this.ins.forEach(input => {
input.witness = EMPTY_WITNESS; // Set witness data to an empty array
});
}
weight() {
const base = this.byteLength(false);
const total = this.byteLength(true);
Expand Down
Loading
Loading