diff options
author | John Newbery <john@johnnewbery.com> | 2018-04-04 11:43:45 -0400 |
---|---|---|
committer | John Newbery <john@johnnewbery.com> | 2018-05-19 11:16:00 -0400 |
commit | 131d4450b913fa4f00dc8b176dc996d39f786c19 (patch) | |
tree | 5c34c2418b2b92e1804fb70dd78ff4c1fc624da3 /test/functional/wallet_hd.py | |
parent | d792e47421fcb9ce3b381c1e6d8902777ae3f9f3 (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/functional/wallet_hd.py')
-rwxr-xr-x | test/functional/wallet_hd.py | 16 |
1 files changed, 8 insertions, 8 deletions
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 |