aboutsummaryrefslogtreecommitdiff
path: root/src/test
Commit message (Collapse)AuthorAgeFilesLines
...
* | Direct CCoins referencesPieter Wuille2012-10-201-3/+0
| | | | | | | | | | | | | | | | To prevent excessive copying of CCoins in and out of the CCoinsView implementations, introduce a GetCoins() function in CCoinsViewCache with returns a direct reference. The block validation and connection logic is updated to require caching CCoinsViews, and exploits the GetCoins() function heavily.
* | UltraprunePieter Wuille2012-10-203-29/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This switches bitcoin's transaction/block verification logic to use a "coin database", which contains all unredeemed transaction output scripts, amounts and heights. The name ultraprune comes from the fact that instead of a full transaction index, we only (need to) keep an index with unspent outputs. For now, the blocks themselves are kept as usual, although they are only necessary for serving, rescanning and reorganizing. The basic datastructures are CCoins (representing the coins of a single transaction), and CCoinsView (representing a state of the coins database). There are several implementations for CCoinsView. A dummy, one backed by the coins database (coins.dat), one backed by the memory pool, and one that adds a cache on top of it. FetchInputs, ConnectInputs, ConnectBlock, DisconnectBlock, ... now operate on a generic CCoinsView. The block switching logic now builds a single cached CCoinsView with changes to be committed to the database before any changes are made. This means no uncommitted changes are ever read from the database, and should ease the transition to another database layer which does not support transactions (but does support atomic writes), like LevelDB. For the getrawtransaction() RPC call, access to a txid-to-disk index would be preferable. As this index is not necessary or even useful for any other part of the implementation, it is not provided. Instead, getrawtransaction() uses the coin database to find the block height, and then scans that block to find the requested transaction. This is slow, but should suffice for debug purposes.
* | Compact serialization for amountsPieter Wuille2012-10-201-0/+62
| | | | | | | | | | | | | | Special serializer/deserializer for amount values. It is optimized for values which have few non-zero digits in decimal representation. Most amounts currently in the txout set take only 1 or 2 bytes to represent.
* | Compact serialization for variable-length integersPieter Wuille2012-10-201-0/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Variable-length integers: bytes are a MSB base-128 encoding of the number. The high bit in each byte signifies whether another digit follows. To make the encoding is one-to-one, one is subtracted from all but the last digit. Thus, the byte sequence a[] with length len, where all but the last byte has bit 128 set, encodes the number: (a[len-1] & 0x7F) + sum(i=1..len-1, 128^i*((a[len-i-1] & 0x7F)+1)) Properties: * Very small (0-127: 1 byte, 128-16511: 2 bytes, 16512-2113663: 3 bytes) * Every integer has exactly one encoding * Encoding does not depend on size of original integer type
* | Merge pull request #1742 from sipa/canonicalJeff Garzik2012-10-208-40/+156
|\ \ | | | | | | Check for canonical public keys and signatures
| * | Check for canonical public keys and signaturesPieter Wuille2012-09-218-40/+156
| | | | | | | | | | | | Only enabled inside tests for now.
* | | data-driven base58 CBitcoinAddress/CBitcoinSecret testsWladimir J. van der Laan2012-10-014-64/+854
|/ / | | | | | | | | Arbitrary numbers of test vectors can be generated using the script `gen_base58_test_vectors.py`.
* | Merge branch 'testdata' of git://github.com/TheBlueMatt/bitcoinGavin Andresen2012-09-183-4/+67
|\ \
| * | Add various tests for CTransaction::CheckTransaction()Matt Corallo2012-09-052-2/+59
| | |
| * | check tx.CheckTransaction for data-driven tx tests.Matt Corallo2012-09-051-2/+8
| | | | | | | | | | | | | | | (and change so that only one case has to fail to make a tx_invalid test correct)
* | | Merge branch 'refactor_times' of git://github.com/luke-jr/bitcoinGavin Andresen2012-09-181-1/+1
|\ \ \ | |_|/ |/| |
| * | Bugfix: Initialize CWallet::nOrderPosNext on an empty wallet, and save it in dbLuke Dashjr2012-09-081-1/+1
| | |
* | | Wrong address added to collection in testxanatos2012-09-071-1/+1
| |/ |/| | | The wrong address is added to the collection. As was written a second copy of address1 was added (and so address2 was useless).
* | Merge pull request #1699 from laanwj/2012_08_secureallocPieter Wuille2012-08-241-0/+115
|\ \ | |/ |/| Handle locked pages more robustly (Fixes issue #1462)
| * Handle locked pages more robustly (Fixes issue #1462)Wladimir J. van der Laan2012-08-231-0/+115
| | | | | | | | | | | | | | Memory locks do not stack, that is, pages which have been locked several times by calls to mlock() will be unlocked by a single call to munlock(). This can result in keying material ending up in swap when those functions are used naively. In this commit a class "LockedPageManager" is added that simulates stacking memory locks by keeping a counter per page.
* | Store a fixed order of transactions (and accounting) in the walletLuke Dashjr2012-08-231-0/+123
|/ | | | | For backward compatibility, new accounting data is stored after a \0 in the comment string. This way, old versions and third-party software should load and store them, but all actual use (listtransactions, for example) ignores it.
* Merge branch 'testdata' of git://github.com/TheBlueMatt/bitcoinGavin Andresen2012-08-215-2/+411
|\
| * Add data-driven transaction tests.Matt Corallo2012-08-203-0/+216
| |
| * Add a few test cases to data-driven script tests.Matt Corallo2012-08-202-2/+195
| |
* | Merge pull request #1687 from gavinandresen/quietunitPieter Wuille2012-08-211-1/+1
|\ \ | | | | | | Suppress output when running unit tests.
| * | Suppress output when running unit tests.Gavin Andresen2012-08-201-1/+1
| |/ | | | | | | | | | | | | | | This does two things: 1) Now does not output to debug.log if -printtodebugger flag is passed 2) Unit tests set -printtodebugger so only test results are output to stdout Note that -printtodebugger only actually prints to the debugger on Windows.
* / Set block.nVersion to fix miner unit testGavin Andresen2012-08-201-0/+1
|/
* Remove useless non-cross-platform tests.Matt Corallo2012-08-171-0/+2
|
* fix further spelling errors / remove a tab in the sourcePhilip Kaufmann2012-08-021-3/+3
|
* Bugfix: Use standard BTC unit in commentsLuke Dashjr2012-08-011-2/+2
|
* Bugfix: Fix a variety of misspellingsLuke Dashjr2012-08-012-3/+3
|
* Tests for CreateNewBlockLuke Dashjr2012-07-121-0/+190
|
* Run BDB disk-less for test_bitcoinLuke Dashjr2012-07-111-1/+7
|
* Implement raw transaction RPC callsGavin Andresen2012-07-051-0/+113
| | | | | | Implement listunspent / getrawtransaction / createrawtransaction / signrawtransaction, to support creation and signing-on-multiple-device multisignature transactions.
* Fix a couple more typosfanquake2012-06-302-2/+2
|
* Merge branch 'patch-3' of https://github.com/xanatos/bitcoinGavin Andresen2012-06-281-3/+3
|\
| * Small fix to rpc_testsxanatos2012-06-221-3/+3
| |
* | Checkpoint at block 185333 (and remove a couple of intermediate checkpoints)Gavin Andresen2012-06-251-7/+7
| |
* | Node support for Tor hidden servicesPieter Wuille2012-06-232-2/+13
| | | | | | | | | | | | This commit adds support for .onion addresses (mapped into the IPv6 by using OnionCat's range and encoding), and the ability to connect to them via a SOCKS5 proxy.
* | Unit tests for base32 encode/decodePieter Wuille2012-06-221-0/+20
|/
* = instead of == in multisig_tests.cppxanatos2012-06-211-1/+1
|
* Fix netbase testsPieter Wuille2012-06-191-1/+0
| | | | | * Do not rely on "a.b.c" being interpreted as "a.0.b.c" * Parse numeric addresses for address families for which no device is configured
* Merge pull request #1399 from sipa/ipparseGavin Andresen2012-06-181-0/+92
|\ | | | | Improve parsing of IPv6 addresses
| * Add netbase testsPieter Wuille2012-06-141-0/+92
| |
* | Merge branch 'signbugs' of https://github.com/wizeman/bitcoinGavin Andresen2012-06-181-0/+125
|\ \ | |/ |/| | | Resolved minor conflict in main.cpp
| * Move NOINLINE definition to test where it's used.Ricardo M. Correia2012-06-071-0/+16
| |
| * Use C++-style numeric limits instead of C-style.Ricardo M. Correia2012-05-311-3/+3
| |
| * Fix noinline definition so that it works for more compilers.Ricardo M. Correia2012-05-311-3/+2
| |
| * Add test case for CBigNum::setint64().Ricardo M. Correia2012-05-141-0/+110
| | | | | | | | | | | | | | One of the test cases currently aborts when using gcc's flag -ftrapv, due to negating an INT64_MIN int64 variable, which is an undefined operation. This will be fixed in a subsequent commit.
* | Fix build of testcases after commit 0f10b21719e1b0d9683a142f0a7105e65f095694Wladimir J. van der Laan2012-06-141-0/+6
| |
* | Fix coin selection to only include change when it's necessary.Chris Moore2012-06-041-38/+7
| |
* | Test that the coin selection code is suitably random, and add tests re. ↵Chris Moore2012-06-041-1/+71
| | | | | | | | sub-cent change.
* | Refactor SelectCoinsMinConf() and add unit tests.Chris Moore2012-06-041-0/+256
| | | | | | | | AvailableCoins() makes a vector of available outputs which is then passed to SelectCoinsMinConf(). This allows unit tests to test the coin selection algorithm without having the whole blockchain available.
* | Merge pull request #1357 from sipa/keyidPieter Wuille2012-05-267-46/+51
|\ \ | | | | | | Refactor: split CKeyID/CScriptID/CTxDestination from CBitcoinAddress
| * | Refactor: split CKeyID/CScriptID/CTxDestination from CBitcoinAddressPieter Wuille2012-05-247-52/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This introduces internal types: * CKeyID: reference (hash160) of a key * CScriptID: reference (hash160) of a script * CTxDestination: a boost::variant of the former two CBitcoinAddress is retrofitted to be a Base58 encoding of a CTxDestination. This allows all internal code to only use the internal types, and only have RPC and GUI depend on the base58 code. Furthermore, the header dependencies are a lot saner now. base58.h is at the top (right below rpc and gui) instead of at the bottom. For the rest: wallet -> script -> keystore -> key. Only keystore still requires a forward declaration of CScript. Solving that would require splitting script into two layers.