Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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)
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)
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
))
def test_time(self):
logger.info(crypto.now())
def setUp(self):
logger.setDebug()
logger.info("ConnectionTest")
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)
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)
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 = [
def setUp(self):
logger.setDebug()
logger.debug("PrimitiveTest")
def setUp(self):
logger.setDebug()
logger.info("CreatorTest")