use of com.hedera.services.sigs.metadata.SafeLookupResult in project hedera-services by hashgraph.
the class DefaultTopicLookup method safeLookup.
@Override
public SafeLookupResult<TopicSigningMetadata> safeLookup(TopicID id) {
var topic = topics.get().get(fromTopicId(id));
if (topic == null || topic.isDeleted()) {
return SafeLookupResult.failure(INVALID_TOPIC);
} else {
final var effAdminKey = topic.hasAdminKey() ? topic.getAdminKey() : null;
final var effSubmitKey = topic.hasSubmitKey() ? topic.getSubmitKey() : null;
return new SafeLookupResult<>(new TopicSigningMetadata(effAdminKey, effSubmitKey));
}
}
Aggregations