use of com.hedera.mirror.test.e2e.acceptance.response.NetworkTransactionResponse in project hedera-mirror-node by hashgraph.
the class TopicClient method deleteTopic.
public NetworkTransactionResponse deleteTopic(TopicId topicId) {
TopicDeleteTransaction consensusTopicDeleteTransaction = new TopicDeleteTransaction().setMaxTransactionFee(sdkClient.getMaxTransactionFee()).setTopicId(topicId).setTransactionMemo(getMemo("Delete Topic"));
NetworkTransactionResponse networkTransactionResponse = executeTransactionAndRetrieveReceipt(consensusTopicDeleteTransaction);
log.debug("Deleted topic : '{}'.", topicId);
return networkTransactionResponse;
}
use of com.hedera.mirror.test.e2e.acceptance.response.NetworkTransactionResponse in project hedera-mirror-node by hashgraph.
the class TopicFeature method createNewOpenTopic.
@Given("I successfully create a new open topic")
public void createNewOpenTopic() {
testInstantReference = Instant.now();
NetworkTransactionResponse networkTransactionResponse = topicClient.createTopic(topicClient.getSdkClient().getExpandedOperatorAccountId(), null);
assertNotNull(networkTransactionResponse.getReceipt());
TopicId topicId = networkTransactionResponse.getReceipt().topicId;
assertNotNull(topicId);
consensusTopicId = topicId;
topicMessageQuery = new TopicMessageQuery().setTopicId(consensusTopicId).setStartTime(Instant.EPOCH);
log.debug("Set TopicMessageQuery with topic: {}, startTime: {}", consensusTopicId, Instant.EPOCH);
}
use of com.hedera.mirror.test.e2e.acceptance.response.NetworkTransactionResponse in project hedera-mirror-node by hashgraph.
the class TopicFeature method createNewTopic.
@Given("I successfully create a new topic id")
public void createNewTopic() {
testInstantReference = Instant.now();
submitKey = PrivateKey.generate();
PublicKey submitPublicKey = submitKey.getPublicKey();
log.trace("Topic creation PrivateKey : {}, PublicKey : {}", submitKey, submitPublicKey);
NetworkTransactionResponse networkTransactionResponse = topicClient.createTopic(topicClient.getSdkClient().getExpandedOperatorAccountId(), submitPublicKey);
assertNotNull(networkTransactionResponse.getReceipt());
TopicId topicId = networkTransactionResponse.getReceipt().topicId;
assertNotNull(topicId);
consensusTopicId = topicId;
topicMessageQuery = new TopicMessageQuery().setTopicId(consensusTopicId).setStartTime(Instant.EPOCH);
log.debug("Set TopicMessageQuery with topic: {}, startTime: {}", consensusTopicId, Instant.EPOCH);
}
use of com.hedera.mirror.test.e2e.acceptance.response.NetworkTransactionResponse in project hedera-mirror-node by hashgraph.
the class AbstractNetworkClient method executeTransactionAndRetrieveReceipt.
public NetworkTransactionResponse executeTransactionAndRetrieveReceipt(Transaction transaction, KeyList keyList, ExpandedAccountId payer) {
long startBalance = getBalance();
TransactionId transactionId = executeTransaction(transaction, keyList, payer);
TransactionReceipt transactionReceipt = null;
try {
transactionReceipt = getTransactionReceipt(transactionId);
} catch (Exception e) {
log.error("Failed to get transaction receipt for {}: {}", transactionId, e.getMessage());
}
log.trace("Executed transaction {} cost {} tℏ", transactionId, startBalance - getBalance());
return new NetworkTransactionResponse(transactionId, transactionReceipt);
}
use of com.hedera.mirror.test.e2e.acceptance.response.NetworkTransactionResponse in project hedera-mirror-node by hashgraph.
the class AccountClient method createCryptoAccount.
public ExpandedAccountId createCryptoAccount(Hbar initialBalance, boolean receiverSigRequired, KeyList keyList, String memo) {
// 1. Generate a Ed25519 private, public key pair
PrivateKey privateKey = PrivateKey.generate();
PublicKey publicKey = privateKey.getPublicKey();
log.trace("Private key = {}", privateKey);
log.trace("Public key = {}", publicKey);
KeyList publicKeyList = KeyList.of(privateKey.getPublicKey());
if (keyList != null) {
publicKeyList.addAll(keyList);
}
AccountCreateTransaction accountCreateTransaction = getAccountCreateTransaction(initialBalance, publicKeyList, receiverSigRequired, memo == null ? "" : memo);
NetworkTransactionResponse networkTransactionResponse = executeTransactionAndRetrieveReceipt(accountCreateTransaction, receiverSigRequired ? KeyList.of(privateKey) : null);
TransactionReceipt receipt = networkTransactionResponse.getReceipt();
AccountId newAccountId = receipt.accountId;
// verify accountId
if (receipt.accountId == null) {
throw new NetworkException(String.format("Receipt for %s returned no accountId, receipt: %s", networkTransactionResponse.getTransactionId(), receipt));
}
log.debug("Created new account {}, receiverSigRequired: {}", newAccountId, receiverSigRequired);
return new ExpandedAccountId(newAccountId, privateKey, privateKey.getPublicKey());
}
Aggregations