Skip to content

Commit

Permalink
Merge pull request #87 from soramitsu/update/max_transaction_in_block
Browse files Browse the repository at this point in the history
update user flow scn
  • Loading branch information
timofeevmd authored Jun 26, 2024
2 parents 1c9442d + 006dbaf commit b846461
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
24 changes: 13 additions & 11 deletions src/main/kotlin/jp/co/soramitsu/load/UserFlow.kt
Original file line number Diff line number Diff line change
Expand Up @@ -39,121 +39,123 @@ class UserFlow : Wrench13() {
val userFlowScn = scenario("userFlowScn")
.feed(csv("preconditionList.csv").circular())
.exec { Session ->
//iroha2Client = buildClient(SimulationConfig.simulation.configuration())
iroha2Client = buildClient(SimulationConfig.simulation.configuration())
anotherDevKeyPairSender = adminKeyPair
domainIdSender = Session.get<String>("domainIdSender")!!.asDomainId()
anotherDevAccountIdSender = Session.get<String>("anotherDevAccountIdSender")!!.asAccountId()
targetDevAccountIdReceiver = Session.get<String>("anotherDevAccountIdReceiver")!!.asAccountId()
anotherDevAssetIdSender = Session.get<String>("anotherDevAssetIdSender")!!.asAssetId()
Session
}.exec { Session ->
val iroha2Client = builder("peer-0/api")
runBlocking {
QueryBuilder.findAssetsByAccountId(anotherDevAccountIdSender)
.account(anotherDevAccountIdSender)
.buildSigned(anotherDevKeyPairSender)
.let { query ->
iroha2Client.sendQuery(query)
}
println("findAssetsByAccountId")
}
Session
}.exec { Session ->
val iroha2Client = builder("peer-1/api")
runBlocking {
QueryBuilder.findAccountsByDomainId(domainIdSender)
.account(anotherDevAccountIdSender)
.buildSigned(anotherDevKeyPairSender)
.let { query ->
iroha2Client.sendQuery(query)
}
println("findAccountsByDomainId")
}
Session
}.exec { Session ->
val iroha2Client = builder("peer-2/api")
runBlocking {
QueryBuilder.findAllAssets()
.account(anotherDevAccountIdSender)
.buildSigned(anotherDevKeyPairSender)
.let { query ->
iroha2Client.sendQuery(query)
}
println("findAllAssets")
}
Session
}.exec { Session ->
val iroha2Client = builder("peer-3/api")
runBlocking {
QueryBuilder.findAllAssets()
.account(anotherDevAccountIdSender)
.buildSigned(anotherDevKeyPairSender)
.let { query ->
iroha2Client.sendQuery(query)
}
println("findAllAssets")
}
Session
}.exec { Session ->
val iroha2Client = builder("peer-4/api")
runBlocking {
QueryBuilder.findAllTransactions()
.account(anotherDevAccountIdSender)
.buildSigned(anotherDevKeyPairSender)
.let { query ->
iroha2Client.sendQuery(query)
}
println("findAllTransactions")
}
Session
}.exec { Session ->
val iroha2Client = builder("peer-0/api")
runBlocking {
QueryBuilder.findTransactionByHash(hash)
.account(anotherDevAccountIdSender)
.buildSigned(anotherDevKeyPairSender)
.let { query ->
iroha2Client.sendQuery(query)
}
println("findTransactionByHash")
}
Session
}.exec { Session ->
val iroha2Client = builder("peer-1/api")
runBlocking {
QueryBuilder.findAccountsByDomainId(domainIdSender)
.account(anotherDevAccountIdSender)
.buildSigned(anotherDevKeyPairSender)
.let { query ->
iroha2Client.sendQuery(query)
}
println("findAccountsByDomainId")
}
Session
}.exec { Session ->
val iroha2Client = builder("peer-2/api")
runBlocking {
QueryBuilder.findAllAssets()
.account(anotherDevAccountIdSender)
.buildSigned(anotherDevKeyPairSender)
.let { query ->
iroha2Client.sendQuery(query)
}
println("findAllAssets")
}
Session
}.exec { Session ->
val iroha2Client = builder("peer-3/api")
runBlocking {
QueryBuilder.findAllAssets()
.account(anotherDevAccountIdSender)
.buildSigned(anotherDevKeyPairSender)
.let { query ->
iroha2Client.sendQuery(query)
}.also {

}
println("findAllAssets")
}
Session
}.exec { Session ->
val iroha2Client = builder("peer-4/api")
runBlocking {
QueryBuilder.findAllTransactions()
.account(anotherDevAccountIdSender)
.buildSigned(anotherDevKeyPairSender)
.let { query ->
iroha2Client.sendQuery(query)
}
println("findAllTransactions")
}
Session
}
Expand Down
7 changes: 3 additions & 4 deletions src/main/kotlin/jp/co/soramitsu/load/toolbox/Wrench13.kt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ import java.security.KeyPair
open class Wrench13 {

val urls: MutableList<URL> = mutableListOf()
val peers = arrayOf("peer-0/api", "peer-1/api", "peer-2/api", "peer-3/api", "peer-4/api")
//val peers = arrayOf("peer-0/api", "peer-1/api", "peer-2/api", "peer-3/api", "peer-4/api")
val peers = arrayOf("peer-0/api", "peer-1/api", "peer-2/api")
val bobAccountId = AccountId("wonderland".asDomainId(), "bob".asName())
val aliceAccountId = AccountId("wonderland".asDomainId(), "alice".asName())
val admin = AccountId("wonderland".asDomainId(), "bob".asName())
Expand Down Expand Up @@ -72,7 +73,7 @@ open class Wrench13 {
return builder(randomPeer)
}

fun builder(randomPeer: String): AdminIroha2Client {
private fun builder(randomPeer: String): AdminIroha2Client {
val peerUrl = URIBuilder().let {
it.scheme = SimulationConfig.simulation.targetProtocol()
it.host = SimulationConfig.simulation.targetURL()
Expand All @@ -88,8 +89,6 @@ open class Wrench13 {
urls[0],
log = false,
credentials = SimulationConfig.simulation.remoteLogin() + ":" + SimulationConfig.simulation.remotePass(),
/*eventReadTimeoutInMills = 10000,
eventReadMaxAttempts = 20*/
)
}

Expand Down

0 comments on commit b846461

Please sign in to comment.