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