io.provenance.scope.contract.proto.Extensions.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of contract-proto Show documentation
Show all versions of contract-proto Show documentation
A collection of libraries that interact and run Provenance Java based contracts.
// package io.provenance.scope.contract.proto
// import com.google.protobuf.DescriptorProtos
// import com.google.protobuf.GeneratedMessage
// import com.google.protobuf.ProtocolMessageEnum
// import io.provenance.scope.contract.proto.ContractScope.Envelope.Status
// /**
// * Get enum description for a status value.
// */
// fun Status.getDescription(): String {
// return getExtension(ContractScope.description)
// }
// /**
// * com.google.protobuf.ProtocolMessageEnum -> String Description
// */
// fun ProtocolMessageEnum.getExtension(extension: GeneratedMessage.GeneratedExtension): T {
// try {
// return valueDescriptor.options.getExtension(extension)
// } catch (e: ArrayIndexOutOfBoundsException) {
// throw IllegalArgumentException("${javaClass.name}.$this missing extension [(${extension.descriptor.name}) = ???]. Try filtering it out")
// }
// }