Skip to content

Commit

Permalink
Merge pull request bitcoin#335 from qtumproject/djaen/python-qa-fixes…
Browse files Browse the repository at this point in the history
…-for-rpcmaxgasprice

Updated tests to account for rpcmaxgasprice
  • Loading branch information
qtum-neil authored Sep 7, 2017
2 parents b9ed2a6 + af4adb0 commit 0542018
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 19 deletions.
2 changes: 1 addition & 1 deletion qa/rpc-tests/qtum-condensing-txs.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def __init__(self):
self.num_nodes = 1

def setup_network(self, split=False):
self.nodes = start_nodes(self.num_nodes, self.options.tmpdir, [['-txindex=1']])
self.nodes = start_nodes(self.num_nodes, self.options.tmpdir, [['-txindex=1', '-rpcmaxgasprice=10000000']])
self.node = self.nodes[0]
self.is_network_split = False

Expand Down
2 changes: 1 addition & 1 deletion qa/rpc-tests/qtum-dgp-gas-price-lingering-mempool-tx.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def __init__(self):
self.num_nodes = 2

def setup_network(self, split=False):
self.nodes = start_nodes(self.num_nodes, self.options.tmpdir)
self.nodes = start_nodes(self.num_nodes, self.options.tmpdir, [['-rpcmaxgasprice=10000000'], ['-rpcmaxgasprice=10000000']])
self.node = self.nodes[0]
self.GAS_PRICE_DGP = DGPState(self.node, "0000000000000000000000000000000000000082")
connect_nodes_bi(self.nodes, 0, 1)
Expand Down
16 changes: 8 additions & 8 deletions qa/rpc-tests/qtum-soft-block-gas-limits.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ def __init__(self):

def setup_network(self, split=False):
self.nodes = start_nodes(self.num_nodes, self.options.tmpdir, [
["-staker-soft-block-gas-limit=1000000000"],
["-staker-soft-block-gas-limit=400000"],
["-staker-soft-block-gas-limit=0"],
["-staker-max-tx-gas-limit=100000000"],
["-staker-max-tx-gas-limit=100000"],
["-staker-max-tx-gas-limit=0"],
["-staker-min-tx-gas-price=0"],
["-staker-min-tx-gas-price=0.0001"]
["-staker-soft-block-gas-limit=1000000000", '-rpcmaxgasprice=10000000'],
["-staker-soft-block-gas-limit=400000", '-rpcmaxgasprice=10000000'],
["-staker-soft-block-gas-limit=0", '-rpcmaxgasprice=10000000'],
["-staker-max-tx-gas-limit=100000000", '-rpcmaxgasprice=10000000'],
["-staker-max-tx-gas-limit=100000", '-rpcmaxgasprice=10000000'],
["-staker-max-tx-gas-limit=0", '-rpcmaxgasprice=10000000'],
["-staker-min-tx-gas-price=0", '-rpcmaxgasprice=10000000'],
["-staker-min-tx-gas-price=0.0001", '-rpcmaxgasprice=10000000']
])
self.is_network_split = False
# Make the network fully connected
Expand Down
12 changes: 3 additions & 9 deletions qa/rpc-tests/qtum-transaction-prioritization.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,27 @@
from test_framework.script import *
from test_framework.mininode import *
from test_framework.address import *
from test_framework.qtum import *
import sys
import random
import time

def p2pkh_to_hex_hash(address):
return str(base58_to_byte(address, 25)[1])[2:-1]

def hex_hash_to_p2pkh(hex_hash):
return keyhash_to_p2pkh(hex_str_to_bytes(hex_hash))

class QtumTransactionPrioritizationTest(BitcoinTestFramework):
def __init__(self):
super().__init__()
self.setup_clean_chain = True
self.num_nodes = 1

def setup_network(self, split=False):
self.nodes = start_nodes(self.num_nodes, self.options.tmpdir, [['-staking=1']])
self.nodes = start_nodes(self.num_nodes, self.options.tmpdir, [['-staking=1', '-rpcmaxgasprice=10000000']])
self.is_network_split = False
self.node = self.nodes[0]

def restart_node(self):
stop_nodes(self.nodes)
self.nodes = start_nodes(self.num_nodes, self.options.tmpdir, [["-staking=1"]])
self.nodes = start_nodes(self.num_nodes, self.options.tmpdir, [['-staking=1', '-rpcmaxgasprice=10000000']])
self.node = self.nodes[0]


def stake_or_mine(self, old_block_count=None, use_staking=False):
# Since staking is switched on by default, if a block has been staked return that block's hash
if self.node.getblockcount() > old_block_count:
Expand Down

0 comments on commit 0542018

Please sign in to comment.