Beispiel #1
0
class BitcoinKeypairTest(unittest.TestCase):
    reference = _reference_info

    def setUp(self):
        self.keypair = BitcoinKeypair(self.reference['hex_private_key'])

    def tearDown(self):
        pass

    def test_hex_private_key(self):
        self.assertEqual(
            self.keypair.private_key(), self.reference['hex_private_key'])

    def test_wif_private_key(self):
        self.assertEqual(
            self.keypair.wif_pk(), self.reference['wif_private_key'])

    def test_address(self):
        self.assertEqual(
            self.keypair.address(), self.reference['address'])

    def test_hex_hash160(self):
        self.assertEqual(self.keypair.hash160(), self.reference['hex_hash160'])

    def test_public_key(self):
        self.assertEqual(
            self.keypair.public_key(), self.reference['hex_public_key'])
Beispiel #2
0
class BitcoinKeypairTest(unittest.TestCase):
    reference = _reference_info

    def setUp(self):
        self.keypair = BitcoinKeypair(self.reference['hex_private_key'])

    def tearDown(self):
        pass

    def test_hex_private_key(self):
        self.assertEqual(self.keypair.private_key(),
                         self.reference['hex_private_key'])

    def test_wif_private_key(self):
        self.assertEqual(self.keypair.wif_pk(),
                         self.reference['wif_private_key'])

    def test_address(self):
        self.assertEqual(self.keypair.address(), self.reference['address'])

    def test_hex_hash160(self):
        self.assertEqual(self.keypair.hash160(), self.reference['hex_hash160'])

    def test_public_key(self):
        self.assertEqual(self.keypair.public_key(),
                         self.reference['hex_public_key'])
Beispiel #3
0
class RandomBitcoinKeypairsTest(unittest.TestCase):
    def setUp(self):
        self.keypair = BitcoinKeypair()
        self.brainwallet_keypair = BitcoinKeypair.from_passphrase()

    def tearDown(self):
        pass

    def test_keypair(self):
        # self.assertTrue(is_256bit_hex_string(self.keypair.private_key()))
        # self.assertTrue(is_wif_pk(self.keypair.wif_pk()))
        self.assertTrue(is_b58check_address(self.keypair.address()))

    def test_brainwallet_keypair(self):
        self.assertTrue(len(self.brainwallet_keypair.passphrase().split()) > 1)
Beispiel #4
0
class RandomBitcoinKeypairsTest(unittest.TestCase):
    def setUp(self):
        self.keypair = BitcoinKeypair()
        self.brainwallet_keypair = BitcoinKeypair.from_passphrase()

    def tearDown(self):
        pass

    def test_keypair(self):
        # self.assertTrue(is_256bit_hex_string(self.keypair.private_key()))
        # self.assertTrue(is_wif_pk(self.keypair.wif_pk()))
        self.assertTrue(is_b58check_address(self.keypair.address()))

    def test_brainwallet_keypair(self):
        self.assertTrue(len(self.brainwallet_keypair.passphrase().split()) > 1)