Пример #1
0
    def check_tx(self, raw_transaction):
        """Validate the transaction before entry into
        the mempool.

        Args:
            raw_tx: a raw string (in bytes) transaction.
        """

        self.abort_if_abci_chain_is_not_synced()

        logger.debug('check_tx: %s', raw_transaction)
        transaction = decode_transaction(raw_transaction)
        if self.bigchaindb.is_valid_transaction(transaction):
            logger.debug('check_tx: VALID')
            return ResponseCheckTx(code=CodeTypeOk)
        else:
            logger.debug('check_tx: INVALID')
            return ResponseCheckTx(code=CodeTypeError)
Пример #2
0
    def check_tx(self, raw_transaction):
        """Validate the transaction before entry into
        the mempool.

        Args:
            raw_tx: a raw string (in bytes) transaction."""

        logger.benchmark('CHECK_TX_INIT')
        logger.debug('check_tx: %s', raw_transaction)
        transaction = decode_transaction(raw_transaction)
        if self.bigchaindb.is_valid_transaction(transaction):
            logger.debug('check_tx: VALID')
            logger.benchmark('CHECK_TX_END, tx_id:%s', transaction['id'])
            return ResponseCheckTx(code=CodeTypeOk)
        else:
            logger.debug('check_tx: INVALID')
            logger.benchmark('CHECK_TX_END, tx_id:%s', transaction['id'])
            return ResponseCheckTx(code=CodeTypeError)
Пример #3
0
 def check_tx(self, tx):
     return ResponseCheckTx(code=CodeTypeOk, data=tx, log="bueno")
Пример #4
0
 def check_tx(self, raw_transaction):
     return ResponseCheckTx(code=CodeTypeOk)