How to use the iroha.helper.logger.debug function in iroha

To help you get started, we’ve selected a few iroha examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github hyperledger / iroha-python / tests / primitive / test_amount.py View on Github external
def test_amount_changer(self):
        logger.info("test_amount_changer")
        logger.setDebug()


        logger.debug(10000000000000000000*100000000000000000000 + 1000)

        num = int(3121092321831273291731287318721973219)
        amnt = amount.int2amount(num, 2)
        logger.debug(amnt)
        re_num = amount.amount2int(amnt)
        self.assertEqual(num,re_num)
github hyperledger / iroha-python / tests / helper / test_stateless_validator.py View on Github external
def test_stateless_validator_signature_ng(self):
        logger.debug("test_stateless_validator_signature_ng")

        create_ac = Command.CreateAccount(
            account_name = "rihito",
            domain_id = "light.wing",
            main_pubkey = self.keypair.public_key
        )
        payload = Transaction.Payload(
            commands = [
                Command(create_account = create_ac)
            ],
            creator_account_id = self.creator,
            tx_counter = self.tx_counter,
            created_time = crypto.now()
        )
        payload2 = Transaction.Payload(
            commands = [
github hyperledger / iroha-python / tests / primitive / test_signatories.py View on Github external
def setUp(self):
        logger.setDebug()
        logger.debug("PrimitiveTest")
github hyperledger / iroha-python / iroha / query / response.py View on Github external
def account_asset(self):
        logger.debug("Response.account_asset")
        if self.has_account_asset():
            return self.response.payload.account_assets_response.account_asset
        else:
            raise NotAccountAssetResponseException
github hyperledger / iroha-python / iroha / query / query.py View on Github external
def set_connection(self,connection):
        """
        Set connection used to connect iroha

        Args:
            connection ( `Connection` ) : connection used to connect iroha
        """
        logger.debug("Query.set_counnection")
        self.connection = connection
github hyperledger / iroha-python / iroha / creator.py View on Github external
def create_tx(self):
        """
        Create Transaction

        Returns:
            `Transaction`: created transaction with added signatory, account_id, time stamp, and connection
        """
        logger.debug("Creator.create_tx")
        retx = Transaction()
        if self.connection:
            retx.set_connection(self.connection)
        if self.signatories:
            retx.add_key_pairs(self.signatories)
        if self.creator_account_id:
            retx.set_creator_account_id(self.creator_account_id)
        # TODO It has not deceided yet
        retx.set_tx_counter(0)
        retx.time_stamp()
        return retx
github hyperledger / iroha-python / iroha / primitive / signatories.py View on Github external
def sign(self,tx):
        logger.debug("Signatories.sign")
        payload = tx.payload
        for signatory in self.signatories:
            if not [ signature for signature in tx.signatures if signature.pubkey == signatory.public_key ]:
                tx.signatures.extend([
                    Signature(
                        pubkey = signatory.public_key,
                        signature = crypto.sign(signatory, crypto.sign_hash(payload))
                    )
github hyperledger / iroha-python / iroha / query / query.py View on Github external
def set_creator_account_id(self,creator_account_id):
        """
        Set creator of this query.

        Args:
            creator_account_id (str) : it is creator's account id of query
        """
        logger.debug("Query.set_creator_account_id")
        self.query.payload.creator_account_id = creator_account_id
github hyperledger / iroha-python / iroha / query / response.py View on Github external
def has_transactions(self):
        logger.debug("Response.has_transactions")
        return self.response.payload.HasField("transactions_response")
github hyperledger / iroha-python / iroha / query / response.py View on Github external
def has_account_asset(self):
        logger.debug("Response.has_account_asset")
        return self.response.payload.HasField("account_assets_response")