Skip to content

Commit

Permalink
update TransferAssets.kt
Browse files Browse the repository at this point in the history
Signed-off-by: timofeevmd <[email protected]>
  • Loading branch information
timofeevmd committed Mar 20, 2024
1 parent 2e2b5ca commit 6bc7d02
Showing 1 changed file with 85 additions and 1 deletion.
86 changes: 85 additions & 1 deletion src/main/kotlin/jp/co/soramitsu/load/TransferAssets.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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<String>("domainIdSender")!!.asDomainId()
anotherDevAccountIdSender = Session.get<String>("anotherDevAccountIdSender")!!.asAccountId()
Expand All @@ -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("\\"),
Expand Down Expand Up @@ -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
}
}

0 comments on commit 6bc7d02

Please sign in to comment.