Daniel Cousens
82d8e20793
tests: avoid unnecessary .ok
11 years ago
Daniel Cousens
0782e8e837
tests: fixes test description typos
11 years ago
Daniel Cousens
26b028adcf
Wallet: use TxBuilder instead
11 years ago
Daniel Cousens
2f00c9ab35
Wallet: rework unspents to primarily work on initialization
The RegExp for the UTXO validation was removed as the errors are now
more verbose and specific to each case.
11 years ago
Daniel Cousens
7c22067f69
Wallet: clarify getPrivateKeyForAddress method structure
This does repeat the O(n) lookup several times, but that can be fixed by
using an O(1) lookup instead (and will be later).
Clarity first.
11 years ago
Daniel Cousens
eaf8cf85af
test: rephrase fail -> throw
11 years ago
Daniel Cousens
2920bb2ee1
tests: remove outdated FIXME in wallet
11 years ago
Wei Lu
f7af487597
wallet: reintroduce output.to to track pending spent utxo
11 years ago
Wei Lu
82b1d8fbdc
wallet: do not delete pending incoming tx from outputs
11 years ago
Wei Lu
79a17d67ec
wallet: do not overestimate fees when network has dustSoftThreshold
11 years ago
Wei Lu
7e31668b69
wallet: rename utxo.receive to utxo.from
11 years ago
Wei Lu
7e98123ccd
wallet.getUnspentOutputs includes the pending field
11 years ago
Wei Lu
79ec61d085
Fix bitcoin dustThreshold and feePerKb values
11 years ago
Daniel Cousens
c0e5393595
Transaction: remove .outpoint object
11 years ago
Daniel Cousens
569e0d4ff1
Wallet: fix processConfirmedTx tests
These tests were still passing despite being incorrect.
11 years ago
Daniel Cousens
f85792ba22
Transaction: remove address from txOut
11 years ago
Daniel Cousens
5551c38812
Transaction: use hash Buffer instead of hex string
11 years ago
Daniel Cousens
bdc7131d0e
Transaction: renames getHash to getId
In turn also removes the inherent calculation of tx.hash after deserialization.
11 years ago
Daniel Cousens
8b5647b0b9
Transaction: remove TxIn/TxOut exports
11 years ago
Daniel Cousens
07a0beee90
tests: remove unnecessary linebreaks
11 years ago
Daniel Cousens
7e5af52cd1
Transaction: mass rename from SPK/SS to Input/Output
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.
11 years ago
Daniel Cousens
41c3b68293
templates: rename to scripts
11 years ago
Daniel Cousens
00cec9ce64
Script: move all templates to templates.js
11 years ago
Wei Lu
f53e35ed28
wallet: delete utxo instead of marking it as spend
11 years ago
Wei Lu
d265b53b03
wallet: processTx -> processConfirmedTx, processPendingTx
11 years ago
Wei Lu
e064e9d29d
wallet.createTx ignores pending utxo
11 years ago
Wei Lu
660c95483d
wallet.processTx accepts isPending flag and passes it on to output
11 years ago
Daniel Cousens
6a73bc02f5
HDNode: rename priv/pub to privKey/pubKey
11 years ago
Daniel Cousens
64e307b13f
HDWallet: rename to HDNode
11 years ago
Daniel Cousens
3bce535e36
Wallet: use assert for consistency
11 years ago
Daniel Cousens
cde285ccfc
Wallet: enforce operator new
11 years ago
Daniel Cousens
4952c5f4e7
HD/Wallet: use network objects, not strings
11 years ago
Daniel Cousens
2df790e2ab
Wallet: remove use of hashLittleEndian
11 years ago
Daniel Cousens
bd3690bdc0
Wallet: remove async interface
11 years ago
Daniel Cousens
50e9a09a8c
Wallet: cleanup createTx control flow
Unknowingly this also revealed a subtle bug in the previous
implementation which allowed the creation of transactions even
when no UTXOs existed.
11 years ago
Daniel Cousens
4dd617d5ca
wallet: fix address description typo
11 years ago
Daniel Cousens
8514bbfabd
Address: remove Address.Error
By removing Address.Error, we remove a code smell.
This part of the code base was also not under any form of test.
Test data and tests have therefore been added verifying its behaviour in
both Wallet and Address tests.
11 years ago
Daniel Cousens
0468c4710c
Transaction: rename (de)serialize to [to/from]Buffer
11 years ago
Daniel Cousens
6c0eebe94b
tests: use filepaths directly
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.
11 years ago
Daniel Cousens
7a740c2e7b
tests: forces consistent import syntax
11 years ago
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)
11 years ago
Daniel Cousens
63231fb67d
Extends test for custom Wallet change addresses
11 years ago
Daniel Cousens
a77846701f
Fixes network support for TxOut
11 years ago
Daniel Cousens
eba08fa761
Fixes indentation for assertions
11 years ago
Daniel Cousens
a8cf2fdd9e
Changes internal serialization to use Buffers instead
11 years ago
Daniel Cousens
d17f85f5a6
Changes fakeTxHash to actual hex
11 years ago
William Cotton
8f698d19f7
custom changeAddress has full integration test
11 years ago
William Cotton
dfbfdafc94
added tests for createTx testnet and createTx custom changeAddress
11 years ago
Daniel Cousens
f047afef2d
Updates network.js constant names
11 years ago
Daniel Cousens
c99a576fbd
Migrates all usage of crypto-js/sha256 to ./crypto
11 years ago