pybit/py3/block.py
def split_script(pk_op) -> list:
        """
        Split pk script into list of component data and OP_CODES, expects hex
        """

        # Create list to store output script
        script = []
        # Use cursor to track position in string
        cur = 0
        # Loop over raw script - increments 4 bytes each iteration
        # unless instructed otherwise
        while cur < len(pk_op):
            # Get the next 4 bytes
            # Convert to int in base 16
            op = int(pk_op[cur:cur+2], 16)

            # Incremenet the cursor by 4 bytes
            cur += 2

            # If the code is between 1-75, it's a number of bytes
            # to add to stack
            if (op >= 1) & (op <= 75):
                # Get these and add these to script
                script += ['PUSH_BYTES', op, pk_op[cur:cur+op * 2]]
                cur += op * 2
            else:
                # Otherwise, get the OP_CODE from the dictionary
                # If it's for an undefined code, return the code number
                script += [OP_CODES.get(op, op)]

        return script

        Split pk script into list of component data and OP_CODES, expects hex
        
Split pk script into list of component data and OP_CODES, expects hex
Split pk script into list of component data and OP_CODES expects hex
def split_script(pk_op) -> list:
        script = []
        cur = 0
        while cur < len(pk_op):
            op = int(pk_op[cur:cur+2], 16)
            cur += 2
            if (op >= 1) & (op <= 75):
                script += ['PUSH_BYTES', op, pk_op[cur:cur+op * 2]]
                cur += op * 2
            else:
                script += [OP_CODES.get(op, op)]
        return script
def split_script ( pk_op ) -> list : script = [ ] cur = 0 while cur < len ( pk_op ) : op = int ( pk_op [ cur : cur + 2 ] , 16 ) cur += 2 if ( op >= 1 ) & ( op <= 75 ) : script += [ 'PUSH_BYTES' , op , pk_op [ cur : cur + op * 2 ] ] cur += op * 2 else : script += [ OP_CODES . get ( op , op ) ] return script
Split pk script into list of component data and OP_CODES, expects hex
Split pk script into list of component data and OP_CODES expects hex
"""
        Split pk script into list of component data and OP_CODES, expects hex
        """ # Create list to store output script # Use cursor to track position in string # Loop over raw script - increments 4 bytes each iteration # unless instructed otherwise # Get the next 4 bytes # Convert to int in base 16 # Incremenet the cursor by 4 bytes # If the code is between 1-75, it's a number of bytes # to add to stack # Get these and add these to script # Otherwise, get the OP_CODE from the dictionary # If it's for an undefined code, return the code number
pk_op