Exemplo n.º 1
0
def test_pub():
    for (_priv, _pub) in zip([PRIV, PRIV_1, PRIV_2], [PUB, PUB_1, PUB_2]):
        decoded = decode_privkey(_priv)
        pub = gen_pub_key(decoded)
        raw_pub = base58.b58decode(_pub[3:]).hex()
        raw_PUB = base58.b58decode(_pub[3:]).hex()
        assert raw_PUB == raw_pub
        assert _pub == pub
Exemplo n.º 2
0
def test_addr():
    decoded = decode_privkey(PRIV_3)
    encoded = encode_privkey(decoded)
    assert PRIV_3 == encoded
    pub = gen_pub_key(decoded)
    assert PUB_3 == pub
    addr = gen_address_from_priv(decoded)
    assert ADDR_3 == addr
Exemplo n.º 3
0
def test_priv():
    for p in [PRIV, PRIV_1, PRIV_2]:
        decoded = decode_privkey(p)
        encoded = encode_privkey(decoded)
        assert p == encoded