Remove Output casts from Transaction class

This commit is contained in:
junderw 2019-11-21 18:01:04 +09:00
parent 2aa3926616
commit 22d5831b9b
No known key found for this signature in database
GPG key ID: B256185D3A971908

View file

@ -268,7 +268,7 @@ export class Transaction {
newTx.outs = this.outs.map(txOut => { newTx.outs = this.outs.map(txOut => {
return { return {
script: txOut.script, script: txOut.script,
value: (txOut as Output).value, value: txOut.value,
}; };
}); });
@ -438,7 +438,7 @@ export class Transaction {
toffset = 0; toffset = 0;
this.outs.forEach(out => { this.outs.forEach(out => {
writeUInt64((out as Output).value); writeUInt64(out.value);
writeVarSlice(out.script); writeVarSlice(out.script);
}); });
@ -451,7 +451,7 @@ export class Transaction {
tbuffer = Buffer.allocUnsafe(8 + varSliceSize(output.script)); tbuffer = Buffer.allocUnsafe(8 + varSliceSize(output.script));
toffset = 0; toffset = 0;
writeUInt64((output as Output).value); writeUInt64(output.value);
writeVarSlice(output.script); writeVarSlice(output.script);
hashOutputs = bcrypto.hash256(tbuffer); hashOutputs = bcrypto.hash256(tbuffer);