diff options
author | Jonas Schnelli <dev@jonasschnelli.ch> | 2017-01-17 08:55:30 +0100 |
---|---|---|
committer | Jonas Schnelli <dev@jonasschnelli.ch> | 2017-03-24 10:28:39 +0100 |
commit | 79df9df3482d71391dee1dd59054aed8f7bbfa6b (patch) | |
tree | 6fcfc3d7002941d921faf4ee5c4c0440e1fcce46 /test | |
parent | bcafca1077cf789ba79d16501a8cbb5d692bf8e6 (diff) |
Switch to 100% for the HD internal keypool size
Diffstat (limited to 'test')
-rwxr-xr-x | test/functional/fundrawtransaction.py | 1 | ||||
-rwxr-xr-x | test/functional/keypool.py | 10 | ||||
-rwxr-xr-x | test/functional/wallet-dump.py | 6 |
3 files changed, 10 insertions, 7 deletions
diff --git a/test/functional/fundrawtransaction.py b/test/functional/fundrawtransaction.py index a28ff94655..6bb7d7f334 100755 --- a/test/functional/fundrawtransaction.py +++ b/test/functional/fundrawtransaction.py @@ -468,7 +468,6 @@ class RawTransactionsTest(BitcoinTestFramework): # drain the keypool self.nodes[1].getnewaddress() self.nodes[1].getrawchangeaddress() - self.nodes[1].getrawchangeaddress() inputs = [] outputs = {self.nodes[0].getnewaddress():1.1} rawTx = self.nodes[1].createrawtransaction(inputs, outputs) diff --git a/test/functional/keypool.py b/test/functional/keypool.py index 26585fc4ad..cb9ab688d1 100755 --- a/test/functional/keypool.py +++ b/test/functional/keypool.py @@ -29,17 +29,21 @@ class KeyPoolTest(BitcoinTestFramework): assert(addr_data['hdmasterkeyid'] == wallet_info['hdmasterkeyid']) assert_raises_jsonrpc(-12, "Error: Keypool ran out, please call keypoolrefill first", nodes[0].getnewaddress) - # put six (plus 2) new keys in the keypool (100% external-, +20% internal-keys, 2 in min) + # put six (plus 2) new keys in the keypool (100% external-, +100% internal-keys, 1 in min) nodes[0].walletpassphrase('test', 12000) nodes[0].keypoolrefill(6) nodes[0].walletlock() wi = nodes[0].getwalletinfo() - assert_equal(wi['keypoolsize_hd_internal'], 2) + assert_equal(wi['keypoolsize_hd_internal'], 6) assert_equal(wi['keypoolsize'], 6) # drain the internal keys nodes[0].getrawchangeaddress() nodes[0].getrawchangeaddress() + nodes[0].getrawchangeaddress() + nodes[0].getrawchangeaddress() + nodes[0].getrawchangeaddress() + nodes[0].getrawchangeaddress() addr = set() # the next one should fail assert_raises_jsonrpc(-12, "Keypool ran out", nodes[0].getrawchangeaddress) @@ -72,7 +76,7 @@ class KeyPoolTest(BitcoinTestFramework): nodes[0].walletpassphrase('test', 100) nodes[0].keypoolrefill(100) wi = nodes[0].getwalletinfo() - assert_equal(wi['keypoolsize_hd_internal'], 20) + assert_equal(wi['keypoolsize_hd_internal'], 100) assert_equal(wi['keypoolsize'], 100) def __init__(self): diff --git a/test/functional/wallet-dump.py b/test/functional/wallet-dump.py index 7eaa8090b5..8876f935a4 100755 --- a/test/functional/wallet-dump.py +++ b/test/functional/wallet-dump.py @@ -88,7 +88,7 @@ class WalletDumpTest(BitcoinTestFramework): read_dump(tmpdir + "/node0/wallet.unencrypted.dump", addrs, None) assert_equal(found_addr, test_addr_count) # all keys must be in the dump assert_equal(found_addr_chg, 50) # 50 blocks where mined - assert_equal(found_addr_rsv, 90*1.2) # 90 keys plus 20% internal keys + assert_equal(found_addr_rsv, 90*2) # 90 keys plus 100% internal keys #encrypt wallet, restart, unlock and dump self.nodes[0].encryptwallet('test') @@ -102,8 +102,8 @@ class WalletDumpTest(BitcoinTestFramework): found_addr, found_addr_chg, found_addr_rsv, hd_master_addr_enc = \ read_dump(tmpdir + "/node0/wallet.encrypted.dump", addrs, hd_master_addr_unenc) assert_equal(found_addr, test_addr_count) - assert_equal(found_addr_chg, 90*1.2 + 50) # old reserve keys are marked as change now - assert_equal(found_addr_rsv, 90*1.2) + assert_equal(found_addr_chg, 90*2 + 50) # old reserve keys are marked as change now + assert_equal(found_addr_rsv, 90*2) if __name__ == '__main__': WalletDumpTest().main () |