def test_create_identity_from_prikey(self): wm = WalletManager() wm.open_wallet("./test6.json") ide = wm.create_identity_from_prikey( "ide", "1", util.hex_to_bytes( "75de8489fcb2dcaf2ef3cd607feffde18789de7da129b5e97c81e001793cb7cf" )) print(ide)
def test_export_identity_qrcode(self): wm = WalletManager() pwd = "1" identity = wm.create_identity_from_prikey("sss", pwd, util.hex_to_bytes("75de8489fcb2dcaf2ef3cd607feffde18789de7da129b5e97c81e001793cb7cf")) # account = wm.create_random_account("sss2", pwd) wqr = WalletQR() d = wqr.export_identity_qrcode(wm.wallet_file, identity) dstr = json.dumps(d, default=lambda obj: obj.__dict__, sort_keys=True, indent=4) privatekey = wqr.get_prikey_from_qrcode(dstr, pwd) print(privatekey.hex())