Search in sources :

Example 1 with ConsensusUpdateTopicTransactionBody

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);
}
Also used : Transaction(com.hederahashgraph.api.proto.java.Transaction) HapiTxnOp(com.hedera.services.bdd.spec.transactions.HapiTxnOp) StringValue(com.google.protobuf.StringValue) EMPTY_KEY(com.hedera.services.bdd.suites.HapiApiSuite.EMPTY_KEY) Function(java.util.function.Function) ArrayList(java.util.ArrayList) ConsensusUpdateTopic(com.hederahashgraph.api.proto.java.HederaFunctionality.ConsensusUpdateTopic) OptionalLong(java.util.OptionalLong) TxnUtils.asId(com.hedera.services.bdd.spec.transactions.TxnUtils.asId) CommonUtils(com.hedera.services.legacy.proto.utils.CommonUtils) TxnUtils.asTopicId(com.hedera.services.bdd.spec.transactions.TxnUtils.asTopicId) TransactionBody(com.hederahashgraph.api.proto.java.TransactionBody) TransactionResponse(com.hederahashgraph.api.proto.java.TransactionResponse) TxnUtils.asTimestamp(com.hedera.services.bdd.spec.transactions.TxnUtils.asTimestamp) Timestamp(com.hederahashgraph.api.proto.java.Timestamp) ConsensusServiceFeeBuilder(com.hederahashgraph.fee.ConsensusServiceFeeBuilder) ResponseCodeEnum(com.hederahashgraph.api.proto.java.ResponseCodeEnum) MoreObjects(com.google.common.base.MoreObjects) ConsensusUpdateTopicTransactionBody(com.hederahashgraph.api.proto.java.ConsensusUpdateTopicTransactionBody) TxnUtils.asDuration(com.hedera.services.bdd.spec.transactions.TxnUtils.asDuration) Consumer(java.util.function.Consumer) ConsensusCreateTopicTransactionBody(com.hederahashgraph.api.proto.java.ConsensusCreateTopicTransactionBody) Key(com.hederahashgraph.api.proto.java.Key) List(java.util.List) HederaFunctionality(com.hederahashgraph.api.proto.java.HederaFunctionality) Optional(java.util.Optional) FeeCalculator(com.hedera.services.bdd.spec.fees.FeeCalculator) HapiApiSpec(com.hedera.services.bdd.spec.HapiApiSpec) ConsensusUpdateTopicTransactionBody(com.hederahashgraph.api.proto.java.ConsensusUpdateTopicTransactionBody) ConsensusServiceFeeBuilder(com.hederahashgraph.fee.ConsensusServiceFeeBuilder)

Aggregations

MoreObjects (com.google.common.base.MoreObjects)1 StringValue (com.google.protobuf.StringValue)1 HapiApiSpec (com.hedera.services.bdd.spec.HapiApiSpec)1 FeeCalculator (com.hedera.services.bdd.spec.fees.FeeCalculator)1 HapiTxnOp (com.hedera.services.bdd.spec.transactions.HapiTxnOp)1 TxnUtils.asDuration (com.hedera.services.bdd.spec.transactions.TxnUtils.asDuration)1 TxnUtils.asId (com.hedera.services.bdd.spec.transactions.TxnUtils.asId)1 TxnUtils.asTimestamp (com.hedera.services.bdd.spec.transactions.TxnUtils.asTimestamp)1 TxnUtils.asTopicId (com.hedera.services.bdd.spec.transactions.TxnUtils.asTopicId)1 EMPTY_KEY (com.hedera.services.bdd.suites.HapiApiSuite.EMPTY_KEY)1 CommonUtils (com.hedera.services.legacy.proto.utils.CommonUtils)1 ConsensusCreateTopicTransactionBody (com.hederahashgraph.api.proto.java.ConsensusCreateTopicTransactionBody)1 ConsensusUpdateTopicTransactionBody (com.hederahashgraph.api.proto.java.ConsensusUpdateTopicTransactionBody)1 HederaFunctionality (com.hederahashgraph.api.proto.java.HederaFunctionality)1 ConsensusUpdateTopic (com.hederahashgraph.api.proto.java.HederaFunctionality.ConsensusUpdateTopic)1 Key (com.hederahashgraph.api.proto.java.Key)1 ResponseCodeEnum (com.hederahashgraph.api.proto.java.ResponseCodeEnum)1 Timestamp (com.hederahashgraph.api.proto.java.Timestamp)1 Transaction (com.hederahashgraph.api.proto.java.Transaction)1 TransactionBody (com.hederahashgraph.api.proto.java.TransactionBody)1