예제 #1
0
 def test_script_type_pay_to_public_pair(self):
     for se in range(1, 100):
         key = Key(secret_exponent=se)
         for b in [True, False]:
             st = ScriptPayToPublicKey.from_key(key, use_uncompressed=b)
             addr = key.address(use_uncompressed=b)
             self.assertEqual(st.address(), addr)
             sc = st.script()
             st = script_obj_from_script(sc)
             self.assertEqual(st.address(), addr)
예제 #2
0
 def test_script_type_pay_to_public_pair(self):
     for se in range(1, 100):
         key = Key(secret_exponent=se)
         for b in [True, False]:
             st = ScriptPayToPublicKey.from_key(key, use_uncompressed=b)
             addr = key.address(use_uncompressed=b)
             self.assertEqual(st.address(), addr)
             sc = st.script()
             st = script_obj_from_script(sc)
             self.assertEqual(st.address(), addr)
예제 #3
0
 def test_solve_pay_to_public_pair(self):
     for se in range(1, 10):
         key = Key(secret_exponent=se)
         for b in [True, False]:
             addr = key.address(use_uncompressed=b)
             st = ScriptPayToPublicKey.from_key(key, use_uncompressed=b)
             self.assertEqual(st.address(), addr)
             hl = build_hash160_lookup([se])
             sv = 100
             solution = st.solve(hash160_lookup=hl, sign_value=sv, signature_type=SIGHASH_ALL)
             sc = st.script()
             st = script_obj_from_script(sc)
             self.assertEqual(st.address(), addr)
예제 #4
0
 def test_solve_pay_to_public_pair(self):
     for se in range(1, 10):
         key = Key(secret_exponent=se)
         for b in [True, False]:
             addr = key.address(use_uncompressed=b)
             st = ScriptPayToPublicKey.from_key(key, use_uncompressed=b)
             self.assertEqual(st.address(), addr)
             hl = build_hash160_lookup([se])
             sv = 100
             solution = st.solve(hash160_lookup=hl, sign_value=sv, signature_type=SIGHASH_ALL)
             sc = st.script()
             st = script_obj_from_script(sc)
             self.assertEqual(st.address(), addr)