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);
}
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;
}
Aggregations