Search in sources :

Example 6 with TopicId

use of com.hedera.hashgraph.sdk.TopicId in project hedera-mirror-node by hashgraph.

the class TopicFeature method createNewTopic.

@Given("I successfully create a new topic id")
public void createNewTopic() {
    testInstantReference = Instant.now();
    submitKey = PrivateKey.generate();
    PublicKey submitPublicKey = submitKey.getPublicKey();
    log.trace("Topic creation PrivateKey : {}, PublicKey : {}", submitKey, submitPublicKey);
    NetworkTransactionResponse networkTransactionResponse = topicClient.createTopic(topicClient.getSdkClient().getExpandedOperatorAccountId(), submitPublicKey);
    assertNotNull(networkTransactionResponse.getReceipt());
    TopicId topicId = networkTransactionResponse.getReceipt().topicId;
    assertNotNull(topicId);
    consensusTopicId = topicId;
    topicMessageQuery = new TopicMessageQuery().setTopicId(consensusTopicId).setStartTime(Instant.EPOCH);
    log.debug("Set TopicMessageQuery with topic: {}, startTime: {}", consensusTopicId, Instant.EPOCH);
}
Also used : NetworkTransactionResponse(com.hedera.mirror.test.e2e.acceptance.response.NetworkTransactionResponse) PublicKey(com.hedera.hashgraph.sdk.PublicKey) TopicId(com.hedera.hashgraph.sdk.TopicId) TopicMessageQuery(com.hedera.hashgraph.sdk.TopicMessageQuery) Given(io.cucumber.java.en.Given)

Example 7 with TopicId

use of com.hedera.hashgraph.sdk.TopicId in project hedera-mirror-node by hashgraph.

the class TopicFeature method setTopicIdParam.

@Given("I provide a topic id {string}")
public void setTopicIdParam(String topicId) {
    testInstantReference = Instant.now();
    topicMessageQuery = new TopicMessageQuery().setStartTime(Instant.EPOCH);
    consensusTopicId = null;
    if (!topicId.isEmpty()) {
        consensusTopicId = new TopicId(0, 0, Long.parseLong(topicId));
        topicMessageQuery.setTopicId(consensusTopicId);
    }
    log.debug("Set TopicMessageQuery with topic: {}, StartTime: {}", consensusTopicId, Instant.EPOCH);
    messageSubscribeCount = 0;
}
Also used : TopicId(com.hedera.hashgraph.sdk.TopicId) TopicMessageQuery(com.hedera.hashgraph.sdk.TopicMessageQuery) Given(io.cucumber.java.en.Given)

Aggregations

TopicId (com.hedera.hashgraph.sdk.TopicId)7 TopicMessageQuery (com.hedera.hashgraph.sdk.TopicMessageQuery)5 Given (io.cucumber.java.en.Given)4 TopicCreateTransaction (com.hedera.hashgraph.sdk.TopicCreateTransaction)3 NetworkTransactionResponse (com.hedera.mirror.test.e2e.acceptance.response.NetworkTransactionResponse)3 Client (com.hedera.hashgraph.sdk.Client)2 TopicMessageSubmitTransaction (com.hedera.hashgraph.sdk.TopicMessageSubmitTransaction)2 Var (com.google.errorprone.annotations.Var)1 PrivateKey (com.hedera.hashgraph.sdk.PrivateKey)1 PublicKey (com.hedera.hashgraph.sdk.PublicKey)1 TransactionReceipt (com.hedera.hashgraph.sdk.TransactionReceipt)1 TransactionResponse (com.hedera.hashgraph.sdk.TransactionResponse)1 ExpandedAccountId (com.hedera.mirror.test.e2e.acceptance.props.ExpandedAccountId)1