Example #1
0
 def test_sign_unsupported_crypto_type(self):
     keypair = Keypair.create_from_private_key(
         ss58_address='16ADqpMa4yzfmWs3nuTSMhfZ2ckeGtvqhPWCNqECEGDcGgU2',
         private_key=
         '0x1f1995bdf3a17b60626a26cfe6f564b337d46056b7a1281b64c649d592ccda0a9cffd34d9fb01cae1fba61aeed184c817442a2186d5172416729a4b54dd4b84e',
         crypto_type=3)
     self.assertRaises(ConfigurationError, keypair.sign, "0x1234")
Example #2
0
 def test_create_keypair_from_private_key(self):
     keypair = Keypair.create_from_private_key(
         ss58_address='16ADqpMa4yzfmWs3nuTSMhfZ2ckeGtvqhPWCNqECEGDcGgU2',
         private_key=
         '0x1f1995bdf3a17b60626a26cfe6f564b337d46056b7a1281b64c649d592ccda0a9cffd34d9fb01cae1fba61aeed184c817442a2186d5172416729a4b54dd4b84e'
     )
     self.assertEqual(
         keypair.public_key,
         '0xe4359ad3e2716c539a1d663ebd0a51bdc5c98a12e663bb4c4402db47828c9446'
     )