Search in sources :

Example 1 with NetworkTransactionResponse

use of com.hedera.mirror.test.e2e.acceptance.response.NetworkTransactionResponse in project hedera-mirror-node by hashgraph.

the class AccountClient method sendCryptoTransfer.

public NetworkTransactionResponse sendCryptoTransfer(AccountId recipient, Hbar hbarAmount) {
    log.debug("Send CryptoTransfer of {} tℏ from {} to {}", hbarAmount.toTinybars(), sdkClient.getExpandedOperatorAccountId().getAccountId(), recipient);
    TransferTransaction cryptoTransferTransaction = getCryptoTransferTransaction(sdkClient.getExpandedOperatorAccountId().getAccountId(), recipient, hbarAmount);
    NetworkTransactionResponse networkTransactionResponse = executeTransactionAndRetrieveReceipt(cryptoTransferTransaction);
    log.debug("Sent CryptoTransfer");
    return networkTransactionResponse;
}
Also used : NetworkTransactionResponse(com.hedera.mirror.test.e2e.acceptance.response.NetworkTransactionResponse) TransferTransaction(com.hedera.hashgraph.sdk.TransferTransaction)

Example 2 with NetworkTransactionResponse

use of com.hedera.mirror.test.e2e.acceptance.response.NetworkTransactionResponse in project hedera-mirror-node by hashgraph.

the class ContractClient method deleteContract.

public NetworkTransactionResponse deleteContract(ContractId contractId, AccountId transferAccountId, ContractId transferContractId) {
    log.debug("Delete contract {}", contractId);
    String memo = getMemo("Delete contract");
    ContractDeleteTransaction contractDeleteTransaction = new ContractDeleteTransaction().setContractId(contractId).setTransactionMemo(memo);
    // either AccountId or ContractId, not both
    if (transferAccountId != null) {
        contractDeleteTransaction.setTransferAccountId(transferAccountId);
    }
    if (transferContractId != null) {
        contractDeleteTransaction.setTransferContractId(transferContractId);
    }
    NetworkTransactionResponse networkTransactionResponse = executeTransactionAndRetrieveReceipt(contractDeleteTransaction);
    log.debug("Deleted contract {}", contractId);
    return networkTransactionResponse;
}
Also used : ContractDeleteTransaction(com.hedera.hashgraph.sdk.ContractDeleteTransaction) NetworkTransactionResponse(com.hedera.mirror.test.e2e.acceptance.response.NetworkTransactionResponse)

Example 3 with NetworkTransactionResponse

use of com.hedera.mirror.test.e2e.acceptance.response.NetworkTransactionResponse in project hedera-mirror-node by hashgraph.

the class FileClient method updateFile.

public NetworkTransactionResponse updateFile(FileId fileId, byte[] byteCode) {
    log.debug("Update file");
    String memo = getMemo("Update file");
    FileUpdateTransaction fileUpdateTransaction = new FileUpdateTransaction().setFileId(fileId).setFileMemo(memo).setTransactionMemo(memo);
    if (byteCode != null) {
        fileUpdateTransaction.setContents(byteCode);
    }
    NetworkTransactionResponse networkTransactionResponse = executeTransactionAndRetrieveReceipt(fileUpdateTransaction);
    log.debug("Updated file {}", fileId);
    return networkTransactionResponse;
}
Also used : FileUpdateTransaction(com.hedera.hashgraph.sdk.FileUpdateTransaction) NetworkTransactionResponse(com.hedera.mirror.test.e2e.acceptance.response.NetworkTransactionResponse)

Example 4 with NetworkTransactionResponse

use of com.hedera.mirror.test.e2e.acceptance.response.NetworkTransactionResponse in project hedera-mirror-node by hashgraph.

the class FileClient method appendFile.

public NetworkTransactionResponse appendFile(FileId fileId, byte[] byteCode) {
    String memo = "Append file";
    log.debug(memo);
    FileAppendTransaction fileAppendTransaction = new FileAppendTransaction().setFileId(fileId).setContents(byteCode).setTransactionMemo(getMemo(memo));
    NetworkTransactionResponse networkTransactionResponse = executeTransactionAndRetrieveReceipt(fileAppendTransaction);
    log.debug("Appended to file {}", fileId);
    return networkTransactionResponse;
}
Also used : NetworkTransactionResponse(com.hedera.mirror.test.e2e.acceptance.response.NetworkTransactionResponse) FileAppendTransaction(com.hedera.hashgraph.sdk.FileAppendTransaction)

Example 5 with NetworkTransactionResponse

use of com.hedera.mirror.test.e2e.acceptance.response.NetworkTransactionResponse in project hedera-mirror-node by hashgraph.

the class FileClient method deleteFile.

public NetworkTransactionResponse deleteFile(FileId fileId) {
    String memo = "Delete file";
    log.debug(memo);
    FileDeleteTransaction fileUpdateTransaction = new FileDeleteTransaction().setFileId(fileId).setTransactionMemo(getMemo(memo));
    NetworkTransactionResponse networkTransactionResponse = executeTransactionAndRetrieveReceipt(fileUpdateTransaction);
    log.debug("Deleted file {}", fileId);
    return networkTransactionResponse;
}
Also used : NetworkTransactionResponse(com.hedera.mirror.test.e2e.acceptance.response.NetworkTransactionResponse) FileDeleteTransaction(com.hedera.hashgraph.sdk.FileDeleteTransaction)

Aggregations

NetworkTransactionResponse (com.hedera.mirror.test.e2e.acceptance.response.NetworkTransactionResponse)41 PublicKey (com.hedera.hashgraph.sdk.PublicKey)3 TopicId (com.hedera.hashgraph.sdk.TopicId)3 AccountId (com.hedera.hashgraph.sdk.AccountId)2 KeyList (com.hedera.hashgraph.sdk.KeyList)2 PrivateKey (com.hedera.hashgraph.sdk.PrivateKey)2 TokenBurnTransaction (com.hedera.hashgraph.sdk.TokenBurnTransaction)2 TokenCreateTransaction (com.hedera.hashgraph.sdk.TokenCreateTransaction)2 TokenId (com.hedera.hashgraph.sdk.TokenId)2 TokenUpdateTransaction (com.hedera.hashgraph.sdk.TokenUpdateTransaction)2 TokenWipeTransaction (com.hedera.hashgraph.sdk.TokenWipeTransaction)2 TopicMessageQuery (com.hedera.hashgraph.sdk.TopicMessageQuery)2 TransactionReceipt (com.hedera.hashgraph.sdk.TransactionReceipt)2 TransactionRecord (com.hedera.hashgraph.sdk.TransactionRecord)2 TransferTransaction (com.hedera.hashgraph.sdk.TransferTransaction)2 ExpandedAccountId (com.hedera.mirror.test.e2e.acceptance.props.ExpandedAccountId)2 Given (io.cucumber.java.en.Given)2 AccountAllowanceApproveTransaction (com.hedera.hashgraph.sdk.AccountAllowanceApproveTransaction)1 AccountCreateTransaction (com.hedera.hashgraph.sdk.AccountCreateTransaction)1 ContractCreateTransaction (com.hedera.hashgraph.sdk.ContractCreateTransaction)1