Example #1
0
 def test_all(self):
     data = '76  A9  14 89 AB CD EF AB BA AB BA AB BA AB BA AB BA AB BA AB BA AB BA  88 AC'.replace(' ', '').decode('hex')
     self.assertEquals(
         list(script.parse(data)),
         [('UNK_118', None), ('UNK_169', None), ('PUSH', '\x89\xab\xcd\xef\xab\xba\xab\xba\xab\xba\xab\xba\xab\xba\xab\xba\xab\xba\xab\xba'), ('UNK_136', None), ('CHECKSIG', None)],
     )
     self.assertEquals(script.get_sigop_count(data), 1)
Example #2
0
 def test_all(self):
     data = '76  A9  14 89 AB CD EF AB BA AB BA AB BA AB BA AB BA AB BA AB BA AB BA  88 AC'.replace(
         ' ', '').decode('hex')
     self.assertEquals(
         list(script.parse(data)),
         [('UNK_118', None), ('UNK_169', None),
          ('PUSH',
           '\x89\xab\xcd\xef\xab\xba\xab\xba\xab\xba\xab\xba\xab\xba\xab\xba\xab\xba\xab\xba'
           ), ('UNK_136', None), ('CHECKSIG', None)],
     )
     self.assertEquals(script.get_sigop_count(data), 1)
Example #3
0
def parse_bip0034(coinbase):
    _, opdata = script.parse(coinbase).next()
    bignum = pack.IntType(len(opdata)*8).unpack(opdata)
    if ord(opdata[-1]) & 0x80:
        bignum = -bignum
    return (bignum,)
Example #4
0
def parse_bip0034(coinbase):
    _, opdata = script.parse(coinbase).next()
    bignum = deserialize_bignum(opdata, len(opdata))
    if ord(opdata[-1]) & 0x80:
        bignum = -bignum
    return (bignum,)
Example #5
0
def parse_bip0034(coinbase):
    _, opdata = script.parse(coinbase).next()
    bignum = pack.IntType(len(opdata) * 8).unpack(opdata)
    if ord(opdata[-1]) & 0x80:
        bignum = -bignum
    return (bignum, )
Example #6
0
def parse_bip0034(coinbase):
    _, opdata = script.parse(coinbase).next()
    bignum = deserialize_bignum(opdata, len(opdata))
    if ord(opdata[-1]) & 0x80:
        bignum = -bignum
    return (bignum,)