Skip to content

Commit

Permalink
Merge pull request #85 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 5cb8e81 + 6c33255 commit 638c481
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 37 deletions.
74 changes: 38 additions & 36 deletions src/main/kotlin/jp/co/soramitsu/load/UserFlow.kt
Original file line number Diff line number Diff line change
Expand Up @@ -39,104 +39,105 @@ 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 ->
iroha2Client = builder("peer-0/api")
runBlocking {
QueryBuilder.findAssetsByAccountId(anotherDevAccountIdSender)
.account(anotherDevAccountIdSender)
.buildSigned(anotherDevKeyPairSender)
.let { query ->
/*println("QUERY BODY")
println(query)*/
iroha2Client.sendQuery(query)
}
}
Session
}.exec { Session ->
iroha2Client = builder("peer-1/api")
runBlocking {
QueryBuilder.findAccountsByDomainId(domainIdSender)
.account(anotherDevAccountIdSender)
.buildSigned(anotherDevKeyPairSender)
.let { query ->
/*println("QUERY BODY")
println(query)*/
iroha2Client.sendQuery(query)
}
}
Session
}.exec { Session ->
iroha2Client = builder("peer-2/api")
runBlocking {
QueryBuilder.findAllAssets()
.account(anotherDevAccountIdSender)
.buildSigned(anotherDevKeyPairSender)
.let { query ->
/*println("QUERY BODY")
println(query)*/
iroha2Client.sendQuery(query)
}
}
Session
}.exec { Session ->
iroha2Client = builder("peer-3/api")
runBlocking {
QueryBuilder.findAllAssets()
.account(anotherDevAccountIdSender)
.buildSigned(anotherDevKeyPairSender)
.let { query ->
/*println("QUERY BODY")
println(query)*/
iroha2Client.sendQuery(query)
}
}
Session
}/*.exec { Session ->
}.exec { Session ->
iroha2Client = builder("peer-4/api")
runBlocking {
val assetDefinition = "xor_" + UUID.randomUUID() + "_" + UUID.randomUUID()
val assetDefinitionId = AssetDefinitionId(
domainIdSender,
assetDefinition.asName()
)
iroha2Client.sendTransaction {
account(anotherDevAccountIdSender)
registerAssetDefinition(assetDefinitionId, AssetValueType.numeric())
buildSigned(anotherDevKeyPairSender)
}
QueryBuilder.findAllTransactions()
.account(anotherDevAccountIdSender)
.buildSigned(anotherDevKeyPairSender)
.let { query ->
iroha2Client.sendQuery(query)
}
}
Session
}.exec { Session ->
iroha2Client = builder("peer-0/api")
runBlocking {
txs = QueryBuilder.findTransactionsByAccountId(anotherDevAccountIdSender)
QueryBuilder.findTransactionByHash(hash)
.account(anotherDevAccountIdSender)
.buildSigned(anotherDevKeyPairSender)
.let { query ->
iroha2Client.sendQuery(query)
}
}
Session
}.exec { Session ->
iroha2Client = builder("peer-1/api")
runBlocking {
QueryBuilder.findAccountsByDomainId(domainIdSender)
.account(anotherDevAccountIdSender)
.buildSigned(anotherDevKeyPairSender)
.let { query ->
iroha2Client.sendQuery(query)
}
hash = SignedTransaction.encode(txs[2].transaction.value).hash()
}
Session
}.exec { Session ->
iroha2Client = builder("peer-2/api")
runBlocking {
val assetDefinition = "xor_" + UUID.randomUUID() + "_" + UUID.randomUUID()
val assetDefinitionId = AssetDefinitionId(
domainIdSender,
assetDefinition.asName()
)
iroha2Client.sendTransaction {
account(anotherDevAccountIdSender)
registerAssetDefinition(assetDefinitionId, AssetValueType.numeric())
buildSigned(anotherDevKeyPairSender)
}
QueryBuilder.findAllAssets()
.account(anotherDevAccountIdSender)
.buildSigned(anotherDevKeyPairSender)
.let { query ->
iroha2Client.sendQuery(query)
}
}
Session
}*/.exec { Session ->
}.exec { Session ->
iroha2Client = builder("peer-3/api")
runBlocking {
QueryBuilder.findAllTransactions()
QueryBuilder.findAllAssets()
.account(anotherDevAccountIdSender)
.buildSigned(anotherDevKeyPairSender)
.let { query ->
Expand All @@ -145,8 +146,9 @@ class UserFlow : Wrench13() {
}
Session
}.exec { Session ->
iroha2Client = builder("peer-4/api")
runBlocking {
QueryBuilder.findTransactionByHash(hash)
QueryBuilder.findAllTransactions()
.account(anotherDevAccountIdSender)
.buildSigned(anotherDevKeyPairSender)
.let { query ->
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/jp/co/soramitsu/load/toolbox/Wrench13.kt
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ open class Wrench13 {
return builder(randomPeer)
}

private fun builder(randomPeer: String): AdminIroha2Client {
fun builder(randomPeer: String): AdminIroha2Client {
val peerUrl = URIBuilder().let {
it.scheme = SimulationConfig.simulation.targetProtocol()
it.host = SimulationConfig.simulation.targetURL()
Expand Down

0 comments on commit 638c481

Please sign in to comment.