Search in sources :

Example 6 with TopicUpdateTransaction

use of com.hedera.hashgraph.sdk.TopicUpdateTransaction 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

TopicUpdateTransaction (com.hedera.hashgraph.sdk.TopicUpdateTransaction)6 Test (org.junit.jupiter.api.Test)3 PublicKey (com.hedera.hashgraph.sdk.PublicKey)2 TopicInfoQuery (com.hedera.hashgraph.sdk.TopicInfoQuery)2 AbstractTransactionSupplierTest (com.hedera.mirror.monitor.publish.transaction.AbstractTransactionSupplierTest)2 KeyList (com.hedera.hashgraph.sdk.KeyList)1 PrivateKey (com.hedera.hashgraph.sdk.PrivateKey)1 TopicCreateTransaction (com.hedera.hashgraph.sdk.TopicCreateTransaction)1 TopicDeleteTransaction (com.hedera.hashgraph.sdk.TopicDeleteTransaction)1 TopicInfo (com.hedera.hashgraph.sdk.TopicInfo)1 TransactionResponse (com.hedera.hashgraph.sdk.TransactionResponse)1 NetworkTransactionResponse (com.hedera.mirror.test.e2e.acceptance.response.NetworkTransactionResponse)1 Duration (java.time.Duration)1 DisplayName (org.junit.jupiter.api.DisplayName)1