-
Notifications
You must be signed in to change notification settings - Fork 573
Expand file tree
/
Copy pathtest_helper_bitcoin.py
More file actions
26 lines (21 loc) · 977 Bytes
/
test_helper_bitcoin.py
File metadata and controls
26 lines (21 loc) · 977 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
"""Test for helperbitcoin"""
import unittest
from pybitmessage.helper_bitcoin import (
calculateBitcoinAddressFromPubkey,
calculateTestnetAddressFromPubkey
)
from .samples import sample_pubsigningkey
PUB_SIGNING_KEY = sample_pubsigningkey
# CORRESPONDING BITCONADDRESS AND TESTNET ADDRESS
BITCOINADDRESS = b'1CJQzhGb1Lh4DwDoxbTSZbTkSq2zJ7LAK7'
TESTNETADDRESS = b'mrpNHkMZpN8K13hRgARpPWg5JpdhDVUVGA'
class TestHelperBitcoin(unittest.TestCase):
"""Test class for ObjectProcessor"""
def test_calculateBitcoinAddressFromPubkey(self):
"""Test calculateBitcoinAddressFromPubkey"""
bitcoinAddress = calculateBitcoinAddressFromPubkey(PUB_SIGNING_KEY)
self.assertEqual(bitcoinAddress, BITCOINADDRESS)
def test_calculateTestnetAddressFromPubkey(self):
"""Test calculateTestnetAddressFromPubkey"""
testnetAddress = calculateTestnetAddressFromPubkey(PUB_SIGNING_KEY)
self.assertEqual(testnetAddress, TESTNETADDRESS)