This interface is used to get the corresponding smart contract event based on the height of block.

        :param tx_hash: a hexadecimal hash value.
        :param is_full:
        :return: the information of smart contract event in dictionary form.
505037
def get_smart_contract_event_by_tx_hash(self, tx_hash: str, is_full: bool = False) -> dict:
        
        payload = self.generate_json_rpc_payload(RpcMethod.GET_SMART_CONTRACT_EVENT, [tx_hash, 1])
        response = self.__post(self.__url, payload)
        if is_full:
            return response
        return response['result']
1345962
def get_by_contract(self, contract_hash):
        
        hash = contract_hash
        if isinstance(contract_hash, str) and len(contract_hash) == 40:
            hash = UInt160.ParseString(contract_hash)

        if not isinstance(hash, UInt160):
            raise Exception("Incorrect address format")

        contractlist_snapshot = self.db.prefixed_db(NotificationPrefix.PREFIX_CONTRACT).snapshot()
        results = []

        for val in contractlist_snapshot.iterator(prefix=bytes(hash.Data), include_key=False):
            if len(val) > 4:
                try:
                    event = SmartContractEvent.FromByteArray(val)
                    results.append(event)
                except Exception as e:
                    logger.error("could not parse event: %s %s" % (e, val))
        return results
135392
def tx_for_tx_hash(self, tx_hash):
        
        try:
            url_append = "?token=%s&includeHex=true" % self.api_key
            url = self.base_url("txs/%s%s" % (b2h_rev(tx_hash), url_append))
            result = json.loads(urlopen(url).read().decode("utf8"))
            tx = Tx.parse(io.BytesIO(h2b(result.get("hex"))))
            return tx
        except Exception:
            raise Exception
122654
def update_txn_with_extra_data(self, txn):
        
        # For RAW and ENC attributes, only hash is stored in the ledger.
        if get_type(txn) == ATTRIB:
            txn_data = get_payload_data(txn)
            # The key needs to be present and not None
            key = RAW if (RAW in txn_data and txn_data[RAW] is not None) else \
                ENC if (ENC in txn_data and txn_data[ENC] is not None) else None
            if key:
                txn_data[key] = self.attributeStore.get(txn_data[key])
        return txn
1300811
def blockstack_tx_filter( tx ):
    
    if not 'nulldata' in tx:
        return False
    
    if tx['nulldata'] is None:
        return False

    payload = binascii.unhexlify( tx['nulldata'] )
    if payload.startswith(blockstack_magic_bytes()):
        return True

    else:
        return False
1155002
def find_block(hash)
      blockchain.select{|block| block if block.hash == hash}.first
    end
248156
def _sighash_final_hashing(self, copy_tx, sighash_type):
        '''
        
        '''
        sighash = z.ZcashByteData()
        sighash += copy_tx.to_bytes()
        sighash += utils.i2le_padded(sighash_type, 4)
        return utils.hash256(sighash.to_bytes())
380533
def get_canonical_transaction(self, transaction_hash: Hash32) -> BaseTransaction:
        
        (block_num, index) = self.chaindb.get_transaction_index(transaction_hash)
        VM_class = self.get_vm_class_for_block_number(block_num)

        transaction = self.chaindb.get_transaction_by_index(
            block_num,
            index,
            VM_class.get_transaction_class(),
        )

        if transaction.hash == transaction_hash:
            return transaction
        else:
            raise TransactionNotFound("Found transaction {} instead of {} in block {} at {}".format(
                encode_hex(transaction.hash),
                encode_hex(transaction_hash),
                block_num,
                index,
            ))
1372154
def get_merkle_proof(self, tx_hash: str, is_full: bool = False) -> dict:
        
        payload = self.generate_json_rpc_payload(RpcMethod.GET_MERKLE_PROOF, [tx_hash, 1])
        response = self.__post(self.__url, payload)
        if is_full:
            return response
        return response['result']
984725
def calculate_size(name, txn_id, thread_id, key, value):
    
    data_size = 0
    data_size += calculate_size_str(name)
    data_size += calculate_size_str(txn_id)
    data_size += LONG_SIZE_IN_BYTES
    data_size += calculate_size_data(key)
    data_size += calculate_size_data(value)
    return data_size
610460
def get_block_height(self, is_full: bool = False) -> int or dict:
        
        response = self.get_block_count(is_full=True)
        response['result'] -= 1
        if is_full:
            return response
        return response['result']
946996
def check_tx_sender_types(senders, block_height):
    
    supported_sender_types = get_epoch_btc_sender_types(block_height)
    for sender in senders:
        if len(sender['addresses']) != 1:
            log.warning('Sender has {} addresses'.format(sender['addresses']))
            return False

        out_type = virtualchain.btc_script_classify(sender['script_pubkey'])
        if out_type not in supported_sender_types:
            log.warning('Unsupported sender output type {} ({})'.format(out_type, sender['script_pubkey']))
            return False

    return True
556733
def tx_extend(partial_tx_hex, new_inputs, new_outputs, blockchain='bitcoin', **blockchain_opts):
    
    if blockchain == 'bitcoin':
        return btc_tx_extend(partial_tx_hex, new_inputs, new_outputs, **blockchain_opts)
    else:
        raise ValueError('Unknown blockchain "{}"'.format(blockchain))
639616
def broadcast_transaction(self, hex_tx):
        

        resp = self.obj.sendrawtransaction(hex_tx)
        if len(resp) > 0:
            return {'transaction_hash': resp, 'success': True}
        else:
            return error_reply('Invalid response from bitcoind.')
1078286
def tx_output_has_data(output, blockchain='bitcoin', **blockchain_opts):
    
    if blockchain == 'bitcoin':
        return btc_tx_output_has_data(output, **blockchain_opts)
    else:
        return ValueError('Unknown blockchain "{}"'.format(blockchain))
1350258
def get_secret_registration_block_by_secrethash(
            self,
            secrethash: SecretHash,
            block_identifier: BlockSpecification,
    ) -> Optional[BlockNumber]:
        
        result = self.proxy.contract.functions.getSecretRevealBlockHeight(
            secrethash,
        ).call(block_identifier=block_identifier)

        # Block 0 either represents the genesis block or an empty entry in the
        # secret mapping. This is important for custom genesis files used while
        # testing. To avoid problems the smart contract can be added as part of
        # the genesis file, however it's important for its storage to be
        # empty.
        if result == 0:
            return None

        return result
326766
def standard?
      return false if version > MAX_STANDARD_VERSION
      return false if weight > MAX_STANDARD_TX_WEIGHT
      inputs.each do |i|
        # Biggest 'standard' txin is a 15-of-15 P2SH multisig with compressed keys (remember the 520 byte limit on redeemScript size).
        # That works out to a (15*(33+1))+3=513 byte redeemScript, 513+1+15*(73+1)+3=1627
        # bytes of scriptSig, which we round off to 1650 bytes for some minor future-proofing.
        # That's also enough to spend a 20-of-20 CHECKMULTISIG scriptPubKey, though such a scriptPubKey is not considered standard.
        return false if i.script_sig.size > 1650
        return false unless i.script_sig.push_only?
      end
      data_count = 0
      outputs.each do |o|
        return false unless o.script_pubkey.standard?
        data_count += 1 if o.script_pubkey.op_return?
        # TODO add non P2SH multisig relay(permitbaremultisig)
        # TODO add dust relay check
      end
      return false if data_count > 1
      true
    end