Skip to content

Commit

Permalink
Merge pull request #130 from soramitsu/update/genesis
Browse files Browse the repository at this point in the history
Merge remote-tracking branch 'origin/update/genesis' into update/genesis
  • Loading branch information
timofeevmd authored Jul 15, 2024
2 parents 8c460a8 + 24c8567 commit ad9ef84
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 14 deletions.
47 changes: 34 additions & 13 deletions src/test/java/requests/Transactions.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,13 @@
import io.gatling.javaapi.core.ChainBuilder;
import jp.co.soramitsu.iroha2.CryptoUtils;
import jp.co.soramitsu.iroha2.ExtensionsKt;
import jp.co.soramitsu.iroha2.generated.AssetType;
import jp.co.soramitsu.iroha2.generated.NumericSpec;
import jp.co.soramitsu.iroha2.generated.SignedTransaction;
import jp.co.soramitsu.iroha2.generated.*;
import jp.co.soramitsu.iroha2.transaction.TransactionBuilder;

import static io.gatling.javaapi.core.CoreDsl.*;
import static io.gatling.javaapi.http.HttpDsl.http;
import static io.gatling.javaapi.http.HttpDsl.status;


public class Transactions extends Constants {

public static ChainBuilder postRegisterDefinitionId = exec(feed(CSV_FEEDER)).exec(feed(PEERS_FEEDER))
Expand Down Expand Up @@ -53,7 +50,7 @@ public class Transactions extends Constants {
TransactionBuilder.Companion.builder()
.account(ExtensionsKt.asAccountId(session.getString("anotherDevAccountIdSender")))
.chainId(Constants.CHAIN_ID)
.unregisterAssetDefinition(ExtensionsKt.asAssetDefinitionId("performance_token_#" + session.getString("domainIdSender")) )
.unregisterAssetDefinition(ExtensionsKt.asAssetDefinitionId("performance_token_#" + session.getString("domainIdSender")))
.buildSigned(CryptoUtils.keyPairFromHex(
session.getString("publicKeySender"),
session.getString("privateKeySender")))
Expand Down Expand Up @@ -103,18 +100,42 @@ public class Transactions extends Constants {
session.getString("publicKeySender"),
session.getString("privateKeySender")
))
/*TransactionBuilder.Companion.builder()
.account(ExtensionsKt.asAccountId("CE7FA46C9DCE7EA4B125E2E36BDB63EA33073E7590AC92816AE1E861B7048B03@wonderland"))
);
}
)
)
).exec(http("tx_register_domain_status").get(Constants.URL_STATUS).check(status().is(200)));

public static ChainBuilder debuggingPostTransferAsset = exec(feed(CSV_FEEDER)).exec(feed(PEERS_FEEDER))
.exec(
http("debugging_tx_transfer_asset")
.post(session -> {
return session.getString("peer") + Constants.URL_TRANSACTION;
}
).body(ByteArrayBody(session -> {
return SignedTransaction.Companion.encode(
TransactionBuilder.Companion.builder()
/*crypto*/.account(ExtensionsKt.asAccountId("b24ff6ab1e5923f125d7f4eb0c62528eb6b8e84139e17fb377e2bd5fc1498b19@bulb_7405035c-e673-4a46-8f7f-1cca0a0687fa_6138d709-b7e0-44e6-b5dd-1f26f848f464"))
.chainId(Constants.CHAIN_ID)
.transferAsset(ExtensionsKt.asAssetId("rose#wonderland#CE7FA46C9DCE7EA4B125E2E36BDB63EA33073E7590AC92816AE1E861B7048B03@wonderland"),
/* drop ed0120*/.transferAsset(ExtensionsKt.asAssetId("xora08da796-bca3-475f-bf94-30cc918ef69b_c687b817-3a68-4848-81bc-d4915801cee1##b24ff6ab1e5923f125d7f4eb0c62528eb6b8e84139e17fb377e2bd5fc1498b19@bulb_7405035c-e673-4a46-8f7f-1cca0a0687fa_6138d709-b7e0-44e6-b5dd-1f26f848f464"),
1,
ExtensionsKt.asAccountId("04FF5B81046DDCCF19E2E451C45DFB6F53759D4EB30FA2EFA807284D1CC33016@wonderland"))
/*drop ed0120*/ExtensionsKt.asAccountId("7d5ad42de2c9c7f4b1faa7e12a9fc58d831189a59ad60daa6a3a88af9dc2a2e2@bulb_7405035c-e673-4a46-8f7f-1cca0a0687fa_6138d709-b7e0-44e6-b5dd-1f26f848f464"))
.buildSigned(CryptoUtils.keyPairFromHex(
"7233bfc89dcbd68c19fde6ce6158225298ec1131b6a130d1aeb454c1ab5183c0",
"9ac47abf59b356e0bd7dcbbbb4dec080e302156a48ca907e47cb6aea1d32719e"))*/
);
"b24ff6ab1e5923f125d7f4eb0c62528eb6b8e84139e17fb377e2bd5fc1498b19",
"272d70e7efbee4f4c9bc61a2b30deb43194ac1b5e18d06fbba0374d3505c36c8"))
);
}
)
).check(
status().is(200),
bodyString().saveAs("responseBody")
)
).exec(http("tx_register_domain_status").get(Constants.URL_STATUS).check(status().is(200)));
).exec(http("debugging_tx_register_domain_status").get(Constants.URL_STATUS).check(status().is(200)))
.exec(session -> {
String responseBody = session.getString("responseBody");
System.out.println("Response: " + responseBody);
return session;
});
}


2 changes: 1 addition & 1 deletion src/test/java/scenarious/TransferAsset.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ public class TransferAsset {
public static ScenarioBuilder transferAsset = scenario("transfer asset")
.feed(csv("preconditionList.csv").circular())
.exec(
Transactions.postTransferAsset
Transactions.debuggingPostTransferAsset
);
}

0 comments on commit ad9ef84

Please sign in to comment.