From 6bc7d021b8eff81239272f69c5ce99d79fccfa50 Mon Sep 17 00:00:00 2001 From: timofeevmd Date: Wed, 20 Mar 2024 10:56:04 +0400 Subject: [PATCH] update TransferAssets.kt Signed-off-by: timofeevmd --- .../jp/co/soramitsu/load/TransferAssets.kt | 86 ++++++++++++++++++- 1 file changed, 85 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/jp/co/soramitsu/load/TransferAssets.kt b/src/main/kotlin/jp/co/soramitsu/load/TransferAssets.kt index 56b7d05..25f0062 100644 --- a/src/main/kotlin/jp/co/soramitsu/load/TransferAssets.kt +++ b/src/main/kotlin/jp/co/soramitsu/load/TransferAssets.kt @@ -7,6 +7,7 @@ import jp.co.soramitsu.iroha2.asAccountId import jp.co.soramitsu.iroha2.asAssetId import jp.co.soramitsu.iroha2.generated.* import jp.co.soramitsu.iroha2.asDomainId +import jp.co.soramitsu.iroha2.client.Iroha2Client import jp.co.soramitsu.load.TechicalScns.Iroha2SetUp import jp.co.soramitsu.load.infrastructure.config.SimulationConfig import jp.co.soramitsu.load.objects.CustomMetrics @@ -22,6 +23,7 @@ class TransferAssets : Wrench13() { lateinit var anotherDevAssetIdSender: AssetId lateinit var targetDevAccountIdReceiver: AccountId lateinit var anotherDevKeyPairSender: KeyPair + lateinit var iroha2Client: Iroha2Client companion object { @JvmStatic @@ -37,6 +39,7 @@ class TransferAssets : Wrench13() { val transferAssetsScn = scenario("TransferAssets") .feed(csv("preconditionList.csv").circular()) .exec { Session -> + iroha2Client = buildClient(SimulationConfig.simulation.configuration()) anotherDevKeyPairSender = adminKeyPair domainIdSender = Session.get("domainIdSender")!!.asDomainId() anotherDevAccountIdSender = Session.get("anotherDevAccountIdSender")!!.asAccountId() @@ -47,7 +50,7 @@ class TransferAssets : Wrench13() { .exec { Session -> runBlocking { //var timer: Histogram.Timer - val iroha2Client = buildClient(SimulationConfig.simulation.configuration()) + // //timer = CustomMetrics.subscriptionToBlockStreamTimer.labels( // "gatling", // System.getProperty("user.dir").substringAfterLast("/").substringAfterLast("\\"), @@ -101,5 +104,86 @@ class TransferAssets : Wrench13() { //} } Session + }.exec { Session -> + runBlocking { + iroha2Client.sendTransaction { + account(anotherDevAccountIdSender) + transferAsset(anotherDevAssetIdSender, 1, targetDevAccountIdReceiver) + buildSigned(anotherDevKeyPairSender) + } + } + Session + }.exec { Session -> + runBlocking { + iroha2Client.sendTransaction { + account(anotherDevAccountIdSender) + transferAsset(anotherDevAssetIdSender, 1, targetDevAccountIdReceiver) + buildSigned(anotherDevKeyPairSender) + } + } + Session + }.exec { Session -> + runBlocking { + iroha2Client.sendTransaction { + account(anotherDevAccountIdSender) + transferAsset(anotherDevAssetIdSender, 1, targetDevAccountIdReceiver) + buildSigned(anotherDevKeyPairSender) + } + } + Session + }.exec { Session -> + runBlocking { + iroha2Client.sendTransaction { + account(anotherDevAccountIdSender) + transferAsset(anotherDevAssetIdSender, 1, targetDevAccountIdReceiver) + buildSigned(anotherDevKeyPairSender) + } + } + Session + }.exec { Session -> + runBlocking { + iroha2Client.sendTransaction { + account(anotherDevAccountIdSender) + transferAsset(anotherDevAssetIdSender, 1, targetDevAccountIdReceiver) + buildSigned(anotherDevKeyPairSender) + } + } + Session + }.exec { Session -> + runBlocking { + iroha2Client.sendTransaction { + account(anotherDevAccountIdSender) + transferAsset(anotherDevAssetIdSender, 1, targetDevAccountIdReceiver) + buildSigned(anotherDevKeyPairSender) + } + } + Session + }.exec { Session -> + runBlocking { + iroha2Client.sendTransaction { + account(anotherDevAccountIdSender) + transferAsset(anotherDevAssetIdSender, 1, targetDevAccountIdReceiver) + buildSigned(anotherDevKeyPairSender) + } + } + Session + }.exec { Session -> + runBlocking { + iroha2Client.sendTransaction { + account(anotherDevAccountIdSender) + transferAsset(anotherDevAssetIdSender, 1, targetDevAccountIdReceiver) + buildSigned(anotherDevKeyPairSender) + } + } + Session + }.exec { Session -> + runBlocking { + iroha2Client.sendTransaction { + account(anotherDevAccountIdSender) + transferAsset(anotherDevAssetIdSender, 1, targetDevAccountIdReceiver) + buildSigned(anotherDevKeyPairSender) + } + } + Session } } \ No newline at end of file