aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJohn Newbery <john@johnnewbery.com>2018-04-04 11:43:45 -0400
committerJohn Newbery <john@johnnewbery.com>2018-05-19 11:16:00 -0400
commit131d4450b913fa4f00dc8b176dc996d39f786c19 (patch)
tree5c34c2418b2b92e1804fb70dd78ff4c1fc624da3 /test
parentd792e47421fcb9ce3b381c1e6d8902777ae3f9f3 (diff)
scripted-diff: Rename master key to seed
-BEGIN VERIFY SCRIPT- ren() { git grep -l "\<$1\>" 'src/*.cpp' 'src/*.h' test | xargs sed -i "s:\<$1\>:$2:g"; } ren GenerateNewHDMasterKey GenerateNewSeed ren DeriveNewMasterHDKey DeriveNewSeed ren SetHDMasterKey SetHDSeed ren hdMasterKeyID hd_seed_id ren masterKeyID seed_id ren SetMaster SetSeed ren hdmasterkeyid hdseedid ren hdmaster hdseed -END VERIFY SCRIPT-
Diffstat (limited to 'test')
-rwxr-xr-xtest/functional/wallet_dump.py2
-rwxr-xr-xtest/functional/wallet_hd.py16
-rwxr-xr-xtest/functional/wallet_keypool.py6
3 files changed, 12 insertions, 12 deletions
diff --git a/test/functional/wallet_dump.py b/test/functional/wallet_dump.py
index 01d27dabe7..6c2590812b 100755
--- a/test/functional/wallet_dump.py
+++ b/test/functional/wallet_dump.py
@@ -39,7 +39,7 @@ def read_dump(file_name, addrs, script_addrs, hd_master_addr_old):
if keytype == "inactivehdmaster=1":
# ensure the old master is still available
assert(hd_master_addr_old == addr)
- elif keytype == "hdmaster=1":
+ elif keytype == "hdseed=1":
# ensure we have generated a new hd master key
assert(hd_master_addr_old != addr)
hd_master_addr_ret = addr
diff --git a/test/functional/wallet_hd.py b/test/functional/wallet_hd.py
index 97a945721f..afc20c5a91 100755
--- a/test/functional/wallet_hd.py
+++ b/test/functional/wallet_hd.py
@@ -29,7 +29,7 @@ class WalletHDTest(BitcoinTestFramework):
connect_nodes_bi(self.nodes, 0, 1)
# Make sure we use hd, keep masterkeyid
- masterkeyid = self.nodes[1].getwalletinfo()['hdmasterkeyid']
+ masterkeyid = self.nodes[1].getwalletinfo()['hdseedid']
assert_equal(len(masterkeyid), 40)
# create an internal key
@@ -54,7 +54,7 @@ class WalletHDTest(BitcoinTestFramework):
hd_add = self.nodes[1].getnewaddress()
hd_info = self.nodes[1].getaddressinfo(hd_add)
assert_equal(hd_info["hdkeypath"], "m/0'/0'/"+str(i)+"'")
- assert_equal(hd_info["hdmasterkeyid"], masterkeyid)
+ assert_equal(hd_info["hdseedid"], masterkeyid)
self.nodes[0].sendtoaddress(hd_add, 1)
self.nodes[0].generate(1)
self.nodes[0].sendtoaddress(non_hd_add, 1)
@@ -83,7 +83,7 @@ class WalletHDTest(BitcoinTestFramework):
hd_add_2 = self.nodes[1].getnewaddress()
hd_info_2 = self.nodes[1].getaddressinfo(hd_add_2)
assert_equal(hd_info_2["hdkeypath"], "m/0'/0'/"+str(i)+"'")
- assert_equal(hd_info_2["hdmasterkeyid"], masterkeyid)
+ assert_equal(hd_info_2["hdseedid"], masterkeyid)
assert_equal(hd_add, hd_add_2)
connect_nodes_bi(self.nodes, 0, 1)
self.sync_all()
@@ -122,9 +122,9 @@ class WalletHDTest(BitcoinTestFramework):
assert_equal(keypath[0:7], "m/0'/1'")
# Generate a new HD seed on node 1 and make sure it is set
- orig_masterkeyid = self.nodes[1].getwalletinfo()['hdmasterkeyid']
+ orig_masterkeyid = self.nodes[1].getwalletinfo()['hdseedid']
self.nodes[1].sethdseed()
- new_masterkeyid = self.nodes[1].getwalletinfo()['hdmasterkeyid']
+ new_masterkeyid = self.nodes[1].getwalletinfo()['hdseedid']
assert orig_masterkeyid != new_masterkeyid
addr = self.nodes[1].getnewaddress()
assert_equal(self.nodes[1].getaddressinfo(addr)['hdkeypath'], 'm/0\'/0\'/0\'') # Make sure the new address is the first from the keypool
@@ -134,16 +134,16 @@ class WalletHDTest(BitcoinTestFramework):
new_seed = self.nodes[0].dumpprivkey(self.nodes[0].getnewaddress())
orig_masterkeyid = new_masterkeyid
self.nodes[1].sethdseed(False, new_seed)
- new_masterkeyid = self.nodes[1].getwalletinfo()['hdmasterkeyid']
+ new_masterkeyid = self.nodes[1].getwalletinfo()['hdseedid']
assert orig_masterkeyid != new_masterkeyid
addr = self.nodes[1].getnewaddress()
- assert_equal(orig_masterkeyid, self.nodes[1].getaddressinfo(addr)['hdmasterkeyid'])
+ assert_equal(orig_masterkeyid, self.nodes[1].getaddressinfo(addr)['hdseedid'])
assert_equal(self.nodes[1].getaddressinfo(addr)['hdkeypath'], 'm/0\'/0\'/1\'') # Make sure the new address continues previous keypool
# Check that the next address is from the new seed
self.nodes[1].keypoolrefill(1)
next_addr = self.nodes[1].getnewaddress()
- assert_equal(new_masterkeyid, self.nodes[1].getaddressinfo(next_addr)['hdmasterkeyid'])
+ assert_equal(new_masterkeyid, self.nodes[1].getaddressinfo(next_addr)['hdseedid'])
assert_equal(self.nodes[1].getaddressinfo(next_addr)['hdkeypath'], 'm/0\'/0\'/0\'') # Make sure the new address is not from previous keypool
assert next_addr != addr
diff --git a/test/functional/wallet_keypool.py b/test/functional/wallet_keypool.py
index 505014e48f..66d382e4cd 100755
--- a/test/functional/wallet_keypool.py
+++ b/test/functional/wallet_keypool.py
@@ -16,7 +16,7 @@ class KeyPoolTest(BitcoinTestFramework):
addr_before_encrypting = nodes[0].getnewaddress()
addr_before_encrypting_data = nodes[0].getaddressinfo(addr_before_encrypting)
wallet_info_old = nodes[0].getwalletinfo()
- assert(addr_before_encrypting_data['hdmasterkeyid'] == wallet_info_old['hdmasterkeyid'])
+ assert(addr_before_encrypting_data['hdseedid'] == wallet_info_old['hdseedid'])
# Encrypt wallet and wait to terminate
nodes[0].node_encrypt_wallet('test')
@@ -26,8 +26,8 @@ class KeyPoolTest(BitcoinTestFramework):
addr = nodes[0].getnewaddress()
addr_data = nodes[0].getaddressinfo(addr)
wallet_info = nodes[0].getwalletinfo()
- assert(addr_before_encrypting_data['hdmasterkeyid'] != wallet_info['hdmasterkeyid'])
- assert(addr_data['hdmasterkeyid'] == wallet_info['hdmasterkeyid'])
+ assert(addr_before_encrypting_data['hdseedid'] != wallet_info['hdseedid'])
+ assert(addr_data['hdseedid'] == wallet_info['hdseedid'])
assert_raises_rpc_error(-12, "Error: Keypool ran out, please call keypoolrefill first", nodes[0].getnewaddress)
# put six (plus 2) new keys in the keypool (100% external-, +100% internal-keys, 1 in min)