Commit Graph

19 Commits

Author SHA1 Message Date
Pasta
b40dc8f1ec fix lint-python.sh after 11835 and 12295
Signed-off-by: Pasta <pasta@dashboost.org>
2020-06-17 14:29:55 -05:00
Alexander Block
8dc7ec7e56 Call set_node_times by default in bump_mocktime
And remove manual calls accordingly.
2020-04-14 15:16:51 +02:00
Alexander Block
12ae7e171e Sync mempool before generating blocks 2020-04-14 15:16:51 +02:00
Alexander Block
54198ce739
Backport bitcoin#15773: test: Add BitcoinTestFramework::sync_* methods (incomplete backport) (#3409)
* scripted-diff: Rename sync_blocks to send_blocks to avoid name collisions and confusion

-BEGIN VERIFY SCRIPT-
FILE_LIST=$(git grep -l 'def sync_blocks' ./test/functional/*.py)
sed -i -e 's/def sync_blocks/def send_blocks/g'   $FILE_LIST
sed -i -e 's/self.sync_blocks/self.send_blocks/g' $FILE_LIST
-END VERIFY SCRIPT-

* test: Pass at most one node group to sync_all

* test: Add BitcoinTestFramework::sync_* methods

* Move bumping of mocktime into BitcoinTestFramework.sync_mempool

Instead of doing it in every place it's needed

* scripted-diff: use self.sync_* methods

-BEGIN VERIFY SCRIPT-
sed -i -e 's/sync_blocks(self.nodes)/self.sync_blocks()/g'     $(git grep -l 'sync_blocks(self.nodes)'   ./test/functional/*.py)
sed -i -e 's/sync_mempools(self.nodes)/self.sync_mempools()/g' $(git grep -l 'sync_mempools(self.nodes)' ./test/functional/*.py)

sed -i -e 's/  sync_blocks(/  self.sync_blocks(/g'     $(git grep -l sync_blocks   ./test/functional/*.py)
sed -i -e 's/  sync_mempools(/  self.sync_mempools(/g' $(git grep -l sync_mempools ./test/functional/*.py)
-END VERIFY SCRIPT-

* Pass nodes into bump_mocktime

Co-authored-by: MarcoFalke <falke.marco@gmail.com>
2020-04-14 13:00:16 +03:00
Alexander Block
5cf417bc3a Bump mocktime while syncing mempools
Otherwise the inv/getdata logic won't work with inbound connections due to
the added delay of 2 seconds.
2020-04-08 22:28:39 +02:00
UdjinM6
7d39637b02 Bump copyright year to 2020 (#3290)
* Bump _COPYRIGHT_YEAR

* Run copyright update script

./contrib/devtools/copyright_header.py update .

* Update COPYING

* Bump copyright year in dash-cli/qt/tx and dashd map pages
2020-01-17 15:42:55 +01:00
Alexander Block
aca6af0a0e
Use smaller LLMQs in regtest (#3269)
* Rename LLMQ_5_60 to LLMQ_TEST

* Introduce -llmqtestparams which allows to modify LLMQ_TEST on regtest

Also add support in DashTestFramework

* Use parameters size=3, threshold=2 as default for LLMQ_TEST

And fall back to the old parameters where necessary

* Wait for all contributions, even when one member is lying

Otherwise we might end up continuing too fast, which would fail the DKG.

* Update src/chainparams.cpp

Co-Authored-By: UdjinM6 <UdjinM6@users.noreply.github.com>

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2020-01-07 13:49:51 +01:00
UdjinM6
08f447af92 Tests: Allow specifying different cmd-line params for each masternode (#3222) 2019-12-05 19:28:33 +01:00
UdjinM6
bad3243b8e
Bump mocktime before generating new blocks and generate a few blocks at the end of test_mempool_doublespend in p2p-instantsend.py (#3125)
* Cleanup p2p-instantsend.py

Bump mocktime before generating new blocks and generate a few blocks at the end of test_mempool_doublespend to clean things up

* Update test/functional/p2p-instantsend.py

Co-Authored-By: PastaPastaPasta <6443210+PastaPastaPasta@users.noreply.github.com>
2019-10-01 17:15:28 +03:00
UdjinM6
82ebba18f4
Few fixes for wait_for_instantlock (#3123)
* Fix `wait_for_instantlock` to make it fail if instantlock wasn't aquired, use `wait_until`

Currently it simply returns False if islock failed but that's not the way we use it (we never check results).

* Wait for txes to propagate before checking for instantlock
2019-10-01 17:14:26 +03:00
Alexander Block
424ed32dbb Few assert_raises_jsonrpc -> assert_raises_rpc_error fixes 2019-09-29 12:48:49 +02:00
Alexander Block
fa57eafd00 scripted-diff: rename assert_raises_jsonrpc to assert_raises_rpc error
-BEGIN VERIFY SCRIPT-
sed -i 's/assert_raises_jsonrpc/assert_raises_rpc_error/g' test/functional/*py test/functional/test_framework/*py
-END VERIFY SCRIPT-
2019-09-29 12:42:13 +02:00
Alexander Block
7a44dc1956 Fix hash256() imports
Importing util.* results in the wrong version of hash256 being imported
2019-09-24 17:47:35 +02:00
Alexander Block
a304d4d47c Fix DashTestFramework and tests depending on it 2019-09-24 17:47:35 +02:00
UdjinM6
9abc393839
Refactor few things here and there (#3066)
* Refactor `HandleFullyConfirmedBlock()`

* Pass `pindexMined` into `AddNonLockedTx()`

* Unify time import in Dash specific tests

* Refactor UpdateSpork and SetPrivKey
2019-08-28 14:51:59 +03:00
UdjinM6
386de78bcb
Fix SelectCoinsMinConf to allow instant respends (#3061)
* Modify tests to check for instant respends

This should fail atm...

* Fix SelectCoinsMinConf to allow instant respends

Now tests should pass again.
2019-08-23 21:02:33 +03:00
UdjinM6
d0288fba58
Refactor/fix mocktime usage in tests 2019-08-12 09:07:03 -05:00
Alexander Block
2f21e55514 Remove legacy InstantSend code (#3020)
* Remove ppszTypeName from protocol.cpp and reimplement GetCommand

This removes the need to carefully maintain ppszTypeName, which required
correct order and also did not allow to permanently remove old message
types.

To get the command name for an INV type, GetCommandInternal uses a switch
which needs to be maintained from now on.

The way this is implemented also resembles the way it is implemented in
Bitcoin today, but it's not identical. The original PR that introduced the
switch case in Bitcoin was part of the Segwit changes and thus never got
backported. I decided to implement it in a slightly different way that
avoids throwing exceptions when an unknown INV type is encountered.

IsKnownType will now also leverage GetCommandInternal() to figure out if
the INV type is known locally. This has the side effect of old/legacy
message types to return false from now on. We will depend on this side
effect in later commits when we remove legacy InstantSend code.

* Stop handling/relaying legacy IX messages

When we receive an IX message, we simply treat it as a regular TX and relay
it as such.

We'll however still request IX messages when they are announced to us. We
can't simply revert to requesting TX messages in this case as it might
result in the other peer not answering due to the TX not being in mapRelay
yet. We should at some point in the future completely drop handling of IX
messages instead.

* Remove IsNewInstantSendEnabled() and only use IsInstantSendEnabled()

* Remove legacy InstantSend from GUI

* Remove InstantSend from Bitcoin/Dash URIs

* Remove legacy InstantSend from RPC commands

* Remove legacy InstantSend from wallet

* Remove legacy instantsend.h include

* Remove legacy InstantSend from validation code

* Completely remove remaining legacy InstantSend code

* Remove now unused spork

* Fix InstantSend related test failures

* Remove now obsolete auto IS tests

* Make spork2 and spork3 disabled by default

This should have no influence on mainnet as these sporks are actually set
there. This will however affect regtest, which shouldn't have LLMQ based
InstantSend enabled by default.

* Remove instantsend tests from dip3-deterministicmns.py

These were only testing legacy InstantSend

* Fix .QCheckBox#checkUsePrivateSend styling a bit

* s/TXLEGACYLOCKREQUEST/LEGACYTXLOCKREQUEST/

* Revert "verified via InstantSend" back to "verified via LLMQ based InstantSend"

* Use cmd == nullptr instead of !cmd

* Remove last parameter from AvailableCoins call

This was for fUseInstantSend which is not present anymore since rebase
2019-07-09 17:50:08 +03:00
PastaPastaPasta
6edbc9cebd Merge bitcoin#9956: Reorganise qa directory (#2912)
* Merge #9956: Reorganise qa directory

63d66ba Move src/test/bitcoin-util-test.py to test/util/bitcoin-util-test.py (John Newbery)
5b0bff4 Rename --enable-extended-rpc-tests to --enable-extended-functional-tests (John Newbery)
a9bd622 Rename test/pull-tester/rpc-tests.py to test/functional/test_runner.py (John Newbery)
c28ee91 Rename rpc-tests directory to functional (John Newbery)
00902c4 Rename qa directory to test (John Newbery)

Tree-SHA512: ee7125c0c647d81590177beef2c8852c4ef76fdcf888096d9d4d360562a01d8d3b453345c3040487b2a043935bd1e7e80018f34462d6e02262bedbe23edcc576

resolve build errors

Signed-off-by: Pasta <Pasta@dash.org>

update test_runner.py in testintegrations.sh

Signed-off-by: Pasta <Pasta@dash.org>

* moved dash specific tests

Signed-off-by: Pasta <Pasta@dash.org>

* dashify README.md

Signed-off-by: Pasta <Pasta@dash.org>

* removed autoix*.py

Signed-off-by: Pasta <Pasta@dash.org>

* change back file perms

* dedashify

Signed-off-by: Pasta <Pasta@dash.org>
2019-05-19 23:20:34 +03:00