Search in sources :

Example 1 with ContractDeleteTransactionBody

use of com.hederahashgraph.api.proto.java.ContractDeleteTransactionBody in project hedera-services by hashgraph.

the class HapiContractDelete method opBodyDef.

@Override
protected Consumer<TransactionBody.Builder> opBodyDef(HapiApiSpec spec) throws Throwable {
    ContractDeleteTransactionBody opBody = spec.txns().<ContractDeleteTransactionBody, ContractDeleteTransactionBody.Builder>body(ContractDeleteTransactionBody.class, builder -> {
        builder.setContractID(TxnUtils.asContractId(contract, spec));
        transferContract.ifPresent(c -> builder.setTransferContractID(TxnUtils.asContractId(c, spec)));
        transferAccount.ifPresent(a -> builder.setTransferAccountID(spec.registry().getAccountID(a)));
    });
    return builder -> builder.setContractDeleteInstance(opBody);
}
Also used : Transaction(com.hederahashgraph.api.proto.java.Transaction) Arrays(java.util.Arrays) HapiTxnOp(com.hedera.services.bdd.spec.transactions.HapiTxnOp) MoreObjects(com.google.common.base.MoreObjects) SupportedContract(com.hedera.services.bdd.spec.infrastructure.meta.SupportedContract) SUCCESS(com.hederahashgraph.api.proto.java.ResponseCodeEnum.SUCCESS) Function(java.util.function.Function) Consumer(java.util.function.Consumer) Key(com.hederahashgraph.api.proto.java.Key) List(java.util.List) TxnUtils(com.hedera.services.bdd.spec.transactions.TxnUtils) TransactionBody(com.hederahashgraph.api.proto.java.TransactionBody) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) HederaFunctionality(com.hederahashgraph.api.proto.java.HederaFunctionality) ContractDeleteTransactionBody(com.hederahashgraph.api.proto.java.ContractDeleteTransactionBody) Optional(java.util.Optional) TransactionResponse(com.hederahashgraph.api.proto.java.TransactionResponse) HapiApiSpec(com.hedera.services.bdd.spec.HapiApiSpec) ContractDeleteTransactionBody(com.hederahashgraph.api.proto.java.ContractDeleteTransactionBody)

Aggregations

MoreObjects (com.google.common.base.MoreObjects)1 HapiApiSpec (com.hedera.services.bdd.spec.HapiApiSpec)1 SupportedContract (com.hedera.services.bdd.spec.infrastructure.meta.SupportedContract)1 HapiTxnOp (com.hedera.services.bdd.spec.transactions.HapiTxnOp)1 TxnUtils (com.hedera.services.bdd.spec.transactions.TxnUtils)1 ContractDeleteTransactionBody (com.hederahashgraph.api.proto.java.ContractDeleteTransactionBody)1 HederaFunctionality (com.hederahashgraph.api.proto.java.HederaFunctionality)1 Key (com.hederahashgraph.api.proto.java.Key)1 SUCCESS (com.hederahashgraph.api.proto.java.ResponseCodeEnum.SUCCESS)1 Transaction (com.hederahashgraph.api.proto.java.Transaction)1 TransactionBody (com.hederahashgraph.api.proto.java.TransactionBody)1 TransactionResponse (com.hederahashgraph.api.proto.java.TransactionResponse)1 Arrays (java.util.Arrays)1 List (java.util.List)1 Optional (java.util.Optional)1 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)1 Consumer (java.util.function.Consumer)1 Function (java.util.function.Function)1