def test_stealth_metadata_script(self): nonce = int('deadbeef', 16) script = bc.mk_stealth_metadata_script(self.ephem_pub, nonce) self.assertEqual(script[6:], 'deadbeef' + self.ephem_pub) eph_pub = bc.ephem_pubkey_from_tx_script(script) self.assertEqual(eph_pub, self.ephem_pub)
def get_ephem_pubkey_if_stealth(self, tx_outs): if 'script' in tx_outs[0]: try: return bc.ephem_pubkey_from_tx_script(tx_outs[0]['script']) except: return None else: return None