Skip to content

Commit

Permalink
fix: remove unnecessary slashingTxScript
Browse files Browse the repository at this point in the history
  • Loading branch information
jrwbabylonlab committed Jan 7, 2025
1 parent 4494689 commit 22685c1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 12 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@babylonlabs-io/btc-staking-ts",
"version": "0.4.0-canary.6",
"version": "0.4.0-canary.7",
"description": "Library exposing methods for the creation and consumption of Bitcoin transactions pertaining to Babylon's Bitcoin Staking protocol.",
"module": "dist/index.js",
"main": "dist/index.cjs",
Expand Down
11 changes: 2 additions & 9 deletions src/staking/transactions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ export function stakingTransaction(
const tx = new Transaction();
tx.version = TRANSACTION_VERSION;


for (let i = 0; i < selectedUTXOs.length; ++i) {
const input = selectedUTXOs[i];
tx.addInput(
Expand Down Expand Up @@ -241,7 +240,7 @@ export function withdrawTimelockUnbondedTransaction(
*
* This transaction spends the output from the slashing transaction.
*
* @param {Object} scripts - The unbondingTimelockScript and slashingScript
* @param {Object} scripts - The unbondingTimelockScript
* We use the unbonding timelock script as the timelock of the slashing transaction.
* This is due to slashing tx timelock is the same as the unbonding timelock.
* @param {Transaction} slashingTx - The slashing transaction.
Expand All @@ -254,20 +253,14 @@ export function withdrawTimelockUnbondedTransaction(
export function withdrawSlashingTransaction(
scripts: {
unbondingTimelockScript: Buffer;
slashingScript: Buffer;
},
slashingTx: Transaction,
withdrawalAddress: string,
network: networks.Network,
feeRate: number,
outputIndex: number,
): PsbtResult {
const scriptTree: Taptree = [
{
output: scripts.slashingScript,
},
{ output: scripts.unbondingTimelockScript },
];
const scriptTree: Taptree = { output: scripts.unbondingTimelockScript };

return withdrawalTransaction(
{
Expand Down

0 comments on commit 22685c1

Please sign in to comment.