Skip to content

Commit c689862

Browse files
committed
Improve property names
1 parent f703435 commit c689862

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

src/psbt.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,13 @@ class Psbt {
9797
get inputCount() {
9898
return this.data.inputs.length;
9999
}
100-
get txVersion() {
100+
get version() {
101101
return this.__CACHE.__TX.version;
102102
}
103-
get txLocktime() {
103+
get locktime() {
104104
return this.__CACHE.__TX.locktime;
105105
}
106-
get txInputs() {
106+
get inputs() {
107107
return this.__CACHE.__TX.ins.map(input => {
108108
return {
109109
hash: bufferutils_1.cloneBuffer(input.hash),
@@ -114,7 +114,7 @@ class Psbt {
114114
};
115115
});
116116
}
117-
get txOutputs() {
117+
get outputs() {
118118
return this.__CACHE.__TX.outs.map(output => {
119119
return {
120120
script: bufferutils_1.cloneBuffer(output.script),

test/psbt.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -523,9 +523,9 @@ describe(`Psbt`, () => {
523523
});
524524

525525
assert.strictEqual(psbt.inputCount, 1);
526-
assert.strictEqual(psbt.txInputs[0].sequence, 0xffffffff);
526+
assert.strictEqual(psbt.inputs[0].sequence, 0xffffffff);
527527
psbt.setInputSequence(0, 0);
528-
assert.strictEqual(psbt.txInputs[0].sequence, 0);
528+
assert.strictEqual(psbt.inputs[0].sequence, 0);
529529
});
530530

531531
it('throws if input index is too high', () => {

ts_src/psbt.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,15 +129,15 @@ export class Psbt {
129129
return this.data.inputs.length;
130130
}
131131

132-
get txVersion(): number {
132+
get version(): number {
133133
return this.__CACHE.__TX.version;
134134
}
135135

136-
get txLocktime(): number {
136+
get locktime(): number {
137137
return this.__CACHE.__TX.locktime;
138138
}
139139

140-
get txInputs(): Input[] {
140+
get inputs(): Input[] {
141141
return this.__CACHE.__TX.ins.map(input => {
142142
return {
143143
hash: cloneBuffer(input.hash),
@@ -149,7 +149,7 @@ export class Psbt {
149149
});
150150
}
151151

152-
get txOutputs(): Output[] {
152+
get outputs(): Output[] {
153153
return this.__CACHE.__TX.outs.map(output => {
154154
return {
155155
script: cloneBuffer(output.script),

types/psbt.d.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ export declare class Psbt {
4444
private opts;
4545
constructor(opts?: PsbtOptsOptional, data?: PsbtBase);
4646
readonly inputCount: number;
47-
readonly txVersion: number;
48-
readonly txLocktime: number;
49-
readonly txInputs: Input[];
50-
readonly txOutputs: Output[];
47+
readonly version: number;
48+
readonly locktime: number;
49+
readonly inputs: Input[];
50+
readonly outputs: Output[];
5151
combine(...those: Psbt[]): this;
5252
clone(): Psbt;
5353
setMaximumFeeRate(satoshiPerByte: number): void;

0 commit comments

Comments
 (0)