mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-13 12:33:42 +02:00
update functional tests
This commit is contained in:
parent
ef7525a446
commit
d5a756738e
2 changed files with 7 additions and 4 deletions
|
|
@ -87,7 +87,7 @@ class NetTest(BitcoinTestFramework):
|
|||
for node, peer, field in product(range(self.num_nodes), range(2), ['last_block', 'last_transaction']):
|
||||
assert field in peer_info[node][peer].keys()
|
||||
if peer_info[node][peer][field] != 0:
|
||||
assert_approx(peer_info[node][peer][field], time_now, vspan=60)
|
||||
assert_approx(peer_info[node][peer][field], time_now, vspan=100)
|
||||
# check both sides of bidirectional connection between nodes
|
||||
# the address bound to on one side will be the source address for the other node
|
||||
assert_equal(peer_info[0][0]['addrbind'], peer_info[1][0]['addr'])
|
||||
|
|
|
|||
|
|
@ -30,14 +30,17 @@ class WalletTest(BitcoinTestFramework):
|
|||
self.skip_if_no_wallet()
|
||||
|
||||
def run_test(self):
|
||||
self.generate(self.nodes[0], COINBASE_MATURITY + 1)
|
||||
self.generate(self.nodes[0], COINBASE_MATURITY + 10)
|
||||
self.sync_all()
|
||||
|
||||
balance = self.nodes[0].getbalance()
|
||||
assert_equal(balance["bitcoin"],21000000)
|
||||
|
||||
new_addr = self.nodes[1].getnewaddress()
|
||||
self.nodes[0].sendtoaddress(new_addr, 10)
|
||||
self.nodes[0].sendtoaddress(self.nodes[2].getnewaddress(), 20)
|
||||
self.generate(self.nodes[0], 1)
|
||||
assert_equal(self.nodes[0].getblockchaininfo()["blocks"], 102)
|
||||
assert_equal(self.nodes[0].getblockchaininfo()["blocks"], 111)
|
||||
assert_equal(self.nodes[0].getbalance(), {'bitcoin': Decimal('20999969.99900900')})
|
||||
assert_equal(self.nodes[1].getbalance(), {'bitcoin': Decimal('10.00000000')})
|
||||
assert_equal(self.nodes[2].getbalance(), {'bitcoin': Decimal('20.00000000')})
|
||||
|
|
@ -48,7 +51,7 @@ class WalletTest(BitcoinTestFramework):
|
|||
assert_equal(tx["fee"]["bitcoin"], 0)
|
||||
hex = self.nodes[0].getrawtransaction(txid)
|
||||
self.generate(self.nodes[0], 1)
|
||||
assert_equal(self.nodes[0].getblockchaininfo()["blocks"], 103)
|
||||
assert_equal(self.nodes[0].getblockchaininfo()["blocks"], 112)
|
||||
|
||||
decoded = self.nodes[0].decoderawtransaction(hex)
|
||||
# there should be no fee output
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue