use of com.hederahashgraph.api.proto.java.HederaFunctionality.SystemDelete in project hedera-services by hashgraph.
the class HapiSysDelete method opBodyDef.
@Override
protected Consumer<TransactionBody.Builder> opBodyDef(HapiApiSpec spec) throws Throwable {
if (file.isPresent() && contract.isPresent()) {
Assertions.fail("Ambiguous SystemDelete---both file and contract present!");
}
SystemDeleteTransactionBody opBody = spec.txns().<SystemDeleteTransactionBody, SystemDeleteTransactionBody.Builder>body(SystemDeleteTransactionBody.class, b -> {
newExpiry.ifPresent(l -> b.setExpirationTime(TimestampSeconds.newBuilder().setSeconds(l)));
file.ifPresent(n -> b.setFileID(asFileId(n, spec)));
contract.ifPresent(n -> b.setContractID(asContractId(n, spec)));
});
return b -> b.setSystemDelete(opBody);
}
Aggregations