Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update genesis.json, added new scn, update previous scn #108

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
<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>69c6515</iroha-java.version>
<!--iroha-java.version>69c6515</iroha-java.version-->
<iroha-java.version>922d5acb08</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
3 changes: 2 additions & 1 deletion src/test/java/requests/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,13 @@ public class Constants {
public static final String ALICE_ACCOUNT = "alice";
public static final String BOB_ACCOUNT = "bob";
public static final String GENESIS = "genesis";
public static final String ALICE_ACCOUNT_ID_VALUE = "alice@wonderland";
public static final String ALICE_ACCOUNT_ID_VALUE = "7233bfc89dcbd68c19fde6ce6158225298ec1131b6a130d1aeb454c1ab5183c0@wonderland";
public static final AccountId ALICE_ACCOUNT_ID = ExtensionsKt.asAccountId(ALICE_ACCOUNT_ID_VALUE);
public static final DomainId WONDERLAND_DOMAIN_ID = ExtensionsKt.asDomainId(DEFAULT_DOMAIN);
public static final KeyPair ALICE_KEYPAIR = CryptoUtils.keyPairFromHex(
"7233bfc89dcbd68c19fde6ce6158225298ec1131b6a130d1aeb454c1ab5183c0",
"9ac47abf59b356e0bd7dcbbbb4dec080e302156a48ca907e47cb6aea1d32719e");

public static final DomainId NEW_DOMAIN_ID = new DomainId(new Name("new_domain_name"));
public static final UUID CHAIN_ID = UUID.fromString("00000000-0000-0000-0000-000000000000");
public static FeederBuilder<String> CSV_FEEDER = csv("preconditionList.csv").circular();
Expand Down
48 changes: 42 additions & 6 deletions src/test/java/requests/Transactions.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
package requests;

import io.gatling.javaapi.core.ChainBuilder;
import jp.co.soramitsu.iroha2.CryptoUtils;
import jp.co.soramitsu.iroha2.ExtensionsKt;
import jp.co.soramitsu.iroha2.generated.SignedTransaction;
import jp.co.soramitsu.iroha2.generated.*;
import jp.co.soramitsu.iroha2.transaction.TransactionBuilder;
import org.bouncycastle.util.encoders.Hex;

import java.math.BigInteger;
import java.security.KeyPair;

import static io.gatling.javaapi.core.CoreDsl.*;
import static io.gatling.javaapi.http.HttpDsl.http;
Expand All @@ -12,6 +17,31 @@

public class Transactions extends Constants {

public static ChainBuilder postRegisterDefinitionId = exec(feed(CSV_FEEDER)).exec(feed(PEERS_FEEDER))
.exec(
http("tx_register_definition_id")
.post(session -> {
return session.getString("peer") + Constants.URL_TRANSACTION;
}
)
.body(ByteArrayBody(session -> {
return SignedTransaction.Companion.encode(
TransactionBuilder.Companion.builder()
.account(ExtensionsKt.asAccountId(session.getString("anotherDevAccountIdSender")))
.chainId(Constants.CHAIN_ID)
.registerAssetDefinition(
ExtensionsKt.asAssetDefinitionId(session.getString("domainIdSender")),
new AssetType.Numeric(new NumericSpec())
)
.buildSigned(CryptoUtils.keyPairFromHex(
session.getString("publicKeySender"),
session.getString("privateKeySender")))
);
}
)
)
).exec(http("tx_register_definition_id_status").get(Constants.URL_STATUS).check(status().is(200)));

public static ChainBuilder postRegisterDomain = exec(feed(CSV_FEEDER)).exec(feed(PEERS_FEEDER))
.exec(
http("tx_register_domain")
Expand All @@ -25,11 +55,14 @@ public class Transactions extends Constants {
.account(ExtensionsKt.asAccountId(session.getString("anotherDevAccountIdSender")))
.chainId(Constants.CHAIN_ID)
.registerDomain(Constants.NEW_DOMAIN_ID)
.buildSigned(Constants.ALICE_KEYPAIR));
.buildSigned(CryptoUtils.keyPairFromHex(
session.getString("publicKeySender"),
session.getString("privateKeySender")))
);
}
)
)
).exec(http("tx_register_domain_status").get(Constants.URL_STATUS).check(status().is(200)));;
).exec(http("tx_register_domain_status").get(Constants.URL_STATUS).check(status().is(200)));

public static ChainBuilder postTransferAsset = exec(feed(CSV_FEEDER)).exec(feed(PEERS_FEEDER))
.exec(
Expand All @@ -44,9 +77,12 @@ public class Transactions extends Constants {
.chainId(Constants.CHAIN_ID)
.transferAsset(ExtensionsKt.asAssetId(session.getString("anotherDevAssetIdSender")),
1,
ExtensionsKt.asAccountId(session.getString("anotherDevAccountIdReceiver"))
)
.buildSigned(Constants.ALICE_KEYPAIR));
ExtensionsKt.asAccountId(session.getString("anotherDevAccountIdReceiver")))
.buildSigned(CryptoUtils.keyPairFromHex(
session.getString("publicKeySender"),
session.getString("privateKeySender")
))
);
}
)
)
Expand Down
16 changes: 16 additions & 0 deletions src/test/java/scenarious/DefinitionId.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package scenarious;

import io.gatling.javaapi.core.ScenarioBuilder;
import requests.Transactions;

import static io.gatling.javaapi.core.CoreDsl.csv;
import static io.gatling.javaapi.core.CoreDsl.scenario;

public class DefinitionId {
public static ScenarioBuilder transferAsset = scenario("register definition id")
.feed(csv("preconditionList.csv").circular())
.exec(
Transactions.postRegisterDefinitionId

);
}
Loading