-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' of https://github.com/dashpay/dash into develop
- Loading branch information
Showing
17 changed files
with
100 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Tests | ||
----- | ||
|
||
- For the `regtest` network the activation heights of several softforks were | ||
changed. (dash#6189) | ||
* BIP 34 (blockheight in coinbase) from 500 to 2 | ||
* BIP 66 (DERSIG) from 1251 to 102 | ||
* BIP 65 (CLTV) from 1351 to 111 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,6 +40,7 @@ | |
from itertools import product | ||
|
||
from test_framework.blocktools import ( | ||
CSV_ACTIVATION_HEIGHT, | ||
create_block, | ||
create_coinbase, | ||
TIME_GENESIS_BLOCK, | ||
|
@@ -63,12 +64,12 @@ | |
TESTING_TX_COUNT = 83 # Number of testing transactions: 1 BIP113 tx, 16 BIP68 txs, 66 BIP112 txs (see comments above) | ||
COINBASE_BLOCK_COUNT = TESTING_TX_COUNT # Number of coinbase blocks we need to generate as inputs for our txs | ||
BASE_RELATIVE_LOCKTIME = 10 | ||
CSV_ACTIVATION_HEIGHT = 432 | ||
SEQ_DISABLE_FLAG = 1 << 31 | ||
SEQ_RANDOM_HIGH_BIT = 1 << 25 | ||
SEQ_TYPE_FLAG = 1 << 22 | ||
SEQ_RANDOM_LOW_BIT = 1 << 18 | ||
|
||
|
||
def relative_locktime(sdf, srhb, stf, srlb): | ||
"""Returns a locktime with certain bits set.""" | ||
|
||
|
@@ -83,6 +84,7 @@ def relative_locktime(sdf, srhb, stf, srlb): | |
locktime |= SEQ_RANDOM_LOW_BIT | ||
return locktime | ||
|
||
|
||
def all_rlt_txs(txs): | ||
return [tx['tx'] for tx in txs] | ||
|
||
|
@@ -93,6 +95,7 @@ def set_test_params(self): | |
self.setup_clean_chain = True | ||
# Must set '-dip3params=2000:2000' to create pre-dip3 blocks only | ||
self.extra_args = [[ | ||
'-peertimeout=999999', # bump because mocktime might cause a disconnect otherwise | ||
'[email protected]', | ||
'-dip3params=2000:2000', | ||
'-par=1', # Use only one script thread to get the exact reject reason for testing | ||
|
@@ -148,13 +151,13 @@ def create_bip112txs(self, bip112inputs, varyOP_CSV, txversion, locktime_delta=0 | |
for i, (sdf, srhb, stf, srlb) in enumerate(product(*[[True, False]] * 4)): | ||
locktime = relative_locktime(sdf, srhb, stf, srlb) | ||
tx = self.create_self_transfer_from_utxo(bip112inputs[i]) | ||
if (varyOP_CSV): # if varying OP_CSV, nSequence is fixed | ||
if varyOP_CSV: # if varying OP_CSV, nSequence is fixed | ||
tx.vin[0].nSequence = BASE_RELATIVE_LOCKTIME + locktime_delta | ||
else: # vary nSequence instead, OP_CSV is fixed | ||
tx.vin[0].nSequence = locktime + locktime_delta | ||
tx.nVersion = txversion | ||
self.miniwallet.sign_tx(tx) | ||
if (varyOP_CSV): | ||
if varyOP_CSV: | ||
tx.vin[0].scriptSig = CScript([locktime, OP_CHECKSEQUENCEVERIFY, OP_DROP] + list(CScript(tx.vin[0].scriptSig))) | ||
else: | ||
tx.vin[0].scriptSig = CScript([BASE_RELATIVE_LOCKTIME, OP_CHECKSEQUENCEVERIFY, OP_DROP] + list(CScript(tx.vin[0].scriptSig))) | ||
|
@@ -201,7 +204,7 @@ def run_test(self): | |
self.tip = int(self.nodes[0].getbestblockhash(), 16) | ||
|
||
# Activation height is hardcoded | ||
test_blocks = self.generate_blocks(CSV_ACTIVATION_HEIGHT-5 - COINBASE_BLOCK_COUNT) | ||
test_blocks = self.generate_blocks(CSV_ACTIVATION_HEIGHT - 5 - COINBASE_BLOCK_COUNT) | ||
#test_blocks = self.generate_blocks(345) | ||
self.send_blocks(test_blocks) | ||
assert not softfork_active(self.nodes[0], 'csv') | ||
|
@@ -487,5 +490,6 @@ def run_test(self): | |
self.send_blocks([self.create_test_block(time_txs)]) | ||
self.nodes[0].invalidateblock(self.nodes[0].getbestblockhash()) | ||
|
||
|
||
if __name__ == '__main__': | ||
BIP68_112_113Test().main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.