How to use iroha - 10 common examples

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-archives / iroha / test / load / locustfile-performance.py View on Github external
def send_tx(self):
            iroha = Iroha('admin@test')

            tx = iroha.transaction([iroha.command(
                'TransferAsset', src_account_id='admin@test', dest_account_id='test@test', asset_id='coin#test',
                amount='0.01', description=HOSTNAME
            )])
            ic.sign_transaction(tx, ADMIN_PRIVATE_KEY)
            self.client.send_tx_await(tx)
github hyperledger-archives / iroha / test / load / locustfile-performance.py View on Github external
def send_tx(self):
            iroha = Iroha('admin@test')

            tx = iroha.transaction([iroha.command(
                'TransferAsset', src_account_id='admin@test', dest_account_id='test@test', asset_id='coin#test',
                amount='0.01', description=HOSTNAME
            )])
            ic.sign_transaction(tx, ADMIN_PRIVATE_KEY)
            self.client.send_tx_await(tx)
github hyperledger / iroha-python / tests / query / test_request.py View on Github external
def test_request_get_account_asset(self):
        logger.info("test_request_get_account_asset")
        req = GetAccountAssets(
            account_id = "test@test",
            asset_id = "test/test"
        )
        payload = Query.Payload()
        wrap_query(payload,req)
        self.assertEqual(payload,Query.Payload(
            get_account_assets = req
        ))
github hyperledger / iroha-python / tests / network / test_connection.py View on Github external
def setUp(self):
        logger.setDebug()
        logger.info("ConnectionTest")
github hyperledger / iroha-python / tests / helper / test_crypt.py View on Github external
def test_sign_hash(self):
        hash = crypto.sign_hash(self.tx.payload)

        logger.info(hash)
        logger.info(crypto.b64encode(hash))

        sign = crypto.sign(self.keypair,hash)

        logger.info(sign)

        is_verify = crypto.verify(self.keypair.public_key,sign,hash)

        logger.info(is_verify)
        self.assertTrue(is_verify)
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 / tests / test_creator.py View on Github external
def setUp(self):
        logger.setDebug()
        logger.info("CreatorTest")