Remove extra return statement

This commit is contained in:
Luke Childs 2020-04-26 15:37:57 +07:00
parent c68986231c
commit c9b2964546
2 changed files with 22 additions and 30 deletions

View file

@ -104,23 +104,19 @@ class Psbt {
return this.__CACHE.__TX.locktime; return this.__CACHE.__TX.locktime;
} }
get inputs() { get inputs() {
return this.__CACHE.__TX.ins.map(input => { return this.__CACHE.__TX.ins.map(input => ({
return { hash: bufferutils_1.cloneBuffer(input.hash),
hash: bufferutils_1.cloneBuffer(input.hash), index: input.index,
index: input.index, script: bufferutils_1.cloneBuffer(input.script),
script: bufferutils_1.cloneBuffer(input.script), sequence: input.sequence,
sequence: input.sequence, witness: input.witness.map(buffer => bufferutils_1.cloneBuffer(buffer)),
witness: input.witness.map(buffer => bufferutils_1.cloneBuffer(buffer)), }));
};
});
} }
get outputs() { get outputs() {
return this.__CACHE.__TX.outs.map(output => { return this.__CACHE.__TX.outs.map(output => ({
return { script: bufferutils_1.cloneBuffer(output.script),
script: bufferutils_1.cloneBuffer(output.script), value: output.value,
value: output.value, }));
};
});
} }
combine(...those) { combine(...those) {
this.data.combine(...those.map(o => o.data)); this.data.combine(...those.map(o => o.data));

View file

@ -138,24 +138,20 @@ export class Psbt {
} }
get inputs(): Input[] { get inputs(): Input[] {
return this.__CACHE.__TX.ins.map(input => { return this.__CACHE.__TX.ins.map(input => ({
return { hash: cloneBuffer(input.hash),
hash: cloneBuffer(input.hash), index: input.index,
index: input.index, script: cloneBuffer(input.script),
script: cloneBuffer(input.script), sequence: input.sequence,
sequence: input.sequence, witness: input.witness.map(buffer => cloneBuffer(buffer)),
witness: input.witness.map(buffer => cloneBuffer(buffer)), }));
};
});
} }
get outputs(): Output[] { get outputs(): Output[] {
return this.__CACHE.__TX.outs.map(output => { return this.__CACHE.__TX.outs.map(output => ({
return { script: cloneBuffer(output.script),
script: cloneBuffer(output.script), value: output.value,
value: output.value, }));
};
});
} }
combine(...those: Psbt[]): this { combine(...those: Psbt[]): this {