Search in sources :

Example 1 with LiveHashDeleteTransaction

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

the class LiveHashDeleteIntegrationTest method cannotDeleteLiveHashBecauseItsNotSupported.

@Test
@DisplayName("Cannot delete live hash because it's not supported")
void cannotDeleteLiveHashBecauseItsNotSupported() throws Exception {
    var testEnv = new IntegrationTestEnv(1);
    var key = PrivateKey.generateED25519();
    var response = new AccountCreateTransaction().setKey(key).setInitialBalance(new Hbar(1)).execute(testEnv.client);
    var accountId = Objects.requireNonNull(response.getReceipt(testEnv.client).accountId);
    assertThatExceptionOfType(PrecheckStatusException.class).isThrownBy(() -> {
        new LiveHashDeleteTransaction().setAccountId(accountId).setHash(HASH).execute(testEnv.client).getReceipt(testEnv.client);
    }).withMessageContaining(Status.NOT_SUPPORTED.toString());
    testEnv.close(accountId, key);
}
Also used : LiveHashDeleteTransaction(com.hedera.hashgraph.sdk.LiveHashDeleteTransaction) Hbar(com.hedera.hashgraph.sdk.Hbar) AccountCreateTransaction(com.hedera.hashgraph.sdk.AccountCreateTransaction) Test(org.junit.jupiter.api.Test) DisplayName(org.junit.jupiter.api.DisplayName)

Aggregations

AccountCreateTransaction (com.hedera.hashgraph.sdk.AccountCreateTransaction)1 Hbar (com.hedera.hashgraph.sdk.Hbar)1 LiveHashDeleteTransaction (com.hedera.hashgraph.sdk.LiveHashDeleteTransaction)1 DisplayName (org.junit.jupiter.api.DisplayName)1 Test (org.junit.jupiter.api.Test)1