Commit Graph

56 Commits

Author SHA1 Message Date
Esteban Ordano
ed9a9f6da9 Fix wrong jsdocs 2014-12-16 17:21:41 -03:00
Manuel Araoz
3eba0bc546 address review comments 2014-12-16 13:33:57 -03:00
Manuel Araoz
c888c3baa7 adding some signature methods for script interpreting 2014-12-16 13:33:56 -03:00
Manuel Araoz
3de71f8558 refactors and fixes for script interpreter 2014-12-16 13:33:56 -03:00
Esteban Ordano
de4d2884c7 Modify Transaction to use Multisig
* Allow `Script#add` to add a Script causing concatenation of opcodes
* Add `Script#equals` to compare scripts
* Add `Script#fromAddress`
* Drop `_payTo` methods
* Add `Script.buildP2SHMultisigIn`

Greatly simplifying the internal transaction object
2014-12-15 18:19:54 -03:00
Esteban Ordano
1535805f1c Add PublicKeyHashInput class 2014-12-15 18:19:39 -03:00
Braydon Fuller
b13c4fb0c9 Added inspect prototype G5 2014-12-14 15:13:01 -05:00
Manuel Araoz
d3b761fc7c Opcode('*').toNumber() -> Opcode.* 2014-12-11 16:19:22 -03:00
Manuel Araoz
53f6a31e73 refactor script 2014-12-11 16:19:22 -03:00
Manuel Araoz
f5b7f73d09 fixing tests for new script internals 2 2014-12-11 16:19:21 -03:00
Manuel Araoz
016bc6e3ed fixing tests for new script internals 2014-12-11 16:19:21 -03:00
Manuel Araoz
ec464681fe add sorting to Script#buildMutlisigOut() 2014-12-10 16:46:20 -03:00
Esteban Ordano
0c28bc1786 Split buildPKH arguments, add Copy constructor on publickey 2014-12-10 12:46:21 -03:00
Esteban Ordano
5c974a8ef2 Refactor transaction to match new API
* Refactor transaction into a different subfolder
* Added a lot of tests for sighash and transaction serialization (from
  reddit's and Ryan X. Charles' `fullnode`)
* Drop "only" from sighash tests and consolidate logs
2014-12-10 12:44:30 -03:00
Manuel Araoz
b61bd6f76a add Script#isPushOnly() 2014-12-10 12:39:09 -03:00
Esteban Ordano
fd531de123 Update opcode and script transactions 2014-12-09 17:53:30 -03:00
Manuel Araoz
58b43345c0 add docs 2014-12-04 18:39:13 -03:00
Manuel Araoz
6c5198b743 fix a browser test 2014-12-04 15:38:46 -03:00
Manuel Araoz
d19ad6f384 remove commented code 2014-12-04 15:10:19 -03:00
Manuel Araoz
eaaab5c7d0 implement Script.buildScriptHashOut() 2014-12-04 15:06:56 -03:00
Manuel Araoz
4bca5316ea implement Script.buildDDataOut() 2014-12-04 15:06:56 -03:00
Manuel Araoz
b87e687fd9 implement Script.buildPublicKeyHashOut() 2014-12-04 15:06:56 -03:00
Manuel Araoz
163925c754 implement Script.buildMultisigOut() 2014-12-04 15:06:56 -03:00
Manuel Araoz
4fae69807d change isOpReturn to isDataOut 2014-12-04 15:06:56 -03:00
Manuel Araoz
d05aa27bed finish all tests 2014-12-04 15:06:56 -03:00
Manuel Araoz
ef8f1eabd2 add script.isStandard() 2014-12-02 14:20:58 -03:00
Manuel Araoz
c4cc6ba56d fix tests with new script api 2014-12-02 14:20:58 -03:00
Manuel Araoz
87c40193b9 add pubkey in pubkey out script types 2014-12-02 14:20:58 -03:00
Manuel Araoz
3e2bcaa297 more verbose invalid script error 2014-12-02 14:20:58 -03:00
Manuel Araoz
ed0fc6298c fix classify tests 2014-12-02 14:20:58 -03:00
Manuel Araoz
7d9151abc6 fix classify tests 2014-12-02 14:20:58 -03:00
Manuel Araoz
293a3299d4 add classify tests 2014-12-02 14:20:58 -03:00
Manuel Araoz
72b5dcc6af add Script.isMultisigIn 2014-12-02 14:20:58 -03:00
Manuel Araoz
96e1451d28 add script.isMultisigOut 2014-12-02 14:20:58 -03:00
Manuel Araoz
4a6755d0d1 add Script#prepend() 2014-12-02 14:20:57 -03:00
Manuel Araoz
ebf97aa4bb fix condition style again 2014-12-02 14:20:02 -03:00
Manuel Araoz
94f1afbad7 fix tests 2014-12-02 14:20:02 -03:00
Manuel Araoz
98be01b207 fix conditional format 2014-12-02 14:20:02 -03:00
Manuel Araoz
66e96e5fa4 make tests pass with Script refactor 2014-12-02 14:20:02 -03:00
Manuel Araoz
87f6651554 initial Script refactor 2014-12-02 14:20:02 -03:00
Braydon Fuller
85ce140aeb Keys: Renamed Privkey to PrivateKey and Pubkey to PublicKey 2014-11-25 13:21:53 -05:00
Manuel Araoz
4508fb6765 fix references to encoding 2014-11-21 12:54:56 -03:00
Manuel Araoz
ca9b8d8f7b use strict to protocol 2014-11-20 12:52:32 -03:00
Ryan X. Charles
729049a7da Add error for when pushdata is exceptionally large 2014-09-23 21:37:18 -07:00
Ryan X. Charles
b37e39abca Script().writeXX convenience methods
Script().writeOp('OP_CHECKMULTISIG'), or...
Script().writeOp(174), or...
Script().writeBuffer([push data buffer]), or...
Script().write([op string, number, or push data buffer])

These convenience methods let you easily write a script.
2014-09-23 21:28:03 -07:00
Ryan X. Charles
792e8080c8 classify pubkeyhash and scripthash scripts
...both the "in" (ScriptSig) and "out" (ScriptPubkey)
2014-09-22 16:04:06 -07:00
Ryan X. Charles
6f92775b2c extra curly braces for code readability 2014-09-22 14:56:07 -07:00
Ryan X. Charles
27fbdb42ad isOpReturn
standard OP_RETURN scripts contain either just an OP_RETURN or an OP_RETURN
followed by a single pushdata OP with not more than 40 bytes.
2014-09-19 21:59:19 -07:00
Ryan X. Charles
e11019a083 toJSON, fromJSON
Every object should have toJSON and fromJSON methods so you can have a reliable
way to store and retrieve objects.
2014-09-18 17:52:02 -07:00
Ryan X. Charles
0212e4bd4c replace .buffer with .read 2014-09-17 15:49:45 -07:00