Commit graph

73 commits

Author SHA1 Message Date
Daniel Cousens
cace8316e4 Script: extract test data to fixture 2014-05-09 12:56:35 +10:00
Daniel Cousens
708aa03390 Transaction/Script: bitcoin network no longer implied
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)
2014-05-08 10:59:58 +10:00
Daniel Cousens
0822def7e0 Script: add standard Script.create*ScriptPubKey
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.
2014-05-08 10:59:58 +10:00
Daniel Cousens
d0f684844c Script: add toHex, fromHex
Script.fromHex previously existed, but was not under any kind of test.
This commit adds tests (despite being a little circular in nature) to
check that the output is as expected.
2014-05-08 10:59:58 +10:00
Daniel Cousens
57b8afbdab Network: rename Network to Networks
This change removes the most common ambiguities.
As the network module is not representative of a class, the lower case
has been used.
2014-05-08 10:59:58 +10:00
Daniel Cousens
f5ce83beca Adds working implementation of Script.createP2SHMultisigScriptSig 2014-04-22 00:28:13 +10:00
Daniel Cousens
6edd97d4fd Removes convert usage 2014-04-21 21:55:49 +10:00
Daniel Cousens
682ec133bb Migrates Address to stricter API subset 2014-04-18 17:12:29 +10:00
Daniel Cousens
f047afef2d Updates network.js constant names 2014-04-17 05:50:59 +10:00
Wei Lu
c3d95010ae standardize test descriptions & add nonstandard script test vector
[follow-up #125]
2014-04-14 12:25:48 +08:00
sidazhang
92cff2fb43 Test vectors for nulldata (OP_RETURN) and multisig 2014-04-13 14:32:22 -07:00
sidazhang
aa43e98ac0 Aligning type naming with bitcoind and fixed pubkeyhash bug 2014-04-11 15:20:42 -07:00
Daniel Cousens
c99a576fbd Migrates all usage of crypto-js/sha256 to ./crypto 2014-04-08 23:07:46 +10:00
Daniel Cousens
81d9c8e759 Renames util.js to crypto.js 2014-04-08 22:00:28 +10:00
Wei Lu
93fe1b4c78 cosmetic standardization
[closes #56]
2014-03-31 11:47:47 +08:00
Wei Lu
66e04fe701 Merge branch 'multisig_tests' of github.com:juliustayl/bitcoinjs-lib into juliustayl-multisig_tests
Conflicts:
	test/script.js
2014-03-29 22:13:39 +08:00
Julius Taylor
bad2f769ff added redeem script test
refactored the previous multi-sig address test a bit and added a test
to validate the # of signatures required and possible addresses
included in the redeemscript
2014-03-27 22:56:10 -04:00
Wei Lu
83381186d1 add (some) fromAddress and getInType tests to script 2014-03-26 08:43:31 +08:00
Wei Lu
c3880c0cdf script.toAddress -> script.getToAddress 2014-03-26 08:43:31 +08:00
Wei Lu
423124966f add toAddress and getOutType tests to script 2014-03-26 08:43:31 +08:00
Julius Taylor
a4317d67be validate multi-sig address
This is a test I have been using to validate a 2-of-3 multi sig address
using known public keys as well as validating the multi sig address
from the redeem script. I am working on more redeem script validation
tests but I want to make sure I am on the right track and see if this
test is something you all would deem useful.
2014-03-25 01:32:43 -04:00
Wei Lu
9f2da415ea fix script constructor array check 2014-03-17 16:13:49 +08:00
Wei Lu
d2b790fef9 throw error when input to script constructor is not an array
[#58]
2014-03-09 13:43:36 +08:00