aboutsummaryrefslogtreecommitdiff
path: root/src/test
AgeCommit message (Collapse)Author
2016-03-15Versionbits testsPieter Wuille
2016-03-15BIP9 ImplementationPieter Wuille
Inspired by former implementations by Eric Lombrozo and Rusty Russell, and based on code by Jorge Timon.
2016-03-14Merge #7517: test: script_error checking in script_invalid testsWladimir J. van der Laan
0ecb340 test: Script_error checking in script_invalid tests (Wladimir J. van der Laan) 2317ad7 test: Re-introduce JSON pretty printing in test builder (Wladimir J. van der Laan) b0ff857 test: Move non-generated script_invalid test to the correct place (Wladimir J. van der Laan)
2016-03-11Move GetTempPath() to testutil.Mustafa
2016-03-11Add a source file for unit test utils.Mustafa
2016-02-16Add tags to mempool's mapTx indicesSuhas Daftuar
2016-02-16Merge #7524: BIP-112: Mempool-only CHECKSEQUENCEVERIFYWladimir J. van der Laan
a381076 Code style fix. (BtcDrak) c3c3752 Separate CheckLockTime() and CheckSequence() logic (BtcDrak) 53e53a3 BIP112: Implement CHECKSEQUENCEVERIFY (Mark Friedenbach)
2016-02-15test: test leading space for ParseHexWladimir J. van der Laan
BerkeleyDB dump files have key and value lines indented. The salvage code passes these to ParseHex as-is. Check this in the tests (should just pass with current code).
2016-02-14BIP112: Implement CHECKSEQUENCEVERIFYMark Friedenbach
- Replace NOP3 with CHECKSEQUENCEVERIFY (BIP112) <nSequence> CHECKSEQUENCEVERIFY -> <nSequence> - Fails if txin.nSequence < nSequence, allowing funds of a txout to be locked for a number of blocks or a duration of time after its inclusion in a block. - Pull most of CheckLockTime() out into VerifyLockTime(), a local function that will be reused for CheckSequence() - Add bitwise AND operator to CScriptNum - Enable CHECKSEQUENCEVERIFY as a standard script verify flag - Transactions that fail CSV verification will be rejected from the mempool, making it easy to test the feature. However blocks containing "invalid" CSV-using transactions will still be accepted; this is *not* the soft-fork required to actually enable CSV for production use.
2016-02-12Merge #7184: Implement SequenceLocks functions for BIP 68Wladimir J. van der Laan
b043c4b fix sdaftuar's nits again (Alex Morcos) a51c79b Bug fix to RPC test (Alex Morcos) da6ad5f Add RPC test exercising BIP68 (mempool only) (Suhas Daftuar) c6c2f0f Implement SequenceLocks functions (Alex Morcos)
2016-02-11test: Script_error checking in script_invalid testsWladimir J. van der Laan
Check the returned script_error. Add expected script_error for generated as well as custom tests. The specific error is not part of consensus, however it could avoid unclear reporting issues such as #6862 in the future. Fixes #7513.
2016-02-11test: Re-introduce JSON pretty printing in test builderWladimir J. van der Laan
2016-02-11test: Move non-generated script_invalid test to the correct placeWladimir J. van der Laan
This test was introduced in 9fadf1c874f938f87395495776dbae896551873d, but accidentally added in the autogenerated area.
2016-02-10Implement SequenceLocks functionsAlex Morcos
SequenceLocks functions are used to evaluate sequence lock times or heights per BIP 68. The majority of this code is copied from maaku in #6312 Further credit: btcdrak, sipa, NicolasDorier
2016-02-09tests: Remove May15 testWladimir J. van der Laan
This test is no longer relevant. It was introduced in 8c222dca4f961ad13ec64d690134a40d09b20813 to check the switch to 1MB blocks after the BDB too-many-locks issue back in 2013. The switching code has been long since removed. It also needs a specific data file that is hard to find. I've verified in #6320 that it still passes, however I think there is zero reason to keep it. Closes #6320.
2016-02-04Merge #7070: Move maxTxFee out of mempoolWladimir J. van der Laan
fad6244 ATMP: make nAbsurdFee const (MarcoFalke) fa762d0 [wallet.h] Remove main.h include (MarcoFalke) fa79db2 Move maxTxFee out of mempool (MarcoFalke)
2016-02-03Merge branch 'master' into single_prodnameLuke Dashjr
2016-02-03Rewrite FormatParagraph to handle newlines within input strings correctlyLuke Dashjr
2016-02-02Move maxTxFee out of mempoolMarcoFalke
Also, remove default values in CMerkleTx::AcceptToMemoryPool()
2016-02-01Get rid of inaccurate ScriptSigArgsExpectedPieter Wuille
(cherry picked from commit 52b29dca7670c3f6d2ab918c0fff1d17c4e494ad)
2016-01-28Merge #7212: Adds unittests for CAddrMan and CAddrinfo, removes source of ↵Wladimir J. van der Laan
non-determinism. 40c87b6 Increase test coverage for addrman and addrinfo (Ethan Heilman)
2016-01-28Merge #7348: MOVE ONLY: move rpc* to rpc/Wladimir J. van der Laan
d13f65e rpc: update inline comments to refer to new file paths (Daniel Cousens) a0eaff8 move rpc* to rpc/ (Daniel Cousens)
2016-01-27Increase test coverage for addrman and addrinfoEthan Heilman
Adds several unittests for CAddrMan and CAddrInfo. Increases the accuracy of addrman tests. Removes non-determinism in tests by overriding the random number generator. Extracts testing code from addrman class to test class.
2016-01-27Merge #7300: [trivial] Add missing copyright headersWladimir J. van der Laan
fabcee1 Remove copyright header from autogenerated chainparamsseeds.h (MarcoFalke) fa60d05 Add missing copyright headers (MarcoFalke) fa7e4c0 Bump copyright headers to 2014 (MarcoFalke)
2016-01-21move rpc* to rpc/Daniel Cousens
2016-01-20Merge #7307: [RPC, Wallet] Move RPC dispatch table registration to wallet/ codeWladimir J. van der Laan
dd2dc40 [RPC, Wallet] Move RPC dispatch table registration to wallet/ code (Jonas Schnelli)
2016-01-20[RPC, Wallet] Move RPC dispatch table registration to wallet/ codeJonas Schnelli
Allow extending the rpc dispatch table by appending commands when server is not running.
2016-01-17Typo fixes in commentsChris Wheeler
2016-01-05c++11: don't throw from the reverselock destructorCory Fields
noexcept is default for destructors as of c++11. By throwing in reverselock's destructor if it's lock has been tampered with, the likely result is std::terminate being called. Indeed that happened before this change. Once reverselock has taken another lock (its ctor didn't throw), it makes no sense to try to grab or lock the parent lock. That is be broken/undefined behavior depending on the parent lock's implementation, but it shouldn't cause the reverselock to fail to re-lock when destroyed. To avoid those problems, simply swap the parent lock's contents with a dummy for the duration of the lock. That will ensure that any undefined behavior is caught at the call-site rather than the reverse lock's destruction. Barring a failed mutex unlock which would be indicative of a larger problem, the destructor should now never throw.
2016-01-05Add missing copyright headersMarcoFalke
2016-01-05Bump copyright headers to 2014MarcoFalke
2016-01-05Merge pull request #7205Wladimir J. van der Laan
fa71669 [devtools] Use git pretty-format for year parsing (MarcoFalke) fa24439 Bump copyright headers to 2015 (MarcoFalke) fa6ad85 [devtools] Rewrite fix-copyright-headers.py (MarcoFalke)
2015-12-30Double semicolon cleanup.21E14
2015-12-15Rename OP_NOP2 to OP_CHECKLOCKTIMEVERIFY.mb300sd
2015-12-13Bump copyright headers to 2015MarcoFalke
2015-12-11Replace trickle nodes with per-node/message Poisson delaysPieter Wuille
We used to have a trickle node, a node which was chosen in each iteration of the send loop that was privileged and allowed to send out queued up non-time critical messages. Since the removal of the fixed sleeps in the network code, this resulted in fast and attackable treatment of such broadcasts. This pull request changes the 3 remaining trickle use cases by random delays: * Local address broadcast (while also removing the the wiping of the seen filter) * Address relay * Inv relay (for transactions; blocks are always relayed immediately) The code is based on older commits by Patrick Strateman.
2015-12-03Merge pull request #7133Wladimir J. van der Laan
aa4b0c2 When not filtering blocks, getdata sends more in one test (Pieter Wuille) d41e44c Actually only use filterInventoryKnown with MSG_TX inventory messages. (Gregory Maxwell) b6a0da4 Only use filterInventoryKnown with MSG_TX inventory messages. (Patick Strateman) 6b84935 Rename setInventoryKnown filterInventoryKnown (Patick Strateman) e206724 Remove mruset as it is no longer used. (Gregory Maxwell) ec73ef3 Replace setInventoryKnown with a rolling bloom filter. (Gregory Maxwell)
2015-12-02Merge pull request #7144Wladimir J. van der Laan
8f0d79e test: Disable scheduler test manythreads (Wladimir J. van der Laan)
2015-12-01Rewrite CreateNewBlockAlex Morcos
Use the score index on the mempool to only add sorted txs in order. Remove much of the validation while building the block, relying on mempool to be consistent and only contain txs that can be mined. The mempool is assumed to be consistent as far as not containing txs which spend non-existent outputs or double spends, and scripts are valid. Finality of txs is still checked (except not coinbase maturity, assumed in mempool). Still TestBlockValidity in case mempool consistency breaks and return error state if an invalid block was created. Unit tests are modified to realize that invalid blocks can now be constructed if the mempool breaks its consistency assumptions and also updated to have the right fees, since the cached value is now used for block construction. Conflicts: src/miner.cpp
2015-12-01Add a score index to the mempool.Alex Morcos
The score index is meant to represent the order of priority for being included in a block for miners. Initially this is set to the transactions modified (by any feeDelta) fee rate. Index improvements and unit tests by sdaftuar.
2015-12-01Store the total sig op count of a tx.Alex Morcos
Store sum of legacy and P2SH sig op counts. This is calculated in AcceptToMemory pool and storing it saves redoing the expensive calculation in block template creation.
2015-12-01test: Disable scheduler test manythreadsWladimir J. van der Laan
It causes occasional deadlocks, resulting in false negatives in Travis. Disable the test for now. Works around #6540.
2015-12-01Merge pull request #6915Wladimir J. van der Laan
2d8860e Fix removeForReorg to use MedianTimePast (Suhas Daftuar) b7fa4aa Don't call removeForReorg if DisconnectTip fails (Suhas Daftuar) 7e49f5f Track coinbase spends in CTxMemPoolEntry (Suhas Daftuar) bb8ea1f removeForReorg calls once-per-disconnect-> once-per-reorg (Matt Corallo) 474b84a Make indentation in ActivateBestChainStep readable (Matt Corallo) b0a064c Fix comment in removeForReorg (Matt Corallo) 9b060e5 Fix removal of time-locked transactions during reorg (Matt Corallo) 0c9959a Add failing test checking timelocked-txn removal during reorg (Matt Corallo)
2015-12-01Merge pull request #6914Wladimir J. van der Laan
114b581 Prevector type (Pieter Wuille)
2015-11-30Merge pull request #7072Gregory Maxwell
996d311 [RPC] Add transaction size to JSON output (Nick)
2015-11-30Track coinbase spends in CTxMemPoolEntrySuhas Daftuar
This allows us to optimize CTxMemPool::removeForReorg.
2015-11-30Remove mruset as it is no longer used.Gregory Maxwell
2015-11-28[RPC] Add transaction size to JSON outputNick
This may be useful for blockchain explorers.
2015-11-27Switch blocks to a constant-space Merkle root/branch algorithm.Pieter Wuille
This switches the Merkle tree logic for blocks to one that runs in constant (small) space. The old code is moved to tests, and a new test is added that for various combinations of block sizes, transaction positions to compute a branch for, and mutations: * Verifies that the old code and new code agree for the Merkle root. * Verifies that the old code and new code agree for the Merkle branch. * Verifies that the computed Merkle branch is valid. * Verifies that mutations don't change the Merkle root. * Verifies that mutations are correctly detected.
2015-11-27Merge pull request #7095Wladimir J. van der Laan
4ec3561 Replace scriptnum_test's normative ScriptNum implementation (Wladimir J. van der Laan)