-
Notifications
You must be signed in to change notification settings - Fork 575
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test for Helper bitcoin & used fallback for ripemd160 in helper_bitcoin
- Loading branch information
1 parent
3a04e35
commit c3a6714
Showing
2 changed files
with
35 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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) |