Search in sources :

Example 1 with FileDeleteTransactionBody

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

the class HapiFileDelete method opBodyDef.

@Override
protected Consumer<TransactionBody.Builder> opBodyDef(HapiApiSpec spec) throws Throwable {
    file = fileSupplier.isPresent() ? fileSupplier.get().get() : file;
    var fid = TxnUtils.asFileId(file, spec);
    FileDeleteTransactionBody opBody = spec.txns().<FileDeleteTransactionBody, FileDeleteTransactionBody.Builder>body(FileDeleteTransactionBody.class, builder -> {
        builder.setFileID(fid);
    });
    return builder -> builder.setFileDelete(opBody);
}
Also used : FileDeleteTransactionBody(com.hederahashgraph.api.proto.java.FileDeleteTransactionBody) Transaction(com.hederahashgraph.api.proto.java.Transaction) FileDeleteTransactionBody(com.hederahashgraph.api.proto.java.FileDeleteTransactionBody) ResponseCodeEnum(com.hederahashgraph.api.proto.java.ResponseCodeEnum) HapiTxnOp(com.hedera.services.bdd.spec.transactions.HapiTxnOp) MoreObjects(com.google.common.base.MoreObjects) Function(java.util.function.Function) Supplier(java.util.function.Supplier) Consumer(java.util.function.Consumer) Key(com.hederahashgraph.api.proto.java.Key) List(java.util.List) Logger(org.apache.logging.log4j.Logger) TxnUtils(com.hedera.services.bdd.spec.transactions.TxnUtils) TransactionBody(com.hederahashgraph.api.proto.java.TransactionBody) HederaFunctionality(com.hederahashgraph.api.proto.java.HederaFunctionality) Optional(java.util.Optional) TransactionResponse(com.hederahashgraph.api.proto.java.TransactionResponse) HapiApiSpec(com.hedera.services.bdd.spec.HapiApiSpec) LogManager(org.apache.logging.log4j.LogManager)

Aggregations

MoreObjects (com.google.common.base.MoreObjects)1 HapiApiSpec (com.hedera.services.bdd.spec.HapiApiSpec)1 HapiTxnOp (com.hedera.services.bdd.spec.transactions.HapiTxnOp)1 TxnUtils (com.hedera.services.bdd.spec.transactions.TxnUtils)1 FileDeleteTransactionBody (com.hederahashgraph.api.proto.java.FileDeleteTransactionBody)1 HederaFunctionality (com.hederahashgraph.api.proto.java.HederaFunctionality)1 Key (com.hederahashgraph.api.proto.java.Key)1 ResponseCodeEnum (com.hederahashgraph.api.proto.java.ResponseCodeEnum)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 List (java.util.List)1 Optional (java.util.Optional)1 Consumer (java.util.function.Consumer)1 Function (java.util.function.Function)1 Supplier (java.util.function.Supplier)1 LogManager (org.apache.logging.log4j.LogManager)1 Logger (org.apache.logging.log4j.Logger)1