mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-25 02:33:24 -03:00
test: Add helper functions for checking node versions
This commit is contained in:
parent
ef29d5d7e2
commit
5d8469362a
1 changed files with 18 additions and 0 deletions
|
@ -77,6 +77,24 @@ class BackwardsCompatibilityTest(BitcoinTestFramework):
|
|||
return node.chain_path
|
||||
return node.wallets_path
|
||||
|
||||
def split_version(self, node):
|
||||
major = node.version // 10000
|
||||
minor = (node.version % 10000) // 100
|
||||
patch = (node.version % 100)
|
||||
return (major, minor, patch)
|
||||
|
||||
def major_version_equals(self, node, major):
|
||||
node_major, _, _ = self.split_version(node)
|
||||
return node_major == major
|
||||
|
||||
def major_version_less_than(self, node, major):
|
||||
node_major, _, _ = self.split_version(node)
|
||||
return node_major < major
|
||||
|
||||
def major_version_at_least(self, node, major):
|
||||
node_major, _, _ = self.split_version(node)
|
||||
return node_major >= major
|
||||
|
||||
def run_test(self):
|
||||
node_miner = self.nodes[0]
|
||||
node_master = self.nodes[1]
|
||||
|
|
Loading…
Add table
Reference in a new issue