use of com.hederahashgraph.api.proto.java.ConsensusUpdateTopicTransactionBody in project hedera-services by hashgraph.
the class HapiTopicUpdate method opBodyDef.
@Override
protected Consumer<TransactionBody.Builder> opBodyDef(HapiApiSpec spec) throws Throwable {
newAdminKeyName.ifPresent(name -> newAdminKey = Optional.of(spec.registry().getKey(name)));
newSubmitKeyName.ifPresent(name -> newSubmitKey = Optional.of(spec.registry().getKey(name)));
ConsensusUpdateTopicTransactionBody opBody = spec.txns().<ConsensusUpdateTopicTransactionBody, ConsensusUpdateTopicTransactionBody.Builder>body(ConsensusUpdateTopicTransactionBody.class, b -> {
b.setTopicID(asTopicId(topic, spec));
topicMemo.ifPresent(memo -> b.setMemo(StringValue.of(memo)));
newAdminKey.ifPresent(b::setAdminKey);
newSubmitKey.ifPresent(b::setSubmitKey);
newExpiry.ifPresent(s -> b.setExpirationTime(asTimestamp(s)));
newAutoRenewPeriod.ifPresent(s -> b.setAutoRenewPeriod(asDuration(s)));
newAutoRenewAccount.ifPresent(id -> b.setAutoRenewAccount(asId(id, spec)));
});
return b -> b.setConsensusUpdateTopic(opBody);
}
Aggregations