Search in sources :

Example 1 with LiveHashAddTransaction

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

the class LiveHashAddIntegrationTest method cannotCreateLiveHashBecauseItsNotSupported.

@Test
@DisplayName("Cannot create live hash because it's not supported")
void cannotCreateLiveHashBecauseItsNotSupported() 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 LiveHashAddTransaction().setAccountId(accountId).setDuration(Duration.ofDays(30)).setHash(HASH).setKeys(key).execute(testEnv.client).getReceipt(testEnv.client);
    }).withMessageContaining(Status.NOT_SUPPORTED.toString());
    testEnv.close(accountId, key);
}
Also used : Hbar(com.hedera.hashgraph.sdk.Hbar) LiveHashAddTransaction(com.hedera.hashgraph.sdk.LiveHashAddTransaction) 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 LiveHashAddTransaction (com.hedera.hashgraph.sdk.LiveHashAddTransaction)1 DisplayName (org.junit.jupiter.api.DisplayName)1 Test (org.junit.jupiter.api.Test)1