Skip to content

Commit edaad94

Browse files
refactor(abstract-utxo): rename WalletOutput to FixedScriptWalletOutput
Make room for DescriptorWalletOutput Issue: BTC-1450
1 parent ffe4810 commit edaad94

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

modules/abstract-utxo/src/abstractUtxoCoin.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -132,16 +132,18 @@ export interface BaseOutput {
132132
external?: boolean;
133133
}
134134

135-
export interface WalletOutput extends BaseOutput {
135+
export interface FixedScriptWalletOutput extends BaseOutput {
136136
needsCustomChangeKeySignatureVerification?: boolean;
137137
chain: number;
138138
index: number;
139139
}
140140

141-
export type Output = BaseOutput | WalletOutput;
141+
export type Output = BaseOutput | FixedScriptWalletOutput;
142142

143-
export function isWalletOutput(output: Output): output is WalletOutput {
144-
return (output as WalletOutput).chain !== undefined && (output as WalletOutput).index !== undefined;
143+
export function isWalletOutput(output: Output): output is FixedScriptWalletOutput {
144+
return (
145+
(output as FixedScriptWalletOutput).chain !== undefined && (output as FixedScriptWalletOutput).index !== undefined
146+
);
145147
}
146148

147149
export interface TransactionExplanation extends BaseTransactionExplanation<string, string> {
@@ -745,7 +747,7 @@ export abstract class AbstractUtxoCoin extends BaseCoin {
745747
);
746748

747749
const needsCustomChangeKeySignatureVerification = allOutputDetails.some(
748-
(output) => (output as WalletOutput)?.needsCustomChangeKeySignatureVerification
750+
(output) => (output as FixedScriptWalletOutput)?.needsCustomChangeKeySignatureVerification
749751
);
750752

751753
const changeOutputs = _.filter(allOutputDetails, { external: false });

modules/abstract-utxo/src/transaction/fixedScript/explainTransaction.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
ExplainTransactionOptions,
88
Output,
99
TransactionExplanation,
10-
WalletOutput,
10+
FixedScriptWalletOutput,
1111
} from '../../abstractUtxoCoin';
1212
import { toExtendedAddressFormat } from '../recipient';
1313

@@ -19,7 +19,7 @@ function explainCommon<TNumber extends number | bigint>(
1919
const displayOrder = ['id', 'outputAmount', 'changeAmount', 'outputs', 'changeOutputs'];
2020
let spendAmount = BigInt(0);
2121
let changeAmount = BigInt(0);
22-
const changeOutputs: WalletOutput[] = [];
22+
const changeOutputs: FixedScriptWalletOutput[] = [];
2323
const outputs: Output[] = [];
2424

2525
const { changeInfo } = params;

0 commit comments

Comments
 (0)