How to use the iroha.helper.stateless_validator.command 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 / helper / test_stateless_validator.py View on Github external
src_account_id="chika@ichigo.mashimaro",
                dest_account_id="miu@ichigo.mashimaro",
                asset_id="ichigo.mashimaro/yen",
                amount=int2amount(100)
            )
        )
        self.assertTrue(stateless_validator.command(transfer_as))
        transfer_as = Command(
            transfer_asset = Command.TransferAsset(
                src_account_id="chika@ichigo.mashimaro",
                dest_account_id="miu@ichigo.mashimaro",
                asset_id="ichigo.mashimaro/yen",
                amount=int2amount(0)
            )
        )
        self.assertFalse(stateless_validator.command(transfer_as))
github hyperledger / iroha-python / tests / helper / test_stateless_validator.py View on Github external
def test_stateless_validator_add_asset_quantity(self):
        add_asset_q = Command(
            add_asset_quantity = Command.AddAssetQuantity(
                account_id="chika@ichigo.mashimaro",
                asset_id="ichigo.mashimaro/yen",
                amount=int2amount(100)
            )
        )
        self.assertTrue(stateless_validator.command(add_asset_q))
        add_asset_q = Command(
            add_asset_quantity = Command.AddAssetQuantity(
                account_id="chika@ichigo.mashimaro",
                asset_id="ichigo.mashimaro/",
                amount=int2amount(100)
            )
        )
        self.assertFalse(stateless_validator.command(add_asset_q))
github hyperledger / iroha-python / tests / helper / test_stateless_validator.py View on Github external
def test_stateless_validator_transfer_asset(self):
        transfer_as = Command(
            transfer_asset = Command.TransferAsset(
                src_account_id="chika@ichigo.mashimaro",
                dest_account_id="miu@ichigo.mashimaro",
                asset_id="ichigo.mashimaro/yen",
                amount=int2amount(100)
            )
        )
        self.assertTrue(stateless_validator.command(transfer_as))
        transfer_as = Command(
            transfer_asset = Command.TransferAsset(
                src_account_id="chika@ichigo.mashimaro",
                dest_account_id="miu@ichigo.mashimaro",
                asset_id="ichigo.mashimaro/yen",
                amount=int2amount(0)
            )
        )
        self.assertFalse(stateless_validator.command(transfer_as))
github hyperledger / iroha-python / tests / helper / test_stateless_validator.py View on Github external
def test_stateless_validator_create_domain(self):
        create_d = Command(
            create_domain = Command.CreateDomain(
                domain_name="ichigo.mashimaro"
            )
        )
        self.assertTrue(stateless_validator.command(create_d))
        create_d = Command(
            create_domain = Command.CreateDomain(
                domain_name="ichigo+mashimaro"
            )
        )
        self.assertFalse(stateless_validator.command(create_d))
github hyperledger / iroha-python / tests / helper / test_stateless_validator.py View on Github external
def test_stateless_validator_set_account_quorum(self):
        set_ac_q = Command(
            set_account_quorum = Command.SetAccountQuorum(
                account_id = "rihito@light.wing",
                quorum = 100
            )
        )
        self.assertTrue(stateless_validator.command(set_ac_q))
        set_ac_q = Command(
            set_account_quorum = Command.SetAccountQuorum(
                account_id = "rihito@light.wing",
                quorum = 0
            )
        )
        self.assertFalse(stateless_validator.command(set_ac_q))
github hyperledger / iroha-python / tests / helper / test_stateless_validator.py View on Github external
create_ac = Command(
            create_account = Command.CreateAccount(
                account_name = "rihito",
                domain_id = "light.wing.a.c.f",
                main_pubkey = self.keypair.public_key
            )
        )
        self.assertTrue(stateless_validator.command(create_ac))
        create_ac = Command(
            create_account = Command.CreateAccount(
                account_name = "rihito",
                domain_id = "light.wing.a*.c.d.e.f.g.sf",
                main_pubkey = self.keypair.public_key
            )
        )
        self.assertFalse(stateless_validator.command(create_ac))
github hyperledger / iroha-python / tests / helper / test_stateless_validator.py View on Github external
add_asset_q = Command(
            add_asset_quantity = Command.AddAssetQuantity(
                account_id="chika@ichigo.mashimaro",
                asset_id="ichigo.mashimaro/yen",
                amount=int2amount(100)
            )
        )
        self.assertTrue(stateless_validator.command(add_asset_q))
        add_asset_q = Command(
            add_asset_quantity = Command.AddAssetQuantity(
                account_id="chika@ichigo.mashimaro",
                asset_id="ichigo.mashimaro/",
                amount=int2amount(100)
            )
        )
        self.assertFalse(stateless_validator.command(add_asset_q))
github hyperledger / iroha-python / tests / helper / test_stateless_validator.py View on Github external
def test_stateless_validator_create_domain(self):
        create_d = Command(
            create_domain = Command.CreateDomain(
                domain_name="ichigo.mashimaro"
            )
        )
        self.assertTrue(stateless_validator.command(create_d))
        create_d = Command(
            create_domain = Command.CreateDomain(
                domain_name="ichigo+mashimaro"
            )
        )
        self.assertFalse(stateless_validator.command(create_d))
github hyperledger / iroha-python / tests / helper / test_stateless_validator.py View on Github external
def test_stateless_validator_add_signatory(self):
        add_sig = Command(
            add_signatory = Command.AddSignatory(
                account_id = "rihito@light.wing",
                pubkey = self.keypair.public_key
            )
        )
        self.assertTrue(stateless_validator.command(add_sig))
github hyperledger / iroha-python / tests / helper / test_stateless_validator.py View on Github external
def test_stateless_validator_create_account(self):
        create_ac = Command(
            create_account = Command.CreateAccount(
                account_name = "rihito",
                domain_id = "light.wing",
                main_pubkey = self.keypair.public_key
            )
        )
        self.assertTrue(stateless_validator.command(create_ac))
        create_ac = Command(
            create_account = Command.CreateAccount(
                account_name = "rihitoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo",
                domain_id = "light.wing",
                main_pubkey = self.keypair.public_key
            )
        )
        self.assertFalse(stateless_validator.command(create_ac))
        create_ac = Command(
            create_account = Command.CreateAccount(
                account_name = "rihito",
                domain_id = "light.wing.a.c.f",
                main_pubkey = self.keypair.public_key
            )
        )
        self.assertTrue(stateless_validator.command(create_ac))