Search in sources :

Example 11 with TopicInfoQuery

use of com.hedera.hashgraph.sdk.TopicInfoQuery in project hedera-sdk-java by hashgraph.

the class TopicUpdateIntegrationTest method canUpdateTopic.

@Test
@DisplayName("Can update topic")
void canUpdateTopic() throws Exception {
    var testEnv = new IntegrationTestEnv(1);
    var response = new TopicCreateTransaction().setAdminKey(testEnv.operatorKey).setAutoRenewAccountId(testEnv.operatorId).setTopicMemo("[e2e::TopicCreateTransaction]").execute(testEnv.client);
    var topicId = Objects.requireNonNull(response.getReceipt(testEnv.client).topicId);
    new TopicUpdateTransaction().clearAutoRenewAccountId().setTopicMemo("hello").setTopicId(topicId).execute(testEnv.client).getReceipt(testEnv.client);
    var topicInfo = new TopicInfoQuery().setTopicId(topicId).execute(testEnv.client);
    assertThat(topicInfo.topicMemo).isEqualTo("hello");
    assertThat(topicInfo.autoRenewAccountId).isNull();
    new TopicDeleteTransaction().setTopicId(topicId).execute(testEnv.client).getReceipt(testEnv.client);
    testEnv.close();
}
Also used : TopicCreateTransaction(com.hedera.hashgraph.sdk.TopicCreateTransaction) TopicUpdateTransaction(com.hedera.hashgraph.sdk.TopicUpdateTransaction) TopicInfoQuery(com.hedera.hashgraph.sdk.TopicInfoQuery) TopicDeleteTransaction(com.hedera.hashgraph.sdk.TopicDeleteTransaction) Test(org.junit.jupiter.api.Test) DisplayName(org.junit.jupiter.api.DisplayName)

Aggregations

TopicInfoQuery (com.hedera.hashgraph.sdk.TopicInfoQuery)11 TopicCreateTransaction (com.hedera.hashgraph.sdk.TopicCreateTransaction)10 TopicDeleteTransaction (com.hedera.hashgraph.sdk.TopicDeleteTransaction)10 DisplayName (org.junit.jupiter.api.DisplayName)10 Test (org.junit.jupiter.api.Test)10 TopicMessageSubmitTransaction (com.hedera.hashgraph.sdk.TopicMessageSubmitTransaction)4 Var (com.google.errorprone.annotations.Var)2 TopicMessageQuery (com.hedera.hashgraph.sdk.TopicMessageQuery)2 TopicUpdateTransaction (com.hedera.hashgraph.sdk.TopicUpdateTransaction)2 Hbar (com.hedera.hashgraph.sdk.Hbar)1 KeyList (com.hedera.hashgraph.sdk.KeyList)1 MaxQueryPaymentExceededException (com.hedera.hashgraph.sdk.MaxQueryPaymentExceededException)1 PrivateKey (com.hedera.hashgraph.sdk.PrivateKey)1 TopicInfo (com.hedera.hashgraph.sdk.TopicInfo)1 TransactionResponse (com.hedera.hashgraph.sdk.TransactionResponse)1