added test for create extended public key from parent private/public key
This commit is contained in:
parent
1affa4a258
commit
0cce0b70cc
@ -24,3 +24,14 @@ def master_key_hdwallet():
|
||||
finger_print=b'\x00\x00\x00\x00',
|
||||
chain_code=b'B\xa8\xe9v>y\xe2\x82\x10\x80\xc2\xa91\x10E\xe0XJ\xe6\xc7\x18\x9eE~\xa0^\xd1\x820\xe7\x18\x0c',
|
||||
is_private=True)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def public_key_hdwallet():
|
||||
return dict(version=b'\x04\x88\xB2\x1E',
|
||||
key=b"Y\x9e'\xe00or'\xacD\x9c(l\x99\x0fxB\x03\xbd/]|+\xfd\xe89K!\x93\x0bN\x9b",
|
||||
depth=0,
|
||||
child=0,
|
||||
finger_print=b'\x00\x00\x00\x00',
|
||||
chain_code=b'B\xa8\xe9v>y\xe2\x82\x10\x80\xc2\xa91\x10E\xe0XJ\xe6\xc7\x18\x9eE~\xa0^\xd1\x820\xe7\x18\x0c',
|
||||
is_private=False)
|
||||
|
||||
@ -56,4 +56,15 @@ def test_serialize_key(master_key_hdwallet):
|
||||
serialize_key = serialize_key_hdwallet(master_key_hdwallet)
|
||||
assert serialize_key is not None
|
||||
assert type(serialize_key) is bytes
|
||||
assert len(serialize_key) == 82
|
||||
assert len(serialize_key[:-4]) == 78
|
||||
|
||||
|
||||
def test_create_expanded_key(master_key_hdwallet, public_key_hdwallet):
|
||||
result = create_expanded_key(b'asdasdasd', 0)
|
||||
assert result is None
|
||||
result = create_expanded_key(master_key_hdwallet, 0)
|
||||
assert result is not None
|
||||
assert len(result) == 64
|
||||
result = create_expanded_key(public_key_hdwallet, 0)
|
||||
assert result is not None
|
||||
assert len(result) == 64
|
||||
|
||||
Loading…
Reference in New Issue
Block a user