Search in sources :

Example 1 with SystemUndelete

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

the class HapiSysUndelete method opBodyDef.

@Override
protected Consumer<TransactionBody.Builder> opBodyDef(HapiApiSpec spec) throws Throwable {
    if (file.isPresent() && contract.isPresent()) {
        Assertions.fail("Ambiguous SystemUndelete---both file and contract present!");
    }
    SystemUndeleteTransactionBody opBody = spec.txns().<SystemUndeleteTransactionBody, SystemUndeleteTransactionBody.Builder>body(SystemUndeleteTransactionBody.class, b -> {
        file.ifPresent(n -> b.setFileID(asFileId(n, spec)));
        contract.ifPresent(n -> b.setContractID(asContractId(n, spec)));
    });
    return b -> b.setSystemUndelete(opBody);
}
Also used : Transaction(com.hederahashgraph.api.proto.java.Transaction) TxnUtils.asFileId(com.hedera.services.bdd.spec.transactions.TxnUtils.asFileId) HapiTxnOp(com.hedera.services.bdd.spec.transactions.HapiTxnOp) MoreObjects(com.google.common.base.MoreObjects) Function(java.util.function.Function) Consumer(java.util.function.Consumer) SystemUndeleteTransactionBody(com.hederahashgraph.api.proto.java.SystemUndeleteTransactionBody) TransactionBody(com.hederahashgraph.api.proto.java.TransactionBody) HederaFunctionality(com.hederahashgraph.api.proto.java.HederaFunctionality) Assertions(org.junit.jupiter.api.Assertions) Optional(java.util.Optional) TransactionResponse(com.hederahashgraph.api.proto.java.TransactionResponse) HapiApiSpec(com.hedera.services.bdd.spec.HapiApiSpec) TxnUtils.asContractId(com.hedera.services.bdd.spec.transactions.TxnUtils.asContractId) SystemUndelete(com.hederahashgraph.api.proto.java.HederaFunctionality.SystemUndelete) SystemUndeleteTransactionBody(com.hederahashgraph.api.proto.java.SystemUndeleteTransactionBody)

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.asContractId (com.hedera.services.bdd.spec.transactions.TxnUtils.asContractId)1 TxnUtils.asFileId (com.hedera.services.bdd.spec.transactions.TxnUtils.asFileId)1 HederaFunctionality (com.hederahashgraph.api.proto.java.HederaFunctionality)1 SystemUndelete (com.hederahashgraph.api.proto.java.HederaFunctionality.SystemUndelete)1 SystemUndeleteTransactionBody (com.hederahashgraph.api.proto.java.SystemUndeleteTransactionBody)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 Optional (java.util.Optional)1 Consumer (java.util.function.Consumer)1 Function (java.util.function.Function)1 Assertions (org.junit.jupiter.api.Assertions)1