Skip to content

Commit

Permalink
Merge pull request #27 from bitcoinerlab/default-network-ledger-fix
Browse files Browse the repository at this point in the history
ledger: fix ledger key expression maker. Do not set a default network…
  • Loading branch information
landabaso authored Oct 19, 2023
2 parents 31a94d0 + 9616bfc commit 1641233
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 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
Expand Up @@ -2,7 +2,7 @@
"name": "@bitcoinerlab/descriptors",
"description": "This library parses and creates Bitcoin Miniscript Descriptors and generates Partially Signed Bitcoin Transactions (PSBTs). It provides PSBT finalizers and signers for single-signature, BIP32 and Hardware Wallets.",
"homepage": "https://github.com/bitcoinerlab/descriptors",
"version": "2.0.0",
"version": "2.0.1",
"author": "Jose-Luis Landabaso",
"license": "MIT",
"repository": {
Expand Down
4 changes: 2 additions & 2 deletions src/scriptExpressions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ function standardExpressionsLedgerMaker(
ledgerClient,
ledgerState,
ledgerManager,
network = networks.bitcoin,
network,
account,
keyPath,
change,
Expand All @@ -143,7 +143,6 @@ function standardExpressionsLedgerMaker(
ledgerClient?: unknown;
ledgerState?: LedgerState;
ledgerManager?: LedgerManager;
/** @default networks.bitcoin */
network?: Network;
account: number;
keyPath?: string;
Expand All @@ -154,6 +153,7 @@ function standardExpressionsLedgerMaker(
throw new Error(`ledgerClient and ledgerState have been deprecated`);
if (ledgerManager && network)
throw new Error(`ledgerManager already includes the network object`);
if (!ledgerManager && !network) network = networks.bitcoin;
if (ledgerManager) ({ ledgerClient, ledgerState, network } = ledgerManager);
if (!ledgerClient || !ledgerState)
throw new Error(`Could not retrieve ledgerClient or ledgerState`);
Expand Down

0 comments on commit 1641233

Please sign in to comment.