I think it is important we maintain some reasoning that an Input script
is actually a script signature, but in the end, these names are more
coherent and understandable when reasoning with our code. So I think
its OK we break tradition with bitcoind.
After a long IRC discussion, it was decided that the use of direct
filepaths instead of the module is a more pure form of testing ,
although it may provide less overall coverage than the mixed integration
style imports used previously.
This will need to be remedied by further integration testing in
/test/integration.
It is favoured to compose the scriptSig manually using
Script.createP2SHScriptSig and Script.createMultisigScriptSig.
Added a test to verify that createMultisigScriptSig throws when not
enough signatures a provided and the redeemScript is given.
A Transaction (and its subsequent scripts) do not carry any network
specific information in the Bitcoin protocol.
Therefore they can not (without further context) produce the network
specific constants for the generation of the base58 Addresses.
As TransactionOut.address is used heavily throughout Wallet and other
areas of the library, this could not be entirely removed without a large
number of changes.
For now, TransactionOut.address is only defined in the case of
Tx.addOutput being used directly:
Transaction.addOutput(address, value)
Extracts the two Script types out of Script.createOutputScript, and puts
them both under test.
Also renames Script.createMultiSigOutputScript to adhere to the same
convention.
To keep this change minimal, both TxIn/TxOut still use the parameter
object for initialization. TxOut accepts only the types it uses
internally, and not hex or byte arrays for scripts.
The clone is unnecessary as a TransactionOut is never mutated after its
creation.
This resulted in TransactionOut.scriptPubKey no longer being needed,
and was removed. To access the scriptPubKey as a byte buffer, a user
can simply use:
TransactionOut.script.toBuffer()
Unfortunately, this leaves TransactionOut in a sorry state of test.
Something that needs to be fixed.