Skip to content

Commit

Permalink
Merge pull request #140 from soramitsu/scenarious/multi_transaction
Browse files Browse the repository at this point in the history
Scenarious/multi transaction
  • Loading branch information
timofeevmd authored Jul 30, 2024
2 parents deb507c + 0efa02c commit 46aa2a1
Show file tree
Hide file tree
Showing 4 changed files with 5,026 additions and 29 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<maven-compiler-plugin.version>3.13.0</maven-compiler-plugin.version>
<maven-resources-plugin.version>3.3.1</maven-resources-plugin.version>
<maven-jar-plugin.version>3.4.2</maven-jar-plugin.version>
<iroha-java.version>8ea800591</iroha-java.version>
<iroha-java.version>f908546812</iroha-java.version>
<jackson.versaion>2.14.1</jackson.versaion>
<commons-codec.version>1.15</commons-codec.version>
<lombok.version>1.18.24</lombok.version>
Expand Down
45 changes: 22 additions & 23 deletions src/test/java/requests/Transactions.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public class Transactions extends Constants {

public static ChainBuilder postMultiInstructions = exec(feed(CSV_FEEDER)).exec(feed(PEERS_FEEDER)).exec(feed(MULTI_TXS_FEEDER))
.exec(
http("tx_register_definition_id")
http("tx_multi_instruction")
.post(session -> {
return session.getString("peer") + Constants.URL_TRANSACTION;
}
Expand All @@ -57,8 +57,8 @@ public class Transactions extends Constants {

.registerAssetDefinition(ExtensionsKt.asAssetDefinitionId(session.getString("assetDefinitionId_0")), new AssetType.Numeric(new NumericSpec()))
.registerAssetDefinition(ExtensionsKt.asAssetDefinitionId(session.getString("assetDefinitionId_1")), new AssetType.Numeric(new NumericSpec()))
.registerAssetDefinition(ExtensionsKt.asAssetDefinitionId(session.getString("assetDefinitionId_2")), new AssetType.Numeric(new NumericSpec()))
.registerAssetDefinition(ExtensionsKt.asAssetDefinitionId(session.getString("assetDefinitionId_2")), new AssetType.Numeric(new NumericSpec()))
.registerAssetDefinition(ExtensionsKt.asAssetDefinitionId(session.getString("assetDefinitionId_2_0")), new AssetType.Numeric(new NumericSpec()))
.registerAssetDefinition(ExtensionsKt.asAssetDefinitionId(session.getString("assetDefinitionId_2_1")), new AssetType.Numeric(new NumericSpec()))

.registerAccount(ExtensionsKt.asAccountId(session.getString("accountIdSender_0")))
.registerAccount(ExtensionsKt.asAccountId(session.getString("accountIdSender_1")))
Expand All @@ -79,15 +79,15 @@ public class Transactions extends Constants {
.registerAccount(ExtensionsKt.asAccountId(session.getString("accountIdReceiver_7")))
.registerAccount(ExtensionsKt.asAccountId(session.getString("accountIdReceiver_8")))

.registerAsset(ExtensionsKt.asAssetId(session.getString("assetId_0")), new AssetValue.Numeric(new Numeric(BigInteger.valueOf(1000), 1000)))
.registerAsset(ExtensionsKt.asAssetId(session.getString("assetId_1")), new AssetValue.Numeric(new Numeric(BigInteger.valueOf(1000), 1000)))
.registerAsset(ExtensionsKt.asAssetId(session.getString("assetId_2")), new AssetValue.Numeric(new Numeric(BigInteger.valueOf(1000), 1000)))
.registerAsset(ExtensionsKt.asAssetId(session.getString("assetId_3")), new AssetValue.Numeric(new Numeric(BigInteger.valueOf(1000), 1000)))
.registerAsset(ExtensionsKt.asAssetId(session.getString("assetId_4")), new AssetValue.Numeric(new Numeric(BigInteger.valueOf(1000), 1000)))
.registerAsset(ExtensionsKt.asAssetId(session.getString("assetId_5")), new AssetValue.Numeric(new Numeric(BigInteger.valueOf(1000), 1000)))
.registerAsset(ExtensionsKt.asAssetId(session.getString("assetId_6")), new AssetValue.Numeric(new Numeric(BigInteger.valueOf(1000), 1000)))
.registerAsset(ExtensionsKt.asAssetId(session.getString("assetId_7")), new AssetValue.Numeric(new Numeric(BigInteger.valueOf(1000), 1000)))
.registerAsset(ExtensionsKt.asAssetId(session.getString("assetId_8")), new AssetValue.Numeric(new Numeric(BigInteger.valueOf(1000), 1000)))
.registerAsset(ExtensionsKt.asAssetId(session.getString("assetId_0")), new AssetValue.Numeric(new Numeric(BigInteger.TEN, Long.parseLong("1"))))
.registerAsset(ExtensionsKt.asAssetId(session.getString("assetId_1")), new AssetValue.Numeric(new Numeric(BigInteger.TEN, Long.parseLong("1"))))
.registerAsset(ExtensionsKt.asAssetId(session.getString("assetId_2")), new AssetValue.Numeric(new Numeric(BigInteger.TEN, Long.parseLong("1"))))
.registerAsset(ExtensionsKt.asAssetId(session.getString("assetId_3")), new AssetValue.Numeric(new Numeric(BigInteger.TEN, Long.parseLong("1"))))
.registerAsset(ExtensionsKt.asAssetId(session.getString("assetId_4")), new AssetValue.Numeric(new Numeric(BigInteger.TEN, Long.parseLong("1"))))
.registerAsset(ExtensionsKt.asAssetId(session.getString("assetId_5")), new AssetValue.Numeric(new Numeric(BigInteger.TEN, Long.parseLong("1"))))
.registerAsset(ExtensionsKt.asAssetId(session.getString("assetId_6")), new AssetValue.Numeric(new Numeric(BigInteger.TEN, Long.parseLong("1"))))
.registerAsset(ExtensionsKt.asAssetId(session.getString("assetId_7")), new AssetValue.Numeric(new Numeric(BigInteger.TEN, Long.parseLong("1"))))
.registerAsset(ExtensionsKt.asAssetId(session.getString("assetId_8")), new AssetValue.Numeric(new Numeric(BigInteger.TEN, Long.parseLong("1"))))

.mintAsset(ExtensionsKt.asAssetId(session.getString("assetId_0")), 100)
.mintAsset(ExtensionsKt.asAssetId(session.getString("assetId_1")), 100)
Expand All @@ -100,40 +100,39 @@ public class Transactions extends Constants {
.mintAsset(ExtensionsKt.asAssetId(session.getString("assetId_8")), 100)

.transferAsset(ExtensionsKt.asAssetId(session.getString("assetId_0")), 1, ExtensionsKt.asAccountId(session.getString("accountIdReceiver_0")))
.burnAsset(ExtensionsKt.asAssetId(session.getString("accountIdSender_0")), 1)
.burnAsset(ExtensionsKt.asAssetId(session.getString("assetId_0")), 1)

.transferAsset(ExtensionsKt.asAssetId(session.getString("assetId_1")), 1, ExtensionsKt.asAccountId(session.getString("accountIdReceiver_1")))
.burnAsset(ExtensionsKt.asAssetId(session.getString("accountIdSender_1")), 1)
.burnAsset(ExtensionsKt.asAssetId(session.getString("assetId_1")), 1)

.transferAsset(ExtensionsKt.asAssetId(session.getString("assetId_2")), 1, ExtensionsKt.asAccountId(session.getString("accountIdReceiver_2")))
.burnAsset(ExtensionsKt.asAssetId(session.getString("accountIdSender_2")), 1)
.burnAsset(ExtensionsKt.asAssetId(session.getString("assetId_2")), 1)

.transferAsset(ExtensionsKt.asAssetId(session.getString("assetId_3")), 1, ExtensionsKt.asAccountId(session.getString("accountIdReceiver_3")))
.burnAsset(ExtensionsKt.asAssetId(session.getString("accountIdSender_3")), 1)
.burnAsset(ExtensionsKt.asAssetId(session.getString("assetId_3")), 1)

.transferAsset(ExtensionsKt.asAssetId(session.getString("assetId_4")), 1, ExtensionsKt.asAccountId(session.getString("accountIdReceiver_4")))
.burnAsset(ExtensionsKt.asAssetId(session.getString("accountIdSender_4")), 1)
.burnAsset(ExtensionsKt.asAssetId(session.getString("assetId_4")), 1)

.transferAsset(ExtensionsKt.asAssetId(session.getString("assetId_5")), 1, ExtensionsKt.asAccountId(session.getString("accountIdReceiver_5")))
.burnAsset(ExtensionsKt.asAssetId(session.getString("accountIdSender_5")), 1)
.burnAsset(ExtensionsKt.asAssetId(session.getString("assetId_5")), 1)

.transferAsset(ExtensionsKt.asAssetId(session.getString("assetId_6")), 1, ExtensionsKt.asAccountId(session.getString("accountIdReceiver_6")))
.burnAsset(ExtensionsKt.asAssetId(session.getString("accountIdSender_6")), 1)
.burnAsset(ExtensionsKt.asAssetId(session.getString("assetId_6")), 1)

.transferAsset(ExtensionsKt.asAssetId(session.getString("assetId_7")), 1, ExtensionsKt.asAccountId(session.getString("accountIdReceiver_7")))
.burnAsset(ExtensionsKt.asAssetId(session.getString("accountIdSender_7")), 1)
.burnAsset(ExtensionsKt.asAssetId(session.getString("assetId_7")), 1)

.transferAsset(ExtensionsKt.asAssetId(session.getString("assetId_8")), 1, ExtensionsKt.asAccountId(session.getString("accountIdReceiver_8")))
.burnAsset(ExtensionsKt.asAssetId(session.getString("accountIdSender_8")), 1)
.burnAsset(ExtensionsKt.asAssetId(session.getString("assetId_8")), 1)

.buildSigned(CryptoUtils.keyPairFromHex(
session.getString("publicKeySender"),
session.getString("privateKeySender"))));
}
)
)
).exec(http("tx_register_definition_id_status").get(Constants.URL_STATUS).check(status().is(200)));

).exec(http("tx_multi_instruction_status").get(Constants.URL_STATUS).check(status().is(200)));

public static ChainBuilder postRevertWorldViewMultiInstructions = exec(feed(CSV_FEEDER)).exec(feed(PEERS_FEEDER)).exec(feed(MULTI_TXS_FEEDER))
.exec(
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/scenarious/GeneralTransaction.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
public class GeneralTransaction {
public static ScenarioBuilder txsMultiInstructions = scenario("many instructions")
.feed(csv("preconditionList.csv").circular())
.exec(Transactions.postMultiInstructions)
.exec(Transactions.postRevertWorldViewMultiInstructions);
.exec(Transactions.postRevertWorldViewMultiInstructions)
.exec(Transactions.postMultiInstructions);
}
Loading

0 comments on commit 46aa2a1

Please sign in to comment.