Changeset View
Changeset View
Standalone View
Standalone View
qa/rpc-tests/wallet.py
Show All 31 Lines | class WalletTest (BitcoinTestFramework): | ||||
def run_test(self): | def run_test(self): | ||||
# Check that there's no UTXO on none of the nodes | # Check that there's no UTXO on none of the nodes | ||||
assert_equal(len(self.nodes[0].listunspent()), 0) | assert_equal(len(self.nodes[0].listunspent()), 0) | ||||
assert_equal(len(self.nodes[1].listunspent()), 0) | assert_equal(len(self.nodes[1].listunspent()), 0) | ||||
assert_equal(len(self.nodes[2].listunspent()), 0) | assert_equal(len(self.nodes[2].listunspent()), 0) | ||||
print("Mining blocks...") | self.log.info("Mining blocks...") | ||||
self.nodes[0].generate(1) | self.nodes[0].generate(1) | ||||
walletinfo = self.nodes[0].getwalletinfo() | walletinfo = self.nodes[0].getwalletinfo() | ||||
assert_equal(walletinfo['immature_balance'], 50) | assert_equal(walletinfo['immature_balance'], 50) | ||||
assert_equal(walletinfo['balance'], 0) | assert_equal(walletinfo['balance'], 0) | ||||
self.sync_all() | self.sync_all() | ||||
▲ Show 20 Lines • Show All 301 Lines • ▼ Show 20 Lines | def run_test(self): | ||||
'-reindex', | '-reindex', | ||||
'-zapwallettxes=1', | '-zapwallettxes=1', | ||||
'-zapwallettxes=2', | '-zapwallettxes=2', | ||||
# disabled until issue is fixed: https://github.com/bitcoin/bitcoin/issues/7463 | # disabled until issue is fixed: https://github.com/bitcoin/bitcoin/issues/7463 | ||||
# '-salvagewallet', | # '-salvagewallet', | ||||
] | ] | ||||
chainlimit = 6 | chainlimit = 6 | ||||
for m in maintenance: | for m in maintenance: | ||||
print("check " + m) | self.log.info("check " + m) | ||||
stop_nodes(self.nodes) | stop_nodes(self.nodes) | ||||
# set lower ancestor limit for later | # set lower ancestor limit for later | ||||
self.nodes = start_nodes(3, self.options.tmpdir, | self.nodes = start_nodes(3, self.options.tmpdir, | ||||
[[m, "-limitancestorcount=" + str(chainlimit)]] * 3) | [[m, "-limitancestorcount=" + str(chainlimit)]] * 3) | ||||
while m == '-reindex' and [block_count] * 3 != [self.nodes[i].getblockcount() for i in range(3)]: | while m == '-reindex' and [block_count] * 3 != [self.nodes[i].getblockcount() for i in range(3)]: | ||||
# reindex will leave rpc warm up "early"; Wait for it to finish | # reindex will leave rpc warm up "early"; Wait for it to finish | ||||
time.sleep(0.1) | time.sleep(0.1) | ||||
assert_equal( | assert_equal( | ||||
▲ Show 20 Lines • Show All 76 Lines • Show Last 20 Lines |