From b9635c0c3c9e4f577a4d1c97297d829318062623 Mon Sep 17 00:00:00 2001 From: Carlton N Hanna Date: Fri, 8 Mar 2024 07:57:23 -0700 Subject: [PATCH 1/8] add logging statement --- .../src/main/kotlin/io/provenance/explorer/service/GovService.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/service/src/main/kotlin/io/provenance/explorer/service/GovService.kt b/service/src/main/kotlin/io/provenance/explorer/service/GovService.kt index 48d282f1..8fcd4698 100644 --- a/service/src/main/kotlin/io/provenance/explorer/service/GovService.kt +++ b/service/src/main/kotlin/io/provenance/explorer/service/GovService.kt @@ -419,6 +419,7 @@ class GovService( GovProposalRecord.getAllPaginated(page.toOffset(count), count) .let { list -> runBlocking { + logger().debug("getting proposal list") val filtered = list.filter { it.dataV1 == null } if (filtered.isNotEmpty()) { filtered.asFlow().collect { prop -> From 704378425dda9b3911e898df32f96f0f487abc65 Mon Sep 17 00:00:00 2001 From: Carlton N Hanna Date: Fri, 8 Mar 2024 08:17:40 -0700 Subject: [PATCH 2/8] add another logging statement --- .../main/kotlin/io/provenance/explorer/service/GovService.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/service/src/main/kotlin/io/provenance/explorer/service/GovService.kt b/service/src/main/kotlin/io/provenance/explorer/service/GovService.kt index 8fcd4698..1725081d 100644 --- a/service/src/main/kotlin/io/provenance/explorer/service/GovService.kt +++ b/service/src/main/kotlin/io/provenance/explorer/service/GovService.kt @@ -437,7 +437,10 @@ class GovService( list } } - }.map { mapProposalRecord(it) } + }.map { + logger().info("mapping proposal record: $it") + mapProposalRecord(it) + } .let { val total = GovProposalRecord.getAllCount() PagedResults(total.pageCountOfResults(count), it, total) From 3cbd480617c3f65ac41af9a224cbf506983ee031 Mon Sep 17 00:00:00 2001 From: Carlton N Hanna Date: Mon, 11 Mar 2024 11:06:39 -0600 Subject: [PATCH 3/8] add messages from exchange protos dynamically --- buildSrc/src/main/kotlin/Dependencies.kt | 2 ++ service/build.gradle.kts | 1 + .../provenance/explorer/config/RestConfig.kt | 28 +++++++++++++++++-- 3 files changed, 28 insertions(+), 3 deletions(-) diff --git a/buildSrc/src/main/kotlin/Dependencies.kt b/buildSrc/src/main/kotlin/Dependencies.kt index 3628b04e..33ccc6ab 100644 --- a/buildSrc/src/main/kotlin/Dependencies.kt +++ b/buildSrc/src/main/kotlin/Dependencies.kt @@ -54,6 +54,7 @@ object Versions { const val ProvProto = "1.18.0-rc2" const val Postgres = "42.2.23" const val Protobuf = "3.21.9" + const val Reflections = "0.9.12" // Testing const val Jupiter = "5.9.1" @@ -89,6 +90,7 @@ object Libraries { const val KtorClientContentNeg = "io.ktor:ktor-client-content-negotiation:${Versions.Ktor}" const val KaseChange = "net.pearx.kasechange:kasechange:${Versions.KaseChange}" const val Json = "org.json:json:${Versions.Json}" + const val Reflections = "org.reflections:reflections:${Versions.Reflections}" // Protobuf const val GrpcNetty = "io.grpc:grpc-netty:${Versions.Grpc}" diff --git a/service/build.gradle.kts b/service/build.gradle.kts index d452387c..fa1cbf64 100644 --- a/service/build.gradle.kts +++ b/service/build.gradle.kts @@ -27,6 +27,7 @@ dependencies { implementation(Libraries.KotlinStdlib) implementation(Libraries.ProtobufKotlin) implementation(Libraries.ProvenanceProto) + implementation(Libraries.Reflections) implementation(Libraries.SpringBootStarterWeb) implementation(Libraries.SpringBootStarterJdbc) diff --git a/service/src/main/kotlin/io/provenance/explorer/config/RestConfig.kt b/service/src/main/kotlin/io/provenance/explorer/config/RestConfig.kt index 45d72984..dc7cfd97 100644 --- a/service/src/main/kotlin/io/provenance/explorer/config/RestConfig.kt +++ b/service/src/main/kotlin/io/provenance/explorer/config/RestConfig.kt @@ -1,5 +1,6 @@ package io.provenance.explorer.config +import com.google.protobuf.Descriptors import com.google.protobuf.util.JsonFormat import cosmos.auth.v1beta1.Auth import cosmos.authz.v1beta1.Authz @@ -148,6 +149,8 @@ import io.provenance.reward.v1.MsgClaimAllRewardsRequest import io.provenance.reward.v1.MsgClaimRewardsRequest import io.provenance.reward.v1.MsgCreateRewardProgramRequest import io.provenance.reward.v1.MsgEndRewardProgramRequest +import io.provenance.exchange.v1.MsgGovCreateMarketRequest +import org.reflections.Reflections import org.springframework.context.annotation.Bean import org.springframework.context.annotation.Configuration import org.springframework.context.annotation.Primary @@ -157,6 +160,7 @@ import org.springframework.web.client.RestTemplate import org.springframework.web.servlet.config.annotation.CorsRegistry import org.springframework.web.servlet.config.annotation.WebMvcConfigurer + @Configuration class RestConfig { @@ -233,8 +237,8 @@ fun pubKeyDescriptors() = cosmos.crypto.multisig.Keys.LegacyAminoPubKey.getDescriptor() ) -fun msgDescriptors() = - listOf( +fun msgDescriptors(): List { + val descriptors = mutableListOf( TxOuterClass.Tx.getDescriptor(), Tx.MsgSend.getDescriptor(), Tx.MsgMultiSend.getDescriptor(), @@ -357,9 +361,27 @@ fun msgDescriptors() = MsgVote.getDescriptor(), MsgWithdrawProposal.getDescriptor(), MsgExec.getDescriptor(), - MsgLeaveGroup.getDescriptor() + MsgLeaveGroup.getDescriptor(), ) + descriptors.addAll(findMsgDescriptorsInPackage("io.provenance.exchange.v1")) + + return descriptors +} + +private fun findMsgDescriptorsInPackage(packageName: String): List { + val reflections = Reflections(packageName) + val messageClasses = reflections.getSubTypesOf(com.google.protobuf.Message::class.java) + + return messageClasses.filter { it.simpleName.startsWith("Msg") }.mapNotNull { + try { + it.getMethod("getDescriptor").invoke(null) as Descriptors.Descriptor + } catch (e: Exception) { + null // or log error + } + } +} + fun contentDescriptors() = listOf( Gov.TextProposal.getDescriptor(), From 0699413dce9eaf83dbd5777f674e5f3115578d40 Mon Sep 17 00:00:00 2001 From: Carlton N Hanna Date: Mon, 11 Mar 2024 11:11:07 -0600 Subject: [PATCH 4/8] fix lint, remove logging --- .../main/kotlin/io/provenance/explorer/config/RestConfig.kt | 4 +--- .../main/kotlin/io/provenance/explorer/service/GovService.kt | 2 -- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/service/src/main/kotlin/io/provenance/explorer/config/RestConfig.kt b/service/src/main/kotlin/io/provenance/explorer/config/RestConfig.kt index dc7cfd97..3d107b08 100644 --- a/service/src/main/kotlin/io/provenance/explorer/config/RestConfig.kt +++ b/service/src/main/kotlin/io/provenance/explorer/config/RestConfig.kt @@ -149,7 +149,6 @@ import io.provenance.reward.v1.MsgClaimAllRewardsRequest import io.provenance.reward.v1.MsgClaimRewardsRequest import io.provenance.reward.v1.MsgCreateRewardProgramRequest import io.provenance.reward.v1.MsgEndRewardProgramRequest -import io.provenance.exchange.v1.MsgGovCreateMarketRequest import org.reflections.Reflections import org.springframework.context.annotation.Bean import org.springframework.context.annotation.Configuration @@ -160,7 +159,6 @@ import org.springframework.web.client.RestTemplate import org.springframework.web.servlet.config.annotation.CorsRegistry import org.springframework.web.servlet.config.annotation.WebMvcConfigurer - @Configuration class RestConfig { @@ -361,7 +359,7 @@ fun msgDescriptors(): List { MsgVote.getDescriptor(), MsgWithdrawProposal.getDescriptor(), MsgExec.getDescriptor(), - MsgLeaveGroup.getDescriptor(), + MsgLeaveGroup.getDescriptor() ) descriptors.addAll(findMsgDescriptorsInPackage("io.provenance.exchange.v1")) diff --git a/service/src/main/kotlin/io/provenance/explorer/service/GovService.kt b/service/src/main/kotlin/io/provenance/explorer/service/GovService.kt index 1725081d..c36bac2f 100644 --- a/service/src/main/kotlin/io/provenance/explorer/service/GovService.kt +++ b/service/src/main/kotlin/io/provenance/explorer/service/GovService.kt @@ -419,7 +419,6 @@ class GovService( GovProposalRecord.getAllPaginated(page.toOffset(count), count) .let { list -> runBlocking { - logger().debug("getting proposal list") val filtered = list.filter { it.dataV1 == null } if (filtered.isNotEmpty()) { filtered.asFlow().collect { prop -> @@ -438,7 +437,6 @@ class GovService( } } }.map { - logger().info("mapping proposal record: $it") mapProposalRecord(it) } .let { From 32cc3fc1469bfac7a542ab6d43d65fe48e2db412 Mon Sep 17 00:00:00 2001 From: Carlton N Hanna Date: Mon, 11 Mar 2024 12:22:00 -0600 Subject: [PATCH 5/8] add support for dynamically loading all proto descriptors for provenance --- .../provenance/explorer/config/RestConfig.kt | 229 ++---------------- 1 file changed, 22 insertions(+), 207 deletions(-) diff --git a/service/src/main/kotlin/io/provenance/explorer/config/RestConfig.kt b/service/src/main/kotlin/io/provenance/explorer/config/RestConfig.kt index 3d107b08..c106372d 100644 --- a/service/src/main/kotlin/io/provenance/explorer/config/RestConfig.kt +++ b/service/src/main/kotlin/io/provenance/explorer/config/RestConfig.kt @@ -48,107 +48,6 @@ import cosmwasm.wasm.v1.Proposal.UpdateInstantiateConfigProposal import ibc.applications.interchain_accounts.v1.Account.InterchainAccount import ibc.core.client.v1.Client import ibc.lightclients.tendermint.v1.Tendermint -import io.provenance.attribute.v1.EventAttributeAdd -import io.provenance.attribute.v1.EventAttributeDelete -import io.provenance.attribute.v1.EventAttributeDistinctDelete -import io.provenance.attribute.v1.MsgAddAttributeRequest -import io.provenance.attribute.v1.MsgDeleteAttributeRequest -import io.provenance.attribute.v1.MsgDeleteDistinctAttributeRequest -import io.provenance.attribute.v1.MsgUpdateAttributeRequest -import io.provenance.marker.v1.AddMarkerProposal -import io.provenance.marker.v1.ChangeStatusProposal -import io.provenance.marker.v1.EventDenomUnit -import io.provenance.marker.v1.EventMarkerAccess -import io.provenance.marker.v1.EventMarkerActivate -import io.provenance.marker.v1.EventMarkerAdd -import io.provenance.marker.v1.EventMarkerAddAccess -import io.provenance.marker.v1.EventMarkerBurn -import io.provenance.marker.v1.EventMarkerCancel -import io.provenance.marker.v1.EventMarkerDelete -import io.provenance.marker.v1.EventMarkerDeleteAccess -import io.provenance.marker.v1.EventMarkerFinalize -import io.provenance.marker.v1.EventMarkerMint -import io.provenance.marker.v1.EventMarkerSetDenomMetadata -import io.provenance.marker.v1.EventMarkerTransfer -import io.provenance.marker.v1.EventMarkerWithdraw -import io.provenance.marker.v1.MarkerAccount -import io.provenance.marker.v1.MarkerTransferAuthorization -import io.provenance.marker.v1.MsgActivateRequest -import io.provenance.marker.v1.MsgAddAccessRequest -import io.provenance.marker.v1.MsgAddMarkerRequest -import io.provenance.marker.v1.MsgBurnRequest -import io.provenance.marker.v1.MsgCancelRequest -import io.provenance.marker.v1.MsgDeleteAccessRequest -import io.provenance.marker.v1.MsgDeleteRequest -import io.provenance.marker.v1.MsgFinalizeRequest -import io.provenance.marker.v1.MsgMintRequest -import io.provenance.marker.v1.MsgSetDenomMetadataRequest -import io.provenance.marker.v1.MsgTransferRequest -import io.provenance.marker.v1.MsgWithdrawRequest -import io.provenance.marker.v1.RemoveAdministratorProposal -import io.provenance.marker.v1.SetAdministratorProposal -import io.provenance.marker.v1.SetDenomMetadataProposal -import io.provenance.marker.v1.SupplyDecreaseProposal -import io.provenance.marker.v1.SupplyIncreaseProposal -import io.provenance.marker.v1.WithdrawEscrowProposal -import io.provenance.metadata.v1.EventContractSpecificationCreated -import io.provenance.metadata.v1.EventContractSpecificationDeleted -import io.provenance.metadata.v1.EventContractSpecificationUpdated -import io.provenance.metadata.v1.EventOSLocatorCreated -import io.provenance.metadata.v1.EventOSLocatorDeleted -import io.provenance.metadata.v1.EventOSLocatorUpdated -import io.provenance.metadata.v1.EventRecordCreated -import io.provenance.metadata.v1.EventRecordDeleted -import io.provenance.metadata.v1.EventRecordSpecificationCreated -import io.provenance.metadata.v1.EventRecordSpecificationDeleted -import io.provenance.metadata.v1.EventRecordSpecificationUpdated -import io.provenance.metadata.v1.EventRecordUpdated -import io.provenance.metadata.v1.EventScopeCreated -import io.provenance.metadata.v1.EventScopeDeleted -import io.provenance.metadata.v1.EventScopeSpecificationCreated -import io.provenance.metadata.v1.EventScopeSpecificationDeleted -import io.provenance.metadata.v1.EventScopeSpecificationUpdated -import io.provenance.metadata.v1.EventScopeUpdated -import io.provenance.metadata.v1.EventSessionCreated -import io.provenance.metadata.v1.EventSessionDeleted -import io.provenance.metadata.v1.EventSessionUpdated -import io.provenance.metadata.v1.EventTxCompleted -import io.provenance.metadata.v1.MsgAddContractSpecToScopeSpecRequest -import io.provenance.metadata.v1.MsgAddScopeDataAccessRequest -import io.provenance.metadata.v1.MsgAddScopeOwnerRequest -import io.provenance.metadata.v1.MsgBindOSLocatorRequest -import io.provenance.metadata.v1.MsgDeleteContractSpecFromScopeSpecRequest -import io.provenance.metadata.v1.MsgDeleteContractSpecificationRequest -import io.provenance.metadata.v1.MsgDeleteOSLocatorRequest -import io.provenance.metadata.v1.MsgDeleteRecordRequest -import io.provenance.metadata.v1.MsgDeleteRecordSpecificationRequest -import io.provenance.metadata.v1.MsgDeleteScopeDataAccessRequest -import io.provenance.metadata.v1.MsgDeleteScopeOwnerRequest -import io.provenance.metadata.v1.MsgDeleteScopeRequest -import io.provenance.metadata.v1.MsgDeleteScopeSpecificationRequest -import io.provenance.metadata.v1.MsgModifyOSLocatorRequest -import io.provenance.metadata.v1.MsgP8eMemorializeContractRequest -import io.provenance.metadata.v1.MsgWriteContractSpecificationRequest -import io.provenance.metadata.v1.MsgWriteP8eContractSpecRequest -import io.provenance.metadata.v1.MsgWriteRecordRequest -import io.provenance.metadata.v1.MsgWriteRecordSpecificationRequest -import io.provenance.metadata.v1.MsgWriteScopeRequest -import io.provenance.metadata.v1.MsgWriteScopeSpecificationRequest -import io.provenance.metadata.v1.MsgWriteSessionRequest -import io.provenance.msgfees.v1.AddMsgFeeProposal -import io.provenance.msgfees.v1.RemoveMsgFeeProposal -import io.provenance.msgfees.v1.UpdateConversionFeeDenomProposal -import io.provenance.msgfees.v1.UpdateMsgFeeProposal -import io.provenance.msgfees.v1.UpdateNhashPerUsdMilProposal -import io.provenance.name.v1.CreateRootNameProposal -import io.provenance.name.v1.EventNameBound -import io.provenance.name.v1.EventNameUnbound -import io.provenance.name.v1.MsgBindNameRequest -import io.provenance.name.v1.MsgDeleteNameRequest -import io.provenance.reward.v1.MsgClaimAllRewardsRequest -import io.provenance.reward.v1.MsgClaimRewardsRequest -import io.provenance.reward.v1.MsgCreateRewardProgramRequest -import io.provenance.reward.v1.MsgEndRewardProgramRequest import org.reflections.Reflections import org.springframework.context.annotation.Bean import org.springframework.context.annotation.Configuration @@ -171,6 +70,7 @@ class RestConfig { .add(contentDescriptors()) .add(events()) .add(miscAnys()) + .add(packageDescriptors()) .build() return JsonFormat.printer().usingTypeRegistry(typeRegistry) } @@ -184,6 +84,7 @@ class RestConfig { .add(contentDescriptors()) .add(events()) .add(miscAnys()) + .add(packageDescriptors()) .build() return JsonFormat.parser().usingTypeRegistry(typeRegistry) } @@ -216,7 +117,6 @@ class RestConfig { fun accountDescriptors() = listOf( - MarkerAccount.getDescriptor(), Auth.BaseAccount.getDescriptor(), Auth.ModuleAccount.getDescriptor(), Vesting.BaseVestingAccount.getDescriptor(), @@ -262,38 +162,6 @@ fun msgDescriptors(): List { cosmos.staking.v1beta1.Tx.MsgUndelegate.getDescriptor(), cosmos.vesting.v1beta1.Tx.MsgCreateVestingAccount.getDescriptor(), MsgCancelUnbondingDelegation.getDescriptor(), - MsgWithdrawRequest.getDescriptor(), - MsgAddMarkerRequest.getDescriptor(), - MsgAddAccessRequest.getDescriptor(), - MsgDeleteAccessRequest.getDescriptor(), - MsgFinalizeRequest.getDescriptor(), - MsgActivateRequest.getDescriptor(), - MsgCancelRequest.getDescriptor(), - MsgDeleteRequest.getDescriptor(), - MsgMintRequest.getDescriptor(), - MsgBurnRequest.getDescriptor(), - MsgTransferRequest.getDescriptor(), - MsgSetDenomMetadataRequest.getDescriptor(), - MsgBindNameRequest.getDescriptor(), - MsgDeleteNameRequest.getDescriptor(), - MsgAddAttributeRequest.getDescriptor(), - MsgDeleteAttributeRequest.getDescriptor(), - MsgWriteP8eContractSpecRequest.getDescriptor(), - MsgP8eMemorializeContractRequest.getDescriptor(), - MsgWriteScopeRequest.getDescriptor(), - MsgDeleteScopeRequest.getDescriptor(), - MsgWriteSessionRequest.getDescriptor(), - MsgWriteRecordRequest.getDescriptor(), - MsgDeleteRecordRequest.getDescriptor(), - MsgWriteScopeSpecificationRequest.getDescriptor(), - MsgDeleteScopeSpecificationRequest.getDescriptor(), - MsgWriteContractSpecificationRequest.getDescriptor(), - MsgDeleteContractSpecificationRequest.getDescriptor(), - MsgWriteRecordSpecificationRequest.getDescriptor(), - MsgDeleteRecordSpecificationRequest.getDescriptor(), - MsgBindOSLocatorRequest.getDescriptor(), - MsgDeleteOSLocatorRequest.getDescriptor(), - MsgModifyOSLocatorRequest.getDescriptor(), cosmwasm.wasm.v1.Tx.MsgStoreCode.getDescriptor(), cosmwasm.wasm.v1.Tx.MsgInstantiateContract.getDescriptor(), cosmwasm.wasm.v1.Tx.MsgExecuteContract.getDescriptor(), @@ -326,14 +194,6 @@ fun msgDescriptors(): List { ibc.core.connection.v1.Tx.MsgConnectionOpenTry.getDescriptor(), ibc.core.connection.v1.Tx.MsgConnectionOpenAck.getDescriptor(), ibc.core.connection.v1.Tx.MsgConnectionOpenConfirm.getDescriptor(), - MsgAddScopeDataAccessRequest.getDescriptor(), - MsgDeleteScopeDataAccessRequest.getDescriptor(), - MsgAddScopeOwnerRequest.getDescriptor(), - MsgDeleteScopeOwnerRequest.getDescriptor(), - MsgUpdateAttributeRequest.getDescriptor(), - MsgDeleteDistinctAttributeRequest.getDescriptor(), - MsgAddContractSpecToScopeSpecRequest.getDescriptor(), - MsgDeleteContractSpecFromScopeSpecRequest.getDescriptor(), cosmos.authz.v1beta1.Tx.MsgGrant.getDescriptor(), cosmos.authz.v1beta1.Tx.MsgExec.getDescriptor(), cosmos.authz.v1beta1.Tx.MsgRevoke.getDescriptor(), @@ -342,10 +202,6 @@ fun msgDescriptors(): List { Ibc.MsgIBCSend.getDescriptor(), Ibc.MsgIBCCloseChannel.getDescriptor(), MsgSend.getDescriptor(), - MsgCreateRewardProgramRequest.getDescriptor(), - MsgEndRewardProgramRequest.getDescriptor(), - MsgClaimRewardsRequest.getDescriptor(), - MsgClaimAllRewardsRequest.getDescriptor(), MsgCreateGroup.getDescriptor(), MsgCreateGroupWithPolicy.getDescriptor(), MsgCreateGroupPolicy.getDescriptor(), @@ -361,17 +217,32 @@ fun msgDescriptors(): List { MsgExec.getDescriptor(), MsgLeaveGroup.getDescriptor() ) + return descriptors +} - descriptors.addAll(findMsgDescriptorsInPackage("io.provenance.exchange.v1")) - +fun packageDescriptors(): List { + val descriptors = mutableListOf() + descriptors.addAll(findDescriptorsInPackage("io.provenance.attribute.v1")) + descriptors.addAll(findDescriptorsInPackage("io.provenance.exchange.v1")) + descriptors.addAll(findDescriptorsInPackage("io.provenance.hold.v1")) + descriptors.addAll(findDescriptorsInPackage("io.provenance.ibchooks.v1")) + descriptors.addAll(findDescriptorsInPackage("io.provenance.ibcratelimit.v1")) + descriptors.addAll(findDescriptorsInPackage("io.provenance.marker.v1")) + descriptors.addAll(findDescriptorsInPackage("io.provenance.metadata.v1")) + descriptors.addAll(findDescriptorsInPackage("io.provenance.msgfees.v1")) + descriptors.addAll(findDescriptorsInPackage("io.provenance.name.v1")) + descriptors.addAll(findDescriptorsInPackage("io.provenance.oracle.v1")) + descriptors.addAll(findDescriptorsInPackage("io.provenance.reward.v1")) + descriptors.addAll(findDescriptorsInPackage("io.provenance.trigger.v1")) return descriptors } -private fun findMsgDescriptorsInPackage(packageName: String): List { + +private fun findDescriptorsInPackage(packageName: String): List { val reflections = Reflections(packageName) val messageClasses = reflections.getSubTypesOf(com.google.protobuf.Message::class.java) - return messageClasses.filter { it.simpleName.startsWith("Msg") }.mapNotNull { + return messageClasses.mapNotNull { try { it.getMethod("getDescriptor").invoke(null) as Descriptors.Descriptor } catch (e: Exception) { @@ -388,15 +259,6 @@ fun contentDescriptors() = Upgrade.CancelSoftwareUpgradeProposal.getDescriptor(), Distribution.CommunityPoolSpendProposal.getDescriptor(), Distribution.CommunityPoolSpendProposalWithDeposit.getDescriptor(), - AddMarkerProposal.getDescriptor(), - SupplyIncreaseProposal.getDescriptor(), - SupplyDecreaseProposal.getDescriptor(), - SetAdministratorProposal.getDescriptor(), - RemoveAdministratorProposal.getDescriptor(), - ChangeStatusProposal.getDescriptor(), - WithdrawEscrowProposal.getDescriptor(), - SetDenomMetadataProposal.getDescriptor(), - CreateRootNameProposal.getDescriptor(), Proposal.StoreCodeProposal.getDescriptor(), Proposal.InstantiateContractProposal.getDescriptor(), Proposal.MigrateContractProposal.getDescriptor(), @@ -415,56 +277,10 @@ fun contentDescriptors() = cosmwasm.wasm.v1beta1.Proposal.PinCodesProposal.getDescriptor(), cosmwasm.wasm.v1beta1.Proposal.UnpinCodesProposal.getDescriptor(), Client.ClientUpdateProposal.getDescriptor(), - Client.UpgradeProposal.getDescriptor(), - AddMsgFeeProposal.getDescriptor(), - UpdateMsgFeeProposal.getDescriptor(), - RemoveMsgFeeProposal.getDescriptor(), - UpdateNhashPerUsdMilProposal.getDescriptor(), - UpdateConversionFeeDenomProposal.getDescriptor() + Client.UpgradeProposal.getDescriptor() ) fun events() = listOf( - EventNameBound.getDescriptor(), - EventNameUnbound.getDescriptor(), - EventMarkerAdd.getDescriptor(), - EventMarkerAddAccess.getDescriptor(), - EventMarkerAccess.getDescriptor(), - EventMarkerDeleteAccess.getDescriptor(), - EventMarkerFinalize.getDescriptor(), - EventMarkerActivate.getDescriptor(), - EventMarkerCancel.getDescriptor(), - EventMarkerDelete.getDescriptor(), - EventMarkerMint.getDescriptor(), - EventMarkerBurn.getDescriptor(), - EventMarkerWithdraw.getDescriptor(), - EventMarkerTransfer.getDescriptor(), - EventMarkerSetDenomMetadata.getDescriptor(), - EventDenomUnit.getDescriptor(), - EventTxCompleted.getDescriptor(), - EventScopeCreated.getDescriptor(), - EventScopeUpdated.getDescriptor(), - EventScopeDeleted.getDescriptor(), - EventSessionCreated.getDescriptor(), - EventSessionUpdated.getDescriptor(), - EventSessionDeleted.getDescriptor(), - EventRecordCreated.getDescriptor(), - EventRecordUpdated.getDescriptor(), - EventRecordDeleted.getDescriptor(), - EventScopeSpecificationCreated.getDescriptor(), - EventScopeSpecificationUpdated.getDescriptor(), - EventScopeSpecificationDeleted.getDescriptor(), - EventContractSpecificationCreated.getDescriptor(), - EventContractSpecificationUpdated.getDescriptor(), - EventContractSpecificationDeleted.getDescriptor(), - EventRecordSpecificationCreated.getDescriptor(), - EventRecordSpecificationUpdated.getDescriptor(), - EventRecordSpecificationDeleted.getDescriptor(), - EventOSLocatorCreated.getDescriptor(), - EventOSLocatorUpdated.getDescriptor(), - EventOSLocatorDeleted.getDescriptor(), - EventAttributeAdd.getDescriptor(), - EventAttributeDelete.getDescriptor(), - EventAttributeDistinctDelete.getDescriptor(), Event.EventGrant.getDescriptor(), Event.EventRevoke.getDescriptor(), EventCreateGroup.getDescriptor(), @@ -486,7 +302,6 @@ fun miscAnys() = listOf( Feegrant.PeriodicAllowance.getDescriptor(), Feegrant.AllowedMsgAllowance.getDescriptor(), cosmos.staking.v1beta1.Authz.StakeAuthorization.getDescriptor(), - MarkerTransferAuthorization.getDescriptor(), CountAuthorization.getDescriptor(), GrantAuthorization.getDescriptor(), ThresholdDecisionPolicy.getDescriptor(), From 4794d89b1218fc04c852e1001153e039064bc11a Mon Sep 17 00:00:00 2001 From: Carlton N Hanna Date: Tue, 12 Mar 2024 09:21:28 -0600 Subject: [PATCH 6/8] fix lint --- .../src/main/kotlin/io/provenance/explorer/config/RestConfig.kt | 1 - 1 file changed, 1 deletion(-) diff --git a/service/src/main/kotlin/io/provenance/explorer/config/RestConfig.kt b/service/src/main/kotlin/io/provenance/explorer/config/RestConfig.kt index c106372d..ada262c5 100644 --- a/service/src/main/kotlin/io/provenance/explorer/config/RestConfig.kt +++ b/service/src/main/kotlin/io/provenance/explorer/config/RestConfig.kt @@ -237,7 +237,6 @@ fun packageDescriptors(): List { return descriptors } - private fun findDescriptorsInPackage(packageName: String): List { val reflections = Reflections(packageName) val messageClasses = reflections.getSubTypesOf(com.google.protobuf.Message::class.java) From 0c7ca9a7d8f92ff90f3d6f2449429befe45cbeba Mon Sep 17 00:00:00 2001 From: Carlton N Hanna Date: Tue, 12 Mar 2024 09:24:23 -0600 Subject: [PATCH 7/8] Add changelog entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d03c56a3..f66260b4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,6 +38,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Improvements * Updated Prov Protos to 1.18.0-rc2 [#510](https://github.com/provenance-io/explorer-service/issues/510) +* Automate the registration of Provenance protobuf module descriptors [#514](https://github.com/provenance-io/explorer-service/issues/514) ## [v5.7.0](https://github.com/provenance-io/explorer-service/releases/tag/v5.7.0) - 2023-11-14 ### Release Name: Peter Fidler From 7857979d098e1e4ec07b106d02600ecdc5a242a7 Mon Sep 17 00:00:00 2001 From: Carlton N Hanna Date: Tue, 12 Mar 2024 09:26:27 -0600 Subject: [PATCH 8/8] not going to log error --- .../src/main/kotlin/io/provenance/explorer/config/RestConfig.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service/src/main/kotlin/io/provenance/explorer/config/RestConfig.kt b/service/src/main/kotlin/io/provenance/explorer/config/RestConfig.kt index ada262c5..a3b8b37c 100644 --- a/service/src/main/kotlin/io/provenance/explorer/config/RestConfig.kt +++ b/service/src/main/kotlin/io/provenance/explorer/config/RestConfig.kt @@ -245,7 +245,7 @@ private fun findDescriptorsInPackage(packageName: String): List