Daniel Cousens
9f1d41fc44
script: enforce PUSH_DATA codes for witness outputs
9 years ago
Daniel Cousens
20a026aefe
scripts/tests: add witness* scripts
9 years ago
Daniel Cousens
6faeae397f
TxBuilder: add setVersion
9 years ago
Daniel Cousens
697f2da1bc
Transaction: re-work hashForSignature for readability
9 years ago
JP Richardson
ac8ae8f0ed
opcodes: add json extension to fix Webpack JSON loader
9 years ago
Daniel Cousens
d58e09a3a7
Block: add checkMerkleRoot
9 years ago
Kirill Fomichev
8ddcf737f9
Update Transaction.isCoinbaseHash
- add argument type-checking
- replace Array.every on for-loop
9 years ago
Karel Bilek
f958dd1e86
Adding Transaction.prototype.isCoinbase
9 years ago
Daniel Cousens
ea4ce4e2a6
ECPair: no elseif needed, move default for clarity
9 years ago
Daniel Cousens
00cee340dd
ECPair: don't depend on WIF error message, avoid unnecessary import
9 years ago
Daniel Cousens
e52c0d5b67
ECPair: use toBase58Check
9 years ago
Daniel Cousens
9db67bb3b1
Cleanup for #540 ( #551 )
* Txbuilder: early exit as soon as possible
* Txbuilder: prefer function declaration over variable
* TxBuilder: extract extractFromOutputScript
* TxBuilder: extract buildFromInputData
9 years ago
Kirill Fomichev
bc9a95e0ae
Use buffer-reverse instead [].reverse.call
9 years ago
Daniel Cousens
aae5db6a59
ECPair/HDNode: missing version from list is Unknown, not Invalid
9 years ago
Daniel Cousens
bdb0dd4a17
HDNode/tests: add testing for invalid network version from networks list
9 years ago
Daniel Cousens
9e32c892ef
ECPair/tests: always use WIF for error throwing
9 years ago
Kirill Fomichev
48866992d4
Update wif to 2.0.1
9 years ago
Ruben de Vries
7aaae4c001
Refactoring `extractInput` and `__build` to enable nested scripts (`P2SH[ P2PKH / multsig ]`).
This is preperation for the segwit support which will have `P2SH[ P2WSH[ P2PKH / multsig ] ]` scripts
9 years ago
Karel Bilek
3c56e80fc6
Simplifying path regex
9 years ago
Karel Bilek
6a74eb6993
Renaming Path to Bip32Path, invalid to fixtures
Only thing I haven't been able to do is to add "undefined" to fixtures. So I could not properly test
that node.derivePath() properly fails as it should. However, I added "null" there, and "null" and "undefined"
behave in similar way in JavaScript, so that should catch that.
9 years ago
Karel Bilek
d2b43f1dfe
Validating path
Again through typeforce
9 years ago
Karel Bilek
182698f53d
Using parseInt instead of + in path parsing
+ can cause issues - +"" is 0. parseInt("", 10) is NaN, which is better (since it causes typeforce to throw).
9 years ago
Karel Bilek
7defe6fe4c
Adding path derivation
The argument is path of either numbers or strings.
String with "'" at the end signifies hardened path.
9 years ago
Karel Bilek
4a72001335
Typechecking indexes
As a consequence, it will not allow accidentally double-hardened indexes.
It also won't allow strings or forgotten parameters.
9 years ago
Karel Bílek
fbcb478560
Adding function to decide if HDNode is public
Public === neutered. Private === not neutered
9 years ago
Ruben de Vries
7c7537fc57
use typeforce >= 1.6.2 which allows us to use `typeforce.TfTypeError` with a custom error message.
9 years ago
Daniel Cousens
67da1b30e3
address: fix compiled assumption for fromOutputScript
9 years ago
Daniel Cousens
6c0745adce
TxBuilder: add setLockTime
9 years ago
Daniel Cousens
d7da292063
script_number: initialize result to 0
9 years ago
Daniel Cousens
302bbe81ba
script_number: refactor to mimic bitcoin/bitcoin
9 years ago
Daniel Cousens
945bdfa747
script_number: refactor
9 years ago
Daniel Cousens
29a1a839ec
script: exposes scriptNumber through script.number
9 years ago
Daniel Cousens
059f48b0c4
script_number: add impl/tests
9 years ago
Daniel Cousens
e4ba88e54f
block: rename verifyPow to checkProofOfWork
9 years ago
Daniel Cousens
92b446f6a5
block: variable extraction
9 years ago
Daniel Cousens
bac700f52c
block: use buffer, faster, verified
9 years ago
Daniel Cousens
86b51b2d62
add Block.calculateTarget, use Buffer comparison rather than bigi
9 years ago
Daniel Cousens
26ccb43047
block: add Block.prototype.verifyPow
9 years ago
Daniel Cousens
cab3022719
add OP_CHECKLOCKTIMEVERIFY and integration tests
9 years ago
Daniel Cousens
540a6643ac
txbuilder: clarify SIGHASH invalidation logic in addInput/addOutput
9 years ago
Daniel Cousens
881a23f9d5
txbuilder: rename tx.outs.length to nOutputs
9 years ago
Daniel Cousens
693e39c061
script: use Buffer.isBuffer consistently
9 years ago
Daniel Cousens
d48a7ab682
address: avoid unnecessary unchunking
9 years ago
Daniel Cousens
f60cb2e491
scripts: ensure isPubKeyHashOutput/isScriptHashOutput adhere to BIP62
9 years ago
Kirill Fomichev
5de6818fcb
Fix TransactionBuilder.addOutput
9 years ago
Alex Seville
a1da3065c4
Remove `const` and replace with `var`
To keep the project consistenly ES5.
Source: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/const
9 years ago
Daniel Cousens
173994c6e0
script: avoid slice if n !== pubKeys.length
9 years ago
Daniel Cousens
0ca1e40a6d
script: refactor isMultisigOutput for clarity
9 years ago
Daniel Cousens
5be9b04741
script: isolate initialization of REVERSE_OPS
9 years ago
Daniel Cousens
74c2f1d957
script: n/m must be numbers, not data
9 years ago