From 8915e02e3580397ae04866d642aa48fb2052621c Mon Sep 17 00:00:00 2001 From: Fedor Partanskiy Date: Mon, 26 Aug 2024 22:58:06 +0300 Subject: [PATCH] add new version libs Signed-off-by: Fedor Partanskiy --- cmd/common/signer/signer.go | 2 +- cmd/configtxgen/main.go | 2 +- cmd/configtxlator/main.go | 22 +- cmd/osnadmin/main.go | 4 +- cmd/osnadmin/main_test.go | 4 +- cmd/osnadmin/mocks/channel_management.go | 2 +- cmd/osnadmin/osnadmin_suite_test.go | 2 +- common/capabilities/application.go | 2 +- common/capabilities/application_test.go | 2 +- common/capabilities/capabilities.go | 2 +- common/capabilities/capabilities_test.go | 2 +- common/capabilities/channel.go | 2 +- common/capabilities/channel_test.go | 2 +- common/capabilities/orderer.go | 2 +- common/capabilities/orderer_test.go | 2 +- common/cauthdsl/cauthdsl.go | 4 +- common/cauthdsl/cauthdsl_test.go | 6 +- common/cauthdsl/policy.go | 4 +- common/cauthdsl/policy_test.go | 4 +- common/chaincode/metadata.go | 4 +- common/chaincode/metadata_test.go | 2 +- common/channelconfig/acls.go | 2 +- common/channelconfig/acls_test.go | 2 +- common/channelconfig/api.go | 6 +- common/channelconfig/application.go | 4 +- common/channelconfig/application_test.go | 4 +- common/channelconfig/applicationorg.go | 4 +- common/channelconfig/bundle.go | 2 +- common/channelconfig/bundle_test.go | 4 +- common/channelconfig/channel.go | 2 +- common/channelconfig/channel_test.go | 2 +- common/channelconfig/consortium.go | 2 +- common/channelconfig/consortium_test.go | 2 +- common/channelconfig/consortiums.go | 2 +- common/channelconfig/consortiums_test.go | 2 +- common/channelconfig/msp.go | 4 +- common/channelconfig/msp_test.go | 2 +- common/channelconfig/orderer.go | 4 +- common/channelconfig/orderer_test.go | 2 +- common/channelconfig/organization.go | 4 +- common/channelconfig/realconfig_test.go | 2 +- common/channelconfig/standardvalues.go | 4 +- common/channelconfig/standardvalues_test.go | 2 +- common/channelconfig/util.go | 14 +- common/channelconfig/util_test.go | 12 +- common/configtx/compare.go | 2 +- common/configtx/compare_test.go | 2 +- common/configtx/configmap.go | 4 +- common/configtx/configmap_test.go | 2 +- common/configtx/configtx.go | 2 +- common/configtx/test/helper.go | 6 +- common/configtx/update.go | 2 +- common/configtx/update_test.go | 2 +- common/configtx/util.go | 4 +- common/configtx/util_test.go | 2 +- common/configtx/validator.go | 4 +- common/configtx/validator_test.go | 2 +- common/crypto/expiration.go | 4 +- common/crypto/expiration_test.go | 4 +- common/crypto/sanitize.go | 4 +- common/deliver/acl.go | 2 +- common/deliver/acl_test.go | 2 +- common/deliver/binding.go | 2 +- common/deliver/binding_test.go | 9 +- common/deliver/deliver.go | 6 +- common/deliver/deliver_test.go | 12 +- common/deliver/mock/block_iterator.go | 2 +- common/deliver/mock/block_reader.go | 4 +- .../deliver/mock/filtered_response_sender.go | 2 +- common/deliver/mock/inspector.go | 2 +- common/deliver/mock/policy_checker.go | 2 +- .../mock/private_data_response_sender.go | 2 +- common/deliver/mock/receiver.go | 2 +- common/deliver/mock/response_sender.go | 2 +- common/deliverclient/block_verification.go | 2 +- .../deliverclient/block_verification_test.go | 2 +- .../deliverclient/blocksprovider/adapters.go | 2 +- .../blocksprovider/bft_censorship_monitor.go | 4 +- .../bft_censorship_monitor_test.go | 4 +- .../blocksprovider/bft_deliverer.go | 4 +- .../blocksprovider/bft_deliverer_test.go | 6 +- .../blocksprovider/bft_header_receiver.go | 4 +- .../bft_header_receiver_test.go | 6 +- .../blocksprovider/block_receiver.go | 4 +- .../blocksprovider_suite_test.go | 2 +- .../deliverclient/blocksprovider/deliverer.go | 6 +- .../blocksprovider/deliverer_test.go | 4 +- .../blocksprovider/delivery_requester.go | 4 +- .../blocksprovider/delivery_requester_test.go | 2 +- .../blocksprovider/fake/ab_deliver_client.go | 4 +- .../blocksprovider/fake/block_handler.go | 2 +- .../fake/deliver_client_requester.go | 6 +- .../blocksprovider/fake/deliver_streamer.go | 2 +- .../fake/gossip_service_adapter.go | 2 +- .../fake/updatable_block_verifier.go | 2 +- common/deliverclient/blocksprovider/util.go | 2 +- common/deliverclient/util.go | 2 +- common/deliverclient/util_test.go | 2 +- common/deliverclient/verifier_assembler.go | 2 +- .../deliverclient/verifier_assembler_test.go | 2 +- common/genesis/genesis.go | 2 +- common/genesis/genesis_test.go | 4 +- common/grpclogging/fields.go | 11 +- common/grpclogging/fields_test.go | 9 +- common/grpclogging/testpb/echo.pb.go | 348 +- common/grpclogging/testpb/echo_grpc.pb.go | 157 + common/grpcmetrics/testpb/echo.pb.go | 348 +- common/grpcmetrics/testpb/echo_grpc.pb.go | 157 + .../blkstoragetest/blkstoragetest.go | 2 +- .../ledger/blkstorage/block_serialization.go | 6 +- .../blkstorage/block_serialization_test.go | 8 +- common/ledger/blkstorage/block_stream_test.go | 2 +- common/ledger/blkstorage/blockfile_helper.go | 4 +- .../blkstorage/blockfile_helper_test.go | 3 +- common/ledger/blkstorage/blockfile_mgr.go | 24 +- .../ledger/blkstorage/blockfile_mgr_test.go | 7 +- .../ledger/blkstorage/blockfile_scan_test.go | 8 +- common/ledger/blkstorage/blockindex.go | 25 +- common/ledger/blkstorage/blockindex_test.go | 2 +- common/ledger/blkstorage/blocks_itr_test.go | 2 +- common/ledger/blkstorage/blockstore.go | 4 +- .../blkstorage/blockstore_provider_test.go | 4 +- common/ledger/blkstorage/cache.go | 2 +- common/ledger/blkstorage/cache_test.go | 2 +- common/ledger/blkstorage/pkg_test.go | 6 +- common/ledger/blkstorage/reset_test.go | 11 +- common/ledger/blkstorage/rollback_test.go | 4 +- common/ledger/blkstorage/snapshot_test.go | 4 +- common/ledger/blkstorage/storage.pb.go | 312 +- common/ledger/blockledger/fileledger/impl.go | 4 +- .../blockledger/fileledger/impl_test.go | 6 +- .../mock/file_ledger_block_store.go | 2 +- common/ledger/blockledger/ledger.go | 4 +- common/ledger/blockledger/util.go | 6 +- common/ledger/blockledger/util_test.go | 2 +- common/ledger/ledger_interface.go | 2 +- common/ledger/snapshot/file.go | 5 +- common/ledger/snapshot/file_test.go | 4 +- .../ledger/testutil/fakes/signing_identity.go | 2 +- common/ledger/testutil/test_helper.go | 6 +- common/policies/bft.go | 4 +- common/policies/convert.go | 2 +- common/policies/convert_test.go | 4 +- common/policies/implicitmeta.go | 4 +- common/policies/implicitmeta_test.go | 2 +- common/policies/implicitmeta_util.go | 2 +- common/policies/implicitmetaparser.go | 2 +- common/policies/implicitmetaparser_test.go | 4 +- common/policies/inquire/compare.go | 4 +- common/policies/inquire/compare_test.go | 17 +- common/policies/inquire/inquire.go | 2 +- common/policies/inquire/inquire_test.go | 6 +- common/policies/mocks/identity.go | 2 +- .../policies/mocks/identity_deserializer.go | 2 +- common/policies/policy.go | 6 +- common/policies/policy_test.go | 6 +- common/policies/util.go | 2 +- common/policies/util_test.go | 2 +- common/policydsl/policydsl_builder.go | 10 +- common/policydsl/policyparser.go | 6 +- common/policydsl/policyparser_test.go | 8 +- common/util/utils.go | 8 +- core/aclmgmt/defaultaclprovider.go | 24 +- core/aclmgmt/mocks/mocks.go | 2 +- core/aclmgmt/resourceprovider.go | 12 +- core/aclmgmt/resourceprovider_test.go | 6 +- core/cclifecycle/lifecycle_test.go | 11 +- core/cclifecycle/util.go | 2 +- core/cclifecycle/util_test.go | 4 +- core/chaincode/accesscontrol/access.go | 4 +- core/chaincode/accesscontrol/access_test.go | 4 +- core/chaincode/accesscontrol/interceptor.go | 2 +- .../chaincode_ginkgo_support_test.go | 2 +- core/chaincode/chaincode_support.go | 4 +- core/chaincode/container_runtime_test.go | 2 +- core/chaincode/cs_test.go | 2 +- core/chaincode/extcc/extcc_handler.go | 2 +- core/chaincode/fake/message_handler.go | 2 +- core/chaincode/fake/query_response_builder.go | 2 +- core/chaincode/handler.go | 23 +- core/chaincode/handler_test.go | 6 +- core/chaincode/lifecycle/cache.go | 2 +- core/chaincode/lifecycle/cache_test.go | 9 +- core/chaincode/lifecycle/custodian_test.go | 5 +- .../lifecycle/deployedcc_infoprovider.go | 7 +- .../lifecycle/deployedcc_infoprovider_test.go | 18 +- .../lifecycle/endorsement_info_test.go | 3 +- core/chaincode/lifecycle/event_broker_test.go | 2 +- core/chaincode/lifecycle/integration_test.go | 14 +- core/chaincode/lifecycle/ledger_shim.go | 5 +- core/chaincode/lifecycle/ledger_shim_test.go | 7 +- core/chaincode/lifecycle/lifecycle.go | 11 +- .../lifecycle/lifecycle_suite_test.go | 3 +- core/chaincode/lifecycle/lifecycle_test.go | 13 +- .../lifecycle/metadata_manager_test.go | 1 - core/chaincode/lifecycle/metadata_provider.go | 4 +- .../lifecycle/metadata_provider_test.go | 11 +- .../lifecycle/mock/application_org_config.go | 2 +- .../lifecycle/mock/chaincode_stub.go | 26 +- .../lifecycle/mock/convertible_policy.go | 2 +- .../chaincode/lifecycle/mock/legacy_ccinfo.go | 4 +- core/chaincode/lifecycle/mock/msp.go | 2 +- core/chaincode/lifecycle/mock/msp_manager.go | 2 +- .../lifecycle/mock/state_iterator.go | 2 +- core/chaincode/lifecycle/scc.go | 18 +- core/chaincode/lifecycle/scc_test.go | 26 +- core/chaincode/lifecycle/serializer.go | 8 +- core/chaincode/lifecycle/serializer_test.go | 11 +- core/chaincode/mock/chaincode_stream.go | 2 +- core/chaincode/mock/collection_store.go | 2 +- core/chaincode/mock/invoker.go | 2 +- core/chaincode/mock/mockccstream.go | 2 +- core/chaincode/mock/mockpeerccsupport.go | 2 +- core/chaincode/mock/peer_ledger.go | 4 +- core/chaincode/pending_query_result.go | 10 +- core/chaincode/pending_query_result_test.go | 4 +- .../persistence/chaincode_package.go | 2 +- .../persistence/chaincode_package_test.go | 2 +- .../mock/legacy_cc_package_locator.go | 2 +- core/chaincode/platforms/golang/platform.go | 2 +- .../platforms/golang/platform_test.go | 2 +- core/chaincode/platforms/java/platform.go | 2 +- .../chaincode/platforms/java/platform_test.go | 2 +- core/chaincode/platforms/node/platform.go | 2 +- core/chaincode/query_response_generator.go | 4 +- .../query_response_generator_test.go | 2 +- .../init_private_data/init_private_data.go | 8 +- .../init_public_data/init_public_data.go | 8 +- .../testdata/src/chaincodes/map/map.go | 50 +- core/chaincode/transaction_context.go | 2 +- core/chaincode/transaction_contexts.go | 2 +- core/chaincode/transaction_contexts_test.go | 2 +- core/committer/committer.go | 2 +- core/committer/committer_impl.go | 4 +- core/committer/committer_test.go | 4 +- core/committer/txvalidator/mocks/validator.go | 2 +- core/committer/txvalidator/router.go | 2 +- .../v14/mocks/identity_deserializer.go | 2 +- .../committer/txvalidator/v14/mocks/plugin.go | 2 +- .../txvalidator/v14/plugin_validator.go | 2 +- .../txvalidator/v14/plugin_validator_test.go | 4 +- .../txvalidator/v14/testdata/test_plugin.go | 4 +- .../v14/testdata/test_plugin.pb.go | 203 +- .../txvalidator/v14/txvalidator_test.go | 6 +- core/committer/txvalidator/v14/validator.go | 8 +- .../txvalidator/v14/validator_test.go | 10 +- .../txvalidator/v14/vscc_validator.go | 6 +- .../v20/mocks/channel_resources.go | 2 +- .../txvalidator/v20/mocks/dispatcher.go | 4 +- .../v20/plugindispatcher/dispatcher.go | 6 +- .../mocks/identity_deserializer.go | 2 +- .../v20/plugindispatcher/mocks/plugin.go | 2 +- .../v20/plugindispatcher/plugin_validator.go | 2 +- .../plugindispatcher/plugin_validator_test.go | 6 +- .../txvalidator/v20/testdata/test_plugin.go | 4 +- .../v20/testdata/test_plugin.pb.go | 203 +- .../txvalidator/v20/txvalidator_test.go | 6 +- core/committer/txvalidator/v20/validator.go | 8 +- .../txvalidator/v20/validator_test.go | 10 +- .../txvalidator/v20/valinforetriever/shim.go | 6 +- .../v20/valinforetriever/shim_test.go | 4 +- core/common/ccpackage/ccpackage.go | 8 +- core/common/ccpackage/ccpackage_test.go | 10 +- core/common/ccprovider/ccinfocache_test.go | 4 +- core/common/ccprovider/ccprovider.go | 4 +- core/common/ccprovider/ccprovider.pb.go | 429 +- core/common/ccprovider/ccprovider_test.go | 4 +- .../common/ccprovider/ccproviderproto_test.go | 24 +- core/common/ccprovider/cdspackage.go | 4 +- core/common/ccprovider/cdspackage_test.go | 10 +- core/common/ccprovider/sigcdspackage.go | 6 +- core/common/ccprovider/sigcdspackage_test.go | 6 +- core/common/privdata/collection.go | 2 +- core/common/privdata/membershipinfo.go | 2 +- core/common/privdata/membershipinfo_test.go | 2 +- .../privdata/mock/chaincode_info_provider.go | 2 +- core/common/privdata/simplecollection.go | 4 +- core/common/privdata/simplecollection_test.go | 6 +- core/common/privdata/store.go | 4 +- core/common/privdata/store_test.go | 2 +- core/common/privdata/util.go | 6 +- core/common/privdata/util_test.go | 2 +- core/common/validation/config_test.go | 4 +- core/common/validation/fullflow_test.go | 4 +- core/common/validation/msgvalidation.go | 4 +- core/common/validation/msgvalidation_test.go | 4 +- .../statebased/validator_keylevel.go | 6 +- .../statebased/validator_keylevel_test.go | 4 +- .../validation/statebased/vpmanager_test.go | 6 +- .../validation/statebased/vpmanagerimpl.go | 2 +- core/container/ccintf/ccintf.go | 2 +- .../dockercontroller/dockercontroller.go | 2 +- .../dockercontroller/dockercontroller_test.go | 2 +- .../testdata/src/chaincodes/noop/chaincode.go | 8 +- core/deliverservice/config.go | 1 - core/deliverservice/config_test.go | 3 +- core/deliverservice/deliveryclient.go | 5 +- core/deliverservice/deliveryclient_test.go | 2 +- core/deliverservice/gossip_block_handler.go | 9 +- .../gossip_block_handler_test.go | 2 +- core/dispatcher/dispatcher.go | 2 +- core/dispatcher/dispatcher_suite_test.go | 1 - core/dispatcher/dispatcher_test.go | 23 +- core/dispatcher/mock/protobuf.go | 2 +- core/dispatcher/protobuf.go | 5 +- core/dispatcher/protobuf_test.go | 8 +- core/endorser/endorser.go | 10 +- core/endorser/endorser_test.go | 37 +- core/endorser/fake/id_deserializer.go | 2 +- core/endorser/fake/identity.go | 2 +- core/endorser/fake/prvt_data_distributor.go | 2 +- core/endorser/fake/support.go | 2 +- core/endorser/mocks/plugin.go | 2 +- .../mocks/signing_identity_fetcher.go | 2 +- core/endorser/msgvalidation.go | 6 +- core/endorser/msgvalidation_test.go | 13 +- core/endorser/plugin_endorser.go | 2 +- core/endorser/plugin_endorser_test.go | 8 +- core/endorser/pvtrwset_assembler.go | 6 +- core/endorser/pvtrwset_assembler_test.go | 4 +- core/endorser/state.go | 2 +- core/endorser/support.go | 2 +- core/handlers/auth/auth.go | 2 +- core/handlers/auth/auth_test.go | 2 +- core/handlers/auth/filter/expiration.go | 2 +- core/handlers/auth/filter/expiration_test.go | 8 +- core/handlers/auth/filter/filter.go | 2 +- core/handlers/auth/filter/filter_test.go | 2 +- core/handlers/auth/filter/timewindow.go | 2 +- core/handlers/auth/filter/timewindow_test.go | 6 +- core/handlers/auth/plugin/filter.go | 2 +- core/handlers/auth/plugin/filter_test.go | 2 +- core/handlers/decoration/decoration.go | 2 +- core/handlers/decoration/decoration_test.go | 2 +- .../decoration/decorator/decorator.go | 2 +- .../decoration/decorator/decorator_test.go | 2 +- core/handlers/decoration/plugin/decorator.go | 2 +- .../decoration/plugin/decorator_test.go | 2 +- core/handlers/endorsement/api/endorsement.go | 2 +- .../endorsement/api/identities/identities.go | 2 +- core/handlers/endorsement/api/state/state.go | 2 +- .../builtin/default_endorsement.go | 2 +- .../builtin/default_endorsement_test.go | 2 +- core/handlers/endorsement/plugin/plugin.go | 2 +- .../endorsement/plugin/plugin_test.go | 2 +- .../endorsement/testdata/noop_endorser.go | 2 +- core/handlers/library/registry_plugin_test.go | 4 +- .../validation/api/identities/identities.go | 2 +- core/handlers/validation/api/validation.go | 2 +- .../validation/builtin/default_validation.go | 2 +- .../builtin/default_validation_test.go | 2 +- .../builtin/mocks/transaction_validator.go | 2 +- .../builtin/v12/validation_logic.go | 10 +- .../builtin/v12/validation_logic_test.go | 10 +- .../builtin/v13/lscc_validation_logic.go | 8 +- .../v13/mocks/state_based_validator.go | 4 +- .../builtin/v13/validation_logic.go | 4 +- .../builtin/v13/validation_logic_test.go | 8 +- .../validation/builtin/v13/validator.go | 4 +- .../v20/mocks/state_based_validator.go | 4 +- .../builtin/v20/validation_logic.go | 6 +- .../builtin/v20/validation_logic_test.go | 4 +- .../validation/builtin/v20/validator.go | 4 +- .../validation/testdata/noop_validator.go | 2 +- core/ledger/cceventmgmt/defs.go | 2 +- core/ledger/cceventmgmt/lsccstate_listener.go | 2 +- core/ledger/cceventmgmt/mgmt_test.go | 2 +- .../confighistorytest/confighistory.go | 2 +- .../confighistorytest/confighistory_test.go | 4 +- core/ledger/confighistory/mgr.go | 6 +- core/ledger/confighistory/mgr_test.go | 8 +- .../kvledger/benchmark/chainmgmt/block_gen.go | 6 +- .../kvledger/benchmark/chainmgmt/chains.go | 2 +- .../benchmark/chainmgmt/tx_envelope_gen.go | 4 +- core/ledger/kvledger/benchmark/mocks/msp.go | 2 +- core/ledger/kvledger/channelinfo_provider.go | 4 +- .../kvledger/channelinfo_provider_test.go | 6 +- core/ledger/kvledger/coll_elg_notifier.go | 4 +- .../ledger/kvledger/coll_elg_notifier_test.go | 6 +- core/ledger/kvledger/hashcheck_pvtdata.go | 4 +- .../ledger/kvledger/hashcheck_pvtdata_test.go | 8 +- core/ledger/kvledger/history/db.go | 2 +- core/ledger/kvledger/history/db_test.go | 12 +- .../ledger/kvledger/history/query_executer.go | 4 +- core/ledger/kvledger/kv_ledger.go | 6 +- core/ledger/kvledger/kv_ledger_provider.go | 4 +- .../kvledger/kv_ledger_provider_test.go | 8 +- core/ledger/kvledger/kv_ledger_test.go | 41 +- core/ledger/kvledger/metrics_test.go | 4 +- .../kvledger/msgs/ledger_metadata.pb.go | 349 +- core/ledger/kvledger/pause_resume_test.go | 2 +- .../rwset_backward_compatibility_test.go | 2 +- core/ledger/kvledger/snapshot.go | 2 +- core/ledger/kvledger/snapshot_mgmt_test.go | 2 +- core/ledger/kvledger/snapshot_test.go | 8 +- core/ledger/kvledger/state_listener_test.go | 4 +- core/ledger/kvledger/tests/client.go | 4 +- core/ledger/kvledger/tests/committer.go | 4 +- .../kvledger/tests/customtx_processor_test.go | 4 +- core/ledger/kvledger/tests/env.go | 4 +- .../tests/nilvalue_no_delete_marker_test.go | 8 +- core/ledger/kvledger/tests/pvtdata_test.go | 2 +- core/ledger/kvledger/tests/reset_test.go | 2 +- .../kvledger/tests/sample_data_helper.go | 2 +- core/ledger/kvledger/tests/snapshot_test.go | 2 +- core/ledger/kvledger/tests/util.go | 10 +- core/ledger/kvledger/tests/v1x_test.go | 4 +- core/ledger/kvledger/tests/verifier.go | 10 +- .../txmgmt/privacyenabledstate/db_test.go | 2 +- .../privacyenabledstate/snapshot_record.pb.go | 214 +- .../privacyenabledstate/snapshot_test.go | 2 +- .../txmgmt/pvtstatepurgemgmt/expiry_keeper.go | 2 +- .../pvtstatepurgemgmt/expiry_keeper_test.go | 2 +- .../expiry_schedule_builder_test.go | 28 +- .../pvtstatepurgemgmt/pvtdata_key.pb.go | 459 +- .../snapshot_purge_mgr_builder_test.go | 8 +- .../txmgmt/queryutil/combiner_test.go | 7 +- .../txmgmt/queryutil/iterator_combiner.go | 2 +- .../txmgmt/rwsetutil/kv_rwset_test.go | 4 +- .../txmgmt/rwsetutil/kvrwset_proto_util.go | 2 +- .../rwsetutil/kvrwset_proto_util_test.go | 2 +- .../txmgmt/rwsetutil/query_results_helper.go | 6 +- .../rwsetutil/query_results_helper_test.go | 4 +- .../txmgmt/rwsetutil/rwset_builder.go | 4 +- .../txmgmt/rwsetutil/rwset_builder_test.go | 14 +- .../txmgmt/rwsetutil/rwset_proto_util.go | 22 +- .../txmgmt/rwsetutil/rwset_proto_util_test.go | 8 +- .../kvledger/txmgmt/rwsetutil/rwset_test.go | 4 +- .../txmgmt/statedb/statecouchdb/cache.go | 2 +- .../txmgmt/statedb/statecouchdb/cache_test.go | 2 +- .../statedb/statecouchdb/cache_value.pb.go | 214 +- .../txmgmt/statedb/statecouchdb/dbvalue.pb.go | 193 +- .../statedb/statecouchdb/dbvalue_encoding.go | 2 +- .../statedb/stateleveldb/db_value.pb.go | 202 +- .../statedb/stateleveldb/value_encoding.go | 2 +- .../kvledger/txmgmt/statemetadata/metadata.go | 4 +- .../txmgmt/statemetadata/metadata_test.go | 2 +- .../kvledger/txmgmt/txmgr/collection_val.go | 2 +- .../kvledger/txmgmt/txmgr/lockbased_txmgr.go | 8 +- core/ledger/kvledger/txmgmt/txmgr/pkg_test.go | 14 +- .../kvledger/txmgmt/txmgr/query_executor.go | 4 +- .../txmgmt/txmgr/query_executor_test.go | 12 +- .../txmgmt/txmgr/state_listener_test.go | 4 +- .../kvledger/txmgmt/txmgr/txmgr_test.go | 11 +- .../txmgmt/txmgr/update_batch_bytes.go | 2 +- .../txmgmt/txmgr/update_batch_bytes_test.go | 2 +- .../kvledger/txmgmt/txmgr/updates.pb.go | 318 +- .../txmgmt/validation/batch_preparer.go | 6 +- .../txmgmt/validation/batch_preparer_test.go | 31 +- .../txmgmt/validation/mock/processor.go | 2 +- .../txmgmt/validation/rangequery_validator.go | 2 +- .../validation/rangequery_validator_test.go | 2 +- .../kvledger/txmgmt/validation/tx_ops.go | 6 +- .../kvledger/txmgmt/validation/tx_ops_test.go | 2 +- .../kvledger/txmgmt/validation/types.go | 2 +- .../kvledger/txmgmt/validation/types_test.go | 2 +- .../kvledger/txmgmt/validation/validator.go | 4 +- .../txmgmt/validation/validator_test.go | 4 +- core/ledger/kvledger/unjoin_channel.go | 4 +- core/ledger/ledger_interface.go | 19 +- core/ledger/ledgermgmt/ledger_mgmt.go | 4 +- core/ledger/ledgermgmt/ledger_mgmt_test.go | 2 +- .../ledgermgmttest/ledgermgmttest.go | 2 +- core/ledger/mock/custom_tx_processor.go | 2 +- core/ledger/mock/deployed_ccinfo_provider.go | 4 +- core/ledger/mock/membership_info_provider.go | 2 +- core/ledger/pkg_test.go | 2 +- core/ledger/pvtdatapolicy/btlpolicy.go | 2 +- core/ledger/pvtdatapolicy/btlpolicy_test.go | 2 +- .../pvtdatapolicy/mock/coll_info_provider.go | 2 +- core/ledger/pvtdatapolicy/testutil/util.go | 2 +- core/ledger/pvtdatastorage/helper.go | 2 +- core/ledger/pvtdatastorage/kv_encoding.go | 16 +- .../pvtdatastorage/persistent_msgs.pb.go | 756 ++- .../reconcile_missing_pvtdata.go | 2 +- .../retroactive_hashed_index.go | 2 +- .../retroactive_hashed_index_test.go | 36 +- .../snapshot_data_importer_test.go | 11 +- core/ledger/pvtdatastorage/store.go | 6 +- .../store_created_from_snapshot_test.go | 2 +- core/ledger/pvtdatastorage/store_test.go | 53 +- core/ledger/pvtdatastorage/v11.go | 4 +- core/ledger/snapshotgrpc/snapshot_service.go | 16 +- .../snapshotgrpc/snapshot_service_test.go | 4 +- core/mocks/txvalidator/support.go | 2 +- core/mocks/validator/validator.go | 4 +- core/peer/channel.go | 2 +- core/peer/configtx_processor.go | 4 +- core/peer/configtx_test.go | 4 +- core/peer/deliverevents.go | 6 +- core/peer/deliverevents_test.go | 8 +- core/peer/mock/peer_ledger.go | 4 +- core/peer/peer.go | 4 +- core/peer/peer_test.go | 4 +- core/peer/pkg_test.go | 6 +- core/policy/application.go | 6 +- core/policy/application_test.go | 6 +- core/policy/mocks/identity.go | 2 +- core/policy/mocks/identity_deserializer.go | 2 +- core/policy/mocks/mocks.go | 2 +- .../policy/mocks/signature_policy_provider.go | 2 +- core/policy/policy.go | 2 +- core/policy/policy_test.go | 2 +- core/policy/principal.go | 4 +- core/policy/principal_test.go | 4 +- core/scc/cscc/configure.go | 26 +- core/scc/cscc/configure_test.go | 8 +- core/scc/cscc/mocks/chaincode_stub.go | 24 +- core/scc/inprocstream.go | 2 +- core/scc/inprocstream_test.go | 2 +- core/scc/lscc/deployedcc_infoprovider.go | 8 +- core/scc/lscc/deployedcc_infoprovider_test.go | 8 +- core/scc/lscc/lscc.go | 9 +- core/scc/lscc/lscc_noncc_test.go | 2 +- core/scc/lscc/lscc_suite_test.go | 2 +- core/scc/lscc/mock/cc_package.go | 4 +- core/scc/lscc/mock/chaincode_stub.go | 24 +- core/scc/lscc/mock/fs_support.go | 2 +- core/scc/lscc/mock/state_query_iterator.go | 2 +- core/scc/lscc/support.go | 2 +- core/scc/mock/chaincode.go | 182 - core/scc/mock/selfdescribingsyscc.go | 2 +- core/scc/qscc/mocks/chaincode_stub.go | 26 +- core/scc/qscc/query.go | 18 +- core/scc/qscc/query_test.go | 6 +- core/scc/scc.go | 4 +- core/scc/test-plugin/plugin.go | 8 +- core/transientstore/delete_store_test.go | 2 +- core/transientstore/persistence.pb.go | 178 +- core/transientstore/store.go | 14 +- core/transientstore/store_helper.go | 4 +- core/transientstore/store_test.go | 10 +- core/tx/endorser/endorsertx_suite_test.go | 4 +- core/tx/endorser/parser.go | 2 +- core/tx/endorser/parser_test.go | 4 +- core/tx/processor_factory.go | 4 +- core/tx/processor_factory_test.go | 4 +- discovery/api.go | 4 +- discovery/client/api.go | 4 +- discovery/client/client.go | 8 +- discovery/client/client_test.go | 12 +- discovery/client/selection_test.go | 4 +- discovery/cmd/config_test.go | 4 +- discovery/cmd/endorsers.go | 11 +- discovery/cmd/endorsers_test.go | 4 +- discovery/cmd/mocks/channel_response.go | 4 +- discovery/cmd/mocks/service_response.go | 2 +- discovery/cmd/peers.go | 4 +- discovery/cmd/peers_test.go | 4 +- discovery/cmd/stub.go | 2 +- discovery/endorsement/collection.go | 2 +- discovery/endorsement/collection_test.go | 6 +- discovery/endorsement/endorsement.go | 7 +- discovery/endorsement/endorsement_test.go | 15 +- discovery/protoext/querytype.go | 2 +- discovery/protoext/querytype_test.go | 2 +- discovery/protoext/response.go | 2 +- discovery/protoext/signedreq.go | 4 +- discovery/protoext/signedreq_test.go | 4 +- discovery/service.go | 2 +- discovery/service_test.go | 9 +- discovery/support/acl/support.go | 2 +- discovery/support/chaincode/support.go | 4 +- discovery/support/chaincode/support_test.go | 4 +- discovery/support/config/support.go | 8 +- discovery/support/config/support_test.go | 8 +- discovery/support/gossip/support.go | 2 +- discovery/support/gossip/support_test.go | 2 +- discovery/support/mocks/config_getter.go | 2 +- discovery/support/mocks/configtx_validator.go | 2 +- discovery/support/mocks/identity.go | 2 +- discovery/support/mocks/msp_manager.go | 2 +- discovery/test/integration_test.go | 14 +- go.mod | 39 +- go.sum | 102 +- gossip/api/crypto.go | 6 +- gossip/api/crypto_test.go | 2 +- gossip/comm/ack_test.go | 2 +- gossip/comm/comm_impl.go | 2 +- gossip/comm/comm_test.go | 4 +- gossip/comm/conn.go | 2 +- gossip/comm/crypto_test.go | 2 +- gossip/comm/mock/mock_comm.go | 2 +- gossip/comm/mock/mock_comm_test.go | 2 +- gossip/comm/mocks/mock_stream.go | 2 +- gossip/comm/msg.go | 2 +- gossip/discovery/discovery.go | 4 +- gossip/discovery/discovery_impl.go | 2 +- gossip/discovery/discovery_test.go | 4 +- gossip/election/adapter.go | 2 +- gossip/election/adapter_test.go | 2 +- gossip/gossip/anchor_test.go | 2 +- gossip/gossip/certstore.go | 2 +- gossip/gossip/certstore_test.go | 2 +- gossip/gossip/channel/channel.go | 2 +- gossip/gossip/channel/channel_test.go | 6 +- gossip/gossip/chanstate.go | 2 +- gossip/gossip/config_test.go | 6 +- gossip/gossip/gossip_impl.go | 4 +- gossip/gossip/gossip_test.go | 73 +- gossip/gossip/orgs_test.go | 4 +- gossip/gossip/pull/pullstore.go | 2 +- gossip/gossip/pull/pullstore_test.go | 2 +- gossip/identity/identity_test.go | 2 +- gossip/privdata/common/common.go | 4 +- gossip/privdata/coordinator.go | 8 +- gossip/privdata/coordinator_test.go | 16 +- gossip/privdata/dataretriever.go | 4 +- gossip/privdata/dataretriever_test.go | 8 +- gossip/privdata/distributor.go | 10 +- gossip/privdata/distributor_test.go | 6 +- .../mocks/collection_access_factory.go | 2 +- gossip/privdata/mocks/collection_store.go | 2 +- gossip/privdata/mocks/committer.go | 2 +- gossip/privdata/pull.go | 4 +- gossip/privdata/pull_test.go | 10 +- gossip/privdata/pvtdataprovider.go | 8 +- gossip/privdata/pvtdataprovider_test.go | 12 +- gossip/privdata/reconcile.go | 4 +- gossip/privdata/reconcile_test.go | 4 +- gossip/privdata/util.go | 12 +- gossip/protoext/compatibility_test.go | 4 +- gossip/protoext/message.go | 2 +- gossip/protoext/message_test.go | 2 +- gossip/protoext/msgcomparator.go | 2 +- gossip/protoext/msgcomparator_test.go | 2 +- gossip/protoext/receivedmessage.go | 2 +- gossip/protoext/signing.go | 10 +- gossip/protoext/signing_test.go | 4 +- gossip/protoext/stringers.go | 6 +- gossip/protoext/stringers_test.go | 55 +- gossip/service/eventer.go | 44 +- gossip/service/eventer_test.go | 7 +- gossip/service/gossip_service.go | 6 +- gossip/service/gossip_service_test.go | 6 +- gossip/service/integration_test.go | 2 +- gossip/service/join_test.go | 4 +- gossip/state/metrics_test.go | 2 +- gossip/state/mocks/gossip.go | 2 +- gossip/state/mocks/gossip_test.go | 2 +- gossip/state/payloads_buffer.go | 2 +- gossip/state/payloads_buffer_test.go | 2 +- gossip/state/state.go | 12 +- gossip/state/state_test.go | 10 +- gossip/util/msgs_test.go | 18 +- gossip/util/privdata.go | 12 +- gotools.mk | 31 +- integration/chaincode/keylevelep/chaincode.go | 26 +- integration/chaincode/keylevelep/cmd/main.go | 2 +- integration/chaincode/kvexecutor/chaincode.go | 10 +- integration/chaincode/kvexecutor/cmd/main.go | 2 +- integration/chaincode/marbles/cmd/main.go | 2 +- .../marbles/cmdwithindexspec/main.go | 2 +- .../marbles/cmdwithindexspecs/main.go | 2 +- .../chaincode/marbles/marbles_chaincode.go | 30 +- .../chaincode/marbles_private/chaincode.go | 32 +- .../chaincode/marbles_private/cmd/main.go | 2 +- integration/chaincode/module/go.mod | 15 +- integration/chaincode/module/go.sum | 74 +- integration/chaincode/module/main.go | 18 +- integration/chaincode/server/main.go | 2 +- integration/chaincode/simple/chaincode.go | 24 +- integration/chaincode/simple/cmd/main.go | 2 +- .../channel_participation.go | 4 +- integration/configtx/configtx_test.go | 2 +- .../configtx/consenter_mapping_test.go | 4 +- integration/discovery/discovery_test.go | 22 +- integration/e2e/acl_test.go | 6 +- integration/e2e/e2e_test.go | 4 +- integration/e2e/filter_proposal_test.go | 12 +- integration/gateway/endorsing_orgs_test.go | 4 +- integration/gateway/gateway_bft_test.go | 10 +- integration/gateway/gateway_discovery_test.go | 6 +- integration/gateway/gateway_test.go | 12 +- integration/ledger/reset_rollback_test.go | 2 +- integration/ledger/snapshot_test.go | 6 +- .../lifecycle/capabilities_endorse_test.go | 2 - .../lifecycle/chaincode/callee/chaincode.go | 8 +- .../lifecycle/chaincode/callee/cmd/main.go | 2 +- .../lifecycle/chaincode/caller/chaincode.go | 8 +- .../lifecycle/chaincode/caller/cmd/main.go | 2 +- integration/lifecycle/interop_test.go | 4 +- integration/lifecycle/lifecycle_suite_test.go | 6 +- integration/lifecycle/lifecycle_test.go | 8 +- integration/nwo/configblock.go | 8 +- integration/nwo/deploy.go | 6 +- integration/nwo/network.go | 15 +- integration/nwo/signingid.go | 4 +- integration/ordererclient/envelope_creator.go | 2 +- integration/ordererclient/orderer_client.go | 4 +- integration/pvtdata/pvtdata_test.go | 27 +- integration/pvtdatapurge/data_purge_test.go | 10 +- integration/raft/cft_test.go | 19 +- .../raft/channel_participation_test.go | 4 +- integration/raft/client.go | 4 +- integration/raft/config_test.go | 12 +- integration/raft/migration_test.go | 10 +- integration/sbe/sbe_test.go | 2 +- integration/smartbft/mock_orderer.go | 6 +- .../smartbft/smartbft_block_deliverer_test.go | 4 +- integration/smartbft/smartbft_test.go | 6 +- internal/configtxgen/encoder/encoder.go | 8 +- internal/configtxgen/encoder/encoder_test.go | 10 +- .../configtxgen/encoder/integration_test.go | 3 +- internal/configtxgen/genesisconfig/config.go | 4 +- .../configtxgen/genesisconfig/config_test.go | 2 +- .../rest/configtxlator_handlers.go | 4 +- .../rest/configtxlator_handlers_test.go | 2 +- .../configtxlator/rest/protolator_handlers.go | 4 +- .../rest/protolator_handlers_test.go | 15 +- internal/configtxlator/update/update.go | 4 +- internal/configtxlator/update/update_test.go | 6 +- internal/ledgerutil/compare/compare.go | 2 +- .../ledgerutil/identifytxs/identifytxs.go | 2 +- internal/ledgerutil/verify/verify.go | 2 +- internal/peer/chaincode/common.go | 10 +- internal/peer/chaincode/common_test.go | 6 +- internal/peer/chaincode/invoke_test.go | 6 +- internal/peer/chaincode/mock/deliver.go | 4 +- .../peer/chaincode/mock/deliver_client.go | 2 +- internal/peer/chaincode/query_test.go | 2 +- .../testdata/src/chaincodes/noop/chaincode.go | 8 +- internal/peer/channel/channel.go | 4 +- internal/peer/channel/create.go | 4 +- internal/peer/channel/create_test.go | 6 +- internal/peer/channel/fetch.go | 9 +- internal/peer/channel/fetch_test.go | 4 +- internal/peer/channel/getinfo.go | 6 +- internal/peer/channel/getinfo_test.go | 6 +- internal/peer/channel/join.go | 4 +- internal/peer/channel/join_test.go | 2 +- internal/peer/channel/joinbysnapshot.go | 2 +- internal/peer/channel/joinbysnapshot_test.go | 2 +- internal/peer/channel/joinbysnapshotstatus.go | 6 +- .../peer/channel/joinbysnapshotstatus_test.go | 4 +- internal/peer/channel/list.go | 6 +- internal/peer/channel/list_test.go | 4 +- internal/peer/channel/signconfigtx_test.go | 2 +- internal/peer/channel/update_test.go | 2 +- internal/peer/common/broadcastclient.go | 2 +- internal/peer/common/common.go | 6 +- internal/peer/common/common_test.go | 4 +- internal/peer/common/deliverclient.go | 6 +- internal/peer/common/deliverclient_test.go | 4 +- internal/peer/common/mock/deliverservice.go | 4 +- internal/peer/common/mockclient.go | 4 +- internal/peer/common/ordererclient.go | 4 +- internal/peer/common/peerclient.go | 2 +- internal/peer/gossip/deserializer.go | 2 +- internal/peer/gossip/mcs.go | 2 +- internal/peer/gossip/mcs_test.go | 17 +- internal/peer/gossip/mocks/mocks.go | 2 +- internal/peer/gossip/mocks/orderer.go | 4 +- .../lifecycle/chaincode/approveformyorg.go | 8 +- .../chaincode/approveformyorg_test.go | 7 +- .../chaincode/calculatepackageid_test.go | 5 +- .../chaincode/chaincode_suite_test.go | 2 +- .../chaincode/checkcommitreadiness.go | 8 +- .../chaincode/checkcommitreadiness_test.go | 11 +- .../lifecycle/chaincode/client_connections.go | 2 +- internal/peer/lifecycle/chaincode/commit.go | 8 +- .../peer/lifecycle/chaincode/commit_test.go | 7 +- internal/peer/lifecycle/chaincode/common.go | 4 +- .../chaincode/getinstalledpackage.go | 8 +- .../chaincode/getinstalledpackage_test.go | 7 +- internal/peer/lifecycle/chaincode/install.go | 8 +- .../peer/lifecycle/chaincode/install_test.go | 7 +- .../chaincode/mock/broadcast_client.go | 2 +- .../peer/lifecycle/chaincode/mock/deliver.go | 4 +- .../chaincode/mock/endorser_client.go | 2 +- .../chaincode/mock/peer_deliver_client.go | 2 +- .../peer/lifecycle/chaincode/package_test.go | 5 +- .../peer/lifecycle/chaincode/queryapproved.go | 8 +- .../lifecycle/chaincode/queryapproved_test.go | 11 +- .../lifecycle/chaincode/querycommitted.go | 8 +- .../chaincode/querycommitted_test.go | 11 +- .../lifecycle/chaincode/queryinstalled.go | 8 +- .../chaincode/queryinstalled_test.go | 11 +- internal/peer/node/mock/peer_ledger.go | 4 +- internal/peer/node/start.go | 10 +- internal/peer/node/start_test.go | 2 +- internal/peer/snapshot/cancelrequest.go | 2 +- internal/peer/snapshot/cancelrequest_test.go | 4 +- internal/peer/snapshot/client.go | 2 +- internal/peer/snapshot/client_test.go | 2 +- internal/peer/snapshot/listpending.go | 2 +- internal/peer/snapshot/listpending_test.go | 2 +- .../peer/snapshot/mock/snapshot_client.go | 65 +- internal/peer/snapshot/snapshot.go | 6 +- internal/peer/snapshot/submitrequest.go | 2 +- internal/peer/snapshot/submitrequest_test.go | 4 +- internal/pkg/comm/client_test.go | 2 +- internal/pkg/comm/testpb/test.pb.go | 515 +- internal/pkg/comm/testpb/test_grpc.pb.go | 357 + internal/pkg/gateway/api_test.go | 30 +- internal/pkg/gateway/apiutils.go | 15 +- internal/pkg/gateway/chaincodeevents.go | 8 +- internal/pkg/gateway/chaincodeevents_test.go | 23 +- internal/pkg/gateway/commit/finder.go | 3 +- internal/pkg/gateway/commit/finder_test.go | 2 +- internal/pkg/gateway/commit/notifier_test.go | 4 +- internal/pkg/gateway/commitstatus.go | 4 +- internal/pkg/gateway/commitstatus_test.go | 6 +- internal/pkg/gateway/diff.go | 2 +- internal/pkg/gateway/diff_test.go | 24 +- internal/pkg/gateway/endorse.go | 6 +- internal/pkg/gateway/endorse_test.go | 8 +- internal/pkg/gateway/endorsement.go | 4 +- internal/pkg/gateway/endorsement_test.go | 2 +- internal/pkg/gateway/endpoint.go | 8 +- internal/pkg/gateway/endpoint_test.go | 2 +- internal/pkg/gateway/evaluate.go | 6 +- internal/pkg/gateway/evaluate_test.go | 4 +- internal/pkg/gateway/event/block.go | 6 +- internal/pkg/gateway/event/blockiterator.go | 2 +- internal/pkg/gateway/event/chaincode.go | 2 +- .../pkg/gateway/event/chaincodeiterator.go | 4 +- internal/pkg/gateway/event/iterator_test.go | 21 +- internal/pkg/gateway/event/transaction.go | 12 +- internal/pkg/gateway/gateway.go | 2 +- internal/pkg/gateway/ledger/mocks/ledger.go | 4 +- internal/pkg/gateway/ledger/peeradapter.go | 4 +- internal/pkg/gateway/mocks/abbclient.go | 4 +- internal/pkg/gateway/mocks/abclient.go | 2 +- .../gateway/mocks/chaincodeeventsserver.go | 2 +- internal/pkg/gateway/mocks/discovery.go | 4 +- internal/pkg/gateway/mocks/endorserclient.go | 2 +- internal/pkg/gateway/mocks/endorserserver.go | 2 +- internal/pkg/gateway/mocks/orderer.go | 4 +- internal/pkg/gateway/registry.go | 11 +- internal/pkg/gateway/registry_test.go | 6 +- internal/pkg/gateway/submit.go | 10 +- internal/pkg/gateway/submit_test.go | 12 +- internal/pkg/txflags/validation_flags.go | 2 +- internal/pkg/txflags/validation_flags_test.go | 2 +- internal/test/matcher.go | 6 +- msp/cache/cache.go | 2 +- msp/cache/cache_test.go | 2 +- msp/configbuilder.go | 4 +- msp/idemix.go | 2 +- msp/identities.go | 4 +- msp/identities_test.go | 4 +- msp/mocks/mocks.go | 2 +- msp/msp.go | 2 +- msp/msp_test.go | 4 +- msp/mspimpl.go | 4 +- msp/mspimplsetup.go | 4 +- msp/mspimplsetup_test.go | 3 +- msp/mspmgrimpl.go | 4 +- msp/nodeous_test.go | 4 +- msp/revocation_test.go | 4 +- orderer/common/blockcutter/blockcutter.go | 2 +- .../common/blockcutter/blockcutter_test.go | 4 +- .../common/blockcutter/mock/orderer_config.go | 4 +- orderer/common/broadcast/broadcast.go | 4 +- .../common/broadcast/broadcast_suite_test.go | 3 +- orderer/common/broadcast/broadcast_test.go | 9 +- orderer/common/broadcast/metrics_test.go | 5 +- orderer/common/broadcast/mock/ab_server.go | 4 +- .../common/broadcast/mock/channel_support.go | 2 +- .../mock/channel_support_registrar.go | 2 +- .../mocks/channel_management.go | 2 +- .../common/channelparticipation/restapi.go | 4 +- .../channelparticipation/restapi_test.go | 2 +- .../common/channelparticipation/validator.go | 2 +- .../channelparticipation/validator_test.go | 4 +- orderer/common/cluster/clusterservice.go | 4 +- orderer/common/cluster/clusterservice_test.go | 6 +- orderer/common/cluster/comm.go | 4 +- orderer/common/cluster/comm_test.go | 6 +- orderer/common/cluster/commauth.go | 2 +- orderer/common/cluster/commauth_test.go | 9 +- orderer/common/cluster/deliver.go | 4 +- orderer/common/cluster/deliver_test.go | 8 +- orderer/common/cluster/interfaces.go | 4 +- .../common/cluster/mocks/StepClientStream.go | 2 +- .../common/cluster/mocks/block_retriever.go | 2 +- orderer/common/cluster/mocks/chain_puller.go | 2 +- .../common/cluster/mocks/cluster_client.go | 2 +- .../cluster/mocks/cluster_step_stream.go | 2 +- orderer/common/cluster/mocks/dispatcher.go | 2 +- orderer/common/cluster/mocks/handler.go | 2 +- orderer/common/cluster/mocks/step_client.go | 2 +- orderer/common/cluster/mocks/step_stream.go | 2 +- orderer/common/cluster/remotecontext.go | 2 +- orderer/common/cluster/rpc.go | 2 +- orderer/common/cluster/rpc_test.go | 4 +- orderer/common/cluster/service.go | 2 +- orderer/common/cluster/service_test.go | 2 +- orderer/common/cluster/stream.go | 2 +- orderer/common/cluster/util.go | 10 +- orderer/common/cluster/util_test.go | 8 +- orderer/common/follower/block_puller.go | 2 +- orderer/common/follower/block_puller_test.go | 2 +- orderer/common/follower/follower_chain.go | 4 +- .../common/follower/follower_chain_test.go | 4 +- .../follower/mocks/block_puller_factory.go | 2 +- .../common/follower/mocks/channel_puller.go | 2 +- .../follower/mocks/cluster_consenter.go | 2 +- .../common/follower/mocks/ledger_resources.go | 2 +- orderer/common/msgprocessor/expiration.go | 2 +- .../common/msgprocessor/expiration_test.go | 6 +- orderer/common/msgprocessor/filter.go | 2 +- orderer/common/msgprocessor/filter_test.go | 2 +- .../common/msgprocessor/maintenancefilter.go | 13 +- .../msgprocessor/maintenancefilter_test.go | 17 +- .../msgprocessor/mocks/orderer_config.go | 4 +- orderer/common/msgprocessor/msgprocessor.go | 2 +- orderer/common/msgprocessor/sigfilter.go | 4 +- orderer/common/msgprocessor/sigfilter_test.go | 4 +- orderer/common/msgprocessor/sizefilter.go | 2 +- .../common/msgprocessor/sizefilter_test.go | 6 +- .../common/msgprocessor/standardchannel.go | 7 +- .../msgprocessor/standardchannel_test.go | 4 +- orderer/common/multichannel/blockwriter.go | 4 +- .../common/multichannel/blockwriter_test.go | 6 +- orderer/common/multichannel/chainsupport.go | 2 +- .../common/multichannel/chainsupport_test.go | 2 +- .../common/multichannel/ledger_resources.go | 2 +- .../multichannel/ledger_resources_test.go | 6 +- .../multichannel/mocks/configtx_validator.go | 2 +- .../common/multichannel/mocks/consenter.go | 2 +- .../multichannel/mocks/orderer_config.go | 4 +- .../common/multichannel/mocks/read_writer.go | 4 +- orderer/common/multichannel/registrar.go | 7 +- orderer/common/multichannel/registrar_test.go | 6 +- orderer/common/multichannel/util_test.go | 2 +- orderer/common/server/attestationserver.go | 4 +- .../common/server/attestationserver_test.go | 4 +- orderer/common/server/main.go | 2 +- orderer/common/server/main_test.go | 2 +- .../common/server/mock/broadcastservice.go | 2 +- orderer/common/server/server.go | 10 +- orderer/common/server/server_test.go | 6 +- orderer/common/server/throttle_test.go | 2 +- orderer/common/server/util.go | 6 +- orderer/common/server/util_test.go | 4 +- orderer/consensus/consensus.go | 2 +- orderer/consensus/etcdraft/blockcreator.go | 4 +- .../consensus/etcdraft/blockcreator_test.go | 2 +- orderer/consensus/etcdraft/blockpuller.go | 2 +- .../consensus/etcdraft/blockpuller_test.go | 4 +- orderer/consensus/etcdraft/chain.go | 14 +- orderer/consensus/etcdraft/chain_test.go | 48 +- orderer/consensus/etcdraft/consenter.go | 8 +- orderer/consensus/etcdraft/consenter_test.go | 8 +- orderer/consensus/etcdraft/dispatcher.go | 2 +- orderer/consensus/etcdraft/dispatcher_test.go | 2 +- orderer/consensus/etcdraft/disseminator.go | 2 +- orderer/consensus/etcdraft/eviction.go | 2 +- orderer/consensus/etcdraft/eviction_test.go | 2 +- orderer/consensus/etcdraft/membership.go | 4 +- orderer/consensus/etcdraft/membership_test.go | 43 +- .../etcdraft/mocks/message_receiver.go | 2 +- .../etcdraft/mocks/mock_blockpuller.go | 2 +- orderer/consensus/etcdraft/mocks/mock_rpc.go | 2 +- orderer/consensus/etcdraft/mocks/msp.go | 2 +- .../etcdraft/mocks/orderer_config.go | 4 +- orderer/consensus/etcdraft/node.go | 7 +- orderer/consensus/etcdraft/tracker.go | 2 +- orderer/consensus/etcdraft/util.go | 8 +- orderer/consensus/etcdraft/util_test.go | 9 +- orderer/consensus/etcdraft/validator_test.go | 4 +- .../consensus/mocks/mock_consenter_support.go | 2 +- orderer/consensus/smartbft/assembler.go | 2 +- orderer/consensus/smartbft/assembler_test.go | 2 +- .../smartbft/block_puller_factory.go | 2 +- orderer/consensus/smartbft/chain.go | 9 +- orderer/consensus/smartbft/chain_test.go | 6 +- orderer/consensus/smartbft/configverifier.go | 10 +- .../consensus/smartbft/configverifier_test.go | 4 +- orderer/consensus/smartbft/consenter.go | 8 +- orderer/consensus/smartbft/egress.go | 6 +- orderer/consensus/smartbft/egress_test.go | 4 +- orderer/consensus/smartbft/ingress.go | 4 +- orderer/consensus/smartbft/ingress_test.go | 6 +- .../smartbft/mocks/bft_block_deliverer.go | 2 +- .../consensus/smartbft/mocks/block_puller.go | 2 +- .../smartbft/mocks/config_tx_validator.go | 2 +- .../smartbft/mocks/config_update_proposer.go | 2 +- .../smartbft/mocks/config_validator.go | 2 +- .../smartbft/mocks/consenter_support.go | 2 +- orderer/consensus/smartbft/mocks/filters.go | 2 +- orderer/consensus/smartbft/mocks/ledger.go | 2 +- .../smartbft/mocks/mock_block_puller.go | 2 +- .../smartbft/mocks/orderer_config.go | 4 +- orderer/consensus/smartbft/mocks/rpc.go | 2 +- .../smartbft/mocks/synchronizer_factory.go | 2 +- .../mocks/updatable_block_verifier.go | 2 +- .../smartbft/mocks/verifier_factory.go | 2 +- orderer/consensus/smartbft/signature.go | 4 +- orderer/consensus/smartbft/signer.go | 2 +- orderer/consensus/smartbft/signer_test.go | 4 +- orderer/consensus/smartbft/sync_buffer.go | 2 +- .../consensus/smartbft/sync_buffer_test.go | 8 +- orderer/consensus/smartbft/synchronizer.go | 2 +- .../consensus/smartbft/synchronizer_bft.go | 10 +- .../smartbft/synchronizer_bft_test.go | 6 +- .../smartbft/synchronizer_factory.go | 2 +- .../consensus/smartbft/synchronizer_test.go | 4 +- orderer/consensus/smartbft/util.go | 11 +- orderer/consensus/smartbft/util/util.go | 2 +- .../consensus/smartbft/util_network_test.go | 4 +- orderer/consensus/smartbft/verifier.go | 6 +- orderer/consensus/smartbft/verifier_test.go | 6 +- .../mocks/common/blockcutter/blockcutter.go | 2 +- .../mocks/common/multichannel/multichannel.go | 2 +- .../sample_clients/broadcast_config/client.go | 4 +- .../broadcast_config/newchain.go | 2 +- .../sample_clients/broadcast_msg/client.go | 4 +- .../sample_clients/deliver_stdout/client.go | 4 +- pkg/tx/interfaces.go | 4 +- protoutil/blockutils.go | 6 +- protoutil/blockutils_test.go | 6 +- protoutil/commonutils.go | 24 +- protoutil/commonutils_test.go | 6 +- protoutil/configtxutils.go | 2 +- protoutil/configtxutils_test.go | 2 +- protoutil/proputils.go | 39 +- protoutil/proputils_test.go | 6 +- protoutil/signeddata.go | 6 +- protoutil/signeddata_test.go | 6 +- protoutil/txutils.go | 12 +- protoutil/txutils_test.go | 6 +- protoutil/unmarshalers.go | 12 +- tools/go.mod | 20 +- tools/go.sum | 63 +- tools/tools.go | 3 +- vendor/github.com/IBM/idemix/README.md | 253 +- vendor/github.com/IBM/idemix/bccsp/bccsp.go | 22 +- .../IBM/idemix/bccsp/handlers/nym.go | 13 +- .../IBM/idemix/bccsp/handlers/nymsigner.go | 69 +- .../IBM/idemix/bccsp/handlers/signer.go | 2 +- .../idemix/bccsp/schemes/aries/blind_sign.go | 21 +- .../IBM/idemix/bccsp/schemes/aries/cred.go | 6 +- .../idemix/bccsp/schemes/aries/credrequest.go | 2 +- .../IBM/idemix/bccsp/schemes/aries/issuer.go | 10 +- .../idemix/bccsp/schemes/aries/nymsigner.go | 12 +- .../IBM/idemix/bccsp/schemes/aries/signer.go | 150 +- .../idemix/bccsp/schemes/aries/smartcard.go | 206 + .../IBM/idemix/bccsp/schemes/aries/util.go | 14 +- .../IBM/idemix/bccsp/types/idemix.go | 10 + .../IBM/idemix/bccsp/types/idemixopts.go | 19 + vendor/github.com/IBM/idemix/idemix_roles.go | 2 +- vendor/github.com/IBM/idemix/idemixmsp.go | 2 +- vendor/github.com/IBM/idemix/msp.go | 2 +- .../primitive/bbs12381g2pub/bbs12381g2pub.go | 152 +- .../crypto/primitive/bbs12381g2pub/fr.go | 19 +- .../crypto/primitive/bbs12381g2pub/keys.go | 49 +- .../bbs12381g2pub/proof_of_knowledge.go | 76 +- .../primitive/bbs12381g2pub/signature.go | 37 +- .../bbs12381g2pub/signature_message.go | 5 +- .../bbs12381g2pub/signature_proof.go | 64 +- vendor/github.com/alecthomas/units/README.md | 2 + vendor/github.com/alecthomas/units/bytes.go | 118 +- .../alecthomas/units/renovate.json5 | 11 + .../gnark-crypto/ecc/bls12-377/bls12-377.go | 4 +- .../ecc/bls12-377/fr/generator.go | 47 + .../gnark-crypto/ecc/bls12-377/g1.go | 136 +- .../gnark-crypto/ecc/bls12-377/g2.go | 121 +- .../bls12-377/internal/fptower/e12_pairing.go | 46 +- .../gnark-crypto/ecc/bls12-377/pairing.go | 240 +- .../gnark-crypto/ecc/bls12-381/bls12-381.go | 4 +- .../ecc/bls12-381/fr/generator.go | 47 + .../gnark-crypto/ecc/bls12-381/g1.go | 137 +- .../gnark-crypto/ecc/bls12-381/g2.go | 121 +- .../bls12-381/internal/fptower/e12_pairing.go | 42 + .../gnark-crypto/ecc/bls12-381/pairing.go | 204 +- .../consensys/gnark-crypto/ecc/bn254/bn254.go | 4 +- .../gnark-crypto/ecc/bn254/fr/generator.go | 47 + .../consensys/gnark-crypto/ecc/bn254/g1.go | 137 +- .../consensys/gnark-crypto/ecc/bn254/g2.go | 121 +- .../ecc/bn254/internal/fptower/e12_pairing.go | 46 +- .../gnark-crypto/ecc/bn254/pairing.go | 337 +- .../consensys/gnark-crypto/ecc/ecc.go | 10 + .../gnark-crypto/field/hash/hashutils.go | 6 +- .../internal/generator/config/bw6-633.go | 2 +- .../internal/generator/config/bw6-756.go | 2 +- .../internal/generator/config/bw6-761.go | 2 +- .../golang/protobuf/jsonpb/decode.go | 531 -- .../golang/protobuf/jsonpb/encode.go | 560 -- .../github.com/golang/protobuf/jsonpb/json.go | 69 - .../golang/protobuf/ptypes/empty/empty.pb.go | 62 - .../fabric-chaincode-go/{ => v2}/LICENSE | 0 .../{ => v2}/pkg/statebased/interfaces.go | 2 +- .../{ => v2}/pkg/statebased/statebasedimpl.go | 16 +- .../{ => v2}/shim/chaincodeserver.go | 8 +- .../{ => v2}/shim/handler.go | 290 +- .../{ => v2}/shim/interfaces.go | 46 +- .../{ => v2}/shim/internal/client.go | 15 +- .../{ => v2}/shim/internal/config.go | 11 +- .../{ => v2}/shim/internal/server.go | 0 .../{ => v2}/shim/response.go | 10 +- .../fabric-chaincode-go/{ => v2}/shim/shim.go | 22 +- .../fabric-chaincode-go/{ => v2}/shim/stub.go | 75 +- .../fabric-config/configtx/application.go | 6 +- .../fabric-config/configtx/capabilities.go | 4 +- .../fabric-config/configtx/channel.go | 2 +- .../fabric-config/configtx/config.go | 17 +- .../fabric-config/configtx/consortiums.go | 6 +- .../internal/policydsl/policyparser.go | 6 +- .../hyperledger/fabric-config/configtx/msp.go | 6 +- .../fabric-config/configtx/orderer.go | 14 +- .../fabric-config/configtx/orderer/orderer.go | 3 + .../fabric-config/configtx/organization.go | 8 +- .../fabric-config/configtx/policies.go | 6 +- .../fabric-config/configtx/signer.go | 6 +- .../fabric-config/configtx/update.go | 4 +- .../fabric-config/protolator/api.go | 8 +- .../fabric-config/protolator/dynamic.go | 2 +- .../fabric-config/protolator/json.go | 60 +- .../fabric-config/protolator/nested.go | 6 +- .../protolator/protoext/commonext/common.go | 8 +- .../protolator/protoext/commonext/configtx.go | 6 +- .../protoext/commonext/configuration.go | 6 +- .../protolator/protoext/commonext/policies.go | 4 +- .../protolator/protoext/decorate.go | 12 +- .../protoext/ledger/rwsetext/rwset.go | 6 +- .../protolator/protoext/mspext/msp_config.go | 4 +- .../protoext/mspext/msp_principal.go | 4 +- .../protoext/ordererext/configuration.go | 17 +- .../protoext/peerext/configuration.go | 8 +- .../protolator/protoext/peerext/proposal.go | 6 +- .../protoext/peerext/proposal_response.go | 4 +- .../protoext/peerext/transaction.go | 6 +- .../protolator/statically_opaque.go | 2 +- .../protolator/variably_opaque.go | 2 +- .../LICENSE | 0 .../common/collection.pb.go | 536 ++ .../common/common.pb.go | 1456 +++++ .../common/configtx.pb.go | 840 +++ .../common/configuration.pb.go | 705 ++ .../common/ledger.pb.go | 262 + .../common/policies.pb.go | 761 +++ .../discovery/protocol.pb.go | 1788 +++++ .../discovery/protocol_grpc.pb.go | 113 + .../gateway/gateway.pb.go | 1416 ++++ .../gateway/gateway_grpc.pb.go | 329 + .../gossip/message.pb.go | 3427 ++++++++++ .../gossip/message_grpc.pb.go | 185 + .../ledger/queryresult/kv_query_result.pb.go | 280 + .../ledger/rwset/kvrwset/kv_rwset.pb.go | 1223 ++++ .../ledger/rwset/rwset.pb.go | 630 ++ .../msp/identities.pb.go | 282 + .../msp/msp_config.pb.go | 1088 ++++ .../msp/msp_principal.pb.go | 704 ++ .../fabric-protos-go-apiv2/orderer/ab.pb.go | 950 +++ .../orderer/ab_grpc.pb.go | 217 + .../orderer/blockattestation.pb.go | 296 + .../orderer/blockattestation_grpc.pb.go | 141 + .../orderer/cluster.pb.go | 570 ++ .../orderer/cluster_grpc.pb.go | 145 + .../orderer/clusterserver.pb.go | 728 +++ .../orderer/clusterserver_grpc.pb.go | 145 + .../orderer/configuration.pb.go | 526 ++ .../orderer/etcdraft/configuration.pb.go | 378 ++ .../orderer/etcdraft/metadata.pb.go | 253 + .../orderer/smartbft/configuration.pb.go | 416 ++ .../peer/chaincode.pb.go | 887 +++ .../peer/chaincode_event.pb.go | 188 + .../peer/chaincode_shim.pb.go | 1684 +++++ .../peer/chaincode_shim_grpc.pb.go | 263 + .../peer/collection.pb.go | 528 ++ .../peer/configuration.pb.go | 371 ++ .../fabric-protos-go-apiv2/peer/events.pb.go | 722 ++ .../peer/events_grpc.pb.go | 300 + .../peer/lifecycle/chaincode_definition.pb.go | 262 + .../peer/lifecycle/db.pb.go | 290 + .../peer/lifecycle/lifecycle.pb.go | 2971 +++++++++ .../fabric-protos-go-apiv2/peer/peer.pb.go | 90 + .../peer/peer_grpc.pb.go | 111 + .../fabric-protos-go-apiv2/peer/policy.pb.go | 214 + .../peer/proposal.pb.go | 582 ++ .../peer/proposal_response.pb.go | 694 ++ .../fabric-protos-go-apiv2/peer/query.pb.go | 506 ++ .../peer/resources.pb.go | 462 ++ .../peer/signed_cc_dep_spec.pb.go | 197 + .../peer/snapshot.pb.go | 432 ++ .../peer/snapshot_grpc.pb.go | 192 + .../peer/transaction.pb.go | 741 +++ .../transientstore/transientstore.pb.go | 210 + .../fabric-protos-go/common/collection.pb.go | 373 -- .../fabric-protos-go/common/common.pb.go | 985 --- .../fabric-protos-go/common/configtx.pb.go | 548 -- .../common/configuration.pb.go | 468 -- .../fabric-protos-go/common/ledger.pb.go | 155 - .../fabric-protos-go/common/policies.pb.go | 512 -- .../fabric-protos-go/discovery/protocol.pb.go | 1275 ---- .../fabric-protos-go/gateway/gateway.pb.go | 1231 ---- .../fabric-protos-go/gossip/message.pb.go | 2552 -------- .../ledger/queryresult/kv_query_result.pb.go | 175 - .../ledger/rwset/kvrwset/kv_rwset.pb.go | 839 --- .../fabric-protos-go/ledger/rwset/rwset.pb.go | 392 -- .../fabric-protos-go/msp/identities.pb.go | 184 - .../fabric-protos-go/msp/msp_config.pb.go | 775 --- .../fabric-protos-go/msp/msp_principal.pb.go | 452 -- .../fabric-protos-go/orderer/ab.pb.go | 812 --- .../orderer/blockattestation.pb.go | 293 - .../fabric-protos-go/orderer/cluster.pb.go | 506 -- .../orderer/clusterserver.pb.go | 622 -- .../orderer/configuration.pb.go | 335 - .../orderer/etcdraft/configuration.pb.go | 247 - .../orderer/etcdraft/metadata.pb.go | 152 - .../orderer/smartbft/configuration.pb.go | 278 - .../fabric-protos-go/peer/chaincode.pb.go | 599 -- .../peer/chaincode_event.pb.go | 110 - .../peer/chaincode_shim.pb.go | 1363 ---- .../fabric-protos-go/peer/collection.pb.go | 366 -- .../fabric-protos-go/peer/configuration.pb.go | 225 - .../fabric-protos-go/peer/events.pb.go | 744 --- .../peer/lifecycle/chaincode_definition.pb.go | 158 - .../fabric-protos-go/peer/lifecycle/db.pb.go | 194 - .../peer/lifecycle/lifecycle.pb.go | 1984 ------ .../fabric-protos-go/peer/peer.pb.go | 123 - .../fabric-protos-go/peer/policy.pb.go | 131 - .../fabric-protos-go/peer/proposal.pb.go | 394 -- .../peer/proposal_response.pb.go | 478 -- .../fabric-protos-go/peer/query.pb.go | 334 - .../fabric-protos-go/peer/resources.pb.go | 292 - .../peer/signed_cc_dep_spec.pb.go | 112 - .../fabric-protos-go/peer/snapshot.pb.go | 422 -- .../fabric-protos-go/peer/transaction.pb.go | 494 -- .../transientstore/transientstore.pb.go | 114 - vendor/golang.org/x/crypto/LICENSE | 4 +- vendor/golang.org/x/crypto/hkdf/hkdf.go | 2 +- vendor/golang.org/x/crypto/sha3/doc.go | 2 +- vendor/golang.org/x/crypto/sha3/hashes.go | 8 + .../golang.org/x/crypto/sha3/keccakf_amd64.s | 5787 +++++++++++++++-- vendor/golang.org/x/crypto/sha3/register.go | 18 - vendor/golang.org/x/mod/LICENSE | 4 +- vendor/golang.org/x/net/LICENSE | 4 +- vendor/golang.org/x/net/http2/http2.go | 19 +- vendor/golang.org/x/net/http2/server.go | 94 +- vendor/golang.org/x/net/http2/testsync.go | 331 - vendor/golang.org/x/net/http2/timer.go | 20 + vendor/golang.org/x/net/http2/transport.go | 314 +- .../x/net/http2/writesched_priority.go | 4 +- vendor/golang.org/x/sys/unix/ztypes_linux.go | 3 + .../golang.org/x/sys/windows/types_windows.go | 44 + vendor/golang.org/x/tools/LICENSE | 4 +- .../tools/go/internal/packagesdriver/sizes.go | 53 - vendor/golang.org/x/tools/go/packages/doc.go | 8 - .../x/tools/go/packages/external.go | 22 +- .../golang.org/x/tools/go/packages/golist.go | 126 +- .../x/tools/go/packages/packages.go | 104 +- .../golang.org/x/tools/go/packages/visit.go | 9 + .../x/tools/go/types/objectpath/objectpath.go | 93 +- .../x/tools/internal/aliases/aliases_go121.go | 12 +- .../x/tools/internal/aliases/aliases_go122.go | 36 + .../x/tools/internal/gocommand/invoke.go | 113 +- .../x/tools/internal/pkgbits/decoder.go | 4 - .../x/tools/internal/stdlib/manifest.go | 111 + .../x/tools/internal/typesinternal/types.go | 15 + .../x/tools/internal/versions/constraint.go | 13 + .../internal/versions/constraint_go121.go | 14 + .../x/tools/internal/versions/types_go122.go | 2 +- vendor/google.golang.org/grpc/MAINTAINERS.md | 33 +- vendor/google.golang.org/grpc/SECURITY.md | 2 +- .../google.golang.org/grpc/backoff/backoff.go | 2 +- .../grpc/balancer/balancer.go | 21 + .../grpc/balancer/pickfirst/pickfirst.go | 2 +- .../grpc/balancer_wrapper.go | 44 +- .../grpc_binarylog_v1/binarylog.pb.go | 2 +- vendor/google.golang.org/grpc/clientconn.go | 114 +- vendor/google.golang.org/grpc/codec.go | 69 +- vendor/google.golang.org/grpc/dialoptions.go | 27 +- vendor/google.golang.org/grpc/doc.go | 2 +- .../grpc/encoding/encoding.go | 5 +- .../grpc/encoding/encoding_v2.go | 81 + .../grpc/encoding/proto/proto.go | 44 +- .../grpc/experimental/stats/metricregistry.go | 270 + .../grpc/experimental/stats/metrics.go | 114 + .../grpc/grpclog/component.go | 10 +- .../google.golang.org/grpc/grpclog/grpclog.go | 104 +- .../grpc/grpclog/internal/grpclog.go | 26 + .../grpc/grpclog/internal/logger.go | 87 + .../internal/loggerv2.go} | 178 +- .../google.golang.org/grpc/grpclog/logger.go | 59 +- .../grpc/grpclog/loggerv2.go | 181 +- .../grpc/health/grpc_health_v1/health.pb.go | 2 +- .../health/grpc_health_v1/health_grpc.pb.go | 71 +- .../grpc/internal/channelz/channelmap.go | 2 +- .../grpc/internal/envconfig/envconfig.go | 4 + .../grpc/internal/experimental.go | 8 +- .../{prefixLogger.go => prefix_logger.go} | 40 +- .../internal/grpcsync/callback_serializer.go | 24 +- .../grpc/internal/grpcsync/pubsub.go | 4 +- .../grpc/internal/internal.go | 21 + .../grpc/internal/stats/labels.go | 42 + .../internal/stats/metrics_recorder_list.go | 95 + .../grpc/internal/tcp_keepalive_unix.go | 2 +- .../grpc/internal/tcp_keepalive_windows.go | 2 +- .../grpc/internal/transport/controlbuf.go | 249 +- .../grpc/internal/transport/handler_server.go | 45 +- .../grpc/internal/transport/http2_client.go | 61 +- .../grpc/internal/transport/http2_server.go | 47 +- .../grpc/internal/transport/http_util.go | 22 +- .../grpc/internal/transport/proxy.go | 10 +- .../grpc/internal/transport/transport.go | 242 +- .../google.golang.org/grpc/mem/buffer_pool.go | 194 + .../grpc/mem/buffer_slice.go | 224 + vendor/google.golang.org/grpc/mem/buffers.go | 252 + .../grpc/metadata/metadata.go | 7 +- vendor/google.golang.org/grpc/preloader.go | 28 +- vendor/google.golang.org/grpc/regenerate.sh | 123 - .../grpc/resolver_wrapper.go | 9 +- vendor/google.golang.org/grpc/rpc_util.go | 299 +- vendor/google.golang.org/grpc/server.go | 98 +- .../grpc/shared_buffer_pool.go | 154 - vendor/google.golang.org/grpc/stats/stats.go | 6 - vendor/google.golang.org/grpc/stream.go | 213 +- vendor/google.golang.org/grpc/version.go | 2 +- vendor/modules.txt | 87 +- 1313 files changed, 52623 insertions(+), 32550 deletions(-) create mode 100644 common/grpclogging/testpb/echo_grpc.pb.go create mode 100644 common/grpcmetrics/testpb/echo_grpc.pb.go delete mode 100644 core/scc/mock/chaincode.go create mode 100644 internal/pkg/comm/testpb/test_grpc.pb.go create mode 100644 vendor/github.com/IBM/idemix/bccsp/schemes/aries/smartcard.go create mode 100644 vendor/github.com/alecthomas/units/renovate.json5 create mode 100644 vendor/github.com/consensys/gnark-crypto/ecc/bls12-377/fr/generator.go create mode 100644 vendor/github.com/consensys/gnark-crypto/ecc/bls12-381/fr/generator.go create mode 100644 vendor/github.com/consensys/gnark-crypto/ecc/bn254/fr/generator.go delete mode 100644 vendor/github.com/golang/protobuf/jsonpb/decode.go delete mode 100644 vendor/github.com/golang/protobuf/jsonpb/encode.go delete mode 100644 vendor/github.com/golang/protobuf/jsonpb/json.go delete mode 100644 vendor/github.com/golang/protobuf/ptypes/empty/empty.pb.go rename vendor/github.com/hyperledger/fabric-chaincode-go/{ => v2}/LICENSE (100%) rename vendor/github.com/hyperledger/fabric-chaincode-go/{ => v2}/pkg/statebased/interfaces.go (98%) rename vendor/github.com/hyperledger/fabric-chaincode-go/{ => v2}/pkg/statebased/statebasedimpl.go (92%) rename vendor/github.com/hyperledger/fabric-chaincode-go/{ => v2}/shim/chaincodeserver.go (88%) rename vendor/github.com/hyperledger/fabric-chaincode-go/{ => v2}/shim/handler.go (63%) rename vendor/github.com/hyperledger/fabric-chaincode-go/{ => v2}/shim/interfaces.go (94%) rename vendor/github.com/hyperledger/fabric-chaincode-go/{ => v2}/shim/internal/client.go (66%) rename vendor/github.com/hyperledger/fabric-chaincode-go/{ => v2}/shim/internal/config.go (92%) rename vendor/github.com/hyperledger/fabric-chaincode-go/{ => v2}/shim/internal/server.go (100%) rename vendor/github.com/hyperledger/fabric-chaincode-go/{ => v2}/shim/response.go (75%) rename vendor/github.com/hyperledger/fabric-chaincode-go/{ => v2}/shim/shim.go (85%) rename vendor/github.com/hyperledger/fabric-chaincode-go/{ => v2}/shim/stub.go (90%) rename vendor/github.com/hyperledger/{fabric-protos-go => fabric-protos-go-apiv2}/LICENSE (100%) create mode 100644 vendor/github.com/hyperledger/fabric-protos-go-apiv2/common/collection.pb.go create mode 100644 vendor/github.com/hyperledger/fabric-protos-go-apiv2/common/common.pb.go create mode 100644 vendor/github.com/hyperledger/fabric-protos-go-apiv2/common/configtx.pb.go create mode 100644 vendor/github.com/hyperledger/fabric-protos-go-apiv2/common/configuration.pb.go create mode 100644 vendor/github.com/hyperledger/fabric-protos-go-apiv2/common/ledger.pb.go create mode 100644 vendor/github.com/hyperledger/fabric-protos-go-apiv2/common/policies.pb.go create mode 100644 vendor/github.com/hyperledger/fabric-protos-go-apiv2/discovery/protocol.pb.go create mode 100644 vendor/github.com/hyperledger/fabric-protos-go-apiv2/discovery/protocol_grpc.pb.go create mode 100644 vendor/github.com/hyperledger/fabric-protos-go-apiv2/gateway/gateway.pb.go create mode 100644 vendor/github.com/hyperledger/fabric-protos-go-apiv2/gateway/gateway_grpc.pb.go create mode 100644 vendor/github.com/hyperledger/fabric-protos-go-apiv2/gossip/message.pb.go create mode 100644 vendor/github.com/hyperledger/fabric-protos-go-apiv2/gossip/message_grpc.pb.go create mode 100644 vendor/github.com/hyperledger/fabric-protos-go-apiv2/ledger/queryresult/kv_query_result.pb.go create mode 100644 vendor/github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset/kvrwset/kv_rwset.pb.go create mode 100644 vendor/github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset/rwset.pb.go create mode 100644 vendor/github.com/hyperledger/fabric-protos-go-apiv2/msp/identities.pb.go create mode 100644 vendor/github.com/hyperledger/fabric-protos-go-apiv2/msp/msp_config.pb.go create mode 100644 vendor/github.com/hyperledger/fabric-protos-go-apiv2/msp/msp_principal.pb.go create mode 100644 vendor/github.com/hyperledger/fabric-protos-go-apiv2/orderer/ab.pb.go create mode 100644 vendor/github.com/hyperledger/fabric-protos-go-apiv2/orderer/ab_grpc.pb.go create mode 100644 vendor/github.com/hyperledger/fabric-protos-go-apiv2/orderer/blockattestation.pb.go create mode 100644 vendor/github.com/hyperledger/fabric-protos-go-apiv2/orderer/blockattestation_grpc.pb.go create mode 100644 vendor/github.com/hyperledger/fabric-protos-go-apiv2/orderer/cluster.pb.go create mode 100644 vendor/github.com/hyperledger/fabric-protos-go-apiv2/orderer/cluster_grpc.pb.go create mode 100644 vendor/github.com/hyperledger/fabric-protos-go-apiv2/orderer/clusterserver.pb.go create mode 100644 vendor/github.com/hyperledger/fabric-protos-go-apiv2/orderer/clusterserver_grpc.pb.go create mode 100644 vendor/github.com/hyperledger/fabric-protos-go-apiv2/orderer/configuration.pb.go create mode 100644 vendor/github.com/hyperledger/fabric-protos-go-apiv2/orderer/etcdraft/configuration.pb.go create mode 100644 vendor/github.com/hyperledger/fabric-protos-go-apiv2/orderer/etcdraft/metadata.pb.go create mode 100644 vendor/github.com/hyperledger/fabric-protos-go-apiv2/orderer/smartbft/configuration.pb.go create mode 100644 vendor/github.com/hyperledger/fabric-protos-go-apiv2/peer/chaincode.pb.go create mode 100644 vendor/github.com/hyperledger/fabric-protos-go-apiv2/peer/chaincode_event.pb.go create mode 100644 vendor/github.com/hyperledger/fabric-protos-go-apiv2/peer/chaincode_shim.pb.go create mode 100644 vendor/github.com/hyperledger/fabric-protos-go-apiv2/peer/chaincode_shim_grpc.pb.go create mode 100644 vendor/github.com/hyperledger/fabric-protos-go-apiv2/peer/collection.pb.go create mode 100644 vendor/github.com/hyperledger/fabric-protos-go-apiv2/peer/configuration.pb.go create mode 100644 vendor/github.com/hyperledger/fabric-protos-go-apiv2/peer/events.pb.go create mode 100644 vendor/github.com/hyperledger/fabric-protos-go-apiv2/peer/events_grpc.pb.go create mode 100644 vendor/github.com/hyperledger/fabric-protos-go-apiv2/peer/lifecycle/chaincode_definition.pb.go create mode 100644 vendor/github.com/hyperledger/fabric-protos-go-apiv2/peer/lifecycle/db.pb.go create mode 100644 vendor/github.com/hyperledger/fabric-protos-go-apiv2/peer/lifecycle/lifecycle.pb.go create mode 100644 vendor/github.com/hyperledger/fabric-protos-go-apiv2/peer/peer.pb.go create mode 100644 vendor/github.com/hyperledger/fabric-protos-go-apiv2/peer/peer_grpc.pb.go create mode 100644 vendor/github.com/hyperledger/fabric-protos-go-apiv2/peer/policy.pb.go create mode 100644 vendor/github.com/hyperledger/fabric-protos-go-apiv2/peer/proposal.pb.go create mode 100644 vendor/github.com/hyperledger/fabric-protos-go-apiv2/peer/proposal_response.pb.go create mode 100644 vendor/github.com/hyperledger/fabric-protos-go-apiv2/peer/query.pb.go create mode 100644 vendor/github.com/hyperledger/fabric-protos-go-apiv2/peer/resources.pb.go create mode 100644 vendor/github.com/hyperledger/fabric-protos-go-apiv2/peer/signed_cc_dep_spec.pb.go create mode 100644 vendor/github.com/hyperledger/fabric-protos-go-apiv2/peer/snapshot.pb.go create mode 100644 vendor/github.com/hyperledger/fabric-protos-go-apiv2/peer/snapshot_grpc.pb.go create mode 100644 vendor/github.com/hyperledger/fabric-protos-go-apiv2/peer/transaction.pb.go create mode 100644 vendor/github.com/hyperledger/fabric-protos-go-apiv2/transientstore/transientstore.pb.go delete mode 100644 vendor/github.com/hyperledger/fabric-protos-go/common/collection.pb.go delete mode 100644 vendor/github.com/hyperledger/fabric-protos-go/common/common.pb.go delete mode 100644 vendor/github.com/hyperledger/fabric-protos-go/common/configtx.pb.go delete mode 100644 vendor/github.com/hyperledger/fabric-protos-go/common/configuration.pb.go delete mode 100644 vendor/github.com/hyperledger/fabric-protos-go/common/ledger.pb.go delete mode 100644 vendor/github.com/hyperledger/fabric-protos-go/common/policies.pb.go delete mode 100644 vendor/github.com/hyperledger/fabric-protos-go/discovery/protocol.pb.go delete mode 100644 vendor/github.com/hyperledger/fabric-protos-go/gateway/gateway.pb.go delete mode 100644 vendor/github.com/hyperledger/fabric-protos-go/gossip/message.pb.go delete mode 100644 vendor/github.com/hyperledger/fabric-protos-go/ledger/queryresult/kv_query_result.pb.go delete mode 100644 vendor/github.com/hyperledger/fabric-protos-go/ledger/rwset/kvrwset/kv_rwset.pb.go delete mode 100644 vendor/github.com/hyperledger/fabric-protos-go/ledger/rwset/rwset.pb.go delete mode 100644 vendor/github.com/hyperledger/fabric-protos-go/msp/identities.pb.go delete mode 100644 vendor/github.com/hyperledger/fabric-protos-go/msp/msp_config.pb.go delete mode 100644 vendor/github.com/hyperledger/fabric-protos-go/msp/msp_principal.pb.go delete mode 100644 vendor/github.com/hyperledger/fabric-protos-go/orderer/ab.pb.go delete mode 100644 vendor/github.com/hyperledger/fabric-protos-go/orderer/blockattestation.pb.go delete mode 100644 vendor/github.com/hyperledger/fabric-protos-go/orderer/cluster.pb.go delete mode 100644 vendor/github.com/hyperledger/fabric-protos-go/orderer/clusterserver.pb.go delete mode 100644 vendor/github.com/hyperledger/fabric-protos-go/orderer/configuration.pb.go delete mode 100644 vendor/github.com/hyperledger/fabric-protos-go/orderer/etcdraft/configuration.pb.go delete mode 100644 vendor/github.com/hyperledger/fabric-protos-go/orderer/etcdraft/metadata.pb.go delete mode 100644 vendor/github.com/hyperledger/fabric-protos-go/orderer/smartbft/configuration.pb.go delete mode 100644 vendor/github.com/hyperledger/fabric-protos-go/peer/chaincode.pb.go delete mode 100644 vendor/github.com/hyperledger/fabric-protos-go/peer/chaincode_event.pb.go delete mode 100644 vendor/github.com/hyperledger/fabric-protos-go/peer/chaincode_shim.pb.go delete mode 100644 vendor/github.com/hyperledger/fabric-protos-go/peer/collection.pb.go delete mode 100644 vendor/github.com/hyperledger/fabric-protos-go/peer/configuration.pb.go delete mode 100644 vendor/github.com/hyperledger/fabric-protos-go/peer/events.pb.go delete mode 100644 vendor/github.com/hyperledger/fabric-protos-go/peer/lifecycle/chaincode_definition.pb.go delete mode 100644 vendor/github.com/hyperledger/fabric-protos-go/peer/lifecycle/db.pb.go delete mode 100644 vendor/github.com/hyperledger/fabric-protos-go/peer/lifecycle/lifecycle.pb.go delete mode 100644 vendor/github.com/hyperledger/fabric-protos-go/peer/peer.pb.go delete mode 100644 vendor/github.com/hyperledger/fabric-protos-go/peer/policy.pb.go delete mode 100644 vendor/github.com/hyperledger/fabric-protos-go/peer/proposal.pb.go delete mode 100644 vendor/github.com/hyperledger/fabric-protos-go/peer/proposal_response.pb.go delete mode 100644 vendor/github.com/hyperledger/fabric-protos-go/peer/query.pb.go delete mode 100644 vendor/github.com/hyperledger/fabric-protos-go/peer/resources.pb.go delete mode 100644 vendor/github.com/hyperledger/fabric-protos-go/peer/signed_cc_dep_spec.pb.go delete mode 100644 vendor/github.com/hyperledger/fabric-protos-go/peer/snapshot.pb.go delete mode 100644 vendor/github.com/hyperledger/fabric-protos-go/peer/transaction.pb.go delete mode 100644 vendor/github.com/hyperledger/fabric-protos-go/transientstore/transientstore.pb.go delete mode 100644 vendor/golang.org/x/crypto/sha3/register.go delete mode 100644 vendor/golang.org/x/net/http2/testsync.go create mode 100644 vendor/golang.org/x/net/http2/timer.go delete mode 100644 vendor/golang.org/x/tools/go/internal/packagesdriver/sizes.go create mode 100644 vendor/golang.org/x/tools/internal/versions/constraint.go create mode 100644 vendor/golang.org/x/tools/internal/versions/constraint_go121.go create mode 100644 vendor/google.golang.org/grpc/encoding/encoding_v2.go create mode 100644 vendor/google.golang.org/grpc/experimental/stats/metricregistry.go create mode 100644 vendor/google.golang.org/grpc/experimental/stats/metrics.go create mode 100644 vendor/google.golang.org/grpc/grpclog/internal/grpclog.go create mode 100644 vendor/google.golang.org/grpc/grpclog/internal/logger.go rename vendor/google.golang.org/grpc/{internal/grpclog/grpclog.go => grpclog/internal/loggerv2.go} (52%) rename vendor/google.golang.org/grpc/internal/grpclog/{prefixLogger.go => prefix_logger.go} (63%) create mode 100644 vendor/google.golang.org/grpc/internal/stats/labels.go create mode 100644 vendor/google.golang.org/grpc/internal/stats/metrics_recorder_list.go create mode 100644 vendor/google.golang.org/grpc/mem/buffer_pool.go create mode 100644 vendor/google.golang.org/grpc/mem/buffer_slice.go create mode 100644 vendor/google.golang.org/grpc/mem/buffers.go delete mode 100644 vendor/google.golang.org/grpc/regenerate.sh delete mode 100644 vendor/google.golang.org/grpc/shared_buffer_pool.go diff --git a/cmd/common/signer/signer.go b/cmd/common/signer/signer.go index d7f13ddec79..0bb336b130a 100644 --- a/cmd/common/signer/signer.go +++ b/cmd/common/signer/signer.go @@ -19,7 +19,7 @@ import ( "strings" "github.com/hyperledger/fabric-lib-go/bccsp/utils" - "github.com/hyperledger/fabric-protos-go/msp" + "github.com/hyperledger/fabric-protos-go-apiv2/msp" "github.com/hyperledger/fabric/common/util" "github.com/hyperledger/fabric/protoutil" "github.com/pkg/errors" diff --git a/cmd/configtxgen/main.go b/cmd/configtxgen/main.go index a0c4dcb9c1e..be724f90e59 100644 --- a/cmd/configtxgen/main.go +++ b/cmd/configtxgen/main.go @@ -18,7 +18,7 @@ import ( "github.com/hyperledger/fabric-config/protolator/protoext/peerext" "github.com/hyperledger/fabric-lib-go/bccsp/factory" "github.com/hyperledger/fabric-lib-go/common/flogging" - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/internal/configtxgen/encoder" "github.com/hyperledger/fabric/internal/configtxgen/genesisconfig" "github.com/hyperledger/fabric/internal/configtxgen/metadata" diff --git a/cmd/configtxlator/main.go b/cmd/configtxlator/main.go index 0b3ddecde5e..90d8f75da73 100644 --- a/cmd/configtxlator/main.go +++ b/cmd/configtxlator/main.go @@ -14,19 +14,19 @@ import ( "os" "reflect" - "github.com/golang/protobuf/proto" "github.com/gorilla/handlers" "github.com/hyperledger/fabric-config/protolator" "github.com/hyperledger/fabric-lib-go/common/flogging" - cb "github.com/hyperledger/fabric-protos-go/common" - _ "github.com/hyperledger/fabric-protos-go/msp" - _ "github.com/hyperledger/fabric-protos-go/orderer" - _ "github.com/hyperledger/fabric-protos-go/orderer/etcdraft" - _ "github.com/hyperledger/fabric-protos-go/peer" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + _ "github.com/hyperledger/fabric-protos-go-apiv2/msp" + _ "github.com/hyperledger/fabric-protos-go-apiv2/orderer" + _ "github.com/hyperledger/fabric-protos-go-apiv2/orderer/etcdraft" + _ "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/internal/configtxlator/metadata" "github.com/hyperledger/fabric/internal/configtxlator/rest" "github.com/hyperledger/fabric/internal/configtxlator/update" "github.com/pkg/errors" + "google.golang.org/protobuf/proto" "google.golang.org/protobuf/reflect/protoreflect" "google.golang.org/protobuf/reflect/protoregistry" "gopkg.in/alecthomas/kingpin.v2" @@ -131,7 +131,7 @@ func encodeProto(msgName string, input, output *os.File) error { return errors.Wrapf(err, "error encode input") } - msgType := reflect.TypeOf(proto.MessageV1(mt.Zero().Interface())) + msgType := reflect.TypeOf(mt.Zero().Interface()) if msgType == nil { return errors.Errorf("message of type %s unknown", msgType) @@ -143,6 +143,9 @@ func encodeProto(msgName string, input, output *os.File) error { return errors.Wrapf(err, "error decoding input") } + if msg == nil { + return errors.New("error marshaling: proto: Marshal called with nil") + } out, err := proto.Marshal(msg) if err != nil { return errors.Wrapf(err, "error marshaling") @@ -162,7 +165,7 @@ func decodeProto(msgName string, input, output *os.File) error { return errors.Wrapf(err, "error encode input") } - msgType := reflect.TypeOf(proto.MessageV1(mt.Zero().Interface())) + msgType := reflect.TypeOf(mt.Zero().Interface()) if msgType == nil { return errors.Errorf("message of type %s unknown", msgType) @@ -217,6 +220,9 @@ func computeUpdt(original, updated, output *os.File, channelID string) error { cu.ChannelId = channelID + if cu == nil { + return errors.New("error marshaling computed config update: proto: Marshal called with nil") + } outBytes, err := proto.Marshal(cu) if err != nil { return errors.Wrapf(err, "error marshaling computed config update") diff --git a/cmd/osnadmin/main.go b/cmd/osnadmin/main.go index 464293ae515..227604666a1 100644 --- a/cmd/osnadmin/main.go +++ b/cmd/osnadmin/main.go @@ -16,10 +16,10 @@ import ( "net/http" "os" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/internal/osnadmin" "github.com/hyperledger/fabric/protoutil" + "google.golang.org/protobuf/proto" "gopkg.in/alecthomas/kingpin.v2" ) diff --git a/cmd/osnadmin/main_test.go b/cmd/osnadmin/main_test.go index 325341fdcc3..c3bf889c803 100644 --- a/cmd/osnadmin/main_test.go +++ b/cmd/osnadmin/main_test.go @@ -18,9 +18,8 @@ import ( "os" "path/filepath" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/bccsp" - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/cmd/osnadmin/mocks" "github.com/hyperledger/fabric/common/crypto/tlsgen" "github.com/hyperledger/fabric/orderer/common/channelparticipation" @@ -29,6 +28,7 @@ import ( "github.com/hyperledger/fabric/protoutil" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" + "google.golang.org/protobuf/proto" ) var _ = Describe("osnadmin", func() { diff --git a/cmd/osnadmin/mocks/channel_management.go b/cmd/osnadmin/mocks/channel_management.go index eafe6340c86..f4eb3df2f63 100644 --- a/cmd/osnadmin/mocks/channel_management.go +++ b/cmd/osnadmin/mocks/channel_management.go @@ -4,7 +4,7 @@ package mocks import ( "sync" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/orderer/common/types" ) diff --git a/cmd/osnadmin/osnadmin_suite_test.go b/cmd/osnadmin/osnadmin_suite_test.go index 478b190eea5..3f36a3d5435 100644 --- a/cmd/osnadmin/osnadmin_suite_test.go +++ b/cmd/osnadmin/osnadmin_suite_test.go @@ -9,7 +9,7 @@ package main import ( "testing" - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/orderer/common/types" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" diff --git a/common/capabilities/application.go b/common/capabilities/application.go index 8b5ecfcc8ef..045b398b69b 100644 --- a/common/capabilities/application.go +++ b/common/capabilities/application.go @@ -7,7 +7,7 @@ SPDX-License-Identifier: Apache-2.0 package capabilities import ( - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" ) const ( diff --git a/common/capabilities/application_test.go b/common/capabilities/application_test.go index e40603ea7d2..a4049e09699 100644 --- a/common/capabilities/application_test.go +++ b/common/capabilities/application_test.go @@ -9,7 +9,7 @@ package capabilities import ( "testing" - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/stretchr/testify/require" ) diff --git a/common/capabilities/capabilities.go b/common/capabilities/capabilities.go index bea3e51e509..0348e4226b2 100644 --- a/common/capabilities/capabilities.go +++ b/common/capabilities/capabilities.go @@ -8,7 +8,7 @@ package capabilities import ( "github.com/hyperledger/fabric-lib-go/common/flogging" - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/pkg/errors" ) diff --git a/common/capabilities/capabilities_test.go b/common/capabilities/capabilities_test.go index f0ea1da1b43..a0c8330ecc3 100644 --- a/common/capabilities/capabilities_test.go +++ b/common/capabilities/capabilities_test.go @@ -9,7 +9,7 @@ package capabilities import ( "testing" - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/stretchr/testify/require" ) diff --git a/common/capabilities/channel.go b/common/capabilities/channel.go index 6397a43676b..32facc44d63 100644 --- a/common/capabilities/channel.go +++ b/common/capabilities/channel.go @@ -7,7 +7,7 @@ SPDX-License-Identifier: Apache-2.0 package capabilities import ( - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/msp" ) diff --git a/common/capabilities/channel_test.go b/common/capabilities/channel_test.go index 07b0d2bd9be..4ae32790cfb 100644 --- a/common/capabilities/channel_test.go +++ b/common/capabilities/channel_test.go @@ -9,7 +9,7 @@ package capabilities import ( "testing" - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/msp" "github.com/stretchr/testify/require" ) diff --git a/common/capabilities/orderer.go b/common/capabilities/orderer.go index ab3bc6a9783..18a4427e200 100644 --- a/common/capabilities/orderer.go +++ b/common/capabilities/orderer.go @@ -7,7 +7,7 @@ SPDX-License-Identifier: Apache-2.0 package capabilities import ( - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" ) const ( diff --git a/common/capabilities/orderer_test.go b/common/capabilities/orderer_test.go index 19f4286a238..baca64bc19d 100644 --- a/common/capabilities/orderer_test.go +++ b/common/capabilities/orderer_test.go @@ -9,7 +9,7 @@ package capabilities import ( "testing" - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/stretchr/testify/require" ) diff --git a/common/cauthdsl/cauthdsl.go b/common/cauthdsl/cauthdsl.go index 41efeabdca5..d218fbf5df3 100644 --- a/common/cauthdsl/cauthdsl.go +++ b/common/cauthdsl/cauthdsl.go @@ -11,8 +11,8 @@ import ( "time" "github.com/hyperledger/fabric-lib-go/common/flogging" - cb "github.com/hyperledger/fabric-protos-go/common" - mb "github.com/hyperledger/fabric-protos-go/msp" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + mb "github.com/hyperledger/fabric-protos-go-apiv2/msp" "github.com/hyperledger/fabric/msp" "go.uber.org/zap/zapcore" ) diff --git a/common/cauthdsl/cauthdsl_test.go b/common/cauthdsl/cauthdsl_test.go index e0411267d95..4fbb09ebf22 100644 --- a/common/cauthdsl/cauthdsl_test.go +++ b/common/cauthdsl/cauthdsl_test.go @@ -12,12 +12,12 @@ import ( "testing" "time" - "github.com/golang/protobuf/proto" - cb "github.com/hyperledger/fabric-protos-go/common" - mb "github.com/hyperledger/fabric-protos-go/msp" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + mb "github.com/hyperledger/fabric-protos-go-apiv2/msp" "github.com/hyperledger/fabric/common/policydsl" "github.com/hyperledger/fabric/msp" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) var invalidSignature = []byte("badsigned") diff --git a/common/cauthdsl/policy.go b/common/cauthdsl/policy.go index 98ad163b302..c4bb8d3b2b8 100644 --- a/common/cauthdsl/policy.go +++ b/common/cauthdsl/policy.go @@ -9,12 +9,12 @@ package cauthdsl import ( "fmt" - "github.com/golang/protobuf/proto" - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/common/policies" "github.com/hyperledger/fabric/msp" "github.com/hyperledger/fabric/protoutil" "github.com/pkg/errors" + "google.golang.org/protobuf/proto" ) type provider struct { diff --git a/common/cauthdsl/policy_test.go b/common/cauthdsl/policy_test.go index 47230c62012..d2b1fc6cc72 100644 --- a/common/cauthdsl/policy_test.go +++ b/common/cauthdsl/policy_test.go @@ -10,12 +10,12 @@ import ( "fmt" "testing" - "github.com/golang/protobuf/proto" - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/common/policies" "github.com/hyperledger/fabric/common/policydsl" "github.com/hyperledger/fabric/protoutil" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) var ( diff --git a/common/chaincode/metadata.go b/common/chaincode/metadata.go index 23d3b3b3c14..78c8a17267c 100644 --- a/common/chaincode/metadata.go +++ b/common/chaincode/metadata.go @@ -9,8 +9,8 @@ package chaincode import ( "sync" - "github.com/hyperledger/fabric-protos-go/gossip" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/gossip" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" ) // InstalledChaincode defines metadata about an installed chaincode diff --git a/common/chaincode/metadata_test.go b/common/chaincode/metadata_test.go index 87b0d65b783..e38d33f0a66 100644 --- a/common/chaincode/metadata_test.go +++ b/common/chaincode/metadata_test.go @@ -9,7 +9,7 @@ package chaincode import ( "testing" - "github.com/hyperledger/fabric-protos-go/gossip" + "github.com/hyperledger/fabric-protos-go-apiv2/gossip" "github.com/stretchr/testify/require" ) diff --git a/common/channelconfig/acls.go b/common/channelconfig/acls.go index f1eb0a788ab..deb028346ad 100644 --- a/common/channelconfig/acls.go +++ b/common/channelconfig/acls.go @@ -7,7 +7,7 @@ SPDX-License-Identifier: Apache-2.0 package channelconfig import ( - pb "github.com/hyperledger/fabric-protos-go/peer" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" ) // aclsProvider provides mappings for resource to policy names diff --git a/common/channelconfig/acls_test.go b/common/channelconfig/acls_test.go index ef61a735404..e62848d9a91 100644 --- a/common/channelconfig/acls_test.go +++ b/common/channelconfig/acls_test.go @@ -9,7 +9,7 @@ package channelconfig import ( "testing" - pb "github.com/hyperledger/fabric-protos-go/peer" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/stretchr/testify/require" ) diff --git a/common/channelconfig/api.go b/common/channelconfig/api.go index dec023342bc..ed7d45389b5 100644 --- a/common/channelconfig/api.go +++ b/common/channelconfig/api.go @@ -9,9 +9,9 @@ package channelconfig import ( "time" - cb "github.com/hyperledger/fabric-protos-go/common" - ab "github.com/hyperledger/fabric-protos-go/orderer" - pb "github.com/hyperledger/fabric-protos-go/peer" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + ab "github.com/hyperledger/fabric-protos-go-apiv2/orderer" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/configtx" "github.com/hyperledger/fabric/common/policies" "github.com/hyperledger/fabric/msp" diff --git a/common/channelconfig/application.go b/common/channelconfig/application.go index 61d1de6377b..87632146c20 100644 --- a/common/channelconfig/application.go +++ b/common/channelconfig/application.go @@ -7,8 +7,8 @@ SPDX-License-Identifier: Apache-2.0 package channelconfig import ( - cb "github.com/hyperledger/fabric-protos-go/common" - pb "github.com/hyperledger/fabric-protos-go/peer" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/capabilities" "github.com/pkg/errors" ) diff --git a/common/channelconfig/application_test.go b/common/channelconfig/application_test.go index ab36737ec78..3268e6bfcdc 100644 --- a/common/channelconfig/application_test.go +++ b/common/channelconfig/application_test.go @@ -9,11 +9,11 @@ package channelconfig import ( "testing" - "github.com/golang/protobuf/proto" - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/common/capabilities" "github.com/hyperledger/fabric/protoutil" . "github.com/onsi/gomega" + "google.golang.org/protobuf/proto" ) func TestApplicationInterface(t *testing.T) { diff --git a/common/channelconfig/applicationorg.go b/common/channelconfig/applicationorg.go index 78ea85bcdb8..4ebb76e4d60 100644 --- a/common/channelconfig/applicationorg.go +++ b/common/channelconfig/applicationorg.go @@ -9,8 +9,8 @@ package channelconfig import ( "fmt" - cb "github.com/hyperledger/fabric-protos-go/common" - pb "github.com/hyperledger/fabric-protos-go/peer" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/pkg/errors" ) diff --git a/common/channelconfig/bundle.go b/common/channelconfig/bundle.go index d92dd469871..387be77ff2a 100644 --- a/common/channelconfig/bundle.go +++ b/common/channelconfig/bundle.go @@ -9,7 +9,7 @@ package channelconfig import ( "github.com/hyperledger/fabric-lib-go/bccsp" "github.com/hyperledger/fabric-lib-go/common/flogging" - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/common/cauthdsl" "github.com/hyperledger/fabric/common/configtx" "github.com/hyperledger/fabric/common/policies" diff --git a/common/channelconfig/bundle_test.go b/common/channelconfig/bundle_test.go index dde8d63bb15..127be3d7a91 100644 --- a/common/channelconfig/bundle_test.go +++ b/common/channelconfig/bundle_test.go @@ -9,8 +9,8 @@ package channelconfig import ( "testing" - cb "github.com/hyperledger/fabric-protos-go/common" - ab "github.com/hyperledger/fabric-protos-go/orderer" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + ab "github.com/hyperledger/fabric-protos-go-apiv2/orderer" cc "github.com/hyperledger/fabric/common/capabilities" "github.com/stretchr/testify/require" ) diff --git a/common/channelconfig/channel.go b/common/channelconfig/channel.go index 8787f621a29..35228a2adfe 100644 --- a/common/channelconfig/channel.go +++ b/common/channelconfig/channel.go @@ -11,7 +11,7 @@ import ( "math" "github.com/hyperledger/fabric-lib-go/bccsp" - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/common/capabilities" "github.com/hyperledger/fabric/common/util" "github.com/hyperledger/fabric/msp" diff --git a/common/channelconfig/channel_test.go b/common/channelconfig/channel_test.go index c06fe4d95b9..4d2c768ac96 100644 --- a/common/channelconfig/channel_test.go +++ b/common/channelconfig/channel_test.go @@ -13,7 +13,7 @@ import ( "github.com/hyperledger/fabric-lib-go/bccsp" "github.com/hyperledger/fabric-lib-go/bccsp/sw" - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/common/util" "github.com/stretchr/testify/require" ) diff --git a/common/channelconfig/consortium.go b/common/channelconfig/consortium.go index 252862579d5..57fc8ffb40c 100644 --- a/common/channelconfig/consortium.go +++ b/common/channelconfig/consortium.go @@ -7,7 +7,7 @@ SPDX-License-Identifier: Apache-2.0 package channelconfig import ( - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/pkg/errors" ) diff --git a/common/channelconfig/consortium_test.go b/common/channelconfig/consortium_test.go index ac4510606c9..aa5db755503 100644 --- a/common/channelconfig/consortium_test.go +++ b/common/channelconfig/consortium_test.go @@ -9,7 +9,7 @@ import ( "testing" "github.com/hyperledger/fabric-lib-go/bccsp/sw" - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/msp" "github.com/stretchr/testify/require" ) diff --git a/common/channelconfig/consortiums.go b/common/channelconfig/consortiums.go index 9d98c5c2f12..40669c1a8d3 100644 --- a/common/channelconfig/consortiums.go +++ b/common/channelconfig/consortiums.go @@ -7,7 +7,7 @@ SPDX-License-Identifier: Apache-2.0 package channelconfig import ( - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" ) const ( diff --git a/common/channelconfig/consortiums_test.go b/common/channelconfig/consortiums_test.go index 3b50dfd9b1b..8516bc15d20 100644 --- a/common/channelconfig/consortiums_test.go +++ b/common/channelconfig/consortiums_test.go @@ -8,7 +8,7 @@ package channelconfig import ( "testing" - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/stretchr/testify/require" ) diff --git a/common/channelconfig/msp.go b/common/channelconfig/msp.go index b641ba69ecb..6a06198feb9 100644 --- a/common/channelconfig/msp.go +++ b/common/channelconfig/msp.go @@ -9,12 +9,12 @@ package channelconfig import ( "fmt" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/bccsp" - mspprotos "github.com/hyperledger/fabric-protos-go/msp" + mspprotos "github.com/hyperledger/fabric-protos-go-apiv2/msp" "github.com/hyperledger/fabric/msp" "github.com/hyperledger/fabric/msp/cache" "github.com/pkg/errors" + "google.golang.org/protobuf/proto" ) type pendingMSPConfig struct { diff --git a/common/channelconfig/msp_test.go b/common/channelconfig/msp_test.go index f0f830a1205..6e2471151fa 100644 --- a/common/channelconfig/msp_test.go +++ b/common/channelconfig/msp_test.go @@ -11,7 +11,7 @@ import ( "github.com/hyperledger/fabric-lib-go/bccsp/factory" "github.com/hyperledger/fabric-lib-go/bccsp/sw" - mspprotos "github.com/hyperledger/fabric-protos-go/msp" + mspprotos "github.com/hyperledger/fabric-protos-go-apiv2/msp" "github.com/hyperledger/fabric/core/config/configtest" "github.com/hyperledger/fabric/msp" "github.com/stretchr/testify/require" diff --git a/common/channelconfig/orderer.go b/common/channelconfig/orderer.go index d7e3d558dd8..a772fecf57b 100644 --- a/common/channelconfig/orderer.go +++ b/common/channelconfig/orderer.go @@ -13,8 +13,8 @@ import ( "strings" "time" - cb "github.com/hyperledger/fabric-protos-go/common" - ab "github.com/hyperledger/fabric-protos-go/orderer" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + ab "github.com/hyperledger/fabric-protos-go-apiv2/orderer" "github.com/hyperledger/fabric/common/capabilities" "github.com/pkg/errors" ) diff --git a/common/channelconfig/orderer_test.go b/common/channelconfig/orderer_test.go index 1d23b02ca58..90b187abb31 100644 --- a/common/channelconfig/orderer_test.go +++ b/common/channelconfig/orderer_test.go @@ -9,7 +9,7 @@ package channelconfig import ( "testing" - ab "github.com/hyperledger/fabric-protos-go/orderer" + ab "github.com/hyperledger/fabric-protos-go-apiv2/orderer" "github.com/stretchr/testify/require" ) diff --git a/common/channelconfig/organization.go b/common/channelconfig/organization.go index 8fcf3fd9824..671c59cad8b 100644 --- a/common/channelconfig/organization.go +++ b/common/channelconfig/organization.go @@ -9,8 +9,8 @@ package channelconfig import ( "fmt" - cb "github.com/hyperledger/fabric-protos-go/common" - mspprotos "github.com/hyperledger/fabric-protos-go/msp" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + mspprotos "github.com/hyperledger/fabric-protos-go-apiv2/msp" "github.com/hyperledger/fabric/msp" "github.com/pkg/errors" ) diff --git a/common/channelconfig/realconfig_test.go b/common/channelconfig/realconfig_test.go index b3912253359..47b415a26c6 100644 --- a/common/channelconfig/realconfig_test.go +++ b/common/channelconfig/realconfig_test.go @@ -10,7 +10,7 @@ import ( "testing" "github.com/hyperledger/fabric-lib-go/bccsp/sw" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/common/channelconfig" "github.com/hyperledger/fabric/core/config/configtest" "github.com/hyperledger/fabric/internal/configtxgen/encoder" diff --git a/common/channelconfig/standardvalues.go b/common/channelconfig/standardvalues.go index 1794feac4b6..f03e613a0ba 100644 --- a/common/channelconfig/standardvalues.go +++ b/common/channelconfig/standardvalues.go @@ -10,8 +10,8 @@ import ( "fmt" "reflect" - "github.com/golang/protobuf/proto" - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + "google.golang.org/protobuf/proto" ) // DeserializeProtoValuesFromGroup deserializes the value for all values in a config group diff --git a/common/channelconfig/standardvalues_test.go b/common/channelconfig/standardvalues_test.go index bcaaeb9e85a..655d33a21b5 100644 --- a/common/channelconfig/standardvalues_test.go +++ b/common/channelconfig/standardvalues_test.go @@ -9,7 +9,7 @@ package channelconfig import ( "testing" - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/protoutil" "github.com/stretchr/testify/require" ) diff --git a/common/channelconfig/util.go b/common/channelconfig/util.go index 313da8a5309..ae64dab8329 100644 --- a/common/channelconfig/util.go +++ b/common/channelconfig/util.go @@ -11,16 +11,16 @@ import ( "math" "os" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/bccsp" - cb "github.com/hyperledger/fabric-protos-go/common" - mspprotos "github.com/hyperledger/fabric-protos-go/msp" - ab "github.com/hyperledger/fabric-protos-go/orderer" - "github.com/hyperledger/fabric-protos-go/orderer/etcdraft" - "github.com/hyperledger/fabric-protos-go/orderer/smartbft" - pb "github.com/hyperledger/fabric-protos-go/peer" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + mspprotos "github.com/hyperledger/fabric-protos-go-apiv2/msp" + ab "github.com/hyperledger/fabric-protos-go-apiv2/orderer" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer/etcdraft" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer/smartbft" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/protoutil" "github.com/pkg/errors" + "google.golang.org/protobuf/proto" ) const ( diff --git a/common/channelconfig/util_test.go b/common/channelconfig/util_test.go index b446bb31201..0f392fbf580 100644 --- a/common/channelconfig/util_test.go +++ b/common/channelconfig/util_test.go @@ -12,17 +12,17 @@ import ( "os" "testing" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-config/protolator" "github.com/hyperledger/fabric-lib-go/bccsp/sw" - cb "github.com/hyperledger/fabric-protos-go/common" - mspprotos "github.com/hyperledger/fabric-protos-go/msp" - ab "github.com/hyperledger/fabric-protos-go/orderer" - "github.com/hyperledger/fabric-protos-go/orderer/etcdraft" - pb "github.com/hyperledger/fabric-protos-go/peer" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + mspprotos "github.com/hyperledger/fabric-protos-go-apiv2/msp" + ab "github.com/hyperledger/fabric-protos-go-apiv2/orderer" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer/etcdraft" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/capabilities" "github.com/hyperledger/fabric/protoutil" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) // The tests in this file are all relatively pointless, as all of this function is exercised diff --git a/common/configtx/compare.go b/common/configtx/compare.go index d4def888ba7..074660ec2a3 100644 --- a/common/configtx/compare.go +++ b/common/configtx/compare.go @@ -9,7 +9,7 @@ package configtx import ( "bytes" - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" ) type comparable struct { diff --git a/common/configtx/compare_test.go b/common/configtx/compare_test.go index 79177cafd99..f2c11ad5490 100644 --- a/common/configtx/compare_test.go +++ b/common/configtx/compare_test.go @@ -9,7 +9,7 @@ package configtx import ( "testing" - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/stretchr/testify/require" ) diff --git a/common/configtx/configmap.go b/common/configtx/configmap.go index 9ea4f4fec2a..3472ecb8e51 100644 --- a/common/configtx/configmap.go +++ b/common/configtx/configmap.go @@ -9,10 +9,10 @@ package configtx import ( "strings" - "github.com/golang/protobuf/proto" - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/protoutil" "github.com/pkg/errors" + "google.golang.org/protobuf/proto" ) const ( diff --git a/common/configtx/configmap_test.go b/common/configtx/configmap_test.go index 1bc2b879cc2..89249318097 100644 --- a/common/configtx/configmap_test.go +++ b/common/configtx/configmap_test.go @@ -9,7 +9,7 @@ package configtx import ( "testing" - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/protoutil" "github.com/stretchr/testify/require" ) diff --git a/common/configtx/configtx.go b/common/configtx/configtx.go index 902be72edd3..bce4ad4c6ed 100644 --- a/common/configtx/configtx.go +++ b/common/configtx/configtx.go @@ -7,7 +7,7 @@ SPDX-License-Identifier: Apache-2.0 package configtx import ( - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" ) // Validator provides a mechanism to propose config updates, see the config update results diff --git a/common/configtx/test/helper.go b/common/configtx/test/helper.go index 3456a39c77f..e2113d68dbe 100644 --- a/common/configtx/test/helper.go +++ b/common/configtx/test/helper.go @@ -8,9 +8,9 @@ package test import ( "github.com/hyperledger/fabric-lib-go/common/flogging" - cb "github.com/hyperledger/fabric-protos-go/common" - mspproto "github.com/hyperledger/fabric-protos-go/msp" - pb "github.com/hyperledger/fabric-protos-go/peer" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + mspproto "github.com/hyperledger/fabric-protos-go-apiv2/msp" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/channelconfig" "github.com/hyperledger/fabric/common/genesis" "github.com/hyperledger/fabric/core/config/configtest" diff --git a/common/configtx/update.go b/common/configtx/update.go index 7ece37392b3..73eb00d74da 100644 --- a/common/configtx/update.go +++ b/common/configtx/update.go @@ -9,7 +9,7 @@ package configtx import ( "strings" - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/common/policies" "github.com/hyperledger/fabric/protoutil" "github.com/pkg/errors" diff --git a/common/configtx/update_test.go b/common/configtx/update_test.go index a1f781eaed1..f682a47476b 100644 --- a/common/configtx/update_test.go +++ b/common/configtx/update_test.go @@ -11,7 +11,7 @@ import ( "reflect" "testing" - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" mockpolicies "github.com/hyperledger/fabric/common/configtx/mock" "github.com/hyperledger/fabric/common/policies" "github.com/stretchr/testify/require" diff --git a/common/configtx/util.go b/common/configtx/util.go index 39177388d19..92cd6652621 100644 --- a/common/configtx/util.go +++ b/common/configtx/util.go @@ -7,9 +7,9 @@ SPDX-License-Identifier: Apache-2.0 package configtx import ( - "github.com/golang/protobuf/proto" - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/protoutil" + "google.golang.org/protobuf/proto" ) // UnmarshalConfig attempts to unmarshal bytes to a *cb.Config diff --git a/common/configtx/util_test.go b/common/configtx/util_test.go index 01c009defc0..1cdc644385e 100644 --- a/common/configtx/util_test.go +++ b/common/configtx/util_test.go @@ -10,7 +10,7 @@ import ( "math/rand" "testing" - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/protoutil" "github.com/stretchr/testify/require" ) diff --git a/common/configtx/validator.go b/common/configtx/validator.go index fa9374a068c..c743296f596 100644 --- a/common/configtx/validator.go +++ b/common/configtx/validator.go @@ -9,12 +9,12 @@ package configtx import ( "regexp" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/common/flogging" - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/common/policies" "github.com/hyperledger/fabric/protoutil" "github.com/pkg/errors" + "google.golang.org/protobuf/proto" ) var logger = flogging.MustGetLogger("common.configtx") diff --git a/common/configtx/validator_test.go b/common/configtx/validator_test.go index f5fa9bc6408..76b3b5215db 100644 --- a/common/configtx/validator_test.go +++ b/common/configtx/validator_test.go @@ -11,7 +11,7 @@ import ( "strings" "testing" - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" mockpolicies "github.com/hyperledger/fabric/common/configtx/mock" "github.com/hyperledger/fabric/common/policies" "github.com/hyperledger/fabric/protoutil" diff --git a/common/crypto/expiration.go b/common/crypto/expiration.go index 82d493b1779..658058fb2e4 100644 --- a/common/crypto/expiration.go +++ b/common/crypto/expiration.go @@ -12,9 +12,9 @@ import ( "encoding/pem" "time" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/msp" + "github.com/hyperledger/fabric-protos-go-apiv2/msp" "github.com/pkg/errors" + "google.golang.org/protobuf/proto" ) // ExpiresAt returns when the given identity expires, or a zero time.Time diff --git a/common/crypto/expiration_test.go b/common/crypto/expiration_test.go index b818f4c6ff8..179b3598d1e 100644 --- a/common/crypto/expiration_test.go +++ b/common/crypto/expiration_test.go @@ -17,11 +17,11 @@ import ( "testing" "time" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/msp" + "github.com/hyperledger/fabric-protos-go-apiv2/msp" "github.com/hyperledger/fabric/common/crypto/tlsgen" "github.com/hyperledger/fabric/protoutil" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) func TestX509CertExpiresAt(t *testing.T) { diff --git a/common/crypto/sanitize.go b/common/crypto/sanitize.go index 9a14edc34ba..c036074e782 100644 --- a/common/crypto/sanitize.go +++ b/common/crypto/sanitize.go @@ -15,10 +15,10 @@ import ( "math/big" "time" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/bccsp/utils" - "github.com/hyperledger/fabric-protos-go/msp" + "github.com/hyperledger/fabric-protos-go-apiv2/msp" "github.com/pkg/errors" + "google.golang.org/protobuf/proto" ) // SanitizeIdentity sanitizes the signature scheme of the identity diff --git a/common/deliver/acl.go b/common/deliver/acl.go index 5a2469efb87..ca81be3fe08 100644 --- a/common/deliver/acl.go +++ b/common/deliver/acl.go @@ -9,7 +9,7 @@ package deliver import ( "time" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/protoutil" "github.com/pkg/errors" ) diff --git a/common/deliver/acl_test.go b/common/deliver/acl_test.go index 708e530fb03..d54b6685137 100644 --- a/common/deliver/acl_test.go +++ b/common/deliver/acl_test.go @@ -9,7 +9,7 @@ package deliver_test import ( "time" - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/common/deliver" "github.com/hyperledger/fabric/common/deliver/mock" . "github.com/hyperledger/fabric/internal/test" diff --git a/common/deliver/binding.go b/common/deliver/binding.go index ef61de736a7..162306b55a0 100644 --- a/common/deliver/binding.go +++ b/common/deliver/binding.go @@ -10,9 +10,9 @@ import ( "bytes" "context" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric/common/util" "github.com/pkg/errors" + "google.golang.org/protobuf/proto" ) // BindingInspector receives as parameters a gRPC context and an Envelope, diff --git a/common/deliver/binding_test.go b/common/deliver/binding_test.go index 5466272d7db..d99ee5458ec 100644 --- a/common/deliver/binding_test.go +++ b/common/deliver/binding_test.go @@ -16,14 +16,14 @@ import ( "testing" "time" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/internal/pkg/comm" "github.com/hyperledger/fabric/internal/pkg/comm/testpb" "github.com/hyperledger/fabric/protoutil" "github.com/stretchr/testify/require" "google.golang.org/grpc" "google.golang.org/grpc/credentials" + "google.golang.org/protobuf/proto" ) func TestBindingInspectorBadInit(t *testing.T) { @@ -170,10 +170,7 @@ func (ins *inspection) withMutualTLS() *inspection { } func (ins *inspection) inspectBinding(envelope *common.Envelope) error { - ctx := context.Background() - ctx, c := context.WithTimeout(ctx, time.Second*3) - defer c() - conn, err := grpc.DialContext(ctx, ins.server.addr, grpc.WithTransportCredentials(ins.creds), grpc.WithBlock()) + conn, err := grpc.NewClient(ins.server.addr, grpc.WithTransportCredentials(ins.creds)) require.NoError(ins.t, err) defer conn.Close() _, err = testpb.NewTestServiceClient(conn).EmptyCall(context.Background(), &testpb.Empty{}) diff --git a/common/deliver/deliver.go b/common/deliver/deliver.go index b2ac17e07c1..d50f0284478 100644 --- a/common/deliver/deliver.go +++ b/common/deliver/deliver.go @@ -15,16 +15,16 @@ import ( "strconv" "time" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/common/flogging" - cb "github.com/hyperledger/fabric-protos-go/common" - ab "github.com/hyperledger/fabric-protos-go/orderer" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + ab "github.com/hyperledger/fabric-protos-go-apiv2/orderer" "github.com/hyperledger/fabric/common/crypto" "github.com/hyperledger/fabric/common/ledger/blockledger" "github.com/hyperledger/fabric/common/policies" "github.com/hyperledger/fabric/common/util" "github.com/hyperledger/fabric/protoutil" "github.com/pkg/errors" + "google.golang.org/protobuf/proto" ) var logger = flogging.MustGetLogger("common.deliver") diff --git a/common/deliver/deliver_test.go b/common/deliver/deliver_test.go index 7209440fa3f..f551653b2df 100644 --- a/common/deliver/deliver_test.go +++ b/common/deliver/deliver_test.go @@ -13,12 +13,11 @@ import ( "io" "time" - "github.com/golang/protobuf/ptypes/timestamp" "github.com/hyperledger/fabric-lib-go/common/metrics/disabled" "github.com/hyperledger/fabric-lib-go/common/metrics/metricsfakes" - cb "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/msp" - ab "github.com/hyperledger/fabric-protos-go/orderer" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/msp" + ab "github.com/hyperledger/fabric-protos-go-apiv2/orderer" "github.com/hyperledger/fabric/common/crypto/tlsgen" "github.com/hyperledger/fabric/common/deliver" "github.com/hyperledger/fabric/common/deliver/mock" @@ -29,6 +28,7 @@ import ( . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "github.com/pkg/errors" + "google.golang.org/protobuf/types/known/timestamppb" ) var ( @@ -150,7 +150,7 @@ var _ = Describe("Deliver", func() { channelHeader *cb.ChannelHeader seekInfo *ab.SeekInfo - ts *timestamp.Timestamp + ts *timestamppb.Timestamp channelHeaderPayload []byte seekInfoPayload []byte @@ -877,7 +877,7 @@ var _ = Describe("Deliver", func() { Context("when the channel header timestamp is out of the time window", func() { BeforeEach(func() { channelHeaderPayload = protoutil.MarshalOrPanic(&cb.ChannelHeader{ - Timestamp: ×tamp.Timestamp{}, + Timestamp: ×tamppb.Timestamp{}, }) }) diff --git a/common/deliver/mock/block_iterator.go b/common/deliver/mock/block_iterator.go index 57936d996bc..416429ba96e 100644 --- a/common/deliver/mock/block_iterator.go +++ b/common/deliver/mock/block_iterator.go @@ -4,7 +4,7 @@ package mock import ( "sync" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" ) type BlockIterator struct { diff --git a/common/deliver/mock/block_reader.go b/common/deliver/mock/block_reader.go index 5f71afe7061..77a0680a6f3 100644 --- a/common/deliver/mock/block_reader.go +++ b/common/deliver/mock/block_reader.go @@ -4,8 +4,8 @@ package mock import ( "sync" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/orderer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer" "github.com/hyperledger/fabric/common/ledger/blockledger" ) diff --git a/common/deliver/mock/filtered_response_sender.go b/common/deliver/mock/filtered_response_sender.go index 7fe55eb65b8..1c28bfa952d 100644 --- a/common/deliver/mock/filtered_response_sender.go +++ b/common/deliver/mock/filtered_response_sender.go @@ -4,7 +4,7 @@ package mock import ( "sync" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/common/deliver" "github.com/hyperledger/fabric/protoutil" ) diff --git a/common/deliver/mock/inspector.go b/common/deliver/mock/inspector.go index 8207c6c335b..e3403230d7e 100644 --- a/common/deliver/mock/inspector.go +++ b/common/deliver/mock/inspector.go @@ -5,8 +5,8 @@ import ( "context" "sync" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric/common/deliver" + "google.golang.org/protobuf/proto" ) type Inspector struct { diff --git a/common/deliver/mock/policy_checker.go b/common/deliver/mock/policy_checker.go index 16d74c666fe..94046831c94 100644 --- a/common/deliver/mock/policy_checker.go +++ b/common/deliver/mock/policy_checker.go @@ -4,7 +4,7 @@ package mock import ( "sync" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/common/deliver" ) diff --git a/common/deliver/mock/private_data_response_sender.go b/common/deliver/mock/private_data_response_sender.go index 96e66ad11f6..c672e854be3 100644 --- a/common/deliver/mock/private_data_response_sender.go +++ b/common/deliver/mock/private_data_response_sender.go @@ -4,7 +4,7 @@ package mock import ( "sync" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/common/deliver" "github.com/hyperledger/fabric/protoutil" ) diff --git a/common/deliver/mock/receiver.go b/common/deliver/mock/receiver.go index 2b567a2a9b5..b24ca7f2c44 100644 --- a/common/deliver/mock/receiver.go +++ b/common/deliver/mock/receiver.go @@ -4,7 +4,7 @@ package mock import ( "sync" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/common/deliver" ) diff --git a/common/deliver/mock/response_sender.go b/common/deliver/mock/response_sender.go index 426e2fa5b2f..038a1df98bd 100644 --- a/common/deliver/mock/response_sender.go +++ b/common/deliver/mock/response_sender.go @@ -4,7 +4,7 @@ package mock import ( "sync" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/common/deliver" "github.com/hyperledger/fabric/protoutil" ) diff --git a/common/deliverclient/block_verification.go b/common/deliverclient/block_verification.go index 6a6f123cb41..28ac6eb1634 100644 --- a/common/deliverclient/block_verification.go +++ b/common/deliverclient/block_verification.go @@ -12,7 +12,7 @@ import ( "github.com/hyperledger/fabric-lib-go/bccsp" "github.com/hyperledger/fabric-lib-go/common/flogging" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/common/configtx" "github.com/hyperledger/fabric/protoutil" "github.com/pkg/errors" diff --git a/common/deliverclient/block_verification_test.go b/common/deliverclient/block_verification_test.go index 4accacd7a52..ba7088a29ca 100644 --- a/common/deliverclient/block_verification_test.go +++ b/common/deliverclient/block_verification_test.go @@ -15,7 +15,7 @@ import ( "github.com/hyperledger/fabric-lib-go/bccsp/sw" "github.com/hyperledger/fabric-lib-go/common/flogging" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/common/crypto/tlsgen" "github.com/hyperledger/fabric/core/config/configtest" "github.com/hyperledger/fabric/internal/configtxgen/encoder" diff --git a/common/deliverclient/blocksprovider/adapters.go b/common/deliverclient/blocksprovider/adapters.go index d32c247b3b8..4d3caaf01f8 100644 --- a/common/deliverclient/blocksprovider/adapters.go +++ b/common/deliverclient/blocksprovider/adapters.go @@ -9,7 +9,7 @@ package blocksprovider import ( "context" - "github.com/hyperledger/fabric-protos-go/orderer" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer" "github.com/hyperledger/fabric/internal/pkg/comm" "google.golang.org/grpc" ) diff --git a/common/deliverclient/blocksprovider/bft_censorship_monitor.go b/common/deliverclient/blocksprovider/bft_censorship_monitor.go index 7edc9d88b7d..bd10bcb1fdf 100644 --- a/common/deliverclient/blocksprovider/bft_censorship_monitor.go +++ b/common/deliverclient/blocksprovider/bft_censorship_monitor.go @@ -14,8 +14,8 @@ import ( "time" "github.com/hyperledger/fabric-lib-go/common/flogging" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/orderer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer" "github.com/hyperledger/fabric/common/deliverclient/orderers" "github.com/pkg/errors" "go.uber.org/zap/zapcore" diff --git a/common/deliverclient/blocksprovider/bft_censorship_monitor_test.go b/common/deliverclient/blocksprovider/bft_censorship_monitor_test.go index 2aff7281ae2..01e76e0dfe3 100644 --- a/common/deliverclient/blocksprovider/bft_censorship_monitor_test.go +++ b/common/deliverclient/blocksprovider/bft_censorship_monitor_test.go @@ -15,8 +15,8 @@ import ( "time" "github.com/hyperledger/fabric-lib-go/common/flogging" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/orderer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer" "github.com/hyperledger/fabric/common/deliverclient/blocksprovider" "github.com/hyperledger/fabric/common/deliverclient/blocksprovider/fake" "github.com/hyperledger/fabric/common/deliverclient/orderers" diff --git a/common/deliverclient/blocksprovider/bft_deliverer.go b/common/deliverclient/blocksprovider/bft_deliverer.go index d58d8d41271..79c900ecce7 100644 --- a/common/deliverclient/blocksprovider/bft_deliverer.go +++ b/common/deliverclient/blocksprovider/bft_deliverer.go @@ -13,8 +13,8 @@ import ( "github.com/hyperledger/fabric-lib-go/bccsp" "github.com/hyperledger/fabric-lib-go/common/flogging" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/orderer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer" "github.com/hyperledger/fabric/common/deliverclient" "github.com/hyperledger/fabric/common/deliverclient/orderers" "github.com/hyperledger/fabric/internal/pkg/identity" diff --git a/common/deliverclient/blocksprovider/bft_deliverer_test.go b/common/deliverclient/blocksprovider/bft_deliverer_test.go index f33d9d574bb..ef5faeb1331 100644 --- a/common/deliverclient/blocksprovider/bft_deliverer_test.go +++ b/common/deliverclient/blocksprovider/bft_deliverer_test.go @@ -14,11 +14,10 @@ import ( "testing" "time" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/bccsp" "github.com/hyperledger/fabric-lib-go/common/flogging" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/orderer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer" "github.com/hyperledger/fabric/common/deliverclient/blocksprovider" "github.com/hyperledger/fabric/common/deliverclient/blocksprovider/fake" "github.com/hyperledger/fabric/common/deliverclient/orderers" @@ -30,6 +29,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/connectivity" "google.golang.org/grpc/credentials/insecure" + "google.golang.org/protobuf/proto" ) type bftDelivererTestSetup struct { diff --git a/common/deliverclient/blocksprovider/bft_header_receiver.go b/common/deliverclient/blocksprovider/bft_header_receiver.go index ece50ce031e..89d4e09c63d 100644 --- a/common/deliverclient/blocksprovider/bft_header_receiver.go +++ b/common/deliverclient/blocksprovider/bft_header_receiver.go @@ -11,8 +11,8 @@ import ( "time" "github.com/hyperledger/fabric-lib-go/common/flogging" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/orderer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer" "github.com/hyperledger/fabric/protoutil" "github.com/pkg/errors" ) diff --git a/common/deliverclient/blocksprovider/bft_header_receiver_test.go b/common/deliverclient/blocksprovider/bft_header_receiver_test.go index 7fc0a5b0198..d930d834fb9 100644 --- a/common/deliverclient/blocksprovider/bft_header_receiver_test.go +++ b/common/deliverclient/blocksprovider/bft_header_receiver_test.go @@ -13,8 +13,8 @@ import ( "time" "github.com/hyperledger/fabric-lib-go/common/flogging" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/orderer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer" "github.com/hyperledger/fabric/common/deliverclient/blocksprovider" "github.com/hyperledger/fabric/common/deliverclient/blocksprovider/fake" "github.com/hyperledger/fabric/protoutil" @@ -144,7 +144,7 @@ func TestBftHeaderReceiver_WithBlocks_Renew(t *testing.T) { assert.Equal(t, fakeBlockVerifier.VerifyBlockAttestationCallCount(), 2) assert.Equal(t, fakeBlockVerifier.VerifyBlockCallCount(), 0) - //=== Create a new BFTHeaderReceiver with the last good header of the previous receiver + // === Create a new BFTHeaderReceiver with the last good header of the previous receiver fakeBlockVerifier = &fake.UpdatableBlockVerifier{} streamClientMock = &fake.DeliverClient{} hr2 := blocksprovider.NewBFTHeaderReceiver("testchannel", "10.10.10.11:666", streamClientMock, fakeBlockVerifier, hr, flogging.MustGetLogger("test.BFTHeaderReceiver.2")) diff --git a/common/deliverclient/blocksprovider/block_receiver.go b/common/deliverclient/blocksprovider/block_receiver.go index 9a1a65bc444..53ffe6e1c43 100644 --- a/common/deliverclient/blocksprovider/block_receiver.go +++ b/common/deliverclient/blocksprovider/block_receiver.go @@ -11,8 +11,8 @@ import ( "sync" "github.com/hyperledger/fabric-lib-go/common/flogging" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/orderer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer" "github.com/hyperledger/fabric/common/deliverclient" "github.com/hyperledger/fabric/common/deliverclient/orderers" "github.com/hyperledger/fabric/protoutil" diff --git a/common/deliverclient/blocksprovider/blocksprovider_suite_test.go b/common/deliverclient/blocksprovider/blocksprovider_suite_test.go index 4ea41ebb83e..df804690401 100644 --- a/common/deliverclient/blocksprovider/blocksprovider_suite_test.go +++ b/common/deliverclient/blocksprovider/blocksprovider_suite_test.go @@ -12,7 +12,7 @@ import ( . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" - "github.com/hyperledger/fabric-protos-go/orderer" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer" "github.com/hyperledger/fabric/internal/pkg/identity" ) diff --git a/common/deliverclient/blocksprovider/deliverer.go b/common/deliverclient/blocksprovider/deliverer.go index 0dc803f2484..8a9d30a44c1 100644 --- a/common/deliverclient/blocksprovider/deliverer.go +++ b/common/deliverclient/blocksprovider/deliverer.go @@ -14,9 +14,9 @@ import ( "github.com/hyperledger/fabric-lib-go/bccsp" "github.com/hyperledger/fabric-lib-go/common/flogging" - cb "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/gossip" - "github.com/hyperledger/fabric-protos-go/orderer" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/gossip" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer" "github.com/hyperledger/fabric/common/deliverclient/orderers" "github.com/hyperledger/fabric/internal/pkg/identity" "google.golang.org/grpc" diff --git a/common/deliverclient/blocksprovider/deliverer_test.go b/common/deliverclient/blocksprovider/deliverer_test.go index 5ef2635e9c4..2c31ea53b78 100644 --- a/common/deliverclient/blocksprovider/deliverer_test.go +++ b/common/deliverclient/blocksprovider/deliverer_test.go @@ -16,8 +16,8 @@ import ( "github.com/hyperledger/fabric-lib-go/bccsp" "github.com/hyperledger/fabric-lib-go/bccsp/sw" "github.com/hyperledger/fabric-lib-go/common/flogging" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/orderer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer" "github.com/hyperledger/fabric/common/crypto/tlsgen" "github.com/hyperledger/fabric/common/deliverclient/blocksprovider" "github.com/hyperledger/fabric/common/deliverclient/blocksprovider/fake" diff --git a/common/deliverclient/blocksprovider/delivery_requester.go b/common/deliverclient/blocksprovider/delivery_requester.go index fa2573c7ca4..cec203338bb 100644 --- a/common/deliverclient/blocksprovider/delivery_requester.go +++ b/common/deliverclient/blocksprovider/delivery_requester.go @@ -10,8 +10,8 @@ import ( "context" "math" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/orderer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer" "github.com/hyperledger/fabric/common/deliverclient/orderers" "github.com/hyperledger/fabric/internal/pkg/identity" "github.com/hyperledger/fabric/protoutil" diff --git a/common/deliverclient/blocksprovider/delivery_requester_test.go b/common/deliverclient/blocksprovider/delivery_requester_test.go index 8661aff4e5b..6cd5da83b99 100644 --- a/common/deliverclient/blocksprovider/delivery_requester_test.go +++ b/common/deliverclient/blocksprovider/delivery_requester_test.go @@ -9,7 +9,7 @@ package blocksprovider_test import ( "testing" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/common/deliverclient/blocksprovider" "github.com/hyperledger/fabric/common/deliverclient/blocksprovider/fake" "github.com/hyperledger/fabric/common/deliverclient/orderers" diff --git a/common/deliverclient/blocksprovider/fake/ab_deliver_client.go b/common/deliverclient/blocksprovider/fake/ab_deliver_client.go index 111fb9e2429..8532fda2ff7 100644 --- a/common/deliverclient/blocksprovider/fake/ab_deliver_client.go +++ b/common/deliverclient/blocksprovider/fake/ab_deliver_client.go @@ -5,8 +5,8 @@ import ( "context" "sync" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/orderer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer" "google.golang.org/grpc/metadata" ) diff --git a/common/deliverclient/blocksprovider/fake/block_handler.go b/common/deliverclient/blocksprovider/fake/block_handler.go index 8edcec7890b..247a13dbc9f 100644 --- a/common/deliverclient/blocksprovider/fake/block_handler.go +++ b/common/deliverclient/blocksprovider/fake/block_handler.go @@ -4,7 +4,7 @@ package fake import ( "sync" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/common/deliverclient/blocksprovider" ) diff --git a/common/deliverclient/blocksprovider/fake/deliver_client_requester.go b/common/deliverclient/blocksprovider/fake/deliver_client_requester.go index 06166a93338..e88ff765cda 100644 --- a/common/deliverclient/blocksprovider/fake/deliver_client_requester.go +++ b/common/deliverclient/blocksprovider/fake/deliver_client_requester.go @@ -4,10 +4,10 @@ package fake import ( "sync" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/orderer" - "github.com/hyperledger/fabric/common/deliverclient/orderers" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer" "github.com/hyperledger/fabric/common/deliverclient/blocksprovider" + "github.com/hyperledger/fabric/common/deliverclient/orderers" ) type DeliverClientRequester struct { diff --git a/common/deliverclient/blocksprovider/fake/deliver_streamer.go b/common/deliverclient/blocksprovider/fake/deliver_streamer.go index e87a9d9578b..d07effd73d1 100644 --- a/common/deliverclient/blocksprovider/fake/deliver_streamer.go +++ b/common/deliverclient/blocksprovider/fake/deliver_streamer.go @@ -5,7 +5,7 @@ import ( "context" "sync" - "github.com/hyperledger/fabric-protos-go/orderer" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer" "github.com/hyperledger/fabric/common/deliverclient/blocksprovider" "google.golang.org/grpc" ) diff --git a/common/deliverclient/blocksprovider/fake/gossip_service_adapter.go b/common/deliverclient/blocksprovider/fake/gossip_service_adapter.go index e022d340d31..60f3440b924 100644 --- a/common/deliverclient/blocksprovider/fake/gossip_service_adapter.go +++ b/common/deliverclient/blocksprovider/fake/gossip_service_adapter.go @@ -4,7 +4,7 @@ package fake import ( "sync" - "github.com/hyperledger/fabric-protos-go/gossip" + "github.com/hyperledger/fabric-protos-go-apiv2/gossip" "github.com/hyperledger/fabric/common/deliverclient/blocksprovider" ) diff --git a/common/deliverclient/blocksprovider/fake/updatable_block_verifier.go b/common/deliverclient/blocksprovider/fake/updatable_block_verifier.go index ab2cf754804..87af9ed2b01 100644 --- a/common/deliverclient/blocksprovider/fake/updatable_block_verifier.go +++ b/common/deliverclient/blocksprovider/fake/updatable_block_verifier.go @@ -4,7 +4,7 @@ package fake import ( "sync" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/common/deliverclient" "github.com/hyperledger/fabric/common/deliverclient/blocksprovider" ) diff --git a/common/deliverclient/blocksprovider/util.go b/common/deliverclient/blocksprovider/util.go index 237aa3ab771..3f6e5debc04 100644 --- a/common/deliverclient/blocksprovider/util.go +++ b/common/deliverclient/blocksprovider/util.go @@ -11,7 +11,7 @@ import ( "time" "github.com/hyperledger/fabric-lib-go/bccsp" - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/common/channelconfig" "github.com/hyperledger/fabric/common/deliverclient/orderers" ) diff --git a/common/deliverclient/util.go b/common/deliverclient/util.go index b91473b10c2..998895fa4db 100644 --- a/common/deliverclient/util.go +++ b/common/deliverclient/util.go @@ -7,7 +7,7 @@ SPDX-License-Identifier: Apache-2.0 package deliverclient import ( - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/common/configtx" "github.com/hyperledger/fabric/protoutil" "github.com/pkg/errors" diff --git a/common/deliverclient/util_test.go b/common/deliverclient/util_test.go index 99c8d7d72ab..950765805e5 100644 --- a/common/deliverclient/util_test.go +++ b/common/deliverclient/util_test.go @@ -9,7 +9,7 @@ package deliverclient_test import ( "testing" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/common/deliverclient" "github.com/hyperledger/fabric/protoutil" "github.com/stretchr/testify/require" diff --git a/common/deliverclient/verifier_assembler.go b/common/deliverclient/verifier_assembler.go index 258c12c6193..1bbfeaf9c92 100644 --- a/common/deliverclient/verifier_assembler.go +++ b/common/deliverclient/verifier_assembler.go @@ -9,7 +9,7 @@ package deliverclient import ( "github.com/hyperledger/fabric-lib-go/bccsp" "github.com/hyperledger/fabric-lib-go/common/flogging" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/common/channelconfig" "github.com/hyperledger/fabric/common/policies" "github.com/hyperledger/fabric/protoutil" diff --git a/common/deliverclient/verifier_assembler_test.go b/common/deliverclient/verifier_assembler_test.go index 66f4b7eace5..a1c827e387a 100644 --- a/common/deliverclient/verifier_assembler_test.go +++ b/common/deliverclient/verifier_assembler_test.go @@ -13,7 +13,7 @@ import ( "testing" "github.com/hyperledger/fabric-lib-go/bccsp/sw" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/common/crypto/tlsgen" "github.com/hyperledger/fabric/common/deliverclient" "github.com/hyperledger/fabric/core/config/configtest" diff --git a/common/genesis/genesis.go b/common/genesis/genesis.go index 8d8af402a36..ebbf2b26e36 100644 --- a/common/genesis/genesis.go +++ b/common/genesis/genesis.go @@ -7,7 +7,7 @@ SPDX-License-Identifier: Apache-2.0 package genesis import ( - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/protoutil" ) diff --git a/common/genesis/genesis_test.go b/common/genesis/genesis_test.go index 179eae57a59..cb9ead9bc3f 100644 --- a/common/genesis/genesis_test.go +++ b/common/genesis/genesis_test.go @@ -9,10 +9,10 @@ package genesis import ( "testing" - "github.com/golang/protobuf/proto" - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/protoutil" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) func TestFactory(t *testing.T) { diff --git a/common/grpclogging/fields.go b/common/grpclogging/fields.go index 72ecb1c0d0f..bbadbfd104b 100644 --- a/common/grpclogging/fields.go +++ b/common/grpclogging/fields.go @@ -7,27 +7,26 @@ SPDX-License-Identifier: Apache-2.0 package grpclogging import ( - "github.com/golang/protobuf/jsonpb" - "github.com/golang/protobuf/proto" "go.uber.org/zap" "go.uber.org/zap/zapcore" + "google.golang.org/protobuf/encoding/protojson" + "google.golang.org/protobuf/proto" ) type protoMarshaler struct { - jsonpb.Marshaler message proto.Message } func (m *protoMarshaler) MarshalJSON() ([]byte, error) { - out, err := m.Marshaler.MarshalToString(m.message) + out, err := protojson.Marshal(m.message) if err != nil { return nil, err } - return []byte(out), nil + return out, nil } func ProtoMessage(key string, val interface{}) zapcore.Field { - if pm, ok := val.(proto.Message); ok { + if pm, ok := val.(proto.Message); ok && pm.ProtoReflect().IsValid() { return zap.Reflect(key, &protoMarshaler{message: pm}) } return zap.Any(key, val) diff --git a/common/grpclogging/fields_test.go b/common/grpclogging/fields_test.go index 3ac31eeeec5..82a4da7d202 100644 --- a/common/grpclogging/fields_test.go +++ b/common/grpclogging/fields_test.go @@ -9,7 +9,6 @@ package grpclogging_test import ( "encoding/json" - "github.com/golang/protobuf/jsonpb" "github.com/hyperledger/fabric/common/grpclogging" "github.com/hyperledger/fabric/common/grpclogging/testpb" . "github.com/onsi/ginkgo/v2" @@ -17,6 +16,7 @@ import ( "github.com/pkg/errors" "go.uber.org/zap" "go.uber.org/zap/zapcore" + "google.golang.org/protobuf/encoding/protojson" ) var _ = Describe("Fields", func() { @@ -37,15 +37,14 @@ var _ = Describe("Fields", func() { Expect(ok).To(BeTrue()) }) - It("marshals messages compatible with jsonpb", func() { + It("marshals messages compatible with protojson", func() { field := grpclogging.ProtoMessage("field-key", message) marshaler := field.Interface.(json.Marshaler) marshaled, err := marshaler.MarshalJSON() Expect(err).NotTo(HaveOccurred()) - protoMarshaler := &jsonpb.Marshaler{} - protoJson, err := protoMarshaler.MarshalToString(message) + protoJson, err := protojson.Marshal(message) Expect(err).NotTo(HaveOccurred()) Expect(marshaled).To(MatchJSON(protoJson)) @@ -118,6 +117,6 @@ type badProto struct{ err error } func (b badProto) Reset() {} func (b badProto) String() string { return "" } func (b badProto) ProtoMessage() {} -func (b badProto) MarshalJSONPB(*jsonpb.Marshaler) ([]byte, error) { +func (b badProto) MarshalJSON() ([]byte, error) { return nil, b.err } diff --git a/common/grpclogging/testpb/echo.pb.go b/common/grpclogging/testpb/echo.pb.go index 0cc3be97b5c..5ce8a177295 100644 --- a/common/grpclogging/testpb/echo.pb.go +++ b/common/grpclogging/testpb/echo.pb.go @@ -1,245 +1,171 @@ +// +//Copyright IBM Corp. All Rights Reserved. +// +//SPDX-License-Identifier: Apache-2.0 + // Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.34.2 +// protoc v5.27.3 // source: echo.proto package testpb import ( - context "context" - fmt "fmt" - math "math" - - proto "github.com/golang/protobuf/proto" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) + reflect "reflect" + sync "sync" -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" +) -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) type Message struct { - Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` - Sequence int32 `protobuf:"varint,2,opt,name=sequence,proto3" json:"sequence,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Message) Reset() { *m = Message{} } -func (m *Message) String() string { return proto.CompactTextString(m) } -func (*Message) ProtoMessage() {} -func (*Message) Descriptor() ([]byte, []int) { - return fileDescriptor_08134aea513e0001, []int{0} -} - -func (m *Message) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Message.Unmarshal(m, b) -} -func (m *Message) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Message.Marshal(b, m, deterministic) -} -func (m *Message) XXX_Merge(src proto.Message) { - xxx_messageInfo_Message.Merge(m, src) -} -func (m *Message) XXX_Size() int { - return xxx_messageInfo_Message.Size(m) -} -func (m *Message) XXX_DiscardUnknown() { - xxx_messageInfo_Message.DiscardUnknown(m) -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -var xxx_messageInfo_Message proto.InternalMessageInfo - -func (m *Message) GetMessage() string { - if m != nil { - return m.Message - } - return "" + Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` + Sequence int32 `protobuf:"varint,2,opt,name=sequence,proto3" json:"sequence,omitempty"` } -func (m *Message) GetSequence() int32 { - if m != nil { - return m.Sequence +func (x *Message) Reset() { + *x = Message{} + if protoimpl.UnsafeEnabled { + mi := &file_echo_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } - return 0 -} - -func init() { - proto.RegisterType((*Message)(nil), "testpb.Message") -} - -func init() { proto.RegisterFile("echo.proto", fileDescriptor_08134aea513e0001) } - -var fileDescriptor_08134aea513e0001 = []byte{ - // 198 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x8f, 0xb1, 0x4b, 0xc5, 0x30, - 0x10, 0xc6, 0x89, 0xe8, 0x7b, 0x7a, 0x0e, 0x42, 0xa6, 0xd2, 0xa9, 0x38, 0x65, 0x4a, 0xa4, 0x0e, - 0xe2, 0x24, 0x08, 0x8e, 0x2e, 0x75, 0x73, 0x6b, 0xce, 0x33, 0x09, 0x36, 0xbd, 0x98, 0xa4, 0x82, - 0xff, 0xbd, 0xd8, 0xaa, 0x83, 0xcb, 0xdb, 0xee, 0x77, 0xdc, 0xfd, 0x3e, 0x3e, 0x00, 0x42, 0xcf, - 0x3a, 0x65, 0xae, 0x2c, 0x77, 0x95, 0x4a, 0x4d, 0xf6, 0xf2, 0x0e, 0xf6, 0x8f, 0x54, 0xca, 0xe8, - 0x48, 0x36, 0xb0, 0x8f, 0xdb, 0xd8, 0x88, 0x4e, 0xa8, 0xb3, 0xe1, 0x17, 0x65, 0x0b, 0xa7, 0x85, - 0xde, 0x17, 0x9a, 0x91, 0x9a, 0xa3, 0x4e, 0xa8, 0x93, 0xe1, 0x8f, 0xfb, 0x37, 0x38, 0x7f, 0x40, - 0xcf, 0x4f, 0x94, 0x3f, 0x02, 0x92, 0x54, 0x70, 0xfc, 0x8d, 0xf2, 0x42, 0x6f, 0x01, 0xfa, 0xc7, - 0xde, 0xfe, 0x5f, 0xc8, 0x1e, 0x60, 0x7d, 0xac, 0x99, 0xc6, 0x78, 0xf8, 0x5e, 0x89, 0x2b, 0x71, - 0x7f, 0xfb, 0x7c, 0xe3, 0x42, 0xf5, 0x8b, 0xd5, 0xc8, 0xd1, 0xf8, 0xcf, 0x44, 0x79, 0xa2, 0x17, - 0x47, 0xd9, 0xbc, 0x8e, 0x36, 0x07, 0x34, 0xc8, 0x31, 0xf2, 0x6c, 0x5c, 0x4e, 0x38, 0xb1, 0x73, - 0x61, 0x76, 0x66, 0xd3, 0xd8, 0xdd, 0xda, 0xfb, 0xfa, 0x2b, 0x00, 0x00, 0xff, 0xff, 0xd7, 0x33, - 0xa2, 0xe6, 0x05, 0x01, 0x00, 0x00, } -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConnInterface - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion6 - -// EchoServiceClient is the client API for EchoService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type EchoServiceClient interface { - Echo(ctx context.Context, in *Message, opts ...grpc.CallOption) (*Message, error) - EchoStream(ctx context.Context, opts ...grpc.CallOption) (EchoService_EchoStreamClient, error) -} - -type echoServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewEchoServiceClient(cc grpc.ClientConnInterface) EchoServiceClient { - return &echoServiceClient{cc} +func (x *Message) String() string { + return protoimpl.X.MessageStringOf(x) } -func (c *echoServiceClient) Echo(ctx context.Context, in *Message, opts ...grpc.CallOption) (*Message, error) { - out := new(Message) - err := c.cc.Invoke(ctx, "/testpb.EchoService/Echo", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} +func (*Message) ProtoMessage() {} -func (c *echoServiceClient) EchoStream(ctx context.Context, opts ...grpc.CallOption) (EchoService_EchoStreamClient, error) { - stream, err := c.cc.NewStream(ctx, &_EchoService_serviceDesc.Streams[0], "/testpb.EchoService/EchoStream", opts...) - if err != nil { - return nil, err +func (x *Message) ProtoReflect() protoreflect.Message { + mi := &file_echo_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms } - x := &echoServiceEchoStreamClient{stream} - return x, nil -} - -type EchoService_EchoStreamClient interface { - Send(*Message) error - Recv() (*Message, error) - grpc.ClientStream -} - -type echoServiceEchoStreamClient struct { - grpc.ClientStream + return mi.MessageOf(x) } -func (x *echoServiceEchoStreamClient) Send(m *Message) error { - return x.ClientStream.SendMsg(m) +// Deprecated: Use Message.ProtoReflect.Descriptor instead. +func (*Message) Descriptor() ([]byte, []int) { + return file_echo_proto_rawDescGZIP(), []int{0} } -func (x *echoServiceEchoStreamClient) Recv() (*Message, error) { - m := new(Message) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err +func (x *Message) GetMessage() string { + if x != nil { + return x.Message } - return m, nil -} - -// EchoServiceServer is the server API for EchoService service. -type EchoServiceServer interface { - Echo(context.Context, *Message) (*Message, error) - EchoStream(EchoService_EchoStreamServer) error -} - -// UnimplementedEchoServiceServer can be embedded to have forward compatible implementations. -type UnimplementedEchoServiceServer struct { -} - -func (*UnimplementedEchoServiceServer) Echo(ctx context.Context, req *Message) (*Message, error) { - return nil, status.Errorf(codes.Unimplemented, "method Echo not implemented") -} -func (*UnimplementedEchoServiceServer) EchoStream(srv EchoService_EchoStreamServer) error { - return status.Errorf(codes.Unimplemented, "method EchoStream not implemented") -} - -func RegisterEchoServiceServer(s *grpc.Server, srv EchoServiceServer) { - s.RegisterService(&_EchoService_serviceDesc, srv) + return "" } -func _EchoService_Echo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(Message) - if err := dec(in); err != nil { - return nil, err +func (x *Message) GetSequence() int32 { + if x != nil { + return x.Sequence } - if interceptor == nil { - return srv.(EchoServiceServer).Echo(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/testpb.EchoService/Echo", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(EchoServiceServer).Echo(ctx, req.(*Message)) - } - return interceptor(ctx, in, info, handler) -} - -func _EchoService_EchoStream_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(EchoServiceServer).EchoStream(&echoServiceEchoStreamServer{stream}) -} - -type EchoService_EchoStreamServer interface { - Send(*Message) error - Recv() (*Message, error) - grpc.ServerStream -} - -type echoServiceEchoStreamServer struct { - grpc.ServerStream + return 0 } -func (x *echoServiceEchoStreamServer) Send(m *Message) error { - return x.ServerStream.SendMsg(m) -} +var File_echo_proto protoreflect.FileDescriptor + +var file_echo_proto_rawDesc = []byte{ + 0x0a, 0x0a, 0x65, 0x63, 0x68, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x74, 0x65, + 0x73, 0x74, 0x70, 0x62, 0x22, 0x3f, 0x0a, 0x07, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, + 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x71, + 0x75, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x73, 0x65, 0x71, + 0x75, 0x65, 0x6e, 0x63, 0x65, 0x32, 0x6b, 0x0a, 0x0b, 0x45, 0x63, 0x68, 0x6f, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x12, 0x28, 0x0a, 0x04, 0x45, 0x63, 0x68, 0x6f, 0x12, 0x0f, 0x2e, 0x74, + 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x0f, 0x2e, + 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x32, + 0x0a, 0x0a, 0x45, 0x63, 0x68, 0x6f, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x0f, 0x2e, 0x74, + 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x0f, 0x2e, + 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x28, 0x01, + 0x30, 0x01, 0x42, 0x39, 0x5a, 0x37, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2f, 0x66, 0x61, 0x62, + 0x72, 0x69, 0x63, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x6c, + 0x6f, 0x67, 0x67, 0x69, 0x6e, 0x67, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_echo_proto_rawDescOnce sync.Once + file_echo_proto_rawDescData = file_echo_proto_rawDesc +) -func (x *echoServiceEchoStreamServer) Recv() (*Message, error) { - m := new(Message) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err +func file_echo_proto_rawDescGZIP() []byte { + file_echo_proto_rawDescOnce.Do(func() { + file_echo_proto_rawDescData = protoimpl.X.CompressGZIP(file_echo_proto_rawDescData) + }) + return file_echo_proto_rawDescData +} + +var file_echo_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_echo_proto_goTypes = []any{ + (*Message)(nil), // 0: testpb.Message +} +var file_echo_proto_depIdxs = []int32{ + 0, // 0: testpb.EchoService.Echo:input_type -> testpb.Message + 0, // 1: testpb.EchoService.EchoStream:input_type -> testpb.Message + 0, // 2: testpb.EchoService.Echo:output_type -> testpb.Message + 0, // 3: testpb.EchoService.EchoStream:output_type -> testpb.Message + 2, // [2:4] is the sub-list for method output_type + 0, // [0:2] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_echo_proto_init() } +func file_echo_proto_init() { + if File_echo_proto != nil { + return } - return m, nil -} - -var _EchoService_serviceDesc = grpc.ServiceDesc{ - ServiceName: "testpb.EchoService", - HandlerType: (*EchoServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Echo", - Handler: _EchoService_Echo_Handler, - }, - }, - Streams: []grpc.StreamDesc{ - { - StreamName: "EchoStream", - Handler: _EchoService_EchoStream_Handler, - ServerStreams: true, - ClientStreams: true, + if !protoimpl.UnsafeEnabled { + file_echo_proto_msgTypes[0].Exporter = func(v any, i int) any { + switch v := v.(*Message); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_echo_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 1, }, - }, - Metadata: "echo.proto", + GoTypes: file_echo_proto_goTypes, + DependencyIndexes: file_echo_proto_depIdxs, + MessageInfos: file_echo_proto_msgTypes, + }.Build() + File_echo_proto = out.File + file_echo_proto_rawDesc = nil + file_echo_proto_goTypes = nil + file_echo_proto_depIdxs = nil } diff --git a/common/grpclogging/testpb/echo_grpc.pb.go b/common/grpclogging/testpb/echo_grpc.pb.go new file mode 100644 index 00000000000..c6151c3ecad --- /dev/null +++ b/common/grpclogging/testpb/echo_grpc.pb.go @@ -0,0 +1,157 @@ +// +//Copyright IBM Corp. All Rights Reserved. +// +//SPDX-License-Identifier: Apache-2.0 + +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.5.1 +// - protoc v5.27.3 +// source: echo.proto + +package testpb + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 + +const ( + EchoService_Echo_FullMethodName = "/testpb.EchoService/Echo" + EchoService_EchoStream_FullMethodName = "/testpb.EchoService/EchoStream" +) + +// EchoServiceClient is the client API for EchoService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type EchoServiceClient interface { + Echo(ctx context.Context, in *Message, opts ...grpc.CallOption) (*Message, error) + EchoStream(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[Message, Message], error) +} + +type echoServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewEchoServiceClient(cc grpc.ClientConnInterface) EchoServiceClient { + return &echoServiceClient{cc} +} + +func (c *echoServiceClient) Echo(ctx context.Context, in *Message, opts ...grpc.CallOption) (*Message, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Message) + err := c.cc.Invoke(ctx, EchoService_Echo_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *echoServiceClient) EchoStream(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[Message, Message], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &EchoService_ServiceDesc.Streams[0], EchoService_EchoStream_FullMethodName, cOpts...) + if err != nil { + return nil, err + } + x := &grpc.GenericClientStream[Message, Message]{ClientStream: stream} + return x, nil +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type EchoService_EchoStreamClient = grpc.BidiStreamingClient[Message, Message] + +// EchoServiceServer is the server API for EchoService service. +// All implementations should embed UnimplementedEchoServiceServer +// for forward compatibility. +type EchoServiceServer interface { + Echo(context.Context, *Message) (*Message, error) + EchoStream(grpc.BidiStreamingServer[Message, Message]) error +} + +// UnimplementedEchoServiceServer should be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedEchoServiceServer struct{} + +func (UnimplementedEchoServiceServer) Echo(context.Context, *Message) (*Message, error) { + return nil, status.Errorf(codes.Unimplemented, "method Echo not implemented") +} +func (UnimplementedEchoServiceServer) EchoStream(grpc.BidiStreamingServer[Message, Message]) error { + return status.Errorf(codes.Unimplemented, "method EchoStream not implemented") +} +func (UnimplementedEchoServiceServer) testEmbeddedByValue() {} + +// UnsafeEchoServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to EchoServiceServer will +// result in compilation errors. +type UnsafeEchoServiceServer interface { + mustEmbedUnimplementedEchoServiceServer() +} + +func RegisterEchoServiceServer(s grpc.ServiceRegistrar, srv EchoServiceServer) { + // If the following call pancis, it indicates UnimplementedEchoServiceServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } + s.RegisterService(&EchoService_ServiceDesc, srv) +} + +func _EchoService_Echo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Message) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(EchoServiceServer).Echo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: EchoService_Echo_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(EchoServiceServer).Echo(ctx, req.(*Message)) + } + return interceptor(ctx, in, info, handler) +} + +func _EchoService_EchoStream_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(EchoServiceServer).EchoStream(&grpc.GenericServerStream[Message, Message]{ServerStream: stream}) +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type EchoService_EchoStreamServer = grpc.BidiStreamingServer[Message, Message] + +// EchoService_ServiceDesc is the grpc.ServiceDesc for EchoService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var EchoService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "testpb.EchoService", + HandlerType: (*EchoServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Echo", + Handler: _EchoService_Echo_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "EchoStream", + Handler: _EchoService_EchoStream_Handler, + ServerStreams: true, + ClientStreams: true, + }, + }, + Metadata: "echo.proto", +} diff --git a/common/grpcmetrics/testpb/echo.pb.go b/common/grpcmetrics/testpb/echo.pb.go index a72b9e95236..eeb8f2dadda 100644 --- a/common/grpcmetrics/testpb/echo.pb.go +++ b/common/grpcmetrics/testpb/echo.pb.go @@ -1,245 +1,171 @@ +// +//Copyright IBM Corp. All Rights Reserved. +// +//SPDX-License-Identifier: Apache-2.0 + // Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.34.2 +// protoc v5.27.3 // source: echo.proto package testpb import ( - context "context" - fmt "fmt" - math "math" - - proto "github.com/golang/protobuf/proto" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) + reflect "reflect" + sync "sync" -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" +) -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) type Message struct { - Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` - Sequence int32 `protobuf:"varint,2,opt,name=sequence,proto3" json:"sequence,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Message) Reset() { *m = Message{} } -func (m *Message) String() string { return proto.CompactTextString(m) } -func (*Message) ProtoMessage() {} -func (*Message) Descriptor() ([]byte, []int) { - return fileDescriptor_08134aea513e0001, []int{0} -} - -func (m *Message) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Message.Unmarshal(m, b) -} -func (m *Message) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Message.Marshal(b, m, deterministic) -} -func (m *Message) XXX_Merge(src proto.Message) { - xxx_messageInfo_Message.Merge(m, src) -} -func (m *Message) XXX_Size() int { - return xxx_messageInfo_Message.Size(m) -} -func (m *Message) XXX_DiscardUnknown() { - xxx_messageInfo_Message.DiscardUnknown(m) -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -var xxx_messageInfo_Message proto.InternalMessageInfo - -func (m *Message) GetMessage() string { - if m != nil { - return m.Message - } - return "" + Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` + Sequence int32 `protobuf:"varint,2,opt,name=sequence,proto3" json:"sequence,omitempty"` } -func (m *Message) GetSequence() int32 { - if m != nil { - return m.Sequence +func (x *Message) Reset() { + *x = Message{} + if protoimpl.UnsafeEnabled { + mi := &file_echo_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } - return 0 -} - -func init() { - proto.RegisterType((*Message)(nil), "testpb.Message") -} - -func init() { proto.RegisterFile("echo.proto", fileDescriptor_08134aea513e0001) } - -var fileDescriptor_08134aea513e0001 = []byte{ - // 196 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x8f, 0x31, 0x4b, 0xc0, 0x30, - 0x10, 0x85, 0x89, 0x68, 0xab, 0xe7, 0x20, 0x64, 0x2a, 0x9d, 0x8a, 0x53, 0xa6, 0x44, 0xea, 0x20, - 0x4e, 0x82, 0xe0, 0xe8, 0x52, 0x37, 0xb7, 0xe6, 0x3c, 0x93, 0xa0, 0x69, 0xe2, 0x25, 0x15, 0xfc, - 0xf7, 0x62, 0xab, 0x0e, 0x2e, 0x6e, 0xf7, 0x1d, 0x77, 0xdf, 0xe3, 0x01, 0x10, 0xfa, 0xa4, 0x33, - 0xa7, 0x9a, 0x64, 0x53, 0xa9, 0xd4, 0x6c, 0xcf, 0x6f, 0xa0, 0xbd, 0xa7, 0x52, 0x66, 0x47, 0xb2, - 0x83, 0x36, 0xee, 0x63, 0x27, 0x06, 0xa1, 0x4e, 0xa6, 0x1f, 0x94, 0x3d, 0x1c, 0x17, 0x7a, 0x5b, - 0x69, 0x41, 0xea, 0x0e, 0x06, 0xa1, 0x8e, 0xa6, 0x5f, 0x1e, 0x5f, 0xe0, 0xf4, 0x0e, 0x7d, 0x7a, - 0x20, 0x7e, 0x0f, 0x48, 0x52, 0xc1, 0xe1, 0x17, 0xca, 0x33, 0xbd, 0x07, 0xe8, 0x6f, 0x7b, 0xff, - 0x77, 0x21, 0x47, 0x80, 0xed, 0xb1, 0x32, 0xcd, 0xf1, 0xff, 0x7b, 0x25, 0x2e, 0xc4, 0xed, 0xf5, - 0xe3, 0x95, 0x0b, 0xd5, 0xaf, 0x56, 0x63, 0x8a, 0xc6, 0x7f, 0x64, 0xe2, 0x57, 0x7a, 0x72, 0xc4, - 0xe6, 0x79, 0xb6, 0x1c, 0xd0, 0x60, 0x8a, 0x31, 0x2d, 0xc6, 0x71, 0xc6, 0x48, 0x95, 0x03, 0x16, - 0xb3, 0x6b, 0x6c, 0xb3, 0xf5, 0xbe, 0xfc, 0x0c, 0x00, 0x00, 0xff, 0xff, 0x48, 0xde, 0xb3, 0x72, - 0x05, 0x01, 0x00, 0x00, } -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConnInterface - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion6 - -// EchoServiceClient is the client API for EchoService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type EchoServiceClient interface { - Echo(ctx context.Context, in *Message, opts ...grpc.CallOption) (*Message, error) - EchoStream(ctx context.Context, opts ...grpc.CallOption) (EchoService_EchoStreamClient, error) -} - -type echoServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewEchoServiceClient(cc grpc.ClientConnInterface) EchoServiceClient { - return &echoServiceClient{cc} +func (x *Message) String() string { + return protoimpl.X.MessageStringOf(x) } -func (c *echoServiceClient) Echo(ctx context.Context, in *Message, opts ...grpc.CallOption) (*Message, error) { - out := new(Message) - err := c.cc.Invoke(ctx, "/testpb.EchoService/Echo", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} +func (*Message) ProtoMessage() {} -func (c *echoServiceClient) EchoStream(ctx context.Context, opts ...grpc.CallOption) (EchoService_EchoStreamClient, error) { - stream, err := c.cc.NewStream(ctx, &_EchoService_serviceDesc.Streams[0], "/testpb.EchoService/EchoStream", opts...) - if err != nil { - return nil, err +func (x *Message) ProtoReflect() protoreflect.Message { + mi := &file_echo_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms } - x := &echoServiceEchoStreamClient{stream} - return x, nil -} - -type EchoService_EchoStreamClient interface { - Send(*Message) error - Recv() (*Message, error) - grpc.ClientStream -} - -type echoServiceEchoStreamClient struct { - grpc.ClientStream + return mi.MessageOf(x) } -func (x *echoServiceEchoStreamClient) Send(m *Message) error { - return x.ClientStream.SendMsg(m) +// Deprecated: Use Message.ProtoReflect.Descriptor instead. +func (*Message) Descriptor() ([]byte, []int) { + return file_echo_proto_rawDescGZIP(), []int{0} } -func (x *echoServiceEchoStreamClient) Recv() (*Message, error) { - m := new(Message) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err +func (x *Message) GetMessage() string { + if x != nil { + return x.Message } - return m, nil -} - -// EchoServiceServer is the server API for EchoService service. -type EchoServiceServer interface { - Echo(context.Context, *Message) (*Message, error) - EchoStream(EchoService_EchoStreamServer) error -} - -// UnimplementedEchoServiceServer can be embedded to have forward compatible implementations. -type UnimplementedEchoServiceServer struct { -} - -func (*UnimplementedEchoServiceServer) Echo(ctx context.Context, req *Message) (*Message, error) { - return nil, status.Errorf(codes.Unimplemented, "method Echo not implemented") -} -func (*UnimplementedEchoServiceServer) EchoStream(srv EchoService_EchoStreamServer) error { - return status.Errorf(codes.Unimplemented, "method EchoStream not implemented") -} - -func RegisterEchoServiceServer(s *grpc.Server, srv EchoServiceServer) { - s.RegisterService(&_EchoService_serviceDesc, srv) + return "" } -func _EchoService_Echo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(Message) - if err := dec(in); err != nil { - return nil, err +func (x *Message) GetSequence() int32 { + if x != nil { + return x.Sequence } - if interceptor == nil { - return srv.(EchoServiceServer).Echo(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/testpb.EchoService/Echo", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(EchoServiceServer).Echo(ctx, req.(*Message)) - } - return interceptor(ctx, in, info, handler) -} - -func _EchoService_EchoStream_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(EchoServiceServer).EchoStream(&echoServiceEchoStreamServer{stream}) -} - -type EchoService_EchoStreamServer interface { - Send(*Message) error - Recv() (*Message, error) - grpc.ServerStream -} - -type echoServiceEchoStreamServer struct { - grpc.ServerStream + return 0 } -func (x *echoServiceEchoStreamServer) Send(m *Message) error { - return x.ServerStream.SendMsg(m) -} +var File_echo_proto protoreflect.FileDescriptor + +var file_echo_proto_rawDesc = []byte{ + 0x0a, 0x0a, 0x65, 0x63, 0x68, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x74, 0x65, + 0x73, 0x74, 0x70, 0x62, 0x22, 0x3f, 0x0a, 0x07, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, + 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x71, + 0x75, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x73, 0x65, 0x71, + 0x75, 0x65, 0x6e, 0x63, 0x65, 0x32, 0x6b, 0x0a, 0x0b, 0x45, 0x63, 0x68, 0x6f, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x12, 0x28, 0x0a, 0x04, 0x45, 0x63, 0x68, 0x6f, 0x12, 0x0f, 0x2e, 0x74, + 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x0f, 0x2e, + 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x32, + 0x0a, 0x0a, 0x45, 0x63, 0x68, 0x6f, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x0f, 0x2e, 0x74, + 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x0f, 0x2e, + 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x28, 0x01, + 0x30, 0x01, 0x42, 0x39, 0x5a, 0x37, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2f, 0x66, 0x61, 0x62, + 0x72, 0x69, 0x63, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x6d, + 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_echo_proto_rawDescOnce sync.Once + file_echo_proto_rawDescData = file_echo_proto_rawDesc +) -func (x *echoServiceEchoStreamServer) Recv() (*Message, error) { - m := new(Message) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err +func file_echo_proto_rawDescGZIP() []byte { + file_echo_proto_rawDescOnce.Do(func() { + file_echo_proto_rawDescData = protoimpl.X.CompressGZIP(file_echo_proto_rawDescData) + }) + return file_echo_proto_rawDescData +} + +var file_echo_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_echo_proto_goTypes = []any{ + (*Message)(nil), // 0: testpb.Message +} +var file_echo_proto_depIdxs = []int32{ + 0, // 0: testpb.EchoService.Echo:input_type -> testpb.Message + 0, // 1: testpb.EchoService.EchoStream:input_type -> testpb.Message + 0, // 2: testpb.EchoService.Echo:output_type -> testpb.Message + 0, // 3: testpb.EchoService.EchoStream:output_type -> testpb.Message + 2, // [2:4] is the sub-list for method output_type + 0, // [0:2] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_echo_proto_init() } +func file_echo_proto_init() { + if File_echo_proto != nil { + return } - return m, nil -} - -var _EchoService_serviceDesc = grpc.ServiceDesc{ - ServiceName: "testpb.EchoService", - HandlerType: (*EchoServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Echo", - Handler: _EchoService_Echo_Handler, - }, - }, - Streams: []grpc.StreamDesc{ - { - StreamName: "EchoStream", - Handler: _EchoService_EchoStream_Handler, - ServerStreams: true, - ClientStreams: true, + if !protoimpl.UnsafeEnabled { + file_echo_proto_msgTypes[0].Exporter = func(v any, i int) any { + switch v := v.(*Message); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_echo_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 1, }, - }, - Metadata: "echo.proto", + GoTypes: file_echo_proto_goTypes, + DependencyIndexes: file_echo_proto_depIdxs, + MessageInfos: file_echo_proto_msgTypes, + }.Build() + File_echo_proto = out.File + file_echo_proto_rawDesc = nil + file_echo_proto_goTypes = nil + file_echo_proto_depIdxs = nil } diff --git a/common/grpcmetrics/testpb/echo_grpc.pb.go b/common/grpcmetrics/testpb/echo_grpc.pb.go new file mode 100644 index 00000000000..c6151c3ecad --- /dev/null +++ b/common/grpcmetrics/testpb/echo_grpc.pb.go @@ -0,0 +1,157 @@ +// +//Copyright IBM Corp. All Rights Reserved. +// +//SPDX-License-Identifier: Apache-2.0 + +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.5.1 +// - protoc v5.27.3 +// source: echo.proto + +package testpb + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 + +const ( + EchoService_Echo_FullMethodName = "/testpb.EchoService/Echo" + EchoService_EchoStream_FullMethodName = "/testpb.EchoService/EchoStream" +) + +// EchoServiceClient is the client API for EchoService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type EchoServiceClient interface { + Echo(ctx context.Context, in *Message, opts ...grpc.CallOption) (*Message, error) + EchoStream(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[Message, Message], error) +} + +type echoServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewEchoServiceClient(cc grpc.ClientConnInterface) EchoServiceClient { + return &echoServiceClient{cc} +} + +func (c *echoServiceClient) Echo(ctx context.Context, in *Message, opts ...grpc.CallOption) (*Message, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Message) + err := c.cc.Invoke(ctx, EchoService_Echo_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *echoServiceClient) EchoStream(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[Message, Message], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &EchoService_ServiceDesc.Streams[0], EchoService_EchoStream_FullMethodName, cOpts...) + if err != nil { + return nil, err + } + x := &grpc.GenericClientStream[Message, Message]{ClientStream: stream} + return x, nil +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type EchoService_EchoStreamClient = grpc.BidiStreamingClient[Message, Message] + +// EchoServiceServer is the server API for EchoService service. +// All implementations should embed UnimplementedEchoServiceServer +// for forward compatibility. +type EchoServiceServer interface { + Echo(context.Context, *Message) (*Message, error) + EchoStream(grpc.BidiStreamingServer[Message, Message]) error +} + +// UnimplementedEchoServiceServer should be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedEchoServiceServer struct{} + +func (UnimplementedEchoServiceServer) Echo(context.Context, *Message) (*Message, error) { + return nil, status.Errorf(codes.Unimplemented, "method Echo not implemented") +} +func (UnimplementedEchoServiceServer) EchoStream(grpc.BidiStreamingServer[Message, Message]) error { + return status.Errorf(codes.Unimplemented, "method EchoStream not implemented") +} +func (UnimplementedEchoServiceServer) testEmbeddedByValue() {} + +// UnsafeEchoServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to EchoServiceServer will +// result in compilation errors. +type UnsafeEchoServiceServer interface { + mustEmbedUnimplementedEchoServiceServer() +} + +func RegisterEchoServiceServer(s grpc.ServiceRegistrar, srv EchoServiceServer) { + // If the following call pancis, it indicates UnimplementedEchoServiceServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } + s.RegisterService(&EchoService_ServiceDesc, srv) +} + +func _EchoService_Echo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Message) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(EchoServiceServer).Echo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: EchoService_Echo_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(EchoServiceServer).Echo(ctx, req.(*Message)) + } + return interceptor(ctx, in, info, handler) +} + +func _EchoService_EchoStream_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(EchoServiceServer).EchoStream(&grpc.GenericServerStream[Message, Message]{ServerStream: stream}) +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type EchoService_EchoStreamServer = grpc.BidiStreamingServer[Message, Message] + +// EchoService_ServiceDesc is the grpc.ServiceDesc for EchoService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var EchoService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "testpb.EchoService", + HandlerType: (*EchoServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Echo", + Handler: _EchoService_Echo_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "EchoStream", + Handler: _EchoService_EchoStream_Handler, + ServerStreams: true, + ClientStreams: true, + }, + }, + Metadata: "echo.proto", +} diff --git a/common/ledger/blkstorage/blkstoragetest/blkstoragetest.go b/common/ledger/blkstorage/blkstoragetest/blkstoragetest.go index 8896cb3a0db..08d8a1677d6 100644 --- a/common/ledger/blkstorage/blkstoragetest/blkstoragetest.go +++ b/common/ledger/blkstorage/blkstoragetest/blkstoragetest.go @@ -14,7 +14,7 @@ import ( "testing" "github.com/hyperledger/fabric-lib-go/common/metrics/disabled" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/common/ledger/blkstorage" "github.com/hyperledger/fabric/protoutil" "github.com/stretchr/testify/require" diff --git a/common/ledger/blkstorage/block_serialization.go b/common/ledger/blkstorage/block_serialization.go index 15b9ffe7087..0fd6678d99e 100644 --- a/common/ledger/blkstorage/block_serialization.go +++ b/common/ledger/blkstorage/block_serialization.go @@ -7,7 +7,7 @@ SPDX-License-Identifier: Apache-2.0 package blkstorage import ( - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/protoutil" "github.com/pkg/errors" "google.golang.org/protobuf/encoding/protowire" @@ -25,7 +25,7 @@ type txindexInfo struct { loc *locPointer } -func serializeBlock(block *common.Block) ([]byte, *serializedBlockInfo, error) { +func serializeBlock(block *common.Block) ([]byte, *serializedBlockInfo) { var buf []byte info := &serializedBlockInfo{} info.blockHeader = block.Header @@ -33,7 +33,7 @@ func serializeBlock(block *common.Block) ([]byte, *serializedBlockInfo, error) { buf = addHeaderBytes(block.Header, buf) info.txOffsets, buf = addDataBytesAndConstructTxIndexInfo(block.Data, buf) buf = addMetadataBytes(block.Metadata, buf) - return buf, info, nil + return buf, info } func deserializeBlock(serializedBlockBytes []byte) (*common.Block, error) { diff --git a/common/ledger/blkstorage/block_serialization_test.go b/common/ledger/blkstorage/block_serialization_test.go index a861133e7f4..c09aed125db 100644 --- a/common/ledger/blkstorage/block_serialization_test.go +++ b/common/ledger/blkstorage/block_serialization_test.go @@ -9,7 +9,7 @@ package blkstorage import ( "testing" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/common/ledger/testutil" "github.com/hyperledger/fabric/protoutil" "github.com/stretchr/testify/require" @@ -37,8 +37,7 @@ func TestBlockSerialization(t *testing.T) { }), }) - bb, _, err := serializeBlock(block) - require.NoError(t, err) + bb, _ := serializeBlock(block) deserializedBlock, err := deserializeBlock(bb) require.NoError(t, err) require.Equal(t, block, deserializedBlock) @@ -87,8 +86,7 @@ func TestSerializedBlockInfo(t *testing.T) { } func testSerializedBlockInfo(t *testing.T, block *common.Block, c *testutilTxIDComputator) { - bb, info, err := serializeBlock(block) - require.NoError(t, err) + bb, info := serializeBlock(block) infoFromBB, err := extractSerializedBlockInfo(bb) require.NoError(t, err) require.Equal(t, info, infoFromBB) diff --git a/common/ledger/blkstorage/block_stream_test.go b/common/ledger/blkstorage/block_stream_test.go index cb83826b600..575f8f25ac5 100644 --- a/common/ledger/blkstorage/block_stream_test.go +++ b/common/ledger/blkstorage/block_stream_test.go @@ -9,7 +9,7 @@ package blkstorage import ( "testing" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/common/ledger/testutil" "github.com/stretchr/testify/require" "google.golang.org/protobuf/encoding/protowire" diff --git a/common/ledger/blkstorage/blockfile_helper.go b/common/ledger/blkstorage/blockfile_helper.go index c27cbaf7753..e0e088c87d6 100644 --- a/common/ledger/blkstorage/blockfile_helper.go +++ b/common/ledger/blkstorage/blockfile_helper.go @@ -13,10 +13,10 @@ import ( "strings" "github.com/davecgh/go-spew/spew" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/internal/fileutil" "github.com/pkg/errors" + "google.golang.org/protobuf/proto" ) // constructBlockfilesInfo scans the last blockfile (if any) and construct the blockfilesInfo diff --git a/common/ledger/blkstorage/blockfile_helper_test.go b/common/ledger/blkstorage/blockfile_helper_test.go index 7d8860b8c7d..473df64deaf 100644 --- a/common/ledger/blkstorage/blockfile_helper_test.go +++ b/common/ledger/blkstorage/blockfile_helper_test.go @@ -62,8 +62,7 @@ func TestConstructBlockfilesInfo(t *testing.T) { // Write a partial block (to simulate a crash) and verify that blockfilesInfo derived from filesystem should be same as from the blockfile manager lastTestBlk := bg.NextTestBlocks(1)[0] - blockBytes, _, err := serializeBlock(lastTestBlk) - require.NoError(t, err) + blockBytes, _ := serializeBlock(lastTestBlk) partialByte := append(protowire.AppendVarint(nil, uint64(len(blockBytes))), blockBytes[len(blockBytes)/2:]...) blockfileMgr.currentFileWriter.append(partialByte, true) checkBlockfilesInfoFromFS(t, blkStoreDir, blockfileMgr.blockfilesInfo) diff --git a/common/ledger/blkstorage/blockfile_mgr.go b/common/ledger/blkstorage/blockfile_mgr.go index 257146be117..bb14d3f7d40 100644 --- a/common/ledger/blkstorage/blockfile_mgr.go +++ b/common/ledger/blkstorage/blockfile_mgr.go @@ -14,14 +14,14 @@ import ( "sync/atomic" "github.com/davecgh/go-spew/spew" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/ledger/util/leveldbhelper" "github.com/hyperledger/fabric/internal/fileutil" "github.com/hyperledger/fabric/protoutil" "github.com/pkg/errors" "google.golang.org/protobuf/encoding/protowire" + "google.golang.org/protobuf/proto" ) const ( @@ -298,10 +298,7 @@ func (mgr *blockfileMgr) addBlock(block *common.Block) error { bcInfo.CurrentBlockHash, block.Header.PreviousHash, ) } - blockBytes, info, err := serializeBlock(block) - if err != nil { - return errors.WithMessage(err, "error serializing block") - } + blockBytes, info := serializeBlock(block) blockHash := protoutil.BlockHeaderHash(block.Header) // Get the location / offset where each transaction starts in the block and where the block ends txOffsets := info.txOffsets @@ -318,7 +315,7 @@ func (mgr *blockfileMgr) addBlock(block *common.Block) error { currentOffset = 0 } // append blockBytesEncodedLen to the file - err = mgr.currentFileWriter.append(blockBytesEncodedLen, false) + err := mgr.currentFileWriter.append(blockBytesEncodedLen, false) if err == nil { // append the actual block bytes to the file err = mgr.currentFileWriter.append(blockBytes, true) @@ -700,11 +697,8 @@ func (mgr *blockfileMgr) loadBlkfilesInfo() (*blockfilesInfo, error) { } func (mgr *blockfileMgr) saveBlkfilesInfo(i *blockfilesInfo, sync bool) error { - b, err := i.marshal() - if err != nil { - return err - } - if err = mgr.db.Put(blkMgrInfoKey, b, sync); err != nil { + b := i.marshal() + if err := mgr.db.Put(blkMgrInfoKey, b, sync); err != nil { return err } return nil @@ -760,7 +754,7 @@ type blockfilesInfo struct { lastPersistedBlock uint64 } -func (i *blockfilesInfo) marshal() ([]byte, error) { +func (i *blockfilesInfo) marshal() []byte { var buf []byte buf = protowire.AppendVarint(buf, uint64(i.latestFileNumber)) buf = protowire.AppendVarint(buf, uint64(i.latestFileSize)) @@ -771,7 +765,7 @@ func (i *blockfilesInfo) marshal() ([]byte, error) { } buf = protowire.AppendVarint(buf, noBlockFilesMarker) - return buf, nil + return buf } func (i *blockfilesInfo) unmarshal(b []byte) error { diff --git a/common/ledger/blkstorage/blockfile_mgr_test.go b/common/ledger/blkstorage/blockfile_mgr_test.go index cf092dedaa9..95fbb313874 100644 --- a/common/ledger/blkstorage/blockfile_mgr_test.go +++ b/common/ledger/blkstorage/blockfile_mgr_test.go @@ -11,8 +11,8 @@ import ( "os" "testing" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/ledger/testutil" "github.com/hyperledger/fabric/internal/pkg/txflags" "github.com/hyperledger/fabric/protoutil" @@ -394,8 +394,7 @@ func TestBlockfileMgrFileRolling(t *testing.T) { blocks := testutil.ConstructTestBlocks(t, 200) size := 0 for _, block := range blocks[:100] { - by, _, err := serializeBlock(block) - require.NoError(t, err, "Error while serializing block") + by, _ := serializeBlock(block) blockBytesSize := len(by) encodedLen := protowire.AppendVarint(nil, uint64(blockBytesSize)) size += blockBytesSize + len(encodedLen) diff --git a/common/ledger/blkstorage/blockfile_scan_test.go b/common/ledger/blkstorage/blockfile_scan_test.go index 3b5456df781..e5f237d27ad 100644 --- a/common/ledger/blkstorage/blockfile_scan_test.go +++ b/common/ledger/blkstorage/blockfile_scan_test.go @@ -10,7 +10,7 @@ import ( "os" "testing" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/common/ledger/testutil" "github.com/hyperledger/fabric/internal/fileutil" "github.com/stretchr/testify/require" @@ -38,8 +38,7 @@ func TestBlockFileScanSmallTxOnly(t *testing.T) { require.Equal(t, len(blocks), numBlocks) require.Equal(t, fileSize, endOffsetLastBlock) - expectedLastBlockBytes, _, err := serializeBlock(blocks[len(blocks)-1]) - require.NoError(t, err) + expectedLastBlockBytes, _ := serializeBlock(blocks[len(blocks)-1]) require.Equal(t, expectedLastBlockBytes, lastBlockBytes) } @@ -70,7 +69,6 @@ func TestBlockFileScanSmallTxLastTxIncomplete(t *testing.T) { require.NoError(t, err) require.Equal(t, len(blocks)-1, numBlocks) - expectedLastBlockBytes, _, err := serializeBlock(blocks[len(blocks)-2]) - require.NoError(t, err) + expectedLastBlockBytes, _ := serializeBlock(blocks[len(blocks)-2]) require.Equal(t, expectedLastBlockBytes, lastBlockBytes) } diff --git a/common/ledger/blkstorage/blockindex.go b/common/ledger/blkstorage/blockindex.go index be392b130ab..771be04d178 100644 --- a/common/ledger/blkstorage/blockindex.go +++ b/common/ledger/blkstorage/blockindex.go @@ -12,15 +12,15 @@ import ( "path/filepath" "unicode/utf8" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/ledger/snapshot" "github.com/hyperledger/fabric/common/ledger/util" "github.com/hyperledger/fabric/common/ledger/util/leveldbhelper" "github.com/hyperledger/fabric/internal/pkg/txflags" "github.com/pkg/errors" "google.golang.org/protobuf/encoding/protowire" + "google.golang.org/protobuf/proto" ) const ( @@ -93,10 +93,7 @@ func (index *blockIndex) indexBlock(blockIdxInfo *blockIdxInfo) error { blkHash := blockIdxInfo.blockHash txsfltr := txflags.ValidationFlags(blockIdxInfo.metadata.Metadata[common.BlockMetadataIndex_TRANSACTIONS_FILTER]) batch := index.db.NewUpdateBatch() - flpBytes, err := flp.marshal() - if err != nil { - return err - } + flpBytes := flp.marshal() // Index1 if index.isAttributeIndexed(IndexableAttrBlockHash) { @@ -113,10 +110,7 @@ func (index *blockIndex) indexBlock(blockIdxInfo *blockIdxInfo) error { for i, txoffset := range txOffsets { txFlp := newFileLocationPointer(flp.fileSuffixNum, flp.offset, txoffset.loc) logger.Debugf("Adding txLoc [%s] for tx ID: [%s] to txid-index", txFlp, txoffset.txID) - txFlpBytes, marshalErr := txFlp.marshal() - if marshalErr != nil { - return marshalErr - } + txFlpBytes := txFlp.marshal() indexVal := &TxIDIndexValue{ BlkLocation: flpBytes, @@ -139,10 +133,7 @@ func (index *blockIndex) indexBlock(blockIdxInfo *blockIdxInfo) error { for i, txoffset := range txOffsets { txFlp := newFileLocationPointer(flp.fileSuffixNum, flp.offset, txoffset.loc) logger.Debugf("Adding txLoc [%s] for tx number:[%d] ID: [%s] to blockNumTranNum index", txFlp, i, txoffset.txID) - txFlpBytes, marshalErr := txFlp.marshal() - if marshalErr != nil { - return marshalErr - } + txFlpBytes := txFlp.marshal() batch.Put(constructBlockNumTranNumKey(blkNum, uint64(i)), txFlpBytes) } } @@ -513,13 +504,13 @@ func newFileLocationPointer(fileSuffixNum int, beginningOffset int, relativeLP * return flp } -func (flp *fileLocPointer) marshal() ([]byte, error) { +func (flp *fileLocPointer) marshal() []byte { var buf []byte buf = protowire.AppendVarint(buf, uint64(flp.fileSuffixNum)) buf = protowire.AppendVarint(buf, uint64(flp.offset)) buf = protowire.AppendVarint(buf, uint64(flp.bytesLength)) - return buf, nil + return buf } func (flp *fileLocPointer) unmarshal(b []byte) error { diff --git a/common/ledger/blkstorage/blockindex_test.go b/common/ledger/blkstorage/blockindex_test.go index 74008350b54..fc420b45c0b 100644 --- a/common/ledger/blkstorage/blockindex_test.go +++ b/common/ledger/blkstorage/blockindex_test.go @@ -15,7 +15,7 @@ import ( "testing" "github.com/hyperledger/fabric-lib-go/common/metrics/disabled" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/common/ledger/snapshot" "github.com/hyperledger/fabric/common/ledger/testutil" commonledgerutil "github.com/hyperledger/fabric/common/ledger/util" diff --git a/common/ledger/blkstorage/blocks_itr_test.go b/common/ledger/blkstorage/blocks_itr_test.go index 58197a082db..a9428562fb7 100644 --- a/common/ledger/blkstorage/blocks_itr_test.go +++ b/common/ledger/blkstorage/blocks_itr_test.go @@ -11,7 +11,7 @@ import ( "testing" "time" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/common/ledger/testutil" "github.com/stretchr/testify/require" ) diff --git a/common/ledger/blkstorage/blockstore.go b/common/ledger/blkstorage/blockstore.go index 0ba03d0b821..175d869cfbe 100644 --- a/common/ledger/blkstorage/blockstore.go +++ b/common/ledger/blkstorage/blockstore.go @@ -9,8 +9,8 @@ package blkstorage import ( "time" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/ledger" "github.com/hyperledger/fabric/common/ledger/snapshot" "github.com/hyperledger/fabric/common/ledger/util/leveldbhelper" diff --git a/common/ledger/blkstorage/blockstore_provider_test.go b/common/ledger/blkstorage/blockstore_provider_test.go index d1317631648..7f966142e99 100644 --- a/common/ledger/blkstorage/blockstore_provider_test.go +++ b/common/ledger/blkstorage/blockstore_provider_test.go @@ -10,8 +10,8 @@ import ( "fmt" "testing" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/ledger/testutil" "github.com/hyperledger/fabric/internal/pkg/txflags" "github.com/hyperledger/fabric/protoutil" diff --git a/common/ledger/blkstorage/cache.go b/common/ledger/blkstorage/cache.go index 35c40c549bb..94f34475145 100644 --- a/common/ledger/blkstorage/cache.go +++ b/common/ledger/blkstorage/cache.go @@ -10,7 +10,7 @@ import ( "fmt" "sync" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" ) const ( diff --git a/common/ledger/blkstorage/cache_test.go b/common/ledger/blkstorage/cache_test.go index 78e8a7f12be..939f983138d 100644 --- a/common/ledger/blkstorage/cache_test.go +++ b/common/ledger/blkstorage/cache_test.go @@ -11,7 +11,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/stretchr/testify/require" ) diff --git a/common/ledger/blkstorage/pkg_test.go b/common/ledger/blkstorage/pkg_test.go index 72a54bc32bc..821d63340d0 100644 --- a/common/ledger/blkstorage/pkg_test.go +++ b/common/ledger/blkstorage/pkg_test.go @@ -12,14 +12,14 @@ import ( "os" "testing" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/common/flogging" "github.com/hyperledger/fabric-lib-go/common/metrics" "github.com/hyperledger/fabric-lib-go/common/metrics/disabled" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/protoutil" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) func TestMain(m *testing.M) { diff --git a/common/ledger/blkstorage/reset_test.go b/common/ledger/blkstorage/reset_test.go index 35b03ca546b..1d12eddec94 100644 --- a/common/ledger/blkstorage/reset_test.go +++ b/common/ledger/blkstorage/reset_test.go @@ -12,11 +12,12 @@ import ( "testing" "github.com/davecgh/go-spew/spew" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/common/ledger/testutil" "github.com/hyperledger/fabric/protoutil" "github.com/stretchr/testify/require" "google.golang.org/protobuf/encoding/protowire" + "google.golang.org/protobuf/proto" ) func TestResetToGenesisBlkSingleBlkFile(t *testing.T) { @@ -218,13 +219,14 @@ func assertBlocksDirOnlyFileWithGenesisBlock(t *testing.T, ledgerDir string, gen func assertBlockStorePostReset(t *testing.T, store *BlockStore, originallyCommittedBlocks []*common.Block) { bcInfo, _ := store.GetBlockchainInfo() t.Logf("bcInfo = %s", spew.Sdump(bcInfo)) - require.Equal(t, + require.True(t, proto.Equal( &common.BlockchainInfo{ Height: 1, CurrentBlockHash: protoutil.BlockHeaderHash(originallyCommittedBlocks[0].Header), PreviousBlockHash: nil, }, - bcInfo) + bcInfo), + ) blk, err := store.RetrieveBlockByNumber(0) require.NoError(t, err) @@ -256,8 +258,7 @@ func assertRecordedHeight(t *testing.T, ledgerDir, expectedRecordedHt string) { func testutilEstimateTotalSizeOnDisk(t *testing.T, blocks []*common.Block) int { size := 0 for _, block := range blocks { - by, _, err := serializeBlock(block) - require.NoError(t, err) + by, _ := serializeBlock(block) blockBytesSize := len(by) encodedLen := protowire.AppendVarint(nil, uint64(blockBytesSize)) size += blockBytesSize + len(encodedLen) diff --git a/common/ledger/blkstorage/rollback_test.go b/common/ledger/blkstorage/rollback_test.go index 5add97d06a0..485be8289ff 100644 --- a/common/ledger/blkstorage/rollback_test.go +++ b/common/ledger/blkstorage/rollback_test.go @@ -11,8 +11,8 @@ import ( "testing" "github.com/hyperledger/fabric-lib-go/common/metrics/disabled" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/ledger/testutil" "github.com/hyperledger/fabric/protoutil" "github.com/stretchr/testify/require" diff --git a/common/ledger/blkstorage/snapshot_test.go b/common/ledger/blkstorage/snapshot_test.go index e538bc47e94..08145c6a646 100644 --- a/common/ledger/blkstorage/snapshot_test.go +++ b/common/ledger/blkstorage/snapshot_test.go @@ -13,8 +13,8 @@ import ( "sort" "testing" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/ledger/snapshot" "github.com/hyperledger/fabric/common/ledger/testutil" "github.com/hyperledger/fabric/internal/pkg/txflags" diff --git a/common/ledger/blkstorage/storage.pb.go b/common/ledger/blkstorage/storage.pb.go index 2ef12db738f..ffc0a9dd260 100644 --- a/common/ledger/blkstorage/storage.pb.go +++ b/common/ledger/blkstorage/storage.pb.go @@ -1,160 +1,258 @@ +// +//Copyright IBM Corp. All Rights Reserved. +// +//SPDX-License-Identifier: Apache-2.0 + // Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.34.2 +// protoc v5.27.3 // source: storage.proto package blkstorage import ( - fmt "fmt" - math "math" + reflect "reflect" + sync "sync" - proto "github.com/golang/protobuf/proto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) type TxIDIndexValue struct { - BlkLocation []byte `protobuf:"bytes,1,opt,name=blk_location,json=blkLocation,proto3" json:"blk_location,omitempty"` - TxLocation []byte `protobuf:"bytes,2,opt,name=tx_location,json=txLocation,proto3" json:"tx_location,omitempty"` - TxValidationCode int32 `protobuf:"varint,3,opt,name=tx_validation_code,json=txValidationCode,proto3" json:"tx_validation_code,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *TxIDIndexValue) Reset() { *m = TxIDIndexValue{} } -func (m *TxIDIndexValue) String() string { return proto.CompactTextString(m) } -func (*TxIDIndexValue) ProtoMessage() {} -func (*TxIDIndexValue) Descriptor() ([]byte, []int) { - return fileDescriptor_0d2c4ccf1453ffdb, []int{0} + BlkLocation []byte `protobuf:"bytes,1,opt,name=blk_location,json=blkLocation,proto3" json:"blk_location,omitempty"` + TxLocation []byte `protobuf:"bytes,2,opt,name=tx_location,json=txLocation,proto3" json:"tx_location,omitempty"` + TxValidationCode int32 `protobuf:"varint,3,opt,name=tx_validation_code,json=txValidationCode,proto3" json:"tx_validation_code,omitempty"` } -func (m *TxIDIndexValue) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_TxIDIndexValue.Unmarshal(m, b) -} -func (m *TxIDIndexValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_TxIDIndexValue.Marshal(b, m, deterministic) -} -func (m *TxIDIndexValue) XXX_Merge(src proto.Message) { - xxx_messageInfo_TxIDIndexValue.Merge(m, src) +func (x *TxIDIndexValue) Reset() { + *x = TxIDIndexValue{} + if protoimpl.UnsafeEnabled { + mi := &file_storage_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *TxIDIndexValue) XXX_Size() int { - return xxx_messageInfo_TxIDIndexValue.Size(m) + +func (x *TxIDIndexValue) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *TxIDIndexValue) XXX_DiscardUnknown() { - xxx_messageInfo_TxIDIndexValue.DiscardUnknown(m) + +func (*TxIDIndexValue) ProtoMessage() {} + +func (x *TxIDIndexValue) ProtoReflect() protoreflect.Message { + mi := &file_storage_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_TxIDIndexValue proto.InternalMessageInfo +// Deprecated: Use TxIDIndexValue.ProtoReflect.Descriptor instead. +func (*TxIDIndexValue) Descriptor() ([]byte, []int) { + return file_storage_proto_rawDescGZIP(), []int{0} +} -func (m *TxIDIndexValue) GetBlkLocation() []byte { - if m != nil { - return m.BlkLocation +func (x *TxIDIndexValue) GetBlkLocation() []byte { + if x != nil { + return x.BlkLocation } return nil } -func (m *TxIDIndexValue) GetTxLocation() []byte { - if m != nil { - return m.TxLocation +func (x *TxIDIndexValue) GetTxLocation() []byte { + if x != nil { + return x.TxLocation } return nil } -func (m *TxIDIndexValue) GetTxValidationCode() int32 { - if m != nil { - return m.TxValidationCode +func (x *TxIDIndexValue) GetTxValidationCode() int32 { + if x != nil { + return x.TxValidationCode } return 0 } type BootstrappingSnapshotInfo struct { - LastBlockNum uint64 `protobuf:"varint,1,opt,name=lastBlockNum,proto3" json:"lastBlockNum,omitempty"` - LastBlockHash []byte `protobuf:"bytes,2,opt,name=lastBlockHash,proto3" json:"lastBlockHash,omitempty"` - PreviousBlockHash []byte `protobuf:"bytes,3,opt,name=previousBlockHash,proto3" json:"previousBlockHash,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *BootstrappingSnapshotInfo) Reset() { *m = BootstrappingSnapshotInfo{} } -func (m *BootstrappingSnapshotInfo) String() string { return proto.CompactTextString(m) } -func (*BootstrappingSnapshotInfo) ProtoMessage() {} -func (*BootstrappingSnapshotInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_0d2c4ccf1453ffdb, []int{1} + LastBlockNum uint64 `protobuf:"varint,1,opt,name=lastBlockNum,proto3" json:"lastBlockNum,omitempty"` + LastBlockHash []byte `protobuf:"bytes,2,opt,name=lastBlockHash,proto3" json:"lastBlockHash,omitempty"` + PreviousBlockHash []byte `protobuf:"bytes,3,opt,name=previousBlockHash,proto3" json:"previousBlockHash,omitempty"` } -func (m *BootstrappingSnapshotInfo) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_BootstrappingSnapshotInfo.Unmarshal(m, b) -} -func (m *BootstrappingSnapshotInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_BootstrappingSnapshotInfo.Marshal(b, m, deterministic) -} -func (m *BootstrappingSnapshotInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_BootstrappingSnapshotInfo.Merge(m, src) +func (x *BootstrappingSnapshotInfo) Reset() { + *x = BootstrappingSnapshotInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_storage_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *BootstrappingSnapshotInfo) XXX_Size() int { - return xxx_messageInfo_BootstrappingSnapshotInfo.Size(m) + +func (x *BootstrappingSnapshotInfo) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *BootstrappingSnapshotInfo) XXX_DiscardUnknown() { - xxx_messageInfo_BootstrappingSnapshotInfo.DiscardUnknown(m) + +func (*BootstrappingSnapshotInfo) ProtoMessage() {} + +func (x *BootstrappingSnapshotInfo) ProtoReflect() protoreflect.Message { + mi := &file_storage_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_BootstrappingSnapshotInfo proto.InternalMessageInfo +// Deprecated: Use BootstrappingSnapshotInfo.ProtoReflect.Descriptor instead. +func (*BootstrappingSnapshotInfo) Descriptor() ([]byte, []int) { + return file_storage_proto_rawDescGZIP(), []int{1} +} -func (m *BootstrappingSnapshotInfo) GetLastBlockNum() uint64 { - if m != nil { - return m.LastBlockNum +func (x *BootstrappingSnapshotInfo) GetLastBlockNum() uint64 { + if x != nil { + return x.LastBlockNum } return 0 } -func (m *BootstrappingSnapshotInfo) GetLastBlockHash() []byte { - if m != nil { - return m.LastBlockHash +func (x *BootstrappingSnapshotInfo) GetLastBlockHash() []byte { + if x != nil { + return x.LastBlockHash } return nil } -func (m *BootstrappingSnapshotInfo) GetPreviousBlockHash() []byte { - if m != nil { - return m.PreviousBlockHash +func (x *BootstrappingSnapshotInfo) GetPreviousBlockHash() []byte { + if x != nil { + return x.PreviousBlockHash } return nil } -func init() { - proto.RegisterType((*TxIDIndexValue)(nil), "msgs.txIDIndexValue") - proto.RegisterType((*BootstrappingSnapshotInfo)(nil), "msgs.bootstrappingSnapshotInfo") -} - -func init() { proto.RegisterFile("storage.proto", fileDescriptor_0d2c4ccf1453ffdb) } - -var fileDescriptor_0d2c4ccf1453ffdb = []byte{ - // 271 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x90, 0x41, 0x4b, 0xf3, 0x40, - 0x10, 0x86, 0xc9, 0xd7, 0x7e, 0x1e, 0xa6, 0xa9, 0xe8, 0x9e, 0xea, 0xc9, 0x1a, 0x3c, 0xf4, 0x50, - 0x9a, 0x83, 0x20, 0x9e, 0xab, 0x07, 0x03, 0xe2, 0x21, 0x82, 0x07, 0x2f, 0x61, 0x77, 0xb3, 0x4d, - 0x96, 0x6c, 0x76, 0x96, 0xdd, 0x49, 0x89, 0x57, 0xff, 0x82, 0x7f, 0x58, 0x0c, 0xa1, 0xa5, 0x78, - 0x9c, 0xe7, 0x7d, 0x60, 0x5e, 0x5e, 0x98, 0x07, 0x42, 0xcf, 0x2b, 0xb5, 0x71, 0x1e, 0x09, 0xd9, - 0xb4, 0x0d, 0x55, 0x48, 0xbe, 0x22, 0x38, 0xa7, 0x3e, 0x7b, 0xca, 0x6c, 0xa9, 0xfa, 0x77, 0x6e, - 0x3a, 0xc5, 0x6e, 0x20, 0x16, 0xa6, 0x29, 0x0c, 0x4a, 0x4e, 0x1a, 0xed, 0x22, 0x5a, 0x46, 0xab, - 0x38, 0x9f, 0x09, 0xd3, 0xbc, 0x8c, 0x88, 0x5d, 0xc3, 0x8c, 0xfa, 0xa3, 0xf1, 0x6f, 0x30, 0x80, - 0xfa, 0x83, 0xb0, 0x06, 0x46, 0x7d, 0xb1, 0xe7, 0x46, 0x97, 0x03, 0x28, 0x24, 0x96, 0x6a, 0x31, - 0x59, 0x46, 0xab, 0xff, 0xf9, 0x05, 0xfd, 0x3e, 0x1a, 0x83, 0x47, 0x2c, 0x55, 0xf2, 0x1d, 0xc1, - 0x95, 0x40, 0xa4, 0x40, 0x9e, 0x3b, 0xa7, 0x6d, 0xf5, 0x66, 0xb9, 0x0b, 0x35, 0x52, 0x66, 0x77, - 0xc8, 0x12, 0x88, 0x0d, 0x0f, 0xb4, 0x35, 0x28, 0x9b, 0xd7, 0xae, 0x1d, 0xfa, 0x4c, 0xf3, 0x13, - 0xc6, 0x6e, 0x61, 0x7e, 0xb8, 0x9f, 0x79, 0xa8, 0xc7, 0x4a, 0xa7, 0x90, 0xad, 0xe1, 0xd2, 0x79, - 0xb5, 0xd7, 0xd8, 0x85, 0xa3, 0x39, 0x19, 0xcc, 0xbf, 0xc1, 0xf6, 0xe1, 0xe3, 0xbe, 0xd2, 0x54, - 0x77, 0x62, 0x23, 0xb1, 0x4d, 0xeb, 0x4f, 0xa7, 0xbc, 0x51, 0x65, 0xa5, 0x7c, 0xba, 0xe3, 0xc2, - 0x6b, 0x99, 0x4a, 0x6c, 0x5b, 0xb4, 0xe9, 0x08, 0x85, 0x69, 0xc6, 0x81, 0xc5, 0xd9, 0xb0, 0xf0, - 0xdd, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xd8, 0x44, 0x15, 0xf9, 0x72, 0x01, 0x00, 0x00, +var File_storage_proto protoreflect.FileDescriptor + +var file_storage_proto_rawDesc = []byte{ + 0x0a, 0x0d, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, + 0x04, 0x6d, 0x73, 0x67, 0x73, 0x22, 0x82, 0x01, 0x0a, 0x0e, 0x74, 0x78, 0x49, 0x44, 0x49, 0x6e, + 0x64, 0x65, 0x78, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x6c, 0x6b, 0x5f, + 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, + 0x62, 0x6c, 0x6b, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1f, 0x0a, 0x0b, 0x74, + 0x78, 0x5f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x0a, 0x74, 0x78, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2c, 0x0a, 0x12, + 0x74, 0x78, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x6f, + 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x10, 0x74, 0x78, 0x56, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x22, 0x93, 0x01, 0x0a, 0x19, 0x62, + 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x53, 0x6e, 0x61, 0x70, + 0x73, 0x68, 0x6f, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x22, 0x0a, 0x0c, 0x6c, 0x61, 0x73, 0x74, + 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0c, + 0x6c, 0x61, 0x73, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x12, 0x24, 0x0a, 0x0d, + 0x6c, 0x61, 0x73, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x0d, 0x6c, 0x61, 0x73, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, + 0x73, 0x68, 0x12, 0x2c, 0x0a, 0x11, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x42, 0x6c, + 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x11, 0x70, + 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, + 0x42, 0x38, 0x5a, 0x36, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, + 0x79, 0x70, 0x65, 0x72, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2f, 0x66, 0x61, 0x62, 0x72, 0x69, + 0x63, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2f, + 0x62, 0x6c, 0x6b, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, +} + +var ( + file_storage_proto_rawDescOnce sync.Once + file_storage_proto_rawDescData = file_storage_proto_rawDesc +) + +func file_storage_proto_rawDescGZIP() []byte { + file_storage_proto_rawDescOnce.Do(func() { + file_storage_proto_rawDescData = protoimpl.X.CompressGZIP(file_storage_proto_rawDescData) + }) + return file_storage_proto_rawDescData +} + +var file_storage_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_storage_proto_goTypes = []any{ + (*TxIDIndexValue)(nil), // 0: msgs.txIDIndexValue + (*BootstrappingSnapshotInfo)(nil), // 1: msgs.bootstrappingSnapshotInfo +} +var file_storage_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_storage_proto_init() } +func file_storage_proto_init() { + if File_storage_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_storage_proto_msgTypes[0].Exporter = func(v any, i int) any { + switch v := v.(*TxIDIndexValue); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_storage_proto_msgTypes[1].Exporter = func(v any, i int) any { + switch v := v.(*BootstrappingSnapshotInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_storage_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_storage_proto_goTypes, + DependencyIndexes: file_storage_proto_depIdxs, + MessageInfos: file_storage_proto_msgTypes, + }.Build() + File_storage_proto = out.File + file_storage_proto_rawDesc = nil + file_storage_proto_goTypes = nil + file_storage_proto_depIdxs = nil } diff --git a/common/ledger/blockledger/fileledger/impl.go b/common/ledger/blockledger/fileledger/impl.go index 36e58bdc832..a8337622bc0 100644 --- a/common/ledger/blockledger/fileledger/impl.go +++ b/common/ledger/blockledger/fileledger/impl.go @@ -8,8 +8,8 @@ package fileledger import ( "github.com/hyperledger/fabric-lib-go/common/flogging" - cb "github.com/hyperledger/fabric-protos-go/common" - ab "github.com/hyperledger/fabric-protos-go/orderer" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + ab "github.com/hyperledger/fabric-protos-go-apiv2/orderer" "github.com/hyperledger/fabric/common/ledger" "github.com/hyperledger/fabric/common/ledger/blockledger" ) diff --git a/common/ledger/blockledger/fileledger/impl_test.go b/common/ledger/blockledger/fileledger/impl_test.go index 84e25de5574..045bbd41e55 100644 --- a/common/ledger/blockledger/fileledger/impl_test.go +++ b/common/ledger/blockledger/fileledger/impl_test.go @@ -13,9 +13,9 @@ import ( "github.com/hyperledger/fabric-lib-go/common/flogging" "github.com/hyperledger/fabric-lib-go/common/metrics/disabled" - cb "github.com/hyperledger/fabric-protos-go/common" - ab "github.com/hyperledger/fabric-protos-go/orderer" - "github.com/hyperledger/fabric-protos-go/peer" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + ab "github.com/hyperledger/fabric-protos-go-apiv2/orderer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" cl "github.com/hyperledger/fabric/common/ledger" "github.com/hyperledger/fabric/common/ledger/blkstorage/blkstoragetest" "github.com/hyperledger/fabric/common/ledger/blockledger" diff --git a/common/ledger/blockledger/fileledger/mock/file_ledger_block_store.go b/common/ledger/blockledger/fileledger/mock/file_ledger_block_store.go index bdd2dcc70fd..065a2e2edc2 100644 --- a/common/ledger/blockledger/fileledger/mock/file_ledger_block_store.go +++ b/common/ledger/blockledger/fileledger/mock/file_ledger_block_store.go @@ -4,7 +4,7 @@ package mock import ( "sync" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/common/ledger" ) diff --git a/common/ledger/blockledger/ledger.go b/common/ledger/blockledger/ledger.go index 1a734aad374..04e370d3bd9 100644 --- a/common/ledger/blockledger/ledger.go +++ b/common/ledger/blockledger/ledger.go @@ -7,8 +7,8 @@ SPDX-License-Identifier: Apache-2.0 package blockledger import ( - cb "github.com/hyperledger/fabric-protos-go/common" - ab "github.com/hyperledger/fabric-protos-go/orderer" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + ab "github.com/hyperledger/fabric-protos-go-apiv2/orderer" ) // Factory retrieves or creates new ledgers by channelID diff --git a/common/ledger/blockledger/util.go b/common/ledger/blockledger/util.go index 5279867dbcd..7c637bf8cfb 100644 --- a/common/ledger/blockledger/util.go +++ b/common/ledger/blockledger/util.go @@ -7,11 +7,11 @@ SPDX-License-Identifier: Apache-2.0 package blockledger import ( - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/common/flogging" - cb "github.com/hyperledger/fabric-protos-go/common" - ab "github.com/hyperledger/fabric-protos-go/orderer" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + ab "github.com/hyperledger/fabric-protos-go-apiv2/orderer" "github.com/hyperledger/fabric/protoutil" + "google.golang.org/protobuf/proto" ) var logger = flogging.MustGetLogger("common.ledger.blockledger.util") diff --git a/common/ledger/blockledger/util_test.go b/common/ledger/blockledger/util_test.go index 107fae35f1d..649ee6c61d6 100644 --- a/common/ledger/blockledger/util_test.go +++ b/common/ledger/blockledger/util_test.go @@ -9,7 +9,7 @@ package blockledger_test import ( "testing" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/common/deliver/mock" "github.com/hyperledger/fabric/common/ledger/blockledger" "github.com/stretchr/testify/require" diff --git a/common/ledger/ledger_interface.go b/common/ledger/ledger_interface.go index fa1e3f17b6d..1fa52c7f169 100644 --- a/common/ledger/ledger_interface.go +++ b/common/ledger/ledger_interface.go @@ -17,7 +17,7 @@ limitations under the License. package ledger import ( - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" ) // Ledger captures the methods that are common across the 'PeerLedger', 'OrdererLedger', and 'ValidatedLedger' diff --git a/common/ledger/snapshot/file.go b/common/ledger/snapshot/file.go index 9eebe18ecce..715a49d3c81 100644 --- a/common/ledger/snapshot/file.go +++ b/common/ledger/snapshot/file.go @@ -14,8 +14,8 @@ import ( "io" "os" - "github.com/golang/protobuf/proto" "github.com/pkg/errors" + "google.golang.org/protobuf/proto" ) type NewHashFunc func() (hash.Hash, error) @@ -66,6 +66,9 @@ func (c *FileWriter) EncodeString(str string) error { // EncodeProtoMessage encodes and appends a proto message to the data stream func (c *FileWriter) EncodeProtoMessage(m proto.Message) error { + if m == nil || !m.ProtoReflect().IsValid() { + return errors.Errorf("error marshalling proto message to write to the snapshot file: %s: proto: Marshal called with nil", c.file.Name()) + } b, err := proto.Marshal(m) if err != nil { return errors.Wrapf(err, "error marshalling proto message to write to the snapshot file: %s", c.file.Name()) diff --git a/common/ledger/snapshot/file_test.go b/common/ledger/snapshot/file_test.go index 32655a9f545..ad6c3fa506b 100644 --- a/common/ledger/snapshot/file_test.go +++ b/common/ledger/snapshot/file_test.go @@ -15,9 +15,9 @@ import ( "path" "testing" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) var testNewHashFunc = func() (hash.Hash, error) { diff --git a/common/ledger/testutil/fakes/signing_identity.go b/common/ledger/testutil/fakes/signing_identity.go index 0b33f1325a1..2b00f7da29f 100644 --- a/common/ledger/testutil/fakes/signing_identity.go +++ b/common/ledger/testutil/fakes/signing_identity.go @@ -5,7 +5,7 @@ import ( "sync" "time" - mspa "github.com/hyperledger/fabric-protos-go/msp" + mspa "github.com/hyperledger/fabric-protos-go-apiv2/msp" "github.com/hyperledger/fabric/msp" ) diff --git a/common/ledger/testutil/test_helper.go b/common/ledger/testutil/test_helper.go index 632752bbf37..307021b1180 100644 --- a/common/ledger/testutil/test_helper.go +++ b/common/ledger/testutil/test_helper.go @@ -10,13 +10,13 @@ import ( "fmt" "testing" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/bccsp/sw" - "github.com/hyperledger/fabric-protos-go/common" - pb "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/configtx/test" "github.com/hyperledger/fabric/common/crypto" "github.com/hyperledger/fabric/internal/pkg/txflags" + "google.golang.org/protobuf/proto" "github.com/hyperledger/fabric/common/ledger/testutil/fakes" "github.com/hyperledger/fabric/msp" diff --git a/common/policies/bft.go b/common/policies/bft.go index 68582a33a72..660a9fba33a 100644 --- a/common/policies/bft.go +++ b/common/policies/bft.go @@ -9,8 +9,8 @@ package policies import ( "math" - cb "github.com/hyperledger/fabric-protos-go/common" - mspa "github.com/hyperledger/fabric-protos-go/msp" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + mspa "github.com/hyperledger/fabric-protos-go-apiv2/msp" "github.com/hyperledger/fabric/common/policydsl" "github.com/hyperledger/fabric/protoutil" ) diff --git a/common/policies/convert.go b/common/policies/convert.go index c6fe10925e0..73378dfd947 100644 --- a/common/policies/convert.go +++ b/common/policies/convert.go @@ -9,7 +9,7 @@ package policies import ( "fmt" - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/pkg/errors" ) diff --git a/common/policies/convert_test.go b/common/policies/convert_test.go index 23d53873bd1..fb61902c82f 100644 --- a/common/policies/convert_test.go +++ b/common/policies/convert_test.go @@ -9,8 +9,8 @@ package policies_test import ( "testing" - cb "github.com/hyperledger/fabric-protos-go/common" - mb "github.com/hyperledger/fabric-protos-go/msp" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + mb "github.com/hyperledger/fabric-protos-go-apiv2/msp" "github.com/hyperledger/fabric/common/cauthdsl" "github.com/hyperledger/fabric/common/policies" "github.com/hyperledger/fabric/common/policydsl" diff --git a/common/policies/implicitmeta.go b/common/policies/implicitmeta.go index 85d10c0f2b1..7787c1c8511 100644 --- a/common/policies/implicitmeta.go +++ b/common/policies/implicitmeta.go @@ -10,11 +10,11 @@ import ( "bytes" "fmt" - "github.com/golang/protobuf/proto" - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/msp" "github.com/hyperledger/fabric/protoutil" "go.uber.org/zap/zapcore" + "google.golang.org/protobuf/proto" ) type ImplicitMetaPolicy struct { diff --git a/common/policies/implicitmeta_test.go b/common/policies/implicitmeta_test.go index d25a01e2a00..bc62c4d792e 100644 --- a/common/policies/implicitmeta_test.go +++ b/common/policies/implicitmeta_test.go @@ -12,7 +12,7 @@ import ( "github.com/hyperledger/fabric/msp" - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/protoutil" "github.com/stretchr/testify/require" ) diff --git a/common/policies/implicitmeta_util.go b/common/policies/implicitmeta_util.go index 7ea6a85b1f1..ed8972939c4 100644 --- a/common/policies/implicitmeta_util.go +++ b/common/policies/implicitmeta_util.go @@ -7,7 +7,7 @@ SPDX-License-Identifier: Apache-2.0 package policies import ( - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/protoutil" ) diff --git a/common/policies/implicitmetaparser.go b/common/policies/implicitmetaparser.go index 9fa74b132d4..3d264b0df35 100644 --- a/common/policies/implicitmetaparser.go +++ b/common/policies/implicitmetaparser.go @@ -9,7 +9,7 @@ package policies import ( "strings" - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/pkg/errors" ) diff --git a/common/policies/implicitmetaparser_test.go b/common/policies/implicitmetaparser_test.go index 52cd7aa664a..4dc7810269c 100644 --- a/common/policies/implicitmetaparser_test.go +++ b/common/policies/implicitmetaparser_test.go @@ -10,9 +10,9 @@ import ( "fmt" "testing" - "github.com/golang/protobuf/proto" - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) func TestImplicitMetaParserWrongTokenCount(t *testing.T) { diff --git a/common/policies/inquire/compare.go b/common/policies/inquire/compare.go index e8d7130d359..176421af4e0 100644 --- a/common/policies/inquire/compare.go +++ b/common/policies/inquire/compare.go @@ -10,9 +10,9 @@ import ( "bytes" "fmt" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/msp" + "github.com/hyperledger/fabric-protos-go-apiv2/msp" "github.com/hyperledger/fabric/common/policies" + "google.golang.org/protobuf/proto" ) // ComparablePrincipal defines an MSPPrincipal that can be compared to other principals diff --git a/common/policies/inquire/compare_test.go b/common/policies/inquire/compare_test.go index 4133129352b..b5dbb05778d 100644 --- a/common/policies/inquire/compare_test.go +++ b/common/policies/inquire/compare_test.go @@ -9,10 +9,11 @@ package inquire import ( "testing" - "github.com/hyperledger/fabric-protos-go/msp" + "github.com/hyperledger/fabric-protos-go-apiv2/msp" "github.com/hyperledger/fabric/common/policies" "github.com/hyperledger/fabric/protoutil" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) func TestToPrincipalSet(t *testing.T) { @@ -79,7 +80,12 @@ func TestNewComparablePrincipal(t *testing.T) { Principal: protoutil.MarshalOrPanic(&msp.MSPRole{Role: msp.MSPRole_MEMBER, MspIdentifier: mspID}), }, } - require.Equal(t, expectedPrincipal, NewComparablePrincipal(member(mspID))) + res := NewComparablePrincipal(member(mspID)) + require.Equal(t, expectedPrincipal.idBytes, res.idBytes) + require.Equal(t, expectedPrincipal.mspID, res.mspID) + require.True(t, proto.Equal(expectedPrincipal.principal, res.principal)) + require.True(t, proto.Equal(expectedPrincipal.ou, res.ou)) + require.True(t, proto.Equal(expectedPrincipal.role, res.role)) }) t.Run("OU", func(t *testing.T) { @@ -92,7 +98,12 @@ func TestNewComparablePrincipal(t *testing.T) { Principal: protoutil.MarshalOrPanic(&msp.OrganizationUnit{OrganizationalUnitIdentifier: "ou", MspIdentifier: mspID}), }, } - require.Equal(t, expectedPrincipal, NewComparablePrincipal(ou(mspID))) + res := NewComparablePrincipal(ou(mspID)) + require.Equal(t, expectedPrincipal.idBytes, res.idBytes) + require.Equal(t, expectedPrincipal.mspID, res.mspID) + require.True(t, proto.Equal(expectedPrincipal.principal, res.principal)) + require.True(t, proto.Equal(expectedPrincipal.ou, res.ou)) + require.True(t, proto.Equal(expectedPrincipal.role, res.role)) }) } diff --git a/common/policies/inquire/inquire.go b/common/policies/inquire/inquire.go index 36ef9f91821..5a0aabdad0b 100644 --- a/common/policies/inquire/inquire.go +++ b/common/policies/inquire/inquire.go @@ -10,7 +10,7 @@ import ( "fmt" "github.com/hyperledger/fabric-lib-go/common/flogging" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/common/graph" "github.com/hyperledger/fabric/common/policies" ) diff --git a/common/policies/inquire/inquire_test.go b/common/policies/inquire/inquire_test.go index c6f1d848bfb..f5704af622a 100644 --- a/common/policies/inquire/inquire_test.go +++ b/common/policies/inquire/inquire_test.go @@ -10,14 +10,14 @@ import ( "fmt" "testing" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/msp" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/msp" "github.com/hyperledger/fabric/common/policydsl" "github.com/hyperledger/fabric/protoutil" "github.com/stretchr/testify/require" "go.uber.org/zap" "go.uber.org/zap/zapcore" + "google.golang.org/protobuf/proto" ) type testCase struct { diff --git a/common/policies/mocks/identity.go b/common/policies/mocks/identity.go index fb80b020655..d1afd4b62aa 100644 --- a/common/policies/mocks/identity.go +++ b/common/policies/mocks/identity.go @@ -5,7 +5,7 @@ import ( "sync" "time" - mspa "github.com/hyperledger/fabric-protos-go/msp" + mspa "github.com/hyperledger/fabric-protos-go-apiv2/msp" "github.com/hyperledger/fabric/msp" ) diff --git a/common/policies/mocks/identity_deserializer.go b/common/policies/mocks/identity_deserializer.go index ed003251e5e..66485562a24 100644 --- a/common/policies/mocks/identity_deserializer.go +++ b/common/policies/mocks/identity_deserializer.go @@ -4,7 +4,7 @@ package mocks import ( "sync" - mspa "github.com/hyperledger/fabric-protos-go/msp" + mspa "github.com/hyperledger/fabric-protos-go-apiv2/msp" "github.com/hyperledger/fabric/msp" ) diff --git a/common/policies/policy.go b/common/policies/policy.go index 7716abf7237..8b27f521972 100644 --- a/common/policies/policy.go +++ b/common/policies/policy.go @@ -10,14 +10,14 @@ import ( "fmt" "strings" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/common/flogging" - cb "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/msp" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/msp" mspi "github.com/hyperledger/fabric/msp" "github.com/hyperledger/fabric/protoutil" "github.com/pkg/errors" "go.uber.org/zap/zapcore" + "google.golang.org/protobuf/proto" ) const ( diff --git a/common/policies/policy_test.go b/common/policies/policy_test.go index a695147b4ec..2cc91d09678 100644 --- a/common/policies/policy_test.go +++ b/common/policies/policy_test.go @@ -12,10 +12,9 @@ import ( "strconv" "testing" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/common/flogging/floggingtest" - cb "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/msp" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/msp" "github.com/hyperledger/fabric/common/crypto/tlsgen" "github.com/hyperledger/fabric/common/policies/mocks" mspi "github.com/hyperledger/fabric/msp" @@ -23,6 +22,7 @@ import ( "github.com/pkg/errors" "github.com/stretchr/testify/require" "go.uber.org/zap/zapcore" + "google.golang.org/protobuf/proto" ) //go:generate counterfeiter -o mocks/identity_deserializer.go --fake-name IdentityDeserializer . identityDeserializer diff --git a/common/policies/util.go b/common/policies/util.go index 223e559297e..6e43f166005 100644 --- a/common/policies/util.go +++ b/common/policies/util.go @@ -7,7 +7,7 @@ SPDX-License-Identifier: Apache-2.0 package policies import ( - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/protoutil" ) diff --git a/common/policies/util_test.go b/common/policies/util_test.go index 6871fd9840a..0d03267529d 100644 --- a/common/policies/util_test.go +++ b/common/policies/util_test.go @@ -9,7 +9,7 @@ package policies import ( "testing" - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/stretchr/testify/require" ) diff --git a/common/policydsl/policydsl_builder.go b/common/policydsl/policydsl_builder.go index 1eba56f8760..9d6fd747a14 100644 --- a/common/policydsl/policydsl_builder.go +++ b/common/policydsl/policydsl_builder.go @@ -9,9 +9,10 @@ package policydsl import ( "sort" - "github.com/golang/protobuf/proto" - cb "github.com/hyperledger/fabric-protos-go/common" - mb "github.com/hyperledger/fabric-protos-go/msp" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + mb "github.com/hyperledger/fabric-protos-go-apiv2/msp" + "github.com/pkg/errors" + "google.golang.org/protobuf/proto" ) // AcceptAllPolicy always evaluates to true @@ -196,6 +197,9 @@ func NOutOf(n int32, policies []*cb.SignaturePolicy) *cb.SignaturePolicy { // protoMarshalOrPanic serializes a protobuf message and panics if this // operation fails func protoMarshalOrPanic(pb proto.Message) []byte { + if !pb.ProtoReflect().IsValid() { + panic(errors.New("proto: Marshal called with nil")) + } data, err := proto.Marshal(pb) if err != nil { panic(err) diff --git a/common/policydsl/policyparser.go b/common/policydsl/policyparser.go index 9f140726703..f06e28e8d90 100644 --- a/common/policydsl/policyparser.go +++ b/common/policydsl/policyparser.go @@ -14,9 +14,9 @@ import ( "strings" "github.com/Knetic/govaluate" - "github.com/golang/protobuf/proto" - cb "github.com/hyperledger/fabric-protos-go/common" - mb "github.com/hyperledger/fabric-protos-go/msp" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + mb "github.com/hyperledger/fabric-protos-go-apiv2/msp" + "google.golang.org/protobuf/proto" ) // Gate values diff --git a/common/policydsl/policyparser_test.go b/common/policydsl/policyparser_test.go index 2008fe3031e..d4da2e9a6c6 100644 --- a/common/policydsl/policyparser_test.go +++ b/common/policydsl/policyparser_test.go @@ -7,13 +7,13 @@ SPDX-License-Identifier: Apache-2.0 package policydsl import ( - "reflect" "testing" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/msp" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/msp" "github.com/hyperledger/fabric/protoutil" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) func TestOutOf1(t *testing.T) { @@ -113,7 +113,7 @@ func TestAndClientPeerOrderer(t *testing.T) { Identities: principals, } - require.True(t, reflect.DeepEqual(p1, p2)) + require.True(t, proto.Equal(p1, p2)) } func TestOr(t *testing.T) { diff --git a/common/util/utils.go b/common/util/utils.go index 54e0eeec5a5..3d0fdda8338 100644 --- a/common/util/utils.go +++ b/common/util/utils.go @@ -12,9 +12,9 @@ import ( "io" "time" - "github.com/golang/protobuf/ptypes/timestamp" "github.com/hyperledger/fabric-lib-go/bccsp" "github.com/hyperledger/fabric-lib-go/bccsp/factory" + "google.golang.org/protobuf/types/known/timestamppb" ) // ComputeSHA256 returns SHA2-256 on data @@ -59,11 +59,9 @@ func GenerateUUID() string { } // CreateUtcTimestamp returns a google/protobuf/Timestamp in UTC -func CreateUtcTimestamp() *timestamp.Timestamp { +func CreateUtcTimestamp() *timestamppb.Timestamp { now := time.Now().UTC() - secs := now.Unix() - nanos := int32(now.UnixNano() - (secs * 1000000000)) - return &(timestamp.Timestamp{Seconds: secs, Nanos: nanos}) + return timestamppb.New(now) } func idBytesToStr(id []byte) string { diff --git a/core/aclmgmt/defaultaclprovider.go b/core/aclmgmt/defaultaclprovider.go index beac1141a4a..2263e30727d 100644 --- a/core/aclmgmt/defaultaclprovider.go +++ b/core/aclmgmt/defaultaclprovider.go @@ -9,8 +9,8 @@ package aclmgmt import ( "fmt" - "github.com/hyperledger/fabric-protos-go/common" - pb "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/policies" "github.com/hyperledger/fabric/core/aclmgmt/resources" "github.com/hyperledger/fabric/core/policy" @@ -46,7 +46,7 @@ func newDefaultACLProvider(policyChecker policy.PolicyChecker) defaultACLProvide cResourcePolicyMap: map[string]string{}, } - //-------------- _lifecycle -------------- + // -------------- _lifecycle -------------- d.pResourcePolicyMap[resources.Lifecycle_InstallChaincode] = policy.Admins d.pResourcePolicyMap[resources.Lifecycle_QueryInstalledChaincode] = policy.Admins d.pResourcePolicyMap[resources.Lifecycle_GetInstalledChaincodePackage] = policy.Admins @@ -60,13 +60,13 @@ func newDefaultACLProvider(policyChecker policy.PolicyChecker) defaultACLProvide d.cResourcePolicyMap[resources.Lifecycle_QueryChaincodeDefinitions] = CHANNELWRITERS d.cResourcePolicyMap[resources.Lifecycle_CheckCommitReadiness] = CHANNELWRITERS - //-------------- snapshot --------------- + // -------------- snapshot --------------- d.pResourcePolicyMap[resources.Snapshot_submitrequest] = policy.Admins d.pResourcePolicyMap[resources.Snapshot_cancelrequest] = policy.Admins d.pResourcePolicyMap[resources.Snapshot_listpending] = policy.Admins - //-------------- LSCC -------------- - //p resources (implemented by the chaincode currently) + // -------------- LSCC -------------- + // p resources (implemented by the chaincode currently) d.pResourcePolicyMap[resources.Lscc_Install] = policy.Admins d.pResourcePolicyMap[resources.Lscc_GetInstalledChaincodes] = policy.Admins @@ -79,8 +79,8 @@ func newDefaultACLProvider(policyChecker policy.PolicyChecker) defaultACLProvide d.cResourcePolicyMap[resources.Lscc_GetInstantiatedChaincodes] = CHANNELREADERS d.cResourcePolicyMap[resources.Lscc_GetCollectionsConfig] = CHANNELREADERS - //-------------- QSCC -------------- - //p resources (none) + // -------------- QSCC -------------- + // p resources (none) // c resources d.cResourcePolicyMap[resources.Qscc_GetChainInfo] = CHANNELREADERS @@ -89,8 +89,8 @@ func newDefaultACLProvider(policyChecker policy.PolicyChecker) defaultACLProvide d.cResourcePolicyMap[resources.Qscc_GetTransactionByID] = CHANNELREADERS d.cResourcePolicyMap[resources.Qscc_GetBlockByTxID] = CHANNELREADERS - //--------------- CSCC resources ----------- - //p resources (implemented by the chaincode currently) + // --------------- CSCC resources ----------- + // p resources (implemented by the chaincode currently) d.pResourcePolicyMap[resources.Cscc_JoinChain] = policy.Admins d.pResourcePolicyMap[resources.Cscc_JoinChainBySnapshot] = policy.Admins d.pResourcePolicyMap[resources.Cscc_JoinBySnapshotStatus] = policy.Admins @@ -100,8 +100,8 @@ func newDefaultACLProvider(policyChecker policy.PolicyChecker) defaultACLProvide d.cResourcePolicyMap[resources.Cscc_GetConfigBlock] = CHANNELREADERS d.cResourcePolicyMap[resources.Cscc_GetChannelConfig] = CHANNELREADERS - //---------------- non-scc resources ------------ - //Peer resources + // ---------------- non-scc resources ------------ + // Peer resources d.cResourcePolicyMap[resources.Peer_Propose] = CHANNELWRITERS d.cResourcePolicyMap[resources.Peer_ChaincodeToChaincode] = CHANNELWRITERS diff --git a/core/aclmgmt/mocks/mocks.go b/core/aclmgmt/mocks/mocks.go index 37a7448725f..155fdfc6f67 100644 --- a/core/aclmgmt/mocks/mocks.go +++ b/core/aclmgmt/mocks/mocks.go @@ -9,7 +9,7 @@ package mocks import ( "testing" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/core/ledger" "github.com/stretchr/testify/mock" ) diff --git a/core/aclmgmt/resourceprovider.go b/core/aclmgmt/resourceprovider.go index b7fc16e4e8a..a23a1a06488 100644 --- a/core/aclmgmt/resourceprovider.go +++ b/core/aclmgmt/resourceprovider.go @@ -9,13 +9,13 @@ package aclmgmt import ( "fmt" - "github.com/hyperledger/fabric-protos-go/common" - pb "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/channelconfig" "github.com/hyperledger/fabric/protoutil" ) -//--------- errors --------- +// --------- errors --------- // PolicyNotFound cache for resource type PolicyNotFound string @@ -31,7 +31,7 @@ func (e InvalidIdInfo) Error() string { return fmt.Sprintf("Invalid id for policy [%s]", string(e)) } -//---------- policyEvaluator ------ +// ---------- policyEvaluator ------ // policyEvaluator interface provides the interfaces for policy evaluation type policyEvaluator interface { @@ -71,7 +71,7 @@ func (pe *policyEvaluatorImpl) Evaluate(polName string, sd []*protoutil.SignedDa return err } -//------ resourcePolicyProvider ---------- +// ------ resourcePolicyProvider ---------- // aclmgmtPolicyProvider is the interface implemented by resource based ACL. type aclmgmtPolicyProvider interface { @@ -145,7 +145,7 @@ func (rp *aclmgmtPolicyProviderImpl) CheckACL(polName string, idinfo interface{} return nil } -//-------- resource provider - entry point API used by aclmgmtimpl for doing resource based ACL ---------- +// -------- resource provider - entry point API used by aclmgmtimpl for doing resource based ACL ---------- // resource getter gets channelconfig.Resources given channel ID type ResourceGetter func(channelID string) channelconfig.Resources diff --git a/core/aclmgmt/resourceprovider_test.go b/core/aclmgmt/resourceprovider_test.go index cf05442d737..a18b24eaaaa 100644 --- a/core/aclmgmt/resourceprovider_test.go +++ b/core/aclmgmt/resourceprovider_test.go @@ -11,15 +11,15 @@ import ( "os" "testing" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/core/aclmgmt/mocks" "github.com/hyperledger/fabric/core/policy" "github.com/hyperledger/fabric/internal/pkg/identity" msptesttools "github.com/hyperledger/fabric/msp/mgmt/testtools" "github.com/hyperledger/fabric/protoutil" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) func newPolicyProvider(pEvaluator policyEvaluator) aclmgmtPolicyProvider { diff --git a/core/cclifecycle/lifecycle_test.go b/core/cclifecycle/lifecycle_test.go index 5c1c80266d4..11b95bb91a5 100644 --- a/core/cclifecycle/lifecycle_test.go +++ b/core/cclifecycle/lifecycle_test.go @@ -16,7 +16,7 @@ import ( "time" "github.com/hyperledger/fabric-lib-go/common/flogging/floggingtest" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/chaincode" "github.com/hyperledger/fabric/core/cclifecycle" "github.com/hyperledger/fabric/core/cclifecycle/mocks" @@ -29,6 +29,7 @@ import ( "github.com/pkg/errors" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) func TestNewQuery(t *testing.T) { @@ -448,13 +449,17 @@ func TestMetadata(t *testing.T) { query.On("GetState", "lscc", "cc1").Return(cc1Bytes, nil).Once() query.On("GetState", "lscc", privdata.BuildCollectionKVSKey("cc1")).Return(protoutil.MarshalOrPanic(&peer.CollectionConfigPackage{}), nil).Once() md = m.Metadata("mychannel", "cc1", "col1") - require.Equal(t, &chaincode.Metadata{ + etl := &chaincode.Metadata{ Name: "cc1", Version: "1.0", Id: []byte{42}, Policy: []byte{1, 2, 3, 4, 5}, CollectionsConfig: &peer.CollectionConfigPackage{}, - }, md) + } + require.True(t, proto.Equal(md.CollectionsConfig, etl.CollectionsConfig)) + md.CollectionsConfig = nil + etl.CollectionsConfig = nil + require.Equal(t, etl, md) assertLogged(t, recorder, "Retrieved collection config for cc1 from cc1~collection") // Scenario VIII: A metadata retrieval is made and the chaincode is in the memory, diff --git a/core/cclifecycle/util.go b/core/cclifecycle/util.go index d2e9e1ff501..ec2e0e4de02 100644 --- a/core/cclifecycle/util.go +++ b/core/cclifecycle/util.go @@ -7,11 +7,11 @@ SPDX-License-Identifier: Apache-2.0 package cclifecycle import ( - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric/common/chaincode" "github.com/hyperledger/fabric/core/common/ccprovider" "github.com/hyperledger/fabric/core/common/privdata" "github.com/pkg/errors" + "google.golang.org/protobuf/proto" ) // AcceptAll returns a predicate that accepts all Metadata diff --git a/core/cclifecycle/util_test.go b/core/cclifecycle/util_test.go index fa10f19f288..7ebe15a7ce0 100644 --- a/core/cclifecycle/util_test.go +++ b/core/cclifecycle/util_test.go @@ -10,8 +10,7 @@ import ( "bytes" "testing" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/common/chaincode" cc "github.com/hyperledger/fabric/core/cclifecycle" "github.com/hyperledger/fabric/core/cclifecycle/mocks" @@ -19,6 +18,7 @@ import ( "github.com/pkg/errors" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) func TestChaincodeInspection(t *testing.T) { diff --git a/core/chaincode/accesscontrol/access.go b/core/chaincode/accesscontrol/access.go index 6bc43b0afb2..83394e6a5f1 100644 --- a/core/chaincode/accesscontrol/access.go +++ b/core/chaincode/accesscontrol/access.go @@ -10,11 +10,11 @@ import ( "errors" "fmt" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/common/flogging" - pb "github.com/hyperledger/fabric-protos-go/peer" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/crypto/tlsgen" "google.golang.org/grpc" + "google.golang.org/protobuf/proto" ) var logger = flogging.MustGetLogger("chaincode.accesscontrol") diff --git a/core/chaincode/accesscontrol/access_test.go b/core/chaincode/accesscontrol/access_test.go index 7ad39cd5427..99d48241835 100644 --- a/core/chaincode/accesscontrol/access_test.go +++ b/core/chaincode/accesscontrol/access_test.go @@ -15,14 +15,14 @@ import ( "testing" "time" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/common/flogging/floggingtest" - pb "github.com/hyperledger/fabric-protos-go/peer" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/crypto/tlsgen" "github.com/stretchr/testify/require" "go.uber.org/zap/zapcore" "google.golang.org/grpc" "google.golang.org/grpc/credentials" + "google.golang.org/protobuf/proto" ) type ccSrv struct { diff --git a/core/chaincode/accesscontrol/interceptor.go b/core/chaincode/accesscontrol/interceptor.go index 02e0c14a681..db1be107629 100644 --- a/core/chaincode/accesscontrol/interceptor.go +++ b/core/chaincode/accesscontrol/interceptor.go @@ -9,7 +9,7 @@ package accesscontrol import ( "fmt" - pb "github.com/hyperledger/fabric-protos-go/peer" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "google.golang.org/grpc" ) diff --git a/core/chaincode/chaincode_ginkgo_support_test.go b/core/chaincode/chaincode_ginkgo_support_test.go index 3104b18611c..b260ba30019 100644 --- a/core/chaincode/chaincode_ginkgo_support_test.go +++ b/core/chaincode/chaincode_ginkgo_support_test.go @@ -10,7 +10,7 @@ import ( "fmt" "unicode/utf8" - pb "github.com/hyperledger/fabric-protos-go/peer" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/core/chaincode" "github.com/hyperledger/fabric/core/chaincode/lifecycle" "github.com/hyperledger/fabric/core/chaincode/mock" diff --git a/core/chaincode/chaincode_support.go b/core/chaincode/chaincode_support.go index 75a75e56b86..700a801ad65 100644 --- a/core/chaincode/chaincode_support.go +++ b/core/chaincode/chaincode_support.go @@ -11,8 +11,7 @@ import ( "time" "unicode/utf8" - "github.com/golang/protobuf/proto" - pb "github.com/hyperledger/fabric-protos-go/peer" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/util" "github.com/hyperledger/fabric/core/chaincode/extcc" "github.com/hyperledger/fabric/core/chaincode/lifecycle" @@ -24,6 +23,7 @@ import ( "github.com/hyperledger/fabric/core/scc" "github.com/hyperledger/fabric/msp" "github.com/pkg/errors" + "google.golang.org/protobuf/proto" ) const ( diff --git a/core/chaincode/container_runtime_test.go b/core/chaincode/container_runtime_test.go index 32bf843c336..a3046653be9 100644 --- a/core/chaincode/container_runtime_test.go +++ b/core/chaincode/container_runtime_test.go @@ -9,7 +9,7 @@ package chaincode_test import ( "testing" - pb "github.com/hyperledger/fabric-protos-go/peer" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/core/chaincode" "github.com/hyperledger/fabric/core/chaincode/mock" "github.com/hyperledger/fabric/core/container" diff --git a/core/chaincode/cs_test.go b/core/chaincode/cs_test.go index a7ee6d50785..f7568cdbb05 100644 --- a/core/chaincode/cs_test.go +++ b/core/chaincode/cs_test.go @@ -13,7 +13,7 @@ import ( "time" "github.com/hyperledger/fabric-lib-go/common/metrics/disabled" - pb "github.com/hyperledger/fabric-protos-go/peer" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/crypto/tlsgen" "github.com/hyperledger/fabric/core/chaincode/accesscontrol" "github.com/hyperledger/fabric/core/chaincode/lifecycle" diff --git a/core/chaincode/extcc/extcc_handler.go b/core/chaincode/extcc/extcc_handler.go index b14e482790b..c2610e82a42 100644 --- a/core/chaincode/extcc/extcc_handler.go +++ b/core/chaincode/extcc/extcc_handler.go @@ -13,7 +13,7 @@ import ( "github.com/hyperledger/fabric/core/container/ccintf" "github.com/pkg/errors" - pb "github.com/hyperledger/fabric-protos-go/peer" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "google.golang.org/grpc" ) diff --git a/core/chaincode/fake/message_handler.go b/core/chaincode/fake/message_handler.go index 32122b238ba..96a08361699 100644 --- a/core/chaincode/fake/message_handler.go +++ b/core/chaincode/fake/message_handler.go @@ -4,7 +4,7 @@ package fake import ( "sync" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/core/chaincode" ) diff --git a/core/chaincode/fake/query_response_builder.go b/core/chaincode/fake/query_response_builder.go index fa676409d8b..6c864e40dd1 100644 --- a/core/chaincode/fake/query_response_builder.go +++ b/core/chaincode/fake/query_response_builder.go @@ -4,7 +4,7 @@ package fake import ( "sync" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/ledger" "github.com/hyperledger/fabric/core/chaincode" ) diff --git a/core/chaincode/handler.go b/core/chaincode/handler.go index 8315d5e1301..1152cbf77d0 100644 --- a/core/chaincode/handler.go +++ b/core/chaincode/handler.go @@ -14,9 +14,8 @@ import ( "sync" "time" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/common/flogging" - pb "github.com/hyperledger/fabric-protos-go/peer" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/channelconfig" commonledger "github.com/hyperledger/fabric/common/ledger" "github.com/hyperledger/fabric/core/aclmgmt/resources" @@ -27,6 +26,7 @@ import ( "github.com/hyperledger/fabric/core/ledger" "github.com/hyperledger/fabric/core/scc" "github.com/pkg/errors" + "google.golang.org/protobuf/proto" ) var chaincodeLogger = flogging.MustGetLogger("chaincode") @@ -782,6 +782,10 @@ func (h *Handler) HandleGetStateByRange(msg *pb.ChaincodeMessage, txContext *Tra txContext.CleanupQueryContext(iterID) return nil, errors.WithStack(err) } + if payload == nil { + txContext.CleanupQueryContext(iterID) + return nil, errors.New("marshal failed: proto: Marshal called with nil") + } payloadBytes, err := proto.Marshal(payload) if err != nil { @@ -813,6 +817,10 @@ func (h *Handler) HandleQueryStateNext(msg *pb.ChaincodeMessage, txContext *Tran txContext.CleanupQueryContext(queryStateNext.Id) return nil, errors.WithStack(err) } + if payload == nil { + txContext.CleanupQueryContext(queryStateNext.Id) + return nil, errors.New("marshal failed: proto: Marshal called with nil") + } payloadBytes, err := proto.Marshal(payload) if err != nil { @@ -892,6 +900,10 @@ func (h *Handler) HandleGetQueryResult(msg *pb.ChaincodeMessage, txContext *Tran txContext.CleanupQueryContext(iterID) return nil, errors.WithStack(err) } + if payload == nil { + txContext.CleanupQueryContext(iterID) + return nil, errors.New("marshal failed: proto: Marshal called with nil") + } payloadBytes, err := proto.Marshal(payload) if err != nil { @@ -930,6 +942,10 @@ func (h *Handler) HandleGetHistoryForKey(msg *pb.ChaincodeMessage, txContext *Tr txContext.CleanupQueryContext(iterID) return nil, errors.WithStack(err) } + if payload == nil { + txContext.CleanupQueryContext(iterID) + return nil, errors.New("marshal failed: proto: Marshal called with nil") + } payloadBytes, err := proto.Marshal(payload) if err != nil { @@ -1208,6 +1224,9 @@ func (h *Handler) HandleInvokeChaincode(msg *pb.ChaincodeMessage, txContext *Tra if err != nil { return nil, errors.Wrap(err, "execute failed") } + if responseMessage == nil { + return nil, errors.New("marshal failed: proto: Marshal called with nil") + } // payload is marshalled and sent to the calling chaincode's shim which unmarshals and // sends it to chaincode diff --git a/core/chaincode/handler_test.go b/core/chaincode/handler_test.go index 3df5f97606c..5aed680678e 100644 --- a/core/chaincode/handler_test.go +++ b/core/chaincode/handler_test.go @@ -10,9 +10,8 @@ import ( "io" "time" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/common/metrics/metricsfakes" - pb "github.com/hyperledger/fabric-protos-go/peer" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/util" ar "github.com/hyperledger/fabric/core/aclmgmt/resources" "github.com/hyperledger/fabric/core/chaincode" @@ -25,6 +24,7 @@ import ( . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "github.com/pkg/errors" + "google.golang.org/protobuf/proto" ) var _ = Describe("Handler", func() { @@ -2551,7 +2551,7 @@ var _ = Describe("Handler", func() { }) It("sends an execute message to the chaincode with the correct proposal", func() { - expectedMessage := proto.Clone(incomingMessage).(*pb.ChaincodeMessage) + expectedMessage := incomingMessage expectedMessage.Proposal = expectedSignedProp close(responseNotifier) diff --git a/core/chaincode/lifecycle/cache.go b/core/chaincode/lifecycle/cache.go index ef70c8663d4..a73aaeb2e6c 100644 --- a/core/chaincode/lifecycle/cache.go +++ b/core/chaincode/lifecycle/cache.go @@ -12,7 +12,7 @@ import ( "strconv" "sync" - lb "github.com/hyperledger/fabric-protos-go/peer/lifecycle" + lb "github.com/hyperledger/fabric-protos-go-apiv2/peer/lifecycle" "github.com/hyperledger/fabric/common/chaincode" "github.com/hyperledger/fabric/common/util" "github.com/hyperledger/fabric/core/chaincode/implicitcollection" diff --git a/core/chaincode/lifecycle/cache_test.go b/core/chaincode/lifecycle/cache_test.go index afa4b850516..93eced21d37 100644 --- a/core/chaincode/lifecycle/cache_test.go +++ b/core/chaincode/lifecycle/cache_test.go @@ -9,10 +9,10 @@ package lifecycle_test import ( "fmt" - "github.com/hyperledger/fabric-protos-go/ledger/queryresult" - "github.com/hyperledger/fabric-protos-go/ledger/rwset/kvrwset" - pb "github.com/hyperledger/fabric-protos-go/peer" - lb "github.com/hyperledger/fabric-protos-go/peer/lifecycle" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/queryresult" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset/kvrwset" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" + lb "github.com/hyperledger/fabric-protos-go-apiv2/peer/lifecycle" "github.com/hyperledger/fabric/common/chaincode" commonledger "github.com/hyperledger/fabric/common/ledger" "github.com/hyperledger/fabric/common/util" @@ -24,7 +24,6 @@ import ( "github.com/hyperledger/fabric/core/ledger" ledgermock "github.com/hyperledger/fabric/core/ledger/mock" "github.com/hyperledger/fabric/protoutil" - . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/core/chaincode/lifecycle/custodian_test.go b/core/chaincode/lifecycle/custodian_test.go index f809717da08..8e2f5936c35 100644 --- a/core/chaincode/lifecycle/custodian_test.go +++ b/core/chaincode/lifecycle/custodian_test.go @@ -9,12 +9,11 @@ package lifecycle_test import ( "fmt" - . "github.com/onsi/ginkgo/v2" - . "github.com/onsi/gomega" - "github.com/hyperledger/fabric/core/chaincode/lifecycle" "github.com/hyperledger/fabric/core/chaincode/lifecycle/mock" "github.com/hyperledger/fabric/core/container" + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" ) var _ = Describe("Custodian", func() { diff --git a/core/chaincode/lifecycle/deployedcc_infoprovider.go b/core/chaincode/lifecycle/deployedcc_infoprovider.go index 819c7284a99..4f2afe0b816 100644 --- a/core/chaincode/lifecycle/deployedcc_infoprovider.go +++ b/core/chaincode/lifecycle/deployedcc_infoprovider.go @@ -10,9 +10,9 @@ import ( "fmt" "regexp" - cb "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/ledger/rwset/kvrwset" - pb "github.com/hyperledger/fabric-protos-go/peer" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset/kvrwset" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/policydsl" "github.com/hyperledger/fabric/common/util" "github.com/hyperledger/fabric/core/chaincode/implicitcollection" @@ -21,7 +21,6 @@ import ( "github.com/hyperledger/fabric/core/peer" "github.com/hyperledger/fabric/gossip/privdata" "github.com/hyperledger/fabric/protoutil" - "github.com/pkg/errors" ) diff --git a/core/chaincode/lifecycle/deployedcc_infoprovider_test.go b/core/chaincode/lifecycle/deployedcc_infoprovider_test.go index 3c7bbf79a8f..b72d6a8c14a 100644 --- a/core/chaincode/lifecycle/deployedcc_infoprovider_test.go +++ b/core/chaincode/lifecycle/deployedcc_infoprovider_test.go @@ -9,12 +9,12 @@ package lifecycle_test import ( "fmt" - cb "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/ledger/queryresult" - "github.com/hyperledger/fabric-protos-go/ledger/rwset/kvrwset" - "github.com/hyperledger/fabric-protos-go/msp" - pb "github.com/hyperledger/fabric-protos-go/peer" - lb "github.com/hyperledger/fabric-protos-go/peer/lifecycle" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/queryresult" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset/kvrwset" + "github.com/hyperledger/fabric-protos-go-apiv2/msp" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" + lb "github.com/hyperledger/fabric-protos-go-apiv2/peer/lifecycle" "github.com/hyperledger/fabric/common/channelconfig" commonledger "github.com/hyperledger/fabric/common/ledger" "github.com/hyperledger/fabric/common/util" @@ -23,13 +23,11 @@ import ( "github.com/hyperledger/fabric/core/ledger" "github.com/hyperledger/fabric/core/peer" "github.com/hyperledger/fabric/gossip/privdata" - "github.com/hyperledger/fabric/protoutil" - - "github.com/golang/protobuf/proto" - . "github.com/hyperledger/fabric/internal/test" + "github.com/hyperledger/fabric/protoutil" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" + "google.golang.org/protobuf/proto" ) var _ = Describe("ValidatorCommitter", func() { diff --git a/core/chaincode/lifecycle/endorsement_info_test.go b/core/chaincode/lifecycle/endorsement_info_test.go index 6bb299e795f..f9874c7b0fa 100644 --- a/core/chaincode/lifecycle/endorsement_info_test.go +++ b/core/chaincode/lifecycle/endorsement_info_test.go @@ -9,11 +9,10 @@ package lifecycle_test import ( "fmt" - lb "github.com/hyperledger/fabric-protos-go/peer/lifecycle" + lb "github.com/hyperledger/fabric-protos-go-apiv2/peer/lifecycle" "github.com/hyperledger/fabric/core/chaincode/lifecycle" "github.com/hyperledger/fabric/core/chaincode/lifecycle/mock" "github.com/hyperledger/fabric/core/scc" - . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/core/chaincode/lifecycle/event_broker_test.go b/core/chaincode/lifecycle/event_broker_test.go index ca302bab60d..5df4ed71729 100644 --- a/core/chaincode/lifecycle/event_broker_test.go +++ b/core/chaincode/lifecycle/event_broker_test.go @@ -11,7 +11,7 @@ import ( "bytes" "io" - lb "github.com/hyperledger/fabric-protos-go/peer/lifecycle" + lb "github.com/hyperledger/fabric-protos-go-apiv2/peer/lifecycle" "github.com/hyperledger/fabric/core/chaincode/lifecycle" "github.com/hyperledger/fabric/core/chaincode/lifecycle/mock" "github.com/hyperledger/fabric/core/chaincode/persistence" diff --git a/core/chaincode/lifecycle/integration_test.go b/core/chaincode/lifecycle/integration_test.go index d09020c40a3..c0af22ad75f 100644 --- a/core/chaincode/lifecycle/integration_test.go +++ b/core/chaincode/lifecycle/integration_test.go @@ -7,22 +7,20 @@ SPDX-License-Identifier: Apache-2.0 package lifecycle_test import ( - "github.com/hyperledger/fabric-chaincode-go/shim" - "github.com/hyperledger/fabric-protos-go/ledger/queryresult" - pb "github.com/hyperledger/fabric-protos-go/peer" - lb "github.com/hyperledger/fabric-protos-go/peer/lifecycle" + "github.com/hyperledger/fabric-chaincode-go/v2/shim" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/queryresult" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" + lb "github.com/hyperledger/fabric-protos-go-apiv2/peer/lifecycle" "github.com/hyperledger/fabric/common/channelconfig" "github.com/hyperledger/fabric/common/util" "github.com/hyperledger/fabric/core/chaincode/lifecycle" "github.com/hyperledger/fabric/core/chaincode/lifecycle/mock" "github.com/hyperledger/fabric/core/dispatcher" - "github.com/hyperledger/fabric/protoutil" - . "github.com/hyperledger/fabric/internal/test" + "github.com/hyperledger/fabric/protoutil" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" - - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" ) var _ = Describe("Integration", func() { diff --git a/core/chaincode/lifecycle/ledger_shim.go b/core/chaincode/lifecycle/ledger_shim.go index f41b973550d..f5e8c74a10b 100644 --- a/core/chaincode/lifecycle/ledger_shim.go +++ b/core/chaincode/lifecycle/ledger_shim.go @@ -7,12 +7,11 @@ SPDX-License-Identifier: Apache-2.0 package lifecycle import ( - "github.com/hyperledger/fabric-chaincode-go/shim" - "github.com/hyperledger/fabric-protos-go/ledger/queryresult" + "github.com/hyperledger/fabric-chaincode-go/v2/shim" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/queryresult" commonledger "github.com/hyperledger/fabric/common/ledger" validatorstate "github.com/hyperledger/fabric/core/handlers/validation/api/state" "github.com/hyperledger/fabric/core/ledger" - "github.com/pkg/errors" ) diff --git a/core/chaincode/lifecycle/ledger_shim_test.go b/core/chaincode/lifecycle/ledger_shim_test.go index 7665b098316..f9dd3952506 100644 --- a/core/chaincode/lifecycle/ledger_shim_test.go +++ b/core/chaincode/lifecycle/ledger_shim_test.go @@ -9,12 +9,11 @@ package lifecycle_test import ( "fmt" - . "github.com/onsi/ginkgo/v2" - . "github.com/onsi/gomega" - - "github.com/hyperledger/fabric-protos-go/ledger/queryresult" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/queryresult" "github.com/hyperledger/fabric/core/chaincode/lifecycle" "github.com/hyperledger/fabric/core/chaincode/lifecycle/mock" + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" ) var _ = Describe("LedgerShims", func() { diff --git a/core/chaincode/lifecycle/lifecycle.go b/core/chaincode/lifecycle/lifecycle.go index 05ce1c9584a..fa98ede704f 100644 --- a/core/chaincode/lifecycle/lifecycle.go +++ b/core/chaincode/lifecycle/lifecycle.go @@ -14,19 +14,18 @@ import ( "sync" "github.com/hyperledger/fabric-lib-go/common/flogging" - cb "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/msp" - pb "github.com/hyperledger/fabric-protos-go/peer" - lb "github.com/hyperledger/fabric-protos-go/peer/lifecycle" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/msp" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" + lb "github.com/hyperledger/fabric-protos-go-apiv2/peer/lifecycle" "github.com/hyperledger/fabric/common/chaincode" "github.com/hyperledger/fabric/common/policydsl" "github.com/hyperledger/fabric/core/chaincode/implicitcollection" "github.com/hyperledger/fabric/core/chaincode/persistence" "github.com/hyperledger/fabric/core/container" "github.com/hyperledger/fabric/protoutil" - - "github.com/golang/protobuf/proto" "github.com/pkg/errors" + "google.golang.org/protobuf/proto" ) var logger = flogging.MustGetLogger("lifecycle") diff --git a/core/chaincode/lifecycle/lifecycle_suite_test.go b/core/chaincode/lifecycle/lifecycle_suite_test.go index ba24ecbfa4c..be06ce934ca 100644 --- a/core/chaincode/lifecycle/lifecycle_suite_test.go +++ b/core/chaincode/lifecycle/lifecycle_suite_test.go @@ -10,7 +10,7 @@ import ( "strings" "testing" - "github.com/hyperledger/fabric-chaincode-go/shim" + "github.com/hyperledger/fabric-chaincode-go/v2/shim" "github.com/hyperledger/fabric/common/channelconfig" commonledger "github.com/hyperledger/fabric/common/ledger" "github.com/hyperledger/fabric/common/policies" @@ -20,7 +20,6 @@ import ( validation "github.com/hyperledger/fabric/core/handlers/validation/api/state" "github.com/hyperledger/fabric/core/ledger" "github.com/hyperledger/fabric/msp" - . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/core/chaincode/lifecycle/lifecycle_test.go b/core/chaincode/lifecycle/lifecycle_test.go index fab2173ba8c..35396f4b815 100644 --- a/core/chaincode/lifecycle/lifecycle_test.go +++ b/core/chaincode/lifecycle/lifecycle_test.go @@ -9,22 +9,21 @@ package lifecycle_test import ( "fmt" - "github.com/golang/protobuf/proto" - cb "github.com/hyperledger/fabric-protos-go/common" - pb "github.com/hyperledger/fabric-protos-go/peer" - lb "github.com/hyperledger/fabric-protos-go/peer/lifecycle" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" + lb "github.com/hyperledger/fabric-protos-go-apiv2/peer/lifecycle" "github.com/hyperledger/fabric/common/chaincode" "github.com/hyperledger/fabric/common/channelconfig" "github.com/hyperledger/fabric/core/chaincode/lifecycle" "github.com/hyperledger/fabric/core/chaincode/lifecycle/mock" "github.com/hyperledger/fabric/core/chaincode/persistence" "github.com/hyperledger/fabric/core/container" - "github.com/hyperledger/fabric/protoutil" - "github.com/pkg/errors" - . "github.com/hyperledger/fabric/internal/test" + "github.com/hyperledger/fabric/protoutil" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" + "github.com/pkg/errors" + "google.golang.org/protobuf/proto" ) var _ = Describe("ChaincodeParameters", func() { diff --git a/core/chaincode/lifecycle/metadata_manager_test.go b/core/chaincode/lifecycle/metadata_manager_test.go index 8bbe8ffce90..eb2f9e93c46 100644 --- a/core/chaincode/lifecycle/metadata_manager_test.go +++ b/core/chaincode/lifecycle/metadata_manager_test.go @@ -10,7 +10,6 @@ import ( "github.com/hyperledger/fabric/common/chaincode" "github.com/hyperledger/fabric/core/chaincode/lifecycle" "github.com/hyperledger/fabric/core/chaincode/lifecycle/mock" - . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/core/chaincode/lifecycle/metadata_provider.go b/core/chaincode/lifecycle/metadata_provider.go index fbc37c1efcb..9bc36fd3ee0 100644 --- a/core/chaincode/lifecycle/metadata_provider.go +++ b/core/chaincode/lifecycle/metadata_provider.go @@ -9,14 +9,14 @@ package lifecycle import ( "strconv" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/chaincode" "github.com/hyperledger/fabric/common/policies" "github.com/hyperledger/fabric/common/policydsl" "github.com/hyperledger/fabric/core/chaincode/implicitcollection" "github.com/hyperledger/fabric/protoutil" "github.com/pkg/errors" + "google.golang.org/protobuf/proto" ) // LegacyMetadataProvider provides metadata for a lscc-defined chaincode diff --git a/core/chaincode/lifecycle/metadata_provider_test.go b/core/chaincode/lifecycle/metadata_provider_test.go index 2991f833090..5f03834c734 100644 --- a/core/chaincode/lifecycle/metadata_provider_test.go +++ b/core/chaincode/lifecycle/metadata_provider_test.go @@ -7,19 +7,18 @@ SPDX-License-Identifier: Apache-2.0 package lifecycle_test import ( - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/msp" - pb "github.com/hyperledger/fabric-protos-go/peer" - lb "github.com/hyperledger/fabric-protos-go/peer/lifecycle" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/msp" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" + lb "github.com/hyperledger/fabric-protos-go-apiv2/peer/lifecycle" "github.com/hyperledger/fabric/common/chaincode" "github.com/hyperledger/fabric/common/policydsl" "github.com/hyperledger/fabric/core/chaincode/lifecycle" "github.com/hyperledger/fabric/core/chaincode/lifecycle/mock" - "github.com/pkg/errors" - "github.com/hyperledger/fabric/protoutil" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" + "github.com/pkg/errors" ) var _ = Describe("MetadataProvider", func() { diff --git a/core/chaincode/lifecycle/mock/application_org_config.go b/core/chaincode/lifecycle/mock/application_org_config.go index 8d78964452a..e18d04f9d53 100644 --- a/core/chaincode/lifecycle/mock/application_org_config.go +++ b/core/chaincode/lifecycle/mock/application_org_config.go @@ -4,7 +4,7 @@ package mock import ( "sync" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/msp" ) diff --git a/core/chaincode/lifecycle/mock/chaincode_stub.go b/core/chaincode/lifecycle/mock/chaincode_stub.go index 75ff614f412..ecba339e08f 100644 --- a/core/chaincode/lifecycle/mock/chaincode_stub.go +++ b/core/chaincode/lifecycle/mock/chaincode_stub.go @@ -4,8 +4,8 @@ package mock import ( "sync" - "github.com/hyperledger/fabric-chaincode-go/shim" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-chaincode-go/v2/shim" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "google.golang.org/protobuf/types/known/timestamppb" ) @@ -400,7 +400,7 @@ type ChaincodeStub struct { result1 *timestamppb.Timestamp result2 error } - InvokeChaincodeStub func(string, [][]byte, string) peer.Response + InvokeChaincodeStub func(string, [][]byte, string) *peer.Response invokeChaincodeMutex sync.RWMutex invokeChaincodeArgsForCall []struct { arg1 string @@ -408,10 +408,10 @@ type ChaincodeStub struct { arg3 string } invokeChaincodeReturns struct { - result1 peer.Response + result1 *peer.Response } invokeChaincodeReturnsOnCall map[int]struct { - result1 peer.Response + result1 *peer.Response } PurgePrivateDataStub func(string, string) error purgePrivateDataMutex sync.RWMutex @@ -2358,7 +2358,7 @@ func (fake *ChaincodeStub) GetTxTimestampReturnsOnCall(i int, result1 *timestamp }{result1, result2} } -func (fake *ChaincodeStub) InvokeChaincode(arg1 string, arg2 [][]byte, arg3 string) peer.Response { +func (fake *ChaincodeStub) InvokeChaincode(arg1 string, arg2 [][]byte, arg3 string) *peer.Response { var arg2Copy [][]byte if arg2 != nil { arg2Copy = make([][]byte, len(arg2)) @@ -2390,7 +2390,7 @@ func (fake *ChaincodeStub) InvokeChaincodeCallCount() int { return len(fake.invokeChaincodeArgsForCall) } -func (fake *ChaincodeStub) InvokeChaincodeCalls(stub func(string, [][]byte, string) peer.Response) { +func (fake *ChaincodeStub) InvokeChaincodeCalls(stub func(string, [][]byte, string) *peer.Response) { fake.invokeChaincodeMutex.Lock() defer fake.invokeChaincodeMutex.Unlock() fake.InvokeChaincodeStub = stub @@ -2403,26 +2403,26 @@ func (fake *ChaincodeStub) InvokeChaincodeArgsForCall(i int) (string, [][]byte, return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3 } -func (fake *ChaincodeStub) InvokeChaincodeReturns(result1 peer.Response) { +func (fake *ChaincodeStub) InvokeChaincodeReturns(result1 *peer.Response) { fake.invokeChaincodeMutex.Lock() defer fake.invokeChaincodeMutex.Unlock() fake.InvokeChaincodeStub = nil fake.invokeChaincodeReturns = struct { - result1 peer.Response + result1 *peer.Response }{result1} } -func (fake *ChaincodeStub) InvokeChaincodeReturnsOnCall(i int, result1 peer.Response) { +func (fake *ChaincodeStub) InvokeChaincodeReturnsOnCall(i int, result1 *peer.Response) { fake.invokeChaincodeMutex.Lock() defer fake.invokeChaincodeMutex.Unlock() fake.InvokeChaincodeStub = nil if fake.invokeChaincodeReturnsOnCall == nil { fake.invokeChaincodeReturnsOnCall = make(map[int]struct { - result1 peer.Response + result1 *peer.Response }) } fake.invokeChaincodeReturnsOnCall[i] = struct { - result1 peer.Response + result1 *peer.Response }{result1} } @@ -2989,5 +2989,3 @@ func (fake *ChaincodeStub) recordInvocation(key string, args []interface{}) { } fake.invocations[key] = append(fake.invocations[key], args) } - -var _ shim.ChaincodeStubInterface = new(ChaincodeStub) diff --git a/core/chaincode/lifecycle/mock/convertible_policy.go b/core/chaincode/lifecycle/mock/convertible_policy.go index 98094bc6448..1f941425d07 100644 --- a/core/chaincode/lifecycle/mock/convertible_policy.go +++ b/core/chaincode/lifecycle/mock/convertible_policy.go @@ -4,7 +4,7 @@ package mock import ( "sync" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/msp" "github.com/hyperledger/fabric/protoutil" ) diff --git a/core/chaincode/lifecycle/mock/legacy_ccinfo.go b/core/chaincode/lifecycle/mock/legacy_ccinfo.go index f12201fd0f6..f6648629ce5 100644 --- a/core/chaincode/lifecycle/mock/legacy_ccinfo.go +++ b/core/chaincode/lifecycle/mock/legacy_ccinfo.go @@ -4,8 +4,8 @@ package mock import ( "sync" - "github.com/hyperledger/fabric-protos-go/ledger/rwset/kvrwset" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset/kvrwset" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/core/chaincode/lifecycle" "github.com/hyperledger/fabric/core/ledger" ) diff --git a/core/chaincode/lifecycle/mock/msp.go b/core/chaincode/lifecycle/mock/msp.go index d6e75cb64d2..fc98129f81f 100644 --- a/core/chaincode/lifecycle/mock/msp.go +++ b/core/chaincode/lifecycle/mock/msp.go @@ -4,7 +4,7 @@ package mock import ( "sync" - mspa "github.com/hyperledger/fabric-protos-go/msp" + mspa "github.com/hyperledger/fabric-protos-go-apiv2/msp" "github.com/hyperledger/fabric/msp" ) diff --git a/core/chaincode/lifecycle/mock/msp_manager.go b/core/chaincode/lifecycle/mock/msp_manager.go index 2dc4986b5df..8d8a0365a2b 100644 --- a/core/chaincode/lifecycle/mock/msp_manager.go +++ b/core/chaincode/lifecycle/mock/msp_manager.go @@ -4,7 +4,7 @@ package mock import ( "sync" - mspa "github.com/hyperledger/fabric-protos-go/msp" + mspa "github.com/hyperledger/fabric-protos-go-apiv2/msp" "github.com/hyperledger/fabric/msp" ) diff --git a/core/chaincode/lifecycle/mock/state_iterator.go b/core/chaincode/lifecycle/mock/state_iterator.go index 019a5c929b9..e6238f97ab5 100644 --- a/core/chaincode/lifecycle/mock/state_iterator.go +++ b/core/chaincode/lifecycle/mock/state_iterator.go @@ -4,7 +4,7 @@ package mock import ( "sync" - "github.com/hyperledger/fabric-protos-go/ledger/queryresult" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/queryresult" ) type StateIterator struct { diff --git a/core/chaincode/lifecycle/scc.go b/core/chaincode/lifecycle/scc.go index 64a660766de..c7d471d7491 100644 --- a/core/chaincode/lifecycle/scc.go +++ b/core/chaincode/lifecycle/scc.go @@ -10,11 +10,11 @@ import ( "fmt" "regexp" - "github.com/hyperledger/fabric-chaincode-go/shim" - "github.com/hyperledger/fabric-protos-go/common" - mspprotos "github.com/hyperledger/fabric-protos-go/msp" - pb "github.com/hyperledger/fabric-protos-go/peer" - lb "github.com/hyperledger/fabric-protos-go/peer/lifecycle" + "github.com/hyperledger/fabric-chaincode-go/v2/shim" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + mspprotos "github.com/hyperledger/fabric-protos-go-apiv2/msp" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" + lb "github.com/hyperledger/fabric-protos-go-apiv2/peer/lifecycle" "github.com/hyperledger/fabric/common/cauthdsl" "github.com/hyperledger/fabric/common/chaincode" "github.com/hyperledger/fabric/common/channelconfig" @@ -25,9 +25,9 @@ import ( "github.com/hyperledger/fabric/core/ledger" "github.com/hyperledger/fabric/msp" - "github.com/golang/protobuf/proto" "github.com/pkg/errors" "go.uber.org/zap/zapcore" + "google.golang.org/protobuf/proto" ) const ( @@ -180,14 +180,14 @@ func (scc *SCC) Chaincode() shim.Chaincode { } // Init is mostly useless for system chaincodes and always returns success -func (scc *SCC) Init(stub shim.ChaincodeStubInterface) pb.Response { +func (scc *SCC) Init(stub shim.ChaincodeStubInterface) *pb.Response { return shim.Success(nil) } // Invoke takes chaincode invocation arguments and routes them to the correct // underlying lifecycle operation. All functions take a single argument of // type marshaled lb.Args and return a marshaled lb.Result -func (scc *SCC) Invoke(stub shim.ChaincodeStubInterface) pb.Response { +func (scc *SCC) Invoke(stub shim.ChaincodeStubInterface) *pb.Response { args := stub.GetArgs() if len(args) == 0 { return shim.Error("lifecycle scc must be invoked with arguments") @@ -238,7 +238,7 @@ func (scc *SCC) Invoke(stub shim.ChaincodeStubInterface) pb.Response { if err != nil { switch err.(type) { case ErrNamespaceNotDefined, persistence.CodePackageNotFoundErr: - return pb.Response{ + return &pb.Response{ Status: 404, Message: err.Error(), } diff --git a/core/chaincode/lifecycle/scc_test.go b/core/chaincode/lifecycle/scc_test.go index a4859232b33..fa443863d4d 100644 --- a/core/chaincode/lifecycle/scc_test.go +++ b/core/chaincode/lifecycle/scc_test.go @@ -11,11 +11,10 @@ import ( "encoding/gob" "fmt" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-chaincode-go/shim" - mspprotos "github.com/hyperledger/fabric-protos-go/msp" - pb "github.com/hyperledger/fabric-protos-go/peer" - lb "github.com/hyperledger/fabric-protos-go/peer/lifecycle" + "github.com/hyperledger/fabric-chaincode-go/v2/shim" + mspprotos "github.com/hyperledger/fabric-protos-go-apiv2/msp" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" + lb "github.com/hyperledger/fabric-protos-go-apiv2/peer/lifecycle" "github.com/hyperledger/fabric/common/chaincode" "github.com/hyperledger/fabric/common/channelconfig" "github.com/hyperledger/fabric/common/policydsl" @@ -29,6 +28,7 @@ import ( . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "github.com/pkg/errors" + "google.golang.org/protobuf/proto" ) var _ = Describe("SCC", func() { @@ -972,7 +972,7 @@ var _ = Describe("SCC", func() { chname, ccname, cd, pubState, orgStates := fakeSCCFuncs.CommitChaincodeDefinitionArgsForCall(0) Expect(chname).To(Equal("test-channel")) Expect(ccname).To(Equal("cc-name2")) - Expect(cd).To(Equal(&lifecycle.ChaincodeDefinition{ + etl := &lifecycle.ChaincodeDefinition{ Sequence: 7, EndorsementInfo: &lb.ChaincodeEndorsementInfo{ Version: "version-2+2", @@ -999,7 +999,11 @@ var _ = Describe("SCC", func() { }, }, }, - })) + } + Expect(cd.Sequence).To(Equal(etl.Sequence)) + Expect(cd.EndorsementInfo).To(ProtoEqual(etl.EndorsementInfo)) + Expect(cd.Collections).To(ProtoEqual(etl.Collections)) + Expect(cd.ValidationInfo).To(ProtoEqual(etl.ValidationInfo)) Expect(pubState).To(Equal(fakeStub)) Expect(len(orgStates)).To(Equal(2)) Expect(orgStates[0]).To(BeAssignableToTypeOf(&lifecycle.ChaincodePrivateLedgerShim{})) @@ -1245,7 +1249,7 @@ var _ = Describe("SCC", func() { Expect(ccname).To(Equal("name")) colls, ok := proto.Clone(arg.Collections).(*pb.CollectionConfigPackage) Expect(ok).To(BeTrue()) - Expect(cd).To(Equal(&lifecycle.ChaincodeDefinition{ + etl := &lifecycle.ChaincodeDefinition{ Sequence: 7, EndorsementInfo: &lb.ChaincodeEndorsementInfo{ Version: "version", @@ -1257,7 +1261,11 @@ var _ = Describe("SCC", func() { ValidationParameter: []byte("validation-parameter"), }, Collections: colls, - })) + } + Expect(cd.Sequence).To(Equal(etl.Sequence)) + Expect(cd.EndorsementInfo).To(ProtoEqual(etl.EndorsementInfo)) + Expect(cd.Collections).To(ProtoEqual(etl.Collections)) + Expect(cd.ValidationInfo).To(ProtoEqual(etl.ValidationInfo)) Expect(pubState).To(Equal(fakeStub)) Expect(orgStates).To(HaveLen(2)) Expect(orgStates[0]).To(BeAssignableToTypeOf(&lifecycle.ChaincodePrivateLedgerShim{})) diff --git a/core/chaincode/lifecycle/serializer.go b/core/chaincode/lifecycle/serializer.go index 5f1c77dbdd7..b65b7a0f640 100644 --- a/core/chaincode/lifecycle/serializer.go +++ b/core/chaincode/lifecycle/serializer.go @@ -11,11 +11,10 @@ import ( "fmt" "reflect" - lb "github.com/hyperledger/fabric-protos-go/peer/lifecycle" + lb "github.com/hyperledger/fabric-protos-go-apiv2/peer/lifecycle" "github.com/hyperledger/fabric/common/util" - - "github.com/golang/protobuf/proto" "github.com/pkg/errors" + "google.golang.org/protobuf/proto" ) const ( @@ -53,6 +52,9 @@ func (m Marshaler) Marshal(msg proto.Message) ([]byte, error) { if m != nil { return m(msg) } + if !msg.ProtoReflect().IsValid() { + return nil, errors.New("proto: Marshal called with nil") + } return proto.Marshal(msg) } diff --git a/core/chaincode/lifecycle/serializer_test.go b/core/chaincode/lifecycle/serializer_test.go index 832d2af091a..1c282b7ecc6 100644 --- a/core/chaincode/lifecycle/serializer_test.go +++ b/core/chaincode/lifecycle/serializer_test.go @@ -9,16 +9,15 @@ package lifecycle_test import ( "fmt" - . "github.com/hyperledger/fabric/internal/test" - . "github.com/onsi/ginkgo/v2" - . "github.com/onsi/gomega" - - "github.com/golang/protobuf/proto" - lb "github.com/hyperledger/fabric-protos-go/peer/lifecycle" + lb "github.com/hyperledger/fabric-protos-go-apiv2/peer/lifecycle" "github.com/hyperledger/fabric/common/util" "github.com/hyperledger/fabric/core/chaincode/lifecycle" "github.com/hyperledger/fabric/core/chaincode/lifecycle/mock" + . "github.com/hyperledger/fabric/internal/test" "github.com/hyperledger/fabric/protoutil" + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" + "google.golang.org/protobuf/proto" ) var _ = Describe("Serializer", func() { diff --git a/core/chaincode/mock/chaincode_stream.go b/core/chaincode/mock/chaincode_stream.go index ddefedadf20..71b80d3930b 100644 --- a/core/chaincode/mock/chaincode_stream.go +++ b/core/chaincode/mock/chaincode_stream.go @@ -4,7 +4,7 @@ package mock import ( "sync" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" ) type ChaincodeStream struct { diff --git a/core/chaincode/mock/collection_store.go b/core/chaincode/mock/collection_store.go index 37f8bb050b8..14329787136 100644 --- a/core/chaincode/mock/collection_store.go +++ b/core/chaincode/mock/collection_store.go @@ -4,7 +4,7 @@ package mock import ( "sync" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/core/common/privdata" "github.com/hyperledger/fabric/core/ledger" ) diff --git a/core/chaincode/mock/invoker.go b/core/chaincode/mock/invoker.go index ec356e61299..ca93d51dfba 100644 --- a/core/chaincode/mock/invoker.go +++ b/core/chaincode/mock/invoker.go @@ -4,7 +4,7 @@ package mock import ( "sync" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/core/common/ccprovider" ) diff --git a/core/chaincode/mock/mockccstream.go b/core/chaincode/mock/mockccstream.go index e498043030a..606cb967c78 100644 --- a/core/chaincode/mock/mockccstream.go +++ b/core/chaincode/mock/mockccstream.go @@ -11,7 +11,7 @@ import ( "sync" "time" - pb "github.com/hyperledger/fabric-protos-go/peer" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" ) // MockResponseSet is used for processing CC to Peer comm diff --git a/core/chaincode/mock/mockpeerccsupport.go b/core/chaincode/mock/mockpeerccsupport.go index 0f4a0a89fae..c336e235e68 100644 --- a/core/chaincode/mock/mockpeerccsupport.go +++ b/core/chaincode/mock/mockpeerccsupport.go @@ -9,7 +9,7 @@ package mock import ( "fmt" - pb "github.com/hyperledger/fabric-protos-go/peer" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" ) // MockPeerCCSupport provides CC support for peer interfaces. diff --git a/core/chaincode/mock/peer_ledger.go b/core/chaincode/mock/peer_ledger.go index 31c8838efbc..f283690d21e 100644 --- a/core/chaincode/mock/peer_ledger.go +++ b/core/chaincode/mock/peer_ledger.go @@ -4,8 +4,8 @@ package mock import ( "sync" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" ledgera "github.com/hyperledger/fabric/common/ledger" "github.com/hyperledger/fabric/core/ledger" ) diff --git a/core/chaincode/pending_query_result.go b/core/chaincode/pending_query_result.go index d434d7b8d36..1392bddeaf1 100644 --- a/core/chaincode/pending_query_result.go +++ b/core/chaincode/pending_query_result.go @@ -7,9 +7,10 @@ SPDX-License-Identifier: Apache-2.0 package chaincode import ( - "github.com/golang/protobuf/proto" - pb "github.com/hyperledger/fabric-protos-go/peer" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" commonledger "github.com/hyperledger/fabric/common/ledger" + "github.com/pkg/errors" + "google.golang.org/protobuf/proto" ) type PendingQueryResult struct { @@ -23,6 +24,11 @@ func (p *PendingQueryResult) Cut() []*pb.QueryResultBytes { } func (p *PendingQueryResult) Add(queryResult commonledger.QueryResult) error { + _, ok := queryResult.(proto.Message) + if !ok { + chaincodeLogger.Error("failed to marshal query result: proto is nil") + return errors.New("marshal-failed") + } queryResultBytes, err := proto.Marshal(queryResult.(proto.Message)) if err != nil { chaincodeLogger.Errorf("failed to marshal query result: %s", err) diff --git a/core/chaincode/pending_query_result_test.go b/core/chaincode/pending_query_result_test.go index 5d7f004fae7..eb2057e5cb1 100644 --- a/core/chaincode/pending_query_result_test.go +++ b/core/chaincode/pending_query_result_test.go @@ -9,12 +9,12 @@ package chaincode_test import ( "fmt" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/ledger/queryresult" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/queryresult" "github.com/hyperledger/fabric/core/chaincode" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "github.com/pkg/errors" + "google.golang.org/protobuf/proto" ) var _ = Describe("PendingQueryResult", func() { diff --git a/core/chaincode/persistence/chaincode_package.go b/core/chaincode/persistence/chaincode_package.go index ed10e52bd15..7bfcc2a224d 100644 --- a/core/chaincode/persistence/chaincode_package.go +++ b/core/chaincode/persistence/chaincode_package.go @@ -16,7 +16,7 @@ import ( "path/filepath" "regexp" - pb "github.com/hyperledger/fabric-protos-go/peer" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/pkg/errors" ) diff --git a/core/chaincode/persistence/chaincode_package_test.go b/core/chaincode/persistence/chaincode_package_test.go index 78373021bc0..e9ff8a3128a 100644 --- a/core/chaincode/persistence/chaincode_package_test.go +++ b/core/chaincode/persistence/chaincode_package_test.go @@ -10,7 +10,7 @@ import ( "io" "os" - pb "github.com/hyperledger/fabric-protos-go/peer" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/core/chaincode/persistence" "github.com/hyperledger/fabric/core/chaincode/persistence/mock" . "github.com/onsi/ginkgo/v2" diff --git a/core/chaincode/persistence/mock/legacy_cc_package_locator.go b/core/chaincode/persistence/mock/legacy_cc_package_locator.go index 92d14a6d2dc..d0a3de95c8a 100644 --- a/core/chaincode/persistence/mock/legacy_cc_package_locator.go +++ b/core/chaincode/persistence/mock/legacy_cc_package_locator.go @@ -4,7 +4,7 @@ package mock import ( "sync" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/core/chaincode/persistence" ) diff --git a/core/chaincode/platforms/golang/platform.go b/core/chaincode/platforms/golang/platform.go index 98184030e13..743507fb4ba 100644 --- a/core/chaincode/platforms/golang/platform.go +++ b/core/chaincode/platforms/golang/platform.go @@ -21,7 +21,7 @@ import ( "sort" "strings" - pb "github.com/hyperledger/fabric-protos-go/peer" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/core/chaincode/platforms/util" "github.com/hyperledger/fabric/internal/ccmetadata" "github.com/pkg/errors" diff --git a/core/chaincode/platforms/golang/platform_test.go b/core/chaincode/platforms/golang/platform_test.go index 41769cc2ea7..310b7ab05bf 100644 --- a/core/chaincode/platforms/golang/platform_test.go +++ b/core/chaincode/platforms/golang/platform_test.go @@ -18,7 +18,7 @@ import ( "strings" "testing" - pb "github.com/hyperledger/fabric-protos-go/peer" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/core/chaincode/platforms/util" "github.com/hyperledger/fabric/core/config/configtest" "github.com/pkg/errors" diff --git a/core/chaincode/platforms/java/platform.go b/core/chaincode/platforms/java/platform.go index b7105afd865..a929aa8f442 100644 --- a/core/chaincode/platforms/java/platform.go +++ b/core/chaincode/platforms/java/platform.go @@ -18,7 +18,7 @@ import ( "strings" "github.com/hyperledger/fabric-lib-go/common/flogging" - pb "github.com/hyperledger/fabric-protos-go/peer" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/core/chaincode/platforms/util" ) diff --git a/core/chaincode/platforms/java/platform_test.go b/core/chaincode/platforms/java/platform_test.go index f86363a8003..c288e96d628 100644 --- a/core/chaincode/platforms/java/platform_test.go +++ b/core/chaincode/platforms/java/platform_test.go @@ -17,7 +17,7 @@ import ( "testing" "time" - pb "github.com/hyperledger/fabric-protos-go/peer" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/core/chaincode/platforms/java" "github.com/hyperledger/fabric/core/chaincode/platforms/util" "github.com/hyperledger/fabric/core/config/configtest" diff --git a/core/chaincode/platforms/node/platform.go b/core/chaincode/platforms/node/platform.go index 233beecb094..be2521539cb 100644 --- a/core/chaincode/platforms/node/platform.go +++ b/core/chaincode/platforms/node/platform.go @@ -19,7 +19,7 @@ import ( "strings" "github.com/hyperledger/fabric-lib-go/common/flogging" - pb "github.com/hyperledger/fabric-protos-go/peer" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/core/chaincode/platforms/util" ) diff --git a/core/chaincode/query_response_generator.go b/core/chaincode/query_response_generator.go index c05d1fd3c3d..b4fef0146b7 100644 --- a/core/chaincode/query_response_generator.go +++ b/core/chaincode/query_response_generator.go @@ -7,9 +7,9 @@ SPDX-License-Identifier: Apache-2.0 package chaincode import ( - "github.com/golang/protobuf/proto" - pb "github.com/hyperledger/fabric-protos-go/peer" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" commonledger "github.com/hyperledger/fabric/common/ledger" + "google.golang.org/protobuf/proto" ) type QueryResponseGenerator struct { diff --git a/core/chaincode/query_response_generator_test.go b/core/chaincode/query_response_generator_test.go index 73886b23636..b0d1ba589a6 100644 --- a/core/chaincode/query_response_generator_test.go +++ b/core/chaincode/query_response_generator_test.go @@ -12,7 +12,7 @@ import ( "math" "testing" - "github.com/hyperledger/fabric-protos-go/ledger/queryresult" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/queryresult" "github.com/hyperledger/fabric/core/chaincode" "github.com/hyperledger/fabric/core/chaincode/mock" "github.com/stretchr/testify/require" diff --git a/core/chaincode/testdata/src/chaincodes/init_private_data/init_private_data.go b/core/chaincode/testdata/src/chaincodes/init_private_data/init_private_data.go index 7202d51a67d..2bf0c7f9763 100644 --- a/core/chaincode/testdata/src/chaincodes/init_private_data/init_private_data.go +++ b/core/chaincode/testdata/src/chaincodes/init_private_data/init_private_data.go @@ -9,8 +9,8 @@ package main import ( "fmt" - "github.com/hyperledger/fabric-chaincode-go/shim" - pb "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-chaincode-go/v2/shim" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" ) // SimpleChaincode example simple Chaincode implementation @@ -18,7 +18,7 @@ type SimpleChaincode struct { } // Init initializes a private state -func (t *SimpleChaincode) Init(stub shim.ChaincodeStubInterface) pb.Response { +func (t *SimpleChaincode) Init(stub shim.ChaincodeStubInterface) *pb.Response { if err := stub.PutPrivateData("dummyColl", "dummyKey", []byte("dummyValue")); err != nil { return shim.Error(fmt.Sprintf("put operation failed. Error storing state: %s", err)) } @@ -26,7 +26,7 @@ func (t *SimpleChaincode) Init(stub shim.ChaincodeStubInterface) pb.Response { } // Invoke is a no-op -func (t *SimpleChaincode) Invoke(stub shim.ChaincodeStubInterface) pb.Response { +func (t *SimpleChaincode) Invoke(stub shim.ChaincodeStubInterface) *pb.Response { return shim.Success(nil) } diff --git a/core/chaincode/testdata/src/chaincodes/init_public_data/init_public_data.go b/core/chaincode/testdata/src/chaincodes/init_public_data/init_public_data.go index eceecf9465b..7e145e8dc96 100644 --- a/core/chaincode/testdata/src/chaincodes/init_public_data/init_public_data.go +++ b/core/chaincode/testdata/src/chaincodes/init_public_data/init_public_data.go @@ -9,8 +9,8 @@ package main import ( "fmt" - "github.com/hyperledger/fabric-chaincode-go/shim" - pb "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-chaincode-go/v2/shim" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" ) // SimpleChaincode example simple Chaincode implementation @@ -18,7 +18,7 @@ type SimpleChaincode struct { } // Init initializes a public state -func (t *SimpleChaincode) Init(stub shim.ChaincodeStubInterface) pb.Response { +func (t *SimpleChaincode) Init(stub shim.ChaincodeStubInterface) *pb.Response { if err := stub.PutState("dummyKey", []byte("dummyValue")); err != nil { return shim.Error(fmt.Sprintf("put operation failed. Error storing state: %s", err)) } @@ -26,7 +26,7 @@ func (t *SimpleChaincode) Init(stub shim.ChaincodeStubInterface) pb.Response { } // Invoke is a no-op -func (t *SimpleChaincode) Invoke(stub shim.ChaincodeStubInterface) pb.Response { +func (t *SimpleChaincode) Invoke(stub shim.ChaincodeStubInterface) *pb.Response { return shim.Success(nil) } diff --git a/core/chaincode/testdata/src/chaincodes/map/map.go b/core/chaincode/testdata/src/chaincodes/map/map.go index 61bc74ba00d..d7ae6db6048 100644 --- a/core/chaincode/testdata/src/chaincodes/map/map.go +++ b/core/chaincode/testdata/src/chaincodes/map/map.go @@ -12,8 +12,8 @@ import ( "strconv" "time" - "github.com/hyperledger/fabric-chaincode-go/shim" - pb "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-chaincode-go/v2/shim" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" ) // This chaincode implements a simple map that is stored in the state. @@ -35,14 +35,14 @@ type PageResponse struct { } // Init is a no-op -func (t *SimpleChaincode) Init(stub shim.ChaincodeStubInterface) pb.Response { +func (t *SimpleChaincode) Init(stub shim.ChaincodeStubInterface) *pb.Response { return shim.Success(nil) } // Invoke has two functions // put - takes two arguments, a key and value, and stores them in the state // remove - takes one argument, a key, and removes if from the state -func (t *SimpleChaincode) Invoke(stub shim.ChaincodeStubInterface) pb.Response { +func (t *SimpleChaincode) Invoke(stub shim.ChaincodeStubInterface) *pb.Response { function, args := stub.GetFunctionAndParameters() switch function { @@ -96,7 +96,7 @@ func (t *SimpleChaincode) Invoke(stub shim.ChaincodeStubInterface) pb.Response { } } -func (t *SimpleChaincode) putPrivate(stub shim.ChaincodeStubInterface, args []string) pb.Response { +func (t *SimpleChaincode) putPrivate(stub shim.ChaincodeStubInterface, args []string) *pb.Response { if len(args) < 3 { return shim.Error("put operation on private data must include three arguments: [collection, key, value]") } @@ -111,7 +111,7 @@ func (t *SimpleChaincode) putPrivate(stub shim.ChaincodeStubInterface, args []st return shim.Success(nil) } -func (t *SimpleChaincode) removePrivate(stub shim.ChaincodeStubInterface, args []string) pb.Response { +func (t *SimpleChaincode) removePrivate(stub shim.ChaincodeStubInterface, args []string) *pb.Response { if len(args) < 2 { return shim.Error("remove operation on private data must include two arguments: [collection, key]") } @@ -124,7 +124,7 @@ func (t *SimpleChaincode) removePrivate(stub shim.ChaincodeStubInterface, args [ } return shim.Success(nil) } -func (t *SimpleChaincode) getPrivate(stub shim.ChaincodeStubInterface, args []string) pb.Response { +func (t *SimpleChaincode) getPrivate(stub shim.ChaincodeStubInterface, args []string) *pb.Response { if len(args) < 2 { return shim.Error("get operation on private data must include two arguments: [collection, key]") } @@ -138,7 +138,7 @@ func (t *SimpleChaincode) getPrivate(stub shim.ChaincodeStubInterface, args []st return shim.Success(jsonVal) } -func (t *SimpleChaincode) keysPrivate(stub shim.ChaincodeStubInterface, args []string) pb.Response { +func (t *SimpleChaincode) keysPrivate(stub shim.ChaincodeStubInterface, args []string) *pb.Response { if len(args) < 3 { return shim.Error("range query operation on private data must include three arguments, a collection, key and value") } @@ -146,7 +146,7 @@ func (t *SimpleChaincode) keysPrivate(stub shim.ChaincodeStubInterface, args []s startKey := args[1] endKey := args[2] - //sleep needed to test peer's timeout behavior when using iterators + // sleep needed to test peer's timeout behavior when using iterators stime := 0 if len(args) > 3 { stime, _ = strconv.Atoi(args[3]) @@ -160,7 +160,7 @@ func (t *SimpleChaincode) keysPrivate(stub shim.ChaincodeStubInterface, args []s var keys []string for keysIter.HasNext() { - //if sleeptime is specied, take a nap + // if sleeptime is specied, take a nap if stime > 0 { time.Sleep(time.Duration(stime) * time.Millisecond) } @@ -184,7 +184,7 @@ func (t *SimpleChaincode) keysPrivate(stub shim.ChaincodeStubInterface, args []s return shim.Success(jsonKeys) } -func (t *SimpleChaincode) queryPrivate(stub shim.ChaincodeStubInterface, args []string) pb.Response { +func (t *SimpleChaincode) queryPrivate(stub shim.ChaincodeStubInterface, args []string) *pb.Response { collection := args[0] query := args[1] keysIter, err := stub.GetPrivateDataQueryResult(collection, query) @@ -209,7 +209,7 @@ func (t *SimpleChaincode) queryPrivate(stub shim.ChaincodeStubInterface, args [] return shim.Success(jsonKeys) } -func (t *SimpleChaincode) put(stub shim.ChaincodeStubInterface, args []string) pb.Response { +func (t *SimpleChaincode) put(stub shim.ChaincodeStubInterface, args []string) *pb.Response { if len(args) < 2 { return shim.Error("put operation must include two arguments: [key, value]") } @@ -235,7 +235,7 @@ func (t *SimpleChaincode) put(stub shim.ChaincodeStubInterface, args []string) p return shim.Success(nil) } -func (t *SimpleChaincode) remove(stub shim.ChaincodeStubInterface, args []string) pb.Response { +func (t *SimpleChaincode) remove(stub shim.ChaincodeStubInterface, args []string) *pb.Response { if len(args) < 1 { return shim.Error("remove operation must include one argument: [key]") } @@ -247,7 +247,7 @@ func (t *SimpleChaincode) remove(stub shim.ChaincodeStubInterface, args []string } return shim.Success(nil) } -func (t *SimpleChaincode) get(stub shim.ChaincodeStubInterface, args []string) pb.Response { +func (t *SimpleChaincode) get(stub shim.ChaincodeStubInterface, args []string) *pb.Response { if len(args) < 1 { return shim.Error("get operation must include one argument, a key") } @@ -259,14 +259,14 @@ func (t *SimpleChaincode) get(stub shim.ChaincodeStubInterface, args []string) p jsonVal, err := json.Marshal(string(value)) return shim.Success(jsonVal) } -func (t *SimpleChaincode) keys(stub shim.ChaincodeStubInterface, args []string) pb.Response { +func (t *SimpleChaincode) keys(stub shim.ChaincodeStubInterface, args []string) *pb.Response { if len(args) < 2 { return shim.Error("keys operation must include two arguments, a key and value") } startKey := args[0] endKey := args[1] - //sleep needed to test peer's timeout behavior when using iterators + // sleep needed to test peer's timeout behavior when using iterators stime := 0 if len(args) > 2 { stime, _ = strconv.Atoi(args[2]) @@ -280,7 +280,7 @@ func (t *SimpleChaincode) keys(stub shim.ChaincodeStubInterface, args []string) var keys []string for keysIter.HasNext() { - //if sleeptime is specied, take a nap + // if sleeptime is specied, take a nap if stime > 0 { time.Sleep(time.Duration(stime) * time.Millisecond) } @@ -304,7 +304,7 @@ func (t *SimpleChaincode) keys(stub shim.ChaincodeStubInterface, args []string) return shim.Success(jsonKeys) } -func (t *SimpleChaincode) keysByPage(stub shim.ChaincodeStubInterface, args []string) pb.Response { +func (t *SimpleChaincode) keysByPage(stub shim.ChaincodeStubInterface, args []string) *pb.Response { if len(args) < 4 { return shim.Error("paginated range query operation must include four arguments, a key, value, pageSize and a bookmark") } @@ -316,7 +316,7 @@ func (t *SimpleChaincode) keysByPage(stub shim.ChaincodeStubInterface, args []st } bookmark := args[3] - //sleep needed to test peer's timeout behavior when using iterators + // sleep needed to test peer's timeout behavior when using iterators stime := 0 if len(args) > 4 { stime, _ = strconv.Atoi(args[4]) @@ -330,7 +330,7 @@ func (t *SimpleChaincode) keysByPage(stub shim.ChaincodeStubInterface, args []st var keys []string for keysIter.HasNext() { - //if sleeptime is specied, take a nap + // if sleeptime is specied, take a nap if stime > 0 { time.Sleep(time.Duration(stime) * time.Millisecond) } @@ -358,7 +358,7 @@ func (t *SimpleChaincode) keysByPage(stub shim.ChaincodeStubInterface, args []st return shim.Success(queryResp) } -func (t *SimpleChaincode) query(stub shim.ChaincodeStubInterface, args []string) pb.Response { +func (t *SimpleChaincode) query(stub shim.ChaincodeStubInterface, args []string) *pb.Response { query := args[0] keysIter, err := stub.GetQueryResult(query) if err != nil { @@ -382,7 +382,7 @@ func (t *SimpleChaincode) query(stub shim.ChaincodeStubInterface, args []string) return shim.Success(jsonKeys) } -func (t *SimpleChaincode) queryByPage(stub shim.ChaincodeStubInterface, args []string) pb.Response { +func (t *SimpleChaincode) queryByPage(stub shim.ChaincodeStubInterface, args []string) *pb.Response { query := args[0] pageSize, parserr := strconv.ParseInt(args[1], 10, 32) if parserr != nil { @@ -421,7 +421,7 @@ func (t *SimpleChaincode) queryByPage(stub shim.ChaincodeStubInterface, args []s return shim.Success(queryResp) } -func (t *SimpleChaincode) history(stub shim.ChaincodeStubInterface, args []string) pb.Response { +func (t *SimpleChaincode) history(stub shim.ChaincodeStubInterface, args []string) *pb.Response { key := args[0] keysIter, err := stub.GetHistoryForKey(key) if err != nil { @@ -449,11 +449,11 @@ func (t *SimpleChaincode) history(stub shim.ChaincodeStubInterface, args []strin return shim.Success(jsonKeys) } -func (t *SimpleChaincode) getPut(stub shim.ChaincodeStubInterface, args []string) pb.Response { +func (t *SimpleChaincode) getPut(stub shim.ChaincodeStubInterface, args []string) *pb.Response { _ = t.get(stub, args) return t.put(stub, args) } -func (t *SimpleChaincode) getPutPrivate(stub shim.ChaincodeStubInterface, args []string) pb.Response { +func (t *SimpleChaincode) getPutPrivate(stub shim.ChaincodeStubInterface, args []string) *pb.Response { _ = t.getPrivate(stub, args) return t.putPrivate(stub, args) } diff --git a/core/chaincode/transaction_context.go b/core/chaincode/transaction_context.go index 766939665bc..09cc2b37a2b 100644 --- a/core/chaincode/transaction_context.go +++ b/core/chaincode/transaction_context.go @@ -9,7 +9,7 @@ package chaincode import ( "sync" - pb "github.com/hyperledger/fabric-protos-go/peer" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" commonledger "github.com/hyperledger/fabric/common/ledger" "github.com/hyperledger/fabric/core/common/privdata" "github.com/hyperledger/fabric/core/ledger" diff --git a/core/chaincode/transaction_contexts.go b/core/chaincode/transaction_contexts.go index 977ebc69211..3d540b4d455 100644 --- a/core/chaincode/transaction_contexts.go +++ b/core/chaincode/transaction_contexts.go @@ -9,7 +9,7 @@ package chaincode import ( "sync" - pb "github.com/hyperledger/fabric-protos-go/peer" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" commonledger "github.com/hyperledger/fabric/common/ledger" "github.com/hyperledger/fabric/core/common/ccprovider" "github.com/pkg/errors" diff --git a/core/chaincode/transaction_contexts_test.go b/core/chaincode/transaction_contexts_test.go index 91e08fe3c6f..883a00528ec 100644 --- a/core/chaincode/transaction_contexts_test.go +++ b/core/chaincode/transaction_contexts_test.go @@ -7,7 +7,7 @@ SPDX-License-Identifier: Apache-2.0 package chaincode_test import ( - pb "github.com/hyperledger/fabric-protos-go/peer" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/core/chaincode" "github.com/hyperledger/fabric/core/chaincode/mock" "github.com/hyperledger/fabric/core/common/ccprovider" diff --git a/core/committer/committer.go b/core/committer/committer.go index d78a1724d10..67317d4a1c2 100644 --- a/core/committer/committer.go +++ b/core/committer/committer.go @@ -17,7 +17,7 @@ limitations under the License. package committer import ( - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/core/ledger" ) diff --git a/core/committer/committer_impl.go b/core/committer/committer_impl.go index 074ec49e42d..fa2daa66be3 100644 --- a/core/committer/committer_impl.go +++ b/core/committer/committer_impl.go @@ -8,13 +8,13 @@ package committer import ( "github.com/hyperledger/fabric-lib-go/common/flogging" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/core/ledger" ) var logger = flogging.MustGetLogger("committer") -//--------!!!IMPORTANT!!-!!IMPORTANT!!-!!IMPORTANT!!--------- +// --------!!!IMPORTANT!!-!!IMPORTANT!!-!!IMPORTANT!!--------- // This is used merely to complete the loop for the "skeleton" // path so we can reason about and modify committer component // more effectively using code. diff --git a/core/committer/committer_test.go b/core/committer/committer_test.go index dafc65bbffe..f5f1881475d 100644 --- a/core/committer/committer_test.go +++ b/core/committer/committer_test.go @@ -9,8 +9,8 @@ package committer import ( "testing" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/configtx/test" "github.com/hyperledger/fabric/common/ledger" "github.com/hyperledger/fabric/common/ledger/testutil" diff --git a/core/committer/txvalidator/mocks/validator.go b/core/committer/txvalidator/mocks/validator.go index 6c9d83432c5..b2ec29e1dd5 100644 --- a/core/committer/txvalidator/mocks/validator.go +++ b/core/committer/txvalidator/mocks/validator.go @@ -3,7 +3,7 @@ package mocks import ( - common "github.com/hyperledger/fabric-protos-go/common" + common "github.com/hyperledger/fabric-protos-go-apiv2/common" mock "github.com/stretchr/testify/mock" ) diff --git a/core/committer/txvalidator/router.go b/core/committer/txvalidator/router.go index c3d1e652498..7a26ae1ed8f 100644 --- a/core/committer/txvalidator/router.go +++ b/core/committer/txvalidator/router.go @@ -7,7 +7,7 @@ SPDX-License-Identifier: Apache-2.0 package txvalidator import ( - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/common/channelconfig" ) diff --git a/core/committer/txvalidator/v14/mocks/identity_deserializer.go b/core/committer/txvalidator/v14/mocks/identity_deserializer.go index 5ad63c62d0d..49d909a8ba3 100644 --- a/core/committer/txvalidator/v14/mocks/identity_deserializer.go +++ b/core/committer/txvalidator/v14/mocks/identity_deserializer.go @@ -3,7 +3,7 @@ package mocks import ( - fabric_protos_gomsp "github.com/hyperledger/fabric-protos-go/msp" + fabric_protos_gomsp "github.com/hyperledger/fabric-protos-go-apiv2/msp" mock "github.com/stretchr/testify/mock" msp "github.com/hyperledger/fabric/msp" diff --git a/core/committer/txvalidator/v14/mocks/plugin.go b/core/committer/txvalidator/v14/mocks/plugin.go index bf98f92e2ae..fd5b093448e 100644 --- a/core/committer/txvalidator/v14/mocks/plugin.go +++ b/core/committer/txvalidator/v14/mocks/plugin.go @@ -3,7 +3,7 @@ package mocks import ( - common "github.com/hyperledger/fabric-protos-go/common" + common "github.com/hyperledger/fabric-protos-go-apiv2/common" mock "github.com/stretchr/testify/mock" validation "github.com/hyperledger/fabric/core/handlers/validation/api" diff --git a/core/committer/txvalidator/v14/plugin_validator.go b/core/committer/txvalidator/v14/plugin_validator.go index 9957c95f6af..b9dff9286f0 100644 --- a/core/committer/txvalidator/v14/plugin_validator.go +++ b/core/committer/txvalidator/v14/plugin_validator.go @@ -10,7 +10,7 @@ import ( "fmt" "sync" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/common/cauthdsl" ledger2 "github.com/hyperledger/fabric/common/ledger" vp "github.com/hyperledger/fabric/core/committer/txvalidator/plugin" diff --git a/core/committer/txvalidator/v14/plugin_validator_test.go b/core/committer/txvalidator/v14/plugin_validator_test.go index aaf8fdbab12..6c29c7bc951 100644 --- a/core/committer/txvalidator/v14/plugin_validator_test.go +++ b/core/committer/txvalidator/v14/plugin_validator_test.go @@ -9,8 +9,7 @@ package txvalidator_test import ( "testing" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/common/policydsl" tmocks "github.com/hyperledger/fabric/core/committer/txvalidator/mocks" "github.com/hyperledger/fabric/core/committer/txvalidator/plugin" @@ -23,6 +22,7 @@ import ( "github.com/pkg/errors" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) func TestValidateWithPlugin(t *testing.T) { diff --git a/core/committer/txvalidator/v14/testdata/test_plugin.go b/core/committer/txvalidator/v14/testdata/test_plugin.go index 5d5495dbaa9..76f40b6b835 100644 --- a/core/committer/txvalidator/v14/testdata/test_plugin.go +++ b/core/committer/txvalidator/v14/testdata/test_plugin.go @@ -9,8 +9,7 @@ package testdata import ( "testing" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" validation "github.com/hyperledger/fabric/core/handlers/validation/api" . "github.com/hyperledger/fabric/core/handlers/validation/api/capabilities" . "github.com/hyperledger/fabric/core/handlers/validation/api/identities" @@ -19,6 +18,7 @@ import ( "github.com/hyperledger/fabric/protoutil" "github.com/pkg/errors" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) // SampleValidationPlugin is an example for a validation plugin, diff --git a/core/committer/txvalidator/v14/testdata/test_plugin.pb.go b/core/committer/txvalidator/v14/testdata/test_plugin.pb.go index 15c176c42f8..2576d595456 100644 --- a/core/committer/txvalidator/v14/testdata/test_plugin.pb.go +++ b/core/committer/txvalidator/v14/testdata/test_plugin.pb.go @@ -1,98 +1,171 @@ +// +//Copyright IBM Corp. All Rights Reserved. +//SPDX-License-Identifier: Apache-2.0 + // Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.34.2 +// protoc v5.27.3 // source: test_plugin.proto package testdata import ( - fmt "fmt" - proto "github.com/golang/protobuf/proto" - math "math" -) + reflect "reflect" + sync "sync" -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" +) -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) type MarshaledSignedData struct { - Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` - Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` - Identity []byte `protobuf:"bytes,3,opt,name=identity,proto3" json:"identity,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *MarshaledSignedData) Reset() { *m = MarshaledSignedData{} } -func (m *MarshaledSignedData) String() string { return proto.CompactTextString(m) } -func (*MarshaledSignedData) ProtoMessage() {} -func (*MarshaledSignedData) Descriptor() ([]byte, []int) { - return fileDescriptor_65f5abc8dfb3e1dd, []int{0} + Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` + Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` + Identity []byte `protobuf:"bytes,3,opt,name=identity,proto3" json:"identity,omitempty"` } -func (m *MarshaledSignedData) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MarshaledSignedData.Unmarshal(m, b) -} -func (m *MarshaledSignedData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MarshaledSignedData.Marshal(b, m, deterministic) -} -func (m *MarshaledSignedData) XXX_Merge(src proto.Message) { - xxx_messageInfo_MarshaledSignedData.Merge(m, src) +func (x *MarshaledSignedData) Reset() { + *x = MarshaledSignedData{} + if protoimpl.UnsafeEnabled { + mi := &file_test_plugin_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *MarshaledSignedData) XXX_Size() int { - return xxx_messageInfo_MarshaledSignedData.Size(m) + +func (x *MarshaledSignedData) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *MarshaledSignedData) XXX_DiscardUnknown() { - xxx_messageInfo_MarshaledSignedData.DiscardUnknown(m) + +func (*MarshaledSignedData) ProtoMessage() {} + +func (x *MarshaledSignedData) ProtoReflect() protoreflect.Message { + mi := &file_test_plugin_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_MarshaledSignedData proto.InternalMessageInfo +// Deprecated: Use MarshaledSignedData.ProtoReflect.Descriptor instead. +func (*MarshaledSignedData) Descriptor() ([]byte, []int) { + return file_test_plugin_proto_rawDescGZIP(), []int{0} +} -func (m *MarshaledSignedData) GetData() []byte { - if m != nil { - return m.Data +func (x *MarshaledSignedData) GetData() []byte { + if x != nil { + return x.Data } return nil } -func (m *MarshaledSignedData) GetSignature() []byte { - if m != nil { - return m.Signature +func (x *MarshaledSignedData) GetSignature() []byte { + if x != nil { + return x.Signature } return nil } -func (m *MarshaledSignedData) GetIdentity() []byte { - if m != nil { - return m.Identity +func (x *MarshaledSignedData) GetIdentity() []byte { + if x != nil { + return x.Identity } return nil } -func init() { - proto.RegisterType((*MarshaledSignedData)(nil), "testdata.MarshaledSignedData") +var File_test_plugin_proto protoreflect.FileDescriptor + +var file_test_plugin_proto_rawDesc = []byte{ + 0x0a, 0x11, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x12, 0x08, 0x74, 0x65, 0x73, 0x74, 0x64, 0x61, 0x74, 0x61, 0x22, 0x63, 0x0a, + 0x13, 0x4d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x64, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, + 0x44, 0x61, 0x74, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, + 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x69, 0x67, + 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, + 0x74, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, + 0x74, 0x79, 0x42, 0x47, 0x5a, 0x45, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2f, 0x66, 0x61, 0x62, + 0x72, 0x69, 0x63, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, + 0x65, 0x72, 0x2f, 0x74, 0x78, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x76, + 0x31, 0x34, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x64, 0x61, 0x74, 0x61, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, +} + +var ( + file_test_plugin_proto_rawDescOnce sync.Once + file_test_plugin_proto_rawDescData = file_test_plugin_proto_rawDesc +) + +func file_test_plugin_proto_rawDescGZIP() []byte { + file_test_plugin_proto_rawDescOnce.Do(func() { + file_test_plugin_proto_rawDescData = protoimpl.X.CompressGZIP(file_test_plugin_proto_rawDescData) + }) + return file_test_plugin_proto_rawDescData +} + +var file_test_plugin_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_test_plugin_proto_goTypes = []any{ + (*MarshaledSignedData)(nil), // 0: testdata.MarshaledSignedData +} +var file_test_plugin_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name } -func init() { proto.RegisterFile("test_plugin.proto", fileDescriptor_65f5abc8dfb3e1dd) } - -var fileDescriptor_65f5abc8dfb3e1dd = []byte{ - // 191 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x44, 0x8e, 0x31, 0x6b, 0xc3, 0x30, - 0x10, 0x46, 0x71, 0x5b, 0x8a, 0x2b, 0xba, 0x54, 0x5d, 0x4c, 0xe9, 0x50, 0x3a, 0x75, 0xb2, 0x28, - 0xed, 0x2f, 0x28, 0x0d, 0x99, 0xb2, 0x24, 0x5b, 0x96, 0x70, 0x96, 0x2e, 0xf2, 0x81, 0x2c, 0x99, - 0xf3, 0xd9, 0xc4, 0xff, 0x3e, 0x58, 0x90, 0x64, 0xfb, 0xbe, 0xf7, 0x96, 0xa7, 0x5e, 0x04, 0x07, - 0x39, 0xf4, 0x61, 0xf4, 0x14, 0xeb, 0x9e, 0x93, 0x24, 0x5d, 0x2e, 0xc8, 0x81, 0xc0, 0xa7, 0x55, - 0xaf, 0x1b, 0xe0, 0xa1, 0x85, 0x80, 0x6e, 0x47, 0x3e, 0xa2, 0xfb, 0x07, 0x01, 0xad, 0xd5, 0xc3, - 0xa2, 0xab, 0xe2, 0xa3, 0xf8, 0x7a, 0xde, 0xe6, 0xad, 0xdf, 0xd5, 0xd3, 0x40, 0x3e, 0x82, 0x8c, - 0x8c, 0xd5, 0x5d, 0x16, 0x37, 0xa0, 0xdf, 0x54, 0x49, 0x0e, 0xa3, 0x90, 0xcc, 0xd5, 0x7d, 0x96, - 0xd7, 0xff, 0xb7, 0xde, 0xaf, 0x3c, 0x49, 0x3b, 0x36, 0xb5, 0x4d, 0x9d, 0x69, 0xe7, 0x1e, 0x39, - 0xa0, 0xf3, 0xc8, 0xe6, 0x08, 0x0d, 0x93, 0x35, 0x36, 0x31, 0x1a, 0x9b, 0xba, 0x8e, 0x44, 0x90, - 0x8d, 0x9c, 0x26, 0x08, 0xe4, 0x40, 0x12, 0x9b, 0xe9, 0xfb, 0xd7, 0x5c, 0x6a, 0x9b, 0xc7, 0x9c, - 0xff, 0x73, 0x0e, 0x00, 0x00, 0xff, 0xff, 0x64, 0xb2, 0x7a, 0x4a, 0xd3, 0x00, 0x00, 0x00, +func init() { file_test_plugin_proto_init() } +func file_test_plugin_proto_init() { + if File_test_plugin_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_test_plugin_proto_msgTypes[0].Exporter = func(v any, i int) any { + switch v := v.(*MarshaledSignedData); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_test_plugin_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_test_plugin_proto_goTypes, + DependencyIndexes: file_test_plugin_proto_depIdxs, + MessageInfos: file_test_plugin_proto_msgTypes, + }.Build() + File_test_plugin_proto = out.File + file_test_plugin_proto_rawDesc = nil + file_test_plugin_proto_goTypes = nil + file_test_plugin_proto_depIdxs = nil } diff --git a/core/committer/txvalidator/v14/txvalidator_test.go b/core/committer/txvalidator/v14/txvalidator_test.go index d58f881586b..e418f3b1381 100644 --- a/core/committer/txvalidator/v14/txvalidator_test.go +++ b/core/committer/txvalidator/v14/txvalidator_test.go @@ -9,10 +9,9 @@ package txvalidator import ( "testing" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/bccsp/sw" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/configtx/test" "github.com/hyperledger/fabric/common/ledger/testutil" "github.com/hyperledger/fabric/common/semaphore" @@ -30,6 +29,7 @@ import ( msptesttools "github.com/hyperledger/fabric/msp/mgmt/testtools" "github.com/hyperledger/fabric/protoutil" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) func testValidationWithNTXes(t *testing.T, ledger ledger2.PeerLedger, gbHash []byte, nBlocks int) { diff --git a/core/committer/txvalidator/v14/validator.go b/core/committer/txvalidator/v14/validator.go index fef54c4c2f9..290c92b5182 100644 --- a/core/committer/txvalidator/v14/validator.go +++ b/core/committer/txvalidator/v14/validator.go @@ -11,12 +11,11 @@ import ( "fmt" "time" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/bccsp" "github.com/hyperledger/fabric-lib-go/common/flogging" - "github.com/hyperledger/fabric-protos-go/common" - mspprotos "github.com/hyperledger/fabric-protos-go/msp" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + mspprotos "github.com/hyperledger/fabric-protos-go-apiv2/msp" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/channelconfig" "github.com/hyperledger/fabric/common/configtx" commonerrors "github.com/hyperledger/fabric/common/errors" @@ -28,6 +27,7 @@ import ( "github.com/hyperledger/fabric/msp" "github.com/hyperledger/fabric/protoutil" "github.com/pkg/errors" + "google.golang.org/protobuf/proto" ) // Semaphore provides to the validator means for synchronisation diff --git a/core/committer/txvalidator/v14/validator_test.go b/core/committer/txvalidator/v14/validator_test.go index 4f9ea7e76c6..9b6696e6a98 100644 --- a/core/committer/txvalidator/v14/validator_test.go +++ b/core/committer/txvalidator/v14/validator_test.go @@ -15,11 +15,11 @@ import ( "time" "github.com/hyperledger/fabric-lib-go/bccsp/sw" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/ledger/rwset" - "github.com/hyperledger/fabric-protos-go/ledger/rwset/kvrwset" - mb "github.com/hyperledger/fabric-protos-go/msp" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset/kvrwset" + mb "github.com/hyperledger/fabric-protos-go-apiv2/msp" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" ctxt "github.com/hyperledger/fabric/common/configtx/test" commonerrors "github.com/hyperledger/fabric/common/errors" ledger2 "github.com/hyperledger/fabric/common/ledger" diff --git a/core/committer/txvalidator/v14/vscc_validator.go b/core/committer/txvalidator/v14/vscc_validator.go index 2e23a7abcb3..073998e91ee 100644 --- a/core/committer/txvalidator/v14/vscc_validator.go +++ b/core/committer/txvalidator/v14/vscc_validator.go @@ -9,9 +9,8 @@ package txvalidator import ( "fmt" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" commonerrors "github.com/hyperledger/fabric/common/errors" "github.com/hyperledger/fabric/common/policydsl" "github.com/hyperledger/fabric/core/common/ccprovider" @@ -20,6 +19,7 @@ import ( "github.com/hyperledger/fabric/core/ledger/kvledger/txmgmt/rwsetutil" "github.com/hyperledger/fabric/protoutil" "github.com/pkg/errors" + "google.golang.org/protobuf/proto" ) // VsccValidatorImpl is the implementation used to call diff --git a/core/committer/txvalidator/v20/mocks/channel_resources.go b/core/committer/txvalidator/v20/mocks/channel_resources.go index 644f9e8746f..31f8d2aca31 100644 --- a/core/committer/txvalidator/v20/mocks/channel_resources.go +++ b/core/committer/txvalidator/v20/mocks/channel_resources.go @@ -3,7 +3,7 @@ package mocks import ( - common "github.com/hyperledger/fabric-protos-go/common" + common "github.com/hyperledger/fabric-protos-go-apiv2/common" channelconfig "github.com/hyperledger/fabric/common/channelconfig" mock "github.com/stretchr/testify/mock" diff --git a/core/committer/txvalidator/v20/mocks/dispatcher.go b/core/committer/txvalidator/v20/mocks/dispatcher.go index e229f521c9e..ab384679a47 100644 --- a/core/committer/txvalidator/v20/mocks/dispatcher.go +++ b/core/committer/txvalidator/v20/mocks/dispatcher.go @@ -3,10 +3,10 @@ package mocks import ( - common "github.com/hyperledger/fabric-protos-go/common" + common "github.com/hyperledger/fabric-protos-go-apiv2/common" mock "github.com/stretchr/testify/mock" - peer "github.com/hyperledger/fabric-protos-go/peer" + peer "github.com/hyperledger/fabric-protos-go-apiv2/peer" ) // Dispatcher is an autogenerated mock type for the Dispatcher type diff --git a/core/committer/txvalidator/v20/plugindispatcher/dispatcher.go b/core/committer/txvalidator/v20/plugindispatcher/dispatcher.go index 474f333737f..c7cce7602a8 100644 --- a/core/committer/txvalidator/v20/plugindispatcher/dispatcher.go +++ b/core/committer/txvalidator/v20/plugindispatcher/dispatcher.go @@ -9,10 +9,9 @@ package plugindispatcher import ( "fmt" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/common/flogging" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" commonerrors "github.com/hyperledger/fabric/common/errors" validation "github.com/hyperledger/fabric/core/handlers/validation/api" s "github.com/hyperledger/fabric/core/handlers/validation/api/state" @@ -20,6 +19,7 @@ import ( "github.com/hyperledger/fabric/core/ledger/kvledger/txmgmt/rwsetutil" "github.com/hyperledger/fabric/protoutil" "github.com/pkg/errors" + "google.golang.org/protobuf/proto" ) // ChannelResources provides access to channel artefacts or diff --git a/core/committer/txvalidator/v20/plugindispatcher/mocks/identity_deserializer.go b/core/committer/txvalidator/v20/plugindispatcher/mocks/identity_deserializer.go index 5ad63c62d0d..49d909a8ba3 100644 --- a/core/committer/txvalidator/v20/plugindispatcher/mocks/identity_deserializer.go +++ b/core/committer/txvalidator/v20/plugindispatcher/mocks/identity_deserializer.go @@ -3,7 +3,7 @@ package mocks import ( - fabric_protos_gomsp "github.com/hyperledger/fabric-protos-go/msp" + fabric_protos_gomsp "github.com/hyperledger/fabric-protos-go-apiv2/msp" mock "github.com/stretchr/testify/mock" msp "github.com/hyperledger/fabric/msp" diff --git a/core/committer/txvalidator/v20/plugindispatcher/mocks/plugin.go b/core/committer/txvalidator/v20/plugindispatcher/mocks/plugin.go index bf98f92e2ae..fd5b093448e 100644 --- a/core/committer/txvalidator/v20/plugindispatcher/mocks/plugin.go +++ b/core/committer/txvalidator/v20/plugindispatcher/mocks/plugin.go @@ -3,7 +3,7 @@ package mocks import ( - common "github.com/hyperledger/fabric-protos-go/common" + common "github.com/hyperledger/fabric-protos-go-apiv2/common" mock "github.com/stretchr/testify/mock" validation "github.com/hyperledger/fabric/core/handlers/validation/api" diff --git a/core/committer/txvalidator/v20/plugindispatcher/plugin_validator.go b/core/committer/txvalidator/v20/plugindispatcher/plugin_validator.go index 0864051cf98..84322fc7830 100644 --- a/core/committer/txvalidator/v20/plugindispatcher/plugin_validator.go +++ b/core/committer/txvalidator/v20/plugindispatcher/plugin_validator.go @@ -10,7 +10,7 @@ import ( "fmt" "sync" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" ledger2 "github.com/hyperledger/fabric/common/ledger" "github.com/hyperledger/fabric/common/policies" txvalidatorplugin "github.com/hyperledger/fabric/core/committer/txvalidator/plugin" diff --git a/core/committer/txvalidator/v20/plugindispatcher/plugin_validator_test.go b/core/committer/txvalidator/v20/plugindispatcher/plugin_validator_test.go index add9ac2baee..fb1cb7a89e0 100644 --- a/core/committer/txvalidator/v20/plugindispatcher/plugin_validator_test.go +++ b/core/committer/txvalidator/v20/plugindispatcher/plugin_validator_test.go @@ -9,9 +9,8 @@ package plugindispatcher_test import ( "testing" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/policydsl" tmocks "github.com/hyperledger/fabric/core/committer/txvalidator/mocks" "github.com/hyperledger/fabric/core/committer/txvalidator/plugin" @@ -24,6 +23,7 @@ import ( "github.com/pkg/errors" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) func TestValidateWithPlugin(t *testing.T) { diff --git a/core/committer/txvalidator/v20/testdata/test_plugin.go b/core/committer/txvalidator/v20/testdata/test_plugin.go index 5d5495dbaa9..76f40b6b835 100644 --- a/core/committer/txvalidator/v20/testdata/test_plugin.go +++ b/core/committer/txvalidator/v20/testdata/test_plugin.go @@ -9,8 +9,7 @@ package testdata import ( "testing" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" validation "github.com/hyperledger/fabric/core/handlers/validation/api" . "github.com/hyperledger/fabric/core/handlers/validation/api/capabilities" . "github.com/hyperledger/fabric/core/handlers/validation/api/identities" @@ -19,6 +18,7 @@ import ( "github.com/hyperledger/fabric/protoutil" "github.com/pkg/errors" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) // SampleValidationPlugin is an example for a validation plugin, diff --git a/core/committer/txvalidator/v20/testdata/test_plugin.pb.go b/core/committer/txvalidator/v20/testdata/test_plugin.pb.go index 022c4c86778..a1815a4c095 100644 --- a/core/committer/txvalidator/v20/testdata/test_plugin.pb.go +++ b/core/committer/txvalidator/v20/testdata/test_plugin.pb.go @@ -1,98 +1,171 @@ +// +//Copyright IBM Corp. All Rights Reserved. +//SPDX-License-Identifier: Apache-2.0 + // Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.34.2 +// protoc v5.27.3 // source: test_plugin.proto package testdata import ( - fmt "fmt" - proto "github.com/golang/protobuf/proto" - math "math" -) + reflect "reflect" + sync "sync" -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" +) -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) type MarshaledSignedData struct { - Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` - Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` - Identity []byte `protobuf:"bytes,3,opt,name=identity,proto3" json:"identity,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *MarshaledSignedData) Reset() { *m = MarshaledSignedData{} } -func (m *MarshaledSignedData) String() string { return proto.CompactTextString(m) } -func (*MarshaledSignedData) ProtoMessage() {} -func (*MarshaledSignedData) Descriptor() ([]byte, []int) { - return fileDescriptor_65f5abc8dfb3e1dd, []int{0} + Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` + Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` + Identity []byte `protobuf:"bytes,3,opt,name=identity,proto3" json:"identity,omitempty"` } -func (m *MarshaledSignedData) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MarshaledSignedData.Unmarshal(m, b) -} -func (m *MarshaledSignedData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MarshaledSignedData.Marshal(b, m, deterministic) -} -func (m *MarshaledSignedData) XXX_Merge(src proto.Message) { - xxx_messageInfo_MarshaledSignedData.Merge(m, src) +func (x *MarshaledSignedData) Reset() { + *x = MarshaledSignedData{} + if protoimpl.UnsafeEnabled { + mi := &file_test_plugin_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *MarshaledSignedData) XXX_Size() int { - return xxx_messageInfo_MarshaledSignedData.Size(m) + +func (x *MarshaledSignedData) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *MarshaledSignedData) XXX_DiscardUnknown() { - xxx_messageInfo_MarshaledSignedData.DiscardUnknown(m) + +func (*MarshaledSignedData) ProtoMessage() {} + +func (x *MarshaledSignedData) ProtoReflect() protoreflect.Message { + mi := &file_test_plugin_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_MarshaledSignedData proto.InternalMessageInfo +// Deprecated: Use MarshaledSignedData.ProtoReflect.Descriptor instead. +func (*MarshaledSignedData) Descriptor() ([]byte, []int) { + return file_test_plugin_proto_rawDescGZIP(), []int{0} +} -func (m *MarshaledSignedData) GetData() []byte { - if m != nil { - return m.Data +func (x *MarshaledSignedData) GetData() []byte { + if x != nil { + return x.Data } return nil } -func (m *MarshaledSignedData) GetSignature() []byte { - if m != nil { - return m.Signature +func (x *MarshaledSignedData) GetSignature() []byte { + if x != nil { + return x.Signature } return nil } -func (m *MarshaledSignedData) GetIdentity() []byte { - if m != nil { - return m.Identity +func (x *MarshaledSignedData) GetIdentity() []byte { + if x != nil { + return x.Identity } return nil } -func init() { - proto.RegisterType((*MarshaledSignedData)(nil), "testdata.MarshaledSignedData") +var File_test_plugin_proto protoreflect.FileDescriptor + +var file_test_plugin_proto_rawDesc = []byte{ + 0x0a, 0x11, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x12, 0x08, 0x74, 0x65, 0x73, 0x74, 0x64, 0x61, 0x74, 0x61, 0x22, 0x63, 0x0a, + 0x13, 0x4d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x64, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, + 0x44, 0x61, 0x74, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, + 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x69, 0x67, + 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, + 0x74, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, + 0x74, 0x79, 0x42, 0x47, 0x5a, 0x45, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2f, 0x66, 0x61, 0x62, + 0x72, 0x69, 0x63, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, + 0x65, 0x72, 0x2f, 0x74, 0x78, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x76, + 0x32, 0x30, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x64, 0x61, 0x74, 0x61, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, +} + +var ( + file_test_plugin_proto_rawDescOnce sync.Once + file_test_plugin_proto_rawDescData = file_test_plugin_proto_rawDesc +) + +func file_test_plugin_proto_rawDescGZIP() []byte { + file_test_plugin_proto_rawDescOnce.Do(func() { + file_test_plugin_proto_rawDescData = protoimpl.X.CompressGZIP(file_test_plugin_proto_rawDescData) + }) + return file_test_plugin_proto_rawDescData +} + +var file_test_plugin_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_test_plugin_proto_goTypes = []any{ + (*MarshaledSignedData)(nil), // 0: testdata.MarshaledSignedData +} +var file_test_plugin_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name } -func init() { proto.RegisterFile("test_plugin.proto", fileDescriptor_65f5abc8dfb3e1dd) } - -var fileDescriptor_65f5abc8dfb3e1dd = []byte{ - // 191 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x44, 0x8e, 0x31, 0x4f, 0xc3, 0x30, - 0x10, 0x46, 0x15, 0x40, 0x28, 0x58, 0x2c, 0x98, 0x25, 0x42, 0x0c, 0x88, 0x89, 0x29, 0x46, 0xf0, - 0x0f, 0x10, 0x55, 0xa7, 0x2e, 0xed, 0xd6, 0xa5, 0xba, 0xd8, 0x57, 0xe7, 0x24, 0xc7, 0x8e, 0x2e, - 0x97, 0xa8, 0xf9, 0xf7, 0x55, 0x2c, 0xb5, 0xdd, 0xbe, 0xef, 0xbd, 0xe5, 0xa9, 0x17, 0xc1, 0x41, - 0x0e, 0x7d, 0x18, 0x3d, 0xc5, 0xba, 0xe7, 0x24, 0x49, 0x97, 0x0b, 0x72, 0x20, 0xf0, 0x69, 0xd5, - 0xeb, 0x06, 0x78, 0x68, 0x21, 0xa0, 0xdb, 0x91, 0x8f, 0xe8, 0xfe, 0x41, 0x40, 0x6b, 0xf5, 0xb0, - 0xe8, 0xaa, 0xf8, 0x28, 0xbe, 0x9e, 0xb7, 0x79, 0xeb, 0x77, 0xf5, 0x34, 0x90, 0x8f, 0x20, 0x23, - 0x63, 0x75, 0x97, 0xc5, 0x0d, 0xe8, 0x37, 0x55, 0x92, 0xc3, 0x28, 0x24, 0x73, 0x75, 0x9f, 0xe5, - 0xf5, 0xff, 0xad, 0xf7, 0x2b, 0x4f, 0xd2, 0x8e, 0x4d, 0x6d, 0x53, 0x67, 0xda, 0xb9, 0x47, 0x0e, - 0xe8, 0x3c, 0xb2, 0x39, 0x42, 0xc3, 0x64, 0x8d, 0x4d, 0x8c, 0xc6, 0xa6, 0xae, 0x23, 0x11, 0x64, - 0x23, 0xa7, 0x09, 0x02, 0x39, 0x90, 0xc4, 0x66, 0xfa, 0xf9, 0x36, 0x97, 0xda, 0xe6, 0x31, 0xe7, - 0xff, 0x9e, 0x03, 0x00, 0x00, 0xff, 0xff, 0xcb, 0xe3, 0x84, 0xe2, 0xd3, 0x00, 0x00, 0x00, +func init() { file_test_plugin_proto_init() } +func file_test_plugin_proto_init() { + if File_test_plugin_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_test_plugin_proto_msgTypes[0].Exporter = func(v any, i int) any { + switch v := v.(*MarshaledSignedData); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_test_plugin_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_test_plugin_proto_goTypes, + DependencyIndexes: file_test_plugin_proto_depIdxs, + MessageInfos: file_test_plugin_proto_msgTypes, + }.Build() + File_test_plugin_proto = out.File + file_test_plugin_proto_rawDesc = nil + file_test_plugin_proto_goTypes = nil + file_test_plugin_proto_depIdxs = nil } diff --git a/core/committer/txvalidator/v20/txvalidator_test.go b/core/committer/txvalidator/v20/txvalidator_test.go index ce3cdbdfc4f..d2f11c88480 100644 --- a/core/committer/txvalidator/v20/txvalidator_test.go +++ b/core/committer/txvalidator/v20/txvalidator_test.go @@ -9,10 +9,9 @@ package txvalidator import ( "testing" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/bccsp/sw" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/ledger/testutil" "github.com/hyperledger/fabric/common/semaphore" tmocks "github.com/hyperledger/fabric/core/committer/txvalidator/mocks" @@ -24,6 +23,7 @@ import ( "github.com/hyperledger/fabric/protoutil" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) // mockDispatcher is still useful for the parallel test. Auto-generated mocks diff --git a/core/committer/txvalidator/v20/validator.go b/core/committer/txvalidator/v20/validator.go index e3f21ad8d71..5582e4fed1f 100644 --- a/core/committer/txvalidator/v20/validator.go +++ b/core/committer/txvalidator/v20/validator.go @@ -10,12 +10,11 @@ import ( "context" "time" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/bccsp" "github.com/hyperledger/fabric-lib-go/common/flogging" - "github.com/hyperledger/fabric-protos-go/common" - mspprotos "github.com/hyperledger/fabric-protos-go/msp" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + mspprotos "github.com/hyperledger/fabric-protos-go-apiv2/msp" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/channelconfig" "github.com/hyperledger/fabric/common/configtx" commonerrors "github.com/hyperledger/fabric/common/errors" @@ -28,6 +27,7 @@ import ( "github.com/hyperledger/fabric/msp" "github.com/hyperledger/fabric/protoutil" "github.com/pkg/errors" + "google.golang.org/protobuf/proto" ) // Semaphore provides to the validator means for synchronisation diff --git a/core/committer/txvalidator/v20/validator_test.go b/core/committer/txvalidator/v20/validator_test.go index 6940362ebda..b1b22ffbbb9 100644 --- a/core/committer/txvalidator/v20/validator_test.go +++ b/core/committer/txvalidator/v20/validator_test.go @@ -15,11 +15,11 @@ import ( "time" "github.com/hyperledger/fabric-lib-go/bccsp/sw" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/ledger/rwset" - "github.com/hyperledger/fabric-protos-go/ledger/rwset/kvrwset" - protosmsp "github.com/hyperledger/fabric-protos-go/msp" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset/kvrwset" + protosmsp "github.com/hyperledger/fabric-protos-go-apiv2/msp" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" commonerrors "github.com/hyperledger/fabric/common/errors" "github.com/hyperledger/fabric/common/policydsl" "github.com/hyperledger/fabric/common/semaphore" diff --git a/core/committer/txvalidator/v20/valinforetriever/shim.go b/core/committer/txvalidator/v20/valinforetriever/shim.go index 42f0bf83c9c..c227e905f2a 100644 --- a/core/committer/txvalidator/v20/valinforetriever/shim.go +++ b/core/committer/txvalidator/v20/valinforetriever/shim.go @@ -7,11 +7,11 @@ SPDX-License-Identifier: Apache-2.0 package valinforetriever import ( - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/core/committer/txvalidator/v20/plugindispatcher" "github.com/hyperledger/fabric/core/ledger" + "google.golang.org/protobuf/proto" ) //go:generate mockery -dir . -name LifecycleResources -case underscore -output mocks/ diff --git a/core/committer/txvalidator/v20/valinforetriever/shim_test.go b/core/committer/txvalidator/v20/valinforetriever/shim_test.go index 1c60e130192..7982a56e289 100644 --- a/core/committer/txvalidator/v20/valinforetriever/shim_test.go +++ b/core/committer/txvalidator/v20/valinforetriever/shim_test.go @@ -9,8 +9,8 @@ package valinforetriever_test import ( "testing" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/protoutil" "github.com/hyperledger/fabric/core/committer/txvalidator/v20/valinforetriever" diff --git a/core/common/ccpackage/ccpackage.go b/core/common/ccpackage/ccpackage.go index 89d7b099b49..44d7e6286fe 100644 --- a/core/common/ccpackage/ccpackage.go +++ b/core/common/ccpackage/ccpackage.go @@ -11,11 +11,11 @@ import ( "errors" "fmt" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/internal/pkg/identity" "github.com/hyperledger/fabric/protoutil" + "google.golang.org/protobuf/proto" ) // ExtractSignedCCDepSpec extracts the messages from the envelope @@ -89,7 +89,7 @@ func createSignedCCDepSpec(cdsbytes []byte, instpolicybytes []byte, endorsements // create SignedChaincodeDeploymentSpec... cip := &peer.SignedChaincodeDeploymentSpec{ChaincodeDeploymentSpec: cdsbytes, InstantiationPolicy: instpolicybytes, OwnerEndorsements: endorsements} - //...and marshal it + // ...and marshal it cipbytes := protoutil.MarshalOrPanic(cip) // use defaults (this is definitely ok for install package) diff --git a/core/common/ccpackage/ccpackage_test.go b/core/common/ccpackage/ccpackage_test.go index d9764788bea..bea3adc999e 100644 --- a/core/common/ccpackage/ccpackage_test.go +++ b/core/common/ccpackage/ccpackage_test.go @@ -11,16 +11,16 @@ import ( "os" "testing" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/bccsp/sw" - "github.com/hyperledger/fabric-protos-go/common" - mspprotos "github.com/hyperledger/fabric-protos-go/msp" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + mspprotos "github.com/hyperledger/fabric-protos-go-apiv2/msp" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/policydsl" "github.com/hyperledger/fabric/msp" mspmgmt "github.com/hyperledger/fabric/msp/mgmt" msptesttools "github.com/hyperledger/fabric/msp/mgmt/testtools" "github.com/hyperledger/fabric/protoutil" + "google.golang.org/protobuf/proto" ) func ownerCreateCCDepSpec(codepackage []byte, sigpolicy *common.SignaturePolicyEnvelope, owner msp.SigningIdentity) (*common.Envelope, error) { @@ -70,7 +70,7 @@ func TestAddSignature(t *testing.T) { t.Fatalf("error signing existing package %s", err) return } - //...and sign aother for luck + // ...and sign aother for luck env, err = SignExistingPackage(env, signer) if err != nil || env == nil { t.Fatalf("error signing existing package %s", err) diff --git a/core/common/ccprovider/ccinfocache_test.go b/core/common/ccprovider/ccinfocache_test.go index e1ea9ae06ae..dbff1b1312c 100644 --- a/core/common/ccprovider/ccinfocache_test.go +++ b/core/common/ccprovider/ccinfocache_test.go @@ -24,10 +24,10 @@ import ( "path/filepath" "testing" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/bccsp/sw" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) func getDepSpec(name string, path string, version string, initArgs [][]byte) (*peer.ChaincodeDeploymentSpec, error) { diff --git a/core/common/ccprovider/ccprovider.go b/core/common/ccprovider/ccprovider.go index 78559971eb2..ea7f9dbaa49 100644 --- a/core/common/ccprovider/ccprovider.go +++ b/core/common/ccprovider/ccprovider.go @@ -13,15 +13,15 @@ import ( "strings" "unicode" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/bccsp" "github.com/hyperledger/fabric-lib-go/bccsp/factory" "github.com/hyperledger/fabric-lib-go/common/flogging" - pb "github.com/hyperledger/fabric-protos-go/peer" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/chaincode" "github.com/hyperledger/fabric/core/common/privdata" "github.com/hyperledger/fabric/core/ledger" "github.com/pkg/errors" + "google.golang.org/protobuf/proto" ) var ccproviderLogger = flogging.MustGetLogger("ccprovider") diff --git a/core/common/ccprovider/ccprovider.pb.go b/core/common/ccprovider/ccprovider.pb.go index c659b1f110a..4a5eb787044 100644 --- a/core/common/ccprovider/ccprovider.pb.go +++ b/core/common/ccprovider/ccprovider.pb.go @@ -1,30 +1,39 @@ +// +//Copyright IBM Corp. All Rights Reserved. +//SPDX-License-Identifier: Apache-2.0 + // Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.34.2 +// protoc v5.27.3 // source: ccprovider.proto package ccprovider import ( - fmt "fmt" - proto "github.com/golang/protobuf/proto" - math "math" -) + reflect "reflect" + sync "sync" -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" +) -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) // -------- ChaincodeData is stored on the LSCC ------- // ChaincodeData defines the datastructure for chaincodes to be serialized by proto // Type provides an additional check by directing to use a specific package after instantiation // Data is Type specific (see CDSPackage and SignedCDSPackage) type ChaincodeData struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + // Name of the chaincode Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // Version of the chaincode @@ -41,89 +50,93 @@ type ChaincodeData struct { // currently used anywhere but serves as a good eyecatcher Id []byte `protobuf:"bytes,7,opt,name=id,proto3" json:"id,omitempty"` // InstantiationPolicy for the chaincode - InstantiationPolicy []byte `protobuf:"bytes,8,opt,name=instantiation_policy,json=instantiationPolicy,proto3" json:"instantiation_policy,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + InstantiationPolicy []byte `protobuf:"bytes,8,opt,name=instantiation_policy,json=instantiationPolicy,proto3" json:"instantiation_policy,omitempty"` } -func (m *ChaincodeData) Reset() { *m = ChaincodeData{} } -func (m *ChaincodeData) String() string { return proto.CompactTextString(m) } -func (*ChaincodeData) ProtoMessage() {} -func (*ChaincodeData) Descriptor() ([]byte, []int) { - return fileDescriptor_c9a74861accd0272, []int{0} +func (x *ChaincodeData) Reset() { + *x = ChaincodeData{} + if protoimpl.UnsafeEnabled { + mi := &file_ccprovider_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *ChaincodeData) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ChaincodeData.Unmarshal(m, b) -} -func (m *ChaincodeData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ChaincodeData.Marshal(b, m, deterministic) -} -func (m *ChaincodeData) XXX_Merge(src proto.Message) { - xxx_messageInfo_ChaincodeData.Merge(m, src) +func (x *ChaincodeData) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *ChaincodeData) XXX_Size() int { - return xxx_messageInfo_ChaincodeData.Size(m) -} -func (m *ChaincodeData) XXX_DiscardUnknown() { - xxx_messageInfo_ChaincodeData.DiscardUnknown(m) + +func (*ChaincodeData) ProtoMessage() {} + +func (x *ChaincodeData) ProtoReflect() protoreflect.Message { + mi := &file_ccprovider_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_ChaincodeData proto.InternalMessageInfo +// Deprecated: Use ChaincodeData.ProtoReflect.Descriptor instead. +func (*ChaincodeData) Descriptor() ([]byte, []int) { + return file_ccprovider_proto_rawDescGZIP(), []int{0} +} -func (m *ChaincodeData) GetName() string { - if m != nil { - return m.Name +func (x *ChaincodeData) GetName() string { + if x != nil { + return x.Name } return "" } -func (m *ChaincodeData) GetVersion() string { - if m != nil { - return m.Version +func (x *ChaincodeData) GetVersion() string { + if x != nil { + return x.Version } return "" } -func (m *ChaincodeData) GetEscc() string { - if m != nil { - return m.Escc +func (x *ChaincodeData) GetEscc() string { + if x != nil { + return x.Escc } return "" } -func (m *ChaincodeData) GetVscc() string { - if m != nil { - return m.Vscc +func (x *ChaincodeData) GetVscc() string { + if x != nil { + return x.Vscc } return "" } -func (m *ChaincodeData) GetPolicy() []byte { - if m != nil { - return m.Policy +func (x *ChaincodeData) GetPolicy() []byte { + if x != nil { + return x.Policy } return nil } -func (m *ChaincodeData) GetData() []byte { - if m != nil { - return m.Data +func (x *ChaincodeData) GetData() []byte { + if x != nil { + return x.Data } return nil } -func (m *ChaincodeData) GetId() []byte { - if m != nil { - return m.Id +func (x *ChaincodeData) GetId() []byte { + if x != nil { + return x.Id } return nil } -func (m *ChaincodeData) GetInstantiationPolicy() []byte { - if m != nil { - return m.InstantiationPolicy +func (x *ChaincodeData) GetInstantiationPolicy() []byte { + if x != nil { + return x.InstantiationPolicy } return nil } @@ -133,50 +146,58 @@ func (m *ChaincodeData) GetInstantiationPolicy() []byte { // for CDSPackage. This needs to be serialized for ChaincodeData // hence the protobuf format type CDSData struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + // CodeHash hash of CodePackage from ChaincodeDeploymentSpec CodeHash []byte `protobuf:"bytes,1,opt,name=code_hash,json=codeHash,proto3" json:"code_hash,omitempty"` // MetaDataHash hash of Name and Version from ChaincodeDeploymentSpec - MetaDataHash []byte `protobuf:"bytes,2,opt,name=meta_data_hash,json=metaDataHash,proto3" json:"meta_data_hash,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + MetaDataHash []byte `protobuf:"bytes,2,opt,name=meta_data_hash,json=metaDataHash,proto3" json:"meta_data_hash,omitempty"` } -func (m *CDSData) Reset() { *m = CDSData{} } -func (m *CDSData) String() string { return proto.CompactTextString(m) } -func (*CDSData) ProtoMessage() {} -func (*CDSData) Descriptor() ([]byte, []int) { - return fileDescriptor_c9a74861accd0272, []int{1} +func (x *CDSData) Reset() { + *x = CDSData{} + if protoimpl.UnsafeEnabled { + mi := &file_ccprovider_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *CDSData) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CDSData.Unmarshal(m, b) +func (x *CDSData) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *CDSData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CDSData.Marshal(b, m, deterministic) -} -func (m *CDSData) XXX_Merge(src proto.Message) { - xxx_messageInfo_CDSData.Merge(m, src) -} -func (m *CDSData) XXX_Size() int { - return xxx_messageInfo_CDSData.Size(m) -} -func (m *CDSData) XXX_DiscardUnknown() { - xxx_messageInfo_CDSData.DiscardUnknown(m) + +func (*CDSData) ProtoMessage() {} + +func (x *CDSData) ProtoReflect() protoreflect.Message { + mi := &file_ccprovider_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_CDSData proto.InternalMessageInfo +// Deprecated: Use CDSData.ProtoReflect.Descriptor instead. +func (*CDSData) Descriptor() ([]byte, []int) { + return file_ccprovider_proto_rawDescGZIP(), []int{1} +} -func (m *CDSData) GetCodeHash() []byte { - if m != nil { - return m.CodeHash +func (x *CDSData) GetCodeHash() []byte { + if x != nil { + return x.CodeHash } return nil } -func (m *CDSData) GetMetaDataHash() []byte { - if m != nil { - return m.MetaDataHash +func (x *CDSData) GetMetaDataHash() []byte { + if x != nil { + return x.MetaDataHash } return nil } @@ -186,88 +207,190 @@ func (m *CDSData) GetMetaDataHash() []byte { // for SignedCDSPackage. This needs to be serialized for ChaincodeData // hence the protobuf format type SignedCDSData struct { - CodeHash []byte `protobuf:"bytes,1,opt,name=code_hash,json=codeHash,proto3" json:"code_hash,omitempty"` - MetaDataHash []byte `protobuf:"bytes,2,opt,name=meta_data_hash,json=metaDataHash,proto3" json:"meta_data_hash,omitempty"` - SignatureHash []byte `protobuf:"bytes,3,opt,name=signature_hash,json=signatureHash,proto3" json:"signature_hash,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *SignedCDSData) Reset() { *m = SignedCDSData{} } -func (m *SignedCDSData) String() string { return proto.CompactTextString(m) } -func (*SignedCDSData) ProtoMessage() {} -func (*SignedCDSData) Descriptor() ([]byte, []int) { - return fileDescriptor_c9a74861accd0272, []int{2} + CodeHash []byte `protobuf:"bytes,1,opt,name=code_hash,json=codeHash,proto3" json:"code_hash,omitempty"` + MetaDataHash []byte `protobuf:"bytes,2,opt,name=meta_data_hash,json=metaDataHash,proto3" json:"meta_data_hash,omitempty"` + SignatureHash []byte `protobuf:"bytes,3,opt,name=signature_hash,json=signatureHash,proto3" json:"signature_hash,omitempty"` } -func (m *SignedCDSData) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SignedCDSData.Unmarshal(m, b) -} -func (m *SignedCDSData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SignedCDSData.Marshal(b, m, deterministic) -} -func (m *SignedCDSData) XXX_Merge(src proto.Message) { - xxx_messageInfo_SignedCDSData.Merge(m, src) +func (x *SignedCDSData) Reset() { + *x = SignedCDSData{} + if protoimpl.UnsafeEnabled { + mi := &file_ccprovider_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *SignedCDSData) XXX_Size() int { - return xxx_messageInfo_SignedCDSData.Size(m) + +func (x *SignedCDSData) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *SignedCDSData) XXX_DiscardUnknown() { - xxx_messageInfo_SignedCDSData.DiscardUnknown(m) + +func (*SignedCDSData) ProtoMessage() {} + +func (x *SignedCDSData) ProtoReflect() protoreflect.Message { + mi := &file_ccprovider_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_SignedCDSData proto.InternalMessageInfo +// Deprecated: Use SignedCDSData.ProtoReflect.Descriptor instead. +func (*SignedCDSData) Descriptor() ([]byte, []int) { + return file_ccprovider_proto_rawDescGZIP(), []int{2} +} -func (m *SignedCDSData) GetCodeHash() []byte { - if m != nil { - return m.CodeHash +func (x *SignedCDSData) GetCodeHash() []byte { + if x != nil { + return x.CodeHash } return nil } -func (m *SignedCDSData) GetMetaDataHash() []byte { - if m != nil { - return m.MetaDataHash +func (x *SignedCDSData) GetMetaDataHash() []byte { + if x != nil { + return x.MetaDataHash } return nil } -func (m *SignedCDSData) GetSignatureHash() []byte { - if m != nil { - return m.SignatureHash +func (x *SignedCDSData) GetSignatureHash() []byte { + if x != nil { + return x.SignatureHash } return nil } -func init() { - proto.RegisterType((*ChaincodeData)(nil), "ccprovider.ChaincodeData") - proto.RegisterType((*CDSData)(nil), "ccprovider.CDSData") - proto.RegisterType((*SignedCDSData)(nil), "ccprovider.SignedCDSData") -} - -func init() { proto.RegisterFile("ccprovider.proto", fileDescriptor_c9a74861accd0272) } - -var fileDescriptor_c9a74861accd0272 = []byte{ - // 306 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x91, 0xcf, 0x4a, 0x03, 0x31, - 0x10, 0x87, 0xd9, 0x6d, 0xed, 0x9f, 0xa1, 0x2d, 0x12, 0x45, 0x02, 0x5e, 0x4a, 0x51, 0xe8, 0xa9, - 0x8b, 0x28, 0x3e, 0x80, 0xed, 0xc1, 0x83, 0x07, 0x69, 0x6f, 0x5e, 0xca, 0x34, 0x89, 0xbb, 0x03, - 0xdd, 0x64, 0x49, 0xd2, 0x42, 0xdf, 0xd3, 0x07, 0x92, 0x49, 0xab, 0xc5, 0xbb, 0xb7, 0xdf, 0x7c, - 0xf3, 0x65, 0xc2, 0x30, 0x70, 0xa9, 0x54, 0xe3, 0xdd, 0x9e, 0xb4, 0xf1, 0xb3, 0xc6, 0xbb, 0xe8, - 0x04, 0x9c, 0xc9, 0xe4, 0x2b, 0x83, 0xe1, 0xbc, 0x42, 0xb2, 0xca, 0x69, 0xb3, 0xc0, 0x88, 0x42, - 0x40, 0xdb, 0x62, 0x6d, 0x64, 0x36, 0xce, 0xa6, 0xfd, 0x65, 0xca, 0x42, 0x42, 0x77, 0x6f, 0x7c, - 0x20, 0x67, 0x65, 0x9e, 0xf0, 0x4f, 0xc9, 0xb6, 0x09, 0x4a, 0xc9, 0xd6, 0xd1, 0xe6, 0xcc, 0x6c, - 0xcf, 0xac, 0x7d, 0x64, 0x9c, 0xc5, 0x0d, 0x74, 0x1a, 0xb7, 0x25, 0x75, 0x90, 0x17, 0xe3, 0x6c, - 0x3a, 0x58, 0x9e, 0x2a, 0x76, 0x35, 0x46, 0x94, 0x9d, 0x44, 0x53, 0x16, 0x23, 0xc8, 0x49, 0xcb, - 0x6e, 0x22, 0x39, 0x69, 0xf1, 0x00, 0xd7, 0x64, 0x43, 0x44, 0x1b, 0x09, 0x23, 0x39, 0xbb, 0x3e, - 0x4d, 0xea, 0x25, 0xe3, 0xea, 0x4f, 0xef, 0x3d, 0xb5, 0x26, 0x6f, 0xd0, 0x9d, 0x2f, 0x56, 0x69, - 0x9f, 0x5b, 0xe8, 0xf3, 0x6e, 0xeb, 0x0a, 0x43, 0x95, 0x96, 0x1a, 0x2c, 0x7b, 0x0c, 0x5e, 0x31, - 0x54, 0xe2, 0x0e, 0x46, 0xb5, 0x89, 0xb8, 0xe6, 0x7f, 0x8f, 0x46, 0x9e, 0x8c, 0x01, 0x53, 0x7e, - 0xce, 0xd6, 0xe4, 0x00, 0xc3, 0x15, 0x95, 0xd6, 0xe8, 0xff, 0x9b, 0x29, 0xee, 0x61, 0x14, 0xa8, - 0xb4, 0x18, 0x77, 0xfe, 0x34, 0xa7, 0x95, 0xac, 0xe1, 0x2f, 0x65, 0xed, 0xe5, 0xf9, 0xe3, 0xa9, - 0xa4, 0x58, 0xed, 0x36, 0x33, 0xe5, 0xea, 0xa2, 0x3a, 0x34, 0xc6, 0x6f, 0x8d, 0x2e, 0x8d, 0x2f, - 0x3e, 0x71, 0xe3, 0x49, 0x15, 0xca, 0x79, 0x53, 0x28, 0x57, 0xd7, 0xce, 0x16, 0xe7, 0xbb, 0x6e, - 0x3a, 0xe9, 0xd4, 0x8f, 0xdf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x36, 0xd1, 0x14, 0xa3, 0xfe, 0x01, - 0x00, 0x00, +var File_ccprovider_proto protoreflect.FileDescriptor + +var file_ccprovider_proto_rawDesc = []byte{ + 0x0a, 0x10, 0x63, 0x63, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x12, 0x0a, 0x63, 0x63, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x22, 0xd4, + 0x01, 0x0a, 0x0d, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x44, 0x61, 0x74, 0x61, + 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x12, + 0x0a, 0x04, 0x65, 0x73, 0x63, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x65, 0x73, + 0x63, 0x63, 0x12, 0x12, 0x0a, 0x04, 0x76, 0x73, 0x63, 0x63, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x76, 0x73, 0x63, 0x63, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x12, + 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, + 0x74, 0x61, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x02, + 0x69, 0x64, 0x12, 0x31, 0x0a, 0x14, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x69, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x13, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x69, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, + 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x22, 0x4c, 0x0a, 0x07, 0x43, 0x44, 0x53, 0x44, 0x61, 0x74, 0x61, + 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x6f, 0x64, 0x65, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x08, 0x63, 0x6f, 0x64, 0x65, 0x48, 0x61, 0x73, 0x68, 0x12, 0x24, 0x0a, + 0x0e, 0x6d, 0x65, 0x74, 0x61, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x6d, 0x65, 0x74, 0x61, 0x44, 0x61, 0x74, 0x61, 0x48, + 0x61, 0x73, 0x68, 0x22, 0x79, 0x0a, 0x0d, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x43, 0x44, 0x53, + 0x44, 0x61, 0x74, 0x61, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x6f, 0x64, 0x65, 0x5f, 0x68, 0x61, 0x73, + 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x63, 0x6f, 0x64, 0x65, 0x48, 0x61, 0x73, + 0x68, 0x12, 0x24, 0x0a, 0x0e, 0x6d, 0x65, 0x74, 0x61, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x68, + 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x6d, 0x65, 0x74, 0x61, 0x44, + 0x61, 0x74, 0x61, 0x48, 0x61, 0x73, 0x68, 0x12, 0x25, 0x0a, 0x0e, 0x73, 0x69, 0x67, 0x6e, 0x61, + 0x74, 0x75, 0x72, 0x65, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x0d, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x48, 0x61, 0x73, 0x68, 0x42, 0x36, + 0x5a, 0x34, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x79, 0x70, + 0x65, 0x72, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2f, 0x66, 0x61, 0x62, 0x72, 0x69, 0x63, 0x2f, + 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x63, 0x70, 0x72, + 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_ccprovider_proto_rawDescOnce sync.Once + file_ccprovider_proto_rawDescData = file_ccprovider_proto_rawDesc +) + +func file_ccprovider_proto_rawDescGZIP() []byte { + file_ccprovider_proto_rawDescOnce.Do(func() { + file_ccprovider_proto_rawDescData = protoimpl.X.CompressGZIP(file_ccprovider_proto_rawDescData) + }) + return file_ccprovider_proto_rawDescData +} + +var file_ccprovider_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_ccprovider_proto_goTypes = []any{ + (*ChaincodeData)(nil), // 0: ccprovider.ChaincodeData + (*CDSData)(nil), // 1: ccprovider.CDSData + (*SignedCDSData)(nil), // 2: ccprovider.SignedCDSData +} +var file_ccprovider_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_ccprovider_proto_init() } +func file_ccprovider_proto_init() { + if File_ccprovider_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_ccprovider_proto_msgTypes[0].Exporter = func(v any, i int) any { + switch v := v.(*ChaincodeData); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ccprovider_proto_msgTypes[1].Exporter = func(v any, i int) any { + switch v := v.(*CDSData); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ccprovider_proto_msgTypes[2].Exporter = func(v any, i int) any { + switch v := v.(*SignedCDSData); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_ccprovider_proto_rawDesc, + NumEnums: 0, + NumMessages: 3, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_ccprovider_proto_goTypes, + DependencyIndexes: file_ccprovider_proto_depIdxs, + MessageInfos: file_ccprovider_proto_msgTypes, + }.Build() + File_ccprovider_proto = out.File + file_ccprovider_proto_rawDesc = nil + file_ccprovider_proto_goTypes = nil + file_ccprovider_proto_depIdxs = nil } diff --git a/core/common/ccprovider/ccprovider_test.go b/core/common/ccprovider/ccprovider_test.go index e257c18a8a5..42a4c6fe206 100644 --- a/core/common/ccprovider/ccprovider_test.go +++ b/core/common/ccprovider/ccprovider_test.go @@ -14,13 +14,13 @@ import ( "strings" "testing" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/bccsp/sw" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/chaincode" "github.com/hyperledger/fabric/core/common/ccprovider" "github.com/pkg/errors" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) func TestInstalledCCs(t *testing.T) { diff --git a/core/common/ccprovider/ccproviderproto_test.go b/core/common/ccprovider/ccproviderproto_test.go index 34ca39e1fa2..60b8441cc6b 100644 --- a/core/common/ccprovider/ccproviderproto_test.go +++ b/core/common/ccprovider/ccproviderproto_test.go @@ -8,9 +8,11 @@ package ccprovider_test import ( "testing" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric/core/common/ccprovider" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/encoding/prototext" + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/protoadapt" ) // -------- ChaincodeDataOld is stored on the LSCC ------- @@ -45,7 +47,8 @@ func (cd *ChaincodeData) Reset() { *cd = ChaincodeData{} } // String converts to string func (cd *ChaincodeData) String() string { - return proto.CompactTextString(cd) + b, _ := prototext.MarshalOptions{Indent: ""}.Marshal(protoadapt.MessageV2Of(cd)) + return string(b) } // ProtoMessage just exists to make proto happy @@ -67,7 +70,10 @@ type SignedCDSData struct { func (data *SignedCDSData) Reset() { *data = SignedCDSData{} } // String converts to string -func (data *SignedCDSData) String() string { return proto.CompactTextString(data) } +func (data *SignedCDSData) String() string { + b, _ := prototext.MarshalOptions{Indent: ""}.Marshal(protoadapt.MessageV2Of(data)) + return string(b) +} // ProtoMessage just exists to make proto happy func (*SignedCDSData) ProtoMessage() {} @@ -96,17 +102,17 @@ func TestChaincodeDataOldToNew(t *testing.T) { Id: []byte("id"), InstantiationPolicy: []byte("instantiation-policy"), } - bOld, err := proto.Marshal(ccDataOld) + bOld, err := proto.Marshal(protoadapt.MessageV2Of(ccDataOld)) require.NoError(t, err) ccDataOld2 := &ChaincodeData{} ccData2 := &ccprovider.ChaincodeData{} - err = proto.Unmarshal(bNew, ccDataOld2) + err = proto.Unmarshal(bNew, protoadapt.MessageV2Of(ccDataOld2)) require.NoError(t, err) err = proto.Unmarshal(bOld, ccData2) require.NoError(t, err) - require.True(t, proto.Equal(ccDataOld, ccDataOld2)) + require.True(t, proto.Equal(protoadapt.MessageV2Of(ccDataOld), protoadapt.MessageV2Of(ccDataOld2))) require.True(t, proto.Equal(ccData, ccData2)) } @@ -124,16 +130,16 @@ func TestSignedCDSDataOldToNew(t *testing.T) { MetaDataHash: []byte("data"), SignatureHash: []byte("id"), } - bOld, err := proto.Marshal(ccDataOld) + bOld, err := proto.Marshal(protoadapt.MessageV2Of(ccDataOld)) require.NoError(t, err) ccDataOld2 := &SignedCDSData{} ccData2 := &ccprovider.SignedCDSData{} - err = proto.Unmarshal(bNew, ccDataOld2) + err = proto.Unmarshal(bNew, protoadapt.MessageV2Of(ccDataOld2)) require.NoError(t, err) err = proto.Unmarshal(bOld, ccData2) require.NoError(t, err) - require.True(t, proto.Equal(ccDataOld, ccDataOld2)) + require.True(t, proto.Equal(protoadapt.MessageV2Of(ccDataOld), protoadapt.MessageV2Of(ccDataOld2))) require.True(t, proto.Equal(ccData, ccData2)) } diff --git a/core/common/ccprovider/cdspackage.go b/core/common/ccprovider/cdspackage.go index 4096521a9e0..fff3a6a962d 100644 --- a/core/common/ccprovider/cdspackage.go +++ b/core/common/ccprovider/cdspackage.go @@ -21,9 +21,9 @@ import ( "hash" "os" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/bccsp" - pb "github.com/hyperledger/fabric-protos-go/peer" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" + "google.golang.org/protobuf/proto" ) // GetHasher interface defines a subset of bccsp which contains GetHash function. diff --git a/core/common/ccprovider/cdspackage_test.go b/core/common/ccprovider/cdspackage_test.go index a71ed17765d..0491566c20e 100644 --- a/core/common/ccprovider/cdspackage_test.go +++ b/core/common/ccprovider/cdspackage_test.go @@ -12,7 +12,7 @@ import ( "testing" "github.com/hyperledger/fabric-lib-go/bccsp/sw" - pb "github.com/hyperledger/fabric-protos-go/peer" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/protoutil" "github.com/stretchr/testify/require" ) @@ -100,7 +100,7 @@ func TestPutCDSErrorPaths(t *testing.T) { // put back dep spec ccpack.depSpec = savDepSpec - //...but remove the chaincode directory + // ...but remove the chaincode directory os.RemoveAll(ccdir) if err = ccpack.PutChaincodeToFS(); err == nil { t.Fatalf("expected error putting package on the FS") @@ -157,7 +157,7 @@ func TestCDSSwitchChaincodes(t *testing.T) { // mimic the good code ChaincodeData from the instantiate... cds.CodePackage = []byte("goodcode") - //...and generate the CD for it (don't overwrite the bad code) + // ...and generate the CD for it (don't overwrite the bad code) _, _, goodcd, err := processCDS(cds, false) if err != nil { t.Fatalf("error putting CDS to FS %s", err) @@ -249,7 +249,7 @@ func TestValidateCCErrorPaths(t *testing.T) { cpack.data = &CDSData{} err = cpack.ValidateCC(ccdata) require.Error(t, err) - require.Contains(t, err.Error(), `invalid chaincode data name:"Tom" (name:"Jerry" version:"0" )`) + require.Contains(t, err.Error(), "invalid chaincode data", "Unexpected error validating package") // mismatched versions cpack = &CDSPackage{GetHasher: cryptoProvider} @@ -263,5 +263,5 @@ func TestValidateCCErrorPaths(t *testing.T) { cpack.data = &CDSData{} err = cpack.ValidateCC(ccdata) require.Error(t, err) - require.Contains(t, err.Error(), `invalid chaincode data name:"Tom" version:"1" (name:"Tom" version:"0" )`) + require.Contains(t, err.Error(), "invalid chaincode data", "Unexpected error validating package") } diff --git a/core/common/ccprovider/sigcdspackage.go b/core/common/ccprovider/sigcdspackage.go index 10104cd4a10..5bfc9b22097 100644 --- a/core/common/ccprovider/sigcdspackage.go +++ b/core/common/ccprovider/sigcdspackage.go @@ -20,12 +20,12 @@ import ( "fmt" "os" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/bccsp" "github.com/hyperledger/fabric-lib-go/bccsp/factory" - "github.com/hyperledger/fabric-protos-go/common" - pb "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/core/common/ccpackage" + "google.golang.org/protobuf/proto" ) // -------- SignedCDSPackage --------- diff --git a/core/common/ccprovider/sigcdspackage_test.go b/core/common/ccprovider/sigcdspackage_test.go index f32e299d084..12e7225e9e4 100644 --- a/core/common/ccprovider/sigcdspackage_test.go +++ b/core/common/ccprovider/sigcdspackage_test.go @@ -12,8 +12,8 @@ import ( "testing" "github.com/hyperledger/fabric-lib-go/bccsp/sw" - "github.com/hyperledger/fabric-protos-go/common" - pb "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/core/common/ccpackage" "github.com/hyperledger/fabric/protoutil" "github.com/stretchr/testify/require" @@ -341,7 +341,7 @@ func TestSignedCDSSwitchChaincodes(t *testing.T) { // mimic the good code ChaincodeData from the instantiate... cds.CodePackage = []byte("goodcode") - //...and generate the CD for it (don't overwrite the bad code) + // ...and generate the CD for it (don't overwrite the bad code) _, _, goodcd, err := processSignedCDS(cds, &common.SignaturePolicyEnvelope{Version: 1}, false) if err != nil { t.Fatalf("error putting CDS to FS %s", err) diff --git a/core/common/privdata/collection.go b/core/common/privdata/collection.go index 7bf5b179baf..37e9047498a 100644 --- a/core/common/privdata/collection.go +++ b/core/common/privdata/collection.go @@ -9,7 +9,7 @@ package privdata import ( "strings" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/core/ledger" "github.com/hyperledger/fabric/protoutil" ) diff --git a/core/common/privdata/membershipinfo.go b/core/common/privdata/membershipinfo.go index 410a064c8fc..c94813961cb 100644 --- a/core/common/privdata/membershipinfo.go +++ b/core/common/privdata/membershipinfo.go @@ -8,7 +8,7 @@ package privdata import ( "github.com/hyperledger/fabric-lib-go/common/flogging" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/core/chaincode/implicitcollection" "github.com/hyperledger/fabric/msp" "github.com/hyperledger/fabric/protoutil" diff --git a/core/common/privdata/membershipinfo_test.go b/core/common/privdata/membershipinfo_test.go index 73295bdd036..ac532abfcba 100644 --- a/core/common/privdata/membershipinfo_test.go +++ b/core/common/privdata/membershipinfo_test.go @@ -9,7 +9,7 @@ package privdata import ( "testing" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/policydsl" "github.com/hyperledger/fabric/core/chaincode/implicitcollection" "github.com/hyperledger/fabric/msp" diff --git a/core/common/privdata/mock/chaincode_info_provider.go b/core/common/privdata/mock/chaincode_info_provider.go index e77e79feb61..dc4d8703199 100644 --- a/core/common/privdata/mock/chaincode_info_provider.go +++ b/core/common/privdata/mock/chaincode_info_provider.go @@ -4,7 +4,7 @@ package mock import ( "sync" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/core/ledger" ) diff --git a/core/common/privdata/simplecollection.go b/core/common/privdata/simplecollection.go index 6081c3dcb8c..1de13d04869 100644 --- a/core/common/privdata/simplecollection.go +++ b/core/common/privdata/simplecollection.go @@ -7,12 +7,12 @@ SPDX-License-Identifier: Apache-2.0 package privdata import ( - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/policies" "github.com/hyperledger/fabric/msp" "github.com/hyperledger/fabric/protoutil" "github.com/pkg/errors" + "google.golang.org/protobuf/proto" ) // SimpleCollection implements a collection with static properties diff --git a/core/common/privdata/simplecollection_test.go b/core/common/privdata/simplecollection_test.go index 1fae0e0196b..7f0ba72c112 100644 --- a/core/common/privdata/simplecollection_test.go +++ b/core/common/privdata/simplecollection_test.go @@ -12,9 +12,9 @@ import ( "testing" "time" - cb "github.com/hyperledger/fabric-protos-go/common" - mb "github.com/hyperledger/fabric-protos-go/msp" - pb "github.com/hyperledger/fabric-protos-go/peer" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + mb "github.com/hyperledger/fabric-protos-go-apiv2/msp" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/policydsl" "github.com/hyperledger/fabric/msp" "github.com/hyperledger/fabric/protoutil" diff --git a/core/common/privdata/store.go b/core/common/privdata/store.go index 8a3d8257616..36c2483c934 100644 --- a/core/common/privdata/store.go +++ b/core/common/privdata/store.go @@ -9,12 +9,12 @@ package privdata import ( "fmt" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/core/ledger" "github.com/hyperledger/fabric/msp" "github.com/hyperledger/fabric/protoutil" "github.com/pkg/errors" + "google.golang.org/protobuf/proto" ) // State retrieves data from the state. diff --git a/core/common/privdata/store_test.go b/core/common/privdata/store_test.go index 7acc936c2f0..c4ba97b72d5 100644 --- a/core/common/privdata/store_test.go +++ b/core/common/privdata/store_test.go @@ -9,7 +9,7 @@ package privdata import ( "testing" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/policydsl" "github.com/hyperledger/fabric/core/common/privdata/mock" "github.com/hyperledger/fabric/core/ledger" diff --git a/core/common/privdata/util.go b/core/common/privdata/util.go index 31f906e0e33..3166a5bb9a1 100644 --- a/core/common/privdata/util.go +++ b/core/common/privdata/util.go @@ -7,13 +7,13 @@ SPDX-License-Identifier: Apache-2.0 package privdata import ( - "github.com/golang/protobuf/proto" - mspp "github.com/hyperledger/fabric-protos-go/msp" - "github.com/hyperledger/fabric-protos-go/peer" + mspp "github.com/hyperledger/fabric-protos-go-apiv2/msp" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/cauthdsl" "github.com/hyperledger/fabric/common/policies" "github.com/hyperledger/fabric/msp" "github.com/pkg/errors" + "google.golang.org/protobuf/proto" ) // getPolicy creates a new policy from the policy envelope. It will return an error if the envelope has invalid policy config. diff --git a/core/common/privdata/util_test.go b/core/common/privdata/util_test.go index 35b5389807b..27ede818eb6 100644 --- a/core/common/privdata/util_test.go +++ b/core/common/privdata/util_test.go @@ -9,7 +9,7 @@ package privdata import ( "testing" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/stretchr/testify/require" ) diff --git a/core/common/validation/config_test.go b/core/common/validation/config_test.go index 0843a34a3a3..51076701e2f 100644 --- a/core/common/validation/config_test.go +++ b/core/common/validation/config_test.go @@ -10,8 +10,8 @@ import ( "testing" "github.com/hyperledger/fabric-lib-go/bccsp/sw" - cb "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/peer" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/core/config/configtest" "github.com/hyperledger/fabric/internal/configtxgen/encoder" "github.com/hyperledger/fabric/internal/configtxgen/genesisconfig" diff --git a/core/common/validation/fullflow_test.go b/core/common/validation/fullflow_test.go index 64de40bc420..6a28d38e66b 100644 --- a/core/common/validation/fullflow_test.go +++ b/core/common/validation/fullflow_test.go @@ -14,8 +14,8 @@ import ( "time" "github.com/hyperledger/fabric-lib-go/bccsp/sw" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/msp" mspmgmt "github.com/hyperledger/fabric/msp/mgmt" msptesttools "github.com/hyperledger/fabric/msp/mgmt/testtools" diff --git a/core/common/validation/msgvalidation.go b/core/common/validation/msgvalidation.go index d059a930a9d..295b19bf8b6 100644 --- a/core/common/validation/msgvalidation.go +++ b/core/common/validation/msgvalidation.go @@ -11,8 +11,8 @@ import ( "github.com/hyperledger/fabric-lib-go/bccsp" "github.com/hyperledger/fabric-lib-go/common/flogging" - "github.com/hyperledger/fabric-protos-go/common" - pb "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" mspmgmt "github.com/hyperledger/fabric/msp/mgmt" "github.com/hyperledger/fabric/protoutil" "github.com/pkg/errors" diff --git a/core/common/validation/msgvalidation_test.go b/core/common/validation/msgvalidation_test.go index 2b97dae48bf..89172b79009 100644 --- a/core/common/validation/msgvalidation_test.go +++ b/core/common/validation/msgvalidation_test.go @@ -11,8 +11,8 @@ import ( "testing" "github.com/hyperledger/fabric-lib-go/bccsp/sw" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/protoutil" "github.com/stretchr/testify/require" ) diff --git a/core/common/validation/statebased/validator_keylevel.go b/core/common/validation/statebased/validator_keylevel.go index 77a44ed7556..9dd7b8504c3 100644 --- a/core/common/validation/statebased/validator_keylevel.go +++ b/core/common/validation/statebased/validator_keylevel.go @@ -9,15 +9,15 @@ package statebased import ( "sync" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" commonerrors "github.com/hyperledger/fabric/common/errors" validation "github.com/hyperledger/fabric/core/handlers/validation/api/policies" "github.com/hyperledger/fabric/core/ledger" "github.com/hyperledger/fabric/core/ledger/kvledger/txmgmt/rwsetutil" "github.com/hyperledger/fabric/protoutil" "github.com/pkg/errors" + "google.golang.org/protobuf/proto" ) type epEvaluator interface { diff --git a/core/common/validation/statebased/validator_keylevel_test.go b/core/common/validation/statebased/validator_keylevel_test.go index 8f80b84f885..340fa0387a2 100644 --- a/core/common/validation/statebased/validator_keylevel_test.go +++ b/core/common/validation/statebased/validator_keylevel_test.go @@ -10,8 +10,8 @@ import ( "fmt" "testing" - "github.com/hyperledger/fabric-protos-go/common" - pb "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/errors" "github.com/hyperledger/fabric/core/ledger" "github.com/hyperledger/fabric/core/ledger/kvledger/txmgmt/rwsetutil" diff --git a/core/common/validation/statebased/vpmanager_test.go b/core/common/validation/statebased/vpmanager_test.go index 9be3b01ca4e..0247467c577 100644 --- a/core/common/validation/statebased/vpmanager_test.go +++ b/core/common/validation/statebased/vpmanager_test.go @@ -15,9 +15,9 @@ import ( "testing" "time" - "github.com/hyperledger/fabric-protos-go/ledger/rwset" - "github.com/hyperledger/fabric-protos-go/ledger/rwset/kvrwset" - pb "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset/kvrwset" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/policydsl" validation "github.com/hyperledger/fabric/core/handlers/validation/api/state" "github.com/hyperledger/fabric/protoutil" diff --git a/core/common/validation/statebased/vpmanagerimpl.go b/core/common/validation/statebased/vpmanagerimpl.go index 1f8820083dc..ff1c84e348e 100644 --- a/core/common/validation/statebased/vpmanagerimpl.go +++ b/core/common/validation/statebased/vpmanagerimpl.go @@ -10,7 +10,7 @@ import ( "sync" "github.com/hyperledger/fabric-lib-go/common/flogging" - pb "github.com/hyperledger/fabric-protos-go/peer" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" validation "github.com/hyperledger/fabric/core/handlers/validation/api/state" "github.com/hyperledger/fabric/core/ledger/kvledger/txmgmt/rwsetutil" "github.com/pkg/errors" diff --git a/core/container/ccintf/ccintf.go b/core/container/ccintf/ccintf.go index 35f6d0a833c..69b5583fa9b 100644 --- a/core/container/ccintf/ccintf.go +++ b/core/container/ccintf/ccintf.go @@ -9,7 +9,7 @@ package ccintf import ( "github.com/hyperledger/fabric/internal/pkg/comm" - pb "github.com/hyperledger/fabric-protos-go/peer" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" ) // These structures can/should probably be moved out of here. diff --git a/core/container/dockercontroller/dockercontroller.go b/core/container/dockercontroller/dockercontroller.go index 0695aa85bdd..ccf003d9a39 100644 --- a/core/container/dockercontroller/dockercontroller.go +++ b/core/container/dockercontroller/dockercontroller.go @@ -23,7 +23,7 @@ import ( docker "github.com/fsouza/go-dockerclient" "github.com/hyperledger/fabric-lib-go/common/flogging" - pb "github.com/hyperledger/fabric-protos-go/peer" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/util" "github.com/hyperledger/fabric/core/chaincode/persistence" "github.com/hyperledger/fabric/core/container" diff --git a/core/container/dockercontroller/dockercontroller_test.go b/core/container/dockercontroller/dockercontroller_test.go index 22d2f95d5b2..6365ce8f3af 100644 --- a/core/container/dockercontroller/dockercontroller_test.go +++ b/core/container/dockercontroller/dockercontroller_test.go @@ -22,7 +22,7 @@ import ( "github.com/hyperledger/fabric-lib-go/common/flogging/floggingtest" "github.com/hyperledger/fabric-lib-go/common/metrics/disabled" "github.com/hyperledger/fabric-lib-go/common/metrics/metricsfakes" - pb "github.com/hyperledger/fabric-protos-go/peer" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/util" "github.com/hyperledger/fabric/core/chaincode/persistence" "github.com/hyperledger/fabric/core/container/ccintf" diff --git a/core/container/dockercontroller/testdata/src/chaincodes/noop/chaincode.go b/core/container/dockercontroller/testdata/src/chaincodes/noop/chaincode.go index 71058bd41fa..4dbc59ac936 100644 --- a/core/container/dockercontroller/testdata/src/chaincodes/noop/chaincode.go +++ b/core/container/dockercontroller/testdata/src/chaincodes/noop/chaincode.go @@ -9,18 +9,18 @@ package main import ( "fmt" - "github.com/hyperledger/fabric-chaincode-go/shim" - pb "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-chaincode-go/v2/shim" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" ) // No-op test chaincode type TestChaincode struct{} -func (t *TestChaincode) Init(stub shim.ChaincodeStubInterface) pb.Response { +func (t *TestChaincode) Init(stub shim.ChaincodeStubInterface) *pb.Response { return shim.Success(nil) } -func (t *TestChaincode) Invoke(stub shim.ChaincodeStubInterface) pb.Response { +func (t *TestChaincode) Invoke(stub shim.ChaincodeStubInterface) *pb.Response { return shim.Success(nil) } diff --git a/core/deliverservice/config.go b/core/deliverservice/config.go index 32017f31c9f..b54ff352956 100644 --- a/core/deliverservice/config.go +++ b/core/deliverservice/config.go @@ -15,7 +15,6 @@ import ( "github.com/hyperledger/fabric/common/deliverclient/orderers" "github.com/hyperledger/fabric/core/config" "github.com/hyperledger/fabric/internal/pkg/comm" - "github.com/pkg/errors" "github.com/spf13/viper" ) diff --git a/core/deliverservice/config_test.go b/core/deliverservice/config_test.go index f96a9ca9da1..9f83ad39097 100644 --- a/core/deliverservice/config_test.go +++ b/core/deliverservice/config_test.go @@ -13,11 +13,10 @@ import ( "testing" "time" - "github.com/stretchr/testify/require" - "github.com/hyperledger/fabric/core/deliverservice" "github.com/hyperledger/fabric/internal/pkg/comm" "github.com/spf13/viper" + "github.com/stretchr/testify/require" ) func TestSecureOptsConfig(t *testing.T) { diff --git a/core/deliverservice/deliveryclient.go b/core/deliverservice/deliveryclient.go index 82db9b3538d..5c3297f2c66 100644 --- a/core/deliverservice/deliveryclient.go +++ b/core/deliverservice/deliveryclient.go @@ -11,12 +11,11 @@ import ( "sync" "time" - "github.com/hyperledger/fabric/common/deliverclient" - "github.com/hyperledger/fabric-lib-go/bccsp" "github.com/hyperledger/fabric-lib-go/common/flogging" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/common/channelconfig" + "github.com/hyperledger/fabric/common/deliverclient" "github.com/hyperledger/fabric/common/deliverclient/blocksprovider" "github.com/hyperledger/fabric/common/deliverclient/orderers" "github.com/hyperledger/fabric/common/util" diff --git a/core/deliverservice/deliveryclient_test.go b/core/deliverservice/deliveryclient_test.go index e080a8a171d..b3aa28b30a3 100644 --- a/core/deliverservice/deliveryclient_test.go +++ b/core/deliverservice/deliveryclient_test.go @@ -16,7 +16,7 @@ import ( "github.com/hyperledger/fabric-lib-go/bccsp" "github.com/hyperledger/fabric-lib-go/bccsp/sw" "github.com/hyperledger/fabric-lib-go/common/flogging" - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/common/crypto/tlsgen" "github.com/hyperledger/fabric/common/deliverclient/blocksprovider" "github.com/hyperledger/fabric/core/config/configtest" diff --git a/core/deliverservice/gossip_block_handler.go b/core/deliverservice/gossip_block_handler.go index 306d9c32c66..75016ed9134 100644 --- a/core/deliverservice/gossip_block_handler.go +++ b/core/deliverservice/gossip_block_handler.go @@ -7,11 +7,11 @@ SPDX-License-Identifier: Apache-2.0 package deliverservice import ( - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/common/flogging" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/gossip" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/gossip" "github.com/pkg/errors" + "google.golang.org/protobuf/proto" ) // GossipServiceAdapter serves to provide basic functionality @@ -33,6 +33,9 @@ type GossipBlockHandler struct { } func (h *GossipBlockHandler) HandleBlock(channelID string, block *common.Block) error { + if block == nil { + return errors.New("block from orderer could not be re-marshaled: proto: Marshal called with nil") + } marshaledBlock, err := proto.Marshal(block) if err != nil { return errors.WithMessage(err, "block from orderer could not be re-marshaled") diff --git a/core/deliverservice/gossip_block_handler_test.go b/core/deliverservice/gossip_block_handler_test.go index 3a92d34bed5..5ad9d00f059 100644 --- a/core/deliverservice/gossip_block_handler_test.go +++ b/core/deliverservice/gossip_block_handler_test.go @@ -10,7 +10,7 @@ import ( "testing" "github.com/hyperledger/fabric-lib-go/common/flogging" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/common/deliverclient/blocksprovider/fake" "github.com/pkg/errors" "github.com/stretchr/testify/require" diff --git a/core/dispatcher/dispatcher.go b/core/dispatcher/dispatcher.go index b8e49f3c4f3..dc6c26511b2 100644 --- a/core/dispatcher/dispatcher.go +++ b/core/dispatcher/dispatcher.go @@ -9,8 +9,8 @@ package dispatcher import ( "reflect" - "github.com/golang/protobuf/proto" "github.com/pkg/errors" + "google.golang.org/protobuf/proto" ) // Dispatcher is used to handle the boilerplate proto tasks of unmarshalling inputs and remarshaling outputs diff --git a/core/dispatcher/dispatcher_suite_test.go b/core/dispatcher/dispatcher_suite_test.go index dfaefe823c9..f18bd1a42d7 100644 --- a/core/dispatcher/dispatcher_suite_test.go +++ b/core/dispatcher/dispatcher_suite_test.go @@ -10,7 +10,6 @@ import ( "testing" "github.com/hyperledger/fabric/core/dispatcher" - . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/core/dispatcher/dispatcher_test.go b/core/dispatcher/dispatcher_test.go index 90712c62f6b..1d762a28e0d 100644 --- a/core/dispatcher/dispatcher_test.go +++ b/core/dispatcher/dispatcher_test.go @@ -10,48 +10,47 @@ import ( "fmt" "time" - "github.com/golang/protobuf/proto" - "github.com/golang/protobuf/ptypes/timestamp" "github.com/hyperledger/fabric/core/dispatcher" "github.com/hyperledger/fabric/core/dispatcher/mock" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" + "google.golang.org/protobuf/proto" "google.golang.org/protobuf/types/known/timestamppb" ) type TestReceiver struct{} -func (tr TestReceiver) GoodFunc(ts *timestamp.Timestamp) (*timestamp.Timestamp, error) { +func (tr TestReceiver) GoodFunc(ts *timestamppb.Timestamp) (*timestamppb.Timestamp, error) { return timestamppb.New(time.Unix(0, 0)), nil } -func (tr TestReceiver) MissingFuncParameters() (*timestamp.Timestamp, error) { +func (tr TestReceiver) MissingFuncParameters() (*timestamppb.Timestamp, error) { return timestamppb.New(time.Unix(0, 0)), nil } -func (tr TestReceiver) NotProtoParameter(foo *string) (*timestamp.Timestamp, error) { +func (tr TestReceiver) NotProtoParameter(foo *string) (*timestamppb.Timestamp, error) { return timestamppb.New(time.Unix(0, 0)), nil } -func (tr TestReceiver) NotPointerParameter(foo string) (*timestamp.Timestamp, error) { +func (tr TestReceiver) NotPointerParameter(foo string) (*timestamppb.Timestamp, error) { return timestamppb.New(time.Unix(0, 0)), nil } -func (tr TestReceiver) NoReturnValues(ts *timestamp.Timestamp) {} +func (tr TestReceiver) NoReturnValues(ts *timestamppb.Timestamp) {} -func (tr TestReceiver) NotProtoReturn(ts *timestamp.Timestamp) (string, error) { +func (tr TestReceiver) NotProtoReturn(ts *timestamppb.Timestamp) (string, error) { return "", nil } -func (tr TestReceiver) NotErrorReturn(ts *timestamp.Timestamp) (*timestamp.Timestamp, string) { +func (tr TestReceiver) NotErrorReturn(ts *timestamppb.Timestamp) (*timestamppb.Timestamp, string) { return nil, "" } -func (tr TestReceiver) NilNilReturn(ts *timestamp.Timestamp) (*timestamp.Timestamp, error) { +func (tr TestReceiver) NilNilReturn(ts *timestamppb.Timestamp) (*timestamppb.Timestamp, error) { return nil, nil } -func (tr TestReceiver) ErrorReturned(ts *timestamp.Timestamp) (*timestamp.Timestamp, error) { +func (tr TestReceiver) ErrorReturned(ts *timestamppb.Timestamp) (*timestamppb.Timestamp, error) { return nil, fmt.Errorf("fake-error") } @@ -86,7 +85,7 @@ var _ = Describe("Dispatcher", func() { It("unmarshals, dispatches to the correct function, and marshals the result", func() { outputBytes, err := d.Dispatch(inputBytes, "GoodFunc", testReceiver) Expect(err).NotTo(HaveOccurred()) - ts := ×tamp.Timestamp{} + ts := ×tamppb.Timestamp{} err = proto.Unmarshal(outputBytes, ts) Expect(err).NotTo(HaveOccurred()) gts := ts.AsTime() diff --git a/core/dispatcher/mock/protobuf.go b/core/dispatcher/mock/protobuf.go index aa25edd8d82..262d2dde1f4 100644 --- a/core/dispatcher/mock/protobuf.go +++ b/core/dispatcher/mock/protobuf.go @@ -4,7 +4,7 @@ package mock import ( "sync" - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" ) type Protobuf struct { diff --git a/core/dispatcher/protobuf.go b/core/dispatcher/protobuf.go index 7868e454ea2..1494d7df83a 100644 --- a/core/dispatcher/protobuf.go +++ b/core/dispatcher/protobuf.go @@ -7,8 +7,8 @@ SPDX-License-Identifier: Apache-2.0 package dispatcher import ( - "github.com/golang/protobuf/proto" "github.com/pkg/errors" + "google.golang.org/protobuf/proto" ) // Protobuf defines the subset of protobuf lifecycle needs and allows @@ -23,6 +23,9 @@ type ProtobufImpl struct{} // Marshal passes through to proto.Marshal func (p ProtobufImpl) Marshal(msg proto.Message) ([]byte, error) { + if !msg.ProtoReflect().IsValid() { + return nil, errors.New("proto: Marshal called with nil") + } res, err := proto.Marshal(msg) return res, errors.WithStack(err) } diff --git a/core/dispatcher/protobuf_test.go b/core/dispatcher/protobuf_test.go index 05599cc789f..dd3e22c9c7c 100644 --- a/core/dispatcher/protobuf_test.go +++ b/core/dispatcher/protobuf_test.go @@ -7,14 +7,12 @@ SPDX-License-Identifier: Apache-2.0 package dispatcher_test import ( + lc "github.com/hyperledger/fabric-protos-go-apiv2/peer/lifecycle" + "github.com/hyperledger/fabric/core/dispatcher" . "github.com/hyperledger/fabric/internal/test" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" - - lc "github.com/hyperledger/fabric-protos-go/peer/lifecycle" - "github.com/hyperledger/fabric/core/dispatcher" - - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" ) var _ = Describe("ProtobufImpl", func() { diff --git a/core/endorser/endorser.go b/core/endorser/endorser.go index 596f6706227..6acb366c9f0 100644 --- a/core/endorser/endorser.go +++ b/core/endorser/endorser.go @@ -12,12 +12,11 @@ import ( "strconv" "time" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-chaincode-go/shim" + "github.com/hyperledger/fabric-chaincode-go/v2/shim" "github.com/hyperledger/fabric-lib-go/common/flogging" - "github.com/hyperledger/fabric-protos-go/common" - pb "github.com/hyperledger/fabric-protos-go/peer" - "github.com/hyperledger/fabric-protos-go/transientstore" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/transientstore" "github.com/hyperledger/fabric/common/util" "github.com/hyperledger/fabric/core/chaincode/lifecycle" "github.com/hyperledger/fabric/core/common/ccprovider" @@ -27,6 +26,7 @@ import ( "github.com/hyperledger/fabric/protoutil" "github.com/pkg/errors" "go.uber.org/zap" + "google.golang.org/protobuf/proto" ) var endorserLogger = flogging.MustGetLogger("endorser") diff --git a/core/endorser/endorser_test.go b/core/endorser/endorser_test.go index 2d31b786936..da4564a51b3 100644 --- a/core/endorser/endorser_test.go +++ b/core/endorser/endorser_test.go @@ -12,13 +12,12 @@ import ( "slices" "strings" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/common/metrics/metricsfakes" - cb "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/ledger/rwset" - "github.com/hyperledger/fabric-protos-go/ledger/rwset/kvrwset" - mspproto "github.com/hyperledger/fabric-protos-go/msp" - pb "github.com/hyperledger/fabric-protos-go/peer" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset/kvrwset" + mspproto "github.com/hyperledger/fabric-protos-go-apiv2/msp" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/core/chaincode/lifecycle" "github.com/hyperledger/fabric/core/endorser" "github.com/hyperledger/fabric/core/endorser/fake" @@ -29,6 +28,7 @@ import ( . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "github.com/pkg/errors" + "google.golang.org/protobuf/proto" ) func sortChaincodeCall(a, b *pb.ChaincodeCall) int { @@ -1242,7 +1242,6 @@ var _ = Describe("Endorser", func() { slices.SortFunc(proposalResponse.Interest.Chaincodes, sortChaincodeCall) Expect(proposalResponse.Interest).To(ProtoEqual( - proposalResponse.Interest, &pb.ChaincodeInterest{ Chaincodes: []*pb.ChaincodeCall{ { @@ -1328,10 +1327,21 @@ var _ = Describe("Endorser", func() { proposalResponse, err := e.ProcessProposal(context.TODO(), signedProposal) Expect(err).NotTo(HaveOccurred()) - Expect(proposalResponse.Interest.Chaincodes).To(ContainElements([]*pb.ChaincodeCall{ - {Name: "myCC"}, - {Name: "otherCC"}, - })) + Expect(proto.Equal(proposalResponse.Interest.Chaincodes[0], + &pb.ChaincodeCall{ + Name: "myCC", + }) || proto.Equal(proposalResponse.Interest.Chaincodes[0], + &pb.ChaincodeCall{ + Name: "otherCC", + })).To(BeTrue()) + + Expect(proto.Equal(proposalResponse.Interest.Chaincodes[1], + &pb.ChaincodeCall{ + Name: "myCC", + }) || proto.Equal(proposalResponse.Interest.Chaincodes[1], + &pb.ChaincodeCall{ + Name: "otherCC", + })).To(BeTrue()) }) It("ignores system chaincodes", func() { @@ -1395,8 +1405,9 @@ var _ = Describe("Endorser", func() { proposalResponse, err := e.ProcessProposal(context.TODO(), signedProposal) Expect(err).NotTo(HaveOccurred()) - Expect(proposalResponse.Interest.Chaincodes).To(ContainElements([]*pb.ChaincodeCall{ - {Name: "myCC", CollectionNames: []string{"mycollection-1"}}, + Expect(proposalResponse.Interest.Chaincodes[0]).To(ProtoEqual(&pb.ChaincodeCall{ + Name: "myCC", + CollectionNames: []string{"mycollection-1"}, })) }) }) diff --git a/core/endorser/fake/id_deserializer.go b/core/endorser/fake/id_deserializer.go index b256aafa49f..269b948228f 100644 --- a/core/endorser/fake/id_deserializer.go +++ b/core/endorser/fake/id_deserializer.go @@ -4,7 +4,7 @@ package fake import ( "sync" - mspa "github.com/hyperledger/fabric-protos-go/msp" + mspa "github.com/hyperledger/fabric-protos-go-apiv2/msp" "github.com/hyperledger/fabric/msp" ) diff --git a/core/endorser/fake/identity.go b/core/endorser/fake/identity.go index 0c66e9de0bc..bfffb7d3cb4 100644 --- a/core/endorser/fake/identity.go +++ b/core/endorser/fake/identity.go @@ -5,7 +5,7 @@ import ( "sync" "time" - mspa "github.com/hyperledger/fabric-protos-go/msp" + mspa "github.com/hyperledger/fabric-protos-go-apiv2/msp" "github.com/hyperledger/fabric/msp" ) diff --git a/core/endorser/fake/prvt_data_distributor.go b/core/endorser/fake/prvt_data_distributor.go index e92ad72f5a6..f5125fdf778 100644 --- a/core/endorser/fake/prvt_data_distributor.go +++ b/core/endorser/fake/prvt_data_distributor.go @@ -4,7 +4,7 @@ package fake import ( "sync" - "github.com/hyperledger/fabric-protos-go/transientstore" + "github.com/hyperledger/fabric-protos-go-apiv2/transientstore" "github.com/hyperledger/fabric/core/endorser" ) diff --git a/core/endorser/fake/support.go b/core/endorser/fake/support.go index 4496c57d108..1b012912243 100644 --- a/core/endorser/fake/support.go +++ b/core/endorser/fake/support.go @@ -4,7 +4,7 @@ package fake import ( "sync" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/core/chaincode/lifecycle" "github.com/hyperledger/fabric/core/common/ccprovider" "github.com/hyperledger/fabric/core/ledger" diff --git a/core/endorser/mocks/plugin.go b/core/endorser/mocks/plugin.go index b60d4933044..22b47b12531 100644 --- a/core/endorser/mocks/plugin.go +++ b/core/endorser/mocks/plugin.go @@ -11,7 +11,7 @@ import ( endorsement "github.com/hyperledger/fabric/core/handlers/endorsement/api" mock "github.com/stretchr/testify/mock" - peer "github.com/hyperledger/fabric-protos-go/peer" + peer "github.com/hyperledger/fabric-protos-go-apiv2/peer" ) // Plugin is an autogenerated mock type for the Plugin type diff --git a/core/endorser/mocks/signing_identity_fetcher.go b/core/endorser/mocks/signing_identity_fetcher.go index c12c71a7fba..0459a721148 100644 --- a/core/endorser/mocks/signing_identity_fetcher.go +++ b/core/endorser/mocks/signing_identity_fetcher.go @@ -11,7 +11,7 @@ import ( endorsement "github.com/hyperledger/fabric/core/handlers/endorsement/api/identities" mock "github.com/stretchr/testify/mock" - peer "github.com/hyperledger/fabric-protos-go/peer" + peer "github.com/hyperledger/fabric-protos-go-apiv2/peer" ) // SigningIdentityFetcher is an autogenerated mock type for the SigningIdentityFetcher type diff --git a/core/endorser/msgvalidation.go b/core/endorser/msgvalidation.go index 0959c18a853..8da61f55397 100644 --- a/core/endorser/msgvalidation.go +++ b/core/endorser/msgvalidation.go @@ -9,13 +9,13 @@ package endorser import ( "crypto/sha256" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/core/common/ccprovider" "github.com/hyperledger/fabric/msp" "github.com/hyperledger/fabric/protoutil" "github.com/pkg/errors" + "google.golang.org/protobuf/proto" ) // UnpackedProposal contains the interesting artifacts from inside the proposal. diff --git a/core/endorser/msgvalidation_test.go b/core/endorser/msgvalidation_test.go index 146bcc4db56..d684d19827c 100644 --- a/core/endorser/msgvalidation_test.go +++ b/core/endorser/msgvalidation_test.go @@ -9,16 +9,15 @@ package endorser_test import ( "fmt" - . "github.com/hyperledger/fabric/internal/test" - . "github.com/onsi/ginkgo/v2" - . "github.com/onsi/gomega" - - cb "github.com/hyperledger/fabric-protos-go/common" - mspproto "github.com/hyperledger/fabric-protos-go/msp" - pb "github.com/hyperledger/fabric-protos-go/peer" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + mspproto "github.com/hyperledger/fabric-protos-go-apiv2/msp" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/core/endorser" "github.com/hyperledger/fabric/core/endorser/fake" + . "github.com/hyperledger/fabric/internal/test" "github.com/hyperledger/fabric/protoutil" + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" ) var _ = Describe("UnpackProposal", func() { diff --git a/core/endorser/plugin_endorser.go b/core/endorser/plugin_endorser.go index 78890def00e..1e4d945fd50 100644 --- a/core/endorser/plugin_endorser.go +++ b/core/endorser/plugin_endorser.go @@ -10,7 +10,7 @@ import ( "fmt" "sync" - pb "github.com/hyperledger/fabric-protos-go/peer" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" endorsement "github.com/hyperledger/fabric/core/handlers/endorsement/api" endorsement3 "github.com/hyperledger/fabric/core/handlers/endorsement/api/identities" "github.com/hyperledger/fabric/core/transientstore" diff --git a/core/endorser/plugin_endorser_test.go b/core/endorser/plugin_endorser_test.go index fa3e9abb26f..1adc61f02ab 100644 --- a/core/endorser/plugin_endorser_test.go +++ b/core/endorser/plugin_endorser_test.go @@ -9,10 +9,9 @@ package endorser_test import ( "testing" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/ledger/rwset" - "github.com/hyperledger/fabric-protos-go/peer" - tspb "github.com/hyperledger/fabric-protos-go/transientstore" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" + tspb "github.com/hyperledger/fabric-protos-go-apiv2/transientstore" "github.com/hyperledger/fabric/core/endorser" "github.com/hyperledger/fabric/core/endorser/fake" "github.com/hyperledger/fabric/core/endorser/mocks" @@ -24,6 +23,7 @@ import ( "github.com/pkg/errors" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) var mockTransientStoreRetriever = transientStoreRetriever() diff --git a/core/endorser/pvtrwset_assembler.go b/core/endorser/pvtrwset_assembler.go index 1025e1e8c7f..89bf92e3f8f 100644 --- a/core/endorser/pvtrwset_assembler.go +++ b/core/endorser/pvtrwset_assembler.go @@ -12,9 +12,9 @@ package endorser import ( "fmt" - "github.com/hyperledger/fabric-protos-go/ledger/rwset" - "github.com/hyperledger/fabric-protos-go/peer" - "github.com/hyperledger/fabric-protos-go/transientstore" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/transientstore" "github.com/hyperledger/fabric/core/ledger" "github.com/pkg/errors" ) diff --git a/core/endorser/pvtrwset_assembler_test.go b/core/endorser/pvtrwset_assembler_test.go index bc183398a3b..e16ff370861 100644 --- a/core/endorser/pvtrwset_assembler_test.go +++ b/core/endorser/pvtrwset_assembler_test.go @@ -12,8 +12,8 @@ package endorser import ( "testing" - "github.com/hyperledger/fabric-protos-go/ledger/rwset" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/core/ledger" "github.com/hyperledger/fabric/core/ledger/mock" "github.com/stretchr/testify/require" diff --git a/core/endorser/state.go b/core/endorser/state.go index 97ec8282324..36a2cd8a154 100644 --- a/core/endorser/state.go +++ b/core/endorser/state.go @@ -7,7 +7,7 @@ SPDX-License-Identifier: Apache-2.0 package endorser import ( - "github.com/hyperledger/fabric-protos-go/ledger/rwset" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset" endorsement "github.com/hyperledger/fabric/core/handlers/endorsement/api/state" "github.com/hyperledger/fabric/core/ledger" "github.com/hyperledger/fabric/core/transientstore" diff --git a/core/endorser/support.go b/core/endorser/support.go index d393283262b..c1d84394ba9 100644 --- a/core/endorser/support.go +++ b/core/endorser/support.go @@ -9,7 +9,7 @@ package endorser import ( "fmt" - pb "github.com/hyperledger/fabric-protos-go/peer" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/channelconfig" "github.com/hyperledger/fabric/core/aclmgmt" "github.com/hyperledger/fabric/core/aclmgmt/resources" diff --git a/core/handlers/auth/auth.go b/core/handlers/auth/auth.go index 9b133065157..4cecf5c7c39 100644 --- a/core/handlers/auth/auth.go +++ b/core/handlers/auth/auth.go @@ -7,7 +7,7 @@ SPDX-License-Identifier: Apache-2.0 package auth import ( - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" ) // Filter defines an authentication filter that intercepts diff --git a/core/handlers/auth/auth_test.go b/core/handlers/auth/auth_test.go index c7c4a92b6e5..5fa84eb6328 100644 --- a/core/handlers/auth/auth_test.go +++ b/core/handlers/auth/auth_test.go @@ -11,7 +11,7 @@ import ( "encoding/binary" "testing" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/stretchr/testify/require" ) diff --git a/core/handlers/auth/filter/expiration.go b/core/handlers/auth/filter/expiration.go index 71f1ef524ba..6a90b8ea6af 100644 --- a/core/handlers/auth/filter/expiration.go +++ b/core/handlers/auth/filter/expiration.go @@ -10,7 +10,7 @@ import ( "context" "time" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/crypto" "github.com/hyperledger/fabric/core/handlers/auth" "github.com/hyperledger/fabric/protoutil" diff --git a/core/handlers/auth/filter/expiration_test.go b/core/handlers/auth/filter/expiration_test.go index fb49a3762fb..f508bb86155 100644 --- a/core/handlers/auth/filter/expiration_test.go +++ b/core/handlers/auth/filter/expiration_test.go @@ -12,12 +12,12 @@ import ( "path/filepath" "testing" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/msp" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/msp" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/protoutil" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) type mutator func([]byte) []byte diff --git a/core/handlers/auth/filter/filter.go b/core/handlers/auth/filter/filter.go index 052c10484bf..18b0120ea3b 100644 --- a/core/handlers/auth/filter/filter.go +++ b/core/handlers/auth/filter/filter.go @@ -9,7 +9,7 @@ package filter import ( "context" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/core/handlers/auth" ) diff --git a/core/handlers/auth/filter/filter_test.go b/core/handlers/auth/filter/filter_test.go index 04782e0cd06..8222660a26b 100644 --- a/core/handlers/auth/filter/filter_test.go +++ b/core/handlers/auth/filter/filter_test.go @@ -10,7 +10,7 @@ import ( "context" "testing" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/stretchr/testify/require" ) diff --git a/core/handlers/auth/filter/timewindow.go b/core/handlers/auth/filter/timewindow.go index 72780db8492..f8a4bb702a0 100644 --- a/core/handlers/auth/filter/timewindow.go +++ b/core/handlers/auth/filter/timewindow.go @@ -10,7 +10,7 @@ import ( "context" "time" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/core/handlers/auth" "github.com/hyperledger/fabric/protoutil" "github.com/pkg/errors" diff --git a/core/handlers/auth/filter/timewindow_test.go b/core/handlers/auth/filter/timewindow_test.go index 1aa4b0662c3..268eef718fd 100644 --- a/core/handlers/auth/filter/timewindow_test.go +++ b/core/handlers/auth/filter/timewindow_test.go @@ -11,11 +11,11 @@ import ( "testing" "time" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/protoutil" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" "google.golang.org/protobuf/types/known/timestamppb" ) diff --git a/core/handlers/auth/plugin/filter.go b/core/handlers/auth/plugin/filter.go index 82a079bd2c9..248467aa667 100644 --- a/core/handlers/auth/plugin/filter.go +++ b/core/handlers/auth/plugin/filter.go @@ -9,7 +9,7 @@ package main import ( "context" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/core/handlers/auth" ) diff --git a/core/handlers/auth/plugin/filter_test.go b/core/handlers/auth/plugin/filter_test.go index 7c0f9f5a879..ac7aec86d55 100644 --- a/core/handlers/auth/plugin/filter_test.go +++ b/core/handlers/auth/plugin/filter_test.go @@ -10,7 +10,7 @@ import ( "context" "testing" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/stretchr/testify/require" ) diff --git a/core/handlers/decoration/decoration.go b/core/handlers/decoration/decoration.go index fdaf5409d4b..160ae66c77c 100644 --- a/core/handlers/decoration/decoration.go +++ b/core/handlers/decoration/decoration.go @@ -7,7 +7,7 @@ SPDX-License-Identifier: Apache-2.0 package decoration import ( - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" ) // Decorator decorates a chaincode input diff --git a/core/handlers/decoration/decoration_test.go b/core/handlers/decoration/decoration_test.go index f3d8f19ee82..ae5a9934e0f 100644 --- a/core/handlers/decoration/decoration_test.go +++ b/core/handlers/decoration/decoration_test.go @@ -10,7 +10,7 @@ import ( "encoding/binary" "testing" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/stretchr/testify/require" ) diff --git a/core/handlers/decoration/decorator/decorator.go b/core/handlers/decoration/decorator/decorator.go index d2e9990a66a..b24a325bfe6 100644 --- a/core/handlers/decoration/decorator/decorator.go +++ b/core/handlers/decoration/decorator/decorator.go @@ -7,7 +7,7 @@ SPDX-License-Identifier: Apache-2.0 package decorator import ( - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/core/handlers/decoration" ) diff --git a/core/handlers/decoration/decorator/decorator_test.go b/core/handlers/decoration/decorator/decorator_test.go index b3924f16037..1be6b056c12 100644 --- a/core/handlers/decoration/decorator/decorator_test.go +++ b/core/handlers/decoration/decorator/decorator_test.go @@ -9,7 +9,7 @@ package decorator import ( "testing" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/stretchr/testify/require" ) diff --git a/core/handlers/decoration/plugin/decorator.go b/core/handlers/decoration/plugin/decorator.go index c77a6acb346..87768399c4f 100644 --- a/core/handlers/decoration/plugin/decorator.go +++ b/core/handlers/decoration/plugin/decorator.go @@ -7,7 +7,7 @@ SPDX-License-Identifier: Apache-2.0 package main import ( - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/core/handlers/decoration" ) diff --git a/core/handlers/decoration/plugin/decorator_test.go b/core/handlers/decoration/plugin/decorator_test.go index 5608982ff8f..9683454f063 100644 --- a/core/handlers/decoration/plugin/decorator_test.go +++ b/core/handlers/decoration/plugin/decorator_test.go @@ -9,7 +9,7 @@ package main import ( "testing" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/stretchr/testify/require" ) diff --git a/core/handlers/endorsement/api/endorsement.go b/core/handlers/endorsement/api/endorsement.go index 5a5b9fe11e2..8caff6a38c7 100644 --- a/core/handlers/endorsement/api/endorsement.go +++ b/core/handlers/endorsement/api/endorsement.go @@ -7,7 +7,7 @@ SPDX-License-Identifier: Apache-2.0 package endorsement import ( - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" ) // Argument defines the argument for endorsement diff --git a/core/handlers/endorsement/api/identities/identities.go b/core/handlers/endorsement/api/identities/identities.go index 77c3651a5f4..cf86ebf8cfe 100644 --- a/core/handlers/endorsement/api/identities/identities.go +++ b/core/handlers/endorsement/api/identities/identities.go @@ -7,7 +7,7 @@ SPDX-License-Identifier: Apache-2.0 package endorsement import ( - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" endorsement "github.com/hyperledger/fabric/core/handlers/endorsement/api" ) diff --git a/core/handlers/endorsement/api/state/state.go b/core/handlers/endorsement/api/state/state.go index bff45c43382..596a3fbea46 100644 --- a/core/handlers/endorsement/api/state/state.go +++ b/core/handlers/endorsement/api/state/state.go @@ -7,7 +7,7 @@ SPDX-License-Identifier: Apache-2.0 package endorsement import ( - "github.com/hyperledger/fabric-protos-go/ledger/rwset" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset" endorsement "github.com/hyperledger/fabric/core/handlers/endorsement/api" ) diff --git a/core/handlers/endorsement/builtin/default_endorsement.go b/core/handlers/endorsement/builtin/default_endorsement.go index deba19ef779..e7cba565ece 100644 --- a/core/handlers/endorsement/builtin/default_endorsement.go +++ b/core/handlers/endorsement/builtin/default_endorsement.go @@ -7,7 +7,7 @@ SPDX-License-Identifier: Apache-2.0 package builtin import ( - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" endorsement "github.com/hyperledger/fabric/core/handlers/endorsement/api" identities "github.com/hyperledger/fabric/core/handlers/endorsement/api/identities" "github.com/pkg/errors" diff --git a/core/handlers/endorsement/builtin/default_endorsement_test.go b/core/handlers/endorsement/builtin/default_endorsement_test.go index 258306bca44..1b40088834e 100644 --- a/core/handlers/endorsement/builtin/default_endorsement_test.go +++ b/core/handlers/endorsement/builtin/default_endorsement_test.go @@ -9,7 +9,7 @@ package builtin_test import ( "testing" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/core/endorser/mocks" "github.com/hyperledger/fabric/core/handlers/endorsement/builtin" mocks2 "github.com/hyperledger/fabric/core/handlers/endorsement/builtin/mocks" diff --git a/core/handlers/endorsement/plugin/plugin.go b/core/handlers/endorsement/plugin/plugin.go index 4a63e336c3d..f6e09ae2b8d 100644 --- a/core/handlers/endorsement/plugin/plugin.go +++ b/core/handlers/endorsement/plugin/plugin.go @@ -10,7 +10,7 @@ import ( "errors" "fmt" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" endorsement "github.com/hyperledger/fabric/core/handlers/endorsement/api" identities "github.com/hyperledger/fabric/core/handlers/endorsement/api/identities" ) diff --git a/core/handlers/endorsement/plugin/plugin_test.go b/core/handlers/endorsement/plugin/plugin_test.go index a794b1a099c..645e73a548a 100644 --- a/core/handlers/endorsement/plugin/plugin_test.go +++ b/core/handlers/endorsement/plugin/plugin_test.go @@ -10,7 +10,7 @@ import ( "errors" "testing" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/core/endorser/mocks" mocks2 "github.com/hyperledger/fabric/core/handlers/endorsement/builtin/mocks" plgn "github.com/hyperledger/fabric/core/handlers/endorsement/plugin" diff --git a/core/handlers/endorsement/testdata/noop_endorser.go b/core/handlers/endorsement/testdata/noop_endorser.go index 7649cf6734e..a459c3fa59b 100644 --- a/core/handlers/endorsement/testdata/noop_endorser.go +++ b/core/handlers/endorsement/testdata/noop_endorser.go @@ -7,7 +7,7 @@ SPDX-License-Identifier: Apache-2.0 package main import ( - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" endorsement "github.com/hyperledger/fabric/core/handlers/endorsement/api" ) diff --git a/core/handlers/library/registry_plugin_test.go b/core/handlers/library/registry_plugin_test.go index 28a0362e722..fce8b84787d 100644 --- a/core/handlers/library/registry_plugin_test.go +++ b/core/handlers/library/registry_plugin_test.go @@ -12,11 +12,11 @@ import ( "path/filepath" "testing" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" endorsement "github.com/hyperledger/fabric/core/handlers/endorsement/api" validation "github.com/hyperledger/fabric/core/handlers/validation/api" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) const ( diff --git a/core/handlers/validation/api/identities/identities.go b/core/handlers/validation/api/identities/identities.go index ddf06e2bc54..d2d4cc8968e 100644 --- a/core/handlers/validation/api/identities/identities.go +++ b/core/handlers/validation/api/identities/identities.go @@ -7,7 +7,7 @@ SPDX-License-Identifier: Apache-2.0 package validation import ( - "github.com/hyperledger/fabric-protos-go/msp" + "github.com/hyperledger/fabric-protos-go-apiv2/msp" validation "github.com/hyperledger/fabric/core/handlers/validation/api" ) diff --git a/core/handlers/validation/api/validation.go b/core/handlers/validation/api/validation.go index a6941dc2474..0c7d7450260 100644 --- a/core/handlers/validation/api/validation.go +++ b/core/handlers/validation/api/validation.go @@ -6,7 +6,7 @@ SPDX-License-Identifier: Apache-2.0 package validation -import "github.com/hyperledger/fabric-protos-go/common" +import "github.com/hyperledger/fabric-protos-go-apiv2/common" // Argument defines the argument for validation type Argument interface { diff --git a/core/handlers/validation/builtin/default_validation.go b/core/handlers/validation/builtin/default_validation.go index 9236d5ef819..be78da09913 100644 --- a/core/handlers/validation/builtin/default_validation.go +++ b/core/handlers/validation/builtin/default_validation.go @@ -11,7 +11,7 @@ import ( "reflect" "github.com/hyperledger/fabric-lib-go/common/flogging" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" commonerrors "github.com/hyperledger/fabric/common/errors" "github.com/hyperledger/fabric/core/committer/txvalidator/v20/plugindispatcher" validation "github.com/hyperledger/fabric/core/handlers/validation/api" diff --git a/core/handlers/validation/builtin/default_validation_test.go b/core/handlers/validation/builtin/default_validation_test.go index 46c79961907..e37ea261e67 100644 --- a/core/handlers/validation/builtin/default_validation_test.go +++ b/core/handlers/validation/builtin/default_validation_test.go @@ -9,7 +9,7 @@ package builtin import ( "testing" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" commonerrors "github.com/hyperledger/fabric/common/errors" "github.com/hyperledger/fabric/core/committer/txvalidator/plugin" . "github.com/hyperledger/fabric/core/handlers/validation/api" diff --git a/core/handlers/validation/builtin/mocks/transaction_validator.go b/core/handlers/validation/builtin/mocks/transaction_validator.go index b550d6b23f6..169f2f06c36 100644 --- a/core/handlers/validation/builtin/mocks/transaction_validator.go +++ b/core/handlers/validation/builtin/mocks/transaction_validator.go @@ -3,7 +3,7 @@ package mocks import ( - common "github.com/hyperledger/fabric-protos-go/common" + common "github.com/hyperledger/fabric-protos-go-apiv2/common" errors "github.com/hyperledger/fabric/common/errors" mock "github.com/stretchr/testify/mock" diff --git a/core/handlers/validation/builtin/v12/validation_logic.go b/core/handlers/validation/builtin/v12/validation_logic.go index 1269fb82f3a..4f7fd4d203b 100644 --- a/core/handlers/validation/builtin/v12/validation_logic.go +++ b/core/handlers/validation/builtin/v12/validation_logic.go @@ -11,12 +11,11 @@ import ( "fmt" "regexp" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/common/flogging" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/ledger/rwset/kvrwset" - "github.com/hyperledger/fabric-protos-go/msp" - pb "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset/kvrwset" + "github.com/hyperledger/fabric-protos-go-apiv2/msp" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" commonerrors "github.com/hyperledger/fabric/common/errors" "github.com/hyperledger/fabric/core/common/ccprovider" "github.com/hyperledger/fabric/core/common/privdata" @@ -28,6 +27,7 @@ import ( "github.com/hyperledger/fabric/core/scc/lscc" "github.com/hyperledger/fabric/protoutil" "github.com/pkg/errors" + "google.golang.org/protobuf/proto" ) var ( diff --git a/core/handlers/validation/builtin/v12/validation_logic_test.go b/core/handlers/validation/builtin/v12/validation_logic_test.go index 1b65317a2bd..23cad3bb199 100644 --- a/core/handlers/validation/builtin/v12/validation_logic_test.go +++ b/core/handlers/validation/builtin/v12/validation_logic_test.go @@ -10,12 +10,11 @@ import ( "os" "testing" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/bccsp/sw" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/ledger/rwset/kvrwset" - mspproto "github.com/hyperledger/fabric-protos-go/msp" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset/kvrwset" + mspproto "github.com/hyperledger/fabric-protos-go-apiv2/msp" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/capabilities" "github.com/hyperledger/fabric/common/channelconfig" "github.com/hyperledger/fabric/common/policydsl" @@ -33,6 +32,7 @@ import ( "github.com/hyperledger/fabric/protoutil" "github.com/pkg/errors" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) //go:generate counterfeiter -o mocks/state.go -fake-name State . vsState diff --git a/core/handlers/validation/builtin/v13/lscc_validation_logic.go b/core/handlers/validation/builtin/v13/lscc_validation_logic.go index 3c83e37815f..70da65c8f49 100644 --- a/core/handlers/validation/builtin/v13/lscc_validation_logic.go +++ b/core/handlers/validation/builtin/v13/lscc_validation_logic.go @@ -10,10 +10,9 @@ import ( "bytes" "fmt" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/ledger/rwset/kvrwset" - pb "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset/kvrwset" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" commonerrors "github.com/hyperledger/fabric/common/errors" "github.com/hyperledger/fabric/core/common/ccprovider" "github.com/hyperledger/fabric/core/common/privdata" @@ -23,6 +22,7 @@ import ( "github.com/hyperledger/fabric/core/scc/lscc" "github.com/hyperledger/fabric/protoutil" "github.com/pkg/errors" + "google.golang.org/protobuf/proto" ) // currently defined system chaincode names that shouldn't diff --git a/core/handlers/validation/builtin/v13/mocks/state_based_validator.go b/core/handlers/validation/builtin/v13/mocks/state_based_validator.go index 1d3d877386a..8ef72d367ad 100644 --- a/core/handlers/validation/builtin/v13/mocks/state_based_validator.go +++ b/core/handlers/validation/builtin/v13/mocks/state_based_validator.go @@ -3,12 +3,12 @@ package mocks import ( - common "github.com/hyperledger/fabric-protos-go/common" + common "github.com/hyperledger/fabric-protos-go-apiv2/common" errors "github.com/hyperledger/fabric/common/errors" mock "github.com/stretchr/testify/mock" - peer "github.com/hyperledger/fabric-protos-go/peer" + peer "github.com/hyperledger/fabric-protos-go-apiv2/peer" ) // StateBasedValidator is an autogenerated mock type for the StateBasedValidator type diff --git a/core/handlers/validation/builtin/v13/validation_logic.go b/core/handlers/validation/builtin/v13/validation_logic.go index 37cd096a4f1..4cb0a731020 100644 --- a/core/handlers/validation/builtin/v13/validation_logic.go +++ b/core/handlers/validation/builtin/v13/validation_logic.go @@ -11,8 +11,8 @@ import ( "regexp" "github.com/hyperledger/fabric-lib-go/common/flogging" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" commonerrors "github.com/hyperledger/fabric/common/errors" "github.com/hyperledger/fabric/core/common/validation/statebased" vc "github.com/hyperledger/fabric/core/handlers/validation/api/capabilities" diff --git a/core/handlers/validation/builtin/v13/validation_logic_test.go b/core/handlers/validation/builtin/v13/validation_logic_test.go index 8e2e26cd129..1ecfea09bb1 100644 --- a/core/handlers/validation/builtin/v13/validation_logic_test.go +++ b/core/handlers/validation/builtin/v13/validation_logic_test.go @@ -10,11 +10,10 @@ import ( "os" "testing" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/bccsp/sw" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/ledger/rwset/kvrwset" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset/kvrwset" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/capabilities" "github.com/hyperledger/fabric/common/channelconfig" commonerrors "github.com/hyperledger/fabric/common/errors" @@ -34,6 +33,7 @@ import ( "github.com/pkg/errors" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) //go:generate counterfeiter -o mocks/state.go -fake-name State . vsState diff --git a/core/handlers/validation/builtin/v13/validator.go b/core/handlers/validation/builtin/v13/validator.go index 726748539db..944c6899df2 100644 --- a/core/handlers/validation/builtin/v13/validator.go +++ b/core/handlers/validation/builtin/v13/validator.go @@ -7,8 +7,8 @@ SPDX-License-Identifier: Apache-2.0 package v13 import ( - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" commonerrors "github.com/hyperledger/fabric/common/errors" ) diff --git a/core/handlers/validation/builtin/v20/mocks/state_based_validator.go b/core/handlers/validation/builtin/v20/mocks/state_based_validator.go index 1d3d877386a..8ef72d367ad 100644 --- a/core/handlers/validation/builtin/v20/mocks/state_based_validator.go +++ b/core/handlers/validation/builtin/v20/mocks/state_based_validator.go @@ -3,12 +3,12 @@ package mocks import ( - common "github.com/hyperledger/fabric-protos-go/common" + common "github.com/hyperledger/fabric-protos-go-apiv2/common" errors "github.com/hyperledger/fabric/common/errors" mock "github.com/stretchr/testify/mock" - peer "github.com/hyperledger/fabric-protos-go/peer" + peer "github.com/hyperledger/fabric-protos-go-apiv2/peer" ) // StateBasedValidator is an autogenerated mock type for the StateBasedValidator type diff --git a/core/handlers/validation/builtin/v20/validation_logic.go b/core/handlers/validation/builtin/v20/validation_logic.go index f92ff927e76..40abff9de01 100644 --- a/core/handlers/validation/builtin/v20/validation_logic.go +++ b/core/handlers/validation/builtin/v20/validation_logic.go @@ -9,10 +9,9 @@ package v20 import ( "fmt" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/common/flogging" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" commonerrors "github.com/hyperledger/fabric/common/errors" "github.com/hyperledger/fabric/core/common/validation/statebased" vc "github.com/hyperledger/fabric/core/handlers/validation/api/capabilities" @@ -21,6 +20,7 @@ import ( vs "github.com/hyperledger/fabric/core/handlers/validation/api/state" "github.com/hyperledger/fabric/protoutil" "github.com/pkg/errors" + "google.golang.org/protobuf/proto" ) var logger = flogging.MustGetLogger("vscc") diff --git a/core/handlers/validation/builtin/v20/validation_logic_test.go b/core/handlers/validation/builtin/v20/validation_logic_test.go index 3a194ce1acd..7b4cd2e304d 100644 --- a/core/handlers/validation/builtin/v20/validation_logic_test.go +++ b/core/handlers/validation/builtin/v20/validation_logic_test.go @@ -12,8 +12,8 @@ import ( "testing" "github.com/hyperledger/fabric-lib-go/bccsp/sw" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" commonerrors "github.com/hyperledger/fabric/common/errors" "github.com/hyperledger/fabric/common/policydsl" "github.com/hyperledger/fabric/core/committer/txvalidator/v14" diff --git a/core/handlers/validation/builtin/v20/validator.go b/core/handlers/validation/builtin/v20/validator.go index 8c6dbd08b33..9a77264f6a7 100644 --- a/core/handlers/validation/builtin/v20/validator.go +++ b/core/handlers/validation/builtin/v20/validator.go @@ -7,8 +7,8 @@ SPDX-License-Identifier: Apache-2.0 package v20 import ( - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" commonerrors "github.com/hyperledger/fabric/common/errors" ) diff --git a/core/handlers/validation/testdata/noop_validator.go b/core/handlers/validation/testdata/noop_validator.go index 375e099cde5..26c592dfd36 100644 --- a/core/handlers/validation/testdata/noop_validator.go +++ b/core/handlers/validation/testdata/noop_validator.go @@ -7,7 +7,7 @@ SPDX-License-Identifier: Apache-2.0 package main import ( - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" validation "github.com/hyperledger/fabric/core/handlers/validation/api" ) diff --git a/core/ledger/cceventmgmt/defs.go b/core/ledger/cceventmgmt/defs.go index 370e44a4993..5eabb3728de 100644 --- a/core/ledger/cceventmgmt/defs.go +++ b/core/ledger/cceventmgmt/defs.go @@ -9,7 +9,7 @@ package cceventmgmt import ( "fmt" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/core/ledger" ) diff --git a/core/ledger/cceventmgmt/lsccstate_listener.go b/core/ledger/cceventmgmt/lsccstate_listener.go index f1f58e587ae..ddba9c30d97 100644 --- a/core/ledger/cceventmgmt/lsccstate_listener.go +++ b/core/ledger/cceventmgmt/lsccstate_listener.go @@ -7,7 +7,7 @@ SPDX-License-Identifier: Apache-2.0 package cceventmgmt import ( - "github.com/hyperledger/fabric-protos-go/ledger/rwset/kvrwset" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset/kvrwset" "github.com/hyperledger/fabric/core/ledger" ) diff --git a/core/ledger/cceventmgmt/mgmt_test.go b/core/ledger/cceventmgmt/mgmt_test.go index f5c2aab64e6..962b8c90311 100644 --- a/core/ledger/cceventmgmt/mgmt_test.go +++ b/core/ledger/cceventmgmt/mgmt_test.go @@ -11,7 +11,7 @@ import ( "testing" "github.com/hyperledger/fabric-lib-go/common/flogging" - "github.com/hyperledger/fabric-protos-go/ledger/rwset/kvrwset" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset/kvrwset" "github.com/hyperledger/fabric/core/ledger" "github.com/hyperledger/fabric/core/ledger/mock" "github.com/stretchr/testify/require" diff --git a/core/ledger/confighistory/confighistorytest/confighistory.go b/core/ledger/confighistory/confighistorytest/confighistory.go index c2bc9ba2f86..25b07c12833 100644 --- a/core/ledger/confighistory/confighistorytest/confighistory.go +++ b/core/ledger/confighistory/confighistorytest/confighistory.go @@ -7,7 +7,7 @@ SPDX-License-Identifier: Apache-2.0 package confighistorytest import ( - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/core/ledger" "github.com/hyperledger/fabric/core/ledger/confighistory" "github.com/hyperledger/fabric/core/ledger/mock" diff --git a/core/ledger/confighistory/confighistorytest/confighistory_test.go b/core/ledger/confighistory/confighistorytest/confighistory_test.go index fc5a3a5742e..10454a18b79 100644 --- a/core/ledger/confighistory/confighistorytest/confighistory_test.go +++ b/core/ledger/confighistory/confighistorytest/confighistory_test.go @@ -11,9 +11,9 @@ import ( "math" "testing" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) func TestConfigHistory(t *testing.T) { diff --git a/core/ledger/confighistory/mgr.go b/core/ledger/confighistory/mgr.go index c23fe92e982..f1573933899 100644 --- a/core/ledger/confighistory/mgr.go +++ b/core/ledger/confighistory/mgr.go @@ -10,14 +10,14 @@ import ( "fmt" "path/filepath" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/common/flogging" - "github.com/hyperledger/fabric-protos-go/ledger/rwset/kvrwset" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset/kvrwset" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/ledger/snapshot" "github.com/hyperledger/fabric/core/ledger" "github.com/hyperledger/fabric/internal/fileutil" "github.com/pkg/errors" + "google.golang.org/protobuf/proto" ) var ( diff --git a/core/ledger/confighistory/mgr_test.go b/core/ledger/confighistory/mgr_test.go index 79c18122fd2..164720d115d 100644 --- a/core/ledger/confighistory/mgr_test.go +++ b/core/ledger/confighistory/mgr_test.go @@ -15,13 +15,13 @@ import ( "path/filepath" "testing" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/common/flogging" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/ledger/snapshot" "github.com/hyperledger/fabric/core/ledger" "github.com/hyperledger/fabric/core/ledger/mock" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) var testNewHashFunc = func() (hash.Hash, error) { @@ -108,7 +108,7 @@ func TestMgrQueries(t *testing.T) { retrievedConfig, err := retriever.MostRecentCollectionConfigBelow(testHeight, chaincodeName) require.NoError(t, err) expectedConfig := sampleCollectionConfigPackage(ledgerid, expectedHeight) - require.Equal(t, expectedConfig, retrievedConfig.CollectionConfig) + require.True(t, proto.Equal(expectedConfig, retrievedConfig.CollectionConfig)) require.Equal(t, expectedHeight, retrievedConfig.CommittingBlockNum) } @@ -155,7 +155,7 @@ func TestDrop(t *testing.T) { retrievedConfig, err = retriever2.MostRecentCollectionConfigBelow(testHeight, chaincodeName) require.NoError(t, err) expectedConfig := sampleCollectionConfigPackage("ledger2", expectedHeight) - require.Equal(t, expectedConfig, retrievedConfig.CollectionConfig) + require.True(t, proto.Equal(expectedConfig, retrievedConfig.CollectionConfig)) require.Equal(t, expectedHeight, retrievedConfig.CommittingBlockNum) } diff --git a/core/ledger/kvledger/benchmark/chainmgmt/block_gen.go b/core/ledger/kvledger/benchmark/chainmgmt/block_gen.go index b4d40ea8268..d2fb17ea224 100644 --- a/core/ledger/kvledger/benchmark/chainmgmt/block_gen.go +++ b/core/ledger/kvledger/benchmark/chainmgmt/block_gen.go @@ -9,11 +9,11 @@ package chainmgmt import ( "sync" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/internal/pkg/txflags" "github.com/hyperledger/fabric/protoutil" + "google.golang.org/protobuf/proto" ) const ( diff --git a/core/ledger/kvledger/benchmark/chainmgmt/chains.go b/core/ledger/kvledger/benchmark/chainmgmt/chains.go index fc05f223edf..b285b08bf8c 100644 --- a/core/ledger/kvledger/benchmark/chainmgmt/chains.go +++ b/core/ledger/kvledger/benchmark/chainmgmt/chains.go @@ -12,7 +12,7 @@ import ( "path/filepath" "sync" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/common/configtx/test" "github.com/hyperledger/fabric/core/ledger" "github.com/hyperledger/fabric/core/ledger/ledgermgmt" diff --git a/core/ledger/kvledger/benchmark/chainmgmt/tx_envelope_gen.go b/core/ledger/kvledger/benchmark/chainmgmt/tx_envelope_gen.go index b246996489a..9454be42dbf 100644 --- a/core/ledger/kvledger/benchmark/chainmgmt/tx_envelope_gen.go +++ b/core/ledger/kvledger/benchmark/chainmgmt/tx_envelope_gen.go @@ -9,8 +9,8 @@ package chainmgmt import ( "fmt" - "github.com/hyperledger/fabric-protos-go/common" - pb "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/core/ledger/kvledger/benchmark/mocks" "github.com/hyperledger/fabric/msp" "github.com/hyperledger/fabric/protoutil" diff --git a/core/ledger/kvledger/benchmark/mocks/msp.go b/core/ledger/kvledger/benchmark/mocks/msp.go index 32d3dc8cfcf..0a9f2d9aebf 100644 --- a/core/ledger/kvledger/benchmark/mocks/msp.go +++ b/core/ledger/kvledger/benchmark/mocks/msp.go @@ -9,7 +9,7 @@ package mocks import ( "time" - mspprotos "github.com/hyperledger/fabric-protos-go/msp" + mspprotos "github.com/hyperledger/fabric-protos-go-apiv2/msp" "github.com/hyperledger/fabric/msp" ) diff --git a/core/ledger/kvledger/channelinfo_provider.go b/core/ledger/kvledger/channelinfo_provider.go index e68261a2b35..507284ce3ab 100644 --- a/core/ledger/kvledger/channelinfo_provider.go +++ b/core/ledger/kvledger/channelinfo_provider.go @@ -8,8 +8,8 @@ package kvledger import ( "github.com/hyperledger/fabric-lib-go/bccsp/factory" - cb "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/ledger/queryresult" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/queryresult" "github.com/hyperledger/fabric/common/channelconfig" commonledger "github.com/hyperledger/fabric/common/ledger" "github.com/hyperledger/fabric/common/ledger/blkstorage" diff --git a/core/ledger/kvledger/channelinfo_provider_test.go b/core/ledger/kvledger/channelinfo_provider_test.go index 544759c0bdb..ca566207c8d 100644 --- a/core/ledger/kvledger/channelinfo_provider_test.go +++ b/core/ledger/kvledger/channelinfo_provider_test.go @@ -12,11 +12,10 @@ import ( "os" "testing" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-config/protolator" "github.com/hyperledger/fabric-lib-go/common/metrics/disabled" - cb "github.com/hyperledger/fabric-protos-go/common" - pb "github.com/hyperledger/fabric-protos-go/peer" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/channelconfig" "github.com/hyperledger/fabric/common/configtx/test" "github.com/hyperledger/fabric/common/ledger/blkstorage" @@ -25,6 +24,7 @@ import ( "github.com/hyperledger/fabric/core/ledger/mock" "github.com/hyperledger/fabric/protoutil" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) func TestNamespacesAndCollections(t *testing.T) { diff --git a/core/ledger/kvledger/coll_elg_notifier.go b/core/ledger/kvledger/coll_elg_notifier.go index 677a6005dfc..ccd1212b4e1 100644 --- a/core/ledger/kvledger/coll_elg_notifier.go +++ b/core/ledger/kvledger/coll_elg_notifier.go @@ -7,8 +7,8 @@ SPDX-License-Identifier: Apache-2.0 package kvledger import ( - "github.com/hyperledger/fabric-protos-go/ledger/rwset/kvrwset" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset/kvrwset" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/core/ledger" ) diff --git a/core/ledger/kvledger/coll_elg_notifier_test.go b/core/ledger/kvledger/coll_elg_notifier_test.go index 22ceca8ded0..902a09d4ab5 100644 --- a/core/ledger/kvledger/coll_elg_notifier_test.go +++ b/core/ledger/kvledger/coll_elg_notifier_test.go @@ -9,9 +9,9 @@ package kvledger import ( "testing" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/ledger/rwset/kvrwset" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset/kvrwset" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/core/ledger" "github.com/hyperledger/fabric/core/ledger/mock" "github.com/stretchr/testify/require" diff --git a/core/ledger/kvledger/hashcheck_pvtdata.go b/core/ledger/kvledger/hashcheck_pvtdata.go index ed41157aec0..d116dc4520b 100644 --- a/core/ledger/kvledger/hashcheck_pvtdata.go +++ b/core/ledger/kvledger/hashcheck_pvtdata.go @@ -9,8 +9,8 @@ package kvledger import ( "bytes" - "github.com/hyperledger/fabric-protos-go/ledger/rwset" - "github.com/hyperledger/fabric-protos-go/ledger/rwset/kvrwset" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset/kvrwset" "github.com/hyperledger/fabric/common/ledger/blkstorage" "github.com/hyperledger/fabric/common/util" "github.com/hyperledger/fabric/core/ledger" diff --git a/core/ledger/kvledger/hashcheck_pvtdata_test.go b/core/ledger/kvledger/hashcheck_pvtdata_test.go index 8db47ab14a7..d3e74d63bc9 100644 --- a/core/ledger/kvledger/hashcheck_pvtdata_test.go +++ b/core/ledger/kvledger/hashcheck_pvtdata_test.go @@ -10,13 +10,13 @@ import ( "fmt" "testing" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/ledger/rwset" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/ledger/testutil" "github.com/hyperledger/fabric/core/ledger" "github.com/hyperledger/fabric/core/ledger/kvledger/txmgmt/rwsetutil" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) func TestExtractValidPvtData(t *testing.T) { @@ -407,7 +407,7 @@ func verifyBlocksPvtdata(t *testing.T, expected, actual map[uint64][]*ledger.TxP for _, e := range expectedTx { require.NotNil(t, m[e.SeqInBlock]) - require.Equal(t, e.WriteSet, m[e.SeqInBlock]) + require.True(t, proto.Equal(e.WriteSet, m[e.SeqInBlock])) } } } diff --git a/core/ledger/kvledger/history/db.go b/core/ledger/kvledger/history/db.go index 01712c8832e..d47e2039c0d 100644 --- a/core/ledger/kvledger/history/db.go +++ b/core/ledger/kvledger/history/db.go @@ -8,7 +8,7 @@ package history import ( "github.com/hyperledger/fabric-lib-go/common/flogging" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/common/ledger/blkstorage" "github.com/hyperledger/fabric/common/ledger/dataformat" "github.com/hyperledger/fabric/common/ledger/util/leveldbhelper" diff --git a/core/ledger/kvledger/history/db_test.go b/core/ledger/kvledger/history/db_test.go index c4d1f448862..d2c0bcf232a 100644 --- a/core/ledger/kvledger/history/db_test.go +++ b/core/ledger/kvledger/history/db_test.go @@ -13,13 +13,12 @@ import ( "strconv" "testing" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/common/flogging" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/ledger/queryresult" - "github.com/hyperledger/fabric-protos-go/ledger/rwset" - "github.com/hyperledger/fabric-protos-go/ledger/rwset/kvrwset" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/queryresult" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset/kvrwset" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" configtxtest "github.com/hyperledger/fabric/common/configtx/test" "github.com/hyperledger/fabric/common/ledger/testutil" util2 "github.com/hyperledger/fabric/common/util" @@ -27,6 +26,7 @@ import ( "github.com/hyperledger/fabric/core/ledger/internal/version" "github.com/hyperledger/fabric/internal/pkg/txflags" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) func TestMain(m *testing.M) { diff --git a/core/ledger/kvledger/history/query_executer.go b/core/ledger/kvledger/history/query_executer.go index bf4c4ded98e..c2b24c511d6 100644 --- a/core/ledger/kvledger/history/query_executer.go +++ b/core/ledger/kvledger/history/query_executer.go @@ -7,8 +7,8 @@ SPDX-License-Identifier: Apache-2.0 package history import ( - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/ledger/queryresult" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/queryresult" commonledger "github.com/hyperledger/fabric/common/ledger" "github.com/hyperledger/fabric/common/ledger/blkstorage" "github.com/hyperledger/fabric/common/ledger/util/leveldbhelper" diff --git a/core/ledger/kvledger/kv_ledger.go b/core/ledger/kvledger/kv_ledger.go index a73828687d5..3fadca7c4cc 100644 --- a/core/ledger/kvledger/kv_ledger.go +++ b/core/ledger/kvledger/kv_ledger.go @@ -14,11 +14,10 @@ import ( "sync/atomic" "time" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/bccsp" "github.com/hyperledger/fabric-lib-go/common/flogging" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" commonledger "github.com/hyperledger/fabric/common/ledger" "github.com/hyperledger/fabric/common/ledger/blkstorage" "github.com/hyperledger/fabric/common/util" @@ -37,6 +36,7 @@ import ( "github.com/hyperledger/fabric/protoutil" "github.com/pkg/errors" "google.golang.org/protobuf/encoding/protowire" + "google.golang.org/protobuf/proto" ) var logger = flogging.MustGetLogger("kvledger") diff --git a/core/ledger/kvledger/kv_ledger_provider.go b/core/ledger/kvledger/kv_ledger_provider.go index 445ee38c19f..a5ab8b5039a 100644 --- a/core/ledger/kvledger/kv_ledger_provider.go +++ b/core/ledger/kvledger/kv_ledger_provider.go @@ -12,8 +12,7 @@ import ( "os" "path/filepath" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/common/ledger/blkstorage" "github.com/hyperledger/fabric/common/ledger/dataformat" "github.com/hyperledger/fabric/common/ledger/util/leveldbhelper" @@ -28,6 +27,7 @@ import ( "github.com/hyperledger/fabric/protoutil" "github.com/pkg/errors" "github.com/syndtr/goleveldb/leveldb" + "google.golang.org/protobuf/proto" ) var ( diff --git a/core/ledger/kvledger/kv_ledger_provider_test.go b/core/ledger/kvledger/kv_ledger_provider_test.go index 57a96b196ea..fa1bc2b43bc 100644 --- a/core/ledger/kvledger/kv_ledger_provider_test.go +++ b/core/ledger/kvledger/kv_ledger_provider_test.go @@ -14,12 +14,11 @@ import ( "testing" "time" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/bccsp/sw" "github.com/hyperledger/fabric-lib-go/common/metrics/disabled" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/ledger/queryresult" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/queryresult" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" configtxtest "github.com/hyperledger/fabric/common/configtx/test" "github.com/hyperledger/fabric/common/ledger/blkstorage" "github.com/hyperledger/fabric/common/ledger/dataformat" @@ -31,6 +30,7 @@ import ( "github.com/hyperledger/fabric/core/ledger/mock" "github.com/hyperledger/fabric/protoutil" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) func TestLedgerProvider(t *testing.T) { diff --git a/core/ledger/kvledger/kv_ledger_test.go b/core/ledger/kvledger/kv_ledger_test.go index 2c66b68c98e..bfe04dc779a 100644 --- a/core/ledger/kvledger/kv_ledger_test.go +++ b/core/ledger/kvledger/kv_ledger_test.go @@ -10,13 +10,12 @@ import ( "os" "testing" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/common/flogging" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/ledger/queryresult" - "github.com/hyperledger/fabric-protos-go/ledger/rwset" - "github.com/hyperledger/fabric-protos-go/ledger/rwset/kvrwset" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/queryresult" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset/kvrwset" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/ledger/testutil" "github.com/hyperledger/fabric/common/util" "github.com/hyperledger/fabric/core/ledger" @@ -29,6 +28,7 @@ import ( "github.com/hyperledger/fabric/protoutil" "github.com/pkg/errors" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) var ( @@ -74,9 +74,9 @@ func TestKVLedgerBlockStorage(t *testing.T) { defer lgr.Close() bcInfo, _ := lgr.GetBlockchainInfo() - require.Equal(t, &common.BlockchainInfo{ + require.True(t, proto.Equal(&common.BlockchainInfo{ Height: 1, CurrentBlockHash: gbHash, PreviousBlockHash: nil, - }, bcInfo) + }, bcInfo)) txid := util.GenerateUUID() simulator, _ := lgr.NewTxSimulator(txid) @@ -91,9 +91,9 @@ func TestKVLedgerBlockStorage(t *testing.T) { bcInfo, _ = lgr.GetBlockchainInfo() block1Hash := protoutil.BlockHeaderHash(block1.Header) - require.Equal(t, &common.BlockchainInfo{ + require.True(t, proto.Equal(&common.BlockchainInfo{ Height: 2, CurrentBlockHash: block1Hash, PreviousBlockHash: gbHash, - }, bcInfo) + }, bcInfo)) txid = util.GenerateUUID() simulator, _ = lgr.NewTxSimulator(txid) @@ -108,9 +108,9 @@ func TestKVLedgerBlockStorage(t *testing.T) { bcInfo, _ = lgr.GetBlockchainInfo() block2Hash := protoutil.BlockHeaderHash(block2.Header) - require.Equal(t, &common.BlockchainInfo{ + require.True(t, proto.Equal(&common.BlockchainInfo{ Height: 3, CurrentBlockHash: block2Hash, PreviousBlockHash: block1Hash, - }, bcInfo) + }, bcInfo)) b0, _ := lgr.GetBlockByHash(gbHash) require.True(t, proto.Equal(b0, gb), "proto messages are not equal") @@ -122,7 +122,7 @@ func TestKVLedgerBlockStorage(t *testing.T) { require.True(t, proto.Equal(b0, gb), "proto messages are not equal") b1, _ = lgr.GetBlockByNumber(1) - require.Equal(t, block1, b1) + require.True(t, proto.Equal(block1, b1)) // get the tran id from the 2nd block, then use it to test GetTransactionByID() txEnvBytes2 := block1.Data.Data[0] @@ -142,7 +142,7 @@ func TestKVLedgerBlockStorage(t *testing.T) { require.NoError(t, err, "Error upon GetTransactionByID") // get the tran envelope from the retrieved ProcessedTransaction retrievedTxEnv2 := processedTran2.TransactionEnvelope - require.Equal(t, txEnv2, retrievedTxEnv2) + require.True(t, proto.Equal(txEnv2, retrievedTxEnv2)) // get the tran id from the 2nd block, then use it to test GetBlockByTxID b1, _ = lgr.GetBlockByTxID(txID2) @@ -636,9 +636,9 @@ func TestPvtDataAPIs(t *testing.T) { lgr.(*kvLedger).pvtdataStore.Init(btlPolicyForSampleData()) bcInfo, _ := lgr.GetBlockchainInfo() - require.Equal(t, &common.BlockchainInfo{ + require.True(t, proto.Equal(&common.BlockchainInfo{ Height: 1, CurrentBlockHash: gbHash, PreviousBlockHash: nil, - }, bcInfo) + }, bcInfo)) kvlgr := lgr.(*kvLedger) @@ -687,7 +687,7 @@ func TestPvtDataAPIs(t *testing.T) { filter.Add("ns-1", "coll-1") blockAndPvtdata, err = lgr.GetPvtDataAndBlockByNum(4, filter) require.NoError(t, err) - require.Equal(t, sampleData[3].Block, blockAndPvtdata.Block) + require.True(t, proto.Equal(sampleData[3].Block, blockAndPvtdata.Block)) // two transactions should be present require.Equal(t, 2, len(blockAndPvtdata.PvtData)) // both tran number 4 and 6 should have only one collection because of filter @@ -1093,7 +1093,12 @@ func TestCollectionConfigHistoryRetriever(t *testing.T) { actualOutput, err := r.MostRecentCollectionConfigBelow(testcase.explicitCollConfigsBlockNum+1, chaincodeName) require.NoError(t, err) - require.Equal(t, testcase.expectedOutput, actualOutput) + if testcase.expectedOutput != nil && actualOutput != nil { + require.Equal(t, testcase.expectedOutput.CommittingBlockNum, actualOutput.CommittingBlockNum) + require.True(t, proto.Equal(testcase.expectedOutput.CollectionConfig, actualOutput.CollectionConfig)) + } else { + require.Equal(t, testcase.expectedOutput, actualOutput) + } }, ) } diff --git a/core/ledger/kvledger/metrics_test.go b/core/ledger/kvledger/metrics_test.go index a60ad3bb076..1d039415c10 100644 --- a/core/ledger/kvledger/metrics_test.go +++ b/core/ledger/kvledger/metrics_test.go @@ -13,8 +13,8 @@ import ( "github.com/hyperledger/fabric-lib-go/bccsp/sw" "github.com/hyperledger/fabric-lib-go/common/metrics" "github.com/hyperledger/fabric-lib-go/common/metrics/metricsfakes" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/ledger/testutil" lgr "github.com/hyperledger/fabric/core/ledger" "github.com/hyperledger/fabric/core/ledger/kvledger/txmgmt/validation" diff --git a/core/ledger/kvledger/msgs/ledger_metadata.pb.go b/core/ledger/kvledger/msgs/ledger_metadata.pb.go index e22baba0458..5791142c57f 100644 --- a/core/ledger/kvledger/msgs/ledger_metadata.pb.go +++ b/core/ledger/kvledger/msgs/ledger_metadata.pb.go @@ -1,25 +1,30 @@ +// +//Copyright IBM Corp. All Rights Reserved. +// +//SPDX-License-Identifier: Apache-2.0 + // Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.34.2 +// protoc v5.27.3 // source: ledger_metadata.proto package msgs import ( - fmt "fmt" - math "math" + reflect "reflect" + sync "sync" - proto "github.com/golang/protobuf/proto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) // Status specifies the status of a ledger type Status int32 @@ -31,150 +36,270 @@ const ( Status_UNDER_DELETION Status = 3 ) -var Status_name = map[int32]string{ - 0: "ACTIVE", - 1: "INACTIVE", - 2: "UNDER_CONSTRUCTION", - 3: "UNDER_DELETION", -} +// Enum value maps for Status. +var ( + Status_name = map[int32]string{ + 0: "ACTIVE", + 1: "INACTIVE", + 2: "UNDER_CONSTRUCTION", + 3: "UNDER_DELETION", + } + Status_value = map[string]int32{ + "ACTIVE": 0, + "INACTIVE": 1, + "UNDER_CONSTRUCTION": 2, + "UNDER_DELETION": 3, + } +) -var Status_value = map[string]int32{ - "ACTIVE": 0, - "INACTIVE": 1, - "UNDER_CONSTRUCTION": 2, - "UNDER_DELETION": 3, +func (x Status) Enum() *Status { + p := new(Status) + *p = x + return p } func (x Status) String() string { - return proto.EnumName(Status_name, int32(x)) + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } -func (Status) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_8173a53a47b026a1, []int{0} +func (Status) Descriptor() protoreflect.EnumDescriptor { + return file_ledger_metadata_proto_enumTypes[0].Descriptor() } -// BootSnapshotMetadata captures the metadata of the snapshot that was used to bootstrap the ledger -type BootSnapshotMetadata struct { - SingableMetadata string `protobuf:"bytes,1,opt,name=singableMetadata,proto3" json:"singableMetadata,omitempty"` - AdditionalMetadata string `protobuf:"bytes,2,opt,name=additionalMetadata,proto3" json:"additionalMetadata,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` +func (Status) Type() protoreflect.EnumType { + return &file_ledger_metadata_proto_enumTypes[0] } -func (m *BootSnapshotMetadata) Reset() { *m = BootSnapshotMetadata{} } -func (m *BootSnapshotMetadata) String() string { return proto.CompactTextString(m) } -func (*BootSnapshotMetadata) ProtoMessage() {} -func (*BootSnapshotMetadata) Descriptor() ([]byte, []int) { - return fileDescriptor_8173a53a47b026a1, []int{0} +func (x Status) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) } -func (m *BootSnapshotMetadata) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_BootSnapshotMetadata.Unmarshal(m, b) +// Deprecated: Use Status.Descriptor instead. +func (Status) EnumDescriptor() ([]byte, []int) { + return file_ledger_metadata_proto_rawDescGZIP(), []int{0} } -func (m *BootSnapshotMetadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_BootSnapshotMetadata.Marshal(b, m, deterministic) + +// BootSnapshotMetadata captures the metadata of the snapshot that was used to bootstrap the ledger +type BootSnapshotMetadata struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + SingableMetadata string `protobuf:"bytes,1,opt,name=singableMetadata,proto3" json:"singableMetadata,omitempty"` // signable metadata of bootstrapping snapshot in json string + AdditionalMetadata string `protobuf:"bytes,2,opt,name=additionalMetadata,proto3" json:"additionalMetadata,omitempty"` // additional metadata of bootstrapping snapshot in json string } -func (m *BootSnapshotMetadata) XXX_Merge(src proto.Message) { - xxx_messageInfo_BootSnapshotMetadata.Merge(m, src) + +func (x *BootSnapshotMetadata) Reset() { + *x = BootSnapshotMetadata{} + if protoimpl.UnsafeEnabled { + mi := &file_ledger_metadata_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *BootSnapshotMetadata) XXX_Size() int { - return xxx_messageInfo_BootSnapshotMetadata.Size(m) + +func (x *BootSnapshotMetadata) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *BootSnapshotMetadata) XXX_DiscardUnknown() { - xxx_messageInfo_BootSnapshotMetadata.DiscardUnknown(m) + +func (*BootSnapshotMetadata) ProtoMessage() {} + +func (x *BootSnapshotMetadata) ProtoReflect() protoreflect.Message { + mi := &file_ledger_metadata_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_BootSnapshotMetadata proto.InternalMessageInfo +// Deprecated: Use BootSnapshotMetadata.ProtoReflect.Descriptor instead. +func (*BootSnapshotMetadata) Descriptor() ([]byte, []int) { + return file_ledger_metadata_proto_rawDescGZIP(), []int{0} +} -func (m *BootSnapshotMetadata) GetSingableMetadata() string { - if m != nil { - return m.SingableMetadata +func (x *BootSnapshotMetadata) GetSingableMetadata() string { + if x != nil { + return x.SingableMetadata } return "" } -func (m *BootSnapshotMetadata) GetAdditionalMetadata() string { - if m != nil { - return m.AdditionalMetadata +func (x *BootSnapshotMetadata) GetAdditionalMetadata() string { + if x != nil { + return x.AdditionalMetadata } return "" } // LedgerMetadata specifies the metadata of a ledger type LedgerMetadata struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + Status Status `protobuf:"varint,1,opt,name=status,proto3,enum=msgs.Status" json:"status,omitempty"` BootSnapshotMetadata *BootSnapshotMetadata `protobuf:"bytes,2,opt,name=boot_snapshot_metadata,json=bootSnapshotMetadata,proto3" json:"boot_snapshot_metadata,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` } -func (m *LedgerMetadata) Reset() { *m = LedgerMetadata{} } -func (m *LedgerMetadata) String() string { return proto.CompactTextString(m) } -func (*LedgerMetadata) ProtoMessage() {} -func (*LedgerMetadata) Descriptor() ([]byte, []int) { - return fileDescriptor_8173a53a47b026a1, []int{1} +func (x *LedgerMetadata) Reset() { + *x = LedgerMetadata{} + if protoimpl.UnsafeEnabled { + mi := &file_ledger_metadata_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *LedgerMetadata) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_LedgerMetadata.Unmarshal(m, b) -} -func (m *LedgerMetadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_LedgerMetadata.Marshal(b, m, deterministic) -} -func (m *LedgerMetadata) XXX_Merge(src proto.Message) { - xxx_messageInfo_LedgerMetadata.Merge(m, src) +func (x *LedgerMetadata) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *LedgerMetadata) XXX_Size() int { - return xxx_messageInfo_LedgerMetadata.Size(m) -} -func (m *LedgerMetadata) XXX_DiscardUnknown() { - xxx_messageInfo_LedgerMetadata.DiscardUnknown(m) + +func (*LedgerMetadata) ProtoMessage() {} + +func (x *LedgerMetadata) ProtoReflect() protoreflect.Message { + mi := &file_ledger_metadata_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_LedgerMetadata proto.InternalMessageInfo +// Deprecated: Use LedgerMetadata.ProtoReflect.Descriptor instead. +func (*LedgerMetadata) Descriptor() ([]byte, []int) { + return file_ledger_metadata_proto_rawDescGZIP(), []int{1} +} -func (m *LedgerMetadata) GetStatus() Status { - if m != nil { - return m.Status +func (x *LedgerMetadata) GetStatus() Status { + if x != nil { + return x.Status } return Status_ACTIVE } -func (m *LedgerMetadata) GetBootSnapshotMetadata() *BootSnapshotMetadata { - if m != nil { - return m.BootSnapshotMetadata +func (x *LedgerMetadata) GetBootSnapshotMetadata() *BootSnapshotMetadata { + if x != nil { + return x.BootSnapshotMetadata } return nil } -func init() { - proto.RegisterEnum("msgs.Status", Status_name, Status_value) - proto.RegisterType((*BootSnapshotMetadata)(nil), "msgs.BootSnapshotMetadata") - proto.RegisterType((*LedgerMetadata)(nil), "msgs.LedgerMetadata") -} - -func init() { proto.RegisterFile("ledger_metadata.proto", fileDescriptor_8173a53a47b026a1) } - -var fileDescriptor_8173a53a47b026a1 = []byte{ - // 285 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x91, 0x41, 0x4f, 0x83, 0x30, - 0x1c, 0xc5, 0x65, 0x1a, 0xa2, 0x7f, 0x17, 0x42, 0x9a, 0xb9, 0x18, 0x4f, 0x66, 0xf1, 0x60, 0x76, - 0x80, 0x64, 0x1e, 0x8c, 0x47, 0xc7, 0x38, 0x90, 0x4c, 0x66, 0x80, 0x79, 0xf0, 0x42, 0x5a, 0xa8, - 0x40, 0x04, 0x4a, 0xda, 0xce, 0xc4, 0x6f, 0xe0, 0xc7, 0x36, 0x2b, 0x95, 0x8b, 0xdc, 0xda, 0xdf, - 0xff, 0xb5, 0xef, 0xbd, 0x16, 0xae, 0x6a, 0x9a, 0x17, 0x94, 0xa7, 0x0d, 0x95, 0x38, 0xc7, 0x12, - 0x3b, 0x1d, 0x67, 0x92, 0xa1, 0xb3, 0x46, 0x14, 0x62, 0xc1, 0x61, 0xb6, 0x66, 0x4c, 0xc6, 0x2d, - 0xee, 0x44, 0xc9, 0xe4, 0x8b, 0xd6, 0xa0, 0x25, 0xd8, 0xa2, 0x6a, 0x0b, 0x4c, 0x6a, 0xfa, 0xc7, - 0xae, 0x8d, 0x5b, 0xe3, 0xfe, 0x22, 0xfa, 0xc7, 0x91, 0x03, 0x08, 0xe7, 0x79, 0x25, 0x2b, 0xd6, - 0xe2, 0x7a, 0x50, 0x4f, 0x94, 0x7a, 0x64, 0xb2, 0xf8, 0x31, 0xc0, 0xda, 0xaa, 0x4c, 0xc3, 0x15, - 0x77, 0x60, 0x0a, 0x89, 0xe5, 0x41, 0x28, 0x13, 0x6b, 0x35, 0x75, 0x8e, 0xe9, 0x9c, 0x58, 0xb1, - 0x48, 0xcf, 0xd0, 0x2b, 0xcc, 0x09, 0x63, 0x32, 0x15, 0x3a, 0xed, 0x50, 0x49, 0x99, 0x5d, 0xae, - 0x6e, 0xfa, 0x53, 0x63, 0x85, 0xa2, 0x19, 0x19, 0xa1, 0xcb, 0x10, 0xcc, 0xde, 0x03, 0x01, 0x98, - 0xcf, 0x5e, 0x12, 0xbc, 0xf9, 0xf6, 0x09, 0x9a, 0xc2, 0x79, 0x10, 0xea, 0x9d, 0x81, 0xe6, 0x80, - 0xf6, 0xe1, 0xc6, 0x8f, 0x52, 0x6f, 0x17, 0xc6, 0x49, 0xb4, 0xf7, 0x92, 0x60, 0x17, 0xda, 0x13, - 0x84, 0xc0, 0xea, 0xf9, 0xc6, 0xdf, 0xfa, 0x8a, 0x9d, 0xae, 0x9f, 0xde, 0x1f, 0x8b, 0x4a, 0x96, - 0x07, 0xe2, 0x64, 0xac, 0x71, 0xcb, 0xef, 0x8e, 0xf2, 0xfe, 0xf5, 0xdd, 0x0f, 0x4c, 0x78, 0x95, - 0xb9, 0x19, 0xe3, 0xd4, 0xd5, 0xe8, 0xf3, 0x4b, 0x2f, 0x8e, 0xa9, 0x89, 0xa9, 0xbe, 0xe5, 0xe1, - 0x37, 0x00, 0x00, 0xff, 0xff, 0xaa, 0xee, 0x9d, 0x64, 0xaf, 0x01, 0x00, 0x00, +var File_ledger_metadata_proto protoreflect.FileDescriptor + +var file_ledger_metadata_proto_rawDesc = []byte{ + 0x0a, 0x15, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x04, 0x6d, 0x73, 0x67, 0x73, 0x22, 0x72, 0x0a, + 0x14, 0x42, 0x6f, 0x6f, 0x74, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x4d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x2a, 0x0a, 0x10, 0x73, 0x69, 0x6e, 0x67, 0x61, 0x62, 0x6c, + 0x65, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x10, 0x73, 0x69, 0x6e, 0x67, 0x61, 0x62, 0x6c, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0x12, 0x2e, 0x0a, 0x12, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x61, + 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0x22, 0x88, 0x01, 0x0a, 0x0e, 0x4c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x4d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0x12, 0x24, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0c, 0x2e, 0x6d, 0x73, 0x67, 0x73, 0x2e, 0x53, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x50, 0x0a, 0x16, 0x62, 0x6f, + 0x6f, 0x74, 0x5f, 0x73, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x5f, 0x6d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6d, 0x73, 0x67, + 0x73, 0x2e, 0x42, 0x6f, 0x6f, 0x74, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x4d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x14, 0x62, 0x6f, 0x6f, 0x74, 0x53, 0x6e, 0x61, 0x70, + 0x73, 0x68, 0x6f, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2a, 0x4e, 0x0a, 0x06, + 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x0a, 0x0a, 0x06, 0x41, 0x43, 0x54, 0x49, 0x56, 0x45, + 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x49, 0x4e, 0x41, 0x43, 0x54, 0x49, 0x56, 0x45, 0x10, 0x01, + 0x12, 0x16, 0x0a, 0x12, 0x55, 0x4e, 0x44, 0x45, 0x52, 0x5f, 0x43, 0x4f, 0x4e, 0x53, 0x54, 0x52, + 0x55, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x02, 0x12, 0x12, 0x0a, 0x0e, 0x55, 0x4e, 0x44, 0x45, + 0x52, 0x5f, 0x44, 0x45, 0x4c, 0x45, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x03, 0x42, 0x39, 0x5a, 0x37, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x79, 0x70, 0x65, 0x72, + 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2f, 0x66, 0x61, 0x62, 0x72, 0x69, 0x63, 0x2f, 0x63, 0x6f, + 0x72, 0x65, 0x2f, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2f, 0x6b, 0x76, 0x6c, 0x65, 0x64, 0x67, + 0x65, 0x72, 0x2f, 0x6d, 0x73, 0x67, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_ledger_metadata_proto_rawDescOnce sync.Once + file_ledger_metadata_proto_rawDescData = file_ledger_metadata_proto_rawDesc +) + +func file_ledger_metadata_proto_rawDescGZIP() []byte { + file_ledger_metadata_proto_rawDescOnce.Do(func() { + file_ledger_metadata_proto_rawDescData = protoimpl.X.CompressGZIP(file_ledger_metadata_proto_rawDescData) + }) + return file_ledger_metadata_proto_rawDescData +} + +var file_ledger_metadata_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_ledger_metadata_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_ledger_metadata_proto_goTypes = []any{ + (Status)(0), // 0: msgs.Status + (*BootSnapshotMetadata)(nil), // 1: msgs.BootSnapshotMetadata + (*LedgerMetadata)(nil), // 2: msgs.LedgerMetadata +} +var file_ledger_metadata_proto_depIdxs = []int32{ + 0, // 0: msgs.LedgerMetadata.status:type_name -> msgs.Status + 1, // 1: msgs.LedgerMetadata.boot_snapshot_metadata:type_name -> msgs.BootSnapshotMetadata + 2, // [2:2] is the sub-list for method output_type + 2, // [2:2] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_ledger_metadata_proto_init() } +func file_ledger_metadata_proto_init() { + if File_ledger_metadata_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_ledger_metadata_proto_msgTypes[0].Exporter = func(v any, i int) any { + switch v := v.(*BootSnapshotMetadata); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ledger_metadata_proto_msgTypes[1].Exporter = func(v any, i int) any { + switch v := v.(*LedgerMetadata); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_ledger_metadata_proto_rawDesc, + NumEnums: 1, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_ledger_metadata_proto_goTypes, + DependencyIndexes: file_ledger_metadata_proto_depIdxs, + EnumInfos: file_ledger_metadata_proto_enumTypes, + MessageInfos: file_ledger_metadata_proto_msgTypes, + }.Build() + File_ledger_metadata_proto = out.File + file_ledger_metadata_proto_rawDesc = nil + file_ledger_metadata_proto_goTypes = nil + file_ledger_metadata_proto_depIdxs = nil } diff --git a/core/ledger/kvledger/pause_resume_test.go b/core/ledger/kvledger/pause_resume_test.go index 63dc860ede3..a8f8ecf80d1 100644 --- a/core/ledger/kvledger/pause_resume_test.go +++ b/core/ledger/kvledger/pause_resume_test.go @@ -9,7 +9,7 @@ package kvledger import ( "testing" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" configtxtest "github.com/hyperledger/fabric/common/configtx/test" "github.com/hyperledger/fabric/core/ledger/kvledger/msgs" "github.com/hyperledger/fabric/core/ledger/mock" diff --git a/core/ledger/kvledger/rwset_backward_compatibility_test.go b/core/ledger/kvledger/rwset_backward_compatibility_test.go index 9c36ea3af62..3510c23ed8d 100644 --- a/core/ledger/kvledger/rwset_backward_compatibility_test.go +++ b/core/ledger/kvledger/rwset_backward_compatibility_test.go @@ -11,7 +11,7 @@ import ( "os" "testing" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/common/ledger/testutil" "github.com/hyperledger/fabric/common/util" lgr "github.com/hyperledger/fabric/core/ledger" diff --git a/core/ledger/kvledger/snapshot.go b/core/ledger/kvledger/snapshot.go index 63cb9d2f08e..8db7425fac4 100644 --- a/core/ledger/kvledger/snapshot.go +++ b/core/ledger/kvledger/snapshot.go @@ -17,7 +17,7 @@ import ( "os" "path/filepath" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/ledger/blkstorage" "github.com/hyperledger/fabric/core/chaincode/implicitcollection" "github.com/hyperledger/fabric/core/ledger" diff --git a/core/ledger/kvledger/snapshot_mgmt_test.go b/core/ledger/kvledger/snapshot_mgmt_test.go index 2f0961d0f26..c3275ca31aa 100644 --- a/core/ledger/kvledger/snapshot_mgmt_test.go +++ b/core/ledger/kvledger/snapshot_mgmt_test.go @@ -11,7 +11,7 @@ import ( "testing" "time" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/common/ledger/testutil" "github.com/hyperledger/fabric/common/util" "github.com/hyperledger/fabric/core/ledger" diff --git a/core/ledger/kvledger/snapshot_test.go b/core/ledger/kvledger/snapshot_test.go index 9216e69b80a..cb6b1979fe7 100644 --- a/core/ledger/kvledger/snapshot_test.go +++ b/core/ledger/kvledger/snapshot_test.go @@ -16,12 +16,11 @@ import ( "testing" "time" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/bccsp/sw" "github.com/hyperledger/fabric-lib-go/common/metrics/disabled" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/ledger/queryresult" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/queryresult" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/ledger/testutil" "github.com/hyperledger/fabric/common/util" "github.com/hyperledger/fabric/core/chaincode/implicitcollection" @@ -36,6 +35,7 @@ import ( "github.com/hyperledger/fabric/internal/fileutil" "github.com/hyperledger/fabric/protoutil" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) func TestSnapshotGenerationAndNewLedgerCreation(t *testing.T) { diff --git a/core/ledger/kvledger/state_listener_test.go b/core/ledger/kvledger/state_listener_test.go index 262f6028b90..c215dad81f2 100644 --- a/core/ledger/kvledger/state_listener_test.go +++ b/core/ledger/kvledger/state_listener_test.go @@ -11,8 +11,8 @@ import ( "github.com/hyperledger/fabric-lib-go/bccsp/sw" "github.com/hyperledger/fabric-lib-go/common/metrics/disabled" - "github.com/hyperledger/fabric-protos-go/ledger/queryresult" - "github.com/hyperledger/fabric-protos-go/ledger/rwset/kvrwset" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/queryresult" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset/kvrwset" "github.com/hyperledger/fabric/common/ledger/testutil" "github.com/hyperledger/fabric/core/ledger" "github.com/hyperledger/fabric/core/ledger/mock" diff --git a/core/ledger/kvledger/tests/client.go b/core/ledger/kvledger/tests/client.go index a727abb2918..72d43b1d95d 100644 --- a/core/ledger/kvledger/tests/client.go +++ b/core/ledger/kvledger/tests/client.go @@ -9,14 +9,14 @@ package tests import ( "testing" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/common/util" "github.com/hyperledger/fabric/core/common/ccprovider" "github.com/hyperledger/fabric/core/common/privdata" "github.com/hyperledger/fabric/core/ledger" "github.com/hyperledger/fabric/protoutil" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) // client helps in a transaction simulation. The client keeps accumulating the results of each simulated transaction diff --git a/core/ledger/kvledger/tests/committer.go b/core/ledger/kvledger/tests/committer.go index ee494129d28..cb65a795ba3 100644 --- a/core/ledger/kvledger/tests/committer.go +++ b/core/ledger/kvledger/tests/committer.go @@ -9,11 +9,11 @@ package tests import ( "testing" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/core/ledger" "github.com/hyperledger/fabric/protoutil" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) // committer helps in cutting a block and commits the block (with pvt data) to the ledger diff --git a/core/ledger/kvledger/tests/customtx_processor_test.go b/core/ledger/kvledger/tests/customtx_processor_test.go index 4990f2dba92..90c4152fcbc 100644 --- a/core/ledger/kvledger/tests/customtx_processor_test.go +++ b/core/ledger/kvledger/tests/customtx_processor_test.go @@ -11,8 +11,8 @@ import ( "testing" "github.com/hyperledger/fabric-lib-go/bccsp/sw" - "github.com/hyperledger/fabric-protos-go/common" - protopeer "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + protopeer "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/core/ledger" "github.com/hyperledger/fabric/core/ledger/ledgermgmt" "github.com/hyperledger/fabric/core/ledger/mock" diff --git a/core/ledger/kvledger/tests/env.go b/core/ledger/kvledger/tests/env.go index 57f7b707baa..afcaf695b56 100644 --- a/core/ledger/kvledger/tests/env.go +++ b/core/ledger/kvledger/tests/env.go @@ -15,8 +15,8 @@ import ( "github.com/hyperledger/fabric-lib-go/bccsp/sw" "github.com/hyperledger/fabric-lib-go/common/metrics/disabled" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/ledger/blkstorage" "github.com/hyperledger/fabric/core/chaincode/implicitcollection" "github.com/hyperledger/fabric/core/chaincode/lifecycle" diff --git a/core/ledger/kvledger/tests/nilvalue_no_delete_marker_test.go b/core/ledger/kvledger/tests/nilvalue_no_delete_marker_test.go index 8fb4e87e823..24834f500b6 100644 --- a/core/ledger/kvledger/tests/nilvalue_no_delete_marker_test.go +++ b/core/ledger/kvledger/tests/nilvalue_no_delete_marker_test.go @@ -9,12 +9,12 @@ package tests import ( "testing" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/ledger/rwset" - "github.com/hyperledger/fabric-protos-go/ledger/rwset/kvrwset" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset/kvrwset" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/util" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) // TestNilValNoDeleteMarker tests for a special writeset which carries a nil value and yet the delete marker is set to false. diff --git a/core/ledger/kvledger/tests/pvtdata_test.go b/core/ledger/kvledger/tests/pvtdata_test.go index d0537cf6318..7afe3bd4036 100644 --- a/core/ledger/kvledger/tests/pvtdata_test.go +++ b/core/ledger/kvledger/tests/pvtdata_test.go @@ -9,7 +9,7 @@ package tests import ( "testing" - "github.com/hyperledger/fabric-protos-go/ledger/rwset" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset" "github.com/hyperledger/fabric/core/ledger" "github.com/stretchr/testify/require" ) diff --git a/core/ledger/kvledger/tests/reset_test.go b/core/ledger/kvledger/tests/reset_test.go index e27afe0692c..7f260f84085 100644 --- a/core/ledger/kvledger/tests/reset_test.go +++ b/core/ledger/kvledger/tests/reset_test.go @@ -10,7 +10,7 @@ import ( "fmt" "testing" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/common/ledger/blkstorage" "github.com/hyperledger/fabric/core/ledger" "github.com/hyperledger/fabric/core/ledger/kvledger" diff --git a/core/ledger/kvledger/tests/sample_data_helper.go b/core/ledger/kvledger/tests/sample_data_helper.go index 3211d0b7c64..ad80946c0c0 100644 --- a/core/ledger/kvledger/tests/sample_data_helper.go +++ b/core/ledger/kvledger/tests/sample_data_helper.go @@ -10,7 +10,7 @@ import ( "fmt" "testing" - protopeer "github.com/hyperledger/fabric-protos-go/peer" + protopeer "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/core/ledger" "github.com/stretchr/testify/require" ) diff --git a/core/ledger/kvledger/tests/snapshot_test.go b/core/ledger/kvledger/tests/snapshot_test.go index 02de124f0aa..0b4b4339dc0 100644 --- a/core/ledger/kvledger/tests/snapshot_test.go +++ b/core/ledger/kvledger/tests/snapshot_test.go @@ -10,7 +10,7 @@ import ( "testing" "time" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/core/ledger" "github.com/hyperledger/fabric/core/ledger/ledgermgmt" "github.com/hyperledger/fabric/core/ledger/util" diff --git a/core/ledger/kvledger/tests/util.go b/core/ledger/kvledger/tests/util.go index 730c369c852..41abd3f2d2a 100644 --- a/core/ledger/kvledger/tests/util.go +++ b/core/ledger/kvledger/tests/util.go @@ -7,18 +7,18 @@ SPDX-License-Identifier: Apache-2.0 package tests import ( - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/common/flogging" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/ledger/rwset" - "github.com/hyperledger/fabric-protos-go/msp" - protopeer "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset" + "github.com/hyperledger/fabric-protos-go-apiv2/msp" + protopeer "github.com/hyperledger/fabric-protos-go-apiv2/peer" configtxtest "github.com/hyperledger/fabric/common/configtx/test" "github.com/hyperledger/fabric/common/crypto" "github.com/hyperledger/fabric/common/policydsl" "github.com/hyperledger/fabric/core/ledger/kvledger/tests/fakes" "github.com/hyperledger/fabric/internal/pkg/txflags" "github.com/hyperledger/fabric/protoutil" + "google.golang.org/protobuf/proto" ) var logger = flogging.MustGetLogger("test2") diff --git a/core/ledger/kvledger/tests/v1x_test.go b/core/ledger/kvledger/tests/v1x_test.go index d43db4e6165..989d8fc641a 100644 --- a/core/ledger/kvledger/tests/v1x_test.go +++ b/core/ledger/kvledger/tests/v1x_test.go @@ -14,8 +14,8 @@ import ( "testing" "time" - "github.com/hyperledger/fabric-protos-go/common" - protopeer "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + protopeer "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/ledger/testutil" "github.com/hyperledger/fabric/core/ledger" "github.com/hyperledger/fabric/core/ledger/kvledger" diff --git a/core/ledger/kvledger/tests/verifier.go b/core/ledger/kvledger/tests/verifier.go index 6e504573925..038574ef6ba 100644 --- a/core/ledger/kvledger/tests/verifier.go +++ b/core/ledger/kvledger/tests/verifier.go @@ -10,14 +10,14 @@ import ( "testing" "github.com/davecgh/go-spew/spew" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/ledger/queryresult" - "github.com/hyperledger/fabric-protos-go/ledger/rwset/kvrwset" - protopeer "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/queryresult" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset/kvrwset" + protopeer "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/core/ledger" "github.com/hyperledger/fabric/internal/pkg/txflags" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) // verifier provides functions that help tests with less verbose code for querying the ledger diff --git a/core/ledger/kvledger/txmgmt/privacyenabledstate/db_test.go b/core/ledger/kvledger/txmgmt/privacyenabledstate/db_test.go index 4758aa4cf5b..303cb62740b 100644 --- a/core/ledger/kvledger/txmgmt/privacyenabledstate/db_test.go +++ b/core/ledger/kvledger/txmgmt/privacyenabledstate/db_test.go @@ -13,7 +13,7 @@ import ( "io" "testing" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/ledger/testutil" "github.com/hyperledger/fabric/core/common/ccprovider" "github.com/hyperledger/fabric/core/ledger/cceventmgmt" diff --git a/core/ledger/kvledger/txmgmt/privacyenabledstate/snapshot_record.pb.go b/core/ledger/kvledger/txmgmt/privacyenabledstate/snapshot_record.pb.go index 6604c2c48fd..2e7bbc106d5 100644 --- a/core/ledger/kvledger/txmgmt/privacyenabledstate/snapshot_record.pb.go +++ b/core/ledger/kvledger/txmgmt/privacyenabledstate/snapshot_record.pb.go @@ -1,108 +1,182 @@ +// +//Copyright IBM Corp. All Rights Reserved. +// +//SPDX-License-Identifier: Apache-2.0 + // Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.34.2 +// protoc v5.27.3 // source: snapshot_record.proto package privacyenabledstate import ( - fmt "fmt" - math "math" + reflect "reflect" + sync "sync" - proto "github.com/golang/protobuf/proto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) type SnapshotRecord struct { - Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` - Metadata []byte `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"` - Version []byte `protobuf:"bytes,4,opt,name=version,proto3" json:"version,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` + Metadata []byte `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"` + Version []byte `protobuf:"bytes,4,opt,name=version,proto3" json:"version,omitempty"` } -func (m *SnapshotRecord) Reset() { *m = SnapshotRecord{} } -func (m *SnapshotRecord) String() string { return proto.CompactTextString(m) } -func (*SnapshotRecord) ProtoMessage() {} -func (*SnapshotRecord) Descriptor() ([]byte, []int) { - return fileDescriptor_052484ec8cd7f17b, []int{0} +func (x *SnapshotRecord) Reset() { + *x = SnapshotRecord{} + if protoimpl.UnsafeEnabled { + mi := &file_snapshot_record_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *SnapshotRecord) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SnapshotRecord.Unmarshal(m, b) -} -func (m *SnapshotRecord) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SnapshotRecord.Marshal(b, m, deterministic) +func (x *SnapshotRecord) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *SnapshotRecord) XXX_Merge(src proto.Message) { - xxx_messageInfo_SnapshotRecord.Merge(m, src) -} -func (m *SnapshotRecord) XXX_Size() int { - return xxx_messageInfo_SnapshotRecord.Size(m) -} -func (m *SnapshotRecord) XXX_DiscardUnknown() { - xxx_messageInfo_SnapshotRecord.DiscardUnknown(m) + +func (*SnapshotRecord) ProtoMessage() {} + +func (x *SnapshotRecord) ProtoReflect() protoreflect.Message { + mi := &file_snapshot_record_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_SnapshotRecord proto.InternalMessageInfo +// Deprecated: Use SnapshotRecord.ProtoReflect.Descriptor instead. +func (*SnapshotRecord) Descriptor() ([]byte, []int) { + return file_snapshot_record_proto_rawDescGZIP(), []int{0} +} -func (m *SnapshotRecord) GetKey() []byte { - if m != nil { - return m.Key +func (x *SnapshotRecord) GetKey() []byte { + if x != nil { + return x.Key } return nil } -func (m *SnapshotRecord) GetValue() []byte { - if m != nil { - return m.Value +func (x *SnapshotRecord) GetValue() []byte { + if x != nil { + return x.Value } return nil } -func (m *SnapshotRecord) GetMetadata() []byte { - if m != nil { - return m.Metadata +func (x *SnapshotRecord) GetMetadata() []byte { + if x != nil { + return x.Metadata } return nil } -func (m *SnapshotRecord) GetVersion() []byte { - if m != nil { - return m.Version +func (x *SnapshotRecord) GetVersion() []byte { + if x != nil { + return x.Version } return nil } -func init() { - proto.RegisterType((*SnapshotRecord)(nil), "privacyenabledstate.SnapshotRecord") +var File_snapshot_record_proto protoreflect.FileDescriptor + +var file_snapshot_record_proto_rawDesc = []byte{ + 0x0a, 0x15, 0x73, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x5f, 0x72, 0x65, 0x63, 0x6f, 0x72, + 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x13, 0x70, 0x72, 0x69, 0x76, 0x61, 0x63, 0x79, + 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x73, 0x74, 0x61, 0x74, 0x65, 0x22, 0x6e, 0x0a, 0x0e, + 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x10, + 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x6b, 0x65, 0x79, + 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x42, 0x57, 0x5a, 0x55, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x79, 0x70, 0x65, 0x72, + 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2f, 0x66, 0x61, 0x62, 0x72, 0x69, 0x63, 0x2f, 0x63, 0x6f, + 0x72, 0x65, 0x2f, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2f, 0x6b, 0x76, 0x6c, 0x65, 0x64, 0x67, + 0x65, 0x72, 0x2f, 0x74, 0x78, 0x6d, 0x67, 0x6d, 0x74, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x64, + 0x62, 0x2f, 0x70, 0x72, 0x69, 0x76, 0x61, 0x63, 0x79, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, + 0x73, 0x74, 0x61, 0x74, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_snapshot_record_proto_rawDescOnce sync.Once + file_snapshot_record_proto_rawDescData = file_snapshot_record_proto_rawDesc +) + +func file_snapshot_record_proto_rawDescGZIP() []byte { + file_snapshot_record_proto_rawDescOnce.Do(func() { + file_snapshot_record_proto_rawDescData = protoimpl.X.CompressGZIP(file_snapshot_record_proto_rawDescData) + }) + return file_snapshot_record_proto_rawDescData } -func init() { proto.RegisterFile("snapshot_record.proto", fileDescriptor_052484ec8cd7f17b) } - -var fileDescriptor_052484ec8cd7f17b = []byte{ - // 200 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x8f, 0xcd, 0x4a, 0xc5, 0x30, - 0x14, 0x84, 0xb9, 0x5e, 0xff, 0x08, 0x22, 0x12, 0x15, 0x82, 0x2b, 0x71, 0xe5, 0xaa, 0x59, 0xf8, - 0x06, 0x3e, 0x42, 0x45, 0x04, 0x37, 0x72, 0x92, 0x1c, 0xdb, 0xd0, 0xe6, 0x87, 0x93, 0xd3, 0x60, - 0xdf, 0x5e, 0x8c, 0xd5, 0xd5, 0xdd, 0xcd, 0x37, 0x33, 0x8b, 0x19, 0x71, 0x5b, 0x22, 0xe4, 0x32, - 0x26, 0xfe, 0x20, 0xb4, 0x89, 0x5c, 0x97, 0x29, 0x71, 0x92, 0xd7, 0x99, 0x7c, 0x05, 0xbb, 0x62, - 0x04, 0x33, 0xa3, 0x2b, 0x0c, 0x8c, 0x0f, 0x51, 0x5c, 0xbe, 0x6c, 0xed, 0xbe, 0x95, 0xe5, 0x95, - 0xd8, 0x4f, 0xb8, 0xaa, 0xdd, 0xfd, 0xee, 0xf1, 0xa2, 0xff, 0x91, 0xf2, 0x46, 0x9c, 0x54, 0x98, - 0x17, 0x54, 0x47, 0xcd, 0xfb, 0x05, 0x79, 0x27, 0xce, 0x03, 0x32, 0x38, 0x60, 0x50, 0xfb, 0x16, - 0xfc, 0xb3, 0x54, 0xe2, 0xac, 0x22, 0x15, 0x9f, 0xa2, 0x3a, 0x6e, 0xd1, 0x1f, 0x3e, 0xbf, 0xbd, - 0xbf, 0x0e, 0x9e, 0xc7, 0xc5, 0x74, 0x36, 0x05, 0x3d, 0xae, 0x19, 0x69, 0x46, 0x37, 0x20, 0xe9, - 0x4f, 0x30, 0xe4, 0xad, 0xb6, 0x89, 0x50, 0x6f, 0xd6, 0x54, 0x37, 0xc1, 0x5f, 0x61, 0x08, 0xac, - 0xdb, 0x64, 0x67, 0xf4, 0x81, 0x23, 0xe6, 0xb4, 0x9d, 0x7c, 0xfa, 0x0e, 0x00, 0x00, 0xff, 0xff, - 0x89, 0x32, 0xc8, 0x38, 0xfd, 0x00, 0x00, 0x00, +var file_snapshot_record_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_snapshot_record_proto_goTypes = []any{ + (*SnapshotRecord)(nil), // 0: privacyenabledstate.SnapshotRecord +} +var file_snapshot_record_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_snapshot_record_proto_init() } +func file_snapshot_record_proto_init() { + if File_snapshot_record_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_snapshot_record_proto_msgTypes[0].Exporter = func(v any, i int) any { + switch v := v.(*SnapshotRecord); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_snapshot_record_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_snapshot_record_proto_goTypes, + DependencyIndexes: file_snapshot_record_proto_depIdxs, + MessageInfos: file_snapshot_record_proto_msgTypes, + }.Build() + File_snapshot_record_proto = out.File + file_snapshot_record_proto_rawDesc = nil + file_snapshot_record_proto_goTypes = nil + file_snapshot_record_proto_depIdxs = nil } diff --git a/core/ledger/kvledger/txmgmt/privacyenabledstate/snapshot_test.go b/core/ledger/kvledger/txmgmt/privacyenabledstate/snapshot_test.go index c913e818a21..90dbdf586b7 100644 --- a/core/ledger/kvledger/txmgmt/privacyenabledstate/snapshot_test.go +++ b/core/ledger/kvledger/txmgmt/privacyenabledstate/snapshot_test.go @@ -16,13 +16,13 @@ import ( "strings" "testing" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric/common/ledger/snapshot" "github.com/hyperledger/fabric/core/ledger/internal/version" "github.com/hyperledger/fabric/core/ledger/kvledger/txmgmt/privacyenabledstate/mock" "github.com/hyperledger/fabric/core/ledger/kvledger/txmgmt/statedb" "github.com/stretchr/testify/require" "google.golang.org/protobuf/encoding/protowire" + "google.golang.org/protobuf/proto" protoV2 "google.golang.org/protobuf/proto" "google.golang.org/protobuf/protoadapt" ) diff --git a/core/ledger/kvledger/txmgmt/pvtstatepurgemgmt/expiry_keeper.go b/core/ledger/kvledger/txmgmt/pvtstatepurgemgmt/expiry_keeper.go index da9fb831b7d..acdbf40a462 100644 --- a/core/ledger/kvledger/txmgmt/pvtstatepurgemgmt/expiry_keeper.go +++ b/core/ledger/kvledger/txmgmt/pvtstatepurgemgmt/expiry_keeper.go @@ -7,11 +7,11 @@ SPDX-License-Identifier: Apache-2.0 package pvtstatepurgemgmt import ( - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/common/flogging" "github.com/hyperledger/fabric/common/ledger/util" "github.com/hyperledger/fabric/common/ledger/util/leveldbhelper" "github.com/hyperledger/fabric/core/ledger/kvledger/bookkeeping" + "google.golang.org/protobuf/proto" ) var logger = flogging.MustGetLogger("pvtstatepurgemgmt") diff --git a/core/ledger/kvledger/txmgmt/pvtstatepurgemgmt/expiry_keeper_test.go b/core/ledger/kvledger/txmgmt/pvtstatepurgemgmt/expiry_keeper_test.go index 934f664f21d..54ac93096a4 100644 --- a/core/ledger/kvledger/txmgmt/pvtstatepurgemgmt/expiry_keeper_test.go +++ b/core/ledger/kvledger/txmgmt/pvtstatepurgemgmt/expiry_keeper_test.go @@ -11,9 +11,9 @@ import ( "testing" "github.com/davecgh/go-spew/spew" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric/core/ledger/kvledger/bookkeeping" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) func TestExpiryKVEncoding(t *testing.T) { diff --git a/core/ledger/kvledger/txmgmt/pvtstatepurgemgmt/expiry_schedule_builder_test.go b/core/ledger/kvledger/txmgmt/pvtstatepurgemgmt/expiry_schedule_builder_test.go index 243babd5579..40982bc0cd3 100644 --- a/core/ledger/kvledger/txmgmt/pvtstatepurgemgmt/expiry_schedule_builder_test.go +++ b/core/ledger/kvledger/txmgmt/pvtstatepurgemgmt/expiry_schedule_builder_test.go @@ -7,6 +7,7 @@ SPDX-License-Identifier: Apache-2.0 package pvtstatepurgemgmt import ( + "reflect" "testing" "github.com/davecgh/go-spew/spew" @@ -15,6 +16,7 @@ import ( btltestutil "github.com/hyperledger/fabric/core/ledger/pvtdatapolicy/testutil" "github.com/hyperledger/fabric/core/ledger/util" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) func TestBuildExpirySchedule(t *testing.T) { @@ -53,7 +55,18 @@ func TestBuildExpirySchedule(t *testing.T) { } require.Len(t, listExpinfo, 3) - require.ElementsMatch(t, expectedListExpInfo, listExpinfo) + for i := 0; i < len(expectedListExpInfo); i++ { + j := 0 + for ; j < len(listExpinfo); j++ { + if reflect.DeepEqual(expectedListExpInfo[i].expiryInfoKey, listExpinfo[j].expiryInfoKey) { + require.True(t, proto.Equal(expectedListExpInfo[i].pvtdataKeys, listExpinfo[j].pvtdataKeys)) + break + } + } + if j == len(listExpinfo) { + require.Fail(t, "Not equal") + } + } } func TestBuildExpiryScheduleWithMissingPvtdata(t *testing.T) { @@ -103,7 +116,18 @@ func TestBuildExpiryScheduleWithMissingPvtdata(t *testing.T) { } require.Len(t, listExpinfo, 3) - require.ElementsMatch(t, expectedListExpInfo, listExpinfo) + for i := 0; i < len(expectedListExpInfo); i++ { + j := 0 + for ; j < len(listExpinfo); j++ { + if reflect.DeepEqual(expectedListExpInfo[i].expiryInfoKey, listExpinfo[j].expiryInfoKey) { + require.True(t, proto.Equal(expectedListExpInfo[i].pvtdataKeys, listExpinfo[j].pvtdataKeys)) + break + } + } + if j == len(listExpinfo) { + require.Fail(t, "Not equal") + } + } } func putPvtAndHashUpdates(t *testing.T, updates *privacyenabledstate.UpdateBatch, ns, coll, key string, value []byte, ver *version.Height) { diff --git a/core/ledger/kvledger/txmgmt/pvtstatepurgemgmt/pvtdata_key.pb.go b/core/ledger/kvledger/txmgmt/pvtstatepurgemgmt/pvtdata_key.pb.go index fc662f5960b..07803ff1108 100644 --- a/core/ledger/kvledger/txmgmt/pvtstatepurgemgmt/pvtdata_key.pb.go +++ b/core/ledger/kvledger/txmgmt/pvtstatepurgemgmt/pvtdata_key.pb.go @@ -1,220 +1,373 @@ +// +//Copyright IBM Corp. All Rights Reserved. +// +//SPDX-License-Identifier: Apache-2.0 + // Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.34.2 +// protoc v5.27.3 // source: pvtdata_key.proto package pvtstatepurgemgmt import ( - fmt "fmt" - math "math" + reflect "reflect" + sync "sync" - proto "github.com/golang/protobuf/proto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) type PvtdataKeys struct { - Map map[string]*Collections `protobuf:"bytes,1,rep,name=map,proto3" json:"map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *PvtdataKeys) Reset() { *m = PvtdataKeys{} } -func (m *PvtdataKeys) String() string { return proto.CompactTextString(m) } -func (*PvtdataKeys) ProtoMessage() {} -func (*PvtdataKeys) Descriptor() ([]byte, []int) { - return fileDescriptor_f7ef096ccb746705, []int{0} + Map map[string]*Collections `protobuf:"bytes,1,rep,name=map,proto3" json:"map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` } -func (m *PvtdataKeys) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_PvtdataKeys.Unmarshal(m, b) -} -func (m *PvtdataKeys) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_PvtdataKeys.Marshal(b, m, deterministic) -} -func (m *PvtdataKeys) XXX_Merge(src proto.Message) { - xxx_messageInfo_PvtdataKeys.Merge(m, src) +func (x *PvtdataKeys) Reset() { + *x = PvtdataKeys{} + if protoimpl.UnsafeEnabled { + mi := &file_pvtdata_key_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *PvtdataKeys) XXX_Size() int { - return xxx_messageInfo_PvtdataKeys.Size(m) + +func (x *PvtdataKeys) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *PvtdataKeys) XXX_DiscardUnknown() { - xxx_messageInfo_PvtdataKeys.DiscardUnknown(m) + +func (*PvtdataKeys) ProtoMessage() {} + +func (x *PvtdataKeys) ProtoReflect() protoreflect.Message { + mi := &file_pvtdata_key_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_PvtdataKeys proto.InternalMessageInfo +// Deprecated: Use PvtdataKeys.ProtoReflect.Descriptor instead. +func (*PvtdataKeys) Descriptor() ([]byte, []int) { + return file_pvtdata_key_proto_rawDescGZIP(), []int{0} +} -func (m *PvtdataKeys) GetMap() map[string]*Collections { - if m != nil { - return m.Map +func (x *PvtdataKeys) GetMap() map[string]*Collections { + if x != nil { + return x.Map } return nil } type Collections struct { - Map map[string]*KeysAndHashes `protobuf:"bytes,1,rep,name=map,proto3" json:"map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *Collections) Reset() { *m = Collections{} } -func (m *Collections) String() string { return proto.CompactTextString(m) } -func (*Collections) ProtoMessage() {} -func (*Collections) Descriptor() ([]byte, []int) { - return fileDescriptor_f7ef096ccb746705, []int{1} + Map map[string]*KeysAndHashes `protobuf:"bytes,1,rep,name=map,proto3" json:"map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` } -func (m *Collections) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Collections.Unmarshal(m, b) -} -func (m *Collections) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Collections.Marshal(b, m, deterministic) -} -func (m *Collections) XXX_Merge(src proto.Message) { - xxx_messageInfo_Collections.Merge(m, src) +func (x *Collections) Reset() { + *x = Collections{} + if protoimpl.UnsafeEnabled { + mi := &file_pvtdata_key_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *Collections) XXX_Size() int { - return xxx_messageInfo_Collections.Size(m) + +func (x *Collections) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Collections) XXX_DiscardUnknown() { - xxx_messageInfo_Collections.DiscardUnknown(m) + +func (*Collections) ProtoMessage() {} + +func (x *Collections) ProtoReflect() protoreflect.Message { + mi := &file_pvtdata_key_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_Collections proto.InternalMessageInfo +// Deprecated: Use Collections.ProtoReflect.Descriptor instead. +func (*Collections) Descriptor() ([]byte, []int) { + return file_pvtdata_key_proto_rawDescGZIP(), []int{1} +} -func (m *Collections) GetMap() map[string]*KeysAndHashes { - if m != nil { - return m.Map +func (x *Collections) GetMap() map[string]*KeysAndHashes { + if x != nil { + return x.Map } return nil } type KeysAndHashes struct { - List []*KeyAndHash `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *KeysAndHashes) Reset() { *m = KeysAndHashes{} } -func (m *KeysAndHashes) String() string { return proto.CompactTextString(m) } -func (*KeysAndHashes) ProtoMessage() {} -func (*KeysAndHashes) Descriptor() ([]byte, []int) { - return fileDescriptor_f7ef096ccb746705, []int{2} + List []*KeyAndHash `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` } -func (m *KeysAndHashes) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_KeysAndHashes.Unmarshal(m, b) -} -func (m *KeysAndHashes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_KeysAndHashes.Marshal(b, m, deterministic) -} -func (m *KeysAndHashes) XXX_Merge(src proto.Message) { - xxx_messageInfo_KeysAndHashes.Merge(m, src) +func (x *KeysAndHashes) Reset() { + *x = KeysAndHashes{} + if protoimpl.UnsafeEnabled { + mi := &file_pvtdata_key_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *KeysAndHashes) XXX_Size() int { - return xxx_messageInfo_KeysAndHashes.Size(m) + +func (x *KeysAndHashes) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *KeysAndHashes) XXX_DiscardUnknown() { - xxx_messageInfo_KeysAndHashes.DiscardUnknown(m) + +func (*KeysAndHashes) ProtoMessage() {} + +func (x *KeysAndHashes) ProtoReflect() protoreflect.Message { + mi := &file_pvtdata_key_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_KeysAndHashes proto.InternalMessageInfo +// Deprecated: Use KeysAndHashes.ProtoReflect.Descriptor instead. +func (*KeysAndHashes) Descriptor() ([]byte, []int) { + return file_pvtdata_key_proto_rawDescGZIP(), []int{2} +} -func (m *KeysAndHashes) GetList() []*KeyAndHash { - if m != nil { - return m.List +func (x *KeysAndHashes) GetList() []*KeyAndHash { + if x != nil { + return x.List } return nil } type KeyAndHash struct { - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - Hash []byte `protobuf:"bytes,2,opt,name=hash,proto3" json:"hash,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *KeyAndHash) Reset() { *m = KeyAndHash{} } -func (m *KeyAndHash) String() string { return proto.CompactTextString(m) } -func (*KeyAndHash) ProtoMessage() {} -func (*KeyAndHash) Descriptor() ([]byte, []int) { - return fileDescriptor_f7ef096ccb746705, []int{3} + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Hash []byte `protobuf:"bytes,2,opt,name=hash,proto3" json:"hash,omitempty"` } -func (m *KeyAndHash) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_KeyAndHash.Unmarshal(m, b) -} -func (m *KeyAndHash) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_KeyAndHash.Marshal(b, m, deterministic) -} -func (m *KeyAndHash) XXX_Merge(src proto.Message) { - xxx_messageInfo_KeyAndHash.Merge(m, src) +func (x *KeyAndHash) Reset() { + *x = KeyAndHash{} + if protoimpl.UnsafeEnabled { + mi := &file_pvtdata_key_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *KeyAndHash) XXX_Size() int { - return xxx_messageInfo_KeyAndHash.Size(m) + +func (x *KeyAndHash) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *KeyAndHash) XXX_DiscardUnknown() { - xxx_messageInfo_KeyAndHash.DiscardUnknown(m) + +func (*KeyAndHash) ProtoMessage() {} + +func (x *KeyAndHash) ProtoReflect() protoreflect.Message { + mi := &file_pvtdata_key_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_KeyAndHash proto.InternalMessageInfo +// Deprecated: Use KeyAndHash.ProtoReflect.Descriptor instead. +func (*KeyAndHash) Descriptor() ([]byte, []int) { + return file_pvtdata_key_proto_rawDescGZIP(), []int{3} +} -func (m *KeyAndHash) GetKey() string { - if m != nil { - return m.Key +func (x *KeyAndHash) GetKey() string { + if x != nil { + return x.Key } return "" } -func (m *KeyAndHash) GetHash() []byte { - if m != nil { - return m.Hash +func (x *KeyAndHash) GetHash() []byte { + if x != nil { + return x.Hash } return nil } -func init() { - proto.RegisterType((*PvtdataKeys)(nil), "pvtstatepurgemgmt.PvtdataKeys") - proto.RegisterMapType((map[string]*Collections)(nil), "pvtstatepurgemgmt.PvtdataKeys.MapEntry") - proto.RegisterType((*Collections)(nil), "pvtstatepurgemgmt.Collections") - proto.RegisterMapType((map[string]*KeysAndHashes)(nil), "pvtstatepurgemgmt.Collections.MapEntry") - proto.RegisterType((*KeysAndHashes)(nil), "pvtstatepurgemgmt.KeysAndHashes") - proto.RegisterType((*KeyAndHash)(nil), "pvtstatepurgemgmt.KeyAndHash") -} - -func init() { proto.RegisterFile("pvtdata_key.proto", fileDescriptor_f7ef096ccb746705) } - -var fileDescriptor_f7ef096ccb746705 = []byte{ - // 297 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x92, 0x4d, 0x4b, 0xc3, 0x40, - 0x10, 0x86, 0xd9, 0xb6, 0x8a, 0x4e, 0x14, 0x74, 0x4f, 0x45, 0x50, 0x42, 0x2f, 0xf6, 0x94, 0x60, - 0x14, 0x51, 0x6f, 0x56, 0x04, 0xa1, 0x14, 0x24, 0x07, 0x11, 0x2f, 0xb2, 0x49, 0xc6, 0x24, 0xe4, - 0x63, 0x97, 0xdd, 0x4d, 0x30, 0xff, 0x46, 0xfc, 0xa5, 0x92, 0x34, 0x62, 0x62, 0x83, 0xde, 0x86, - 0x77, 0x9e, 0x79, 0x79, 0x16, 0x16, 0x0e, 0x45, 0xa9, 0x03, 0xa6, 0xd9, 0x6b, 0x82, 0x95, 0x25, - 0x24, 0xd7, 0x9c, 0xd6, 0x91, 0xd2, 0x4c, 0xa3, 0x28, 0x64, 0x88, 0x59, 0x98, 0xe9, 0xd9, 0x07, - 0x01, 0xe3, 0x71, 0x0d, 0x2e, 0xb1, 0x52, 0xf4, 0x1a, 0xc6, 0x19, 0x13, 0x53, 0x62, 0x8e, 0xe7, - 0x86, 0x73, 0x6a, 0x6d, 0x1c, 0x58, 0x1d, 0xd8, 0x5a, 0x31, 0x71, 0x9f, 0x6b, 0x59, 0xb9, 0xf5, - 0xcd, 0xd1, 0x13, 0xec, 0x7c, 0x07, 0xf4, 0x00, 0xc6, 0x09, 0x56, 0x53, 0x62, 0x92, 0xf9, 0xae, - 0x5b, 0x8f, 0xf4, 0x02, 0xb6, 0x4a, 0x96, 0x16, 0x38, 0x1d, 0x99, 0x64, 0x6e, 0x38, 0x27, 0x03, - 0xd5, 0x77, 0x3c, 0x4d, 0xd1, 0xd7, 0x31, 0xcf, 0x95, 0xbb, 0x86, 0x6f, 0x46, 0x57, 0x64, 0xf6, - 0x49, 0xc0, 0xe8, 0xac, 0xfe, 0x57, 0xec, 0xc0, 0xbf, 0x14, 0x9f, 0xff, 0x54, 0xbc, 0xec, 0x2b, - 0x9a, 0x03, 0xd5, 0xf5, 0xb3, 0x6f, 0xf3, 0xe0, 0x81, 0xa9, 0x08, 0x7b, 0x92, 0x0b, 0xd8, 0xef, - 0xed, 0xe8, 0x19, 0x4c, 0xd2, 0x58, 0xe9, 0x56, 0xf3, 0x78, 0xb8, 0xab, 0xc5, 0xdd, 0x06, 0x9d, - 0x39, 0x00, 0x3f, 0xd9, 0x80, 0x1f, 0x85, 0x49, 0xc4, 0x54, 0xd4, 0xe8, 0xed, 0xb9, 0xcd, 0xbc, - 0x58, 0xbd, 0x2c, 0xc3, 0x58, 0x47, 0x85, 0x67, 0xf9, 0x3c, 0xb3, 0xa3, 0x4a, 0xa0, 0x4c, 0x31, - 0x08, 0x51, 0xda, 0x6f, 0xcc, 0x93, 0xb1, 0x6f, 0xfb, 0x5c, 0xa2, 0xdd, 0x46, 0x49, 0xd9, 0x0e, - 0xfa, 0xbd, 0x36, 0xb0, 0x37, 0x9c, 0xbc, 0xed, 0xe6, 0xa3, 0x9c, 0x7f, 0x05, 0x00, 0x00, 0xff, - 0xff, 0xdf, 0x2c, 0x02, 0xd0, 0x3d, 0x02, 0x00, 0x00, +var File_pvtdata_key_proto protoreflect.FileDescriptor + +var file_pvtdata_key_proto_rawDesc = []byte{ + 0x0a, 0x11, 0x70, 0x76, 0x74, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x6b, 0x65, 0x79, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x12, 0x11, 0x70, 0x76, 0x74, 0x73, 0x74, 0x61, 0x74, 0x65, 0x70, 0x75, 0x72, + 0x67, 0x65, 0x6d, 0x67, 0x6d, 0x74, 0x22, 0xa0, 0x01, 0x0a, 0x0b, 0x50, 0x76, 0x74, 0x64, 0x61, + 0x74, 0x61, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x39, 0x0a, 0x03, 0x6d, 0x61, 0x70, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x70, 0x76, 0x74, 0x73, 0x74, 0x61, 0x74, 0x65, 0x70, 0x75, + 0x72, 0x67, 0x65, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x50, 0x76, 0x74, 0x64, 0x61, 0x74, 0x61, 0x4b, + 0x65, 0x79, 0x73, 0x2e, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x03, 0x6d, 0x61, + 0x70, 0x1a, 0x56, 0x0a, 0x08, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, + 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, + 0x34, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, + 0x2e, 0x70, 0x76, 0x74, 0x73, 0x74, 0x61, 0x74, 0x65, 0x70, 0x75, 0x72, 0x67, 0x65, 0x6d, 0x67, + 0x6d, 0x74, 0x2e, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xa2, 0x01, 0x0a, 0x0b, 0x43, 0x6f, + 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x39, 0x0a, 0x03, 0x6d, 0x61, 0x70, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x70, 0x76, 0x74, 0x73, 0x74, 0x61, 0x74, + 0x65, 0x70, 0x75, 0x72, 0x67, 0x65, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x43, 0x6f, 0x6c, 0x6c, 0x65, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, + 0x03, 0x6d, 0x61, 0x70, 0x1a, 0x58, 0x0a, 0x08, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, + 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, + 0x65, 0x79, 0x12, 0x36, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x20, 0x2e, 0x70, 0x76, 0x74, 0x73, 0x74, 0x61, 0x74, 0x65, 0x70, 0x75, 0x72, 0x67, + 0x65, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x4b, 0x65, 0x79, 0x73, 0x41, 0x6e, 0x64, 0x48, 0x61, 0x73, + 0x68, 0x65, 0x73, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x42, + 0x0a, 0x0d, 0x4b, 0x65, 0x79, 0x73, 0x41, 0x6e, 0x64, 0x48, 0x61, 0x73, 0x68, 0x65, 0x73, 0x12, + 0x31, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, + 0x70, 0x76, 0x74, 0x73, 0x74, 0x61, 0x74, 0x65, 0x70, 0x75, 0x72, 0x67, 0x65, 0x6d, 0x67, 0x6d, + 0x74, 0x2e, 0x4b, 0x65, 0x79, 0x41, 0x6e, 0x64, 0x48, 0x61, 0x73, 0x68, 0x52, 0x04, 0x6c, 0x69, + 0x73, 0x74, 0x22, 0x32, 0x0a, 0x0a, 0x4b, 0x65, 0x79, 0x41, 0x6e, 0x64, 0x48, 0x61, 0x73, 0x68, + 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, + 0x65, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x04, 0x68, 0x61, 0x73, 0x68, 0x42, 0x4d, 0x5a, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, + 0x2f, 0x66, 0x61, 0x62, 0x72, 0x69, 0x63, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x6c, 0x65, 0x64, + 0x67, 0x65, 0x72, 0x2f, 0x6b, 0x76, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2f, 0x74, 0x78, 0x6d, + 0x67, 0x6d, 0x74, 0x2f, 0x70, 0x76, 0x74, 0x73, 0x74, 0x61, 0x74, 0x65, 0x70, 0x75, 0x72, 0x67, + 0x65, 0x6d, 0x67, 0x6d, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_pvtdata_key_proto_rawDescOnce sync.Once + file_pvtdata_key_proto_rawDescData = file_pvtdata_key_proto_rawDesc +) + +func file_pvtdata_key_proto_rawDescGZIP() []byte { + file_pvtdata_key_proto_rawDescOnce.Do(func() { + file_pvtdata_key_proto_rawDescData = protoimpl.X.CompressGZIP(file_pvtdata_key_proto_rawDescData) + }) + return file_pvtdata_key_proto_rawDescData +} + +var file_pvtdata_key_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_pvtdata_key_proto_goTypes = []any{ + (*PvtdataKeys)(nil), // 0: pvtstatepurgemgmt.PvtdataKeys + (*Collections)(nil), // 1: pvtstatepurgemgmt.Collections + (*KeysAndHashes)(nil), // 2: pvtstatepurgemgmt.KeysAndHashes + (*KeyAndHash)(nil), // 3: pvtstatepurgemgmt.KeyAndHash + nil, // 4: pvtstatepurgemgmt.PvtdataKeys.MapEntry + nil, // 5: pvtstatepurgemgmt.Collections.MapEntry +} +var file_pvtdata_key_proto_depIdxs = []int32{ + 4, // 0: pvtstatepurgemgmt.PvtdataKeys.map:type_name -> pvtstatepurgemgmt.PvtdataKeys.MapEntry + 5, // 1: pvtstatepurgemgmt.Collections.map:type_name -> pvtstatepurgemgmt.Collections.MapEntry + 3, // 2: pvtstatepurgemgmt.KeysAndHashes.list:type_name -> pvtstatepurgemgmt.KeyAndHash + 1, // 3: pvtstatepurgemgmt.PvtdataKeys.MapEntry.value:type_name -> pvtstatepurgemgmt.Collections + 2, // 4: pvtstatepurgemgmt.Collections.MapEntry.value:type_name -> pvtstatepurgemgmt.KeysAndHashes + 5, // [5:5] is the sub-list for method output_type + 5, // [5:5] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name +} + +func init() { file_pvtdata_key_proto_init() } +func file_pvtdata_key_proto_init() { + if File_pvtdata_key_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_pvtdata_key_proto_msgTypes[0].Exporter = func(v any, i int) any { + switch v := v.(*PvtdataKeys); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pvtdata_key_proto_msgTypes[1].Exporter = func(v any, i int) any { + switch v := v.(*Collections); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pvtdata_key_proto_msgTypes[2].Exporter = func(v any, i int) any { + switch v := v.(*KeysAndHashes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pvtdata_key_proto_msgTypes[3].Exporter = func(v any, i int) any { + switch v := v.(*KeyAndHash); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_pvtdata_key_proto_rawDesc, + NumEnums: 0, + NumMessages: 6, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_pvtdata_key_proto_goTypes, + DependencyIndexes: file_pvtdata_key_proto_depIdxs, + MessageInfos: file_pvtdata_key_proto_msgTypes, + }.Build() + File_pvtdata_key_proto = out.File + file_pvtdata_key_proto_rawDesc = nil + file_pvtdata_key_proto_goTypes = nil + file_pvtdata_key_proto_depIdxs = nil } diff --git a/core/ledger/kvledger/txmgmt/pvtstatepurgemgmt/snapshot_purge_mgr_builder_test.go b/core/ledger/kvledger/txmgmt/pvtstatepurgemgmt/snapshot_purge_mgr_builder_test.go index e14beb815e8..98bdfc230cf 100644 --- a/core/ledger/kvledger/txmgmt/pvtstatepurgemgmt/snapshot_purge_mgr_builder_test.go +++ b/core/ledger/kvledger/txmgmt/pvtstatepurgemgmt/snapshot_purge_mgr_builder_test.go @@ -16,6 +16,7 @@ import ( "github.com/hyperledger/fabric/core/ledger/pvtdatapolicy" btltestutil "github.com/hyperledger/fabric/core/ledger/pvtdatapolicy/testutil" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) func TestPurgeMgrBuilder(t *testing.T) { @@ -164,7 +165,12 @@ func TestPurgeMgrBuilder(t *testing.T) { t.Run(tc.name, func(t *testing.T) { output, err := purgeMgr.expKeeper.retrieve(tc.expiringBlock) require.NoError(t, err) - require.Equal(t, tc.expectedOutput, output) + if tc.expectedOutput != nil && output != nil { + require.Equal(t, tc.expectedOutput[0].expiryInfoKey, output[0].expiryInfoKey) + require.True(t, proto.Equal(tc.expectedOutput[0].pvtdataKeys, output[0].pvtdataKeys)) + } else { + require.Equal(t, tc.expectedOutput, output) + } }) } } diff --git a/core/ledger/kvledger/txmgmt/queryutil/combiner_test.go b/core/ledger/kvledger/txmgmt/queryutil/combiner_test.go index 39f81e2b479..6fca21fcc0e 100644 --- a/core/ledger/kvledger/txmgmt/queryutil/combiner_test.go +++ b/core/ledger/kvledger/txmgmt/queryutil/combiner_test.go @@ -11,16 +11,15 @@ import ( "os" "testing" - "github.com/hyperledger/fabric/core/ledger/kvledger/txmgmt/privacyenabledstate" - "github.com/hyperledger/fabric/core/ledger/util" - "github.com/hyperledger/fabric-lib-go/common/flogging" - "github.com/hyperledger/fabric-protos-go/ledger/queryresult" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/queryresult" commonledger "github.com/hyperledger/fabric/common/ledger" + "github.com/hyperledger/fabric/core/ledger/kvledger/txmgmt/privacyenabledstate" "github.com/hyperledger/fabric/core/ledger/kvledger/txmgmt/queryutil" "github.com/hyperledger/fabric/core/ledger/kvledger/txmgmt/queryutil/mock" "github.com/hyperledger/fabric/core/ledger/kvledger/txmgmt/statedb" statedbmock "github.com/hyperledger/fabric/core/ledger/kvledger/txmgmt/statedb/mock" + "github.com/hyperledger/fabric/core/ledger/util" "github.com/stretchr/testify/require" ) diff --git a/core/ledger/kvledger/txmgmt/queryutil/iterator_combiner.go b/core/ledger/kvledger/txmgmt/queryutil/iterator_combiner.go index 26b58e48bbc..f60c9855bf2 100644 --- a/core/ledger/kvledger/txmgmt/queryutil/iterator_combiner.go +++ b/core/ledger/kvledger/txmgmt/queryutil/iterator_combiner.go @@ -9,7 +9,7 @@ package queryutil import ( "fmt" - "github.com/hyperledger/fabric-protos-go/ledger/queryresult" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/queryresult" commonledger "github.com/hyperledger/fabric/common/ledger" "github.com/hyperledger/fabric/core/ledger/kvledger/txmgmt/statedb" ) diff --git a/core/ledger/kvledger/txmgmt/rwsetutil/kv_rwset_test.go b/core/ledger/kvledger/txmgmt/rwsetutil/kv_rwset_test.go index 3e96d2d7fe9..fe8ff90bfe8 100644 --- a/core/ledger/kvledger/txmgmt/rwsetutil/kv_rwset_test.go +++ b/core/ledger/kvledger/txmgmt/rwsetutil/kv_rwset_test.go @@ -11,9 +11,9 @@ import ( "testing" "github.com/davecgh/go-spew/spew" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/ledger/rwset/kvrwset" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset/kvrwset" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) const kvrwsetV1ProtoBytesFile = "testdata/kvrwsetV1ProtoBytes" diff --git a/core/ledger/kvledger/txmgmt/rwsetutil/kvrwset_proto_util.go b/core/ledger/kvledger/txmgmt/rwsetutil/kvrwset_proto_util.go index 709f08a37da..5a23e1146f6 100644 --- a/core/ledger/kvledger/txmgmt/rwsetutil/kvrwset_proto_util.go +++ b/core/ledger/kvledger/txmgmt/rwsetutil/kvrwset_proto_util.go @@ -6,7 +6,7 @@ SPDX-License-Identifier: Apache-2.0 package rwsetutil -import "github.com/hyperledger/fabric-protos-go/ledger/rwset/kvrwset" +import "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset/kvrwset" // SetRawReads sets the 'readsInfo' field to raw KVReads performed by the query func SetRawReads(rqi *kvrwset.RangeQueryInfo, kvReads []*kvrwset.KVRead) { diff --git a/core/ledger/kvledger/txmgmt/rwsetutil/kvrwset_proto_util_test.go b/core/ledger/kvledger/txmgmt/rwsetutil/kvrwset_proto_util_test.go index 02b21469004..948c9c127a0 100644 --- a/core/ledger/kvledger/txmgmt/rwsetutil/kvrwset_proto_util_test.go +++ b/core/ledger/kvledger/txmgmt/rwsetutil/kvrwset_proto_util_test.go @@ -9,7 +9,7 @@ package rwsetutil import ( "testing" - "github.com/hyperledger/fabric-protos-go/ledger/rwset/kvrwset" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset/kvrwset" "github.com/stretchr/testify/require" ) diff --git a/core/ledger/kvledger/txmgmt/rwsetutil/query_results_helper.go b/core/ledger/kvledger/txmgmt/rwsetutil/query_results_helper.go index 66045bf2b31..9ada841e303 100644 --- a/core/ledger/kvledger/txmgmt/rwsetutil/query_results_helper.go +++ b/core/ledger/kvledger/txmgmt/rwsetutil/query_results_helper.go @@ -9,9 +9,9 @@ package rwsetutil import ( "fmt" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/ledger/rwset/kvrwset" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset/kvrwset" "github.com/pkg/errors" + "google.golang.org/protobuf/proto" ) // MerkleTreeLevel used for representing a level of the merkle tree @@ -141,7 +141,7 @@ func serializeKVReads(kvReads []*kvrwset.KVRead) ([]byte, error) { return proto.Marshal(&kvrwset.QueryReads{KvReads: kvReads}) } -//////////// Merkle tree building code /////// +// ////////// Merkle tree building code /////// type merkleTree struct { tree map[MerkleTreeLevel][]Hash diff --git a/core/ledger/kvledger/txmgmt/rwsetutil/query_results_helper_test.go b/core/ledger/kvledger/txmgmt/rwsetutil/query_results_helper_test.go index cf7a704118f..266b4b0d5db 100644 --- a/core/ledger/kvledger/txmgmt/rwsetutil/query_results_helper_test.go +++ b/core/ledger/kvledger/txmgmt/rwsetutil/query_results_helper_test.go @@ -11,10 +11,10 @@ import ( "fmt" "testing" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/ledger/rwset/kvrwset" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset/kvrwset" "github.com/hyperledger/fabric/core/ledger/internal/version" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) var testHashFunc = func(data []byte) ([]byte, error) { diff --git a/core/ledger/kvledger/txmgmt/rwsetutil/rwset_builder.go b/core/ledger/kvledger/txmgmt/rwsetutil/rwset_builder.go index ca404a6f0e2..3e14ff1c29d 100644 --- a/core/ledger/kvledger/txmgmt/rwsetutil/rwset_builder.go +++ b/core/ledger/kvledger/txmgmt/rwsetutil/rwset_builder.go @@ -18,8 +18,8 @@ package rwsetutil import ( "github.com/hyperledger/fabric-lib-go/common/flogging" - "github.com/hyperledger/fabric-protos-go/ledger/rwset" - "github.com/hyperledger/fabric-protos-go/ledger/rwset/kvrwset" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset/kvrwset" "github.com/hyperledger/fabric/core/ledger" "github.com/hyperledger/fabric/core/ledger/internal/version" "github.com/hyperledger/fabric/core/ledger/util" diff --git a/core/ledger/kvledger/txmgmt/rwsetutil/rwset_builder_test.go b/core/ledger/kvledger/txmgmt/rwsetutil/rwset_builder_test.go index aa9c993a6b0..930a0b015fa 100644 --- a/core/ledger/kvledger/txmgmt/rwsetutil/rwset_builder_test.go +++ b/core/ledger/kvledger/txmgmt/rwsetutil/rwset_builder_test.go @@ -10,13 +10,13 @@ import ( "os" "testing" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/common/flogging" - "github.com/hyperledger/fabric-protos-go/ledger/rwset" - "github.com/hyperledger/fabric-protos-go/ledger/rwset/kvrwset" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset/kvrwset" "github.com/hyperledger/fabric/core/ledger/internal/version" "github.com/hyperledger/fabric/core/ledger/util" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) func TestMain(m *testing.M) { @@ -105,9 +105,9 @@ func TestTxSimulationResultWithPvtData(t *testing.T) { actualSimRes, err := rwSetBuilder.GetTxSimulationResults() require.NoError(t, err) - /////////////////////////////////////////////////////// + // ///////////////////////////////////////////////////// // construct the expected pvt rwset and compare with the one present in the txSimulationResults - /////////////////////////////////////////////////////// + // ///////////////////////////////////////////////////// pvtNs1Coll2 := &kvrwset.KVRWSet{ Writes: []*kvrwset.KVWrite{newKVWrite("key1", []byte("pvt-ns1-coll2-key1-value"))}, } @@ -160,9 +160,9 @@ func TestTxSimulationResultWithPvtData(t *testing.T) { } require.Equal(t, expectedPvtRWSet, actualSimRes.PvtSimulationResults) - /////////////////////////////////////////////////////// + // ///////////////////////////////////////////////////// // construct the public rwset (which will be part of the block) and compare with the one present in the txSimulationResults - /////////////////////////////////////////////////////// + // ///////////////////////////////////////////////////// pubNs1 := &kvrwset.KVRWSet{ Reads: []*kvrwset.KVRead{NewKVRead("key1", version.NewHeight(1, 1))}, } diff --git a/core/ledger/kvledger/txmgmt/rwsetutil/rwset_proto_util.go b/core/ledger/kvledger/txmgmt/rwsetutil/rwset_proto_util.go index 73d446f55f8..ed65d25af27 100644 --- a/core/ledger/kvledger/txmgmt/rwsetutil/rwset_proto_util.go +++ b/core/ledger/kvledger/txmgmt/rwsetutil/rwset_proto_util.go @@ -19,16 +19,16 @@ package rwsetutil import ( "bytes" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/ledger/rwset" - "github.com/hyperledger/fabric-protos-go/ledger/rwset/kvrwset" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset/kvrwset" "github.com/hyperledger/fabric/core/ledger/internal/version" "github.com/hyperledger/fabric/core/ledger/util" + "google.golang.org/protobuf/proto" ) -///////////////////////////////////////////////////////////////// +// /////////////////////////////////////////////////////////////// // Messages related to PUBLIC read-write set -///////////////////////////////////////////////////////////////// +// /////////////////////////////////////////////////////////////// // TxRwSet acts as a proxy of 'rwset.TxReadWriteSet' proto message and helps constructing Read-write set specifically for KV data model type TxRwSet struct { @@ -75,9 +75,9 @@ func (nsRwSet *NsRwSet) getPvtDataHash(coll string) []byte { return nil } -///////////////////////////////////////////////////////////////// +// /////////////////////////////////////////////////////////////// // Messages related to PRIVATE read-write set -///////////////////////////////////////////////////////////////// +// /////////////////////////////////////////////////////////////// // TxPvtRwSet represents 'rwset.TxPvtReadWriteSet' proto message type TxPvtRwSet struct { @@ -97,9 +97,9 @@ type CollPvtRwSet struct { KvRwSet *kvrwset.KVRWSet } -///////////////////////////////////////////////////////////////// +// /////////////////////////////////////////////////////////////// // FUNCTIONS for converting messages to/from proto bytes -///////////////////////////////////////////////////////////////// +// /////////////////////////////////////////////////////////////// // ToProtoBytes constructs TxReadWriteSet proto message and serializes using protobuf Marshal func (txRwSet *TxRwSet) ToProtoBytes() ([]byte, error) { @@ -249,9 +249,9 @@ func (txRwSet *TxRwSet) NumCollections() int { return numColls } -/////////////////////////////////////////////////////////////////////////////// +// ///////////////////////////////////////////////////////////////////////////// // functions for private read-write set -/////////////////////////////////////////////////////////////////////////////// +// ///////////////////////////////////////////////////////////////////////////// // ToProtoMsg transforms the struct into equivalent proto message func (txPvtRwSet *TxPvtRwSet) ToProtoMsg() (*rwset.TxPvtReadWriteSet, error) { diff --git a/core/ledger/kvledger/txmgmt/rwsetutil/rwset_proto_util_test.go b/core/ledger/kvledger/txmgmt/rwsetutil/rwset_proto_util_test.go index b559c8f9799..ef251447775 100644 --- a/core/ledger/kvledger/txmgmt/rwsetutil/rwset_proto_util_test.go +++ b/core/ledger/kvledger/txmgmt/rwsetutil/rwset_proto_util_test.go @@ -20,12 +20,12 @@ import ( "testing" "github.com/davecgh/go-spew/spew" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/ledger/rwset/kvrwset" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset/kvrwset" "github.com/hyperledger/fabric/core/ledger/internal/version" "github.com/hyperledger/fabric/core/ledger/util" "github.com/kr/pretty" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) func TestTxRWSetMarshalUnmarshal(t *testing.T) { @@ -188,9 +188,9 @@ func sampleCollHashedRwSet(collectionName string) *CollHashedRwSet { return collHashedRwSet } -/////////////////////////////////////////////////////////////////////////////// +// ///////////////////////////////////////////////////////////////////////////// // tests for private read-write set -/////////////////////////////////////////////////////////////////////////////// +// ///////////////////////////////////////////////////////////////////////////// func TestTxPvtRwSetConversion(t *testing.T) { txPvtRwSet := sampleTxPvtRwSet() diff --git a/core/ledger/kvledger/txmgmt/rwsetutil/rwset_test.go b/core/ledger/kvledger/txmgmt/rwsetutil/rwset_test.go index d9aeb942bf1..a4ef52aa1b8 100644 --- a/core/ledger/kvledger/txmgmt/rwsetutil/rwset_test.go +++ b/core/ledger/kvledger/txmgmt/rwsetutil/rwset_test.go @@ -21,9 +21,9 @@ import ( "testing" "github.com/davecgh/go-spew/spew" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/ledger/rwset" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) const rwsetV1ProtoBytesFile = "testdata/rwsetV1ProtoBytes" diff --git a/core/ledger/kvledger/txmgmt/statedb/statecouchdb/cache.go b/core/ledger/kvledger/txmgmt/statedb/statecouchdb/cache.go index 976fd9be263..d00ab336d08 100644 --- a/core/ledger/kvledger/txmgmt/statedb/statecouchdb/cache.go +++ b/core/ledger/kvledger/txmgmt/statedb/statecouchdb/cache.go @@ -8,7 +8,7 @@ package statecouchdb import ( "github.com/VictoriaMetrics/fastcache" - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" ) var keySep = []byte{0x00} diff --git a/core/ledger/kvledger/txmgmt/statedb/statecouchdb/cache_test.go b/core/ledger/kvledger/txmgmt/statedb/statecouchdb/cache_test.go index dcd2e7c67b3..9b02f6553fa 100644 --- a/core/ledger/kvledger/txmgmt/statedb/statecouchdb/cache_test.go +++ b/core/ledger/kvledger/txmgmt/statedb/statecouchdb/cache_test.go @@ -11,8 +11,8 @@ import ( "testing" "github.com/VictoriaMetrics/fastcache" - "github.com/golang/protobuf/proto" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) var sysNamespaces = []string{"lscc", "_lifecycle"} diff --git a/core/ledger/kvledger/txmgmt/statedb/statecouchdb/cache_value.pb.go b/core/ledger/kvledger/txmgmt/statedb/statecouchdb/cache_value.pb.go index 35c7fecc71a..f103dfd7675 100644 --- a/core/ledger/kvledger/txmgmt/statedb/statecouchdb/cache_value.pb.go +++ b/core/ledger/kvledger/txmgmt/statedb/statecouchdb/cache_value.pb.go @@ -1,108 +1,182 @@ +// +//Copyright IBM Corp. All Rights Reserved. +// +//SPDX-License-Identifier: Apache-2.0 + // Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.34.2 +// protoc v5.27.3 // source: cache_value.proto package statecouchdb import ( - fmt "fmt" - math "math" + reflect "reflect" + sync "sync" - proto "github.com/golang/protobuf/proto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) type CacheValue struct { - Version []byte `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` - Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` - Metadata []byte `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"` - AdditionalInfo []byte `protobuf:"bytes,4,opt,name=additional_info,json=additionalInfo,proto3" json:"additional_info,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Version []byte `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` + Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` + Metadata []byte `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"` + AdditionalInfo []byte `protobuf:"bytes,4,opt,name=additional_info,json=additionalInfo,proto3" json:"additional_info,omitempty"` } -func (m *CacheValue) Reset() { *m = CacheValue{} } -func (m *CacheValue) String() string { return proto.CompactTextString(m) } -func (*CacheValue) ProtoMessage() {} -func (*CacheValue) Descriptor() ([]byte, []int) { - return fileDescriptor_c9816941fba5d88a, []int{0} +func (x *CacheValue) Reset() { + *x = CacheValue{} + if protoimpl.UnsafeEnabled { + mi := &file_cache_value_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *CacheValue) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CacheValue.Unmarshal(m, b) -} -func (m *CacheValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CacheValue.Marshal(b, m, deterministic) +func (x *CacheValue) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *CacheValue) XXX_Merge(src proto.Message) { - xxx_messageInfo_CacheValue.Merge(m, src) -} -func (m *CacheValue) XXX_Size() int { - return xxx_messageInfo_CacheValue.Size(m) -} -func (m *CacheValue) XXX_DiscardUnknown() { - xxx_messageInfo_CacheValue.DiscardUnknown(m) + +func (*CacheValue) ProtoMessage() {} + +func (x *CacheValue) ProtoReflect() protoreflect.Message { + mi := &file_cache_value_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_CacheValue proto.InternalMessageInfo +// Deprecated: Use CacheValue.ProtoReflect.Descriptor instead. +func (*CacheValue) Descriptor() ([]byte, []int) { + return file_cache_value_proto_rawDescGZIP(), []int{0} +} -func (m *CacheValue) GetVersion() []byte { - if m != nil { - return m.Version +func (x *CacheValue) GetVersion() []byte { + if x != nil { + return x.Version } return nil } -func (m *CacheValue) GetValue() []byte { - if m != nil { - return m.Value +func (x *CacheValue) GetValue() []byte { + if x != nil { + return x.Value } return nil } -func (m *CacheValue) GetMetadata() []byte { - if m != nil { - return m.Metadata +func (x *CacheValue) GetMetadata() []byte { + if x != nil { + return x.Metadata } return nil } -func (m *CacheValue) GetAdditionalInfo() []byte { - if m != nil { - return m.AdditionalInfo +func (x *CacheValue) GetAdditionalInfo() []byte { + if x != nil { + return x.AdditionalInfo } return nil } -func init() { - proto.RegisterType((*CacheValue)(nil), "statecouchdb.CacheValue") +var File_cache_value_proto protoreflect.FileDescriptor + +var file_cache_value_proto_rawDesc = []byte{ + 0x0a, 0x11, 0x63, 0x61, 0x63, 0x68, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x12, 0x0c, 0x73, 0x74, 0x61, 0x74, 0x65, 0x63, 0x6f, 0x75, 0x63, 0x68, 0x64, + 0x62, 0x22, 0x81, 0x01, 0x0a, 0x0a, 0x43, 0x61, 0x63, 0x68, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x12, 0x1a, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x27, 0x0a, 0x0f, + 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0e, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, + 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x42, 0x50, 0x5a, 0x4e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2f, + 0x66, 0x61, 0x62, 0x72, 0x69, 0x63, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x6c, 0x65, 0x64, 0x67, + 0x65, 0x72, 0x2f, 0x6b, 0x76, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2f, 0x74, 0x78, 0x6d, 0x67, + 0x6d, 0x74, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x64, 0x62, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x65, + 0x63, 0x6f, 0x75, 0x63, 0x68, 0x64, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_cache_value_proto_rawDescOnce sync.Once + file_cache_value_proto_rawDescData = file_cache_value_proto_rawDesc +) + +func file_cache_value_proto_rawDescGZIP() []byte { + file_cache_value_proto_rawDescOnce.Do(func() { + file_cache_value_proto_rawDescData = protoimpl.X.CompressGZIP(file_cache_value_proto_rawDescData) + }) + return file_cache_value_proto_rawDescData } -func init() { proto.RegisterFile("cache_value.proto", fileDescriptor_c9816941fba5d88a) } - -var fileDescriptor_c9816941fba5d88a = []byte{ - // 206 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x4c, 0x8f, 0xbf, 0x4b, 0xc7, 0x30, - 0x10, 0x47, 0xa9, 0xbf, 0x09, 0x45, 0x31, 0x38, 0x04, 0x27, 0x71, 0xd1, 0xa9, 0x19, 0xfc, 0x0f, - 0x74, 0x72, 0x11, 0x71, 0x70, 0x70, 0x29, 0x97, 0xe4, 0xda, 0x04, 0x9b, 0x5c, 0x49, 0xaf, 0x45, - 0x47, 0xff, 0x73, 0x69, 0xac, 0xfa, 0xdd, 0xf2, 0x79, 0x79, 0x1c, 0x3c, 0x71, 0x6e, 0xc1, 0x7a, - 0x6c, 0x17, 0x18, 0x66, 0x6c, 0xc6, 0x4c, 0x4c, 0xb2, 0x9e, 0x18, 0x18, 0x2d, 0xcd, 0xd6, 0x3b, - 0x73, 0xfd, 0x55, 0x09, 0xf1, 0xb0, 0x3a, 0xaf, 0xab, 0x22, 0x95, 0x38, 0x5e, 0x30, 0x4f, 0x81, - 0x92, 0xaa, 0xae, 0xaa, 0xdb, 0xfa, 0xe5, 0x77, 0xca, 0x0b, 0x71, 0x58, 0xae, 0xa8, 0xbd, 0xc2, - 0x7f, 0x86, 0xbc, 0x14, 0x27, 0x11, 0x19, 0x1c, 0x30, 0xa8, 0xfd, 0xf2, 0xf1, 0xb7, 0xe5, 0x8d, - 0x38, 0x03, 0xe7, 0x02, 0x07, 0x4a, 0x30, 0xb4, 0x21, 0x75, 0xa4, 0x0e, 0x8a, 0x72, 0xfa, 0x8f, - 0x1f, 0x53, 0x47, 0xf7, 0xcf, 0x6f, 0x4f, 0x7d, 0x60, 0x3f, 0x9b, 0xc6, 0x52, 0xd4, 0xfe, 0x73, - 0xc4, 0x3c, 0xa0, 0xeb, 0x31, 0xeb, 0x0e, 0x4c, 0x0e, 0x56, 0x5b, 0xca, 0xa8, 0x37, 0xf4, 0xbe, - 0x6c, 0x0f, 0xfe, 0x88, 0x7d, 0x64, 0x5d, 0x6a, 0x9c, 0xd1, 0xbb, 0x55, 0xe6, 0xa8, 0xa4, 0xde, - 0x7d, 0x07, 0x00, 0x00, 0xff, 0xff, 0x71, 0x35, 0x6f, 0x09, 0xff, 0x00, 0x00, 0x00, +var file_cache_value_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_cache_value_proto_goTypes = []any{ + (*CacheValue)(nil), // 0: statecouchdb.CacheValue +} +var file_cache_value_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_cache_value_proto_init() } +func file_cache_value_proto_init() { + if File_cache_value_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_cache_value_proto_msgTypes[0].Exporter = func(v any, i int) any { + switch v := v.(*CacheValue); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_cache_value_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_cache_value_proto_goTypes, + DependencyIndexes: file_cache_value_proto_depIdxs, + MessageInfos: file_cache_value_proto_msgTypes, + }.Build() + File_cache_value_proto = out.File + file_cache_value_proto_rawDesc = nil + file_cache_value_proto_goTypes = nil + file_cache_value_proto_depIdxs = nil } diff --git a/core/ledger/kvledger/txmgmt/statedb/statecouchdb/dbvalue.pb.go b/core/ledger/kvledger/txmgmt/statedb/statecouchdb/dbvalue.pb.go index daffbf44346..bfa0cbf2818 100644 --- a/core/ledger/kvledger/txmgmt/statedb/statecouchdb/dbvalue.pb.go +++ b/core/ledger/kvledger/txmgmt/statedb/statecouchdb/dbvalue.pb.go @@ -1,90 +1,163 @@ +// +//Copyright IBM Corp. All Rights Reserved. +// +//SPDX-License-Identifier: Apache-2.0 + // Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.34.2 +// protoc v5.27.3 // source: dbvalue.proto package statecouchdb import ( - fmt "fmt" - math "math" + reflect "reflect" + sync "sync" - proto "github.com/golang/protobuf/proto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) type VersionAndMetadata struct { - Version []byte `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` - Metadata []byte `protobuf:"bytes,2,opt,name=metadata,proto3" json:"metadata,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *VersionAndMetadata) Reset() { *m = VersionAndMetadata{} } -func (m *VersionAndMetadata) String() string { return proto.CompactTextString(m) } -func (*VersionAndMetadata) ProtoMessage() {} -func (*VersionAndMetadata) Descriptor() ([]byte, []int) { - return fileDescriptor_cc31cde9d22795c4, []int{0} + Version []byte `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` + Metadata []byte `protobuf:"bytes,2,opt,name=metadata,proto3" json:"metadata,omitempty"` } -func (m *VersionAndMetadata) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_VersionAndMetadata.Unmarshal(m, b) -} -func (m *VersionAndMetadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_VersionAndMetadata.Marshal(b, m, deterministic) -} -func (m *VersionAndMetadata) XXX_Merge(src proto.Message) { - xxx_messageInfo_VersionAndMetadata.Merge(m, src) +func (x *VersionAndMetadata) Reset() { + *x = VersionAndMetadata{} + if protoimpl.UnsafeEnabled { + mi := &file_dbvalue_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *VersionAndMetadata) XXX_Size() int { - return xxx_messageInfo_VersionAndMetadata.Size(m) + +func (x *VersionAndMetadata) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *VersionAndMetadata) XXX_DiscardUnknown() { - xxx_messageInfo_VersionAndMetadata.DiscardUnknown(m) + +func (*VersionAndMetadata) ProtoMessage() {} + +func (x *VersionAndMetadata) ProtoReflect() protoreflect.Message { + mi := &file_dbvalue_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_VersionAndMetadata proto.InternalMessageInfo +// Deprecated: Use VersionAndMetadata.ProtoReflect.Descriptor instead. +func (*VersionAndMetadata) Descriptor() ([]byte, []int) { + return file_dbvalue_proto_rawDescGZIP(), []int{0} +} -func (m *VersionAndMetadata) GetVersion() []byte { - if m != nil { - return m.Version +func (x *VersionAndMetadata) GetVersion() []byte { + if x != nil { + return x.Version } return nil } -func (m *VersionAndMetadata) GetMetadata() []byte { - if m != nil { - return m.Metadata +func (x *VersionAndMetadata) GetMetadata() []byte { + if x != nil { + return x.Metadata } return nil } -func init() { - proto.RegisterType((*VersionAndMetadata)(nil), "statecouchdb.VersionAndMetadata") +var File_dbvalue_proto protoreflect.FileDescriptor + +var file_dbvalue_proto_rawDesc = []byte{ + 0x0a, 0x0d, 0x64, 0x62, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, + 0x0c, 0x73, 0x74, 0x61, 0x74, 0x65, 0x63, 0x6f, 0x75, 0x63, 0x68, 0x64, 0x62, 0x22, 0x4a, 0x0a, + 0x12, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x41, 0x6e, 0x64, 0x4d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, + 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x42, 0x50, 0x5a, 0x4e, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x65, 0x64, + 0x67, 0x65, 0x72, 0x2f, 0x66, 0x61, 0x62, 0x72, 0x69, 0x63, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, + 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2f, 0x6b, 0x76, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2f, + 0x74, 0x78, 0x6d, 0x67, 0x6d, 0x74, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x64, 0x62, 0x2f, 0x73, + 0x74, 0x61, 0x74, 0x65, 0x63, 0x6f, 0x75, 0x63, 0x68, 0x64, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, +} + +var ( + file_dbvalue_proto_rawDescOnce sync.Once + file_dbvalue_proto_rawDescData = file_dbvalue_proto_rawDesc +) + +func file_dbvalue_proto_rawDescGZIP() []byte { + file_dbvalue_proto_rawDescOnce.Do(func() { + file_dbvalue_proto_rawDescData = protoimpl.X.CompressGZIP(file_dbvalue_proto_rawDescData) + }) + return file_dbvalue_proto_rawDescData +} + +var file_dbvalue_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_dbvalue_proto_goTypes = []any{ + (*VersionAndMetadata)(nil), // 0: statecouchdb.VersionAndMetadata +} +var file_dbvalue_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name } -func init() { proto.RegisterFile("dbvalue.proto", fileDescriptor_cc31cde9d22795c4) } - -var fileDescriptor_cc31cde9d22795c4 = []byte{ - // 168 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x4d, 0x49, 0x2a, 0x4b, - 0xcc, 0x29, 0x4d, 0xd5, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x29, 0x2e, 0x49, 0x2c, 0x49, - 0x4d, 0xce, 0x2f, 0x4d, 0xce, 0x48, 0x49, 0x52, 0xf2, 0xe2, 0x12, 0x0a, 0x4b, 0x2d, 0x2a, 0xce, - 0xcc, 0xcf, 0x73, 0xcc, 0x4b, 0xf1, 0x4d, 0x2d, 0x49, 0x4c, 0x49, 0x2c, 0x49, 0x14, 0x92, 0xe0, - 0x62, 0x2f, 0x83, 0x88, 0x4a, 0x30, 0x2a, 0x30, 0x6a, 0xf0, 0x04, 0xc1, 0xb8, 0x42, 0x52, 0x5c, - 0x1c, 0xb9, 0x50, 0x55, 0x12, 0x4c, 0x60, 0x29, 0x38, 0xdf, 0x29, 0x20, 0xca, 0x2f, 0x3d, 0xb3, - 0x24, 0xa3, 0x34, 0x49, 0x2f, 0x39, 0x3f, 0x57, 0x3f, 0xa3, 0xb2, 0x20, 0xb5, 0x28, 0x27, 0x35, - 0x25, 0x3d, 0xb5, 0x48, 0x3f, 0x2d, 0x31, 0xa9, 0x28, 0x33, 0x59, 0x3f, 0x39, 0xbf, 0x28, 0x55, - 0x1f, 0x2a, 0x94, 0x5d, 0x06, 0x65, 0x94, 0x54, 0xe4, 0xa6, 0xe7, 0x96, 0xe8, 0x83, 0x5d, 0x95, - 0x92, 0xa4, 0x8f, 0xec, 0xba, 0x24, 0x36, 0xb0, 0x93, 0x8d, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, - 0x59, 0x98, 0x69, 0x7d, 0xc3, 0x00, 0x00, 0x00, +func init() { file_dbvalue_proto_init() } +func file_dbvalue_proto_init() { + if File_dbvalue_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_dbvalue_proto_msgTypes[0].Exporter = func(v any, i int) any { + switch v := v.(*VersionAndMetadata); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_dbvalue_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_dbvalue_proto_goTypes, + DependencyIndexes: file_dbvalue_proto_depIdxs, + MessageInfos: file_dbvalue_proto_msgTypes, + }.Build() + File_dbvalue_proto = out.File + file_dbvalue_proto_rawDesc = nil + file_dbvalue_proto_goTypes = nil + file_dbvalue_proto_depIdxs = nil } diff --git a/core/ledger/kvledger/txmgmt/statedb/statecouchdb/dbvalue_encoding.go b/core/ledger/kvledger/txmgmt/statedb/statecouchdb/dbvalue_encoding.go index 9f6a11d8372..4faa4a06770 100644 --- a/core/ledger/kvledger/txmgmt/statedb/statecouchdb/dbvalue_encoding.go +++ b/core/ledger/kvledger/txmgmt/statedb/statecouchdb/dbvalue_encoding.go @@ -9,9 +9,9 @@ package statecouchdb import ( "encoding/base64" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric/core/ledger/internal/version" "github.com/pkg/errors" + "google.golang.org/protobuf/proto" ) func encodeVersionAndMetadata(version *version.Height, metadata []byte) (string, error) { diff --git a/core/ledger/kvledger/txmgmt/statedb/stateleveldb/db_value.pb.go b/core/ledger/kvledger/txmgmt/statedb/stateleveldb/db_value.pb.go index 38117a70202..3d8957c4be7 100644 --- a/core/ledger/kvledger/txmgmt/statedb/stateleveldb/db_value.pb.go +++ b/core/ledger/kvledger/txmgmt/statedb/stateleveldb/db_value.pb.go @@ -1,99 +1,171 @@ +// +//Copyright IBM Corp. All Rights Reserved. +// +//SPDX-License-Identifier: Apache-2.0 + // Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.34.2 +// protoc v5.27.3 // source: db_value.proto package stateleveldb import ( - fmt "fmt" - math "math" + reflect "reflect" + sync "sync" - proto "github.com/golang/protobuf/proto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) type DBValue struct { - Version []byte `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` - Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` - Metadata []byte `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *DBValue) Reset() { *m = DBValue{} } -func (m *DBValue) String() string { return proto.CompactTextString(m) } -func (*DBValue) ProtoMessage() {} -func (*DBValue) Descriptor() ([]byte, []int) { - return fileDescriptor_1f72618b1cd7c254, []int{0} + Version []byte `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` + Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` + Metadata []byte `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"` } -func (m *DBValue) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DBValue.Unmarshal(m, b) -} -func (m *DBValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DBValue.Marshal(b, m, deterministic) -} -func (m *DBValue) XXX_Merge(src proto.Message) { - xxx_messageInfo_DBValue.Merge(m, src) +func (x *DBValue) Reset() { + *x = DBValue{} + if protoimpl.UnsafeEnabled { + mi := &file_db_value_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *DBValue) XXX_Size() int { - return xxx_messageInfo_DBValue.Size(m) + +func (x *DBValue) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *DBValue) XXX_DiscardUnknown() { - xxx_messageInfo_DBValue.DiscardUnknown(m) + +func (*DBValue) ProtoMessage() {} + +func (x *DBValue) ProtoReflect() protoreflect.Message { + mi := &file_db_value_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_DBValue proto.InternalMessageInfo +// Deprecated: Use DBValue.ProtoReflect.Descriptor instead. +func (*DBValue) Descriptor() ([]byte, []int) { + return file_db_value_proto_rawDescGZIP(), []int{0} +} -func (m *DBValue) GetVersion() []byte { - if m != nil { - return m.Version +func (x *DBValue) GetVersion() []byte { + if x != nil { + return x.Version } return nil } -func (m *DBValue) GetValue() []byte { - if m != nil { - return m.Value +func (x *DBValue) GetValue() []byte { + if x != nil { + return x.Value } return nil } -func (m *DBValue) GetMetadata() []byte { - if m != nil { - return m.Metadata +func (x *DBValue) GetMetadata() []byte { + if x != nil { + return x.Metadata } return nil } -func init() { - proto.RegisterType((*DBValue)(nil), "stateleveldb.DBValue") +var File_db_value_proto protoreflect.FileDescriptor + +var file_db_value_proto_rawDesc = []byte{ + 0x0a, 0x0e, 0x64, 0x62, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x12, 0x0c, 0x73, 0x74, 0x61, 0x74, 0x65, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x64, 0x62, 0x22, 0x55, + 0x0a, 0x07, 0x44, 0x42, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, + 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, + 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x6d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x6d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0x42, 0x50, 0x5a, 0x4e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2f, + 0x66, 0x61, 0x62, 0x72, 0x69, 0x63, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x6c, 0x65, 0x64, 0x67, + 0x65, 0x72, 0x2f, 0x6b, 0x76, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2f, 0x74, 0x78, 0x6d, 0x67, + 0x6d, 0x74, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x64, 0x62, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x65, + 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x64, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_db_value_proto_rawDescOnce sync.Once + file_db_value_proto_rawDescData = file_db_value_proto_rawDesc +) + +func file_db_value_proto_rawDescGZIP() []byte { + file_db_value_proto_rawDescOnce.Do(func() { + file_db_value_proto_rawDescData = protoimpl.X.CompressGZIP(file_db_value_proto_rawDescData) + }) + return file_db_value_proto_rawDescData +} + +var file_db_value_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_db_value_proto_goTypes = []any{ + (*DBValue)(nil), // 0: stateleveldb.DBValue +} +var file_db_value_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name } -func init() { proto.RegisterFile("db_value.proto", fileDescriptor_1f72618b1cd7c254) } - -var fileDescriptor_1f72618b1cd7c254 = []byte{ - // 177 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x4b, 0x49, 0x8a, 0x2f, - 0x4b, 0xcc, 0x29, 0x4d, 0xd5, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x29, 0x2e, 0x49, 0x2c, - 0x49, 0xcd, 0x49, 0x2d, 0x4b, 0xcd, 0x49, 0x49, 0x52, 0x0a, 0xe5, 0x62, 0x77, 0x71, 0x0a, 0x03, - 0x49, 0x0b, 0x49, 0x70, 0xb1, 0x97, 0xa5, 0x16, 0x15, 0x67, 0xe6, 0xe7, 0x49, 0x30, 0x2a, 0x30, - 0x6a, 0xf0, 0x04, 0xc1, 0xb8, 0x42, 0x22, 0x5c, 0xac, 0x60, 0x13, 0x24, 0x98, 0xc0, 0xe2, 0x10, - 0x8e, 0x90, 0x14, 0x17, 0x47, 0x6e, 0x6a, 0x49, 0x62, 0x4a, 0x62, 0x49, 0xa2, 0x04, 0x33, 0x58, - 0x02, 0xce, 0x77, 0x0a, 0x88, 0xf2, 0x4b, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, - 0xd5, 0xcf, 0xa8, 0x2c, 0x48, 0x2d, 0xca, 0x49, 0x4d, 0x49, 0x4f, 0x2d, 0xd2, 0x4f, 0x4b, 0x4c, - 0x2a, 0xca, 0x4c, 0xd6, 0x4f, 0xce, 0x2f, 0x4a, 0xd5, 0x87, 0x0a, 0x65, 0x97, 0x41, 0x19, 0x25, - 0x15, 0xb9, 0xe9, 0xb9, 0x25, 0xfa, 0x60, 0x07, 0xa6, 0x24, 0xe9, 0x23, 0x3b, 0x34, 0x89, 0x0d, - 0xec, 0x7a, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x4d, 0xae, 0xf4, 0xbc, 0xcf, 0x00, 0x00, - 0x00, +func init() { file_db_value_proto_init() } +func file_db_value_proto_init() { + if File_db_value_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_db_value_proto_msgTypes[0].Exporter = func(v any, i int) any { + switch v := v.(*DBValue); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_db_value_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_db_value_proto_goTypes, + DependencyIndexes: file_db_value_proto_depIdxs, + MessageInfos: file_db_value_proto_msgTypes, + }.Build() + File_db_value_proto = out.File + file_db_value_proto_rawDesc = nil + file_db_value_proto_goTypes = nil + file_db_value_proto_depIdxs = nil } diff --git a/core/ledger/kvledger/txmgmt/statedb/stateleveldb/value_encoding.go b/core/ledger/kvledger/txmgmt/statedb/stateleveldb/value_encoding.go index 79cfeaba576..3ef34a0db86 100644 --- a/core/ledger/kvledger/txmgmt/statedb/stateleveldb/value_encoding.go +++ b/core/ledger/kvledger/txmgmt/statedb/stateleveldb/value_encoding.go @@ -7,9 +7,9 @@ SPDX-License-Identifier: Apache-2.0 package stateleveldb import ( - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric/core/ledger/internal/version" "github.com/hyperledger/fabric/core/ledger/kvledger/txmgmt/statedb" + "google.golang.org/protobuf/proto" ) // encodeValue encodes the value, version, and metadata diff --git a/core/ledger/kvledger/txmgmt/statemetadata/metadata.go b/core/ledger/kvledger/txmgmt/statemetadata/metadata.go index 7d9da372ca5..f9f4db672d2 100644 --- a/core/ledger/kvledger/txmgmt/statemetadata/metadata.go +++ b/core/ledger/kvledger/txmgmt/statemetadata/metadata.go @@ -7,8 +7,8 @@ SPDX-License-Identifier: Apache-2.0 package statemetadata import ( - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/ledger/rwset/kvrwset" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset/kvrwset" + "google.golang.org/protobuf/proto" ) // Serialize serializes metadata entries for storing in statedb diff --git a/core/ledger/kvledger/txmgmt/statemetadata/metadata_test.go b/core/ledger/kvledger/txmgmt/statemetadata/metadata_test.go index af9b5f51ed2..05903d807e2 100644 --- a/core/ledger/kvledger/txmgmt/statemetadata/metadata_test.go +++ b/core/ledger/kvledger/txmgmt/statemetadata/metadata_test.go @@ -9,7 +9,7 @@ package statemetadata import ( "testing" - "github.com/hyperledger/fabric-protos-go/ledger/rwset/kvrwset" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset/kvrwset" "github.com/stretchr/testify/require" ) diff --git a/core/ledger/kvledger/txmgmt/txmgr/collection_val.go b/core/ledger/kvledger/txmgmt/txmgr/collection_val.go index 1db6b138ade..79102184152 100644 --- a/core/ledger/kvledger/txmgmt/txmgr/collection_val.go +++ b/core/ledger/kvledger/txmgmt/txmgr/collection_val.go @@ -7,7 +7,7 @@ SPDX-License-Identifier: Apache-2.0 package txmgr import ( - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/core/ledger" ) diff --git a/core/ledger/kvledger/txmgmt/txmgr/lockbased_txmgr.go b/core/ledger/kvledger/txmgmt/txmgr/lockbased_txmgr.go index 4aba6db461e..1e67682962b 100644 --- a/core/ledger/kvledger/txmgmt/txmgr/lockbased_txmgr.go +++ b/core/ledger/kvledger/txmgmt/txmgr/lockbased_txmgr.go @@ -10,11 +10,10 @@ import ( "bytes" "sync" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/common/flogging" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/ledger/rwset" - "github.com/hyperledger/fabric-protos-go/ledger/rwset/kvrwset" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset/kvrwset" "github.com/hyperledger/fabric/common/ledger/snapshot" "github.com/hyperledger/fabric/core/ledger" "github.com/hyperledger/fabric/core/ledger/internal/version" @@ -27,6 +26,7 @@ import ( "github.com/hyperledger/fabric/core/ledger/pvtdatapolicy" "github.com/hyperledger/fabric/core/ledger/util" "github.com/pkg/errors" + "google.golang.org/protobuf/proto" ) var logger = flogging.MustGetLogger("lockbasedtxmgr") diff --git a/core/ledger/kvledger/txmgmt/txmgr/pkg_test.go b/core/ledger/kvledger/txmgmt/txmgr/pkg_test.go index 91a17f79ed4..9825a38fe74 100644 --- a/core/ledger/kvledger/txmgmt/txmgr/pkg_test.go +++ b/core/ledger/kvledger/txmgmt/txmgr/pkg_test.go @@ -11,12 +11,11 @@ import ( "os" "testing" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/common/flogging" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/ledger/queryresult" - "github.com/hyperledger/fabric-protos-go/ledger/rwset" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/queryresult" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/ledger/testutil" "github.com/hyperledger/fabric/core/ledger" "github.com/hyperledger/fabric/core/ledger/internal/version" @@ -28,6 +27,7 @@ import ( "github.com/hyperledger/fabric/core/ledger/util" "github.com/hyperledger/fabric/internal/pkg/txflags" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) func TestMain(m *testing.M) { @@ -67,7 +67,7 @@ var testEnvsMap = map[string]testEnv{ couchDBtestEnvName: testEnvs[1], } -///////////// LevelDB Environment ////////////// +// /////////// LevelDB Environment ////////////// type lockBasedEnv struct { dbInitialized bool @@ -134,7 +134,7 @@ func (env *lockBasedEnv) stopExternalResource() { env.testDBEnv.StopExternalResource() } -//////////// txMgrTestHelper ///////////// +// ////////// txMgrTestHelper ///////////// type txMgrTestHelper struct { t *testing.T diff --git a/core/ledger/kvledger/txmgmt/txmgr/query_executor.go b/core/ledger/kvledger/txmgmt/txmgr/query_executor.go index 156be65610a..52f2553d5fe 100644 --- a/core/ledger/kvledger/txmgmt/txmgr/query_executor.go +++ b/core/ledger/kvledger/txmgmt/txmgr/query_executor.go @@ -7,8 +7,8 @@ SPDX-License-Identifier: Apache-2.0 package txmgr import ( - "github.com/hyperledger/fabric-protos-go/ledger/queryresult" - "github.com/hyperledger/fabric-protos-go/ledger/rwset/kvrwset" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/queryresult" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset/kvrwset" commonledger "github.com/hyperledger/fabric/common/ledger" "github.com/hyperledger/fabric/core/ledger" "github.com/hyperledger/fabric/core/ledger/internal/version" diff --git a/core/ledger/kvledger/txmgmt/txmgr/query_executor_test.go b/core/ledger/kvledger/txmgmt/txmgr/query_executor_test.go index 4cd0b4d3c8d..e72fa935c64 100644 --- a/core/ledger/kvledger/txmgmt/txmgr/query_executor_test.go +++ b/core/ledger/kvledger/txmgmt/txmgr/query_executor_test.go @@ -10,8 +10,8 @@ import ( "crypto/sha256" "testing" - "github.com/hyperledger/fabric-protos-go/ledger/queryresult" - "github.com/hyperledger/fabric-protos-go/ledger/rwset/kvrwset" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/queryresult" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset/kvrwset" commonledger "github.com/hyperledger/fabric/common/ledger" "github.com/hyperledger/fabric/common/ledger/testutil" "github.com/hyperledger/fabric/core/ledger/internal/version" @@ -20,6 +20,7 @@ import ( btltestutil "github.com/hyperledger/fabric/core/ledger/pvtdatapolicy/testutil" "github.com/hyperledger/fabric/core/ledger/util" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) var testHashFunc = func(data []byte) ([]byte, error) { @@ -197,7 +198,12 @@ func testGetPvtdataHash(t *testing.T, env testEnv) { }, }, } - require.Equal(t, expectedRwSet, txrwset) + require.Equal(t, len(expectedRwSet.NsRwSets), len(txrwset.NsRwSets)) + require.Equal(t, expectedRwSet.NsRwSets[0].NameSpace, txrwset.NsRwSets[0].NameSpace) + require.True(t, proto.Equal(expectedRwSet.NsRwSets[0].KvRwSet, txrwset.NsRwSets[0].KvRwSet)) + require.Equal(t, len(expectedRwSet.NsRwSets[0].CollHashedRwSets), len(txrwset.NsRwSets[0].CollHashedRwSets)) + require.Equal(t, expectedRwSet.NsRwSets[0].CollHashedRwSets[0].CollectionName, txrwset.NsRwSets[0].CollHashedRwSets[0].CollectionName) + require.True(t, proto.Equal(expectedRwSet.NsRwSets[0].CollHashedRwSets[0].HashedRwSet, txrwset.NsRwSets[0].CollHashedRwSets[0].HashedRwSet)) } func putPvtUpdates(t *testing.T, updates *privacyenabledstate.UpdateBatch, ns, coll, key string, value []byte, ver *version.Height) { diff --git a/core/ledger/kvledger/txmgmt/txmgr/state_listener_test.go b/core/ledger/kvledger/txmgmt/txmgr/state_listener_test.go index c1dc622006d..53865f2108d 100644 --- a/core/ledger/kvledger/txmgmt/txmgr/state_listener_test.go +++ b/core/ledger/kvledger/txmgmt/txmgr/state_listener_test.go @@ -9,8 +9,8 @@ package txmgr import ( "testing" - "github.com/hyperledger/fabric-protos-go/ledger/queryresult" - "github.com/hyperledger/fabric-protos-go/ledger/rwset/kvrwset" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/queryresult" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset/kvrwset" "github.com/hyperledger/fabric/common/ledger/testutil" "github.com/hyperledger/fabric/core/ledger" "github.com/hyperledger/fabric/core/ledger/internal/version" diff --git a/core/ledger/kvledger/txmgmt/txmgr/txmgr_test.go b/core/ledger/kvledger/txmgmt/txmgr/txmgr_test.go index 0f951ec2eb5..400c1bbd8bd 100644 --- a/core/ledger/kvledger/txmgmt/txmgr/txmgr_test.go +++ b/core/ledger/kvledger/txmgmt/txmgr/txmgr_test.go @@ -14,12 +14,10 @@ import ( "strings" "testing" - "github.com/hyperledger/fabric-protos-go/peer" - - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/ledger/queryresult" - "github.com/hyperledger/fabric-protos-go/ledger/rwset" - "github.com/hyperledger/fabric-protos-go/ledger/rwset/kvrwset" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/queryresult" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset/kvrwset" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/ledger/testutil" "github.com/hyperledger/fabric/core/ledger" "github.com/hyperledger/fabric/core/ledger/internal/version" @@ -28,6 +26,7 @@ import ( btltestutil "github.com/hyperledger/fabric/core/ledger/pvtdatapolicy/testutil" "github.com/hyperledger/fabric/core/ledger/util" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) func TestTxSimulatorWithNoExistingData(t *testing.T) { diff --git a/core/ledger/kvledger/txmgmt/txmgr/update_batch_bytes.go b/core/ledger/kvledger/txmgmt/txmgr/update_batch_bytes.go index fa904db9ea8..1d00cfa8088 100644 --- a/core/ledger/kvledger/txmgmt/txmgr/update_batch_bytes.go +++ b/core/ledger/kvledger/txmgmt/txmgr/update_batch_bytes.go @@ -9,11 +9,11 @@ package txmgr import ( "sort" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric/core/ledger/kvledger/txmgmt/privacyenabledstate" "github.com/hyperledger/fabric/core/ledger/kvledger/txmgmt/statedb" "github.com/hyperledger/fabric/core/ledger/util" "github.com/pkg/errors" + "google.golang.org/protobuf/proto" ) // deterministicBytesForPubAndHashUpdates constructs the bytes for a given UpdateBatch diff --git a/core/ledger/kvledger/txmgmt/txmgr/update_batch_bytes_test.go b/core/ledger/kvledger/txmgmt/txmgr/update_batch_bytes_test.go index 3d4d73d4b31..023fe54e5ba 100644 --- a/core/ledger/kvledger/txmgmt/txmgr/update_batch_bytes_test.go +++ b/core/ledger/kvledger/txmgmt/txmgr/update_batch_bytes_test.go @@ -9,10 +9,10 @@ package txmgr import ( "testing" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric/core/ledger/internal/version" "github.com/hyperledger/fabric/core/ledger/kvledger/txmgmt/privacyenabledstate" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) func TestUpdateBatchBytesBuilderOnlyPublicWrites(t *testing.T) { diff --git a/core/ledger/kvledger/txmgmt/txmgr/updates.pb.go b/core/ledger/kvledger/txmgmt/txmgr/updates.pb.go index de3234a2dc9..36904b3fa5d 100644 --- a/core/ledger/kvledger/txmgmt/txmgr/updates.pb.go +++ b/core/ledger/kvledger/txmgmt/txmgr/updates.pb.go @@ -1,168 +1,264 @@ +// +//Copyright IBM Corp. All Rights Reserved. +// +//SPDX-License-Identifier: Apache-2.0 + // Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.34.2 +// protoc v5.27.3 // source: updates.proto package txmgr import ( - fmt "fmt" - math "math" + reflect "reflect" + sync "sync" - proto "github.com/golang/protobuf/proto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) type KVWrite struct { - Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"` - Collection string `protobuf:"bytes,2,opt,name=collection,proto3" json:"collection,omitempty"` - Key []byte `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"` - IsDelete bool `protobuf:"varint,4,opt,name=isDelete,proto3" json:"isDelete,omitempty"` - Value []byte `protobuf:"bytes,5,opt,name=value,proto3" json:"value,omitempty"` - VersionBytes []byte `protobuf:"bytes,6,opt,name=version_bytes,json=versionBytes,proto3" json:"version_bytes,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *KVWrite) Reset() { *m = KVWrite{} } -func (m *KVWrite) String() string { return proto.CompactTextString(m) } -func (*KVWrite) ProtoMessage() {} -func (*KVWrite) Descriptor() ([]byte, []int) { - return fileDescriptor_675fc0bf03cd96fd, []int{0} -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *KVWrite) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_KVWrite.Unmarshal(m, b) + Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"` + Collection string `protobuf:"bytes,2,opt,name=collection,proto3" json:"collection,omitempty"` + Key []byte `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"` + IsDelete bool `protobuf:"varint,4,opt,name=isDelete,proto3" json:"isDelete,omitempty"` + Value []byte `protobuf:"bytes,5,opt,name=value,proto3" json:"value,omitempty"` + VersionBytes []byte `protobuf:"bytes,6,opt,name=version_bytes,json=versionBytes,proto3" json:"version_bytes,omitempty"` } -func (m *KVWrite) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_KVWrite.Marshal(b, m, deterministic) -} -func (m *KVWrite) XXX_Merge(src proto.Message) { - xxx_messageInfo_KVWrite.Merge(m, src) + +func (x *KVWrite) Reset() { + *x = KVWrite{} + if protoimpl.UnsafeEnabled { + mi := &file_updates_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *KVWrite) XXX_Size() int { - return xxx_messageInfo_KVWrite.Size(m) + +func (x *KVWrite) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *KVWrite) XXX_DiscardUnknown() { - xxx_messageInfo_KVWrite.DiscardUnknown(m) + +func (*KVWrite) ProtoMessage() {} + +func (x *KVWrite) ProtoReflect() protoreflect.Message { + mi := &file_updates_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_KVWrite proto.InternalMessageInfo +// Deprecated: Use KVWrite.ProtoReflect.Descriptor instead. +func (*KVWrite) Descriptor() ([]byte, []int) { + return file_updates_proto_rawDescGZIP(), []int{0} +} -func (m *KVWrite) GetNamespace() string { - if m != nil { - return m.Namespace +func (x *KVWrite) GetNamespace() string { + if x != nil { + return x.Namespace } return "" } -func (m *KVWrite) GetCollection() string { - if m != nil { - return m.Collection +func (x *KVWrite) GetCollection() string { + if x != nil { + return x.Collection } return "" } -func (m *KVWrite) GetKey() []byte { - if m != nil { - return m.Key +func (x *KVWrite) GetKey() []byte { + if x != nil { + return x.Key } return nil } -func (m *KVWrite) GetIsDelete() bool { - if m != nil { - return m.IsDelete +func (x *KVWrite) GetIsDelete() bool { + if x != nil { + return x.IsDelete } return false } -func (m *KVWrite) GetValue() []byte { - if m != nil { - return m.Value +func (x *KVWrite) GetValue() []byte { + if x != nil { + return x.Value } return nil } -func (m *KVWrite) GetVersionBytes() []byte { - if m != nil { - return m.VersionBytes +func (x *KVWrite) GetVersionBytes() []byte { + if x != nil { + return x.VersionBytes } return nil } type Updates struct { - Kvwrites []*KVWrite `protobuf:"bytes,1,rep,name=kvwrites,proto3" json:"kvwrites,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Kvwrites []*KVWrite `protobuf:"bytes,1,rep,name=kvwrites,proto3" json:"kvwrites,omitempty"` } -func (m *Updates) Reset() { *m = Updates{} } -func (m *Updates) String() string { return proto.CompactTextString(m) } -func (*Updates) ProtoMessage() {} -func (*Updates) Descriptor() ([]byte, []int) { - return fileDescriptor_675fc0bf03cd96fd, []int{1} +func (x *Updates) Reset() { + *x = Updates{} + if protoimpl.UnsafeEnabled { + mi := &file_updates_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *Updates) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Updates.Unmarshal(m, b) +func (x *Updates) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Updates) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Updates.Marshal(b, m, deterministic) + +func (*Updates) ProtoMessage() {} + +func (x *Updates) ProtoReflect() protoreflect.Message { + mi := &file_updates_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -func (m *Updates) XXX_Merge(src proto.Message) { - xxx_messageInfo_Updates.Merge(m, src) + +// Deprecated: Use Updates.ProtoReflect.Descriptor instead. +func (*Updates) Descriptor() ([]byte, []int) { + return file_updates_proto_rawDescGZIP(), []int{1} } -func (m *Updates) XXX_Size() int { - return xxx_messageInfo_Updates.Size(m) + +func (x *Updates) GetKvwrites() []*KVWrite { + if x != nil { + return x.Kvwrites + } + return nil } -func (m *Updates) XXX_DiscardUnknown() { - xxx_messageInfo_Updates.DiscardUnknown(m) + +var File_updates_proto protoreflect.FileDescriptor + +var file_updates_proto_rawDesc = []byte{ + 0x0a, 0x0d, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, + 0x05, 0x74, 0x78, 0x6d, 0x67, 0x72, 0x22, 0xb0, 0x01, 0x0a, 0x07, 0x4b, 0x56, 0x57, 0x72, 0x69, + 0x74, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, + 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x6b, + 0x65, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x73, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x69, 0x73, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x14, + 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x5f, + 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x76, 0x65, 0x72, + 0x73, 0x69, 0x6f, 0x6e, 0x42, 0x79, 0x74, 0x65, 0x73, 0x22, 0x35, 0x0a, 0x07, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x73, 0x12, 0x2a, 0x0a, 0x08, 0x6b, 0x76, 0x77, 0x72, 0x69, 0x74, 0x65, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x74, 0x78, 0x6d, 0x67, 0x72, 0x2e, 0x4b, + 0x56, 0x57, 0x72, 0x69, 0x74, 0x65, 0x52, 0x08, 0x6b, 0x76, 0x77, 0x72, 0x69, 0x74, 0x65, 0x73, + 0x42, 0x41, 0x5a, 0x3f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, + 0x79, 0x70, 0x65, 0x72, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2f, 0x66, 0x61, 0x62, 0x72, 0x69, + 0x63, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2f, 0x6b, 0x76, + 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2f, 0x74, 0x78, 0x6d, 0x67, 0x6d, 0x74, 0x2f, 0x74, 0x78, + 0x6d, 0x67, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } -var xxx_messageInfo_Updates proto.InternalMessageInfo +var ( + file_updates_proto_rawDescOnce sync.Once + file_updates_proto_rawDescData = file_updates_proto_rawDesc +) -func (m *Updates) GetKvwrites() []*KVWrite { - if m != nil { - return m.Kvwrites - } - return nil +func file_updates_proto_rawDescGZIP() []byte { + file_updates_proto_rawDescOnce.Do(func() { + file_updates_proto_rawDescData = protoimpl.X.CompressGZIP(file_updates_proto_rawDescData) + }) + return file_updates_proto_rawDescData +} + +var file_updates_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_updates_proto_goTypes = []any{ + (*KVWrite)(nil), // 0: txmgr.KVWrite + (*Updates)(nil), // 1: txmgr.Updates +} +var file_updates_proto_depIdxs = []int32{ + 0, // 0: txmgr.Updates.kvwrites:type_name -> txmgr.KVWrite + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name } -func init() { - proto.RegisterType((*KVWrite)(nil), "txmgr.KVWrite") - proto.RegisterType((*Updates)(nil), "txmgr.Updates") -} - -func init() { proto.RegisterFile("updates.proto", fileDescriptor_675fc0bf03cd96fd) } - -var fileDescriptor_675fc0bf03cd96fd = []byte{ - // 260 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x4c, 0x90, 0x41, 0x4b, 0xc4, 0x30, - 0x10, 0x85, 0x89, 0xb5, 0xbb, 0xdd, 0x71, 0x57, 0x24, 0x78, 0x08, 0x22, 0x52, 0xd6, 0x4b, 0xf1, - 0xd0, 0x82, 0xe2, 0x59, 0x5c, 0xbc, 0x79, 0x2b, 0xa8, 0xe0, 0x45, 0xd2, 0xec, 0xd8, 0x0d, 0x4d, - 0x9b, 0x92, 0xa4, 0xd5, 0xfe, 0x2b, 0x7f, 0xa2, 0x34, 0x5b, 0x56, 0x4f, 0x79, 0xef, 0x7b, 0x61, - 0x98, 0x37, 0xb0, 0xea, 0xda, 0x2d, 0x77, 0x68, 0xd3, 0xd6, 0x68, 0xa7, 0x69, 0xe8, 0xbe, 0xeb, - 0xd2, 0xac, 0x7f, 0x08, 0xcc, 0x9f, 0x5f, 0xdf, 0x8c, 0x74, 0x48, 0x2f, 0x61, 0xd1, 0xf0, 0x1a, - 0x6d, 0xcb, 0x05, 0x32, 0x12, 0x93, 0x64, 0x91, 0xff, 0x01, 0x7a, 0x05, 0x20, 0xb4, 0x52, 0x28, - 0x9c, 0xd4, 0x0d, 0x3b, 0xf2, 0xf1, 0x3f, 0x42, 0xcf, 0x20, 0xa8, 0x70, 0x60, 0x41, 0x4c, 0x92, - 0x65, 0x3e, 0x4a, 0x7a, 0x01, 0x91, 0xb4, 0x4f, 0xa8, 0xd0, 0x21, 0x3b, 0x8e, 0x49, 0x12, 0xe5, - 0x07, 0x4f, 0xcf, 0x21, 0xec, 0xb9, 0xea, 0x90, 0x85, 0xfe, 0xff, 0xde, 0xd0, 0x6b, 0x58, 0xf5, - 0x68, 0xac, 0xd4, 0xcd, 0x47, 0x31, 0x38, 0xb4, 0x6c, 0xe6, 0xd3, 0xe5, 0x04, 0x37, 0x23, 0x5b, - 0xdf, 0xc3, 0xfc, 0x65, 0x5f, 0x85, 0xde, 0x40, 0x54, 0xf5, 0x5f, 0xe3, 0xf2, 0x96, 0x91, 0x38, - 0x48, 0x4e, 0x6e, 0x4f, 0x53, 0xdf, 0x2b, 0x9d, 0x3a, 0xe5, 0x87, 0x7c, 0xf3, 0xf8, 0xfe, 0x50, - 0x4a, 0xb7, 0xeb, 0x8a, 0x54, 0xe8, 0x3a, 0xdb, 0x0d, 0x2d, 0x1a, 0x85, 0xdb, 0x12, 0x4d, 0xf6, - 0xc9, 0x0b, 0x23, 0x45, 0x26, 0xb4, 0xc1, 0x6c, 0x42, 0x55, 0x3f, 0x89, 0x71, 0x5a, 0xed, 0xfc, - 0x63, 0x8a, 0x99, 0x3f, 0xdd, 0xdd, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xf8, 0xfa, 0x17, 0xa7, - 0x4b, 0x01, 0x00, 0x00, +func init() { file_updates_proto_init() } +func file_updates_proto_init() { + if File_updates_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_updates_proto_msgTypes[0].Exporter = func(v any, i int) any { + switch v := v.(*KVWrite); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_updates_proto_msgTypes[1].Exporter = func(v any, i int) any { + switch v := v.(*Updates); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_updates_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_updates_proto_goTypes, + DependencyIndexes: file_updates_proto_depIdxs, + MessageInfos: file_updates_proto_msgTypes, + }.Build() + File_updates_proto = out.File + file_updates_proto_rawDesc = nil + file_updates_proto_goTypes = nil + file_updates_proto_depIdxs = nil } diff --git a/core/ledger/kvledger/txmgmt/validation/batch_preparer.go b/core/ledger/kvledger/txmgmt/validation/batch_preparer.go index 4abfa3b3272..783e83c7665 100644 --- a/core/ledger/kvledger/txmgmt/validation/batch_preparer.go +++ b/core/ledger/kvledger/txmgmt/validation/batch_preparer.go @@ -10,9 +10,9 @@ import ( "bytes" "github.com/hyperledger/fabric-lib-go/common/flogging" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/ledger/rwset" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/core/ledger" "github.com/hyperledger/fabric/core/ledger/internal/version" "github.com/hyperledger/fabric/core/ledger/kvledger/txmgmt/privacyenabledstate" diff --git a/core/ledger/kvledger/txmgmt/validation/batch_preparer_test.go b/core/ledger/kvledger/txmgmt/validation/batch_preparer_test.go index 8bc487a7317..18882000d3f 100644 --- a/core/ledger/kvledger/txmgmt/validation/batch_preparer_test.go +++ b/core/ledger/kvledger/txmgmt/validation/batch_preparer_test.go @@ -11,12 +11,11 @@ import ( "testing" "github.com/davecgh/go-spew/spew" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/common/flogging/floggingtest" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/ledger/rwset" - "github.com/hyperledger/fabric-protos-go/ledger/rwset/kvrwset" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset/kvrwset" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/ledger/testutil" "github.com/hyperledger/fabric/core/ledger" "github.com/hyperledger/fabric/core/ledger/internal/version" @@ -29,6 +28,7 @@ import ( "github.com/hyperledger/fabric/internal/pkg/txflags" "github.com/hyperledger/fabric/protoutil" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) func TestValidateAndPreparePvtBatch(t *testing.T) { @@ -138,7 +138,7 @@ func TestPreprocessProtoBlock(t *testing.T) { return nil } // good block - //_, gb := testutil.NewBlockGenerator(t, "testLedger", false) + // _, gb := testutil.NewBlockGenerator(t, "testLedger", false) gb := testutil.ConstructTestBlock(t, 10, 1, 1) _, _, err := preprocessProtoBlock(nil, allwaysValidKVfunc, gb, false, nil) require.NoError(t, err) @@ -479,7 +479,15 @@ func TestTxStatsInfo(t *testing.T) { }, } t.Logf("txStatsInfo=%s\n", spew.Sdump(txStatsInfo)) - require.Equal(t, expectedTxStatInfo, txStatsInfo) + require.Equal(t, len(expectedTxStatInfo), len(txStatsInfo)) + for i := 0; i < len(expectedTxStatInfo); i++ { + require.Equal(t, expectedTxStatInfo[i].TxIDFromChannelHeader, txStatsInfo[i].TxIDFromChannelHeader) + require.Equal(t, expectedTxStatInfo[i].ValidationCode, txStatsInfo[i].ValidationCode) + require.Equal(t, expectedTxStatInfo[i].TxType, txStatsInfo[i].TxType) + require.Equal(t, expectedTxStatInfo[i].ChaincodeEventData, txStatsInfo[i].ChaincodeEventData) + require.Equal(t, expectedTxStatInfo[i].NumCollections, txStatsInfo[i].NumCollections) + require.True(t, proto.Equal(expectedTxStatInfo[i].ChaincodeID, txStatsInfo[i].ChaincodeID)) + } } func testutilSampleTxSimulationResults(t *testing.T, key string) *ledger.TxSimulationResults { @@ -672,6 +680,13 @@ func Test_preprocessProtoBlock_processNonEndorserTx(t *testing.T) { // Check result require.NoError(t, err2) - require.Equal(t, expectedPreprocessedBlock, internalBlock) + require.Equal(t, expectedPreprocessedBlock.num, internalBlock.num) + require.Equal(t, len(expectedPreprocessedBlock.txs), len(internalBlock.txs)) + require.Equal(t, expectedPreprocessedBlock.txs[0].indexInBlock, internalBlock.txs[0].indexInBlock) + require.Equal(t, expectedPreprocessedBlock.txs[0].id, internalBlock.txs[0].id) + require.Equal(t, expectedPreprocessedBlock.txs[0].containsPostOrderWrites, internalBlock.txs[0].containsPostOrderWrites) + require.Equal(t, expectedPreprocessedBlock.txs[0].rwset.NsRwSets[0].NameSpace, internalBlock.txs[0].rwset.NsRwSets[0].NameSpace) + require.True(t, proto.Equal(expectedPreprocessedBlock.txs[0].rwset.NsRwSets[0].KvRwSet, internalBlock.txs[0].rwset.NsRwSets[0].KvRwSet)) + require.Equal(t, expectedTxStatInfo, txsStatInfo) } diff --git a/core/ledger/kvledger/txmgmt/validation/mock/processor.go b/core/ledger/kvledger/txmgmt/validation/mock/processor.go index a40a8fcb200..ff8480f8b71 100644 --- a/core/ledger/kvledger/txmgmt/validation/mock/processor.go +++ b/core/ledger/kvledger/txmgmt/validation/mock/processor.go @@ -4,7 +4,7 @@ package mock import ( "sync" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/core/ledger" ) diff --git a/core/ledger/kvledger/txmgmt/validation/rangequery_validator.go b/core/ledger/kvledger/txmgmt/validation/rangequery_validator.go index fcc67925b46..2301f7be78e 100644 --- a/core/ledger/kvledger/txmgmt/validation/rangequery_validator.go +++ b/core/ledger/kvledger/txmgmt/validation/rangequery_validator.go @@ -9,7 +9,7 @@ package validation import ( "bytes" - "github.com/hyperledger/fabric-protos-go/ledger/rwset/kvrwset" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset/kvrwset" "github.com/hyperledger/fabric/core/ledger/internal/version" "github.com/hyperledger/fabric/core/ledger/kvledger/txmgmt/rwsetutil" "github.com/hyperledger/fabric/core/ledger/kvledger/txmgmt/statedb" diff --git a/core/ledger/kvledger/txmgmt/validation/rangequery_validator_test.go b/core/ledger/kvledger/txmgmt/validation/rangequery_validator_test.go index 5d015f7cb2a..cc41ebe022b 100644 --- a/core/ledger/kvledger/txmgmt/validation/rangequery_validator_test.go +++ b/core/ledger/kvledger/txmgmt/validation/rangequery_validator_test.go @@ -9,7 +9,7 @@ package validation import ( "testing" - "github.com/hyperledger/fabric-protos-go/ledger/rwset/kvrwset" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset/kvrwset" "github.com/hyperledger/fabric/core/ledger/internal/version" "github.com/hyperledger/fabric/core/ledger/kvledger/txmgmt/rwsetutil" "github.com/hyperledger/fabric/core/ledger/kvledger/txmgmt/statedb" diff --git a/core/ledger/kvledger/txmgmt/validation/tx_ops.go b/core/ledger/kvledger/txmgmt/validation/tx_ops.go index 89464907682..660d6fe6138 100644 --- a/core/ledger/kvledger/txmgmt/validation/tx_ops.go +++ b/core/ledger/kvledger/txmgmt/validation/tx_ops.go @@ -7,7 +7,7 @@ SPDX-License-Identifier: Apache-2.0 package validation import ( - "github.com/hyperledger/fabric-protos-go/ledger/rwset/kvrwset" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset/kvrwset" "github.com/hyperledger/fabric/core/ledger/kvledger/txmgmt/privacyenabledstate" "github.com/hyperledger/fabric/core/ledger/kvledger/txmgmt/rwsetutil" "github.com/hyperledger/fabric/core/ledger/kvledger/txmgmt/statedb" @@ -178,7 +178,7 @@ type keyOps struct { metadata []byte } -////////////////// txOps functions +// //////////////// txOps functions func (txops txOps) upsert(k compositeKey, val []byte) { keyops := txops.getOrCreateKeyEntry(k) @@ -211,7 +211,7 @@ func (txops txOps) getOrCreateKeyEntry(k compositeKey) *keyOps { return keyops } -////////////////// keyOps functions +// //////////////// keyOps functions func (keyops keyOps) isDelete() bool { return keyops.flag&(keyDelete) == keyDelete diff --git a/core/ledger/kvledger/txmgmt/validation/tx_ops_test.go b/core/ledger/kvledger/txmgmt/validation/tx_ops_test.go index ca026e06604..415184448a2 100644 --- a/core/ledger/kvledger/txmgmt/validation/tx_ops_test.go +++ b/core/ledger/kvledger/txmgmt/validation/tx_ops_test.go @@ -9,7 +9,7 @@ package validation import ( "testing" - "github.com/hyperledger/fabric-protos-go/ledger/rwset/kvrwset" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset/kvrwset" "github.com/hyperledger/fabric/core/ledger/internal/version" "github.com/hyperledger/fabric/core/ledger/kvledger/txmgmt/privacyenabledstate" "github.com/hyperledger/fabric/core/ledger/kvledger/txmgmt/rwsetutil" diff --git a/core/ledger/kvledger/txmgmt/validation/types.go b/core/ledger/kvledger/txmgmt/validation/types.go index 06241f55573..92fec8ffc67 100644 --- a/core/ledger/kvledger/txmgmt/validation/types.go +++ b/core/ledger/kvledger/txmgmt/validation/types.go @@ -7,7 +7,7 @@ SPDX-License-Identifier: Apache-2.0 package validation import ( - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/core/ledger/internal/version" "github.com/hyperledger/fabric/core/ledger/kvledger/txmgmt/privacyenabledstate" "github.com/hyperledger/fabric/core/ledger/kvledger/txmgmt/rwsetutil" diff --git a/core/ledger/kvledger/txmgmt/validation/types_test.go b/core/ledger/kvledger/txmgmt/validation/types_test.go index 33449721283..010670621e9 100644 --- a/core/ledger/kvledger/txmgmt/validation/types_test.go +++ b/core/ledger/kvledger/txmgmt/validation/types_test.go @@ -9,7 +9,7 @@ package validation import ( "testing" - "github.com/hyperledger/fabric-protos-go/ledger/rwset/kvrwset" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset/kvrwset" "github.com/hyperledger/fabric/core/ledger/internal/version" "github.com/hyperledger/fabric/core/ledger/kvledger/txmgmt/privacyenabledstate" "github.com/hyperledger/fabric/core/ledger/kvledger/txmgmt/rwsetutil" diff --git a/core/ledger/kvledger/txmgmt/validation/validator.go b/core/ledger/kvledger/txmgmt/validation/validator.go index 106321b38be..b1e64a5b861 100644 --- a/core/ledger/kvledger/txmgmt/validation/validator.go +++ b/core/ledger/kvledger/txmgmt/validation/validator.go @@ -7,8 +7,8 @@ SPDX-License-Identifier: Apache-2.0 package validation import ( - "github.com/hyperledger/fabric-protos-go/ledger/rwset/kvrwset" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset/kvrwset" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/core/ledger/internal/version" "github.com/hyperledger/fabric/core/ledger/kvledger/txmgmt/privacyenabledstate" "github.com/hyperledger/fabric/core/ledger/kvledger/txmgmt/rwsetutil" diff --git a/core/ledger/kvledger/txmgmt/validation/validator_test.go b/core/ledger/kvledger/txmgmt/validation/validator_test.go index a36bce6af0e..fb2fa310ff1 100644 --- a/core/ledger/kvledger/txmgmt/validation/validator_test.go +++ b/core/ledger/kvledger/txmgmt/validation/validator_test.go @@ -13,8 +13,8 @@ import ( "testing" "github.com/hyperledger/fabric-lib-go/common/flogging" - "github.com/hyperledger/fabric-protos-go/ledger/rwset/kvrwset" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset/kvrwset" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/core/ledger/internal/version" "github.com/hyperledger/fabric/core/ledger/kvledger/txmgmt/privacyenabledstate" "github.com/hyperledger/fabric/core/ledger/kvledger/txmgmt/rwsetutil" diff --git a/core/ledger/kvledger/unjoin_channel.go b/core/ledger/kvledger/unjoin_channel.go index 3cae52b4df6..377a5eccef0 100644 --- a/core/ledger/kvledger/unjoin_channel.go +++ b/core/ledger/kvledger/unjoin_channel.go @@ -9,8 +9,8 @@ package kvledger import ( "github.com/hyperledger/fabric-lib-go/common/metrics/disabled" "github.com/hyperledger/fabric-lib-go/healthz" - "github.com/hyperledger/fabric-protos-go/ledger/rwset/kvrwset" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset/kvrwset" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/ledger/blkstorage" "github.com/hyperledger/fabric/common/ledger/util/leveldbhelper" "github.com/hyperledger/fabric/core/ledger" diff --git a/core/ledger/ledger_interface.go b/core/ledger/ledger_interface.go index e15ebea0b18..60e45a88ba2 100644 --- a/core/ledger/ledger_interface.go +++ b/core/ledger/ledger_interface.go @@ -11,15 +11,16 @@ import ( "hash" "time" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/bccsp" "github.com/hyperledger/fabric-lib-go/common/metrics" "github.com/hyperledger/fabric-lib-go/healthz" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/ledger/rwset" - "github.com/hyperledger/fabric-protos-go/ledger/rwset/kvrwset" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset/kvrwset" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" commonledger "github.com/hyperledger/fabric/common/ledger" + "github.com/pkg/errors" + "google.golang.org/protobuf/proto" ) const ( @@ -546,6 +547,9 @@ type TxSimulationResults struct { // GetPubSimulationBytes returns the serialized bytes of public readwrite set func (txSim *TxSimulationResults) GetPubSimulationBytes() ([]byte, error) { + if txSim.PubSimulationResults == nil { + return nil, errors.New("proto: Marshal called with nil") + } return proto.Marshal(txSim.PubSimulationResults) } @@ -554,6 +558,9 @@ func (txSim *TxSimulationResults) GetPvtSimulationBytes() ([]byte, error) { if !txSim.ContainsPvtWrites() { return nil, nil } + if txSim.PvtSimulationResults == nil { + return nil, errors.New("proto: Marshal called with nil") + } return proto.Marshal(txSim.PvtSimulationResults) } @@ -569,7 +576,7 @@ func (txSim *TxSimulationResults) ContainsPvtWrites() bool { // the `stateUpdates` parameter passed to the function captures the state changes caused by the block // for the namespace. The actual data type of stateUpdates depends on the data model enabled. // For instance, for KV data model, the actual type would be proto message -// `github.com/hyperledger/fabric-protos-go/ledger/rwset/kvrwset.KVWrite` +// `github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset/kvrwset.KVWrite` // Function `HandleStateUpdates` is expected to be invoked before block is committed and if this // function returns an error, the ledger implementation is expected to halt block commit operation // and result in a panic. diff --git a/core/ledger/ledgermgmt/ledger_mgmt.go b/core/ledger/ledgermgmt/ledger_mgmt.go index 331d267e988..c62a4f097bc 100644 --- a/core/ledger/ledgermgmt/ledger_mgmt.go +++ b/core/ledger/ledgermgmt/ledger_mgmt.go @@ -13,8 +13,8 @@ import ( "github.com/hyperledger/fabric-lib-go/common/flogging" "github.com/hyperledger/fabric-lib-go/common/metrics" - "github.com/hyperledger/fabric-protos-go/common" - pb "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/core/common/ccprovider" "github.com/hyperledger/fabric/core/ledger" "github.com/hyperledger/fabric/core/ledger/cceventmgmt" diff --git a/core/ledger/ledgermgmt/ledger_mgmt_test.go b/core/ledger/ledgermgmt/ledger_mgmt_test.go index 58bf143619a..a9c6fa75346 100644 --- a/core/ledger/ledgermgmt/ledger_mgmt_test.go +++ b/core/ledger/ledgermgmt/ledger_mgmt_test.go @@ -15,7 +15,7 @@ import ( "github.com/hyperledger/fabric-lib-go/bccsp/sw" "github.com/hyperledger/fabric-lib-go/common/metrics/disabled" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/common/configtx/test" "github.com/hyperledger/fabric/common/ledger/testutil" "github.com/hyperledger/fabric/core/ledger" diff --git a/core/ledger/ledgermgmt/ledgermgmttest/ledgermgmttest.go b/core/ledger/ledgermgmt/ledgermgmttest/ledgermgmttest.go index 6a33a2e7f64..92125f07aef 100644 --- a/core/ledger/ledgermgmt/ledgermgmttest/ledgermgmttest.go +++ b/core/ledger/ledgermgmt/ledgermgmttest/ledgermgmttest.go @@ -14,7 +14,7 @@ import ( "github.com/hyperledger/fabric-lib-go/bccsp/sw" "github.com/hyperledger/fabric-lib-go/common/metrics/disabled" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/common/ledger/testutil" "github.com/hyperledger/fabric/core/ledger" "github.com/hyperledger/fabric/core/ledger/kvledger" diff --git a/core/ledger/mock/custom_tx_processor.go b/core/ledger/mock/custom_tx_processor.go index 48d9d42bbe9..76fe6db31a3 100644 --- a/core/ledger/mock/custom_tx_processor.go +++ b/core/ledger/mock/custom_tx_processor.go @@ -4,7 +4,7 @@ package mock import ( "sync" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/core/ledger" ) diff --git a/core/ledger/mock/deployed_ccinfo_provider.go b/core/ledger/mock/deployed_ccinfo_provider.go index 10c9b40f87d..3b73ba1b117 100644 --- a/core/ledger/mock/deployed_ccinfo_provider.go +++ b/core/ledger/mock/deployed_ccinfo_provider.go @@ -4,8 +4,8 @@ package mock import ( "sync" - "github.com/hyperledger/fabric-protos-go/ledger/rwset/kvrwset" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset/kvrwset" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/core/ledger" ) diff --git a/core/ledger/mock/membership_info_provider.go b/core/ledger/mock/membership_info_provider.go index b53c07fa898..da9d5e0b309 100644 --- a/core/ledger/mock/membership_info_provider.go +++ b/core/ledger/mock/membership_info_provider.go @@ -4,7 +4,7 @@ package mock import ( "sync" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/core/ledger" ) diff --git a/core/ledger/pkg_test.go b/core/ledger/pkg_test.go index 41268e629bf..d3d45aedbbb 100644 --- a/core/ledger/pkg_test.go +++ b/core/ledger/pkg_test.go @@ -8,7 +8,7 @@ package ledger import ( "testing" - "github.com/hyperledger/fabric-protos-go/ledger/rwset" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset" "github.com/stretchr/testify/require" ) diff --git a/core/ledger/pvtdatapolicy/btlpolicy.go b/core/ledger/pvtdatapolicy/btlpolicy.go index 7b02891f444..95a5a96c9a5 100644 --- a/core/ledger/pvtdatapolicy/btlpolicy.go +++ b/core/ledger/pvtdatapolicy/btlpolicy.go @@ -10,7 +10,7 @@ import ( "math" "sync" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/core/common/privdata" ) diff --git a/core/ledger/pvtdatapolicy/btlpolicy_test.go b/core/ledger/pvtdatapolicy/btlpolicy_test.go index ddc0f869a77..74c70c18d1a 100644 --- a/core/ledger/pvtdatapolicy/btlpolicy_test.go +++ b/core/ledger/pvtdatapolicy/btlpolicy_test.go @@ -10,7 +10,7 @@ import ( "math" "testing" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/core/common/privdata" "github.com/hyperledger/fabric/core/ledger/pvtdatapolicy/mock" "github.com/stretchr/testify/require" diff --git a/core/ledger/pvtdatapolicy/mock/coll_info_provider.go b/core/ledger/pvtdatapolicy/mock/coll_info_provider.go index bff6556f4e2..8057c66208f 100644 --- a/core/ledger/pvtdatapolicy/mock/coll_info_provider.go +++ b/core/ledger/pvtdatapolicy/mock/coll_info_provider.go @@ -4,7 +4,7 @@ package mock import ( "sync" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" ) type CollectionInfoProvider struct { diff --git a/core/ledger/pvtdatapolicy/testutil/util.go b/core/ledger/pvtdatapolicy/testutil/util.go index d4eb1bd8db9..27020128eb3 100644 --- a/core/ledger/pvtdatapolicy/testutil/util.go +++ b/core/ledger/pvtdatapolicy/testutil/util.go @@ -7,7 +7,7 @@ SPDX-License-Identifier: Apache-2.0 package testutil import ( - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/core/ledger/pvtdatapolicy" "github.com/hyperledger/fabric/core/ledger/pvtdatapolicy/mock" ) diff --git a/core/ledger/pvtdatastorage/helper.go b/core/ledger/pvtdatastorage/helper.go index 2afeb09707b..7a7f6f4bcab 100644 --- a/core/ledger/pvtdatastorage/helper.go +++ b/core/ledger/pvtdatastorage/helper.go @@ -10,7 +10,7 @@ import ( "math" "github.com/bits-and-blooms/bitset" - "github.com/hyperledger/fabric-protos-go/ledger/rwset" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset" "github.com/hyperledger/fabric/core/ledger" "github.com/hyperledger/fabric/core/ledger/internal/version" "github.com/hyperledger/fabric/core/ledger/kvledger/txmgmt/rwsetutil" diff --git a/core/ledger/pvtdatastorage/kv_encoding.go b/core/ledger/pvtdatastorage/kv_encoding.go index d84382f83d2..39d4aa7a9d1 100644 --- a/core/ledger/pvtdatastorage/kv_encoding.go +++ b/core/ledger/pvtdatastorage/kv_encoding.go @@ -12,11 +12,11 @@ import ( "math" "github.com/bits-and-blooms/bitset" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/ledger/rwset" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset" "github.com/hyperledger/fabric/core/ledger/internal/version" "github.com/pkg/errors" "google.golang.org/protobuf/encoding/protowire" + "google.golang.org/protobuf/proto" ) var ( @@ -72,6 +72,9 @@ func encodeDataKey(key *dataKey) []byte { } func encodeDataValue(collData *rwset.CollectionPvtReadWriteSet) ([]byte, error) { + if collData == nil { + return nil, errors.New("proto: Marshal called with nil") + } return proto.Marshal(collData) } @@ -81,6 +84,9 @@ func encodeExpiryKey(expiryKey *expiryKey) []byte { } func encodeExpiryValue(expiryData *ExpiryData) ([]byte, error) { + if expiryData == nil { + return nil, errors.New("proto: Marshal called with nil") + } return proto.Marshal(expiryData) } @@ -189,6 +195,9 @@ func decodeCollElgKey(b []byte) uint64 { } func encodeCollElgVal(m *CollElgInfo) ([]byte, error) { + if m == nil { + return nil, errors.New("proto: Marshal called with nil") + } return proto.Marshal(m) } @@ -208,6 +217,9 @@ func encodeBootKVHashesKey(key *bootKVHashesKey) []byte { } func encodeBootKVHashesVal(val *BootKVHashes) ([]byte, error) { + if val == nil { + return nil, errors.New("error while marshalling BootKVHashes: proto: Marshal called with nil") + } b, err := proto.Marshal(val) if err != nil { return nil, errors.Wrap(err, "error while marshalling BootKVHashes") diff --git a/core/ledger/pvtdatastorage/persistent_msgs.pb.go b/core/ledger/pvtdatastorage/persistent_msgs.pb.go index 4d4c153d909..4bbd4af25b3 100644 --- a/core/ledger/pvtdatastorage/persistent_msgs.pb.go +++ b/core/ledger/pvtdatastorage/persistent_msgs.pb.go @@ -1,376 +1,620 @@ +// +//Copyright IBM Corp. All Rights Reserved. +// +//SPDX-License-Identifier: Apache-2.0 + // Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.34.2 +// protoc v5.27.3 // source: persistent_msgs.proto package pvtdatastorage import ( - fmt "fmt" - math "math" + reflect "reflect" + sync "sync" - proto "github.com/golang/protobuf/proto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) type ExpiryData struct { - Map map[string]*NamespaceExpiryData `protobuf:"bytes,1,rep,name=map,proto3" json:"map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *ExpiryData) Reset() { *m = ExpiryData{} } -func (m *ExpiryData) String() string { return proto.CompactTextString(m) } -func (*ExpiryData) ProtoMessage() {} -func (*ExpiryData) Descriptor() ([]byte, []int) { - return fileDescriptor_0f0cbd2d16bac879, []int{0} + Map map[string]*NamespaceExpiryData `protobuf:"bytes,1,rep,name=map,proto3" json:"map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` } -func (m *ExpiryData) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ExpiryData.Unmarshal(m, b) -} -func (m *ExpiryData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ExpiryData.Marshal(b, m, deterministic) -} -func (m *ExpiryData) XXX_Merge(src proto.Message) { - xxx_messageInfo_ExpiryData.Merge(m, src) +func (x *ExpiryData) Reset() { + *x = ExpiryData{} + if protoimpl.UnsafeEnabled { + mi := &file_persistent_msgs_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *ExpiryData) XXX_Size() int { - return xxx_messageInfo_ExpiryData.Size(m) + +func (x *ExpiryData) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *ExpiryData) XXX_DiscardUnknown() { - xxx_messageInfo_ExpiryData.DiscardUnknown(m) + +func (*ExpiryData) ProtoMessage() {} + +func (x *ExpiryData) ProtoReflect() protoreflect.Message { + mi := &file_persistent_msgs_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_ExpiryData proto.InternalMessageInfo +// Deprecated: Use ExpiryData.ProtoReflect.Descriptor instead. +func (*ExpiryData) Descriptor() ([]byte, []int) { + return file_persistent_msgs_proto_rawDescGZIP(), []int{0} +} -func (m *ExpiryData) GetMap() map[string]*NamespaceExpiryData { - if m != nil { - return m.Map +func (x *ExpiryData) GetMap() map[string]*NamespaceExpiryData { + if x != nil { + return x.Map } return nil } type NamespaceExpiryData struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + // for pvt data, there would be an // entry in TxNums PresentData map[string]*TxNums `protobuf:"bytes,1,rep,name=presentData,proto3" json:"presentData,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // for any number of missing pvt data of a collection, // there would be an entry in the map MissingData map[string]bool `protobuf:"bytes,2,rep,name=missingData,proto3" json:"missingData,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` - //entries for hashes for the pvtdata key-values (loaded from snapshot data) - BootKVHashes map[string]*TxNums `protobuf:"bytes,3,rep,name=bootKVHashes,proto3" json:"bootKVHashes,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + // entries for hashes for the pvtdata key-values (loaded from snapshot data) + BootKVHashes map[string]*TxNums `protobuf:"bytes,3,rep,name=bootKVHashes,proto3" json:"bootKVHashes,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` } -func (m *NamespaceExpiryData) Reset() { *m = NamespaceExpiryData{} } -func (m *NamespaceExpiryData) String() string { return proto.CompactTextString(m) } -func (*NamespaceExpiryData) ProtoMessage() {} -func (*NamespaceExpiryData) Descriptor() ([]byte, []int) { - return fileDescriptor_0f0cbd2d16bac879, []int{1} +func (x *NamespaceExpiryData) Reset() { + *x = NamespaceExpiryData{} + if protoimpl.UnsafeEnabled { + mi := &file_persistent_msgs_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *NamespaceExpiryData) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_NamespaceExpiryData.Unmarshal(m, b) -} -func (m *NamespaceExpiryData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_NamespaceExpiryData.Marshal(b, m, deterministic) -} -func (m *NamespaceExpiryData) XXX_Merge(src proto.Message) { - xxx_messageInfo_NamespaceExpiryData.Merge(m, src) +func (x *NamespaceExpiryData) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *NamespaceExpiryData) XXX_Size() int { - return xxx_messageInfo_NamespaceExpiryData.Size(m) -} -func (m *NamespaceExpiryData) XXX_DiscardUnknown() { - xxx_messageInfo_NamespaceExpiryData.DiscardUnknown(m) + +func (*NamespaceExpiryData) ProtoMessage() {} + +func (x *NamespaceExpiryData) ProtoReflect() protoreflect.Message { + mi := &file_persistent_msgs_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_NamespaceExpiryData proto.InternalMessageInfo +// Deprecated: Use NamespaceExpiryData.ProtoReflect.Descriptor instead. +func (*NamespaceExpiryData) Descriptor() ([]byte, []int) { + return file_persistent_msgs_proto_rawDescGZIP(), []int{1} +} -func (m *NamespaceExpiryData) GetPresentData() map[string]*TxNums { - if m != nil { - return m.PresentData +func (x *NamespaceExpiryData) GetPresentData() map[string]*TxNums { + if x != nil { + return x.PresentData } return nil } -func (m *NamespaceExpiryData) GetMissingData() map[string]bool { - if m != nil { - return m.MissingData +func (x *NamespaceExpiryData) GetMissingData() map[string]bool { + if x != nil { + return x.MissingData } return nil } -func (m *NamespaceExpiryData) GetBootKVHashes() map[string]*TxNums { - if m != nil { - return m.BootKVHashes +func (x *NamespaceExpiryData) GetBootKVHashes() map[string]*TxNums { + if x != nil { + return x.BootKVHashes } return nil } type BootKVHash struct { - KeyHash []byte `protobuf:"bytes,1,opt,name=keyHash,proto3" json:"keyHash,omitempty"` - ValueHash []byte `protobuf:"bytes,2,opt,name=valueHash,proto3" json:"valueHash,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *BootKVHash) Reset() { *m = BootKVHash{} } -func (m *BootKVHash) String() string { return proto.CompactTextString(m) } -func (*BootKVHash) ProtoMessage() {} -func (*BootKVHash) Descriptor() ([]byte, []int) { - return fileDescriptor_0f0cbd2d16bac879, []int{2} + KeyHash []byte `protobuf:"bytes,1,opt,name=keyHash,proto3" json:"keyHash,omitempty"` + ValueHash []byte `protobuf:"bytes,2,opt,name=valueHash,proto3" json:"valueHash,omitempty"` } -func (m *BootKVHash) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_BootKVHash.Unmarshal(m, b) -} -func (m *BootKVHash) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_BootKVHash.Marshal(b, m, deterministic) -} -func (m *BootKVHash) XXX_Merge(src proto.Message) { - xxx_messageInfo_BootKVHash.Merge(m, src) +func (x *BootKVHash) Reset() { + *x = BootKVHash{} + if protoimpl.UnsafeEnabled { + mi := &file_persistent_msgs_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *BootKVHash) XXX_Size() int { - return xxx_messageInfo_BootKVHash.Size(m) + +func (x *BootKVHash) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *BootKVHash) XXX_DiscardUnknown() { - xxx_messageInfo_BootKVHash.DiscardUnknown(m) + +func (*BootKVHash) ProtoMessage() {} + +func (x *BootKVHash) ProtoReflect() protoreflect.Message { + mi := &file_persistent_msgs_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_BootKVHash proto.InternalMessageInfo +// Deprecated: Use BootKVHash.ProtoReflect.Descriptor instead. +func (*BootKVHash) Descriptor() ([]byte, []int) { + return file_persistent_msgs_proto_rawDescGZIP(), []int{2} +} -func (m *BootKVHash) GetKeyHash() []byte { - if m != nil { - return m.KeyHash +func (x *BootKVHash) GetKeyHash() []byte { + if x != nil { + return x.KeyHash } return nil } -func (m *BootKVHash) GetValueHash() []byte { - if m != nil { - return m.ValueHash +func (x *BootKVHash) GetValueHash() []byte { + if x != nil { + return x.ValueHash } return nil } type BootKVHashes struct { - List []*BootKVHash `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *BootKVHashes) Reset() { *m = BootKVHashes{} } -func (m *BootKVHashes) String() string { return proto.CompactTextString(m) } -func (*BootKVHashes) ProtoMessage() {} -func (*BootKVHashes) Descriptor() ([]byte, []int) { - return fileDescriptor_0f0cbd2d16bac879, []int{3} + List []*BootKVHash `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` } -func (m *BootKVHashes) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_BootKVHashes.Unmarshal(m, b) -} -func (m *BootKVHashes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_BootKVHashes.Marshal(b, m, deterministic) -} -func (m *BootKVHashes) XXX_Merge(src proto.Message) { - xxx_messageInfo_BootKVHashes.Merge(m, src) +func (x *BootKVHashes) Reset() { + *x = BootKVHashes{} + if protoimpl.UnsafeEnabled { + mi := &file_persistent_msgs_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *BootKVHashes) XXX_Size() int { - return xxx_messageInfo_BootKVHashes.Size(m) + +func (x *BootKVHashes) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *BootKVHashes) XXX_DiscardUnknown() { - xxx_messageInfo_BootKVHashes.DiscardUnknown(m) + +func (*BootKVHashes) ProtoMessage() {} + +func (x *BootKVHashes) ProtoReflect() protoreflect.Message { + mi := &file_persistent_msgs_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_BootKVHashes proto.InternalMessageInfo +// Deprecated: Use BootKVHashes.ProtoReflect.Descriptor instead. +func (*BootKVHashes) Descriptor() ([]byte, []int) { + return file_persistent_msgs_proto_rawDescGZIP(), []int{3} +} -func (m *BootKVHashes) GetList() []*BootKVHash { - if m != nil { - return m.List +func (x *BootKVHashes) GetList() []*BootKVHash { + if x != nil { + return x.List } return nil } type TxNums struct { - List []uint64 `protobuf:"varint,1,rep,packed,name=list,proto3" json:"list,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *TxNums) Reset() { *m = TxNums{} } -func (m *TxNums) String() string { return proto.CompactTextString(m) } -func (*TxNums) ProtoMessage() {} -func (*TxNums) Descriptor() ([]byte, []int) { - return fileDescriptor_0f0cbd2d16bac879, []int{4} + List []uint64 `protobuf:"varint,1,rep,packed,name=list,proto3" json:"list,omitempty"` } -func (m *TxNums) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_TxNums.Unmarshal(m, b) -} -func (m *TxNums) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_TxNums.Marshal(b, m, deterministic) -} -func (m *TxNums) XXX_Merge(src proto.Message) { - xxx_messageInfo_TxNums.Merge(m, src) +func (x *TxNums) Reset() { + *x = TxNums{} + if protoimpl.UnsafeEnabled { + mi := &file_persistent_msgs_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *TxNums) XXX_Size() int { - return xxx_messageInfo_TxNums.Size(m) + +func (x *TxNums) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *TxNums) XXX_DiscardUnknown() { - xxx_messageInfo_TxNums.DiscardUnknown(m) + +func (*TxNums) ProtoMessage() {} + +func (x *TxNums) ProtoReflect() protoreflect.Message { + mi := &file_persistent_msgs_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_TxNums proto.InternalMessageInfo +// Deprecated: Use TxNums.ProtoReflect.Descriptor instead. +func (*TxNums) Descriptor() ([]byte, []int) { + return file_persistent_msgs_proto_rawDescGZIP(), []int{4} +} -func (m *TxNums) GetList() []uint64 { - if m != nil { - return m.List +func (x *TxNums) GetList() []uint64 { + if x != nil { + return x.List } return nil } type CollElgInfo struct { - NsCollMap map[string]*CollNames `protobuf:"bytes,1,rep,name=nsCollMap,proto3" json:"nsCollMap,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *CollElgInfo) Reset() { *m = CollElgInfo{} } -func (m *CollElgInfo) String() string { return proto.CompactTextString(m) } -func (*CollElgInfo) ProtoMessage() {} -func (*CollElgInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_0f0cbd2d16bac879, []int{5} + NsCollMap map[string]*CollNames `protobuf:"bytes,1,rep,name=nsCollMap,proto3" json:"nsCollMap,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` } -func (m *CollElgInfo) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CollElgInfo.Unmarshal(m, b) -} -func (m *CollElgInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CollElgInfo.Marshal(b, m, deterministic) -} -func (m *CollElgInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_CollElgInfo.Merge(m, src) +func (x *CollElgInfo) Reset() { + *x = CollElgInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_persistent_msgs_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *CollElgInfo) XXX_Size() int { - return xxx_messageInfo_CollElgInfo.Size(m) + +func (x *CollElgInfo) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *CollElgInfo) XXX_DiscardUnknown() { - xxx_messageInfo_CollElgInfo.DiscardUnknown(m) + +func (*CollElgInfo) ProtoMessage() {} + +func (x *CollElgInfo) ProtoReflect() protoreflect.Message { + mi := &file_persistent_msgs_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_CollElgInfo proto.InternalMessageInfo +// Deprecated: Use CollElgInfo.ProtoReflect.Descriptor instead. +func (*CollElgInfo) Descriptor() ([]byte, []int) { + return file_persistent_msgs_proto_rawDescGZIP(), []int{5} +} -func (m *CollElgInfo) GetNsCollMap() map[string]*CollNames { - if m != nil { - return m.NsCollMap +func (x *CollElgInfo) GetNsCollMap() map[string]*CollNames { + if x != nil { + return x.NsCollMap } return nil } type CollNames struct { - Entries []string `protobuf:"bytes,1,rep,name=entries,proto3" json:"entries,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *CollNames) Reset() { *m = CollNames{} } -func (m *CollNames) String() string { return proto.CompactTextString(m) } -func (*CollNames) ProtoMessage() {} -func (*CollNames) Descriptor() ([]byte, []int) { - return fileDescriptor_0f0cbd2d16bac879, []int{6} + Entries []string `protobuf:"bytes,1,rep,name=entries,proto3" json:"entries,omitempty"` } -func (m *CollNames) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CollNames.Unmarshal(m, b) -} -func (m *CollNames) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CollNames.Marshal(b, m, deterministic) -} -func (m *CollNames) XXX_Merge(src proto.Message) { - xxx_messageInfo_CollNames.Merge(m, src) +func (x *CollNames) Reset() { + *x = CollNames{} + if protoimpl.UnsafeEnabled { + mi := &file_persistent_msgs_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *CollNames) XXX_Size() int { - return xxx_messageInfo_CollNames.Size(m) + +func (x *CollNames) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *CollNames) XXX_DiscardUnknown() { - xxx_messageInfo_CollNames.DiscardUnknown(m) + +func (*CollNames) ProtoMessage() {} + +func (x *CollNames) ProtoReflect() protoreflect.Message { + mi := &file_persistent_msgs_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_CollNames proto.InternalMessageInfo +// Deprecated: Use CollNames.ProtoReflect.Descriptor instead. +func (*CollNames) Descriptor() ([]byte, []int) { + return file_persistent_msgs_proto_rawDescGZIP(), []int{6} +} -func (m *CollNames) GetEntries() []string { - if m != nil { - return m.Entries +func (x *CollNames) GetEntries() []string { + if x != nil { + return x.Entries } return nil } -func init() { - proto.RegisterType((*ExpiryData)(nil), "pvtdatastorage.ExpiryData") - proto.RegisterMapType((map[string]*NamespaceExpiryData)(nil), "pvtdatastorage.ExpiryData.MapEntry") - proto.RegisterType((*NamespaceExpiryData)(nil), "pvtdatastorage.NamespaceExpiryData") - proto.RegisterMapType((map[string]*TxNums)(nil), "pvtdatastorage.NamespaceExpiryData.BootKVHashesEntry") - proto.RegisterMapType((map[string]bool)(nil), "pvtdatastorage.NamespaceExpiryData.MissingDataEntry") - proto.RegisterMapType((map[string]*TxNums)(nil), "pvtdatastorage.NamespaceExpiryData.PresentDataEntry") - proto.RegisterType((*BootKVHash)(nil), "pvtdatastorage.BootKVHash") - proto.RegisterType((*BootKVHashes)(nil), "pvtdatastorage.BootKVHashes") - proto.RegisterType((*TxNums)(nil), "pvtdatastorage.TxNums") - proto.RegisterType((*CollElgInfo)(nil), "pvtdatastorage.CollElgInfo") - proto.RegisterMapType((map[string]*CollNames)(nil), "pvtdatastorage.CollElgInfo.NsCollMapEntry") - proto.RegisterType((*CollNames)(nil), "pvtdatastorage.CollNames") -} - -func init() { proto.RegisterFile("persistent_msgs.proto", fileDescriptor_0f0cbd2d16bac879) } - -var fileDescriptor_0f0cbd2d16bac879 = []byte{ - // 481 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x94, 0xdf, 0x6a, 0xdb, 0x3e, - 0x14, 0xc7, 0x71, 0x92, 0x5f, 0x7f, 0xf5, 0x49, 0x28, 0x99, 0xf6, 0x07, 0xcf, 0xf4, 0x22, 0x78, - 0x0c, 0xca, 0x18, 0x36, 0x6c, 0x2b, 0x74, 0xbd, 0xe8, 0x45, 0xd7, 0x40, 0xc7, 0x48, 0x18, 0x66, - 0xa4, 0x6c, 0xbb, 0x18, 0x4a, 0x7a, 0xea, 0x98, 0xda, 0x96, 0x90, 0x94, 0x52, 0x3f, 0xc6, 0xde, - 0x60, 0x8f, 0xb0, 0x47, 0x1c, 0x96, 0x9d, 0x5a, 0xf6, 0x7c, 0x91, 0x8b, 0xdd, 0x49, 0xe7, 0x7c, - 0xbf, 0x9f, 0x73, 0x74, 0x24, 0x1b, 0x9e, 0x72, 0x14, 0x32, 0x96, 0x0a, 0x33, 0xf5, 0x23, 0x95, - 0x91, 0xf4, 0xb9, 0x60, 0x8a, 0x91, 0x03, 0x7e, 0xa7, 0xae, 0xa9, 0xa2, 0x52, 0x31, 0x41, 0x23, - 0xf4, 0x7e, 0x59, 0x00, 0xd3, 0x7b, 0x1e, 0x8b, 0xfc, 0x82, 0x2a, 0x4a, 0x8e, 0xa1, 0x9f, 0x52, - 0xee, 0x58, 0x93, 0xfe, 0xd1, 0xf0, 0xcd, 0x0b, 0xbf, 0x29, 0xf6, 0x6b, 0xa1, 0x3f, 0xa3, 0x7c, - 0x9a, 0x29, 0x91, 0x87, 0x85, 0xde, 0xfd, 0x0e, 0xfb, 0xdb, 0x00, 0x19, 0x43, 0xff, 0x16, 0x73, - 0xc7, 0x9a, 0x58, 0x47, 0x76, 0x58, 0x2c, 0xc9, 0x7b, 0xf8, 0xef, 0x8e, 0x26, 0x1b, 0x74, 0x7a, - 0x13, 0xab, 0x0b, 0x3b, 0xa7, 0x29, 0x4a, 0x4e, 0x57, 0x58, 0xf3, 0xc3, 0xd2, 0x71, 0xda, 0x3b, - 0xb1, 0xbc, 0x9f, 0x03, 0x78, 0xdc, 0x21, 0x21, 0x0b, 0x18, 0x72, 0x81, 0x12, 0x33, 0x55, 0x6c, - 0xab, 0x9e, 0xdf, 0xed, 0x00, 0xf7, 0x3f, 0xd7, 0xb6, 0xf2, 0x10, 0x26, 0xa8, 0xe0, 0xa6, 0xb1, - 0x94, 0x71, 0x16, 0x69, 0x6e, 0x6f, 0x77, 0xee, 0xac, 0xb6, 0x55, 0x5c, 0x03, 0x44, 0xbe, 0xc2, - 0x68, 0xc9, 0x98, 0xfa, 0xb4, 0xb8, 0xa4, 0x72, 0x8d, 0xd2, 0xe9, 0x6b, 0xf0, 0xf1, 0x2e, 0xe0, - 0x73, 0xc3, 0x57, 0x92, 0x1b, 0x28, 0x77, 0x01, 0xe3, 0xf6, 0x99, 0x3a, 0xee, 0xe1, 0x75, 0xf3, - 0x1e, 0x9e, 0xb5, 0x2b, 0x7f, 0xb9, 0x9f, 0x6f, 0x52, 0x69, 0x8c, 0xde, 0x3d, 0x83, 0x71, 0xfb, - 0x4c, 0x1d, 0xdc, 0x27, 0x26, 0x77, 0xdf, 0xf4, 0x5f, 0xc1, 0xa3, 0xbf, 0x5a, 0xff, 0x17, 0x8d, - 0x79, 0x17, 0x00, 0x35, 0x98, 0x38, 0xf0, 0xff, 0x2d, 0xe6, 0xc5, 0x52, 0x53, 0x47, 0xe1, 0x76, - 0x4b, 0x0e, 0xc1, 0xd6, 0x26, 0x9d, 0xeb, 0xe9, 0x5c, 0x1d, 0xf0, 0xce, 0x60, 0x64, 0xb6, 0x47, - 0x7c, 0x18, 0x24, 0xb1, 0x54, 0xd5, 0x53, 0x72, 0xdb, 0x6d, 0xd4, 0xda, 0x50, 0xeb, 0xbc, 0x43, - 0xd8, 0x2b, 0x5b, 0x23, 0xc4, 0x70, 0x0e, 0xaa, 0xec, 0x6f, 0x0b, 0x86, 0x1f, 0x58, 0x92, 0x4c, - 0x93, 0xe8, 0x63, 0x76, 0xc3, 0xc8, 0x25, 0xd8, 0x99, 0x2c, 0x02, 0xb3, 0x87, 0x2f, 0xec, 0x55, - 0xbb, 0x84, 0xa1, 0xf7, 0xe7, 0x5b, 0x71, 0x79, 0xe3, 0xb5, 0xd9, 0xbd, 0x82, 0x83, 0x66, 0xb2, - 0x63, 0xa6, 0x41, 0x73, 0xa6, 0xcf, 0xbb, 0x2a, 0xe9, 0xa7, 0x66, 0x8e, 0xf5, 0x25, 0xd8, 0x0f, - 0xf1, 0x62, 0xaa, 0x98, 0x29, 0x11, 0xa3, 0xd4, 0xdd, 0xda, 0xe1, 0x76, 0x7b, 0x7e, 0xfa, 0xed, - 0x24, 0x8a, 0xd5, 0x7a, 0xb3, 0xf4, 0x57, 0x2c, 0x0d, 0xd6, 0x39, 0x47, 0x91, 0xe0, 0x75, 0x84, - 0x22, 0xb8, 0xa1, 0x4b, 0x11, 0xaf, 0x82, 0x15, 0x13, 0x18, 0x54, 0xa1, 0x66, 0xdd, 0xe5, 0x9e, - 0xfe, 0x0f, 0xbd, 0xfd, 0x13, 0x00, 0x00, 0xff, 0xff, 0xa1, 0x8d, 0x56, 0x84, 0xa0, 0x04, 0x00, - 0x00, +var File_persistent_msgs_proto protoreflect.FileDescriptor + +var file_persistent_msgs_proto_rawDesc = []byte{ + 0x0a, 0x15, 0x70, 0x65, 0x72, 0x73, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x74, 0x5f, 0x6d, 0x73, 0x67, + 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x70, 0x76, 0x74, 0x64, 0x61, 0x74, 0x61, + 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x22, 0xa0, 0x01, 0x0a, 0x0a, 0x45, 0x78, 0x70, 0x69, + 0x72, 0x79, 0x44, 0x61, 0x74, 0x61, 0x12, 0x35, 0x0a, 0x03, 0x6d, 0x61, 0x70, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x70, 0x76, 0x74, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, + 0x72, 0x61, 0x67, 0x65, 0x2e, 0x45, 0x78, 0x70, 0x69, 0x72, 0x79, 0x44, 0x61, 0x74, 0x61, 0x2e, + 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x03, 0x6d, 0x61, 0x70, 0x1a, 0x5b, 0x0a, + 0x08, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x39, 0x0a, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x70, 0x76, 0x74, + 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x4e, 0x61, 0x6d, 0x65, + 0x73, 0x70, 0x61, 0x63, 0x65, 0x45, 0x78, 0x70, 0x69, 0x72, 0x79, 0x44, 0x61, 0x74, 0x61, 0x52, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x91, 0x04, 0x0a, 0x13, 0x4e, + 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x45, 0x78, 0x70, 0x69, 0x72, 0x79, 0x44, 0x61, + 0x74, 0x61, 0x12, 0x56, 0x0a, 0x0b, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x44, 0x61, 0x74, + 0x61, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x70, 0x76, 0x74, 0x64, 0x61, 0x74, + 0x61, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, + 0x63, 0x65, 0x45, 0x78, 0x70, 0x69, 0x72, 0x79, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x50, 0x72, 0x65, + 0x73, 0x65, 0x6e, 0x74, 0x44, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0b, 0x70, + 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x44, 0x61, 0x74, 0x61, 0x12, 0x56, 0x0a, 0x0b, 0x6d, 0x69, + 0x73, 0x73, 0x69, 0x6e, 0x67, 0x44, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x34, 0x2e, 0x70, 0x76, 0x74, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, + 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x45, 0x78, 0x70, 0x69, 0x72, 0x79, + 0x44, 0x61, 0x74, 0x61, 0x2e, 0x4d, 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x44, 0x61, 0x74, 0x61, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0b, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x44, 0x61, + 0x74, 0x61, 0x12, 0x59, 0x0a, 0x0c, 0x62, 0x6f, 0x6f, 0x74, 0x4b, 0x56, 0x48, 0x61, 0x73, 0x68, + 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x70, 0x76, 0x74, 0x64, 0x61, + 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, + 0x61, 0x63, 0x65, 0x45, 0x78, 0x70, 0x69, 0x72, 0x79, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x42, 0x6f, + 0x6f, 0x74, 0x4b, 0x56, 0x48, 0x61, 0x73, 0x68, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, + 0x0c, 0x62, 0x6f, 0x6f, 0x74, 0x4b, 0x56, 0x48, 0x61, 0x73, 0x68, 0x65, 0x73, 0x1a, 0x56, 0x0a, + 0x10, 0x50, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x44, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, + 0x6b, 0x65, 0x79, 0x12, 0x2c, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70, 0x76, 0x74, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, + 0x61, 0x67, 0x65, 0x2e, 0x54, 0x78, 0x4e, 0x75, 0x6d, 0x73, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x3e, 0x0a, 0x10, 0x4d, 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, + 0x44, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x57, 0x0a, 0x11, 0x42, 0x6f, 0x6f, 0x74, 0x4b, 0x56, 0x48, + 0x61, 0x73, 0x68, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, + 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2c, 0x0a, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70, 0x76, + 0x74, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x54, 0x78, 0x4e, + 0x75, 0x6d, 0x73, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x44, + 0x0a, 0x0a, 0x42, 0x6f, 0x6f, 0x74, 0x4b, 0x56, 0x48, 0x61, 0x73, 0x68, 0x12, 0x18, 0x0a, 0x07, + 0x6b, 0x65, 0x79, 0x48, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x6b, + 0x65, 0x79, 0x48, 0x61, 0x73, 0x68, 0x12, 0x1c, 0x0a, 0x09, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x48, + 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x48, 0x61, 0x73, 0x68, 0x22, 0x3e, 0x0a, 0x0c, 0x42, 0x6f, 0x6f, 0x74, 0x4b, 0x56, 0x48, 0x61, + 0x73, 0x68, 0x65, 0x73, 0x12, 0x2e, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x70, 0x76, 0x74, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, + 0x61, 0x67, 0x65, 0x2e, 0x42, 0x6f, 0x6f, 0x74, 0x4b, 0x56, 0x48, 0x61, 0x73, 0x68, 0x52, 0x04, + 0x6c, 0x69, 0x73, 0x74, 0x22, 0x1c, 0x0a, 0x06, 0x54, 0x78, 0x4e, 0x75, 0x6d, 0x73, 0x12, 0x12, + 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x04, 0x52, 0x04, 0x6c, 0x69, + 0x73, 0x74, 0x22, 0xb0, 0x01, 0x0a, 0x0b, 0x43, 0x6f, 0x6c, 0x6c, 0x45, 0x6c, 0x67, 0x49, 0x6e, + 0x66, 0x6f, 0x12, 0x48, 0x0a, 0x09, 0x6e, 0x73, 0x43, 0x6f, 0x6c, 0x6c, 0x4d, 0x61, 0x70, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x70, 0x76, 0x74, 0x64, 0x61, 0x74, 0x61, 0x73, + 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x43, 0x6f, 0x6c, 0x6c, 0x45, 0x6c, 0x67, 0x49, 0x6e, + 0x66, 0x6f, 0x2e, 0x4e, 0x73, 0x43, 0x6f, 0x6c, 0x6c, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x52, 0x09, 0x6e, 0x73, 0x43, 0x6f, 0x6c, 0x6c, 0x4d, 0x61, 0x70, 0x1a, 0x57, 0x0a, 0x0e, + 0x4e, 0x73, 0x43, 0x6f, 0x6c, 0x6c, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, + 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, + 0x12, 0x2f, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x19, 0x2e, 0x70, 0x76, 0x74, 0x64, 0x61, 0x74, 0x61, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, + 0x2e, 0x43, 0x6f, 0x6c, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x25, 0x0a, 0x09, 0x43, 0x6f, 0x6c, 0x6c, 0x4e, 0x61, 0x6d, + 0x65, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x09, 0x52, 0x07, 0x65, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x42, 0x3a, 0x5a, 0x38, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x79, 0x70, 0x65, 0x72, + 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2f, 0x66, 0x61, 0x62, 0x72, 0x69, 0x63, 0x2f, 0x63, 0x6f, + 0x72, 0x65, 0x2f, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2f, 0x70, 0x76, 0x74, 0x64, 0x61, 0x74, + 0x61, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_persistent_msgs_proto_rawDescOnce sync.Once + file_persistent_msgs_proto_rawDescData = file_persistent_msgs_proto_rawDesc +) + +func file_persistent_msgs_proto_rawDescGZIP() []byte { + file_persistent_msgs_proto_rawDescOnce.Do(func() { + file_persistent_msgs_proto_rawDescData = protoimpl.X.CompressGZIP(file_persistent_msgs_proto_rawDescData) + }) + return file_persistent_msgs_proto_rawDescData +} + +var file_persistent_msgs_proto_msgTypes = make([]protoimpl.MessageInfo, 12) +var file_persistent_msgs_proto_goTypes = []any{ + (*ExpiryData)(nil), // 0: pvtdatastorage.ExpiryData + (*NamespaceExpiryData)(nil), // 1: pvtdatastorage.NamespaceExpiryData + (*BootKVHash)(nil), // 2: pvtdatastorage.BootKVHash + (*BootKVHashes)(nil), // 3: pvtdatastorage.BootKVHashes + (*TxNums)(nil), // 4: pvtdatastorage.TxNums + (*CollElgInfo)(nil), // 5: pvtdatastorage.CollElgInfo + (*CollNames)(nil), // 6: pvtdatastorage.CollNames + nil, // 7: pvtdatastorage.ExpiryData.MapEntry + nil, // 8: pvtdatastorage.NamespaceExpiryData.PresentDataEntry + nil, // 9: pvtdatastorage.NamespaceExpiryData.MissingDataEntry + nil, // 10: pvtdatastorage.NamespaceExpiryData.BootKVHashesEntry + nil, // 11: pvtdatastorage.CollElgInfo.NsCollMapEntry +} +var file_persistent_msgs_proto_depIdxs = []int32{ + 7, // 0: pvtdatastorage.ExpiryData.map:type_name -> pvtdatastorage.ExpiryData.MapEntry + 8, // 1: pvtdatastorage.NamespaceExpiryData.presentData:type_name -> pvtdatastorage.NamespaceExpiryData.PresentDataEntry + 9, // 2: pvtdatastorage.NamespaceExpiryData.missingData:type_name -> pvtdatastorage.NamespaceExpiryData.MissingDataEntry + 10, // 3: pvtdatastorage.NamespaceExpiryData.bootKVHashes:type_name -> pvtdatastorage.NamespaceExpiryData.BootKVHashesEntry + 2, // 4: pvtdatastorage.BootKVHashes.list:type_name -> pvtdatastorage.BootKVHash + 11, // 5: pvtdatastorage.CollElgInfo.nsCollMap:type_name -> pvtdatastorage.CollElgInfo.NsCollMapEntry + 1, // 6: pvtdatastorage.ExpiryData.MapEntry.value:type_name -> pvtdatastorage.NamespaceExpiryData + 4, // 7: pvtdatastorage.NamespaceExpiryData.PresentDataEntry.value:type_name -> pvtdatastorage.TxNums + 4, // 8: pvtdatastorage.NamespaceExpiryData.BootKVHashesEntry.value:type_name -> pvtdatastorage.TxNums + 6, // 9: pvtdatastorage.CollElgInfo.NsCollMapEntry.value:type_name -> pvtdatastorage.CollNames + 10, // [10:10] is the sub-list for method output_type + 10, // [10:10] is the sub-list for method input_type + 10, // [10:10] is the sub-list for extension type_name + 10, // [10:10] is the sub-list for extension extendee + 0, // [0:10] is the sub-list for field type_name +} + +func init() { file_persistent_msgs_proto_init() } +func file_persistent_msgs_proto_init() { + if File_persistent_msgs_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_persistent_msgs_proto_msgTypes[0].Exporter = func(v any, i int) any { + switch v := v.(*ExpiryData); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_persistent_msgs_proto_msgTypes[1].Exporter = func(v any, i int) any { + switch v := v.(*NamespaceExpiryData); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_persistent_msgs_proto_msgTypes[2].Exporter = func(v any, i int) any { + switch v := v.(*BootKVHash); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_persistent_msgs_proto_msgTypes[3].Exporter = func(v any, i int) any { + switch v := v.(*BootKVHashes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_persistent_msgs_proto_msgTypes[4].Exporter = func(v any, i int) any { + switch v := v.(*TxNums); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_persistent_msgs_proto_msgTypes[5].Exporter = func(v any, i int) any { + switch v := v.(*CollElgInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_persistent_msgs_proto_msgTypes[6].Exporter = func(v any, i int) any { + switch v := v.(*CollNames); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_persistent_msgs_proto_rawDesc, + NumEnums: 0, + NumMessages: 12, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_persistent_msgs_proto_goTypes, + DependencyIndexes: file_persistent_msgs_proto_depIdxs, + MessageInfos: file_persistent_msgs_proto_msgTypes, + }.Build() + File_persistent_msgs_proto = out.File + file_persistent_msgs_proto_rawDesc = nil + file_persistent_msgs_proto_goTypes = nil + file_persistent_msgs_proto_depIdxs = nil } diff --git a/core/ledger/pvtdatastorage/reconcile_missing_pvtdata.go b/core/ledger/pvtdatastorage/reconcile_missing_pvtdata.go index 72864ac95e4..6df7381bbdb 100644 --- a/core/ledger/pvtdatastorage/reconcile_missing_pvtdata.go +++ b/core/ledger/pvtdatastorage/reconcile_missing_pvtdata.go @@ -8,7 +8,7 @@ package pvtdatastorage import ( "github.com/bits-and-blooms/bitset" - "github.com/hyperledger/fabric-protos-go/ledger/rwset" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset" "github.com/hyperledger/fabric/common/ledger/util/leveldbhelper" "github.com/hyperledger/fabric/core/ledger" "github.com/pkg/errors" diff --git a/core/ledger/pvtdatastorage/retroactive_hashed_index.go b/core/ledger/pvtdatastorage/retroactive_hashed_index.go index da4bcfe4d4c..5055e9b95f8 100644 --- a/core/ledger/pvtdatastorage/retroactive_hashed_index.go +++ b/core/ledger/pvtdatastorage/retroactive_hashed_index.go @@ -9,7 +9,7 @@ package pvtdatastorage import ( "time" - "github.com/hyperledger/fabric-protos-go/ledger/rwset" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset" "github.com/hyperledger/fabric/common/ledger/util/leveldbhelper" "github.com/hyperledger/fabric/core/ledger" "github.com/hyperledger/fabric/core/ledger/kvledger/txmgmt/rwsetutil" diff --git a/core/ledger/pvtdatastorage/retroactive_hashed_index_test.go b/core/ledger/pvtdatastorage/retroactive_hashed_index_test.go index 405cf418365..47fd3d54e3c 100644 --- a/core/ledger/pvtdatastorage/retroactive_hashed_index_test.go +++ b/core/ledger/pvtdatastorage/retroactive_hashed_index_test.go @@ -11,12 +11,13 @@ import ( "path/filepath" "testing" - "github.com/hyperledger/fabric-protos-go/ledger/rwset/kvrwset" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset/kvrwset" "github.com/hyperledger/fabric/common/ledger/testutil" "github.com/hyperledger/fabric/core/ledger/kvledger/txmgmt/rwsetutil" btltestutil "github.com/hyperledger/fabric/core/ledger/pvtdatapolicy/testutil" "github.com/hyperledger/fabric/core/ledger/util" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) // TestConstructHashedIndexAndUpgradeDataFmtRetroactively test that we create hashed indexes retroactively on the existing @@ -75,7 +76,7 @@ func TestConstructHashedIndexAndUpgradeDataFmtRetroactively(t *testing.T) { pvtWS, err := rwsetutil.TxPvtRwSetFromProtoMsg(pvtdata[0].WriteSet) require.NoError(t, err) - require.Equal(t, &rwsetutil.TxPvtRwSet{ + rwset := &rwsetutil.TxPvtRwSet{ NsPvtRwSet: []*rwsetutil.NsPvtRwSet{ { NameSpace: "marbles_private", @@ -91,7 +92,6 @@ func TestConstructHashedIndexAndUpgradeDataFmtRetroactively(t *testing.T) { }, }, }, - { CollectionName: "collectionMarbles", KvRwSet: &kvrwset.KVRWSet{ @@ -106,9 +106,17 @@ func TestConstructHashedIndexAndUpgradeDataFmtRetroactively(t *testing.T) { }, }, }, - }, - pvtWS, - ) + } + + require.True(t, proto.Equal(rwset.NsPvtRwSet[0].CollPvtRwSets[0].KvRwSet, pvtWS.NsPvtRwSet[0].CollPvtRwSets[0].KvRwSet) || + proto.Equal(rwset.NsPvtRwSet[0].CollPvtRwSets[0].KvRwSet, pvtWS.NsPvtRwSet[0].CollPvtRwSets[1].KvRwSet)) + require.True(t, proto.Equal(rwset.NsPvtRwSet[0].CollPvtRwSets[1].KvRwSet, pvtWS.NsPvtRwSet[0].CollPvtRwSets[0].KvRwSet) || + proto.Equal(rwset.NsPvtRwSet[0].CollPvtRwSets[1].KvRwSet, pvtWS.NsPvtRwSet[0].CollPvtRwSets[1].KvRwSet)) + rwset.NsPvtRwSet[0].CollPvtRwSets[0].KvRwSet = nil + rwset.NsPvtRwSet[0].CollPvtRwSets[1].KvRwSet = nil + pvtWS.NsPvtRwSet[0].CollPvtRwSets[0].KvRwSet = nil + pvtWS.NsPvtRwSet[0].CollPvtRwSets[1].KvRwSet = nil + require.Equal(t, rwset, pvtWS) for blk := 11; blk < 14; blk++ { checkDataNotExists(t, s, blk) @@ -121,7 +129,7 @@ func TestConstructHashedIndexAndUpgradeDataFmtRetroactively(t *testing.T) { pvtWS, err = rwsetutil.TxPvtRwSetFromProtoMsg(pvtdata[0].WriteSet) require.NoError(t, err) - require.Equal(t, &rwsetutil.TxPvtRwSet{ + rwset = &rwsetutil.TxPvtRwSet{ NsPvtRwSet: []*rwsetutil.NsPvtRwSet{ { NameSpace: "marbles_private", @@ -152,9 +160,17 @@ func TestConstructHashedIndexAndUpgradeDataFmtRetroactively(t *testing.T) { }, }, }, - }, - pvtWS, - ) + } + + require.True(t, proto.Equal(rwset.NsPvtRwSet[0].CollPvtRwSets[0].KvRwSet, pvtWS.NsPvtRwSet[0].CollPvtRwSets[0].KvRwSet) || + proto.Equal(rwset.NsPvtRwSet[0].CollPvtRwSets[0].KvRwSet, pvtWS.NsPvtRwSet[0].CollPvtRwSets[1].KvRwSet)) + require.True(t, proto.Equal(rwset.NsPvtRwSet[0].CollPvtRwSets[1].KvRwSet, pvtWS.NsPvtRwSet[0].CollPvtRwSets[0].KvRwSet) || + proto.Equal(rwset.NsPvtRwSet[0].CollPvtRwSets[1].KvRwSet, pvtWS.NsPvtRwSet[0].CollPvtRwSets[1].KvRwSet)) + rwset.NsPvtRwSet[0].CollPvtRwSets[0].KvRwSet = nil + rwset.NsPvtRwSet[0].CollPvtRwSets[1].KvRwSet = nil + pvtWS.NsPvtRwSet[0].CollPvtRwSets[0].KvRwSet = nil + pvtWS.NsPvtRwSet[0].CollPvtRwSets[1].KvRwSet = nil + require.Equal(t, rwset, pvtWS) _, err = s.GetPvtDataByBlockNum(uint64(15), nil) require.EqualError(t, err, "last committed block number [14] smaller than the requested block number [15]") diff --git a/core/ledger/pvtdatastorage/snapshot_data_importer_test.go b/core/ledger/pvtdatastorage/snapshot_data_importer_test.go index 97fbebfdc9f..f356823f3ec 100644 --- a/core/ledger/pvtdatastorage/snapshot_data_importer_test.go +++ b/core/ledger/pvtdatastorage/snapshot_data_importer_test.go @@ -13,9 +13,9 @@ import ( "testing" "github.com/bits-and-blooms/bitset" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/msp" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/msp" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/ledger/util/leveldbhelper" "github.com/hyperledger/fabric/core/chaincode/implicitcollection" "github.com/hyperledger/fabric/core/ledger/confighistory/confighistorytest" @@ -23,6 +23,7 @@ import ( "github.com/hyperledger/fabric/core/ledger/mock" "github.com/hyperledger/fabric/internal/fileutil" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) func TestSnapshotImporter(t *testing.T) { @@ -950,7 +951,7 @@ func (v *dbEntriesVerifier) verifyBootKVHashesEntry(key *bootKVHashesKey, expect require.NoError(v.t, err) val, err := decodeBootKVHashesVal(encVal) require.NoError(v.t, err) - require.Equal(v.t, expectedVal, val) + require.True(v.t, proto.Equal(expectedVal, val)) } func (v *dbEntriesVerifier) verifyExpiryEntry(key *expiryKey, expectedVal *ExpiryData) { @@ -958,7 +959,7 @@ func (v *dbEntriesVerifier) verifyExpiryEntry(key *expiryKey, expectedVal *Expir require.NoError(v.t, err) val, err := decodeExpiryValue(encVal) require.NoError(v.t, err) - require.Equal(v.t, expectedVal, val) + require.True(v.t, proto.Equal(expectedVal, val)) } func (v *dbEntriesVerifier) verifyNoExpiryEntries() { diff --git a/core/ledger/pvtdatastorage/store.go b/core/ledger/pvtdatastorage/store.go index 98e73bf5aa3..eb1f9d1ffa9 100644 --- a/core/ledger/pvtdatastorage/store.go +++ b/core/ledger/pvtdatastorage/store.go @@ -12,10 +12,9 @@ import ( "time" "github.com/bits-and-blooms/bitset" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/common/flogging" - "github.com/hyperledger/fabric-protos-go/ledger/rwset" - "github.com/hyperledger/fabric-protos-go/ledger/rwset/kvrwset" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset/kvrwset" "github.com/hyperledger/fabric/common/ledger/util/leveldbhelper" "github.com/hyperledger/fabric/core/ledger" "github.com/hyperledger/fabric/core/ledger/confighistory" @@ -25,6 +24,7 @@ import ( "github.com/hyperledger/fabric/core/ledger/util" "github.com/pkg/errors" "google.golang.org/protobuf/encoding/protowire" + "google.golang.org/protobuf/proto" ) var logger = flogging.MustGetLogger("pvtdatastorage") diff --git a/core/ledger/pvtdatastorage/store_created_from_snapshot_test.go b/core/ledger/pvtdatastorage/store_created_from_snapshot_test.go index 20b654a0d2c..84c1b73b3d8 100644 --- a/core/ledger/pvtdatastorage/store_created_from_snapshot_test.go +++ b/core/ledger/pvtdatastorage/store_created_from_snapshot_test.go @@ -11,7 +11,7 @@ import ( "path" "testing" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/core/ledger" "github.com/hyperledger/fabric/core/ledger/confighistory/confighistorytest" "github.com/hyperledger/fabric/core/ledger/internal/version" diff --git a/core/ledger/pvtdatastorage/store_test.go b/core/ledger/pvtdatastorage/store_test.go index 6a8a7a0ceec..ff1a2d40817 100644 --- a/core/ledger/pvtdatastorage/store_test.go +++ b/core/ledger/pvtdatastorage/store_test.go @@ -14,15 +14,15 @@ import ( "testing" "time" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/ledger/rwset" - "github.com/hyperledger/fabric-protos-go/ledger/rwset/kvrwset" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset/kvrwset" "github.com/hyperledger/fabric/common/ledger/util/leveldbhelper" "github.com/hyperledger/fabric/core/ledger" "github.com/hyperledger/fabric/core/ledger/kvledger/txmgmt/rwsetutil" btltestutil "github.com/hyperledger/fabric/core/ledger/pvtdatapolicy/testutil" "github.com/hyperledger/fabric/core/ledger/util" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) func TestMain(m *testing.M) { @@ -384,7 +384,10 @@ func TestExpiryDataNotIncluded(t *testing.T) { produceSamplePvtdata(t, 4, []string{"ns-1:coll-2", "ns-2:coll-1", "ns-2:coll-2"}), } retrievedData, _ = store.GetPvtDataByBlockNum(1, nil) - require.Equal(t, expectedPvtdataFromBlock1, retrievedData) + require.Equal(t, expectedPvtdataFromBlock1[0].SeqInBlock, retrievedData[0].SeqInBlock) + require.Equal(t, expectedPvtdataFromBlock1[1].SeqInBlock, retrievedData[1].SeqInBlock) + require.True(t, proto.Equal(expectedPvtdataFromBlock1[0].WriteSet, retrievedData[0].WriteSet)) + require.True(t, proto.Equal(expectedPvtdataFromBlock1[1].WriteSet, retrievedData[1].WriteSet)) // After committing block 3, the missing data of "ns1-coll1" in block1-tx1 should have expired expectedMissingPvtDataInfo = make(ledger.MissingPvtDataInfo) @@ -407,7 +410,10 @@ func TestExpiryDataNotIncluded(t *testing.T) { produceSamplePvtdata(t, 4, []string{"ns-1:coll-2", "ns-2:coll-1"}), } retrievedData, _ = store.GetPvtDataByBlockNum(1, nil) - require.Equal(t, expectedPvtdataFromBlock1, retrievedData) + require.Equal(t, expectedPvtdataFromBlock1[0].SeqInBlock, retrievedData[0].SeqInBlock) + require.Equal(t, expectedPvtdataFromBlock1[1].SeqInBlock, retrievedData[1].SeqInBlock) + require.True(t, proto.Equal(expectedPvtdataFromBlock1[0].WriteSet, retrievedData[0].WriteSet)) + require.True(t, proto.Equal(expectedPvtdataFromBlock1[1].WriteSet, retrievedData[1].WriteSet)) // Now, for block 2, "ns-1:coll1" should also have expired expectedPvtdataFromBlock2 := []*ledger.TxPvtData{ @@ -415,7 +421,10 @@ func TestExpiryDataNotIncluded(t *testing.T) { produceSamplePvtdata(t, 5, []string{"ns-1:coll-2", "ns-2:coll-1", "ns-2:coll-2"}), } retrievedData, _ = store.GetPvtDataByBlockNum(2, nil) - require.Equal(t, expectedPvtdataFromBlock2, retrievedData) + require.Equal(t, expectedPvtdataFromBlock2[0].SeqInBlock, retrievedData[0].SeqInBlock) + require.Equal(t, expectedPvtdataFromBlock2[1].SeqInBlock, retrievedData[1].SeqInBlock) + require.True(t, proto.Equal(expectedPvtdataFromBlock2[0].WriteSet, retrievedData[0].WriteSet)) + require.True(t, proto.Equal(expectedPvtdataFromBlock2[1].WriteSet, retrievedData[1].WriteSet)) // After committing block 4, the missing data of "ns1-coll1" in block2-tx1 should have expired expectedMissingPvtDataInfo = make(ledger.MissingPvtDataInfo) @@ -1294,19 +1303,20 @@ func TestStoreProcessPurgeMarker(t *testing.T) { // this should cause purging key-1 from data require.True(t, testDataKeyExists(t, s, dataKeyColl1)) require.Equal(t, - &rwsetutil.CollPvtRwSet{ - CollectionName: "coll-1", - KvRwSet: &kvrwset.KVRWSet{ - Writes: []*kvrwset.KVWrite{ - { - Key: "key-2", - Value: []byte("value-2"), - }, + "coll-1", + testRetrieveDataValue(t, s, dataKeyColl1).CollectionName, + ) + require.True(t, + proto.Equal(&kvrwset.KVRWSet{ + Writes: []*kvrwset.KVWrite{ + { + Key: "key-2", + Value: []byte("value-2"), }, }, }, - testRetrieveDataValue(t, s, dataKeyColl1), - ) + testRetrieveDataValue(t, s, dataKeyColl1).KvRwSet, + )) require.True(t, testDataKeyExists(t, s, dataKeyColl2)) require.False(t, testHashedIndexExists(t, s, hashedIndexKey1)) require.False(t, testHashedIndexExists(t, s, hashedIndexDeleteKey1)) @@ -1399,12 +1409,13 @@ func TestStoreProcessPurgeMarker(t *testing.T) { // this should cause purging key-2 (e.g., all keys) from data require.True(t, testDataKeyExists(t, s, dataKeyColl1)) + tmp := testRetrieveDataValue(t, s, dataKeyColl1) require.Equal(t, - &rwsetutil.CollPvtRwSet{ - CollectionName: "coll-1", - KvRwSet: &kvrwset.KVRWSet{}, - }, - testRetrieveDataValue(t, s, dataKeyColl1), + "coll-1", + tmp.CollectionName, + ) + require.True(t, + proto.Equal(&kvrwset.KVRWSet{}, tmp.KvRwSet), ) require.True(t, testDataKeyExists(t, s, dataKeyColl2)) require.False(t, testHashedIndexExists(t, s, hashedIndexKey1)) diff --git a/core/ledger/pvtdatastorage/v11.go b/core/ledger/pvtdatastorage/v11.go index 54a5f40d9f2..28de9db35ed 100644 --- a/core/ledger/pvtdatastorage/v11.go +++ b/core/ledger/pvtdatastorage/v11.go @@ -7,10 +7,10 @@ SPDX-License-Identifier: Apache-2.0 package pvtdatastorage import ( - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/ledger/rwset" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset" "github.com/hyperledger/fabric/core/ledger" "github.com/hyperledger/fabric/core/ledger/internal/version" + "google.golang.org/protobuf/proto" ) func v11Format(datakeyBytes []byte) (bool, error) { diff --git a/core/ledger/snapshotgrpc/snapshot_service.go b/core/ledger/snapshotgrpc/snapshot_service.go index f2637812923..9afe1d8948d 100644 --- a/core/ledger/snapshotgrpc/snapshot_service.go +++ b/core/ledger/snapshotgrpc/snapshot_service.go @@ -10,15 +10,15 @@ import ( "context" "time" - "github.com/golang/protobuf/proto" - "github.com/golang/protobuf/ptypes/empty" - cb "github.com/hyperledger/fabric-protos-go/common" - pb "github.com/hyperledger/fabric-protos-go/peer" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/crypto" "github.com/hyperledger/fabric/core/aclmgmt/resources" "github.com/hyperledger/fabric/core/ledger" "github.com/hyperledger/fabric/protoutil" "github.com/pkg/errors" + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/types/known/emptypb" ) // Snapshot Service implements SnapshotServer grpc interface @@ -38,7 +38,7 @@ type ACLProvider interface { } // Generate generates a snapshot request. -func (s *SnapshotService) Generate(ctx context.Context, signedRequest *pb.SignedSnapshotRequest) (*empty.Empty, error) { +func (s *SnapshotService) Generate(ctx context.Context, signedRequest *pb.SignedSnapshotRequest) (*emptypb.Empty, error) { request := &pb.SnapshotRequest{} if err := proto.Unmarshal(signedRequest.Request, request); err != nil { return nil, errors.Wrap(err, "failed to unmarshal snapshot request") @@ -57,11 +57,11 @@ func (s *SnapshotService) Generate(ctx context.Context, signedRequest *pb.Signed return nil, err } - return &empty.Empty{}, nil + return &emptypb.Empty{}, nil } // Cancel cancels a snapshot request. -func (s *SnapshotService) Cancel(ctx context.Context, signedRequest *pb.SignedSnapshotRequest) (*empty.Empty, error) { +func (s *SnapshotService) Cancel(ctx context.Context, signedRequest *pb.SignedSnapshotRequest) (*emptypb.Empty, error) { request := &pb.SnapshotRequest{} if err := proto.Unmarshal(signedRequest.Request, request); err != nil { return nil, errors.Wrap(err, "failed to unmarshal snapshot request") @@ -80,7 +80,7 @@ func (s *SnapshotService) Cancel(ctx context.Context, signedRequest *pb.SignedSn return nil, err } - return &empty.Empty{}, nil + return &emptypb.Empty{}, nil } // QueryPendings returns a list of pending snapshot requests. diff --git a/core/ledger/snapshotgrpc/snapshot_service_test.go b/core/ledger/snapshotgrpc/snapshot_service_test.go index 015ac179f07..8f55e03f2f8 100644 --- a/core/ledger/snapshotgrpc/snapshot_service_test.go +++ b/core/ledger/snapshotgrpc/snapshot_service_test.go @@ -11,8 +11,8 @@ import ( "fmt" "testing" - "github.com/hyperledger/fabric-protos-go/common" - pb "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/configtx/test" "github.com/hyperledger/fabric/core/ledger/ledgermgmt" "github.com/hyperledger/fabric/core/ledger/ledgermgmt/ledgermgmttest" diff --git a/core/mocks/txvalidator/support.go b/core/mocks/txvalidator/support.go index 7b1d1b7e2a2..1959d5baaee 100644 --- a/core/mocks/txvalidator/support.go +++ b/core/mocks/txvalidator/support.go @@ -19,7 +19,7 @@ package support import ( "sync" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/common/channelconfig" "github.com/hyperledger/fabric/core/ledger" "github.com/hyperledger/fabric/msp" diff --git a/core/mocks/validator/validator.go b/core/mocks/validator/validator.go index aa86811fcb4..d8c9d588f35 100644 --- a/core/mocks/validator/validator.go +++ b/core/mocks/validator/validator.go @@ -7,8 +7,8 @@ SPDX-License-Identifier: Apache-2.0 package validator import ( - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/stretchr/testify/mock" ) diff --git a/core/peer/channel.go b/core/peer/channel.go index bdd0554f36e..dd0f4f24250 100644 --- a/core/peer/channel.go +++ b/core/peer/channel.go @@ -10,7 +10,7 @@ import ( "sync" "github.com/hyperledger/fabric-lib-go/bccsp" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/common/channelconfig" "github.com/hyperledger/fabric/common/ledger/blockledger" "github.com/hyperledger/fabric/common/ledger/blockledger/fileledger" diff --git a/core/peer/configtx_processor.go b/core/peer/configtx_processor.go index 39319ce05cf..071d5e2115e 100644 --- a/core/peer/configtx_processor.go +++ b/core/peer/configtx_processor.go @@ -9,10 +9,10 @@ package peer import ( "fmt" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/core/ledger" "github.com/hyperledger/fabric/protoutil" + "google.golang.org/protobuf/proto" ) const ( diff --git a/core/peer/configtx_test.go b/core/peer/configtx_test.go index c6edde48995..5d4527dd011 100644 --- a/core/peer/configtx_test.go +++ b/core/peer/configtx_test.go @@ -9,9 +9,8 @@ package peer import ( "testing" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/bccsp/sw" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/common/capabilities" "github.com/hyperledger/fabric/common/channelconfig" configtxtest "github.com/hyperledger/fabric/common/configtx/test" @@ -22,6 +21,7 @@ import ( "github.com/hyperledger/fabric/internal/configtxgen/genesisconfig" "github.com/hyperledger/fabric/protoutil" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) func TestConfigTxCreateLedger(t *testing.T) { diff --git a/core/peer/deliverevents.go b/core/peer/deliverevents.go index 0a540a57bcf..dc4eb654e9a 100644 --- a/core/peer/deliverevents.go +++ b/core/peer/deliverevents.go @@ -10,9 +10,9 @@ import ( "runtime/debug" "github.com/hyperledger/fabric-lib-go/common/flogging" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/ledger/rwset" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/deliver" "github.com/hyperledger/fabric/core/aclmgmt/resources" "github.com/hyperledger/fabric/core/common/privdata" diff --git a/core/peer/deliverevents_test.go b/core/peer/deliverevents_test.go index 7f95338fb24..0187723cc83 100644 --- a/core/peer/deliverevents_test.go +++ b/core/peer/deliverevents_test.go @@ -15,11 +15,10 @@ import ( "testing" "time" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/common/metrics/disabled" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/orderer" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/deliver" "github.com/hyperledger/fabric/common/ledger/blockledger" "github.com/hyperledger/fabric/common/policies" @@ -32,6 +31,7 @@ import ( "github.com/stretchr/testify/require" "google.golang.org/grpc/metadata" peer2 "google.golang.org/grpc/peer" + "google.golang.org/protobuf/proto" ) // defaultPolicyCheckerProvider policy checker provider used by default, diff --git a/core/peer/mock/peer_ledger.go b/core/peer/mock/peer_ledger.go index 64fa28a1d84..387314b98bc 100644 --- a/core/peer/mock/peer_ledger.go +++ b/core/peer/mock/peer_ledger.go @@ -4,8 +4,8 @@ package mock import ( "sync" - "github.com/hyperledger/fabric-protos-go/common" - peera "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + peera "github.com/hyperledger/fabric-protos-go-apiv2/peer" ledgera "github.com/hyperledger/fabric/common/ledger" "github.com/hyperledger/fabric/core/ledger" ) diff --git a/core/peer/peer.go b/core/peer/peer.go index 1d66ac882ce..f3d57bffa59 100644 --- a/core/peer/peer.go +++ b/core/peer/peer.go @@ -12,8 +12,8 @@ import ( "github.com/hyperledger/fabric-lib-go/bccsp" "github.com/hyperledger/fabric-lib-go/common/flogging" - "github.com/hyperledger/fabric-protos-go/common" - pb "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/channelconfig" "github.com/hyperledger/fabric/common/deliver" "github.com/hyperledger/fabric/common/deliverclient/orderers" diff --git a/core/peer/peer_test.go b/core/peer/peer_test.go index bb2061d51ee..c01a45b20c1 100644 --- a/core/peer/peer_test.go +++ b/core/peer/peer_test.go @@ -19,8 +19,8 @@ import ( "github.com/hyperledger/fabric-lib-go/bccsp/sw" "github.com/hyperledger/fabric-lib-go/common/metrics/disabled" - "github.com/hyperledger/fabric-protos-go/common" - pb "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" configtxtest "github.com/hyperledger/fabric/common/configtx/test" "github.com/hyperledger/fabric/common/crypto/tlsgen" "github.com/hyperledger/fabric/core/committer/txvalidator/plugin" diff --git a/core/peer/pkg_test.go b/core/peer/pkg_test.go index 5a038df3c19..99f7e52aead 100644 --- a/core/peer/pkg_test.go +++ b/core/peer/pkg_test.go @@ -15,9 +15,9 @@ import ( "testing" "time" - cb "github.com/hyperledger/fabric-protos-go/common" - mspproto "github.com/hyperledger/fabric-protos-go/msp" - pb "github.com/hyperledger/fabric-protos-go/peer" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + mspproto "github.com/hyperledger/fabric-protos-go-apiv2/msp" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" configtxtest "github.com/hyperledger/fabric/common/configtx/test" "github.com/hyperledger/fabric/common/crypto/tlsgen" "github.com/hyperledger/fabric/core/ledger/mock" diff --git a/core/policy/application.go b/core/policy/application.go index 0c8fd15a4e3..f9c21baaaf1 100644 --- a/core/policy/application.go +++ b/core/policy/application.go @@ -7,14 +7,14 @@ SPDX-License-Identifier: Apache-2.0 package policy import ( - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/cauthdsl" "github.com/hyperledger/fabric/common/policies" "github.com/hyperledger/fabric/msp" "github.com/hyperledger/fabric/protoutil" "github.com/pkg/errors" + "google.golang.org/protobuf/proto" ) //go:generate mockery -dir . -name Policy -case underscore -output mocks/ diff --git a/core/policy/application_test.go b/core/policy/application_test.go index 310616775d3..f675156efbb 100644 --- a/core/policy/application_test.go +++ b/core/policy/application_test.go @@ -9,9 +9,8 @@ package policy import ( "testing" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/cauthdsl" "github.com/hyperledger/fabric/common/policydsl" "github.com/hyperledger/fabric/core/policy/mocks" @@ -20,6 +19,7 @@ import ( "github.com/pkg/errors" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) func TestComponentIntegrationSignaturePolicyEnv(t *testing.T) { diff --git a/core/policy/mocks/identity.go b/core/policy/mocks/identity.go index fa12eb35f71..2d695dab8ce 100644 --- a/core/policy/mocks/identity.go +++ b/core/policy/mocks/identity.go @@ -3,7 +3,7 @@ package mocks import ( - fabric_protos_gomsp "github.com/hyperledger/fabric-protos-go/msp" + fabric_protos_gomsp "github.com/hyperledger/fabric-protos-go-apiv2/msp" mock "github.com/stretchr/testify/mock" msp "github.com/hyperledger/fabric/msp" diff --git a/core/policy/mocks/identity_deserializer.go b/core/policy/mocks/identity_deserializer.go index 5ad63c62d0d..49d909a8ba3 100644 --- a/core/policy/mocks/identity_deserializer.go +++ b/core/policy/mocks/identity_deserializer.go @@ -3,7 +3,7 @@ package mocks import ( - fabric_protos_gomsp "github.com/hyperledger/fabric-protos-go/msp" + fabric_protos_gomsp "github.com/hyperledger/fabric-protos-go-apiv2/msp" mock "github.com/stretchr/testify/mock" msp "github.com/hyperledger/fabric/msp" diff --git a/core/policy/mocks/mocks.go b/core/policy/mocks/mocks.go index c347775e174..8c4bdfae400 100644 --- a/core/policy/mocks/mocks.go +++ b/core/policy/mocks/mocks.go @@ -12,7 +12,7 @@ import ( "fmt" "time" - mspproto "github.com/hyperledger/fabric-protos-go/msp" + mspproto "github.com/hyperledger/fabric-protos-go-apiv2/msp" "github.com/hyperledger/fabric/common/policies" "github.com/hyperledger/fabric/msp" "github.com/hyperledger/fabric/protoutil" diff --git a/core/policy/mocks/signature_policy_provider.go b/core/policy/mocks/signature_policy_provider.go index 0b3f7aefd27..fdd72a18567 100644 --- a/core/policy/mocks/signature_policy_provider.go +++ b/core/policy/mocks/signature_policy_provider.go @@ -3,7 +3,7 @@ package mocks import ( - common "github.com/hyperledger/fabric-protos-go/common" + common "github.com/hyperledger/fabric-protos-go-apiv2/common" mock "github.com/stretchr/testify/mock" policies "github.com/hyperledger/fabric/common/policies" diff --git a/core/policy/policy.go b/core/policy/policy.go index 3aa1b5b9d26..fb2cebe7a65 100644 --- a/core/policy/policy.go +++ b/core/policy/policy.go @@ -11,7 +11,7 @@ import ( "fmt" "github.com/hyperledger/fabric-lib-go/common/flogging" - pb "github.com/hyperledger/fabric-protos-go/peer" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/policies" "github.com/hyperledger/fabric/msp" "github.com/hyperledger/fabric/protoutil" diff --git a/core/policy/policy_test.go b/core/policy/policy_test.go index 7f435ad2fe7..4db480cf730 100644 --- a/core/policy/policy_test.go +++ b/core/policy/policy_test.go @@ -9,7 +9,7 @@ package policy import ( "testing" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/policies" "github.com/hyperledger/fabric/core/policy/mocks" "github.com/hyperledger/fabric/protoutil" diff --git a/core/policy/principal.go b/core/policy/principal.go index 28a4deac45b..d10ace4198b 100644 --- a/core/policy/principal.go +++ b/core/policy/principal.go @@ -17,10 +17,10 @@ limitations under the License. package policy import ( - "github.com/golang/protobuf/proto" - protomsp "github.com/hyperledger/fabric-protos-go/msp" + protomsp "github.com/hyperledger/fabric-protos-go-apiv2/msp" "github.com/hyperledger/fabric/msp" "github.com/pkg/errors" + "google.golang.org/protobuf/proto" ) const ( diff --git a/core/policy/principal_test.go b/core/policy/principal_test.go index f2ad4434320..66c01911f83 100644 --- a/core/policy/principal_test.go +++ b/core/policy/principal_test.go @@ -9,11 +9,11 @@ package policy import ( "testing" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/bccsp/sw" - "github.com/hyperledger/fabric-protos-go/msp" + "github.com/hyperledger/fabric-protos-go-apiv2/msp" "github.com/hyperledger/fabric/msp/mgmt" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) func TestNewLocalMSPPrincipalGetter(t *testing.T) { diff --git a/core/scc/cscc/configure.go b/core/scc/cscc/configure.go index a08eb56825e..fd2437f5d32 100644 --- a/core/scc/cscc/configure.go +++ b/core/scc/cscc/configure.go @@ -14,12 +14,11 @@ package cscc import ( "fmt" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-chaincode-go/shim" + "github.com/hyperledger/fabric-chaincode-go/v2/shim" "github.com/hyperledger/fabric-lib-go/bccsp" "github.com/hyperledger/fabric-lib-go/common/flogging" - "github.com/hyperledger/fabric-protos-go/common" - pb "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/channelconfig" "github.com/hyperledger/fabric/core/aclmgmt" "github.com/hyperledger/fabric/core/aclmgmt/resources" @@ -29,6 +28,7 @@ import ( "github.com/hyperledger/fabric/internal/pkg/txflags" "github.com/hyperledger/fabric/protoutil" "github.com/pkg/errors" + "google.golang.org/protobuf/proto" ) // New creates a new instance of the CSCC. @@ -79,7 +79,7 @@ const ( ) // Init is mostly useless from an SCC perspective -func (e *PeerConfiger) Init(stub shim.ChaincodeStubInterface) pb.Response { +func (e *PeerConfiger) Init(stub shim.ChaincodeStubInterface) *pb.Response { cnflogger.Info("Init CSCC") return shim.Success(nil) } @@ -94,7 +94,7 @@ func (e *PeerConfiger) Init(stub shim.ChaincodeStubInterface) pb.Response { // # args[1] is a configuration Block if args[0] is JoinChain or // UpdateConfigBlock; otherwise it is the chain id // TODO: Improve the scc interface to avoid marshal/unmarshal args -func (e *PeerConfiger) Invoke(stub shim.ChaincodeStubInterface) pb.Response { +func (e *PeerConfiger) Invoke(stub shim.ChaincodeStubInterface) *pb.Response { args := stub.GetArgs() if len(args) < 1 { @@ -128,7 +128,7 @@ func (e *PeerConfiger) Invoke(stub shim.ChaincodeStubInterface) pb.Response { return e.InvokeNoShim(args, sp) } -func (e *PeerConfiger) InvokeNoShim(args [][]byte, sp *pb.SignedProposal) pb.Response { +func (e *PeerConfiger) InvokeNoShim(args [][]byte, sp *pb.SignedProposal) *pb.Response { var err error fname := string(args[0]) @@ -260,7 +260,7 @@ func (e *PeerConfiger) joinChain( deployedCCInfoProvider ledger.DeployedChaincodeInfoProvider, lr plugindispatcher.LifecycleResources, nr plugindispatcher.CollectionAndLifecycleResources, -) pb.Response { +) *pb.Response { if err := e.peer.CreateChannel(channelID, block, deployedCCInfoProvider, lr, nr); err != nil { return shim.Error(err.Error()) } @@ -274,7 +274,7 @@ func (e *PeerConfiger) JoinChainBySnapshot( deployedCCInfoProvider ledger.DeployedChaincodeInfoProvider, lr plugindispatcher.LifecycleResources, nr plugindispatcher.CollectionAndLifecycleResources, -) pb.Response { +) *pb.Response { if err := e.peer.CreateChannelFromSnapshot(snapshotDir, deployedCCInfoProvider, lr, nr); err != nil { return shim.Error(err.Error()) } @@ -284,7 +284,7 @@ func (e *PeerConfiger) JoinChainBySnapshot( // Return the current configuration block for the specified channelID. If the // peer doesn't belong to the channel, return error -func (e *PeerConfiger) getConfigBlock(channelID []byte) pb.Response { +func (e *PeerConfiger) getConfigBlock(channelID []byte) *pb.Response { if channelID == nil { return shim.Error("ChannelID must not be nil.") } @@ -306,7 +306,7 @@ func (e *PeerConfiger) getConfigBlock(channelID []byte) pb.Response { return shim.Success(blockBytes) } -func (e *PeerConfiger) getChannelConfig(channelID []byte) pb.Response { +func (e *PeerConfiger) getChannelConfig(channelID []byte) *pb.Response { channel := e.peer.Channel(string(channelID)) if channel == nil { return shim.Error(fmt.Sprintf("unknown channel ID, %s", string(channelID))) @@ -324,7 +324,7 @@ func (e *PeerConfiger) getChannelConfig(channelID []byte) pb.Response { } // getChannels returns information about all channels for this peer -func (e *PeerConfiger) getChannels() pb.Response { +func (e *PeerConfiger) getChannels() *pb.Response { channelInfoArray := e.peer.GetChannelsInfo() // add array with info about all channels for this peer @@ -339,7 +339,7 @@ func (e *PeerConfiger) getChannels() pb.Response { } // joinBySnapshotStatus returns information about joinbysnapshot running status. -func (e *PeerConfiger) joinBySnapshotStatus() pb.Response { +func (e *PeerConfiger) joinBySnapshotStatus() *pb.Response { status := e.peer.JoinBySnapshotStatus() statusBytes, err := proto.Marshal(status) diff --git a/core/scc/cscc/configure_test.go b/core/scc/cscc/configure_test.go index 3ccd011fa42..8e9a9b9703a 100644 --- a/core/scc/cscc/configure_test.go +++ b/core/scc/cscc/configure_test.go @@ -13,12 +13,11 @@ import ( "testing" "time" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-chaincode-go/shim" + "github.com/hyperledger/fabric-chaincode-go/v2/shim" "github.com/hyperledger/fabric-lib-go/bccsp/sw" "github.com/hyperledger/fabric-lib-go/common/metrics/disabled" - cb "github.com/hyperledger/fabric-protos-go/common" - pb "github.com/hyperledger/fabric-protos-go/peer" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" configtxtest "github.com/hyperledger/fabric/common/configtx/test" "github.com/hyperledger/fabric/common/genesis" "github.com/hyperledger/fabric/common/policies" @@ -46,6 +45,7 @@ import ( "github.com/stretchr/testify/require" "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" + "google.golang.org/protobuf/proto" ) //go:generate counterfeiter -o mocks/acl_provider.go --fake-name ACLProvider . aclProvider diff --git a/core/scc/cscc/mocks/chaincode_stub.go b/core/scc/cscc/mocks/chaincode_stub.go index be4d69deb75..06248e33550 100644 --- a/core/scc/cscc/mocks/chaincode_stub.go +++ b/core/scc/cscc/mocks/chaincode_stub.go @@ -4,8 +4,8 @@ package mocks import ( "sync" - "github.com/hyperledger/fabric-chaincode-go/shim" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-chaincode-go/v2/shim" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "google.golang.org/protobuf/types/known/timestamppb" ) @@ -400,7 +400,7 @@ type ChaincodeStub struct { result1 *timestamppb.Timestamp result2 error } - InvokeChaincodeStub func(string, [][]byte, string) peer.Response + InvokeChaincodeStub func(string, [][]byte, string) *peer.Response invokeChaincodeMutex sync.RWMutex invokeChaincodeArgsForCall []struct { arg1 string @@ -408,10 +408,10 @@ type ChaincodeStub struct { arg3 string } invokeChaincodeReturns struct { - result1 peer.Response + result1 *peer.Response } invokeChaincodeReturnsOnCall map[int]struct { - result1 peer.Response + result1 *peer.Response } PurgePrivateDataStub func(string, string) error purgePrivateDataMutex sync.RWMutex @@ -2358,7 +2358,7 @@ func (fake *ChaincodeStub) GetTxTimestampReturnsOnCall(i int, result1 *timestamp }{result1, result2} } -func (fake *ChaincodeStub) InvokeChaincode(arg1 string, arg2 [][]byte, arg3 string) peer.Response { +func (fake *ChaincodeStub) InvokeChaincode(arg1 string, arg2 [][]byte, arg3 string) *peer.Response { var arg2Copy [][]byte if arg2 != nil { arg2Copy = make([][]byte, len(arg2)) @@ -2390,7 +2390,7 @@ func (fake *ChaincodeStub) InvokeChaincodeCallCount() int { return len(fake.invokeChaincodeArgsForCall) } -func (fake *ChaincodeStub) InvokeChaincodeCalls(stub func(string, [][]byte, string) peer.Response) { +func (fake *ChaincodeStub) InvokeChaincodeCalls(stub func(string, [][]byte, string) *peer.Response) { fake.invokeChaincodeMutex.Lock() defer fake.invokeChaincodeMutex.Unlock() fake.InvokeChaincodeStub = stub @@ -2403,26 +2403,26 @@ func (fake *ChaincodeStub) InvokeChaincodeArgsForCall(i int) (string, [][]byte, return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3 } -func (fake *ChaincodeStub) InvokeChaincodeReturns(result1 peer.Response) { +func (fake *ChaincodeStub) InvokeChaincodeReturns(result1 *peer.Response) { fake.invokeChaincodeMutex.Lock() defer fake.invokeChaincodeMutex.Unlock() fake.InvokeChaincodeStub = nil fake.invokeChaincodeReturns = struct { - result1 peer.Response + result1 *peer.Response }{result1} } -func (fake *ChaincodeStub) InvokeChaincodeReturnsOnCall(i int, result1 peer.Response) { +func (fake *ChaincodeStub) InvokeChaincodeReturnsOnCall(i int, result1 *peer.Response) { fake.invokeChaincodeMutex.Lock() defer fake.invokeChaincodeMutex.Unlock() fake.InvokeChaincodeStub = nil if fake.invokeChaincodeReturnsOnCall == nil { fake.invokeChaincodeReturnsOnCall = make(map[int]struct { - result1 peer.Response + result1 *peer.Response }) } fake.invokeChaincodeReturnsOnCall[i] = struct { - result1 peer.Response + result1 *peer.Response }{result1} } diff --git a/core/scc/inprocstream.go b/core/scc/inprocstream.go index fcf581bb87b..454519356c7 100644 --- a/core/scc/inprocstream.go +++ b/core/scc/inprocstream.go @@ -11,7 +11,7 @@ import ( "fmt" "sync" - pb "github.com/hyperledger/fabric-protos-go/peer" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" ) // SendPanicFailure diff --git a/core/scc/inprocstream_test.go b/core/scc/inprocstream_test.go index bb3ee5a05b9..9db4a40f97d 100644 --- a/core/scc/inprocstream_test.go +++ b/core/scc/inprocstream_test.go @@ -9,7 +9,7 @@ package scc import ( "testing" - pb "github.com/hyperledger/fabric-protos-go/peer" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/stretchr/testify/require" ) diff --git a/core/scc/lscc/deployedcc_infoprovider.go b/core/scc/lscc/deployedcc_infoprovider.go index f3f29bbc3e5..e1adfbaf525 100644 --- a/core/scc/lscc/deployedcc_infoprovider.go +++ b/core/scc/lscc/deployedcc_infoprovider.go @@ -7,15 +7,15 @@ SPDX-License-Identifier: Apache-2.0 package lscc import ( - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/ledger/queryresult" - "github.com/hyperledger/fabric-protos-go/ledger/rwset/kvrwset" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/queryresult" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset/kvrwset" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/core/common/ccprovider" "github.com/hyperledger/fabric/core/common/privdata" "github.com/hyperledger/fabric/core/ledger" "github.com/hyperledger/fabric/core/ledger/kvledger/txmgmt/rwsetutil" "github.com/pkg/errors" + "google.golang.org/protobuf/proto" ) const ( diff --git a/core/scc/lscc/deployedcc_infoprovider_test.go b/core/scc/lscc/deployedcc_infoprovider_test.go index e1158879d8d..5d529ba84b9 100644 --- a/core/scc/lscc/deployedcc_infoprovider_test.go +++ b/core/scc/lscc/deployedcc_infoprovider_test.go @@ -10,15 +10,15 @@ import ( "fmt" "testing" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/ledger/queryresult" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/queryresult" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/core/common/ccprovider" "github.com/hyperledger/fabric/core/common/privdata" "github.com/hyperledger/fabric/core/ledger" "github.com/hyperledger/fabric/core/scc/lscc" "github.com/hyperledger/fabric/core/scc/lscc/mock" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) func TestNamespaces(t *testing.T) { @@ -141,7 +141,7 @@ func TestCollectionInfo(t *testing.T) { ccPkg2, err := ccInfoProvdier.AllCollectionsConfigPkg("", "cc2", mockQE) require.NoError(t, err) - require.Equal(t, prepapreCollectionConfigPkg([]string{"cc2_coll1", "cc2_coll2"}), ccPkg2) + require.True(t, proto.Equal(prepapreCollectionConfigPkg([]string{"cc2_coll1", "cc2_coll2"}), ccPkg2)) } func prepareMockQE(t *testing.T, deployedChaincodes []*ledger.DeployedChaincodeInfo) *mock.QueryExecutor { diff --git a/core/scc/lscc/lscc.go b/core/scc/lscc/lscc.go index 464740463e2..249a0c125c7 100644 --- a/core/scc/lscc/lscc.go +++ b/core/scc/lscc/lscc.go @@ -12,11 +12,10 @@ import ( "regexp" "sync" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-chaincode-go/shim" + "github.com/hyperledger/fabric-chaincode-go/v2/shim" "github.com/hyperledger/fabric-lib-go/bccsp" "github.com/hyperledger/fabric-lib-go/common/flogging" - pb "github.com/hyperledger/fabric-protos-go/peer" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/channelconfig" "github.com/hyperledger/fabric/common/policies" "github.com/hyperledger/fabric/core/aclmgmt" @@ -30,6 +29,7 @@ import ( "github.com/hyperledger/fabric/core/scc" "github.com/hyperledger/fabric/msp" "github.com/pkg/errors" + "google.golang.org/protobuf/proto" ) var ( @@ -323,6 +323,9 @@ func (lscc *SCC) ValidationInfo(channelID, chaincodeName string, qe ledger.Simpl // create the chaincode on the given chain func (lscc *SCC) putChaincodeData(stub shim.ChaincodeStubInterface, cd *ccprovider.ChaincodeData) error { + if cd == nil { + return errors.New("proto: Marshal called with nil") + } cdbytes, err := proto.Marshal(cd) if err != nil { return err diff --git a/core/scc/lscc/lscc_noncc_test.go b/core/scc/lscc/lscc_noncc_test.go index 369d89dc08a..1ead5161f56 100644 --- a/core/scc/lscc/lscc_noncc_test.go +++ b/core/scc/lscc/lscc_noncc_test.go @@ -9,7 +9,6 @@ package lscc_test import ( "errors" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/bccsp/sw" "github.com/hyperledger/fabric/core/chaincode/lifecycle" "github.com/hyperledger/fabric/core/common/ccprovider" @@ -17,6 +16,7 @@ import ( "github.com/hyperledger/fabric/core/scc/lscc/mock" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" + "google.golang.org/protobuf/proto" ) var _ = Describe("LSCC", func() { diff --git a/core/scc/lscc/lscc_suite_test.go b/core/scc/lscc/lscc_suite_test.go index eba06dea0d2..7c44759521f 100644 --- a/core/scc/lscc/lscc_suite_test.go +++ b/core/scc/lscc/lscc_suite_test.go @@ -9,7 +9,7 @@ package lscc_test import ( "testing" - "github.com/hyperledger/fabric-chaincode-go/shim" + "github.com/hyperledger/fabric-chaincode-go/v2/shim" commonledger "github.com/hyperledger/fabric/common/ledger" "github.com/hyperledger/fabric/core/common/ccprovider" "github.com/hyperledger/fabric/core/common/sysccprovider" diff --git a/core/scc/lscc/mock/cc_package.go b/core/scc/lscc/mock/cc_package.go index 6a77dfd7d8f..44590232096 100644 --- a/core/scc/lscc/mock/cc_package.go +++ b/core/scc/lscc/mock/cc_package.go @@ -4,9 +4,9 @@ package mock import ( "sync" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/core/common/ccprovider" + "google.golang.org/protobuf/proto" ) type CCPackage struct { diff --git a/core/scc/lscc/mock/chaincode_stub.go b/core/scc/lscc/mock/chaincode_stub.go index 2676fa0ddd7..ecba339e08f 100644 --- a/core/scc/lscc/mock/chaincode_stub.go +++ b/core/scc/lscc/mock/chaincode_stub.go @@ -4,8 +4,8 @@ package mock import ( "sync" - "github.com/hyperledger/fabric-chaincode-go/shim" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-chaincode-go/v2/shim" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "google.golang.org/protobuf/types/known/timestamppb" ) @@ -400,7 +400,7 @@ type ChaincodeStub struct { result1 *timestamppb.Timestamp result2 error } - InvokeChaincodeStub func(string, [][]byte, string) peer.Response + InvokeChaincodeStub func(string, [][]byte, string) *peer.Response invokeChaincodeMutex sync.RWMutex invokeChaincodeArgsForCall []struct { arg1 string @@ -408,10 +408,10 @@ type ChaincodeStub struct { arg3 string } invokeChaincodeReturns struct { - result1 peer.Response + result1 *peer.Response } invokeChaincodeReturnsOnCall map[int]struct { - result1 peer.Response + result1 *peer.Response } PurgePrivateDataStub func(string, string) error purgePrivateDataMutex sync.RWMutex @@ -2358,7 +2358,7 @@ func (fake *ChaincodeStub) GetTxTimestampReturnsOnCall(i int, result1 *timestamp }{result1, result2} } -func (fake *ChaincodeStub) InvokeChaincode(arg1 string, arg2 [][]byte, arg3 string) peer.Response { +func (fake *ChaincodeStub) InvokeChaincode(arg1 string, arg2 [][]byte, arg3 string) *peer.Response { var arg2Copy [][]byte if arg2 != nil { arg2Copy = make([][]byte, len(arg2)) @@ -2390,7 +2390,7 @@ func (fake *ChaincodeStub) InvokeChaincodeCallCount() int { return len(fake.invokeChaincodeArgsForCall) } -func (fake *ChaincodeStub) InvokeChaincodeCalls(stub func(string, [][]byte, string) peer.Response) { +func (fake *ChaincodeStub) InvokeChaincodeCalls(stub func(string, [][]byte, string) *peer.Response) { fake.invokeChaincodeMutex.Lock() defer fake.invokeChaincodeMutex.Unlock() fake.InvokeChaincodeStub = stub @@ -2403,26 +2403,26 @@ func (fake *ChaincodeStub) InvokeChaincodeArgsForCall(i int) (string, [][]byte, return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3 } -func (fake *ChaincodeStub) InvokeChaincodeReturns(result1 peer.Response) { +func (fake *ChaincodeStub) InvokeChaincodeReturns(result1 *peer.Response) { fake.invokeChaincodeMutex.Lock() defer fake.invokeChaincodeMutex.Unlock() fake.InvokeChaincodeStub = nil fake.invokeChaincodeReturns = struct { - result1 peer.Response + result1 *peer.Response }{result1} } -func (fake *ChaincodeStub) InvokeChaincodeReturnsOnCall(i int, result1 peer.Response) { +func (fake *ChaincodeStub) InvokeChaincodeReturnsOnCall(i int, result1 *peer.Response) { fake.invokeChaincodeMutex.Lock() defer fake.invokeChaincodeMutex.Unlock() fake.InvokeChaincodeStub = nil if fake.invokeChaincodeReturnsOnCall == nil { fake.invokeChaincodeReturnsOnCall = make(map[int]struct { - result1 peer.Response + result1 *peer.Response }) } fake.invokeChaincodeReturnsOnCall[i] = struct { - result1 peer.Response + result1 *peer.Response }{result1} } diff --git a/core/scc/lscc/mock/fs_support.go b/core/scc/lscc/mock/fs_support.go index d52fb127641..51cf873513d 100644 --- a/core/scc/lscc/mock/fs_support.go +++ b/core/scc/lscc/mock/fs_support.go @@ -4,7 +4,7 @@ package mock import ( "sync" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/core/common/ccprovider" ) diff --git a/core/scc/lscc/mock/state_query_iterator.go b/core/scc/lscc/mock/state_query_iterator.go index 5e24a0b5dd6..30c60dbcd61 100644 --- a/core/scc/lscc/mock/state_query_iterator.go +++ b/core/scc/lscc/mock/state_query_iterator.go @@ -4,7 +4,7 @@ package mock import ( "sync" - "github.com/hyperledger/fabric-protos-go/ledger/queryresult" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/queryresult" ) type StateQueryIterator struct { diff --git a/core/scc/lscc/support.go b/core/scc/lscc/support.go index f7e509839c6..1463d34c91b 100644 --- a/core/scc/lscc/support.go +++ b/core/scc/lscc/support.go @@ -7,7 +7,7 @@ SPDX-License-Identifier: Apache-2.0 package lscc import ( - pb "github.com/hyperledger/fabric-protos-go/peer" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/cauthdsl" "github.com/hyperledger/fabric/common/policydsl" "github.com/hyperledger/fabric/core/common/ccprovider" diff --git a/core/scc/mock/chaincode.go b/core/scc/mock/chaincode.go deleted file mode 100644 index 6ad21a10949..00000000000 --- a/core/scc/mock/chaincode.go +++ /dev/null @@ -1,182 +0,0 @@ -// Code generated by counterfeiter. DO NOT EDIT. -package mock - -import ( - "sync" - - "github.com/hyperledger/fabric-chaincode-go/shim" - "github.com/hyperledger/fabric-protos-go/peer" -) - -type Chaincode struct { - InitStub func(shim.ChaincodeStubInterface) peer.Response - initMutex sync.RWMutex - initArgsForCall []struct { - arg1 shim.ChaincodeStubInterface - } - initReturns struct { - result1 peer.Response - } - initReturnsOnCall map[int]struct { - result1 peer.Response - } - InvokeStub func(shim.ChaincodeStubInterface) peer.Response - invokeMutex sync.RWMutex - invokeArgsForCall []struct { - arg1 shim.ChaincodeStubInterface - } - invokeReturns struct { - result1 peer.Response - } - invokeReturnsOnCall map[int]struct { - result1 peer.Response - } - invocations map[string][][]interface{} - invocationsMutex sync.RWMutex -} - -func (fake *Chaincode) Init(arg1 shim.ChaincodeStubInterface) peer.Response { - fake.initMutex.Lock() - ret, specificReturn := fake.initReturnsOnCall[len(fake.initArgsForCall)] - fake.initArgsForCall = append(fake.initArgsForCall, struct { - arg1 shim.ChaincodeStubInterface - }{arg1}) - fake.recordInvocation("Init", []interface{}{arg1}) - fake.initMutex.Unlock() - if fake.InitStub != nil { - return fake.InitStub(arg1) - } - if specificReturn { - return ret.result1 - } - fakeReturns := fake.initReturns - return fakeReturns.result1 -} - -func (fake *Chaincode) InitCallCount() int { - fake.initMutex.RLock() - defer fake.initMutex.RUnlock() - return len(fake.initArgsForCall) -} - -func (fake *Chaincode) InitCalls(stub func(shim.ChaincodeStubInterface) peer.Response) { - fake.initMutex.Lock() - defer fake.initMutex.Unlock() - fake.InitStub = stub -} - -func (fake *Chaincode) InitArgsForCall(i int) shim.ChaincodeStubInterface { - fake.initMutex.RLock() - defer fake.initMutex.RUnlock() - argsForCall := fake.initArgsForCall[i] - return argsForCall.arg1 -} - -func (fake *Chaincode) InitReturns(result1 peer.Response) { - fake.initMutex.Lock() - defer fake.initMutex.Unlock() - fake.InitStub = nil - fake.initReturns = struct { - result1 peer.Response - }{result1} -} - -func (fake *Chaincode) InitReturnsOnCall(i int, result1 peer.Response) { - fake.initMutex.Lock() - defer fake.initMutex.Unlock() - fake.InitStub = nil - if fake.initReturnsOnCall == nil { - fake.initReturnsOnCall = make(map[int]struct { - result1 peer.Response - }) - } - fake.initReturnsOnCall[i] = struct { - result1 peer.Response - }{result1} -} - -func (fake *Chaincode) Invoke(arg1 shim.ChaincodeStubInterface) peer.Response { - fake.invokeMutex.Lock() - ret, specificReturn := fake.invokeReturnsOnCall[len(fake.invokeArgsForCall)] - fake.invokeArgsForCall = append(fake.invokeArgsForCall, struct { - arg1 shim.ChaincodeStubInterface - }{arg1}) - fake.recordInvocation("Invoke", []interface{}{arg1}) - fake.invokeMutex.Unlock() - if fake.InvokeStub != nil { - return fake.InvokeStub(arg1) - } - if specificReturn { - return ret.result1 - } - fakeReturns := fake.invokeReturns - return fakeReturns.result1 -} - -func (fake *Chaincode) InvokeCallCount() int { - fake.invokeMutex.RLock() - defer fake.invokeMutex.RUnlock() - return len(fake.invokeArgsForCall) -} - -func (fake *Chaincode) InvokeCalls(stub func(shim.ChaincodeStubInterface) peer.Response) { - fake.invokeMutex.Lock() - defer fake.invokeMutex.Unlock() - fake.InvokeStub = stub -} - -func (fake *Chaincode) InvokeArgsForCall(i int) shim.ChaincodeStubInterface { - fake.invokeMutex.RLock() - defer fake.invokeMutex.RUnlock() - argsForCall := fake.invokeArgsForCall[i] - return argsForCall.arg1 -} - -func (fake *Chaincode) InvokeReturns(result1 peer.Response) { - fake.invokeMutex.Lock() - defer fake.invokeMutex.Unlock() - fake.InvokeStub = nil - fake.invokeReturns = struct { - result1 peer.Response - }{result1} -} - -func (fake *Chaincode) InvokeReturnsOnCall(i int, result1 peer.Response) { - fake.invokeMutex.Lock() - defer fake.invokeMutex.Unlock() - fake.InvokeStub = nil - if fake.invokeReturnsOnCall == nil { - fake.invokeReturnsOnCall = make(map[int]struct { - result1 peer.Response - }) - } - fake.invokeReturnsOnCall[i] = struct { - result1 peer.Response - }{result1} -} - -func (fake *Chaincode) Invocations() map[string][][]interface{} { - fake.invocationsMutex.RLock() - defer fake.invocationsMutex.RUnlock() - fake.initMutex.RLock() - defer fake.initMutex.RUnlock() - fake.invokeMutex.RLock() - defer fake.invokeMutex.RUnlock() - copiedInvocations := map[string][][]interface{}{} - for key, value := range fake.invocations { - copiedInvocations[key] = value - } - return copiedInvocations -} - -func (fake *Chaincode) recordInvocation(key string, args []interface{}) { - fake.invocationsMutex.Lock() - defer fake.invocationsMutex.Unlock() - if fake.invocations == nil { - fake.invocations = map[string][][]interface{}{} - } - if fake.invocations[key] == nil { - fake.invocations[key] = [][]interface{}{} - } - fake.invocations[key] = append(fake.invocations[key], args) -} diff --git a/core/scc/mock/selfdescribingsyscc.go b/core/scc/mock/selfdescribingsyscc.go index ef93d9bbbd6..122983b4feb 100644 --- a/core/scc/mock/selfdescribingsyscc.go +++ b/core/scc/mock/selfdescribingsyscc.go @@ -4,7 +4,7 @@ package mock import ( "sync" - "github.com/hyperledger/fabric-chaincode-go/shim" + "github.com/hyperledger/fabric-chaincode-go/v2/shim" ) type SelfDescribingSysCC struct { diff --git a/core/scc/qscc/mocks/chaincode_stub.go b/core/scc/qscc/mocks/chaincode_stub.go index 2676fa0ddd7..06248e33550 100644 --- a/core/scc/qscc/mocks/chaincode_stub.go +++ b/core/scc/qscc/mocks/chaincode_stub.go @@ -1,11 +1,11 @@ // Code generated by counterfeiter. DO NOT EDIT. -package mock +package mocks import ( "sync" - "github.com/hyperledger/fabric-chaincode-go/shim" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-chaincode-go/v2/shim" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "google.golang.org/protobuf/types/known/timestamppb" ) @@ -400,7 +400,7 @@ type ChaincodeStub struct { result1 *timestamppb.Timestamp result2 error } - InvokeChaincodeStub func(string, [][]byte, string) peer.Response + InvokeChaincodeStub func(string, [][]byte, string) *peer.Response invokeChaincodeMutex sync.RWMutex invokeChaincodeArgsForCall []struct { arg1 string @@ -408,10 +408,10 @@ type ChaincodeStub struct { arg3 string } invokeChaincodeReturns struct { - result1 peer.Response + result1 *peer.Response } invokeChaincodeReturnsOnCall map[int]struct { - result1 peer.Response + result1 *peer.Response } PurgePrivateDataStub func(string, string) error purgePrivateDataMutex sync.RWMutex @@ -2358,7 +2358,7 @@ func (fake *ChaincodeStub) GetTxTimestampReturnsOnCall(i int, result1 *timestamp }{result1, result2} } -func (fake *ChaincodeStub) InvokeChaincode(arg1 string, arg2 [][]byte, arg3 string) peer.Response { +func (fake *ChaincodeStub) InvokeChaincode(arg1 string, arg2 [][]byte, arg3 string) *peer.Response { var arg2Copy [][]byte if arg2 != nil { arg2Copy = make([][]byte, len(arg2)) @@ -2390,7 +2390,7 @@ func (fake *ChaincodeStub) InvokeChaincodeCallCount() int { return len(fake.invokeChaincodeArgsForCall) } -func (fake *ChaincodeStub) InvokeChaincodeCalls(stub func(string, [][]byte, string) peer.Response) { +func (fake *ChaincodeStub) InvokeChaincodeCalls(stub func(string, [][]byte, string) *peer.Response) { fake.invokeChaincodeMutex.Lock() defer fake.invokeChaincodeMutex.Unlock() fake.InvokeChaincodeStub = stub @@ -2403,26 +2403,26 @@ func (fake *ChaincodeStub) InvokeChaincodeArgsForCall(i int) (string, [][]byte, return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3 } -func (fake *ChaincodeStub) InvokeChaincodeReturns(result1 peer.Response) { +func (fake *ChaincodeStub) InvokeChaincodeReturns(result1 *peer.Response) { fake.invokeChaincodeMutex.Lock() defer fake.invokeChaincodeMutex.Unlock() fake.InvokeChaincodeStub = nil fake.invokeChaincodeReturns = struct { - result1 peer.Response + result1 *peer.Response }{result1} } -func (fake *ChaincodeStub) InvokeChaincodeReturnsOnCall(i int, result1 peer.Response) { +func (fake *ChaincodeStub) InvokeChaincodeReturnsOnCall(i int, result1 *peer.Response) { fake.invokeChaincodeMutex.Lock() defer fake.invokeChaincodeMutex.Unlock() fake.InvokeChaincodeStub = nil if fake.invokeChaincodeReturnsOnCall == nil { fake.invokeChaincodeReturnsOnCall = make(map[int]struct { - result1 peer.Response + result1 *peer.Response }) } fake.invokeChaincodeReturnsOnCall[i] = struct { - result1 peer.Response + result1 *peer.Response }{result1} } diff --git a/core/scc/qscc/query.go b/core/scc/qscc/query.go index 03ab47ef51f..90aeb4e0594 100644 --- a/core/scc/qscc/query.go +++ b/core/scc/qscc/query.go @@ -10,9 +10,9 @@ import ( "fmt" "strconv" - "github.com/hyperledger/fabric-chaincode-go/shim" + "github.com/hyperledger/fabric-chaincode-go/v2/shim" "github.com/hyperledger/fabric-lib-go/common/flogging" - pb "github.com/hyperledger/fabric-protos-go/peer" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/core/aclmgmt" "github.com/hyperledger/fabric/core/ledger" "github.com/hyperledger/fabric/protoutil" @@ -59,7 +59,7 @@ const ( // Init is called once per chain when the chain is created. // This allows the chaincode to initialize any variables on the ledger prior // to any transaction execution on the chain. -func (e *LedgerQuerier) Init(stub shim.ChaincodeStubInterface) pb.Response { +func (e *LedgerQuerier) Init(stub shim.ChaincodeStubInterface) *pb.Response { qscclogger.Info("Init QSCC") return shim.Success(nil) @@ -72,7 +72,7 @@ func (e *LedgerQuerier) Init(stub shim.ChaincodeStubInterface) pb.Response { // # GetBlockByNumber: Return the block specified by block number in args[2] // # GetBlockByHash: Return the block specified by block hash in args[2] // # GetTransactionByID: Return the transaction specified by ID in args[2] -func (e *LedgerQuerier) Invoke(stub shim.ChaincodeStubInterface) pb.Response { +func (e *LedgerQuerier) Invoke(stub shim.ChaincodeStubInterface) *pb.Response { args := stub.GetArgs() if len(args) < 2 { @@ -129,7 +129,7 @@ func (e *LedgerQuerier) Invoke(stub shim.ChaincodeStubInterface) pb.Response { return shim.Error(fmt.Sprintf("Requested function %s not found.", fname)) } -func getTransactionByID(vledger ledger.PeerLedger, tid []byte) pb.Response { +func getTransactionByID(vledger ledger.PeerLedger, tid []byte) *pb.Response { if tid == nil { return shim.Error("Transaction ID must not be nil.") } @@ -147,7 +147,7 @@ func getTransactionByID(vledger ledger.PeerLedger, tid []byte) pb.Response { return shim.Success(bytes) } -func getBlockByNumber(vledger ledger.PeerLedger, number []byte) pb.Response { +func getBlockByNumber(vledger ledger.PeerLedger, number []byte) *pb.Response { if number == nil { return shim.Error("Block number must not be nil.") } @@ -172,7 +172,7 @@ func getBlockByNumber(vledger ledger.PeerLedger, number []byte) pb.Response { return shim.Success(bytes) } -func getBlockByHash(vledger ledger.PeerLedger, hash []byte) pb.Response { +func getBlockByHash(vledger ledger.PeerLedger, hash []byte) *pb.Response { if hash == nil { return shim.Error("Block hash must not be nil.") } @@ -193,7 +193,7 @@ func getBlockByHash(vledger ledger.PeerLedger, hash []byte) pb.Response { return shim.Success(bytes) } -func getChainInfo(vledger ledger.PeerLedger) pb.Response { +func getChainInfo(vledger ledger.PeerLedger) *pb.Response { binfo, err := vledger.GetBlockchainInfo() if err != nil { return shim.Error(fmt.Sprintf("Failed to get block info with error %s", err)) @@ -206,7 +206,7 @@ func getChainInfo(vledger ledger.PeerLedger) pb.Response { return shim.Success(bytes) } -func getBlockByTxID(vledger ledger.PeerLedger, rawTxID []byte) pb.Response { +func getBlockByTxID(vledger ledger.PeerLedger, rawTxID []byte) *pb.Response { txID := string(rawTxID) block, err := vledger.GetBlockByTxID(txID) if err != nil { diff --git a/core/scc/qscc/query_test.go b/core/scc/qscc/query_test.go index 1fe6840594a..da4f4d2ed43 100644 --- a/core/scc/qscc/query_test.go +++ b/core/scc/qscc/query_test.go @@ -11,10 +11,10 @@ import ( "os" "testing" - "github.com/hyperledger/fabric-chaincode-go/shim" + "github.com/hyperledger/fabric-chaincode-go/v2/shim" "github.com/hyperledger/fabric-lib-go/bccsp/sw" - "github.com/hyperledger/fabric-protos-go/common" - peer2 "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + peer2 "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/ledger/testutil" "github.com/hyperledger/fabric/common/util" "github.com/hyperledger/fabric/core/aclmgmt/mocks" diff --git a/core/scc/scc.go b/core/scc/scc.go index 7bfac8d7242..fa8a6e62d40 100644 --- a/core/scc/scc.go +++ b/core/scc/scc.go @@ -7,9 +7,9 @@ SPDX-License-Identifier: Apache-2.0 package scc import ( - "github.com/hyperledger/fabric-chaincode-go/shim" + "github.com/hyperledger/fabric-chaincode-go/v2/shim" "github.com/hyperledger/fabric-lib-go/common/flogging" - pb "github.com/hyperledger/fabric-protos-go/peer" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/core/container/ccintf" ) diff --git a/core/scc/test-plugin/plugin.go b/core/scc/test-plugin/plugin.go index f1c8e6e88fc..0edffd6470f 100644 --- a/core/scc/test-plugin/plugin.go +++ b/core/scc/test-plugin/plugin.go @@ -7,8 +7,8 @@ SPDX-License-Identifier: Apache-2.0 package main import ( - "github.com/hyperledger/fabric-chaincode-go/shim" - pb "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-chaincode-go/v2/shim" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" ) // New returns an implementation of the chaincode interface @@ -19,12 +19,12 @@ func New() shim.Chaincode { type scc struct{} // Init implements the chaincode shim interface -func (s *scc) Init(stub shim.ChaincodeStubInterface) pb.Response { +func (s *scc) Init(stub shim.ChaincodeStubInterface) *pb.Response { return shim.Success(nil) } // Invoke implements the chaincode shim interface -func (s *scc) Invoke(stub shim.ChaincodeStubInterface) pb.Response { +func (s *scc) Invoke(stub shim.ChaincodeStubInterface) *pb.Response { return shim.Success(nil) } diff --git a/core/transientstore/delete_store_test.go b/core/transientstore/delete_store_test.go index 1832110d919..87638bd0396 100644 --- a/core/transientstore/delete_store_test.go +++ b/core/transientstore/delete_store_test.go @@ -11,9 +11,9 @@ import ( "strings" "testing" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric/common/ledger/util/leveldbhelper" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) func TestSystemNamespaceIsEmptyString(t *testing.T) { diff --git a/core/transientstore/persistence.pb.go b/core/transientstore/persistence.pb.go index 68234d69550..2b0abfefeda 100644 --- a/core/transientstore/persistence.pb.go +++ b/core/transientstore/persistence.pb.go @@ -1,81 +1,151 @@ +// +//Copyright IBM Corp. All Rights Reserved. +// +//SPDX-License-Identifier: Apache-2.0 + // Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.34.2 +// protoc v5.27.3 // source: persistence.proto package transientstore import ( - fmt "fmt" - math "math" + reflect "reflect" + sync "sync" - proto "github.com/golang/protobuf/proto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) type PendingDeleteStorageList struct { - List []string `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + List []string `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` } -func (m *PendingDeleteStorageList) Reset() { *m = PendingDeleteStorageList{} } -func (m *PendingDeleteStorageList) String() string { return proto.CompactTextString(m) } -func (*PendingDeleteStorageList) ProtoMessage() {} -func (*PendingDeleteStorageList) Descriptor() ([]byte, []int) { - return fileDescriptor_a374ca4de69122a4, []int{0} +func (x *PendingDeleteStorageList) Reset() { + *x = PendingDeleteStorageList{} + if protoimpl.UnsafeEnabled { + mi := &file_persistence_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *PendingDeleteStorageList) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_PendingDeleteStorageList.Unmarshal(m, b) +func (x *PendingDeleteStorageList) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *PendingDeleteStorageList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_PendingDeleteStorageList.Marshal(b, m, deterministic) + +func (*PendingDeleteStorageList) ProtoMessage() {} + +func (x *PendingDeleteStorageList) ProtoReflect() protoreflect.Message { + mi := &file_persistence_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -func (m *PendingDeleteStorageList) XXX_Merge(src proto.Message) { - xxx_messageInfo_PendingDeleteStorageList.Merge(m, src) + +// Deprecated: Use PendingDeleteStorageList.ProtoReflect.Descriptor instead. +func (*PendingDeleteStorageList) Descriptor() ([]byte, []int) { + return file_persistence_proto_rawDescGZIP(), []int{0} } -func (m *PendingDeleteStorageList) XXX_Size() int { - return xxx_messageInfo_PendingDeleteStorageList.Size(m) + +func (x *PendingDeleteStorageList) GetList() []string { + if x != nil { + return x.List + } + return nil } -func (m *PendingDeleteStorageList) XXX_DiscardUnknown() { - xxx_messageInfo_PendingDeleteStorageList.DiscardUnknown(m) + +var File_persistence_proto protoreflect.FileDescriptor + +var file_persistence_proto_rawDesc = []byte{ + 0x0a, 0x11, 0x70, 0x65, 0x72, 0x73, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x63, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x74, + 0x6f, 0x72, 0x65, 0x22, 0x2e, 0x0a, 0x18, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x44, 0x65, + 0x6c, 0x65, 0x74, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x12, + 0x12, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x6c, + 0x69, 0x73, 0x74, 0x42, 0x33, 0x5a, 0x31, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2f, 0x66, 0x61, + 0x62, 0x72, 0x69, 0x63, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x69, + 0x65, 0x6e, 0x74, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } -var xxx_messageInfo_PendingDeleteStorageList proto.InternalMessageInfo +var ( + file_persistence_proto_rawDescOnce sync.Once + file_persistence_proto_rawDescData = file_persistence_proto_rawDesc +) -func (m *PendingDeleteStorageList) GetList() []string { - if m != nil { - return m.List - } - return nil +func file_persistence_proto_rawDescGZIP() []byte { + file_persistence_proto_rawDescOnce.Do(func() { + file_persistence_proto_rawDescData = protoimpl.X.CompressGZIP(file_persistence_proto_rawDescData) + }) + return file_persistence_proto_rawDescData } -func init() { - proto.RegisterType((*PendingDeleteStorageList)(nil), "transientstore.PendingDeleteStorageList") +var file_persistence_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_persistence_proto_goTypes = []any{ + (*PendingDeleteStorageList)(nil), // 0: transientstore.PendingDeleteStorageList +} +var file_persistence_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name } -func init() { proto.RegisterFile("persistence.proto", fileDescriptor_a374ca4de69122a4) } - -var fileDescriptor_a374ca4de69122a4 = []byte{ - // 145 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0xcd, 0xb1, 0x0a, 0xc2, 0x30, - 0x10, 0x06, 0x60, 0x44, 0x11, 0xec, 0x20, 0xd8, 0xa9, 0xa3, 0x38, 0x39, 0x35, 0x48, 0xdf, 0x40, - 0x1c, 0x1d, 0x44, 0x37, 0xb7, 0x24, 0xfd, 0x4d, 0x0f, 0x62, 0x2e, 0xdc, 0x9d, 0x83, 0x6f, 0x2f, - 0x74, 0x73, 0xfb, 0xb6, 0xaf, 0xd9, 0x55, 0x88, 0x92, 0x9a, 0x2f, 0x11, 0x7d, 0x15, 0x36, 0x6e, - 0xb7, 0x26, 0xbe, 0x28, 0xa1, 0x98, 0x1a, 0x0b, 0x0e, 0x7d, 0xd3, 0xdd, 0x50, 0x46, 0x2a, 0xe9, - 0x82, 0x0c, 0xc3, 0xc3, 0x58, 0x7c, 0xc2, 0x95, 0xd4, 0xda, 0xb6, 0x59, 0x65, 0x52, 0xeb, 0x16, - 0xfb, 0xe5, 0x71, 0x73, 0x9f, 0x7d, 0x1e, 0x9e, 0xa7, 0x44, 0x36, 0x7d, 0x42, 0x1f, 0xf9, 0xed, - 0xa6, 0x6f, 0x85, 0x64, 0x8c, 0x09, 0xe2, 0x5e, 0x3e, 0x08, 0x45, 0x17, 0x59, 0xe0, 0xfe, 0x93, - 0xb0, 0x9e, 0xef, 0xe1, 0x17, 0x00, 0x00, 0xff, 0xff, 0xa1, 0xb1, 0xe2, 0x32, 0x90, 0x00, 0x00, - 0x00, +func init() { file_persistence_proto_init() } +func file_persistence_proto_init() { + if File_persistence_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_persistence_proto_msgTypes[0].Exporter = func(v any, i int) any { + switch v := v.(*PendingDeleteStorageList); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_persistence_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_persistence_proto_goTypes, + DependencyIndexes: file_persistence_proto_depIdxs, + MessageInfos: file_persistence_proto_msgTypes, + }.Build() + File_persistence_proto = out.File + file_persistence_proto_rawDesc = nil + file_persistence_proto_goTypes = nil + file_persistence_proto_depIdxs = nil } diff --git a/core/transientstore/store.go b/core/transientstore/store.go index fcb635ffdee..34de6260e99 100644 --- a/core/transientstore/store.go +++ b/core/transientstore/store.go @@ -9,15 +9,15 @@ package transientstore import ( "path/filepath" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/common/flogging" - "github.com/hyperledger/fabric-protos-go/ledger/rwset" - "github.com/hyperledger/fabric-protos-go/transientstore" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset" + "github.com/hyperledger/fabric-protos-go-apiv2/transientstore" "github.com/hyperledger/fabric/common/ledger/util/leveldbhelper" "github.com/hyperledger/fabric/common/util" "github.com/hyperledger/fabric/core/ledger" "github.com/pkg/errors" "github.com/syndtr/goleveldb/leveldb/iterator" + "google.golang.org/protobuf/proto" ) var logger = flogging.MustGetLogger("transientstore") @@ -33,9 +33,9 @@ var ( transientStorageLockName = "transientStoreFileLock" ) -////////////////////////////////////////////// +// //////////////////////////////////////////// // Interfaces and data types -///////////////////////////////////////////// +// /////////////////////////////////////////// // StoreProvider provides an instance of a TransientStore type StoreProvider interface { @@ -59,9 +59,9 @@ type EndorserPvtSimulationResults struct { PvtSimulationResultsWithConfig *transientstore.TxPvtReadWriteSetWithConfigInfo } -////////////////////////////////////////////// +// //////////////////////////////////////////// // Implementation -///////////////////////////////////////////// +// /////////////////////////////////////////// // storeProvider encapsulates a leveldb provider which is used to store // private write sets of simulated transactions, and implements TransientStoreProvider diff --git a/core/transientstore/store_helper.go b/core/transientstore/store_helper.go index 6f8b435eb28..838d58cb5ef 100644 --- a/core/transientstore/store_helper.go +++ b/core/transientstore/store_helper.go @@ -10,8 +10,8 @@ import ( "bytes" "errors" - "github.com/hyperledger/fabric-protos-go/ledger/rwset" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/ledger/util" "github.com/hyperledger/fabric/core/ledger" ) diff --git a/core/transientstore/store_test.go b/core/transientstore/store_test.go index 6555c6556a5..d2ea0264013 100644 --- a/core/transientstore/store_test.go +++ b/core/transientstore/store_test.go @@ -13,16 +13,16 @@ import ( "sort" "testing" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/ledger/rwset" - "github.com/hyperledger/fabric-protos-go/peer" - "github.com/hyperledger/fabric-protos-go/transientstore" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/transientstore" "github.com/hyperledger/fabric/common/policydsl" commonutil "github.com/hyperledger/fabric/common/util" "github.com/hyperledger/fabric/core/ledger" "github.com/hyperledger/fabric/core/ledger/util" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) func TestMain(m *testing.M) { diff --git a/core/tx/endorser/endorsertx_suite_test.go b/core/tx/endorser/endorsertx_suite_test.go index 06dbfe49f03..1b80c798f6a 100644 --- a/core/tx/endorser/endorsertx_suite_test.go +++ b/core/tx/endorser/endorsertx_suite_test.go @@ -10,8 +10,8 @@ import ( "math/rand" "testing" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" txpkg "github.com/hyperledger/fabric/pkg/tx" "github.com/hyperledger/fabric/protoutil" . "github.com/onsi/ginkgo/v2" diff --git a/core/tx/endorser/parser.go b/core/tx/endorser/parser.go index 17a9be0af40..85daecfcfd4 100644 --- a/core/tx/endorser/parser.go +++ b/core/tx/endorser/parser.go @@ -9,7 +9,7 @@ package endorsertx import ( "regexp" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/pkg/tx" "github.com/hyperledger/fabric/protoutil" diff --git a/core/tx/endorser/parser_test.go b/core/tx/endorser/parser_test.go index 8f1402c9c51..76b46101dba 100644 --- a/core/tx/endorser/parser_test.go +++ b/core/tx/endorser/parser_test.go @@ -9,8 +9,8 @@ package endorsertx_test import ( "encoding/hex" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/configtx" endorsertx "github.com/hyperledger/fabric/core/tx/endorser" "github.com/hyperledger/fabric/pkg/tx" diff --git a/core/tx/processor_factory.go b/core/tx/processor_factory.go index 959059bd777..b07ed857d47 100644 --- a/core/tx/processor_factory.go +++ b/core/tx/processor_factory.go @@ -9,8 +9,8 @@ package tx import ( "github.com/pkg/errors" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/pkg/tx" "github.com/hyperledger/fabric/protoutil" ) diff --git a/core/tx/processor_factory_test.go b/core/tx/processor_factory_test.go index 1eaf5250739..799915ea656 100644 --- a/core/tx/processor_factory_test.go +++ b/core/tx/processor_factory_test.go @@ -9,8 +9,8 @@ package tx_test import ( "testing" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/core/tx" pkgtx "github.com/hyperledger/fabric/pkg/tx" "github.com/hyperledger/fabric/protoutil" diff --git a/discovery/api.go b/discovery/api.go index 214ef17711a..61d04f45e26 100644 --- a/discovery/api.go +++ b/discovery/api.go @@ -7,8 +7,8 @@ SPDX-License-Identifier: Apache-2.0 package discovery import ( - discprotos "github.com/hyperledger/fabric-protos-go/discovery" - "github.com/hyperledger/fabric-protos-go/peer" + discprotos "github.com/hyperledger/fabric-protos-go-apiv2/discovery" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/gossip/api" "github.com/hyperledger/fabric/gossip/common" "github.com/hyperledger/fabric/gossip/discovery" diff --git a/discovery/client/api.go b/discovery/client/api.go index 595a8c3578d..83c225ff79d 100644 --- a/discovery/client/api.go +++ b/discovery/client/api.go @@ -7,8 +7,8 @@ SPDX-License-Identifier: Apache-2.0 package discovery import ( - "github.com/hyperledger/fabric-protos-go/discovery" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/discovery" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/gossip/protoext" "github.com/pkg/errors" "google.golang.org/grpc" diff --git a/discovery/client/client.go b/discovery/client/client.go index 03bd1c08c13..182dcf652b3 100644 --- a/discovery/client/client.go +++ b/discovery/client/client.go @@ -13,13 +13,13 @@ import ( "math/rand" "time" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/discovery" - "github.com/hyperledger/fabric-protos-go/msp" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/discovery" + "github.com/hyperledger/fabric-protos-go-apiv2/msp" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/discovery/protoext" gprotoext "github.com/hyperledger/fabric/gossip/protoext" "github.com/pkg/errors" + "google.golang.org/protobuf/proto" ) var configTypes = []protoext.QueryType{ diff --git a/discovery/client/client_test.go b/discovery/client/client_test.go index 229ca07fda6..9450a3979be 100644 --- a/discovery/client/client_test.go +++ b/discovery/client/client_test.go @@ -18,12 +18,11 @@ import ( "testing" "time" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/discovery" - "github.com/hyperledger/fabric-protos-go/gossip" - "github.com/hyperledger/fabric-protos-go/msp" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/discovery" + "github.com/hyperledger/fabric-protos-go-apiv2/gossip" + "github.com/hyperledger/fabric-protos-go-apiv2/msp" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/chaincode" "github.com/hyperledger/fabric/common/policies" "github.com/hyperledger/fabric/common/policydsl" @@ -42,6 +41,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/credentials" "google.golang.org/grpc/credentials/insecure" + "google.golang.org/protobuf/proto" ) const ( diff --git a/discovery/client/selection_test.go b/discovery/client/selection_test.go index c420387c82b..5d413537b25 100644 --- a/discovery/client/selection_test.go +++ b/discovery/client/selection_test.go @@ -9,10 +9,10 @@ package discovery import ( "testing" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/gossip" + "github.com/hyperledger/fabric-protos-go-apiv2/gossip" "github.com/hyperledger/fabric/gossip/protoext" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) func TestShuffle(t *testing.T) { diff --git a/discovery/cmd/config_test.go b/discovery/cmd/config_test.go index c08198b3512..5d29ae19e0a 100644 --- a/discovery/cmd/config_test.go +++ b/discovery/cmd/config_test.go @@ -11,8 +11,8 @@ import ( "fmt" "testing" - discprotos "github.com/hyperledger/fabric-protos-go/discovery" - "github.com/hyperledger/fabric-protos-go/msp" + discprotos "github.com/hyperledger/fabric-protos-go-apiv2/discovery" + "github.com/hyperledger/fabric-protos-go-apiv2/msp" "github.com/hyperledger/fabric/cmd/common" discovery "github.com/hyperledger/fabric/discovery/cmd" "github.com/hyperledger/fabric/discovery/cmd/mocks" diff --git a/discovery/cmd/endorsers.go b/discovery/cmd/endorsers.go index e47c838ce23..5f3c3e14a25 100644 --- a/discovery/cmd/endorsers.go +++ b/discovery/cmd/endorsers.go @@ -13,16 +13,15 @@ import ( "reflect" "strings" - "github.com/hyperledger/fabric-protos-go/peer" - - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/discovery" - "github.com/hyperledger/fabric-protos-go/gossip" - "github.com/hyperledger/fabric-protos-go/msp" + "github.com/hyperledger/fabric-protos-go-apiv2/discovery" + "github.com/hyperledger/fabric-protos-go-apiv2/gossip" + "github.com/hyperledger/fabric-protos-go-apiv2/msp" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/cmd/common" discoveryclient "github.com/hyperledger/fabric/discovery/client" "github.com/hyperledger/fabric/gossip/protoext" "github.com/pkg/errors" + "google.golang.org/protobuf/proto" ) // NewEndorsersCmd creates a new EndorsersCmd diff --git a/discovery/cmd/endorsers_test.go b/discovery/cmd/endorsers_test.go index a133595bae0..e7c67d29d11 100644 --- a/discovery/cmd/endorsers_test.go +++ b/discovery/cmd/endorsers_test.go @@ -10,8 +10,8 @@ import ( "bytes" "testing" - discprotos "github.com/hyperledger/fabric-protos-go/discovery" - "github.com/hyperledger/fabric-protos-go/msp" + discprotos "github.com/hyperledger/fabric-protos-go-apiv2/discovery" + "github.com/hyperledger/fabric-protos-go-apiv2/msp" "github.com/hyperledger/fabric/cmd/common" . "github.com/hyperledger/fabric/discovery/client" discovery "github.com/hyperledger/fabric/discovery/cmd" diff --git a/discovery/cmd/mocks/channel_response.go b/discovery/cmd/mocks/channel_response.go index 678fede0f84..0276fc955fb 100644 --- a/discovery/cmd/mocks/channel_response.go +++ b/discovery/cmd/mocks/channel_response.go @@ -5,11 +5,11 @@ package mocks import ( client "github.com/hyperledger/fabric/discovery/client" - discovery "github.com/hyperledger/fabric-protos-go/discovery" + discovery "github.com/hyperledger/fabric-protos-go-apiv2/discovery" mock "github.com/stretchr/testify/mock" - peer "github.com/hyperledger/fabric-protos-go/peer" + peer "github.com/hyperledger/fabric-protos-go-apiv2/peer" ) // ChannelResponse is an autogenerated mock type for the ChannelResponse type diff --git a/discovery/cmd/mocks/service_response.go b/discovery/cmd/mocks/service_response.go index 9873a7cbd62..ceacc6ba90c 100644 --- a/discovery/cmd/mocks/service_response.go +++ b/discovery/cmd/mocks/service_response.go @@ -3,7 +3,7 @@ package mocks import ( - fabric_protos_godiscovery "github.com/hyperledger/fabric-protos-go/discovery" + fabric_protos_godiscovery "github.com/hyperledger/fabric-protos-go-apiv2/discovery" discovery "github.com/hyperledger/fabric/discovery/client" mock "github.com/stretchr/testify/mock" diff --git a/discovery/cmd/peers.go b/discovery/cmd/peers.go index 533df926b0a..e7128e156e0 100644 --- a/discovery/cmd/peers.go +++ b/discovery/cmd/peers.go @@ -11,11 +11,11 @@ import ( "fmt" "io" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/msp" + "github.com/hyperledger/fabric-protos-go-apiv2/msp" "github.com/hyperledger/fabric/cmd/common" discovery "github.com/hyperledger/fabric/discovery/client" "github.com/pkg/errors" + "google.golang.org/protobuf/proto" ) // NewPeerCmd creates a new PeerCmd with the given Stub and ResponseParser diff --git a/discovery/cmd/peers_test.go b/discovery/cmd/peers_test.go index 3e3a6add5c9..670aeded4bb 100644 --- a/discovery/cmd/peers_test.go +++ b/discovery/cmd/peers_test.go @@ -12,8 +12,8 @@ import ( "testing" "time" - "github.com/hyperledger/fabric-protos-go/gossip" - "github.com/hyperledger/fabric-protos-go/msp" + "github.com/hyperledger/fabric-protos-go-apiv2/gossip" + "github.com/hyperledger/fabric-protos-go-apiv2/msp" "github.com/hyperledger/fabric/cmd/common" . "github.com/hyperledger/fabric/discovery/client" discovery "github.com/hyperledger/fabric/discovery/cmd" diff --git a/discovery/cmd/stub.go b/discovery/cmd/stub.go index 4d8016b4e47..a5de7344bcd 100644 --- a/discovery/cmd/stub.go +++ b/discovery/cmd/stub.go @@ -9,7 +9,7 @@ package discovery import ( "context" - "github.com/hyperledger/fabric-protos-go/discovery" + "github.com/hyperledger/fabric-protos-go-apiv2/discovery" "github.com/hyperledger/fabric/cmd/common" "github.com/hyperledger/fabric/cmd/common/comm" "github.com/hyperledger/fabric/cmd/common/signer" diff --git a/discovery/endorsement/collection.go b/discovery/endorsement/collection.go index dad37e81c00..69b16b99f0f 100644 --- a/discovery/endorsement/collection.go +++ b/discovery/endorsement/collection.go @@ -7,7 +7,7 @@ SPDX-License-Identifier: Apache-2.0 package endorsement import ( - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/policies" "github.com/hyperledger/fabric/gossip/api" "github.com/pkg/errors" diff --git a/discovery/endorsement/collection_test.go b/discovery/endorsement/collection_test.go index 410c42d58b9..52fddafa143 100644 --- a/discovery/endorsement/collection_test.go +++ b/discovery/endorsement/collection_test.go @@ -11,9 +11,9 @@ import ( "fmt" "testing" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/msp" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/msp" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/policies" "github.com/hyperledger/fabric/gossip/api" gcommon "github.com/hyperledger/fabric/gossip/common" diff --git a/discovery/endorsement/endorsement.go b/discovery/endorsement/endorsement.go index 81eef6e8652..5ee4d9a06c3 100644 --- a/discovery/endorsement/endorsement.go +++ b/discovery/endorsement/endorsement.go @@ -9,11 +9,10 @@ package endorsement import ( "fmt" - "github.com/hyperledger/fabric-protos-go/peer" - "github.com/hyperledger/fabric-lib-go/common/flogging" - "github.com/hyperledger/fabric-protos-go/discovery" - "github.com/hyperledger/fabric-protos-go/msp" + "github.com/hyperledger/fabric-protos-go-apiv2/discovery" + "github.com/hyperledger/fabric-protos-go-apiv2/msp" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/chaincode" "github.com/hyperledger/fabric/common/graph" "github.com/hyperledger/fabric/common/policies" diff --git a/discovery/endorsement/endorsement_test.go b/discovery/endorsement/endorsement_test.go index f3fa470f29d..333012f2c31 100644 --- a/discovery/endorsement/endorsement_test.go +++ b/discovery/endorsement/endorsement_test.go @@ -10,17 +10,15 @@ import ( "fmt" "testing" - common2 "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric/common/policydsl" - - "github.com/golang/protobuf/proto" - discoveryprotos "github.com/hyperledger/fabric-protos-go/discovery" - "github.com/hyperledger/fabric-protos-go/gossip" - "github.com/hyperledger/fabric-protos-go/msp" - "github.com/hyperledger/fabric-protos-go/peer" + common2 "github.com/hyperledger/fabric-protos-go-apiv2/common" + discoveryprotos "github.com/hyperledger/fabric-protos-go-apiv2/discovery" + "github.com/hyperledger/fabric-protos-go-apiv2/gossip" + "github.com/hyperledger/fabric-protos-go-apiv2/msp" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/chaincode" "github.com/hyperledger/fabric/common/policies" "github.com/hyperledger/fabric/common/policies/inquire" + "github.com/hyperledger/fabric/common/policydsl" "github.com/hyperledger/fabric/gossip/api" "github.com/hyperledger/fabric/gossip/common" "github.com/hyperledger/fabric/gossip/discovery" @@ -28,6 +26,7 @@ import ( "github.com/pkg/errors" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) var pkiID2MSPID = map[string]string{ diff --git a/discovery/protoext/querytype.go b/discovery/protoext/querytype.go index 703b186bb2c..d89e5e79c13 100644 --- a/discovery/protoext/querytype.go +++ b/discovery/protoext/querytype.go @@ -6,7 +6,7 @@ SPDX-License-Identifier: Apache-2.0 package protoext -import "github.com/hyperledger/fabric-protos-go/discovery" +import "github.com/hyperledger/fabric-protos-go-apiv2/discovery" // QueryType defines the types of service discovery requests type QueryType uint8 diff --git a/discovery/protoext/querytype_test.go b/discovery/protoext/querytype_test.go index 21062219514..1122629ee9d 100644 --- a/discovery/protoext/querytype_test.go +++ b/discovery/protoext/querytype_test.go @@ -10,7 +10,7 @@ import ( "strconv" "testing" - "github.com/hyperledger/fabric-protos-go/discovery" + "github.com/hyperledger/fabric-protos-go-apiv2/discovery" "github.com/hyperledger/fabric/discovery/protoext" "github.com/stretchr/testify/require" ) diff --git a/discovery/protoext/response.go b/discovery/protoext/response.go index ab68b6d1d73..fd194f791ff 100644 --- a/discovery/protoext/response.go +++ b/discovery/protoext/response.go @@ -6,7 +6,7 @@ SPDX-License-Identifier: Apache-2.0 package protoext -import "github.com/hyperledger/fabric-protos-go/discovery" +import "github.com/hyperledger/fabric-protos-go-apiv2/discovery" // ResponseConfigAt returns the ConfigResult at a given index in the Response, // or an Error if present. diff --git a/discovery/protoext/signedreq.go b/discovery/protoext/signedreq.go index 3719400a593..c42010834d1 100644 --- a/discovery/protoext/signedreq.go +++ b/discovery/protoext/signedreq.go @@ -7,8 +7,8 @@ SPDX-License-Identifier: Apache-2.0 package protoext import ( - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/discovery" + "github.com/hyperledger/fabric-protos-go-apiv2/discovery" + "google.golang.org/protobuf/proto" ) // SignedRequestToRequest deserializes this SignedRequest's payload diff --git a/discovery/protoext/signedreq_test.go b/discovery/protoext/signedreq_test.go index d02c7b11744..df49e09838e 100644 --- a/discovery/protoext/signedreq_test.go +++ b/discovery/protoext/signedreq_test.go @@ -9,10 +9,10 @@ package protoext_test import ( "testing" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/discovery" + "github.com/hyperledger/fabric-protos-go-apiv2/discovery" "github.com/hyperledger/fabric/discovery/protoext" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) func TestSignedRequestToRequest(t *testing.T) { diff --git a/discovery/service.go b/discovery/service.go index e89ede78cb6..3cff6f95c34 100644 --- a/discovery/service.go +++ b/discovery/service.go @@ -13,7 +13,7 @@ import ( "fmt" "github.com/hyperledger/fabric-lib-go/common/flogging" - "github.com/hyperledger/fabric-protos-go/discovery" + "github.com/hyperledger/fabric-protos-go-apiv2/discovery" "github.com/hyperledger/fabric/common/util" "github.com/hyperledger/fabric/discovery/protoext" common2 "github.com/hyperledger/fabric/gossip/common" diff --git a/discovery/service_test.go b/discovery/service_test.go index df5caeeff89..97026dbe7e4 100644 --- a/discovery/service_test.go +++ b/discovery/service_test.go @@ -13,11 +13,9 @@ import ( "reflect" "testing" - "github.com/hyperledger/fabric-protos-go/peer" - - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/discovery" - "github.com/hyperledger/fabric-protos-go/gossip" + "github.com/hyperledger/fabric-protos-go-apiv2/discovery" + "github.com/hyperledger/fabric-protos-go-apiv2/gossip" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/gossip/api" gcommon "github.com/hyperledger/fabric/gossip/common" gdisc "github.com/hyperledger/fabric/gossip/discovery" @@ -25,6 +23,7 @@ import ( "github.com/hyperledger/fabric/protoutil" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) func TestConfig(t *testing.T) { diff --git a/discovery/support/acl/support.go b/discovery/support/acl/support.go index aeb9b72dc91..8d592599b57 100644 --- a/discovery/support/acl/support.go +++ b/discovery/support/acl/support.go @@ -8,7 +8,7 @@ package acl import ( "github.com/hyperledger/fabric-lib-go/common/flogging" - "github.com/hyperledger/fabric-protos-go/msp" + "github.com/hyperledger/fabric-protos-go-apiv2/msp" "github.com/hyperledger/fabric/common/channelconfig" "github.com/hyperledger/fabric/common/policies" "github.com/hyperledger/fabric/protoutil" diff --git a/discovery/support/chaincode/support.go b/discovery/support/chaincode/support.go index e9d5bbe6afe..c4596e1bfb8 100644 --- a/discovery/support/chaincode/support.go +++ b/discovery/support/chaincode/support.go @@ -7,12 +7,12 @@ SPDX-License-Identifier: Apache-2.0 package chaincode import ( - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/common/flogging" - common2 "github.com/hyperledger/fabric-protos-go/common" + common2 "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/common/chaincode" "github.com/hyperledger/fabric/common/policies" "github.com/hyperledger/fabric/common/policies/inquire" + "google.golang.org/protobuf/proto" ) var logger = flogging.MustGetLogger("discovery.DiscoverySupport") diff --git a/discovery/support/chaincode/support_test.go b/discovery/support/chaincode/support_test.go index 5057da4e213..b144febc7d3 100644 --- a/discovery/support/chaincode/support_test.go +++ b/discovery/support/chaincode/support_test.go @@ -9,8 +9,8 @@ package chaincode import ( "testing" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/msp" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/msp" "github.com/hyperledger/fabric/common/chaincode" "github.com/hyperledger/fabric/common/policies" "github.com/hyperledger/fabric/common/policies/inquire" diff --git a/discovery/support/config/support.go b/discovery/support/config/support.go index 4bd654272c9..63bb88858f3 100644 --- a/discovery/support/config/support.go +++ b/discovery/support/config/support.go @@ -11,14 +11,14 @@ import ( "net" "strconv" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/common/flogging" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/discovery" - "github.com/hyperledger/fabric-protos-go/msp" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/discovery" + "github.com/hyperledger/fabric-protos-go-apiv2/msp" "github.com/hyperledger/fabric/common/channelconfig" mspconstants "github.com/hyperledger/fabric/msp" "github.com/pkg/errors" + "google.golang.org/protobuf/proto" ) var logger = flogging.MustGetLogger("discovery.config") diff --git a/discovery/support/config/support_test.go b/discovery/support/config/support_test.go index f805a8878cc..e3daa5be5e9 100644 --- a/discovery/support/config/support_test.go +++ b/discovery/support/config/support_test.go @@ -15,10 +15,9 @@ import ( "path/filepath" "testing" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/discovery" - "github.com/hyperledger/fabric-protos-go/msp" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/discovery" + "github.com/hyperledger/fabric-protos-go-apiv2/msp" "github.com/hyperledger/fabric/common/channelconfig" "github.com/hyperledger/fabric/common/configtx/test" "github.com/hyperledger/fabric/discovery/support/config" @@ -28,6 +27,7 @@ import ( "github.com/hyperledger/fabric/protoutil" "github.com/onsi/gomega/gexec" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) func TestMSPIDMapping(t *testing.T) { diff --git a/discovery/support/gossip/support.go b/discovery/support/gossip/support.go index 474e9002552..272e8d7a7af 100644 --- a/discovery/support/gossip/support.go +++ b/discovery/support/gossip/support.go @@ -7,7 +7,7 @@ SPDX-License-Identifier: Apache-2.0 package gossip import ( - "github.com/hyperledger/fabric-protos-go/gossip" + "github.com/hyperledger/fabric-protos-go-apiv2/gossip" "github.com/hyperledger/fabric/gossip/api" "github.com/hyperledger/fabric/gossip/common" "github.com/hyperledger/fabric/gossip/discovery" diff --git a/discovery/support/gossip/support_test.go b/discovery/support/gossip/support_test.go index f468fdcfeb4..fcd6a02e11f 100644 --- a/discovery/support/gossip/support_test.go +++ b/discovery/support/gossip/support_test.go @@ -9,7 +9,7 @@ package gossip_test import ( "testing" - gp "github.com/hyperledger/fabric-protos-go/gossip" + gp "github.com/hyperledger/fabric-protos-go-apiv2/gossip" "github.com/hyperledger/fabric/discovery/support/gossip" "github.com/hyperledger/fabric/discovery/support/gossip/mocks" "github.com/hyperledger/fabric/gossip/common" diff --git a/discovery/support/mocks/config_getter.go b/discovery/support/mocks/config_getter.go index 46771ab0672..6fe8528c229 100644 --- a/discovery/support/mocks/config_getter.go +++ b/discovery/support/mocks/config_getter.go @@ -4,7 +4,7 @@ package mocks import ( "sync" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" ) type ConfigGetter struct { diff --git a/discovery/support/mocks/configtx_validator.go b/discovery/support/mocks/configtx_validator.go index 0045a576d42..7c046d09965 100644 --- a/discovery/support/mocks/configtx_validator.go +++ b/discovery/support/mocks/configtx_validator.go @@ -4,7 +4,7 @@ package mocks import ( "sync" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" ) type ConfigtxValidator struct { diff --git a/discovery/support/mocks/identity.go b/discovery/support/mocks/identity.go index fb80b020655..d1afd4b62aa 100644 --- a/discovery/support/mocks/identity.go +++ b/discovery/support/mocks/identity.go @@ -5,7 +5,7 @@ import ( "sync" "time" - mspa "github.com/hyperledger/fabric-protos-go/msp" + mspa "github.com/hyperledger/fabric-protos-go-apiv2/msp" "github.com/hyperledger/fabric/msp" ) diff --git a/discovery/support/mocks/msp_manager.go b/discovery/support/mocks/msp_manager.go index d5fb264d028..532b4446957 100644 --- a/discovery/support/mocks/msp_manager.go +++ b/discovery/support/mocks/msp_manager.go @@ -4,7 +4,7 @@ package mocks import ( "sync" - mspa "github.com/hyperledger/fabric-protos-go/msp" + mspa "github.com/hyperledger/fabric-protos-go-apiv2/msp" "github.com/hyperledger/fabric/msp" ) diff --git a/discovery/test/integration_test.go b/discovery/test/integration_test.go index d65785cb615..c546e29c165 100644 --- a/discovery/test/integration_test.go +++ b/discovery/test/integration_test.go @@ -22,14 +22,13 @@ import ( "testing" "time" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/bccsp/sw" bccsp "github.com/hyperledger/fabric-lib-go/bccsp/utils" - "github.com/hyperledger/fabric-protos-go/common" - discprotos "github.com/hyperledger/fabric-protos-go/discovery" - "github.com/hyperledger/fabric-protos-go/gossip" - msprotos "github.com/hyperledger/fabric-protos-go/msp" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + discprotos "github.com/hyperledger/fabric-protos-go-apiv2/discovery" + "github.com/hyperledger/fabric-protos-go-apiv2/gossip" + msprotos "github.com/hyperledger/fabric-protos-go-apiv2/msp" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/cauthdsl" "github.com/hyperledger/fabric/common/configtx" "github.com/hyperledger/fabric/common/crypto/tlsgen" @@ -60,6 +59,7 @@ import ( "github.com/pkg/errors" "github.com/stretchr/testify/require" "google.golang.org/grpc" + "google.golang.org/protobuf/proto" ) var ( @@ -215,7 +215,7 @@ func TestGreenPath(t *testing.T) { // Ensure MSP Configs are exactly as they appear in the config block for mspID, mspConfig := range conf.Msps { expectedConfig := service.sup.mspConfigs[mspID] - require.Equal(t, expectedConfig, mspConfig) + require.True(t, proto.Equal(expectedConfig, mspConfig)) } // Ensure orderer endpoints are as they appear in the config block for mspID, endpoints := range conf.Orderers { diff --git a/go.mod b/go.mod index e9869d383a9..e18f16b2317 100644 --- a/go.mod +++ b/go.mod @@ -12,15 +12,14 @@ require ( github.com/davecgh/go-spew v1.1.1 github.com/fsouza/go-dockerclient v1.10.0 github.com/go-kit/kit v0.10.0 - github.com/golang/protobuf v1.5.4 github.com/gorilla/handlers v1.5.1 github.com/gorilla/mux v1.8.0 github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 github.com/hyperledger-labs/SmartBFT v0.0.0-20240616160543-3f61a410b8c1 - github.com/hyperledger/fabric-chaincode-go v0.0.0-20220713164125-8f0791c989d7 + github.com/hyperledger/fabric-chaincode-go/v2 v2.0.0 github.com/hyperledger/fabric-config v0.2.1 github.com/hyperledger/fabric-lib-go v1.1.3-0.20240523144151-25edd1eaf5f5 - github.com/hyperledger/fabric-protos-go v0.3.2 + github.com/hyperledger/fabric-protos-go-apiv2 v0.3.3 github.com/kr/pretty v0.3.1 github.com/miekg/pkcs11 v1.1.1 github.com/mitchellh/mapstructure v1.5.0 @@ -38,7 +37,7 @@ require ( go.etcd.io/etcd/raft/v3 v3.5.14 go.etcd.io/etcd/server/v3 v3.5.14 go.uber.org/zap v1.27.0 - google.golang.org/grpc v1.65.0 + google.golang.org/grpc v1.66.1 google.golang.org/protobuf v1.34.2 gopkg.in/alecthomas/kingpin.v2 v2.2.6 gopkg.in/yaml.v2 v2.4.0 @@ -47,19 +46,19 @@ require ( require ( github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 // indirect github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect - github.com/IBM/idemix/bccsp/schemes/aries v0.0.0-20231003085036-c4470b87b2d6 // indirect - github.com/IBM/idemix/bccsp/schemes/weak-bb v0.0.0-20240125153755-b3fcea5c7863 // indirect - github.com/IBM/idemix/bccsp/types v0.0.0-20240125153755-b3fcea5c7863 // indirect + github.com/IBM/idemix/bccsp/schemes/aries v0.0.0-20240612072411-114d281b442d // indirect + github.com/IBM/idemix/bccsp/schemes/weak-bb v0.0.0-20240612072411-114d281b442d // indirect + github.com/IBM/idemix/bccsp/types v0.0.0-20240612072411-114d281b442d // indirect github.com/IBM/mathlib v0.0.3-0.20231011094432-44ee0eb539da // indirect github.com/Microsoft/go-winio v0.6.1 // indirect github.com/Microsoft/hcsshim v0.11.4 // indirect - github.com/ale-linux/aries-framework-go/component/kmscrypto v0.0.0-20230817163708-4b3de6d91874 // indirect + github.com/ale-linux/aries-framework-go/component/kmscrypto v0.0.0-20231023164747-f3f972769504 // indirect github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 // indirect - github.com/alecthomas/units v0.0.0-20210912230133-d1bdfacee922 // indirect + github.com/alecthomas/units v0.0.0-20240626203959-61d1e3462e30 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/consensys/bavard v0.1.13 // indirect - github.com/consensys/gnark-crypto v0.12.1 // indirect + github.com/consensys/gnark-crypto v0.13.0 // indirect github.com/containerd/containerd v1.6.26 // indirect github.com/containerd/log v0.1.0 // indirect github.com/docker/docker v26.1.5+incompatible // indirect @@ -73,9 +72,10 @@ require ( github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect github.com/go-viper/mapstructure/v2 v2.0.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect + github.com/golang/protobuf v1.5.4 // indirect github.com/golang/snappy v0.0.4 // indirect github.com/google/go-cmp v0.6.0 // indirect - github.com/google/pprof v0.0.0-20240130152714-0ed6a68c8d9e // indirect + github.com/google/pprof v0.0.0-20240424215950-a892ee059fd6 // indirect github.com/hyperledger/fabric-amcl v0.0.0-20230602173724-9e02669dceb2 // indirect github.com/inconshreveable/mousetrap v1.0.0 // indirect github.com/kilic/bls12-381 v0.1.0 // indirect @@ -108,14 +108,19 @@ require ( github.com/sykesm/zap-logfmt v0.0.4 // indirect go.etcd.io/etcd/pkg/v3 v3.5.14 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/crypto v0.24.0 // indirect - golang.org/x/mod v0.17.0 // indirect - golang.org/x/net v0.25.0 // indirect + golang.org/x/crypto v0.26.0 // indirect + golang.org/x/mod v0.20.0 // indirect + golang.org/x/net v0.28.0 // indirect golang.org/x/sync v0.8.0 // indirect - golang.org/x/sys v0.23.0 // indirect + golang.org/x/sys v0.24.0 // indirect golang.org/x/text v0.17.0 // indirect - golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 // indirect + golang.org/x/tools v0.24.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect rsc.io/tmplfunc v0.0.3 // indirect ) + +replace ( + github.com/IBM/idemix => github.com/pfi79/idemix v0.0.0-20240827084656-d5b1e15270f4 + github.com/hyperledger/fabric-config => github.com/pfi79/fabric-config v0.0.0-20240822061539-a86c531d2c81 +) diff --git a/go.sum b/go.sum index f53c4743474..6efc6eebb73 100644 --- a/go.sum +++ b/go.sum @@ -39,14 +39,12 @@ github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOEl github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/IBM/idemix v0.0.2-0.20231011101252-a4feda90f3f7 h1:ybW6FaLCYGEF03XaR+WJP7bq7XqeBI4Pfj8uKipQT+A= -github.com/IBM/idemix v0.0.2-0.20231011101252-a4feda90f3f7/go.mod h1:74yugcANjVAC9e8wHDmTDvlKHxnPj0V1L9VJ84ExaoU= -github.com/IBM/idemix/bccsp/schemes/aries v0.0.0-20231003085036-c4470b87b2d6 h1:vz8YaZRqrdZMeTi6EuIQmtWqhmb6eUxKIJQsWQYAIG8= -github.com/IBM/idemix/bccsp/schemes/aries v0.0.0-20231003085036-c4470b87b2d6/go.mod h1:sgvrLB3a8mKr4rX+aBDXPCZBgSRRmQxlyxA3jmwq/Sk= -github.com/IBM/idemix/bccsp/schemes/weak-bb v0.0.0-20240125153755-b3fcea5c7863 h1:MbN+oydksffkBPsVrPihd6njO/5Byz0f7YEjfOiZIso= -github.com/IBM/idemix/bccsp/schemes/weak-bb v0.0.0-20240125153755-b3fcea5c7863/go.mod h1:FC0vVgNI6bv8GH0VTwjup+arwJ8Tau1iEhroWZ1oPwU= -github.com/IBM/idemix/bccsp/types v0.0.0-20240125153755-b3fcea5c7863 h1:peYMhPdcC6xSO/3CQ1m2D8QYSNkyMcEbK5HCRIb8Bwk= -github.com/IBM/idemix/bccsp/types v0.0.0-20240125153755-b3fcea5c7863/go.mod h1:IMIJ8WcUpBmV4gcOO/BYKuFYpdXCPYZjpNhFSUlO9b8= +github.com/IBM/idemix/bccsp/schemes/aries v0.0.0-20240612072411-114d281b442d h1:8w1yWLIk0VzLTHFE1O8GwCaXs5hT9M7u4KsO+IwIen0= +github.com/IBM/idemix/bccsp/schemes/aries v0.0.0-20240612072411-114d281b442d/go.mod h1:vHi4fk2Im6fO0ofevbRr/EvblygatrTb1t2XlER58ik= +github.com/IBM/idemix/bccsp/schemes/weak-bb v0.0.0-20240612072411-114d281b442d h1:jIDz71083inpGWt9IPVGb0DoqyF7tQW/YH0gBLb6sKo= +github.com/IBM/idemix/bccsp/schemes/weak-bb v0.0.0-20240612072411-114d281b442d/go.mod h1:FC0vVgNI6bv8GH0VTwjup+arwJ8Tau1iEhroWZ1oPwU= +github.com/IBM/idemix/bccsp/types v0.0.0-20240612072411-114d281b442d h1:cv8IVW3eP0l3SxOLvKtPygBe4SC8+0QpwzQsJW4vtVE= +github.com/IBM/idemix/bccsp/types v0.0.0-20240612072411-114d281b442d/go.mod h1:IMIJ8WcUpBmV4gcOO/BYKuFYpdXCPYZjpNhFSUlO9b8= github.com/IBM/mathlib v0.0.3-0.20231011094432-44ee0eb539da h1:qqGozq4tF6EOVnWoTgBoJGudRKKZXSAYnEtDggzTnsw= github.com/IBM/mathlib v0.0.3-0.20231011094432-44ee0eb539da/go.mod h1:Tco9QzE3fQzjMS7nPbHDeFfydAzctStf1Pa8hsh6Hjs= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible h1:1G1pk05UrOh0NlF1oeaaix1x8XzrfjIDK47TY0Zehcw= @@ -62,19 +60,18 @@ github.com/VictoriaMetrics/fastcache v1.9.0/go.mod h1:otoTS3xu+6IzF/qByjqzjp3rTu github.com/VividCortex/gohistogram v1.0.0 h1:6+hBz+qvs0JOrrNhhmR7lFxo5sINxBCGXrdtl/UvroE= github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= -github.com/ale-linux/aries-framework-go/component/kmscrypto v0.0.0-20230817163708-4b3de6d91874 h1:O08ZCyb1f7UeyOmTeItAw7eSZOlyM0fBnrPgaYgKEiA= -github.com/ale-linux/aries-framework-go/component/kmscrypto v0.0.0-20230817163708-4b3de6d91874/go.mod h1:4sHtFlGI84SVjaSW7u1pCfC0bjijd9ZeqbKptU/Qljs= +github.com/ale-linux/aries-framework-go/component/kmscrypto v0.0.0-20231023164747-f3f972769504 h1:sQyFeDcHVHWJ3IeE437NSJjv0+J/6MvGQOJew4X+Cuw= +github.com/ale-linux/aries-framework-go/component/kmscrypto v0.0.0-20231023164747-f3f972769504/go.mod h1:z5xq4Ji1RQojJLZzKeZH5+LKCVZxgQRZpQ4xAJWi8r0= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 h1:JYp7IbQjafoB+tBA3gMyHYHrpOtNuDiK/uB5uXxq5wM= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= -github.com/alecthomas/units v0.0.0-20210912230133-d1bdfacee922 h1:8ypNbf5sd3Sm3cKJ9waOGoQv6dKAFiFty9L6NP1AqJ4= -github.com/alecthomas/units v0.0.0-20210912230133-d1bdfacee922/go.mod h1:OMCwj8VM1Kc9e19TLln2VL61YJF0x1XFtfdL4JdbSyE= +github.com/alecthomas/units v0.0.0-20240626203959-61d1e3462e30 h1:t3eaIm0rUkzbrIewtiFmMK5RXHej2XnoXNhxVsAYUfg= +github.com/alecthomas/units v0.0.0-20240626203959-61d1e3462e30/go.mod h1:fvzegU4vN3H1qMT+8wDmzjAcDONcgo2/SZ/TyfdUOFs= github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156 h1:eMwmnE/GDgah4HI848JfFxHt+iPb26b4zyfspmqY0/8= github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM= -github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= @@ -108,19 +105,14 @@ github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMn github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= -github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= github.com/cockroachdb/datadriven v1.0.2 h1:H9MtNqVoVhvd9nCBwOyDjUEdZCREqbIdCJD93PBm/jA= github.com/cockroachdb/datadriven v1.0.2/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= github.com/consensys/bavard v0.1.13 h1:oLhMLOFGTLdlda/kma4VOJazblc7IM5y5QPd2A/YjhQ= github.com/consensys/bavard v0.1.13/go.mod h1:9ItSMtA/dXMAiL7BG6bqW2m3NdSEObYWoH223nGHukI= -github.com/consensys/gnark-crypto v0.12.1 h1:lHH39WuuFgVHONRl3J0LRBtuYdQTumFSDtJF7HpyG8M= -github.com/consensys/gnark-crypto v0.12.1/go.mod h1:v2Gy7L/4ZRosZ7Ivs+9SfUDr0f5UlG+EM5t7MPHiLuY= +github.com/consensys/gnark-crypto v0.13.0 h1:VPULb/v6bbYELAPTDFINEVaMTTybV5GLxDdcjnS+4oc= +github.com/consensys/gnark-crypto v0.13.0/go.mod h1:wKqwsieaKPThcFkHe0d0zMsbHEUWFmZcG7KBCse210o= github.com/containerd/containerd v1.6.26 h1:VVfrE6ZpyisvB1fzoY8Vkiq4sy+i5oF4uk7zu03RaHs= github.com/containerd/containerd v1.6.26/go.mod h1:I4TRdsdoo5MlKob5khDJS2EPT1l1oMNaE2MBm6FrwxM= github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I= @@ -155,8 +147,6 @@ github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4s github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.9.0 h1:8xPHl4/q1VyqGIPif1F+1V3Y3lSmrq01EabUW3CoW5s= @@ -228,8 +218,6 @@ github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvq github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= @@ -247,7 +235,6 @@ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -260,12 +247,11 @@ github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20240130152714-0ed6a68c8d9e h1:E+3PBMCXn0ma79O7iCrne0iUpKtZ7rIcZvoz+jNtNtw= -github.com/google/pprof v0.0.0-20240130152714-0ed6a68c8d9e/go.mod h1:czg5+yv1E0ZGTi6S6vVK1mke0fV+FaUhNGcd6VRS9Ik= +github.com/google/pprof v0.0.0-20240424215950-a892ee059fd6 h1:k7nVchz72niMH6YLQNvHSdIE7iqsQxK1P41mySCvssg= +github.com/google/pprof v0.0.0-20240424215950-a892ee059fd6/go.mod h1:kf6iHlnVGwgKolg33glAes7Yg/8iWP8ukqeldJSO7jw= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/subcommands v1.2.0/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= @@ -282,7 +268,6 @@ github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 h1:+9834+KizmvFV7pXQGSXQTsaW github.com/grpc-ecosystem/go-grpc-middleware v1.3.0/go.mod h1:z0ButlSOZa5vEBq9m2m2hlwIgKw+rp3sdCBRoJY+30Y= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= -github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= @@ -309,15 +294,12 @@ github.com/hyperledger-labs/SmartBFT v0.0.0-20240616160543-3f61a410b8c1 h1:0a9x5 github.com/hyperledger-labs/SmartBFT v0.0.0-20240616160543-3f61a410b8c1/go.mod h1:bY4EAvtsXf132ySoNJncMUOyBcGEQL3MXVtavRNFia4= github.com/hyperledger/fabric-amcl v0.0.0-20230602173724-9e02669dceb2 h1:B1Nt8hKb//KvgGRprk0h1t4lCnwhE9/ryb1WqfZbV+M= github.com/hyperledger/fabric-amcl v0.0.0-20230602173724-9e02669dceb2/go.mod h1:X+DIyUsaTmalOpmpQfIvFZjKHQedrURQ5t4YqquX7lE= -github.com/hyperledger/fabric-chaincode-go v0.0.0-20220713164125-8f0791c989d7 h1:w0VDGxvAmu8WZEfAhLn9M4SJg5xWMFIxUokfflx1MaU= -github.com/hyperledger/fabric-chaincode-go v0.0.0-20220713164125-8f0791c989d7/go.mod h1:9HhzkKkb8qteXBbHEQ3J/FHBVJRDJAgYIPtKPIl3Dt8= -github.com/hyperledger/fabric-config v0.2.1 h1:CsReuxvi5c5NUyKKQOIVbHux32o+XtmDNceYLYjycxo= -github.com/hyperledger/fabric-config v0.2.1/go.mod h1:1ZfjDrsuMoM4IPKezQgTByy2vXUj8bgTXaOXaGXK5O4= +github.com/hyperledger/fabric-chaincode-go/v2 v2.0.0 h1:IhkHfrl5X/fVnmB6pWeCYCdIJRi9bxj+WTnVN8DtW3c= +github.com/hyperledger/fabric-chaincode-go/v2 v2.0.0/go.mod h1:PHHaFffjw7p7n9bmCfcm7RqDqYdivNEsJdiNIKZo5Lk= github.com/hyperledger/fabric-lib-go v1.1.3-0.20240523144151-25edd1eaf5f5 h1:RPWTL5wxAb+xDOrsCU3QYZP65305F8v3PaOyzdbPVMU= github.com/hyperledger/fabric-lib-go v1.1.3-0.20240523144151-25edd1eaf5f5/go.mod h1:SHNCq8AB0VpHAmvJEtdbzabv6NNV1F48JdmDihasBjc= -github.com/hyperledger/fabric-protos-go v0.0.0-20220516090339-9685156fada6/go.mod h1:xVYTjK4DtZRBxZ2D9aE4y6AbLaPwue2o/criQyQbVD0= -github.com/hyperledger/fabric-protos-go v0.3.2 h1:mQmbHw3lyDV2+W5b0FitV/SjM4LLDjMTQJWW9taitDM= -github.com/hyperledger/fabric-protos-go v0.3.2/go.mod h1:WWnyWP40P2roPmmvxsUXSvVI/CF6vwY1K1UFidnKBys= +github.com/hyperledger/fabric-protos-go-apiv2 v0.3.3 h1:Xpd6fzG/KjAOHJsq7EQXY2l+qi/y8muxBaY7R6QWABk= +github.com/hyperledger/fabric-protos-go-apiv2 v0.3.3/go.mod h1:2pq0ui6ZWA0cC8J+eCErgnMDCS1kPOEYVY+06ZAK0qE= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= @@ -447,6 +429,10 @@ github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtP github.com/pelletier/go-toml/v2 v2.2.2 h1:aYUidT7k73Pcl9nb2gScu7NSrKCSHIDE89b3+6Wq+LM= github.com/pelletier/go-toml/v2 v2.2.2/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= +github.com/pfi79/fabric-config v0.0.0-20240822061539-a86c531d2c81 h1:slH2ss5HG+kyErLNyxYb2+i1aWIBlT4e82ESc5soaHM= +github.com/pfi79/fabric-config v0.0.0-20240822061539-a86c531d2c81/go.mod h1:kSevTn78K83Suc++JsEo7Nt1tYIPqDajW+ORz3OhWlg= +github.com/pfi79/idemix v0.0.0-20240827084656-d5b1e15270f4 h1:fiyLsceqV1o9kzCL6nH8H/SNAPSrKKiX87h6Dr0seaA= +github.com/pfi79/idemix v0.0.0-20240827084656-d5b1e15270f4/go.mod h1:00kviUdHi63UuZvTwm3K8jl0p/aEu2OeWmpWcA+XCPE= github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= @@ -491,7 +477,6 @@ github.com/prometheus/procfs v0.8.0 h1:ODq8ZFEaYeCaZOJlZZdJA2AbQR98dSHSM1KW/You5 github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= -github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= @@ -540,7 +525,6 @@ github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= @@ -581,7 +565,6 @@ go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= @@ -605,8 +588,8 @@ golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI= -golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM= +golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw= +golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -637,8 +620,8 @@ golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzB golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= -golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.20.0 h1:utOm6MM3R3dnawAiJgn0y+xvuYRsm1RKM/4giyfDgV0= +golang.org/x/mod v0.20.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -677,8 +660,8 @@ golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= -golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= +golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE= +golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -745,25 +728,23 @@ golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201101102859-da207088b7d1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220204135822-1c1b9b1eba6a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.23.0 h1:YfKFowiIMvtgl1UERQoTPPToxltDeZfbj4H7dVUCwmM= -golang.org/x/sys v0.23.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= +golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.21.0 h1:WVXCp+/EBEHOj53Rvu+7KiT/iElMrO8ACK16SMZ3jaA= -golang.org/x/term v0.21.0/go.mod h1:ooXLefLobQVslOqselCNF4SxFAaoS6KujMbsGzSDmX0= +golang.org/x/term v0.23.0 h1:F6D4vR+EHoL9/sWAWgAR1H2DcHr4PareCbAaCo1RpuU= +golang.org/x/term v0.23.0/go.mod h1:DgV24QBUrK6jhZXl+20l6UWznPlwAHm1Q1mGHtydmSk= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -819,8 +800,8 @@ golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg= -golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= +golang.org/x/tools v0.24.0 h1:J1shsA93PJUEVaUSaay7UXAyE8aimq3GW0pjlolpa24= +golang.org/x/tools v0.24.0/go.mod h1:YhNqVBIfWHdzvTLs0d8LCuMhkKUgSUKldakyV7W/WDQ= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -874,15 +855,14 @@ google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 h1:Zy9XzmMEflZ/MAaA7vNcoebnRAld7FsPW1EeBB7V0m8= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117 h1:1GBuWVLM/KMVUv1t1En5Gs+gFZCNd360GGb4sSxtrhU= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= @@ -900,11 +880,8 @@ google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKa google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= -google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.47.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= -google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc= -google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ= +google.golang.org/grpc v1.66.1 h1:hO5qAXR19+/Z44hmvIM4dQFMSYX9XcWsByfoxutBpAM= +google.golang.org/grpc v1.66.1/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -916,8 +893,6 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/alecthomas/kingpin.v2 v2.2.6 h1:jMFz6MfLP0/4fUyZle81rXUoxOBFi19VUFKVDOQfozc= @@ -938,7 +913,6 @@ gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRN gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/gossip/api/crypto.go b/gossip/api/crypto.go index 2c58c1a0291..9b7fff301b9 100644 --- a/gossip/api/crypto.go +++ b/gossip/api/crypto.go @@ -14,11 +14,11 @@ import ( "fmt" "time" - "github.com/golang/protobuf/proto" - cb "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/msp" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/msp" "github.com/hyperledger/fabric/gossip/common" "google.golang.org/grpc" + "google.golang.org/protobuf/proto" ) // MessageCryptoService is the contract between the gossip component and the diff --git a/gossip/api/crypto_test.go b/gossip/api/crypto_test.go index b597b919030..914126f2238 100644 --- a/gossip/api/crypto_test.go +++ b/gossip/api/crypto_test.go @@ -12,7 +12,7 @@ import ( "path/filepath" "testing" - "github.com/hyperledger/fabric-protos-go/msp" + "github.com/hyperledger/fabric-protos-go-apiv2/msp" "github.com/hyperledger/fabric/protoutil" "github.com/stretchr/testify/require" ) diff --git a/gossip/comm/ack_test.go b/gossip/comm/ack_test.go index 5bcbf845030..8369d2f5ea4 100644 --- a/gossip/comm/ack_test.go +++ b/gossip/comm/ack_test.go @@ -11,7 +11,7 @@ import ( "testing" "time" - proto "github.com/hyperledger/fabric-protos-go/gossip" + proto "github.com/hyperledger/fabric-protos-go-apiv2/gossip" "github.com/hyperledger/fabric/gossip/common" "github.com/hyperledger/fabric/gossip/protoext" "github.com/hyperledger/fabric/gossip/util" diff --git a/gossip/comm/comm_impl.go b/gossip/comm/comm_impl.go index 5a75901d378..6a443ae0cbe 100644 --- a/gossip/comm/comm_impl.go +++ b/gossip/comm/comm_impl.go @@ -17,7 +17,7 @@ import ( "sync/atomic" "time" - proto "github.com/hyperledger/fabric-protos-go/gossip" + proto "github.com/hyperledger/fabric-protos-go-apiv2/gossip" "github.com/hyperledger/fabric/gossip/api" "github.com/hyperledger/fabric/gossip/common" "github.com/hyperledger/fabric/gossip/identity" diff --git a/gossip/comm/comm_test.go b/gossip/comm/comm_test.go index 55e9441a1f3..46d6b6fd01f 100644 --- a/gossip/comm/comm_test.go +++ b/gossip/comm/comm_test.go @@ -26,8 +26,8 @@ import ( "github.com/hyperledger/fabric-lib-go/bccsp/factory" "github.com/hyperledger/fabric-lib-go/common/flogging" "github.com/hyperledger/fabric-lib-go/common/metrics/disabled" - cb "github.com/hyperledger/fabric-protos-go/common" - proto "github.com/hyperledger/fabric-protos-go/gossip" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + proto "github.com/hyperledger/fabric-protos-go-apiv2/gossip" "github.com/hyperledger/fabric/gossip/api" "github.com/hyperledger/fabric/gossip/api/mocks" gmocks "github.com/hyperledger/fabric/gossip/comm/mocks" diff --git a/gossip/comm/conn.go b/gossip/comm/conn.go index 125adecbe90..33fb645162f 100644 --- a/gossip/comm/conn.go +++ b/gossip/comm/conn.go @@ -10,7 +10,7 @@ import ( "context" "sync" - proto "github.com/hyperledger/fabric-protos-go/gossip" + proto "github.com/hyperledger/fabric-protos-go-apiv2/gossip" "github.com/hyperledger/fabric/gossip/common" "github.com/hyperledger/fabric/gossip/metrics" "github.com/hyperledger/fabric/gossip/protoext" diff --git a/gossip/comm/crypto_test.go b/gossip/comm/crypto_test.go index e2f7a1dd6a9..b7ab2f3a861 100644 --- a/gossip/comm/crypto_test.go +++ b/gossip/comm/crypto_test.go @@ -20,7 +20,7 @@ import ( "testing" "time" - proto "github.com/hyperledger/fabric-protos-go/gossip" + proto "github.com/hyperledger/fabric-protos-go-apiv2/gossip" "github.com/hyperledger/fabric/gossip/util" "github.com/stretchr/testify/require" "google.golang.org/grpc" diff --git a/gossip/comm/mock/mock_comm.go b/gossip/comm/mock/mock_comm.go index 6acf3bde55e..c2be320d396 100644 --- a/gossip/comm/mock/mock_comm.go +++ b/gossip/comm/mock/mock_comm.go @@ -9,7 +9,7 @@ package mock import ( "time" - proto "github.com/hyperledger/fabric-protos-go/gossip" + proto "github.com/hyperledger/fabric-protos-go-apiv2/gossip" "github.com/hyperledger/fabric/gossip/api" "github.com/hyperledger/fabric/gossip/comm" "github.com/hyperledger/fabric/gossip/common" diff --git a/gossip/comm/mock/mock_comm_test.go b/gossip/comm/mock/mock_comm_test.go index 8df23e5a559..fd646084422 100644 --- a/gossip/comm/mock/mock_comm_test.go +++ b/gossip/comm/mock/mock_comm_test.go @@ -9,7 +9,7 @@ package mock import ( "testing" - proto "github.com/hyperledger/fabric-protos-go/gossip" + proto "github.com/hyperledger/fabric-protos-go-apiv2/gossip" "github.com/hyperledger/fabric/gossip/comm" "github.com/hyperledger/fabric/gossip/common" "github.com/hyperledger/fabric/gossip/protoext" diff --git a/gossip/comm/mocks/mock_stream.go b/gossip/comm/mocks/mock_stream.go index 8217b572af3..5e3244460ac 100644 --- a/gossip/comm/mocks/mock_stream.go +++ b/gossip/comm/mocks/mock_stream.go @@ -5,7 +5,7 @@ package mocks import ( context "context" - gossip "github.com/hyperledger/fabric-protos-go/gossip" + gossip "github.com/hyperledger/fabric-protos-go-apiv2/gossip" metadata "google.golang.org/grpc/metadata" mock "github.com/stretchr/testify/mock" diff --git a/gossip/comm/msg.go b/gossip/comm/msg.go index 9bb55375111..cafff3365ef 100644 --- a/gossip/comm/msg.go +++ b/gossip/comm/msg.go @@ -7,7 +7,7 @@ SPDX-License-Identifier: Apache-2.0 package comm import ( - proto "github.com/hyperledger/fabric-protos-go/gossip" + proto "github.com/hyperledger/fabric-protos-go-apiv2/gossip" "github.com/hyperledger/fabric/gossip/protoext" "github.com/pkg/errors" ) diff --git a/gossip/discovery/discovery.go b/gossip/discovery/discovery.go index 5bfc27e876f..ee74fba1e84 100644 --- a/gossip/discovery/discovery.go +++ b/gossip/discovery/discovery.go @@ -9,10 +9,10 @@ package discovery import ( "fmt" - protolib "github.com/golang/protobuf/proto" - proto "github.com/hyperledger/fabric-protos-go/gossip" + proto "github.com/hyperledger/fabric-protos-go-apiv2/gossip" "github.com/hyperledger/fabric/gossip/common" "github.com/hyperledger/fabric/gossip/protoext" + protolib "google.golang.org/protobuf/proto" ) // CryptoService is an interface that the discovery expects to be implemented and passed on creation diff --git a/gossip/discovery/discovery_impl.go b/gossip/discovery/discovery_impl.go index 058f8f748ed..18f5556c8fc 100644 --- a/gossip/discovery/discovery_impl.go +++ b/gossip/discovery/discovery_impl.go @@ -15,7 +15,7 @@ import ( "sync" "time" - "github.com/hyperledger/fabric-protos-go/gossip" + "github.com/hyperledger/fabric-protos-go-apiv2/gossip" "github.com/hyperledger/fabric/gossip/common" "github.com/hyperledger/fabric/gossip/gossip/msgstore" "github.com/hyperledger/fabric/gossip/protoext" diff --git a/gossip/discovery/discovery_test.go b/gossip/discovery/discovery_test.go index ff990978b3b..6d8f4dbcdf4 100644 --- a/gossip/discovery/discovery_test.go +++ b/gossip/discovery/discovery_test.go @@ -21,9 +21,8 @@ import ( "testing" "time" - protoG "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/common/flogging" - proto "github.com/hyperledger/fabric-protos-go/gossip" + proto "github.com/hyperledger/fabric-protos-go-apiv2/gossip" "github.com/hyperledger/fabric/gossip/common" "github.com/hyperledger/fabric/gossip/gossip/msgstore" "github.com/hyperledger/fabric/gossip/protoext" @@ -36,6 +35,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/connectivity" "google.golang.org/grpc/credentials/insecure" + protoG "google.golang.org/protobuf/proto" ) var timeout = time.Second * time.Duration(15) diff --git a/gossip/election/adapter.go b/gossip/election/adapter.go index 7c0b41b5356..158b459855c 100644 --- a/gossip/election/adapter.go +++ b/gossip/election/adapter.go @@ -11,7 +11,7 @@ import ( "sync" "time" - proto "github.com/hyperledger/fabric-protos-go/gossip" + proto "github.com/hyperledger/fabric-protos-go-apiv2/gossip" "github.com/hyperledger/fabric/gossip/common" "github.com/hyperledger/fabric/gossip/discovery" "github.com/hyperledger/fabric/gossip/metrics" diff --git a/gossip/election/adapter_test.go b/gossip/election/adapter_test.go index c8c1bc852fb..ab0dbe217fc 100644 --- a/gossip/election/adapter_test.go +++ b/gossip/election/adapter_test.go @@ -15,7 +15,7 @@ import ( "time" "github.com/hyperledger/fabric-lib-go/common/metrics/disabled" - proto "github.com/hyperledger/fabric-protos-go/gossip" + proto "github.com/hyperledger/fabric-protos-go-apiv2/gossip" "github.com/hyperledger/fabric/gossip/common" "github.com/hyperledger/fabric/gossip/discovery" "github.com/hyperledger/fabric/gossip/metrics" diff --git a/gossip/gossip/anchor_test.go b/gossip/gossip/anchor_test.go index da2ac60340a..e53cc497af4 100644 --- a/gossip/gossip/anchor_test.go +++ b/gossip/gossip/anchor_test.go @@ -16,7 +16,7 @@ import ( "testing" "time" - proto "github.com/hyperledger/fabric-protos-go/gossip" + proto "github.com/hyperledger/fabric-protos-go-apiv2/gossip" "github.com/hyperledger/fabric/common/util" "github.com/hyperledger/fabric/gossip/api" "github.com/hyperledger/fabric/gossip/common" diff --git a/gossip/gossip/certstore.go b/gossip/gossip/certstore.go index b1257bc51ec..e7810a943dc 100644 --- a/gossip/gossip/certstore.go +++ b/gossip/gossip/certstore.go @@ -10,7 +10,7 @@ import ( "bytes" "encoding/hex" - proto "github.com/hyperledger/fabric-protos-go/gossip" + proto "github.com/hyperledger/fabric-protos-go-apiv2/gossip" "github.com/hyperledger/fabric/gossip/api" "github.com/hyperledger/fabric/gossip/common" "github.com/hyperledger/fabric/gossip/gossip/pull" diff --git a/gossip/gossip/certstore_test.go b/gossip/gossip/certstore_test.go index a8793000709..ca1c020ee1a 100644 --- a/gossip/gossip/certstore_test.go +++ b/gossip/gossip/certstore_test.go @@ -13,7 +13,7 @@ import ( "testing" "time" - proto "github.com/hyperledger/fabric-protos-go/gossip" + proto "github.com/hyperledger/fabric-protos-go-apiv2/gossip" "github.com/hyperledger/fabric/gossip/api" "github.com/hyperledger/fabric/gossip/comm" "github.com/hyperledger/fabric/gossip/common" diff --git a/gossip/gossip/channel/channel.go b/gossip/gossip/channel/channel.go index bd40ae8e0d9..75c8266e70b 100644 --- a/gossip/gossip/channel/channel.go +++ b/gossip/gossip/channel/channel.go @@ -15,7 +15,7 @@ import ( "sync/atomic" "time" - proto "github.com/hyperledger/fabric-protos-go/gossip" + proto "github.com/hyperledger/fabric-protos-go-apiv2/gossip" common_utils "github.com/hyperledger/fabric/common/util" "github.com/hyperledger/fabric/gossip/api" "github.com/hyperledger/fabric/gossip/comm" diff --git a/gossip/gossip/channel/channel_test.go b/gossip/gossip/channel/channel_test.go index fd51f9c1c4b..390abfb00ce 100644 --- a/gossip/gossip/channel/channel_test.go +++ b/gossip/gossip/channel/channel_test.go @@ -16,12 +16,11 @@ import ( "testing" "time" - gproto "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/bccsp/factory" "github.com/hyperledger/fabric-lib-go/common/flogging" "github.com/hyperledger/fabric-lib-go/common/metrics/disabled" - cb "github.com/hyperledger/fabric-protos-go/common" - proto "github.com/hyperledger/fabric-protos-go/gossip" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + proto "github.com/hyperledger/fabric-protos-go-apiv2/gossip" "github.com/hyperledger/fabric/gossip/api" "github.com/hyperledger/fabric/gossip/comm" "github.com/hyperledger/fabric/gossip/common" @@ -35,6 +34,7 @@ import ( "github.com/stretchr/testify/require" "go.uber.org/zap" "go.uber.org/zap/zapcore" + gproto "google.golang.org/protobuf/proto" ) type msgMutator func(message *proto.Envelope) diff --git a/gossip/gossip/chanstate.go b/gossip/gossip/chanstate.go index 23a48ca3e41..cb25a3df5cb 100644 --- a/gossip/gossip/chanstate.go +++ b/gossip/gossip/chanstate.go @@ -11,7 +11,7 @@ import ( "sync" "sync/atomic" - proto "github.com/hyperledger/fabric-protos-go/gossip" + proto "github.com/hyperledger/fabric-protos-go-apiv2/gossip" "github.com/hyperledger/fabric/gossip/api" "github.com/hyperledger/fabric/gossip/comm" "github.com/hyperledger/fabric/gossip/common" diff --git a/gossip/gossip/config_test.go b/gossip/gossip/config_test.go index 8d6dc4dd3e6..4e028a3026c 100644 --- a/gossip/gossip/config_test.go +++ b/gossip/gossip/config_test.go @@ -12,13 +12,11 @@ import ( "testing" "time" + "github.com/hyperledger/fabric/gossip/comm" "github.com/hyperledger/fabric/gossip/discovery" "github.com/hyperledger/fabric/gossip/election" - - "github.com/hyperledger/fabric/gossip/comm" - "github.com/hyperledger/fabric/gossip/gossip/algo" - "github.com/hyperledger/fabric/gossip/gossip" + "github.com/hyperledger/fabric/gossip/gossip/algo" "github.com/spf13/viper" "github.com/stretchr/testify/require" ) diff --git a/gossip/gossip/gossip_impl.go b/gossip/gossip/gossip_impl.go index c8c9862a50f..c02f9839975 100644 --- a/gossip/gossip/gossip_impl.go +++ b/gossip/gossip/gossip_impl.go @@ -15,8 +15,7 @@ import ( "sync/atomic" "time" - "github.com/golang/protobuf/proto" - pg "github.com/hyperledger/fabric-protos-go/gossip" + pg "github.com/hyperledger/fabric-protos-go-apiv2/gossip" "github.com/hyperledger/fabric/gossip/api" "github.com/hyperledger/fabric/gossip/comm" "github.com/hyperledger/fabric/gossip/common" @@ -32,6 +31,7 @@ import ( "github.com/hyperledger/fabric/gossip/util" "github.com/pkg/errors" "google.golang.org/grpc" + "google.golang.org/protobuf/proto" ) const ( diff --git a/gossip/gossip/gossip_test.go b/gossip/gossip/gossip_test.go index 8982233d16e..2e01892ecd4 100644 --- a/gossip/gossip/gossip_test.go +++ b/gossip/gossip/gossip_test.go @@ -12,7 +12,6 @@ import ( "fmt" "math/rand" "os" - "reflect" "sync" "sync/atomic" "testing" @@ -20,8 +19,8 @@ import ( "github.com/hyperledger/fabric-lib-go/bccsp/factory" "github.com/hyperledger/fabric-lib-go/common/metrics/disabled" - cb "github.com/hyperledger/fabric-protos-go/common" - proto "github.com/hyperledger/fabric-protos-go/gossip" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/gossip" "github.com/hyperledger/fabric/gossip/api" "github.com/hyperledger/fabric/gossip/comm" "github.com/hyperledger/fabric/gossip/common" @@ -34,6 +33,7 @@ import ( "github.com/hyperledger/fabric/gossip/util" corecomm "github.com/hyperledger/fabric/internal/pkg/comm" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) var ( @@ -55,7 +55,7 @@ var ( AliveExpirationTimeout: 10 * aliveTimeInterval, AliveExpirationCheckInterval: aliveTimeInterval, ReconnectInterval: aliveTimeInterval, - MaxConnectionAttempts: 5, + MaxConnectionAttempts: 120, MsgExpirationFactor: discovery.DefMsgExpirationFactor, } ) @@ -63,15 +63,15 @@ var ( var orgInChannelA = api.OrgIdentityType("ORG1") func acceptData(m interface{}) bool { - if dataMsg := m.(*proto.GossipMessage).GetDataMsg(); dataMsg != nil { + if dataMsg := m.(*gossip.GossipMessage).GetDataMsg(); dataMsg != nil { return true } return false } func acceptLeadershp(message interface{}) bool { - validMsg := message.(*proto.GossipMessage).Tag == proto.GossipMessage_CHAN_AND_ORG && - protoext.IsLeadershipMsg(message.(*proto.GossipMessage)) + validMsg := message.(*gossip.GossipMessage).Tag == gossip.GossipMessage_CHAN_AND_ORG && + protoext.IsLeadershipMsg(message.(*gossip.GossipMessage)) return validMsg } @@ -449,7 +449,7 @@ func TestPull(t *testing.T) { for i := 1; i <= n; i++ { go func(i int) { acceptChan, _ := peers[i-1].Accept(acceptData, false) - go func(index int, ch <-chan *proto.GossipMessage) { + go func(index int, ch <-chan *gossip.GossipMessage) { defer wg.Done() for j := 0; j < msgsCount2Send; j++ { <-ch @@ -692,7 +692,7 @@ func TestNoMessagesSelfLoop(t *testing.T) { peerCh, _ := peer.Accept(acceptData, false) // Ensure recipient gets his message - go func(ch <-chan *proto.GossipMessage) { + go func(ch <-chan *gossip.GossipMessage) { defer wg.Done() <-ch }(peerCh) @@ -723,7 +723,7 @@ func TestDissemination(t *testing.T) { boot := newGossipInstanceWithGRPC(0, port0, grpc0, certs0, secDialOpts0, 100) boot.JoinChan(&joinChanMsg{}, common.ChannelID("A")) boot.UpdateLedgerHeight(1, common.ChannelID("A")) - boot.UpdateChaincodes([]*proto.Chaincode{{Name: "exampleCC", Version: "1.2"}}, common.ChannelID("A")) + boot.UpdateChaincodes([]*gossip.Chaincode{{Name: "exampleCC", Version: "1.2"}}, common.ChannelID("A")) peers := make([]*gossipGRPC, n) receivedMessages := make([]int, n) @@ -740,9 +740,9 @@ func TestDissemination(t *testing.T) { peers[i-1] = pI pI.JoinChan(&joinChanMsg{}, common.ChannelID("A")) pI.UpdateLedgerHeight(1, common.ChannelID("A")) - pI.UpdateChaincodes([]*proto.Chaincode{{Name: "exampleCC", Version: "1.2"}}, common.ChannelID("A")) + pI.UpdateChaincodes([]*gossip.Chaincode{{Name: "exampleCC", Version: "1.2"}}, common.ChannelID("A")) acceptChan, _ := pI.Accept(acceptData, false) - go func(index int, ch <-chan *proto.GossipMessage) { + go func(index int, ch <-chan *gossip.GossipMessage) { defer wg.Done() for j := 0; j < msgsCount2Send; j++ { <-ch @@ -768,7 +768,7 @@ func TestDissemination(t *testing.T) { return false } - if !reflect.DeepEqual(p.Properties.Chaincodes, []*proto.Chaincode{{Name: "exampleCC", Version: "1.2"}}) { + if !proto.Equal(p.Properties.Chaincodes[0], &gossip.Chaincode{Name: "exampleCC", Version: "1.2"}) { return false } } @@ -801,7 +801,7 @@ func TestDissemination(t *testing.T) { wgLeadership.Add(n) for i := 1; i <= n; i++ { leadershipChan, _ := peers[i-1].Accept(acceptLeadershp, false) - go func(index int, ch <-chan *proto.GossipMessage) { + go func(index int, ch <-chan *gossip.GossipMessage) { defer wgLeadership.Done() msg := <-ch if bytes.Equal(msg.Channel, common.ChannelID("A")) { @@ -943,6 +943,10 @@ func TestMembershipConvergence(t *testing.T) { } func TestMembershipRequestSpoofing(t *testing.T) { + fmt.Printf("begin test %s\n", t.Name()) + defer fmt.Printf("end test %s\n", t.Name()) + util.SetupTestLoggingWithLevel("DEBUG") + defer util.SetupTestLogging() // Scenario: g1, g2, g3 are peers, and g2 is malicious, and wants // to impersonate g3 when sending a membership request to g1. // Expected output: g1 should *NOT* respond to g2, @@ -984,12 +988,12 @@ func TestMembershipRequestSpoofing(t *testing.T) { }, true) // Now, create a membership request message - memRequestSpoofFactory := func(aliveMsgEnv *proto.Envelope) *protoext.SignedGossipMessage { - sMsg, _ := protoext.NoopSign(&proto.GossipMessage{ - Tag: proto.GossipMessage_EMPTY, + memRequestSpoofFactory := func(aliveMsgEnv *gossip.Envelope) *protoext.SignedGossipMessage { + sMsg, _ := protoext.NoopSign(&gossip.GossipMessage{ + Tag: gossip.GossipMessage_EMPTY, Nonce: uint64(0), - Content: &proto.GossipMessage_MemReq{ - MemReq: &proto.MembershipRequest{ + Content: &gossip.GossipMessage_MemReq{ + MemReq: &gossip.MembershipRequest{ SelfInformation: aliveMsgEnv, Known: [][]byte{}, }, @@ -1202,7 +1206,7 @@ func TestDisseminateAll2All(t *testing.T) { wg = sync.WaitGroup{} wg.Add(n) - reader := func(msgChan <-chan *proto.GossipMessage, i int) { + reader := func(msgChan <-chan *gossip.GossipMessage, i int) { wg.Done() for range msgChan { bMutex.Done() @@ -1478,14 +1482,14 @@ func TestIdentityExpiration(t *testing.T) { g5.Stop() } -func createDataMsg(seqnum uint64, data []byte, channel common.ChannelID) *proto.GossipMessage { - return &proto.GossipMessage{ +func createDataMsg(seqnum uint64, data []byte, channel common.ChannelID) *gossip.GossipMessage { + return &gossip.GossipMessage{ Channel: channel, Nonce: 0, - Tag: proto.GossipMessage_CHAN_AND_ORG, - Content: &proto.GossipMessage_DataMsg{ - DataMsg: &proto.DataMessage{ - Payload: &proto.Payload{ + Tag: gossip.GossipMessage_CHAN_AND_ORG, + Content: &gossip.GossipMessage_DataMsg{ + DataMsg: &gossip.DataMessage{ + Payload: &gossip.Payload{ Data: data, SeqNum: seqnum, }, @@ -1494,20 +1498,20 @@ func createDataMsg(seqnum uint64, data []byte, channel common.ChannelID) *proto. } } -func createLeadershipMsg(isDeclaration bool, channel common.ChannelID, incTime uint64, seqNum uint64, pkiid []byte) *proto.GossipMessage { - leadershipMsg := &proto.LeadershipMessage{ +func createLeadershipMsg(isDeclaration bool, channel common.ChannelID, incTime uint64, seqNum uint64, pkiid []byte) *gossip.GossipMessage { + leadershipMsg := &gossip.LeadershipMessage{ IsDeclaration: isDeclaration, PkiId: pkiid, - Timestamp: &proto.PeerTime{ + Timestamp: &gossip.PeerTime{ IncNum: incTime, SeqNum: seqNum, }, } - msg := &proto.GossipMessage{ + msg := &gossip.GossipMessage{ Nonce: 0, - Tag: proto.GossipMessage_CHAN_AND_ORG, - Content: &proto.GossipMessage_LeadershipMsg{LeadershipMsg: leadershipMsg}, + Tag: gossip.GossipMessage_CHAN_AND_ORG, + Content: &gossip.GossipMessage_LeadershipMsg{LeadershipMsg: leadershipMsg}, Channel: channel, } return msg @@ -1584,10 +1588,11 @@ func waitUntilOrFailBlocking(t *testing.T, f func(), context string) { func checkPeersMembership(t *testing.T, peers []*gossipGRPC, n int) func() bool { return func() bool { for _, peer := range peers { - if len(peer.Peers()) != n { + ps := peer.Peers() + if len(ps) != n { return false } - for _, p := range peer.Peers() { + for _, p := range ps { require.NotNil(t, p.InternalEndpoint) require.NotEmpty(t, p.Endpoint) } diff --git a/gossip/gossip/orgs_test.go b/gossip/gossip/orgs_test.go index 995f8c2747b..74990eb6ba0 100644 --- a/gossip/gossip/orgs_test.go +++ b/gossip/gossip/orgs_test.go @@ -16,8 +16,8 @@ import ( "github.com/hyperledger/fabric-lib-go/bccsp/factory" "github.com/hyperledger/fabric-lib-go/common/metrics/disabled" - cb "github.com/hyperledger/fabric-protos-go/common" - proto "github.com/hyperledger/fabric-protos-go/gossip" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + proto "github.com/hyperledger/fabric-protos-go-apiv2/gossip" "github.com/hyperledger/fabric/gossip/api" gcomm "github.com/hyperledger/fabric/gossip/comm" "github.com/hyperledger/fabric/gossip/common" diff --git a/gossip/gossip/pull/pullstore.go b/gossip/gossip/pull/pullstore.go index a25d105a9bc..58105eecb62 100644 --- a/gossip/gossip/pull/pullstore.go +++ b/gossip/gossip/pull/pullstore.go @@ -11,7 +11,7 @@ import ( "sync" "time" - "github.com/hyperledger/fabric-protos-go/gossip" + "github.com/hyperledger/fabric-protos-go-apiv2/gossip" "github.com/hyperledger/fabric/gossip/comm" "github.com/hyperledger/fabric/gossip/common" "github.com/hyperledger/fabric/gossip/discovery" diff --git a/gossip/gossip/pull/pullstore_test.go b/gossip/gossip/pull/pullstore_test.go index 2623cd5fd97..a34eabdb9f6 100644 --- a/gossip/gossip/pull/pullstore_test.go +++ b/gossip/gossip/pull/pullstore_test.go @@ -15,7 +15,7 @@ import ( "testing" "time" - "github.com/hyperledger/fabric-protos-go/gossip" + "github.com/hyperledger/fabric-protos-go-apiv2/gossip" "github.com/hyperledger/fabric/gossip/comm" "github.com/hyperledger/fabric/gossip/discovery" "github.com/hyperledger/fabric/gossip/gossip/algo" diff --git a/gossip/identity/identity_test.go b/gossip/identity/identity_test.go index 84f09c54b5f..26da697fb72 100644 --- a/gossip/identity/identity_test.go +++ b/gossip/identity/identity_test.go @@ -14,7 +14,7 @@ import ( "testing" "time" - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/gossip/api" "github.com/hyperledger/fabric/gossip/common" "github.com/hyperledger/fabric/gossip/util" diff --git a/gossip/privdata/common/common.go b/gossip/privdata/common/common.go index dc385fb6d44..fcfef64965e 100644 --- a/gossip/privdata/common/common.go +++ b/gossip/privdata/common/common.go @@ -7,8 +7,8 @@ SPDX-License-Identifier: Apache-2.0 package common import ( - "github.com/hyperledger/fabric-protos-go/gossip" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/gossip" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" ) // privdata_common holds types that are used both in privdata and mocks packages. diff --git a/gossip/privdata/coordinator.go b/gossip/privdata/coordinator.go index 9e9a4bf7075..1b92c0455be 100644 --- a/gossip/privdata/coordinator.go +++ b/gossip/privdata/coordinator.go @@ -9,10 +9,10 @@ package privdata import ( "time" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/ledger/rwset" - "github.com/hyperledger/fabric-protos-go/peer" - protostransientstore "github.com/hyperledger/fabric-protos-go/transientstore" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" + protostransientstore "github.com/hyperledger/fabric-protos-go-apiv2/transientstore" "github.com/hyperledger/fabric/common/channelconfig" "github.com/hyperledger/fabric/core/committer" "github.com/hyperledger/fabric/core/committer/txvalidator" diff --git a/gossip/privdata/coordinator_test.go b/gossip/privdata/coordinator_test.go index e33694b79f5..2abe24f9beb 100644 --- a/gossip/privdata/coordinator_test.go +++ b/gossip/privdata/coordinator_test.go @@ -15,16 +15,15 @@ import ( "testing" "time" - pb "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/bccsp/factory" "github.com/hyperledger/fabric-lib-go/common/metrics/disabled" - "github.com/hyperledger/fabric-protos-go/common" - proto "github.com/hyperledger/fabric-protos-go/gossip" - "github.com/hyperledger/fabric-protos-go/ledger/rwset" - "github.com/hyperledger/fabric-protos-go/ledger/rwset/kvrwset" - mspproto "github.com/hyperledger/fabric-protos-go/msp" - "github.com/hyperledger/fabric-protos-go/peer" - tspb "github.com/hyperledger/fabric-protos-go/transientstore" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + proto "github.com/hyperledger/fabric-protos-go-apiv2/gossip" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset/kvrwset" + mspproto "github.com/hyperledger/fabric-protos-go-apiv2/msp" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" + tspb "github.com/hyperledger/fabric-protos-go-apiv2/transientstore" util2 "github.com/hyperledger/fabric/common/util" "github.com/hyperledger/fabric/core/common/privdata" "github.com/hyperledger/fabric/core/ledger" @@ -41,6 +40,7 @@ import ( "github.com/hyperledger/fabric/protoutil" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" + pb "google.golang.org/protobuf/proto" ) var testConfig = CoordinatorConfig{ diff --git a/gossip/privdata/dataretriever.go b/gossip/privdata/dataretriever.go index 6b63639ef94..4db9adc37fa 100644 --- a/gossip/privdata/dataretriever.go +++ b/gossip/privdata/dataretriever.go @@ -7,8 +7,8 @@ SPDX-License-Identifier: Apache-2.0 package privdata import ( - protosgossip "github.com/hyperledger/fabric-protos-go/gossip" - "github.com/hyperledger/fabric-protos-go/ledger/rwset" + protosgossip "github.com/hyperledger/fabric-protos-go-apiv2/gossip" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset" "github.com/hyperledger/fabric/core/committer" "github.com/hyperledger/fabric/core/ledger" "github.com/hyperledger/fabric/core/transientstore" diff --git a/gossip/privdata/dataretriever_test.go b/gossip/privdata/dataretriever_test.go index 583c2509273..ba11b6c0412 100644 --- a/gossip/privdata/dataretriever_test.go +++ b/gossip/privdata/dataretriever_test.go @@ -10,10 +10,10 @@ import ( "errors" "testing" - gossip2 "github.com/hyperledger/fabric-protos-go/gossip" - "github.com/hyperledger/fabric-protos-go/ledger/rwset" - "github.com/hyperledger/fabric-protos-go/peer" - "github.com/hyperledger/fabric-protos-go/transientstore" + gossip2 "github.com/hyperledger/fabric-protos-go-apiv2/gossip" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/transientstore" "github.com/hyperledger/fabric/core/ledger" privdatacommon "github.com/hyperledger/fabric/gossip/privdata/common" "github.com/hyperledger/fabric/gossip/privdata/mocks" diff --git a/gossip/privdata/distributor.go b/gossip/privdata/distributor.go index cba12a7e499..728fcdaeacf 100644 --- a/gossip/privdata/distributor.go +++ b/gossip/privdata/distributor.go @@ -14,11 +14,10 @@ import ( "sync/atomic" "time" - "github.com/golang/protobuf/proto" - protosgossip "github.com/hyperledger/fabric-protos-go/gossip" - "github.com/hyperledger/fabric-protos-go/ledger/rwset" - "github.com/hyperledger/fabric-protos-go/peer" - "github.com/hyperledger/fabric-protos-go/transientstore" + protosgossip "github.com/hyperledger/fabric-protos-go-apiv2/gossip" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/transientstore" "github.com/hyperledger/fabric/core/common/privdata" "github.com/hyperledger/fabric/gossip/api" gossipCommon "github.com/hyperledger/fabric/gossip/common" @@ -31,6 +30,7 @@ import ( "github.com/hyperledger/fabric/msp" "github.com/hyperledger/fabric/protoutil" "github.com/pkg/errors" + "google.golang.org/protobuf/proto" ) // gossipAdapter an adapter for API's required from gossip module diff --git a/gossip/privdata/distributor_test.go b/gossip/privdata/distributor_test.go index 99e49755254..88d56dca09a 100644 --- a/gossip/privdata/distributor_test.go +++ b/gossip/privdata/distributor_test.go @@ -11,9 +11,9 @@ import ( "fmt" "testing" - proto "github.com/hyperledger/fabric-protos-go/gossip" - "github.com/hyperledger/fabric-protos-go/peer" - "github.com/hyperledger/fabric-protos-go/transientstore" + proto "github.com/hyperledger/fabric-protos-go-apiv2/gossip" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/transientstore" "github.com/hyperledger/fabric/core/common/privdata" "github.com/hyperledger/fabric/gossip/api" gcommon "github.com/hyperledger/fabric/gossip/common" diff --git a/gossip/privdata/mocks/collection_access_factory.go b/gossip/privdata/mocks/collection_access_factory.go index 2b8475e7f76..c22514888b1 100644 --- a/gossip/privdata/mocks/collection_access_factory.go +++ b/gossip/privdata/mocks/collection_access_factory.go @@ -3,7 +3,7 @@ package mocks import ( - peer "github.com/hyperledger/fabric-protos-go/peer" + peer "github.com/hyperledger/fabric-protos-go-apiv2/peer" mock "github.com/stretchr/testify/mock" privdata "github.com/hyperledger/fabric/core/common/privdata" diff --git a/gossip/privdata/mocks/collection_store.go b/gossip/privdata/mocks/collection_store.go index ce6314f6b62..faf9118b77e 100644 --- a/gossip/privdata/mocks/collection_store.go +++ b/gossip/privdata/mocks/collection_store.go @@ -6,7 +6,7 @@ import ( ledger "github.com/hyperledger/fabric/core/ledger" mock "github.com/stretchr/testify/mock" - peer "github.com/hyperledger/fabric-protos-go/peer" + peer "github.com/hyperledger/fabric-protos-go-apiv2/peer" privdata "github.com/hyperledger/fabric/core/common/privdata" ) diff --git a/gossip/privdata/mocks/committer.go b/gossip/privdata/mocks/committer.go index d8237aef1a5..04b3c195d6f 100644 --- a/gossip/privdata/mocks/committer.go +++ b/gossip/privdata/mocks/committer.go @@ -3,7 +3,7 @@ package mocks import ( - common "github.com/hyperledger/fabric-protos-go/common" + common "github.com/hyperledger/fabric-protos-go-apiv2/common" ledger "github.com/hyperledger/fabric/core/ledger" mock "github.com/stretchr/testify/mock" diff --git a/gossip/privdata/pull.go b/gossip/privdata/pull.go index a4186da3684..c7afb3c780e 100644 --- a/gossip/privdata/pull.go +++ b/gossip/privdata/pull.go @@ -15,8 +15,7 @@ import ( "sync" "time" - "github.com/golang/protobuf/proto" - protosgossip "github.com/hyperledger/fabric-protos-go/gossip" + protosgossip "github.com/hyperledger/fabric-protos-go-apiv2/gossip" commonutil "github.com/hyperledger/fabric/common/util" "github.com/hyperledger/fabric/core/common/privdata" "github.com/hyperledger/fabric/gossip/api" @@ -31,6 +30,7 @@ import ( "github.com/hyperledger/fabric/protoutil" "github.com/pkg/errors" "go.uber.org/zap/zapcore" + "google.golang.org/protobuf/proto" ) const ( diff --git a/gossip/privdata/pull_test.go b/gossip/privdata/pull_test.go index 6fc2914f713..820a5ba405e 100644 --- a/gossip/privdata/pull_test.go +++ b/gossip/privdata/pull_test.go @@ -12,11 +12,10 @@ import ( "sync" "testing" - pb "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/common/metrics/disabled" - proto "github.com/hyperledger/fabric-protos-go/gossip" - "github.com/hyperledger/fabric-protos-go/ledger/rwset" - "github.com/hyperledger/fabric-protos-go/peer" + proto "github.com/hyperledger/fabric-protos-go-apiv2/gossip" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/core/common/privdata" "github.com/hyperledger/fabric/core/ledger" "github.com/hyperledger/fabric/core/transientstore" @@ -35,6 +34,7 @@ import ( "github.com/pkg/errors" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" + pb "google.golang.org/protobuf/proto" ) func init() { @@ -1027,7 +1027,7 @@ func TestPullerAvoidPullingPurgedData(t *testing.T) { require.NoError(t, err) require.Equal(t, 1, len(fetchedMessages.PurgedElements)) - require.Equal(t, dig1, fetchedMessages.PurgedElements[0]) + require.True(t, pb.Equal(dig1, fetchedMessages.PurgedElements[0])) p3.PrivateDataRetriever.(*dataRetrieverMock).AssertNumberOfCalls(t, "CollectionRWSet", 1) } diff --git a/gossip/privdata/pvtdataprovider.go b/gossip/privdata/pvtdataprovider.go index c08331f8411..a2b45fd31e0 100644 --- a/gossip/privdata/pvtdataprovider.go +++ b/gossip/privdata/pvtdataprovider.go @@ -11,11 +11,10 @@ import ( "fmt" "time" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/common/metrics" - "github.com/hyperledger/fabric-protos-go/ledger/rwset" - "github.com/hyperledger/fabric-protos-go/msp" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset" + "github.com/hyperledger/fabric-protos-go-apiv2/msp" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" vsccErrors "github.com/hyperledger/fabric/common/errors" commonutil "github.com/hyperledger/fabric/common/util" pvtdatasc "github.com/hyperledger/fabric/core/common/privdata" @@ -24,6 +23,7 @@ import ( pvtdatacommon "github.com/hyperledger/fabric/gossip/privdata/common" "github.com/hyperledger/fabric/gossip/util" "github.com/hyperledger/fabric/protoutil" + "google.golang.org/protobuf/proto" ) type sleeper struct { diff --git a/gossip/privdata/pvtdataprovider_test.go b/gossip/privdata/pvtdataprovider_test.go index d3cfa315a13..6a6e9eed7d8 100644 --- a/gossip/privdata/pvtdataprovider_test.go +++ b/gossip/privdata/pvtdataprovider_test.go @@ -14,12 +14,12 @@ import ( "github.com/hyperledger/fabric-lib-go/bccsp/factory" "github.com/hyperledger/fabric-lib-go/common/metrics/disabled" - "github.com/hyperledger/fabric-protos-go/common" - proto "github.com/hyperledger/fabric-protos-go/gossip" - "github.com/hyperledger/fabric-protos-go/ledger/rwset" - mspproto "github.com/hyperledger/fabric-protos-go/msp" - "github.com/hyperledger/fabric-protos-go/peer" - tspb "github.com/hyperledger/fabric-protos-go/transientstore" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + proto "github.com/hyperledger/fabric-protos-go-apiv2/gossip" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset" + mspproto "github.com/hyperledger/fabric-protos-go-apiv2/msp" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" + tspb "github.com/hyperledger/fabric-protos-go-apiv2/transientstore" util2 "github.com/hyperledger/fabric/common/util" "github.com/hyperledger/fabric/core/ledger" "github.com/hyperledger/fabric/core/transientstore" diff --git a/gossip/privdata/reconcile.go b/gossip/privdata/reconcile.go index c6ef5b992f8..8d2efb49420 100644 --- a/gossip/privdata/reconcile.go +++ b/gossip/privdata/reconcile.go @@ -12,8 +12,8 @@ import ( "sync" "time" - protosgossip "github.com/hyperledger/fabric-protos-go/gossip" - "github.com/hyperledger/fabric-protos-go/peer" + protosgossip "github.com/hyperledger/fabric-protos-go-apiv2/gossip" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/core/committer" "github.com/hyperledger/fabric/core/ledger" "github.com/hyperledger/fabric/gossip/metrics" diff --git a/gossip/privdata/reconcile_test.go b/gossip/privdata/reconcile_test.go index b4bef1dd32c..b38689b589b 100644 --- a/gossip/privdata/reconcile_test.go +++ b/gossip/privdata/reconcile_test.go @@ -13,8 +13,8 @@ import ( "time" "github.com/hyperledger/fabric-lib-go/common/metrics/disabled" - gossip2 "github.com/hyperledger/fabric-protos-go/gossip" - "github.com/hyperledger/fabric-protos-go/peer" + gossip2 "github.com/hyperledger/fabric-protos-go-apiv2/gossip" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" util2 "github.com/hyperledger/fabric/common/util" "github.com/hyperledger/fabric/core/ledger" "github.com/hyperledger/fabric/gossip/metrics" diff --git a/gossip/privdata/util.go b/gossip/privdata/util.go index 11f591bd217..483996e554d 100644 --- a/gossip/privdata/util.go +++ b/gossip/privdata/util.go @@ -9,15 +9,15 @@ package privdata import ( "fmt" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/ledger/rwset" - "github.com/hyperledger/fabric-protos-go/ledger/rwset/kvrwset" - "github.com/hyperledger/fabric-protos-go/msp" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset/kvrwset" + "github.com/hyperledger/fabric-protos-go-apiv2/msp" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/core/ledger" "github.com/hyperledger/fabric/core/ledger/kvledger/txmgmt/rwsetutil" privdatacommon "github.com/hyperledger/fabric/gossip/privdata/common" + "google.golang.org/protobuf/proto" ) type txValidationFlags []uint8 diff --git a/gossip/protoext/compatibility_test.go b/gossip/protoext/compatibility_test.go index 97498a96bf3..0b8a444ff2e 100644 --- a/gossip/protoext/compatibility_test.go +++ b/gossip/protoext/compatibility_test.go @@ -10,10 +10,10 @@ import ( "encoding/hex" "testing" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/gossip" + "github.com/hyperledger/fabric-protos-go-apiv2/gossip" "github.com/hyperledger/fabric/gossip/protoext" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) var digestMsg = &gossip.GossipMessage{ diff --git a/gossip/protoext/message.go b/gossip/protoext/message.go index 93ffd288175..1675dae2fa8 100644 --- a/gossip/protoext/message.go +++ b/gossip/protoext/message.go @@ -9,7 +9,7 @@ package protoext import ( "fmt" - "github.com/hyperledger/fabric-protos-go/gossip" + "github.com/hyperledger/fabric-protos-go-apiv2/gossip" ) // IsAliveMsg returns whether this GossipMessage is an AliveMessage diff --git a/gossip/protoext/message_test.go b/gossip/protoext/message_test.go index d9df1e24d9f..2c202ab34f7 100644 --- a/gossip/protoext/message_test.go +++ b/gossip/protoext/message_test.go @@ -9,7 +9,7 @@ package protoext_test import ( "testing" - "github.com/hyperledger/fabric-protos-go/gossip" + "github.com/hyperledger/fabric-protos-go-apiv2/gossip" "github.com/hyperledger/fabric/gossip/protoext" "github.com/stretchr/testify/require" ) diff --git a/gossip/protoext/msgcomparator.go b/gossip/protoext/msgcomparator.go index 08842c55543..7d2d2aa3aee 100644 --- a/gossip/protoext/msgcomparator.go +++ b/gossip/protoext/msgcomparator.go @@ -9,7 +9,7 @@ package protoext import ( "bytes" - "github.com/hyperledger/fabric-protos-go/gossip" + "github.com/hyperledger/fabric-protos-go-apiv2/gossip" "github.com/hyperledger/fabric/gossip/common" ) diff --git a/gossip/protoext/msgcomparator_test.go b/gossip/protoext/msgcomparator_test.go index 1a8eab79a1b..934efee2f7f 100644 --- a/gossip/protoext/msgcomparator_test.go +++ b/gossip/protoext/msgcomparator_test.go @@ -9,7 +9,7 @@ package protoext_test import ( "testing" - "github.com/hyperledger/fabric-protos-go/gossip" + "github.com/hyperledger/fabric-protos-go-apiv2/gossip" "github.com/hyperledger/fabric/gossip/common" "github.com/hyperledger/fabric/gossip/protoext" "github.com/stretchr/testify/require" diff --git a/gossip/protoext/receivedmessage.go b/gossip/protoext/receivedmessage.go index 1377a33589d..862fc0edc02 100644 --- a/gossip/protoext/receivedmessage.go +++ b/gossip/protoext/receivedmessage.go @@ -9,7 +9,7 @@ package protoext import ( "fmt" - "github.com/hyperledger/fabric-protos-go/gossip" + "github.com/hyperledger/fabric-protos-go-apiv2/gossip" "github.com/hyperledger/fabric/gossip/api" "github.com/hyperledger/fabric/gossip/common" ) diff --git a/gossip/protoext/signing.go b/gossip/protoext/signing.go index 04200951fd4..dd09115921c 100644 --- a/gossip/protoext/signing.go +++ b/gossip/protoext/signing.go @@ -10,8 +10,8 @@ import ( "errors" "fmt" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/gossip" + "github.com/hyperledger/fabric-protos-go-apiv2/gossip" + "google.golang.org/protobuf/proto" ) // Signer signs a message, and returns (signature, nil) @@ -24,6 +24,9 @@ type Verifier func(peerIdentity []byte, signature, message []byte) error // SignSecret signs the secret payload and creates a secret envelope out of it. func SignSecret(e *gossip.Envelope, signer Signer, secret *gossip.Secret) error { + if secret == nil { + return errors.New("proto: Marshal called with nil") + } payload, err := proto.Marshal(secret) if err != nil { return err @@ -99,6 +102,9 @@ func (m *SignedGossipMessage) Sign(signer Signer) (*gossip.Envelope, error) { secretEnvelope = m.Envelope.SecretEnvelope } m.Envelope = nil + if m.GossipMessage == nil { + return nil, errors.New("proto: Marshal called with nil") + } payload, err := proto.Marshal(m.GossipMessage) if err != nil { return nil, err diff --git a/gossip/protoext/signing_test.go b/gossip/protoext/signing_test.go index 88969de2f03..c0c63ffc02f 100644 --- a/gossip/protoext/signing_test.go +++ b/gossip/protoext/signing_test.go @@ -11,11 +11,11 @@ import ( "fmt" "testing" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/gossip" + "github.com/hyperledger/fabric-protos-go-apiv2/gossip" "github.com/hyperledger/fabric/gossip/protoext" "github.com/hyperledger/fabric/protoutil" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) func TestToGossipMessageNilEnvelope(t *testing.T) { diff --git a/gossip/protoext/stringers.go b/gossip/protoext/stringers.go index c112d746aca..128a17dca1c 100644 --- a/gossip/protoext/stringers.go +++ b/gossip/protoext/stringers.go @@ -10,9 +10,9 @@ import ( "encoding/hex" "fmt" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/gossip" - "github.com/hyperledger/fabric-protos-go/msp" + "github.com/hyperledger/fabric-protos-go-apiv2/gossip" + "github.com/hyperledger/fabric-protos-go-apiv2/msp" + "google.golang.org/protobuf/proto" ) // MemberToString prints Endpoint and PKI-id diff --git a/gossip/protoext/stringers_test.go b/gossip/protoext/stringers_test.go index 6e18a01a1fb..3d850a1b0a6 100644 --- a/gossip/protoext/stringers_test.go +++ b/gossip/protoext/stringers_test.go @@ -7,9 +7,10 @@ SPDX-License-Identifier: Apache-2.0 package protoext_test import ( + "strings" "testing" - "github.com/hyperledger/fabric-protos-go/gossip" + "github.com/hyperledger/fabric-protos-go-apiv2/gossip" "github.com/hyperledger/fabric/gossip/protoext" "github.com/stretchr/testify/require" ) @@ -20,7 +21,9 @@ func TestMembershipResponseToString(t *testing.T) { Dead: envelopes(), } output := "MembershipResponse with Alive: 1, Dead: 1" - require.Equal(t, output, protoext.MembershipResponseToString(mr)) + output = strings.ReplaceAll(output, " ", "") + tmp := strings.ReplaceAll(protoext.MembershipResponseToString(mr), " ", "") + require.Equal(t, output, tmp) } func TestMembershipRequestToString(t *testing.T) { @@ -67,7 +70,9 @@ func TestMembershipRequestToString(t *testing.T) { } output := "Membership Request with self information of GossipMessage: Channel: A, nonce: 5, tag: UNDEFINED Block message: {Data: 5 bytes, seq: 3}, Envelope: 18 bytes, Signature: 3 bytes Secret payload: 6 bytes, Secret Signature: 3 bytes " - require.Equal(t, output, protoext.MembershipRequestToString(mr)) + output = strings.ReplaceAll(output, " ", "") + tmp := strings.ReplaceAll(protoext.MembershipRequestToString(mr), " ", "") + require.Equal(t, output, tmp) mr1 := &gossip.MembershipRequest{ SelfInformation: &gossip.Envelope{ @@ -97,7 +102,9 @@ func TestToStringMember(t *testing.T) { PkiId: []byte{15}, } output := "Membership: Endpoint:localhost PKI-id:0f" - require.Equal(t, output, protoext.MemberToString(member)) + output = strings.ReplaceAll(output, " ", "") + tmp := strings.ReplaceAll(protoext.MemberToString(member), " ", "") + require.Equal(t, output, tmp) } func TestToStringAliveMessage(t *testing.T) { @@ -114,7 +121,9 @@ func TestToStringAliveMessage(t *testing.T) { Identity: []byte("peerID1"), } output1 := "Alive Message:Membership: Endpoint:localhost PKI-id:11Identity:Timestamp:inc_num:1 seq_num:1 " - require.Equal(t, output1, protoext.AliveMessageToString(am1)) + output1 = strings.ReplaceAll(output1, " ", "") + tmp1 := strings.ReplaceAll(protoext.AliveMessageToString(am1), " ", "") + require.Equal(t, output1, tmp1) am2 := &gossip.AliveMessage{ Membership: nil, Timestamp: &gossip.PeerTime{ @@ -124,7 +133,9 @@ func TestToStringAliveMessage(t *testing.T) { Identity: []byte("peerID1"), } output2 := "nil Membership" - require.Equal(t, output2, protoext.AliveMessageToString(am2)) + output2 = strings.ReplaceAll(output2, " ", "") + tmp2 := strings.ReplaceAll(protoext.AliveMessageToString(am2), " ", "") + require.Equal(t, output2, tmp2) } func TestToStringStateInfoPullRequest(t *testing.T) { @@ -134,7 +145,9 @@ func TestToStringStateInfoPullRequest(t *testing.T) { } output := "state_info_pull_req: Channel MAC:11" - require.Equal(t, output, protoext.StateInfoPullRequestToString(sipr)) + output = strings.ReplaceAll(output, " ", "") + tmp := strings.ReplaceAll(protoext.StateInfoPullRequestToString(sipr), " ", "") + require.Equal(t, output, tmp) } func TestToStringStateInfo(t *testing.T) { @@ -148,7 +161,9 @@ func TestToStringStateInfo(t *testing.T) { Properties: nil, } output := "state_info_message: Timestamp:inc_num:1 seq_num:1 PKI-id:11 channel MAC:11 properties:" - require.Equal(t, output, protoext.StateInfoToString(si)) + output = strings.ReplaceAll(output, " ", "") + tmp := strings.ReplaceAll(protoext.StateInfoToString(si), " ", "") + require.Equal(t, output, tmp) } func TestToStringDataDigest(t *testing.T) { @@ -158,14 +173,18 @@ func TestToStringDataDigest(t *testing.T) { MsgType: gossip.PullMsgType_BLOCK_MSG, } output1 := "data_dig: nonce: 0 , Msg_type: BLOCK_MSG, digests: [msg1 msg2 msg3]" - require.Equal(t, output1, protoext.DataDigestToString(dig1)) + output1 = strings.ReplaceAll(output1, " ", "") + tmp1 := strings.ReplaceAll(protoext.DataDigestToString(dig1), " ", "") + require.Equal(t, output1, tmp1) dig2 := &gossip.DataDigest{ Nonce: 0, Digests: [][]byte{[]byte("msg1"), []byte("msg2"), []byte("msg3")}, MsgType: gossip.PullMsgType_IDENTITY_MSG, } output2 := "data_dig: nonce: 0 , Msg_type: IDENTITY_MSG, digests: [6d736731 6d736732 6d736733]" - require.Equal(t, output2, protoext.DataDigestToString(dig2)) + output2 = strings.ReplaceAll(output2, " ", "") + tmp2 := strings.ReplaceAll(protoext.DataDigestToString(dig2), " ", "") + require.Equal(t, output2, tmp2) } func TestToStringDataRequest(t *testing.T) { @@ -175,14 +194,18 @@ func TestToStringDataRequest(t *testing.T) { MsgType: gossip.PullMsgType_BLOCK_MSG, } output1 := "data request: nonce: 0 , Msg_type: BLOCK_MSG, digests: [msg1 msg2 msg3]" - require.Equal(t, output1, protoext.DataRequestToString(dataReq1)) + output1 = strings.ReplaceAll(output1, " ", "") + tmp1 := strings.ReplaceAll(protoext.DataRequestToString(dataReq1), " ", "") + require.Equal(t, output1, tmp1) dataReq2 := &gossip.DataRequest{ Nonce: 0, Digests: [][]byte{[]byte("msg1"), []byte("msg2"), []byte("msg3")}, MsgType: gossip.PullMsgType_IDENTITY_MSG, } output2 := "data request: nonce: 0 , Msg_type: IDENTITY_MSG, digests: [6d736731 6d736732 6d736733]" - require.Equal(t, output2, protoext.DataRequestToString(dataReq2)) + output2 = strings.ReplaceAll(output2, " ", "") + tmp2 := strings.ReplaceAll(protoext.DataRequestToString(dataReq2), " ", "") + require.Equal(t, output2, tmp2) } func TestToStringLeadershipMessage(t *testing.T) { @@ -195,7 +218,9 @@ func TestToStringLeadershipMessage(t *testing.T) { IsDeclaration: true, } output := "Leadership Message: PKI-id:11 Timestamp:inc_num:1 seq_num:1 Is Declaration true" - require.Equal(t, output, protoext.LeadershipMessageToString(lm)) + output = strings.ReplaceAll(output, " ", "") + tmp := strings.ReplaceAll(protoext.LeadershipMessageToString(lm), " ", "") + require.Equal(t, output, tmp) } func TestRemotePvtDataResponseToString(t *testing.T) { @@ -206,5 +231,7 @@ func TestRemotePvtDataResponseToString(t *testing.T) { } output := `[tx_id:"tx-id" with 1 elements]` - require.Equal(t, output, protoext.RemovePvtDataResponseToString(res)) + output = strings.ReplaceAll(output, " ", "") + tmp := strings.ReplaceAll(protoext.RemovePvtDataResponseToString(res), " ", "") + require.Equal(t, output, tmp) } diff --git a/gossip/service/eventer.go b/gossip/service/eventer.go index 45b5f3bfe76..c436d46da6e 100644 --- a/gossip/service/eventer.go +++ b/gossip/service/eventer.go @@ -7,11 +7,10 @@ SPDX-License-Identifier: Apache-2.0 package service import ( - "reflect" - - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/channelconfig" "github.com/hyperledger/fabric/msp" + "google.golang.org/protobuf/proto" ) // A ConfigUpdate holds the portions of channelconfig Bundle update used by @@ -56,7 +55,7 @@ func newConfigEventer(receiver configEventReceiver) *configEventer { func (ce *configEventer) ProcessConfigUpdate(configUpdate ConfigUpdate) { logger.Debugf("Processing new config for channel %s", configUpdate.ChannelID) orgMap := cloneOrgConfig(configUpdate.Organizations) - if ce.lastConfig != nil && reflect.DeepEqual(ce.lastConfig.orgMap, orgMap) { + if ce.lastConfig != nil && orgMapEqual(ce.lastConfig.orgMap, orgMap) { logger.Debugf("Ignoring new config for channel %s because it contained no anchor peer updates", configUpdate.ChannelID) } else { @@ -88,6 +87,43 @@ func cloneOrgConfig(src map[string]channelconfig.ApplicationOrg) map[string]chan return clone } +func orgMapEqual(orgs1 map[string]channelconfig.ApplicationOrg, orgs2 map[string]channelconfig.ApplicationOrg) bool { + if len(orgs1) != len(orgs2) { + return false + } + + for k, org1 := range orgs1 { + org2, ok := orgs2[k] + if !ok { + return false + } + if org1.Name() != org2.Name() { + return false + } + if org1.MSPID() != org2.MSPID() { + return false + } + aps1 := org1.AnchorPeers() + aps2 := org2.AnchorPeers() + if len(aps1) != len(aps2) { + return false + } + verified := make(map[int]bool, len(aps1)) + external: + for _, ap1 := range aps1 { + for i, ap2 := range aps2 { + if !verified[i] && proto.Equal(ap1, ap2) { + verified[i] = true + continue external + } + } + return false + } + } + + return true +} + type appGrp struct { name string mspID string diff --git a/gossip/service/eventer_test.go b/gossip/service/eventer_test.go index 8ab580b0d7e..4aa1a4f0e6b 100644 --- a/gossip/service/eventer_test.go +++ b/gossip/service/eventer_test.go @@ -9,7 +9,7 @@ package service import ( "testing" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/channelconfig" "github.com/hyperledger/fabric/gossip/util" "github.com/stretchr/testify/require" @@ -74,8 +74,11 @@ func TestSecondUpdate(t *testing.T) { } ce.ProcessConfigUpdate(cu) - require.Equal(t, cu, mr.cu, "should have updated config on second update but did not") require.Equal(t, 2, mr.updateCount) + require.Equal(t, cu.Sequence, mr.cu.Sequence, "should have updated config on second update but did not") + require.Equal(t, cu.OrdererAddresses, mr.cu.OrdererAddresses, "should have updated config on second update but did not") + require.Equal(t, cu.ChannelID, mr.cu.ChannelID, "should have updated config on second update but did not") + require.True(t, orgMapEqual(cu.Organizations, mr.cu.Organizations), "should have updated config on second update but did not") } func TestSecondSameUpdate(t *testing.T) { diff --git a/gossip/service/gossip_service.go b/gossip/service/gossip_service.go index 95fd807ba17..1e27745bb43 100644 --- a/gossip/service/gossip_service.go +++ b/gossip/service/gossip_service.go @@ -12,9 +12,9 @@ import ( "github.com/hyperledger/fabric-lib-go/bccsp" "github.com/hyperledger/fabric-lib-go/common/flogging" - cb "github.com/hyperledger/fabric-protos-go/common" - gproto "github.com/hyperledger/fabric-protos-go/gossip" - tspb "github.com/hyperledger/fabric-protos-go/transientstore" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + gproto "github.com/hyperledger/fabric-protos-go-apiv2/gossip" + tspb "github.com/hyperledger/fabric-protos-go-apiv2/transientstore" "github.com/hyperledger/fabric/common/deliverclient/blocksprovider" "github.com/hyperledger/fabric/common/deliverclient/orderers" "github.com/hyperledger/fabric/core/committer" diff --git a/gossip/service/gossip_service_test.go b/gossip/service/gossip_service_test.go index d18565ee862..410894ab19a 100644 --- a/gossip/service/gossip_service_test.go +++ b/gossip/service/gossip_service_test.go @@ -17,9 +17,9 @@ import ( "github.com/hyperledger/fabric-lib-go/bccsp/factory" "github.com/hyperledger/fabric-lib-go/bccsp/sw" "github.com/hyperledger/fabric-lib-go/common/metrics/disabled" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/peer" - transientstore2 "github.com/hyperledger/fabric-protos-go/transientstore" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" + transientstore2 "github.com/hyperledger/fabric-protos-go-apiv2/transientstore" "github.com/hyperledger/fabric/common/channelconfig" "github.com/hyperledger/fabric/common/deliverclient/blocksprovider" "github.com/hyperledger/fabric/common/deliverclient/orderers" diff --git a/gossip/service/integration_test.go b/gossip/service/integration_test.go index 3caf40657b0..d853b9e5bab 100644 --- a/gossip/service/integration_test.go +++ b/gossip/service/integration_test.go @@ -17,7 +17,7 @@ import ( "github.com/hyperledger/fabric-lib-go/bccsp" "github.com/hyperledger/fabric-lib-go/bccsp/sw" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/common/channelconfig" "github.com/hyperledger/fabric/common/crypto/tlsgen" "github.com/hyperledger/fabric/common/deliverclient/blocksprovider" diff --git a/gossip/service/join_test.go b/gossip/service/join_test.go index 1eddddaa9c6..064438510cc 100644 --- a/gossip/service/join_test.go +++ b/gossip/service/join_test.go @@ -11,8 +11,8 @@ import ( "testing" "time" - proto "github.com/hyperledger/fabric-protos-go/gossip" - "github.com/hyperledger/fabric-protos-go/peer" + proto "github.com/hyperledger/fabric-protos-go-apiv2/gossip" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/channelconfig" "github.com/hyperledger/fabric/gossip/api" "github.com/hyperledger/fabric/gossip/comm" diff --git a/gossip/state/metrics_test.go b/gossip/state/metrics_test.go index d55ee6c6484..e6454d51199 100644 --- a/gossip/state/metrics_test.go +++ b/gossip/state/metrics_test.go @@ -10,7 +10,7 @@ import ( "sync" "testing" - proto "github.com/hyperledger/fabric-protos-go/gossip" + proto "github.com/hyperledger/fabric-protos-go-apiv2/gossip" "github.com/hyperledger/fabric/gossip/discovery" "github.com/hyperledger/fabric/gossip/metrics" gmetricsmocks "github.com/hyperledger/fabric/gossip/metrics/mocks" diff --git a/gossip/state/mocks/gossip.go b/gossip/state/mocks/gossip.go index bebc9a78529..0033b7ce62f 100644 --- a/gossip/state/mocks/gossip.go +++ b/gossip/state/mocks/gossip.go @@ -7,7 +7,7 @@ SPDX-License-Identifier: Apache-2.0 package mocks import ( - proto "github.com/hyperledger/fabric-protos-go/gossip" + proto "github.com/hyperledger/fabric-protos-go-apiv2/gossip" "github.com/hyperledger/fabric/gossip/api" "github.com/hyperledger/fabric/gossip/comm" "github.com/hyperledger/fabric/gossip/common" diff --git a/gossip/state/mocks/gossip_test.go b/gossip/state/mocks/gossip_test.go index e1543fa09c2..fd59f232220 100644 --- a/gossip/state/mocks/gossip_test.go +++ b/gossip/state/mocks/gossip_test.go @@ -9,7 +9,7 @@ package mocks import ( "testing" - proto "github.com/hyperledger/fabric-protos-go/gossip" + proto "github.com/hyperledger/fabric-protos-go-apiv2/gossip" "github.com/hyperledger/fabric/gossip/api" "github.com/hyperledger/fabric/gossip/common" "github.com/hyperledger/fabric/gossip/discovery" diff --git a/gossip/state/payloads_buffer.go b/gossip/state/payloads_buffer.go index 9149976b7ab..faf9415992c 100644 --- a/gossip/state/payloads_buffer.go +++ b/gossip/state/payloads_buffer.go @@ -11,7 +11,7 @@ import ( "sync/atomic" "github.com/hyperledger/fabric-lib-go/common/metrics" - proto "github.com/hyperledger/fabric-protos-go/gossip" + proto "github.com/hyperledger/fabric-protos-go-apiv2/gossip" "github.com/hyperledger/fabric/gossip/util" ) diff --git a/gossip/state/payloads_buffer_test.go b/gossip/state/payloads_buffer_test.go index abac4d3a8f5..5b9eab1fb04 100644 --- a/gossip/state/payloads_buffer_test.go +++ b/gossip/state/payloads_buffer_test.go @@ -13,7 +13,7 @@ import ( "testing" "time" - proto "github.com/hyperledger/fabric-protos-go/gossip" + proto "github.com/hyperledger/fabric-protos-go-apiv2/gossip" "github.com/hyperledger/fabric/gossip/util" "github.com/stretchr/testify/require" ) diff --git a/gossip/state/state.go b/gossip/state/state.go index f5b80962273..fd2c5f3d69e 100644 --- a/gossip/state/state.go +++ b/gossip/state/state.go @@ -12,12 +12,11 @@ import ( "sync/atomic" "time" - pb "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/common" - proto "github.com/hyperledger/fabric-protos-go/gossip" - "github.com/hyperledger/fabric-protos-go/ledger/rwset" - "github.com/hyperledger/fabric-protos-go/peer" - "github.com/hyperledger/fabric-protos-go/transientstore" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + proto "github.com/hyperledger/fabric-protos-go-apiv2/gossip" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/transientstore" vsccErrors "github.com/hyperledger/fabric/common/errors" "github.com/hyperledger/fabric/gossip/api" "github.com/hyperledger/fabric/gossip/comm" @@ -28,6 +27,7 @@ import ( "github.com/hyperledger/fabric/gossip/util" "github.com/hyperledger/fabric/protoutil" "github.com/pkg/errors" + pb "google.golang.org/protobuf/proto" ) // GossipStateProvider is the interface to acquire sequences of the ledger blocks diff --git a/gossip/state/state_test.go b/gossip/state/state_test.go index e7cab443df5..9c1dca137ff 100644 --- a/gossip/state/state_test.go +++ b/gossip/state/state_test.go @@ -17,14 +17,13 @@ import ( "testing" "time" - pb "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/bccsp/factory" "github.com/hyperledger/fabric-lib-go/common/flogging" "github.com/hyperledger/fabric-lib-go/common/metrics/disabled" - pcomm "github.com/hyperledger/fabric-protos-go/common" - proto "github.com/hyperledger/fabric-protos-go/gossip" - "github.com/hyperledger/fabric-protos-go/ledger/rwset" - tspb "github.com/hyperledger/fabric-protos-go/transientstore" + pcomm "github.com/hyperledger/fabric-protos-go-apiv2/common" + proto "github.com/hyperledger/fabric-protos-go-apiv2/gossip" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset" + tspb "github.com/hyperledger/fabric-protos-go-apiv2/transientstore" "github.com/hyperledger/fabric/common/configtx/test" errors2 "github.com/hyperledger/fabric/common/errors" "github.com/hyperledger/fabric/core/committer" @@ -53,6 +52,7 @@ import ( "github.com/stretchr/testify/require" "go.uber.org/zap" "go.uber.org/zap/zapcore" + pb "google.golang.org/protobuf/proto" ) var ( diff --git a/gossip/util/msgs_test.go b/gossip/util/msgs_test.go index ab539ec4783..bc87ad4a0a2 100644 --- a/gossip/util/msgs_test.go +++ b/gossip/util/msgs_test.go @@ -7,13 +7,13 @@ SPDX-License-Identifier: Apache-2.0 package util import ( - "reflect" "testing" - proto "github.com/hyperledger/fabric-protos-go/gossip" + "github.com/hyperledger/fabric-protos-go-apiv2/gossip" "github.com/hyperledger/fabric/gossip/common" "github.com/hyperledger/fabric/gossip/protoext" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) func init() { @@ -27,7 +27,7 @@ func TestMembershipStore(t *testing.T) { id2 := common.PKIidType("id2") msg1 := &protoext.SignedGossipMessage{} - msg2 := &protoext.SignedGossipMessage{Envelope: &proto.Envelope{}} + msg2 := &protoext.SignedGossipMessage{Envelope: &gossip.Envelope{}} // Test initially created store is empty require.Nil(t, membershipStore.MsgByID(id1)) @@ -46,8 +46,8 @@ func TestMembershipStore(t *testing.T) { require.Nil(t, membershipStore.MsgByID(id1)) require.Equal(t, membershipStore.Size(), 1) // Test returned instance is not a copy - msg3 := &protoext.SignedGossipMessage{GossipMessage: &proto.GossipMessage{}} - msg3Clone := &protoext.SignedGossipMessage{GossipMessage: &proto.GossipMessage{}} + msg3 := &protoext.SignedGossipMessage{GossipMessage: &gossip.GossipMessage{}} + msg3Clone := &protoext.SignedGossipMessage{GossipMessage: &gossip.GossipMessage{}} id3 := common.PKIidType("id3") membershipStore.Put(id3, msg3) require.Equal(t, msg3Clone, msg3) @@ -63,9 +63,9 @@ func TestToSlice(t *testing.T) { id4 := common.PKIidType("id4") msg1 := &protoext.SignedGossipMessage{} - msg2 := &protoext.SignedGossipMessage{Envelope: &proto.Envelope{}} - msg3 := &protoext.SignedGossipMessage{GossipMessage: &proto.GossipMessage{}} - msg4 := &protoext.SignedGossipMessage{GossipMessage: &proto.GossipMessage{}, Envelope: &proto.Envelope{}} + msg2 := &protoext.SignedGossipMessage{Envelope: &gossip.Envelope{}} + msg3 := &protoext.SignedGossipMessage{GossipMessage: &gossip.GossipMessage{}} + msg4 := &protoext.SignedGossipMessage{GossipMessage: &gossip.GossipMessage{}, Envelope: &gossip.Envelope{}} membershipStore.Put(id1, msg1) membershipStore.Put(id2, msg2) @@ -76,7 +76,7 @@ func TestToSlice(t *testing.T) { existsInSlice := func(slice []*protoext.SignedGossipMessage, msg *protoext.SignedGossipMessage) bool { for _, m := range slice { - if reflect.DeepEqual(m, msg) { + if proto.Equal(m.Envelope, msg.Envelope) && proto.Equal(m.GossipMessage, msg.GossipMessage) { return true } } diff --git a/gossip/util/privdata.go b/gossip/util/privdata.go index b1464d09516..4cb6eb86dad 100644 --- a/gossip/util/privdata.go +++ b/gossip/util/privdata.go @@ -10,13 +10,13 @@ import ( "encoding/hex" "fmt" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/gossip" - "github.com/hyperledger/fabric-protos-go/ledger/rwset" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/gossip" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/util" "github.com/hyperledger/fabric/core/ledger" "github.com/pkg/errors" + "google.golang.org/protobuf/proto" ) // PvtDataCollections data type to encapsulate collections @@ -31,6 +31,10 @@ func (pvt *PvtDataCollections) Marshal() ([][]byte, error) { errMsg := fmt.Sprintf("Mallformed private data payload, rwset index %d is nil", index) return nil, errors.New(errMsg) } + if each.WriteSet == nil { + errMsg := fmt.Sprintf("Could not marshal private rwset index %d, due to proto: Marshal called with nil", index) + return nil, errors.New(errMsg) + } pvtBytes, err := proto.Marshal(each.WriteSet) if err != nil { errMsg := fmt.Sprintf("Could not marshal private rwset index %d, due to %s", index, err) diff --git a/gotools.mk b/gotools.mk index de066e4bb46..fbfbfcaa526 100644 --- a/gotools.mk +++ b/gotools.mk @@ -3,25 +3,26 @@ # # SPDX-License-Identifier: Apache-2.0 -GOTOOLS = counterfeiter gendoc ginkgo gocov gocov-xml gofumpt goimports golint govulncheck misspell mockery protoc-gen-go staticcheck swagger +GOTOOLS = counterfeiter gendoc ginkgo gocov gocov-xml gofumpt goimports golint govulncheck misspell mockery protoc-gen-go protoc-gen-go-grpc staticcheck swagger BUILD_DIR ?= build GOTOOLS_BINDIR ?= $(shell go env GOPATH)/bin # go tool->path mapping -go.fqp.counterfeiter := github.com/maxbrunsfeld/counterfeiter/v6 -go.fqp.gendoc := github.com/hyperledger/fabric-lib-go/common/metrics/cmd/gendoc -go.fqp.ginkgo := github.com/onsi/ginkgo/v2/ginkgo -go.fqp.gocov := github.com/axw/gocov/gocov -go.fqp.gocov-xml := github.com/AlekSi/gocov-xml -go.fqp.gofumpt := mvdan.cc/gofumpt -go.fqp.goimports := golang.org/x/tools/cmd/goimports -go.fqp.golint := golang.org/x/lint/golint -go.fqp.govulncheck := golang.org/x/vuln/cmd/govulncheck@latest -go.fqp.misspell := github.com/client9/misspell/cmd/misspell -go.fqp.mockery := github.com/vektra/mockery/cmd/mockery -go.fqp.protoc-gen-go := github.com/golang/protobuf/protoc-gen-go -go.fqp.staticcheck := honnef.co/go/tools/cmd/staticcheck@2023.1.7 -go.fqp.swagger := github.com/go-swagger/go-swagger/cmd/swagger +go.fqp.counterfeiter := github.com/maxbrunsfeld/counterfeiter/v6 +go.fqp.gendoc := github.com/hyperledger/fabric-lib-go/common/metrics/cmd/gendoc +go.fqp.ginkgo := github.com/onsi/ginkgo/v2/ginkgo +go.fqp.gocov := github.com/axw/gocov/gocov +go.fqp.gocov-xml := github.com/AlekSi/gocov-xml +go.fqp.gofumpt := mvdan.cc/gofumpt +go.fqp.goimports := golang.org/x/tools/cmd/goimports +go.fqp.golint := golang.org/x/lint/golint +go.fqp.govulncheck := golang.org/x/vuln/cmd/govulncheck@latest +go.fqp.misspell := github.com/client9/misspell/cmd/misspell +go.fqp.mockery := github.com/vektra/mockery/cmd/mockery +go.fqp.protoc-gen-go := google.golang.org/protobuf/cmd/protoc-gen-go +go.fqp.protoc-gen-go-grpc := google.golang.org/grpc/cmd/protoc-gen-go-grpc +go.fqp.staticcheck := honnef.co/go/tools/cmd/staticcheck@2023.1.7 +go.fqp.swagger := github.com/go-swagger/go-swagger/cmd/swagger .PHONY: gotools-install gotools-install: $(patsubst %,$(GOTOOLS_BINDIR)/%, $(GOTOOLS)) diff --git a/integration/chaincode/keylevelep/chaincode.go b/integration/chaincode/keylevelep/chaincode.go index 55c9a9491a2..173e11490eb 100644 --- a/integration/chaincode/keylevelep/chaincode.go +++ b/integration/chaincode/keylevelep/chaincode.go @@ -10,9 +10,9 @@ import ( "encoding/json" "fmt" - "github.com/hyperledger/fabric-chaincode-go/pkg/statebased" - "github.com/hyperledger/fabric-chaincode-go/shim" - pb "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-chaincode-go/v2/pkg/statebased" + "github.com/hyperledger/fabric-chaincode-go/v2/shim" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" ) /* @@ -35,7 +35,7 @@ are provided: type EndorsementCC struct{} // Init callback -func (cc *EndorsementCC) Init(stub shim.ChaincodeStubInterface) pb.Response { +func (cc *EndorsementCC) Init(stub shim.ChaincodeStubInterface) *pb.Response { err := stub.PutState("pub", []byte("foo")) if err != nil { return shim.Error(err.Error()) @@ -44,7 +44,7 @@ func (cc *EndorsementCC) Init(stub shim.ChaincodeStubInterface) pb.Response { } // Invoke dispatcher -func (cc *EndorsementCC) Invoke(stub shim.ChaincodeStubInterface) pb.Response { +func (cc *EndorsementCC) Invoke(stub shim.ChaincodeStubInterface) *pb.Response { funcName, _ := stub.GetFunctionAndParameters() if function, ok := functions[funcName]; ok { return function(stub) @@ -53,7 +53,7 @@ func (cc *EndorsementCC) Invoke(stub shim.ChaincodeStubInterface) pb.Response { } // function dispatch map used by Invoke() -var functions = map[string]func(stub shim.ChaincodeStubInterface) pb.Response{ +var functions = map[string]func(stub shim.ChaincodeStubInterface) *pb.Response{ "addorgs": addOrgs, "delorgs": delOrgs, "listorgs": listOrgs, @@ -65,7 +65,7 @@ var functions = map[string]func(stub shim.ChaincodeStubInterface) pb.Response{ // addOrgs adds the list of MSP IDs from the invocation parameters // to the state's endorsement policy -func addOrgs(stub shim.ChaincodeStubInterface) pb.Response { +func addOrgs(stub shim.ChaincodeStubInterface) *pb.Response { _, parameters := stub.GetFunctionAndParameters() if len(parameters) < 2 { return shim.Error("No orgs to add specified") @@ -114,7 +114,7 @@ func addOrgs(stub shim.ChaincodeStubInterface) pb.Response { // delOrgs removes the list of MSP IDs from the invocation parameters // from the state's endorsement policy -func delOrgs(stub shim.ChaincodeStubInterface) pb.Response { +func delOrgs(stub shim.ChaincodeStubInterface) *pb.Response { _, parameters := stub.GetFunctionAndParameters() if len(parameters) < 2 { return shim.Error("No orgs to delete specified") @@ -162,7 +162,7 @@ func delOrgs(stub shim.ChaincodeStubInterface) pb.Response { // listOrgs returns the list of organizations currently part of // the state's endorsement policy -func listOrgs(stub shim.ChaincodeStubInterface) pb.Response { +func listOrgs(stub shim.ChaincodeStubInterface) *pb.Response { _, parameters := stub.GetFunctionAndParameters() if len(parameters) < 1 { return shim.Error("No key specified") @@ -199,7 +199,7 @@ func listOrgs(stub shim.ChaincodeStubInterface) pb.Response { } // delEP deletes the state-based endorsement policy for the key altogether -func delEP(stub shim.ChaincodeStubInterface) pb.Response { +func delEP(stub shim.ChaincodeStubInterface) *pb.Response { _, parameters := stub.GetFunctionAndParameters() if len(parameters) < 1 { return shim.Error("No key specified") @@ -222,7 +222,7 @@ func delEP(stub shim.ChaincodeStubInterface) pb.Response { } // setVal sets the value of the KVS key -func setVal(stub shim.ChaincodeStubInterface) pb.Response { +func setVal(stub shim.ChaincodeStubInterface) *pb.Response { args := stub.GetArgs() if len(args) != 3 { return shim.Error("setval expects two arguments") @@ -248,7 +248,7 @@ func setVal(stub shim.ChaincodeStubInterface) pb.Response { } // getVal retrieves the value of the KVS key -func getVal(stub shim.ChaincodeStubInterface) pb.Response { +func getVal(stub shim.ChaincodeStubInterface) *pb.Response { args := stub.GetArgs() if len(args) != 2 { return shim.Error("No key specified") @@ -270,7 +270,7 @@ func getVal(stub shim.ChaincodeStubInterface) pb.Response { } // invokeCC is used for chaincode to chaincode invocation of a given cc on another channel -func invokeCC(stub shim.ChaincodeStubInterface) pb.Response { +func invokeCC(stub shim.ChaincodeStubInterface) *pb.Response { args := stub.GetArgs() if len(args) < 3 { return shim.Error("cc2cc expects at least two arguments (channel and chaincode)") diff --git a/integration/chaincode/keylevelep/cmd/main.go b/integration/chaincode/keylevelep/cmd/main.go index 06e30987532..d3bacde13da 100644 --- a/integration/chaincode/keylevelep/cmd/main.go +++ b/integration/chaincode/keylevelep/cmd/main.go @@ -10,7 +10,7 @@ import ( "fmt" "os" - "github.com/hyperledger/fabric-chaincode-go/shim" + "github.com/hyperledger/fabric-chaincode-go/v2/shim" "github.com/hyperledger/fabric/integration/chaincode/keylevelep" ) diff --git a/integration/chaincode/kvexecutor/chaincode.go b/integration/chaincode/kvexecutor/chaincode.go index 7447af9377f..e563e9f3c24 100644 --- a/integration/chaincode/kvexecutor/chaincode.go +++ b/integration/chaincode/kvexecutor/chaincode.go @@ -11,8 +11,8 @@ import ( "encoding/json" "fmt" - "github.com/hyperledger/fabric-chaincode-go/shim" - pb "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-chaincode-go/v2/shim" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/pkg/errors" ) @@ -33,13 +33,13 @@ type KVData struct { // Init initializes chaincode // =========================== -func (t *KVExecutor) Init(stub shim.ChaincodeStubInterface) pb.Response { +func (t *KVExecutor) Init(stub shim.ChaincodeStubInterface) *pb.Response { return shim.Success(nil) } // Invoke - Our entry point for Invocations // ======================================== -func (t *KVExecutor) Invoke(stub shim.ChaincodeStubInterface) pb.Response { +func (t *KVExecutor) Invoke(stub shim.ChaincodeStubInterface) *pb.Response { function, args := stub.GetFunctionAndParameters() fmt.Println("invoke is running " + function) @@ -54,7 +54,7 @@ func (t *KVExecutor) Invoke(stub shim.ChaincodeStubInterface) pb.Response { } // both params should be marshalled json data and base64 encoded -func (t *KVExecutor) readWriteKVs(stub shim.ChaincodeStubInterface, args []string) pb.Response { +func (t *KVExecutor) readWriteKVs(stub shim.ChaincodeStubInterface, args []string) *pb.Response { if len(args) != 2 { return shim.Error("Incorrect number of arguments. Expecting 2 (readInputs and writeInputs)") } diff --git a/integration/chaincode/kvexecutor/cmd/main.go b/integration/chaincode/kvexecutor/cmd/main.go index 6ccd5b2d70e..5cd01f533ba 100644 --- a/integration/chaincode/kvexecutor/cmd/main.go +++ b/integration/chaincode/kvexecutor/cmd/main.go @@ -10,7 +10,7 @@ import ( "fmt" "os" - "github.com/hyperledger/fabric-chaincode-go/shim" + "github.com/hyperledger/fabric-chaincode-go/v2/shim" "github.com/hyperledger/fabric/integration/chaincode/kvexecutor" ) diff --git a/integration/chaincode/marbles/cmd/main.go b/integration/chaincode/marbles/cmd/main.go index 0332315e3db..8095bfd15ac 100644 --- a/integration/chaincode/marbles/cmd/main.go +++ b/integration/chaincode/marbles/cmd/main.go @@ -10,7 +10,7 @@ import ( "fmt" "os" - "github.com/hyperledger/fabric-chaincode-go/shim" + "github.com/hyperledger/fabric-chaincode-go/v2/shim" "github.com/hyperledger/fabric/integration/chaincode/marbles" ) diff --git a/integration/chaincode/marbles/cmdwithindexspec/main.go b/integration/chaincode/marbles/cmdwithindexspec/main.go index 0332315e3db..8095bfd15ac 100644 --- a/integration/chaincode/marbles/cmdwithindexspec/main.go +++ b/integration/chaincode/marbles/cmdwithindexspec/main.go @@ -10,7 +10,7 @@ import ( "fmt" "os" - "github.com/hyperledger/fabric-chaincode-go/shim" + "github.com/hyperledger/fabric-chaincode-go/v2/shim" "github.com/hyperledger/fabric/integration/chaincode/marbles" ) diff --git a/integration/chaincode/marbles/cmdwithindexspecs/main.go b/integration/chaincode/marbles/cmdwithindexspecs/main.go index 0332315e3db..8095bfd15ac 100644 --- a/integration/chaincode/marbles/cmdwithindexspecs/main.go +++ b/integration/chaincode/marbles/cmdwithindexspecs/main.go @@ -10,7 +10,7 @@ import ( "fmt" "os" - "github.com/hyperledger/fabric-chaincode-go/shim" + "github.com/hyperledger/fabric-chaincode-go/v2/shim" "github.com/hyperledger/fabric/integration/chaincode/marbles" ) diff --git a/integration/chaincode/marbles/marbles_chaincode.go b/integration/chaincode/marbles/marbles_chaincode.go index eb0df7055d3..35138064017 100644 --- a/integration/chaincode/marbles/marbles_chaincode.go +++ b/integration/chaincode/marbles/marbles_chaincode.go @@ -87,8 +87,8 @@ import ( "strings" "time" - "github.com/hyperledger/fabric-chaincode-go/shim" - pb "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-chaincode-go/v2/shim" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" ) // SimpleChaincode example simple Chaincode implementation @@ -111,13 +111,13 @@ type marbleHistory struct { // Init initializes chaincode // =========================== -func (t *SimpleChaincode) Init(stub shim.ChaincodeStubInterface) pb.Response { +func (t *SimpleChaincode) Init(stub shim.ChaincodeStubInterface) *pb.Response { return shim.Success(nil) } // Invoke - Our entry point for Invocations // ======================================== -func (t *SimpleChaincode) Invoke(stub shim.ChaincodeStubInterface) pb.Response { +func (t *SimpleChaincode) Invoke(stub shim.ChaincodeStubInterface) *pb.Response { function, args := stub.GetFunctionAndParameters() fmt.Println("invoke is running " + function) @@ -153,7 +153,7 @@ func (t *SimpleChaincode) Invoke(stub shim.ChaincodeStubInterface) pb.Response { // ============================================================ // initMarble - create a new marble, store into chaincode state // ============================================================ -func (t *SimpleChaincode) initMarble(stub shim.ChaincodeStubInterface, args []string) pb.Response { +func (t *SimpleChaincode) initMarble(stub shim.ChaincodeStubInterface, args []string) *pb.Response { var err error // 0 1 2 3 @@ -236,7 +236,7 @@ func (t *SimpleChaincode) initMarble(stub shim.ChaincodeStubInterface, args []st // =============================================== // readMarble - read a marble from chaincode state // =============================================== -func (t *SimpleChaincode) readMarble(stub shim.ChaincodeStubInterface, args []string) pb.Response { +func (t *SimpleChaincode) readMarble(stub shim.ChaincodeStubInterface, args []string) *pb.Response { var name, jsonResp string var err error @@ -260,7 +260,7 @@ func (t *SimpleChaincode) readMarble(stub shim.ChaincodeStubInterface, args []st // ================================================== // delete - remove a marble key/value pair from state // ================================================== -func (t *SimpleChaincode) delete(stub shim.ChaincodeStubInterface, args []string) pb.Response { +func (t *SimpleChaincode) delete(stub shim.ChaincodeStubInterface, args []string) *pb.Response { var jsonResp string var marbleJSON marble if len(args) != 1 { @@ -307,7 +307,7 @@ func (t *SimpleChaincode) delete(stub shim.ChaincodeStubInterface, args []string // =========================================================== // transfer a marble by setting a new owner name on the marble // =========================================================== -func (t *SimpleChaincode) transferMarble(stub shim.ChaincodeStubInterface, args []string) pb.Response { +func (t *SimpleChaincode) transferMarble(stub shim.ChaincodeStubInterface, args []string) *pb.Response { // 0 1 // "name", "bob" if len(args) < 2 { @@ -405,7 +405,7 @@ func addPaginationMetadataToQueryResults(buffer *bytes.Buffer, responseMetadata // time and commit time. // Therefore, range queries are a safe option for performing update transactions based on query results. // =========================================================================================== -func (t *SimpleChaincode) getMarblesByRange(stub shim.ChaincodeStubInterface, args []string) pb.Response { +func (t *SimpleChaincode) getMarblesByRange(stub shim.ChaincodeStubInterface, args []string) *pb.Response { if len(args) < 2 { return shim.Error("Incorrect number of arguments. Expecting 2") } @@ -437,7 +437,7 @@ func (t *SimpleChaincode) getMarblesByRange(stub shim.ChaincodeStubInterface, ar // committing peers if the result set has changed between endorsement time and commit time. // Therefore, range queries are a safe option for performing update transactions based on query results. // =========================================================================================== -func (t *SimpleChaincode) transferMarblesBasedOnColor(stub shim.ChaincodeStubInterface, args []string) pb.Response { +func (t *SimpleChaincode) transferMarblesBasedOnColor(stub shim.ChaincodeStubInterface, args []string) *pb.Response { // 0 1 // "color", "bob" if len(args) < 2 { @@ -507,7 +507,7 @@ func (t *SimpleChaincode) transferMarblesBasedOnColor(stub shim.ChaincodeStubInt // and accepting a single query parameter (owner). // Only available on state databases that support rich query (e.g. CouchDB) // ========================================================================================= -func (t *SimpleChaincode) queryMarblesByOwner(stub shim.ChaincodeStubInterface, args []string) pb.Response { +func (t *SimpleChaincode) queryMarblesByOwner(stub shim.ChaincodeStubInterface, args []string) *pb.Response { // 0 // "bob" if len(args) < 1 { @@ -532,7 +532,7 @@ func (t *SimpleChaincode) queryMarblesByOwner(stub shim.ChaincodeStubInterface, // If this is not desired, follow the queryMarblesForOwner example for parameterized queries. // Only available on state databases that support rich query (e.g. CouchDB) // ========================================================================================= -func (t *SimpleChaincode) queryMarbles(stub shim.ChaincodeStubInterface, args []string) pb.Response { +func (t *SimpleChaincode) queryMarbles(stub shim.ChaincodeStubInterface, args []string) *pb.Response { // 0 // "queryString" if len(args) < 1 { @@ -590,7 +590,7 @@ func getQueryResultForQueryString(stub shim.ChaincodeStubInterface, queryString // The number of fetched records will be equal to or lesser than the page size. // Paginated range queries are only valid for read only transactions. // =========================================================================================== -func (t *SimpleChaincode) getMarblesByRangeWithPagination(stub shim.ChaincodeStubInterface, args []string) pb.Response { +func (t *SimpleChaincode) getMarblesByRangeWithPagination(stub shim.ChaincodeStubInterface, args []string) *pb.Response { if len(args) < 4 { return shim.Error("Incorrect number of arguments. Expecting 4") } @@ -631,7 +631,7 @@ func (t *SimpleChaincode) getMarblesByRangeWithPagination(stub shim.ChaincodeStu // Only available on state databases that support rich query (e.g. CouchDB) // Paginated queries are only valid for read only transactions. // ========================================================================================= -func (t *SimpleChaincode) queryMarblesWithPagination(stub shim.ChaincodeStubInterface, args []string) pb.Response { +func (t *SimpleChaincode) queryMarblesWithPagination(stub shim.ChaincodeStubInterface, args []string) *pb.Response { // 0 // "queryString" if len(args) < 3 { @@ -678,7 +678,7 @@ func getQueryResultForQueryStringWithPagination(stub shim.ChaincodeStubInterface return buffer.Bytes(), nil } -func (t *SimpleChaincode) getHistoryForMarble(stub shim.ChaincodeStubInterface, args []string) pb.Response { +func (t *SimpleChaincode) getHistoryForMarble(stub shim.ChaincodeStubInterface, args []string) *pb.Response { if len(args) < 1 { return shim.Error("Incorrect number of arguments. Expecting 1") } diff --git a/integration/chaincode/marbles_private/chaincode.go b/integration/chaincode/marbles_private/chaincode.go index 709898a7f0f..9452ea96a55 100644 --- a/integration/chaincode/marbles_private/chaincode.go +++ b/integration/chaincode/marbles_private/chaincode.go @@ -11,9 +11,9 @@ import ( "encoding/json" "fmt" - "github.com/hyperledger/fabric-chaincode-go/pkg/statebased" - "github.com/hyperledger/fabric-chaincode-go/shim" - pb "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-chaincode-go/v2/pkg/statebased" + "github.com/hyperledger/fabric-chaincode-go/v2/shim" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" ) // MarblesPrivateChaincode example Chaincode implementation @@ -35,13 +35,13 @@ type marblePrivateDetails struct { // Init initializes chaincode // =========================== -func (t *MarblesPrivateChaincode) Init(stub shim.ChaincodeStubInterface) pb.Response { +func (t *MarblesPrivateChaincode) Init(stub shim.ChaincodeStubInterface) *pb.Response { return shim.Success(nil) } // Invoke - Our entry point for Invocations // ======================================== -func (t *MarblesPrivateChaincode) Invoke(stub shim.ChaincodeStubInterface) pb.Response { +func (t *MarblesPrivateChaincode) Invoke(stub shim.ChaincodeStubInterface) *pb.Response { function, args := stub.GetFunctionAndParameters() fmt.Println("invoke is running " + function) @@ -90,7 +90,7 @@ func (t *MarblesPrivateChaincode) Invoke(stub shim.ChaincodeStubInterface) pb.Re // ============================================================ // initMarble - create a new marble, store into chaincode state // ============================================================ -func (t *MarblesPrivateChaincode) initMarble(stub shim.ChaincodeStubInterface, args []string) pb.Response { +func (t *MarblesPrivateChaincode) initMarble(stub shim.ChaincodeStubInterface, args []string) *pb.Response { var err error type marbleTransientInput struct { @@ -213,7 +213,7 @@ func (t *MarblesPrivateChaincode) initMarble(stub shim.ChaincodeStubInterface, a // =============================================== // readMarble - read a marble from chaincode state // =============================================== -func (t *MarblesPrivateChaincode) readMarble(stub shim.ChaincodeStubInterface, args []string) pb.Response { +func (t *MarblesPrivateChaincode) readMarble(stub shim.ChaincodeStubInterface, args []string) *pb.Response { var name, jsonResp string var err error @@ -237,7 +237,7 @@ func (t *MarblesPrivateChaincode) readMarble(stub shim.ChaincodeStubInterface, a // =============================================== // readMarblereadMarblePrivateDetails - read a marble private details from chaincode state // =============================================== -func (t *MarblesPrivateChaincode) readMarblePrivateDetails(stub shim.ChaincodeStubInterface, args []string) pb.Response { +func (t *MarblesPrivateChaincode) readMarblePrivateDetails(stub shim.ChaincodeStubInterface, args []string) *pb.Response { var name, jsonResp string var err error @@ -261,7 +261,7 @@ func (t *MarblesPrivateChaincode) readMarblePrivateDetails(stub shim.ChaincodeSt // =============================================== // getMarbleHash - get marble private data hash for collectionMarbles from chaincode state // =============================================== -func (t *MarblesPrivateChaincode) getMarbleHash(stub shim.ChaincodeStubInterface, args []string) pb.Response { +func (t *MarblesPrivateChaincode) getMarbleHash(stub shim.ChaincodeStubInterface, args []string) *pb.Response { var name, jsonResp string var err error @@ -285,7 +285,7 @@ func (t *MarblesPrivateChaincode) getMarbleHash(stub shim.ChaincodeStubInterface // =============================================== // getMarblePrivateDetailsHash - get marble private data hash for collectionMarblePrivateDetails from chaincode state // =============================================== -func (t *MarblesPrivateChaincode) getMarblePrivateDetailsHash(stub shim.ChaincodeStubInterface, args []string) pb.Response { +func (t *MarblesPrivateChaincode) getMarblePrivateDetailsHash(stub shim.ChaincodeStubInterface, args []string) *pb.Response { var name, jsonResp string var err error @@ -309,7 +309,7 @@ func (t *MarblesPrivateChaincode) getMarblePrivateDetailsHash(stub shim.Chaincod // ================================================== // delete - remove a marble key/value pair from state // ================================================== -func (t *MarblesPrivateChaincode) delete(stub shim.ChaincodeStubInterface, args []string) pb.Response { +func (t *MarblesPrivateChaincode) delete(stub shim.ChaincodeStubInterface, args []string) *pb.Response { fmt.Println("- start delete marble") type marbleDeleteTransientInput struct { @@ -388,7 +388,7 @@ func (t *MarblesPrivateChaincode) delete(stub shim.ChaincodeStubInterface, args // purge - remove a marble key/value pair from state and // remove all trace of private details // ===================================================== -func (t *MarblesPrivateChaincode) purge(stub shim.ChaincodeStubInterface, args []string) pb.Response { +func (t *MarblesPrivateChaincode) purge(stub shim.ChaincodeStubInterface, args []string) *pb.Response { fmt.Println("- start purge marble") type marblePurgeTransientInput struct { @@ -466,7 +466,7 @@ func (t *MarblesPrivateChaincode) purge(stub shim.ChaincodeStubInterface, args [ // =========================================================== // transfer a marble by setting a new owner name on the marble // =========================================================== -func (t *MarblesPrivateChaincode) transferMarble(stub shim.ChaincodeStubInterface, args []string) pb.Response { +func (t *MarblesPrivateChaincode) transferMarble(stub shim.ChaincodeStubInterface, args []string) *pb.Response { fmt.Println("- start transfer marble") type marbleTransferTransientInput struct { @@ -540,7 +540,7 @@ func (t *MarblesPrivateChaincode) transferMarble(stub shim.ChaincodeStubInterfac // time and commit time. // Therefore, range queries are a safe option for performing update transactions based on query results. // =========================================================================================== -func (t *MarblesPrivateChaincode) getMarblesByRange(stub shim.ChaincodeStubInterface, args []string) pb.Response { +func (t *MarblesPrivateChaincode) getMarblesByRange(stub shim.ChaincodeStubInterface, args []string) *pb.Response { if len(args) < 2 { return shim.Error("Incorrect number of arguments. Expecting 2") } @@ -587,7 +587,7 @@ func (t *MarblesPrivateChaincode) getMarblesByRange(stub shim.ChaincodeStubInter // ============================================================ // setStateBasedEndorsementPolicy - set key based endorsement policy // ============================================================ -func (t *MarblesPrivateChaincode) setStateBasedEndorsementPolicy(stub shim.ChaincodeStubInterface, args []string) pb.Response { +func (t *MarblesPrivateChaincode) setStateBasedEndorsementPolicy(stub shim.ChaincodeStubInterface, args []string) *pb.Response { fmt.Println("- start set marble endorsement policy") type marblePolicyTransientInput struct { @@ -654,7 +654,7 @@ func (t *MarblesPrivateChaincode) setStateBasedEndorsementPolicy(stub shim.Chain } // CheckEndorsingOrg checks that the peer org is present in the given transient data -func (t *MarblesPrivateChaincode) checkEndorsingOrg(stub shim.ChaincodeStubInterface) pb.Response { +func (t *MarblesPrivateChaincode) checkEndorsingOrg(stub shim.ChaincodeStubInterface) *pb.Response { transient, err := stub.GetTransient() if err != nil { return shim.Error(fmt.Sprintf("failed to get transient data: %v", err)) diff --git a/integration/chaincode/marbles_private/cmd/main.go b/integration/chaincode/marbles_private/cmd/main.go index 0f75a96fb9e..b0564c9ffc1 100644 --- a/integration/chaincode/marbles_private/cmd/main.go +++ b/integration/chaincode/marbles_private/cmd/main.go @@ -10,7 +10,7 @@ import ( "fmt" "os" - "github.com/hyperledger/fabric-chaincode-go/shim" + "github.com/hyperledger/fabric-chaincode-go/v2/shim" "github.com/hyperledger/fabric/integration/chaincode/marbles_private" ) diff --git a/integration/chaincode/module/go.mod b/integration/chaincode/module/go.mod index 73ba3065817..a2a2af93484 100644 --- a/integration/chaincode/module/go.mod +++ b/integration/chaincode/module/go.mod @@ -1,8 +1,17 @@ module module -go 1.12 +go 1.23 require ( - github.com/hyperledger/fabric-chaincode-go v0.0.0-20190823162523-04390e015b85 - github.com/hyperledger/fabric-protos-go v0.0.0-20190823190507-26c33c998676 + github.com/hyperledger/fabric-chaincode-go/v2 v2.0.0-20240802023949-a356b32676fd + github.com/hyperledger/fabric-protos-go-apiv2 v0.3.3 +) + +require ( + golang.org/x/net v0.25.0 // indirect + golang.org/x/sys v0.20.0 // indirect + golang.org/x/text v0.15.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 // indirect + google.golang.org/grpc v1.65.0 // indirect + google.golang.org/protobuf v1.34.2 // indirect ) diff --git a/integration/chaincode/module/go.sum b/integration/chaincode/module/go.sum index 6a0afb2ca74..11c175104fc 100644 --- a/integration/chaincode/module/go.sum +++ b/integration/chaincode/module/go.sum @@ -1,52 +1,26 @@ -cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= -github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= -github.com/hyperledger/fabric-chaincode-go v0.0.0-20190823162523-04390e015b85 h1:VEm3tPRTCzq3J/1XpVERh1PbOSnshUVwx2G5s3cLiTw= -github.com/hyperledger/fabric-chaincode-go v0.0.0-20190823162523-04390e015b85/go.mod h1:HZK6PKLWrvdD/t0oSLiyaRaUM6fZ7qjJuOlb0zrn0mo= -github.com/hyperledger/fabric-protos-go v0.0.0-20190821214336-621b908d5022/go.mod h1:xVYTjK4DtZRBxZ2D9aE4y6AbLaPwue2o/criQyQbVD0= -github.com/hyperledger/fabric-protos-go v0.0.0-20190823190507-26c33c998676 h1:35/AU/6kOZgrblvSjglQ6yoz3opCKTpfoMjQygtCD/U= -github.com/hyperledger/fabric-protos-go v0.0.0-20190823190507-26c33c998676/go.mod h1:xVYTjK4DtZRBxZ2D9aE4y6AbLaPwue2o/criQyQbVD0= -github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= -github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/hyperledger/fabric-chaincode-go/v2 v2.0.0-20240802023949-a356b32676fd h1:oKqsj1ZcFHsiTkgQnOXnMlb3auklCSz8A+xg6T4Hul4= +github.com/hyperledger/fabric-chaincode-go/v2 v2.0.0-20240802023949-a356b32676fd/go.mod h1:c0qeSZK5N/SehpFRaA3CPlLlpfySyNq/DeJV1/tmqG0= +github.com/hyperledger/fabric-protos-go-apiv2 v0.3.3 h1:Xpd6fzG/KjAOHJsq7EQXY2l+qi/y8muxBaY7R6QWABk= +github.com/hyperledger/fabric-protos-go-apiv2 v0.3.3/go.mod h1:2pq0ui6ZWA0cC8J+eCErgnMDCS1kPOEYVY+06ZAK0qE= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/net v0.0.0-20190311183353-d8887717615a h1:oWX7TPOiFAMXLq8o0ikBYfCJVlRHBcsciT5bXOrH628= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190522155817-f3200d17e092 h1:4QSRKanuywn15aTZvI/mIDEgPQpswuFndXpOj3rKEco= -golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190710143415-6ec70d6a5542 h1:6ZQFf1D2YYDDI7eSwW8adlkkavTB9sw5I24FVtEvNUQ= -golang.org/x/sys v0.0.0-20190710143415-6ec70d6a5542/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8 h1:Nw54tB0rB7hY/N0NQvRW8DG4Yk3Q6T9cu9RcFQDu1tc= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20180831171423-11092d34479b h1:lohp5blsw53GBXtLyLNaTXPXS9pJ1tiTw61ZHUoE9Qw= -google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/grpc v1.23.0 h1:AzbTB6ux+okLTzP8Ru1Xs41C303zdcfEht7MQnYJt5A= -google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= +golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= +golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= +golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= +golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 h1:Zy9XzmMEflZ/MAaA7vNcoebnRAld7FsPW1EeBB7V0m8= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= +google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc= +google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/integration/chaincode/module/main.go b/integration/chaincode/module/main.go index 4ea20df2096..4e29c707c81 100644 --- a/integration/chaincode/module/main.go +++ b/integration/chaincode/module/main.go @@ -11,14 +11,14 @@ import ( "os" "strconv" - "github.com/hyperledger/fabric-chaincode-go/shim" - pb "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-chaincode-go/v2/shim" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" ) // SimpleChaincode example simple Chaincode implementation type SimpleChaincode struct{} -func (t *SimpleChaincode) Init(stub shim.ChaincodeStubInterface) pb.Response { +func (t *SimpleChaincode) Init(stub shim.ChaincodeStubInterface) *pb.Response { fmt.Println("Init invoked") _, args := stub.GetFunctionAndParameters() var A, B string // Entities @@ -57,7 +57,7 @@ func (t *SimpleChaincode) Init(stub shim.ChaincodeStubInterface) pb.Response { return shim.Success(nil) } -func (t *SimpleChaincode) Invoke(stub shim.ChaincodeStubInterface) pb.Response { +func (t *SimpleChaincode) Invoke(stub shim.ChaincodeStubInterface) *pb.Response { fmt.Println("ex02 Invoke") function, args := stub.GetFunctionAndParameters() switch function { @@ -79,7 +79,7 @@ func (t *SimpleChaincode) Invoke(stub shim.ChaincodeStubInterface) pb.Response { } // Transaction makes payment of X units from A to B -func (t *SimpleChaincode) invoke(stub shim.ChaincodeStubInterface, args []string) pb.Response { +func (t *SimpleChaincode) invoke(stub shim.ChaincodeStubInterface, args []string) *pb.Response { var A, B string // Entities var Aval, Bval int // Asset holdings var X int // Transaction value @@ -136,7 +136,7 @@ func (t *SimpleChaincode) invoke(stub shim.ChaincodeStubInterface, args []string } // Deletes an entity from state -func (t *SimpleChaincode) delete(stub shim.ChaincodeStubInterface, args []string) pb.Response { +func (t *SimpleChaincode) delete(stub shim.ChaincodeStubInterface, args []string) *pb.Response { if len(args) != 1 { return shim.Error("Incorrect number of arguments. Expecting 1") } @@ -153,7 +153,7 @@ func (t *SimpleChaincode) delete(stub shim.ChaincodeStubInterface, args []string } // query callback representing the query of a chaincode -func (t *SimpleChaincode) query(stub shim.ChaincodeStubInterface, args []string) pb.Response { +func (t *SimpleChaincode) query(stub shim.ChaincodeStubInterface, args []string) *pb.Response { var A string // Entities var err error @@ -181,7 +181,7 @@ func (t *SimpleChaincode) query(stub shim.ChaincodeStubInterface, args []string) } // respond simply generates a response payload from the args -func (t *SimpleChaincode) respond(stub shim.ChaincodeStubInterface, args []string) pb.Response { +func (t *SimpleChaincode) respond(stub shim.ChaincodeStubInterface, args []string) *pb.Response { if len(args) != 3 { return shim.Error("expected three arguments") } @@ -193,7 +193,7 @@ func (t *SimpleChaincode) respond(stub shim.ChaincodeStubInterface, args []strin message := args[1] payload := []byte(args[2]) - return pb.Response{ + return &pb.Response{ Status: int32(status), Message: message, Payload: payload, diff --git a/integration/chaincode/server/main.go b/integration/chaincode/server/main.go index fcd2092fe62..d05b3949146 100644 --- a/integration/chaincode/server/main.go +++ b/integration/chaincode/server/main.go @@ -11,7 +11,7 @@ import ( "fmt" "os" - "github.com/hyperledger/fabric-chaincode-go/shim" + "github.com/hyperledger/fabric-chaincode-go/v2/shim" "github.com/hyperledger/fabric/integration/chaincode/simple" ) diff --git a/integration/chaincode/simple/chaincode.go b/integration/chaincode/simple/chaincode.go index 96c13ec26e6..c5246dadd81 100644 --- a/integration/chaincode/simple/chaincode.go +++ b/integration/chaincode/simple/chaincode.go @@ -11,14 +11,14 @@ import ( "os" "strconv" - "github.com/hyperledger/fabric-chaincode-go/shim" - pb "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-chaincode-go/v2/shim" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" ) // SimpleChaincode example simple Chaincode implementation type SimpleChaincode struct{} -func (t *SimpleChaincode) Init(stub shim.ChaincodeStubInterface) pb.Response { +func (t *SimpleChaincode) Init(stub shim.ChaincodeStubInterface) *pb.Response { fmt.Println("Init invoked") _, args := stub.GetFunctionAndParameters() var A, B string // Entities @@ -57,7 +57,7 @@ func (t *SimpleChaincode) Init(stub shim.ChaincodeStubInterface) pb.Response { return shim.Success(nil) } -func (t *SimpleChaincode) Invoke(stub shim.ChaincodeStubInterface) pb.Response { +func (t *SimpleChaincode) Invoke(stub shim.ChaincodeStubInterface) *pb.Response { fmt.Println("ex02 Invoke") if os.Getenv("DEVMODE_ENABLED") != "" { fmt.Println("invoking in devmode") @@ -89,7 +89,7 @@ func (t *SimpleChaincode) Invoke(stub shim.ChaincodeStubInterface) pb.Response { } // Transaction makes payment of X units from A to B -func (t *SimpleChaincode) invoke(stub shim.ChaincodeStubInterface, args []string) pb.Response { +func (t *SimpleChaincode) invoke(stub shim.ChaincodeStubInterface, args []string) *pb.Response { var A, B string // Entities var Aval, Bval int // Asset holdings var X int // Transaction value @@ -146,7 +146,7 @@ func (t *SimpleChaincode) invoke(stub shim.ChaincodeStubInterface, args []string } // Deletes an entity from state -func (t *SimpleChaincode) delete(stub shim.ChaincodeStubInterface, args []string) pb.Response { +func (t *SimpleChaincode) delete(stub shim.ChaincodeStubInterface, args []string) *pb.Response { if len(args) != 1 { return shim.Error("Incorrect number of arguments. Expecting 1") } @@ -163,7 +163,7 @@ func (t *SimpleChaincode) delete(stub shim.ChaincodeStubInterface, args []string } // query callback representing the query of a chaincode -func (t *SimpleChaincode) query(stub shim.ChaincodeStubInterface, args []string) pb.Response { +func (t *SimpleChaincode) query(stub shim.ChaincodeStubInterface, args []string) *pb.Response { var A string // Entities var err error @@ -191,7 +191,7 @@ func (t *SimpleChaincode) query(stub shim.ChaincodeStubInterface, args []string) } // respond simply generates a response payload from the args -func (t *SimpleChaincode) respond(stub shim.ChaincodeStubInterface, args []string) pb.Response { +func (t *SimpleChaincode) respond(stub shim.ChaincodeStubInterface, args []string) *pb.Response { if len(args) != 3 { return shim.Error("expected three arguments") } @@ -203,7 +203,7 @@ func (t *SimpleChaincode) respond(stub shim.ChaincodeStubInterface, args []strin message := args[1] payload := []byte(args[2]) - return pb.Response{ + return &pb.Response{ Status: int32(status), Message: message, Payload: payload, @@ -212,7 +212,7 @@ func (t *SimpleChaincode) respond(stub shim.ChaincodeStubInterface, args []strin // mspid simply calls shim.GetMSPID() to verify the mspid was properly passed from the peer // via the CORE_PEER_LOCALMSPID env var -func (t *SimpleChaincode) mspid(args []string) pb.Response { +func (t *SimpleChaincode) mspid(args []string) *pb.Response { if len(args) != 0 { return shim.Error("expected no arguments") } @@ -234,7 +234,7 @@ func (t *SimpleChaincode) mspid(args []string) pb.Response { } // event emits a chaincode event -func (t *SimpleChaincode) event(stub shim.ChaincodeStubInterface, args []string) pb.Response { +func (t *SimpleChaincode) event(stub shim.ChaincodeStubInterface, args []string) *pb.Response { if len(args) != 2 { return shim.Error("Incorrect number of arguments. Expecting 2") } @@ -247,7 +247,7 @@ func (t *SimpleChaincode) event(stub shim.ChaincodeStubInterface, args []string) } // Issue asset holding. Can only be done once. -func (t *SimpleChaincode) issue(stub shim.ChaincodeStubInterface, args []string) pb.Response { +func (t *SimpleChaincode) issue(stub shim.ChaincodeStubInterface, args []string) *pb.Response { fmt.Printf("Entry: issue\n") if len(args) != 2 { diff --git a/integration/chaincode/simple/cmd/main.go b/integration/chaincode/simple/cmd/main.go index 078b6324c77..05dcf1e642c 100644 --- a/integration/chaincode/simple/cmd/main.go +++ b/integration/chaincode/simple/cmd/main.go @@ -12,7 +12,7 @@ import ( "os/signal" "syscall" - "github.com/hyperledger/fabric-chaincode-go/shim" + "github.com/hyperledger/fabric-chaincode-go/v2/shim" "github.com/hyperledger/fabric/integration/chaincode/simple" ) diff --git a/integration/channelparticipation/channel_participation.go b/integration/channelparticipation/channel_participation.go index 9a5687e9aa8..ae70c82d9b6 100644 --- a/integration/channelparticipation/channel_participation.go +++ b/integration/channelparticipation/channel_participation.go @@ -15,8 +15,7 @@ import ( "net/http" "time" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/integration/nwo" "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" @@ -24,6 +23,7 @@ import ( "github.com/onsi/gomega/gstruct" "github.com/onsi/gomega/types" ginkgomon "github.com/tedsuo/ifrit/ginkgomon_v2" + "google.golang.org/protobuf/proto" ) func Join(n *nwo.Network, o *nwo.Orderer, channel string, block *common.Block, expectedChannelInfo ChannelInfo) { diff --git a/integration/configtx/configtx_test.go b/integration/configtx/configtx_test.go index 79ae3b1f8e7..740e15d368a 100644 --- a/integration/configtx/configtx_test.go +++ b/integration/configtx/configtx_test.go @@ -16,7 +16,7 @@ import ( docker "github.com/fsouza/go-dockerclient" "github.com/hyperledger/fabric-config/configtx" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/integration/channelparticipation" "github.com/hyperledger/fabric/integration/nwo" "github.com/hyperledger/fabric/integration/ordererclient" diff --git a/integration/configtx/consenter_mapping_test.go b/integration/configtx/consenter_mapping_test.go index 99d35fc509e..65658abfff1 100644 --- a/integration/configtx/consenter_mapping_test.go +++ b/integration/configtx/consenter_mapping_test.go @@ -9,12 +9,12 @@ package configtx import ( "os" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/integration/nwo" "github.com/hyperledger/fabric/protoutil" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" + "google.golang.org/protobuf/proto" ) var _ = Describe("ConfigTx ConsenterMapping", func() { diff --git a/integration/discovery/discovery_test.go b/integration/discovery/discovery_test.go index ddc6299a7e6..021920777d5 100644 --- a/integration/discovery/discovery_test.go +++ b/integration/discovery/discovery_test.go @@ -15,10 +15,9 @@ import ( "time" docker "github.com/fsouza/go-dockerclient" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/discovery" - pm "github.com/hyperledger/fabric-protos-go/msp" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/discovery" + pm "github.com/hyperledger/fabric-protos-go-apiv2/msp" "github.com/hyperledger/fabric/common/policydsl" "github.com/hyperledger/fabric/integration/channelparticipation" "github.com/hyperledger/fabric/integration/nwo" @@ -32,6 +31,7 @@ import ( "github.com/onsi/gomega/gexec" "github.com/tedsuo/ifrit" ginkgomon "github.com/tedsuo/ifrit/ginkgomon_v2" + "google.golang.org/protobuf/proto" ) var _ = Describe("DiscoveryService", func() { @@ -293,11 +293,17 @@ var _ = Describe("DiscoveryService", func() { By("validating the orderers") Expect(discoveredConfig.Orderers).To(HaveLen(len(network.Orderers))) + external: for _, orderer := range network.Orderers { ordererMSPID := network.Organization(orderer.Organization).MSPID - Expect(discoveredConfig.Orderers[ordererMSPID].Endpoint).To(ConsistOf( - &discovery.Endpoint{Host: "127.0.0.1", Port: uint32(network.OrdererPort(orderer, nwo.ListenPort))}, - )) + for _, endpoint := range discoveredConfig.Orderers[ordererMSPID].Endpoint { + if proto.Equal(endpoint, + &discovery.Endpoint{Host: "127.0.0.1", Port: uint32(network.OrdererPort(orderer, nwo.ListenPort))}, + ) { + continue external + } + } + Fail("no match orderer host") } // @@ -348,7 +354,7 @@ var _ = Describe("DiscoveryService", func() { sess, err := network.Discover(endorsers) Expect(err).NotTo(HaveOccurred()) Eventually(sess, network.EventuallyTimeout).Should(gexec.Exit(1)) - Expect(sess.Err).To(gbytes.Say(`failed constructing descriptor for chaincodes:", 0)) - Expect(proto.MessageV1(rpcErr.Details()[0]).(*gateway.ErrorDetail).Message).To(ContainSubstring("request unauthorized due to incorrect timestamp")) + Expect(rpcErr.Details()[0].(*gateway.ErrorDetail).Message).To(ContainSubstring("request unauthorized due to incorrect timestamp")) By("sub 30 minute") err = endorser(network, timestamppb.New(time.Now().Add(-time.Minute*30))) rpcErr = status.Convert(err) Expect(rpcErr.Message()).To(Equal("failed to collect enough transaction endorsements, see attached details for more info")) Expect(len(rpcErr.Details())).To(BeNumerically(">", 0)) - Expect(proto.MessageV1(rpcErr.Details()[0]).(*gateway.ErrorDetail).Message).To(ContainSubstring("request unauthorized due to incorrect timestamp")) + Expect(rpcErr.Details()[0].(*gateway.ErrorDetail).Message).To(ContainSubstring("request unauthorized due to incorrect timestamp")) }) }) diff --git a/integration/gateway/endorsing_orgs_test.go b/integration/gateway/endorsing_orgs_test.go index 9737d83b78b..6fe1f72f0be 100644 --- a/integration/gateway/endorsing_orgs_test.go +++ b/integration/gateway/endorsing_orgs_test.go @@ -13,8 +13,8 @@ import ( "syscall" docker "github.com/fsouza/go-dockerclient" - "github.com/hyperledger/fabric-protos-go/gateway" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/gateway" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/integration/channelparticipation" "github.com/hyperledger/fabric/integration/nwo" . "github.com/hyperledger/fabric/internal/test" diff --git a/integration/gateway/gateway_bft_test.go b/integration/gateway/gateway_bft_test.go index e8ac62ed892..2d684885f82 100644 --- a/integration/gateway/gateway_bft_test.go +++ b/integration/gateway/gateway_bft_test.go @@ -17,10 +17,9 @@ import ( "time" docker "github.com/fsouza/go-dockerclient" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/gateway" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/gateway" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/integration/channelparticipation" "github.com/hyperledger/fabric/integration/nwo" "github.com/hyperledger/fabric/integration/nwo/commands" @@ -32,6 +31,7 @@ import ( ginkgomon "github.com/tedsuo/ifrit/ginkgomon_v2" "github.com/tedsuo/ifrit/grouper" "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" ) var _ = Describe("GatewayService with BFT ordering service", func() { @@ -139,7 +139,7 @@ var _ = Describe("GatewayService with BFT ordering service", func() { rpcErr := status.Convert(err) Expect(rpcErr.Message()).To(Equal("insufficient number of orderers could successfully process transaction to satisfy quorum requirement")) Expect(len(rpcErr.Details())).To(BeNumerically(">", 0)) - Expect(proto.MessageV1(rpcErr.Details()[0]).(*gateway.ErrorDetail).Message).To(Equal("received unsuccessful response from orderer: status=SERVICE_UNAVAILABLE, info=failed to submit request: request already processed")) + Expect(rpcErr.Details()[0].(*gateway.ErrorDetail).Message).To(Equal("received unsuccessful response from orderer: status=SERVICE_UNAVAILABLE, info=failed to submit request: request already processed")) By("Shutting down orderer2") ordererProcesses["orderer2"].Signal(syscall.SIGTERM) diff --git a/integration/gateway/gateway_discovery_test.go b/integration/gateway/gateway_discovery_test.go index 09feb2f5785..c76283f5cad 100644 --- a/integration/gateway/gateway_discovery_test.go +++ b/integration/gateway/gateway_discovery_test.go @@ -13,9 +13,8 @@ import ( "syscall" docker "github.com/fsouza/go-dockerclient" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/gateway" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/gateway" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/integration/channelparticipation" "github.com/hyperledger/fabric/integration/nwo" "github.com/hyperledger/fabric/protoutil" @@ -23,6 +22,7 @@ import ( . "github.com/onsi/gomega" "github.com/tedsuo/ifrit" ginkgomon "github.com/tedsuo/ifrit/ginkgomon_v2" + "google.golang.org/protobuf/proto" ) var _ = Describe("GatewayService with endorser discovery", func() { diff --git a/integration/gateway/gateway_test.go b/integration/gateway/gateway_test.go index db98befbe12..2baaed31172 100644 --- a/integration/gateway/gateway_test.go +++ b/integration/gateway/gateway_test.go @@ -14,12 +14,11 @@ import ( "time" docker "github.com/fsouza/go-dockerclient" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/gateway" - "github.com/hyperledger/fabric-protos-go/orderer" - "github.com/hyperledger/fabric-protos-go/peer" - "github.com/hyperledger/fabric-protos-go/peer/lifecycle" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/gateway" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer/lifecycle" "github.com/hyperledger/fabric/integration/channelparticipation" "github.com/hyperledger/fabric/integration/nwo" . "github.com/hyperledger/fabric/internal/test" @@ -31,6 +30,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" ) func NewProposedTransaction(signingIdentity *nwo.SigningIdentity, channelName, chaincodeName, transactionName string, transientData map[string][]byte, args ...[]byte) (*peer.SignedProposal, string) { diff --git a/integration/ledger/reset_rollback_test.go b/integration/ledger/reset_rollback_test.go index e05e8f3b74a..a7fdf2e8556 100644 --- a/integration/ledger/reset_rollback_test.go +++ b/integration/ledger/reset_rollback_test.go @@ -16,7 +16,7 @@ import ( "syscall" docker "github.com/fsouza/go-dockerclient" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/integration/channelparticipation" "github.com/hyperledger/fabric/integration/nwo" "github.com/hyperledger/fabric/integration/nwo/commands" diff --git a/integration/ledger/snapshot_test.go b/integration/ledger/snapshot_test.go index 72555f321e9..6f099111d6c 100644 --- a/integration/ledger/snapshot_test.go +++ b/integration/ledger/snapshot_test.go @@ -20,9 +20,9 @@ import ( "time" docker "github.com/fsouza/go-dockerclient" - cb "github.com/hyperledger/fabric-protos-go/common" - ab "github.com/hyperledger/fabric-protos-go/orderer" - pb "github.com/hyperledger/fabric-protos-go/peer" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + ab "github.com/hyperledger/fabric-protos-go-apiv2/orderer" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/core/ledger/util" "github.com/hyperledger/fabric/integration/chaincode/kvexecutor" "github.com/hyperledger/fabric/integration/channelparticipation" diff --git a/integration/lifecycle/capabilities_endorse_test.go b/integration/lifecycle/capabilities_endorse_test.go index 4470fa35ae1..bc7930a0e10 100644 --- a/integration/lifecycle/capabilities_endorse_test.go +++ b/integration/lifecycle/capabilities_endorse_test.go @@ -21,10 +21,8 @@ import ( "github.com/hyperledger/fabric/integration/channelparticipation" "github.com/hyperledger/fabric/integration/nwo" "github.com/hyperledger/fabric/integration/raft" - . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" - "github.com/tedsuo/ifrit" "github.com/tedsuo/ifrit/ginkgomon_v2" ) diff --git a/integration/lifecycle/chaincode/callee/chaincode.go b/integration/lifecycle/chaincode/callee/chaincode.go index e180268d626..1b8f77aab8d 100644 --- a/integration/lifecycle/chaincode/callee/chaincode.go +++ b/integration/lifecycle/chaincode/callee/chaincode.go @@ -7,14 +7,14 @@ SPDX-License-Identifier: Apache-2.0 package callee import ( - "github.com/hyperledger/fabric-chaincode-go/shim" - pb "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-chaincode-go/v2/shim" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" ) // CC example simple Chaincode implementation type CC struct{} -func (t *CC) Init(stub shim.ChaincodeStubInterface) pb.Response { +func (t *CC) Init(stub shim.ChaincodeStubInterface) *pb.Response { err := stub.PutState("foo", []byte("callee:foo")) if err != nil { return shim.Error(err.Error()) @@ -23,7 +23,7 @@ func (t *CC) Init(stub shim.ChaincodeStubInterface) pb.Response { return shim.Success(nil) } -func (t *CC) Invoke(stub shim.ChaincodeStubInterface) pb.Response { +func (t *CC) Invoke(stub shim.ChaincodeStubInterface) *pb.Response { fn, _ := stub.GetFunctionAndParameters() switch fn { case "INVOKE": diff --git a/integration/lifecycle/chaincode/callee/cmd/main.go b/integration/lifecycle/chaincode/callee/cmd/main.go index df60ab7f613..520338e7e1b 100644 --- a/integration/lifecycle/chaincode/callee/cmd/main.go +++ b/integration/lifecycle/chaincode/callee/cmd/main.go @@ -10,7 +10,7 @@ import ( "fmt" "os" - "github.com/hyperledger/fabric-chaincode-go/shim" + "github.com/hyperledger/fabric-chaincode-go/v2/shim" "github.com/hyperledger/fabric/integration/lifecycle/chaincode/callee" ) diff --git a/integration/lifecycle/chaincode/caller/chaincode.go b/integration/lifecycle/chaincode/caller/chaincode.go index 10df07cbb03..eebf0dd42fe 100644 --- a/integration/lifecycle/chaincode/caller/chaincode.go +++ b/integration/lifecycle/chaincode/caller/chaincode.go @@ -7,14 +7,14 @@ SPDX-License-Identifier: Apache-2.0 package caller import ( - "github.com/hyperledger/fabric-chaincode-go/shim" - pb "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-chaincode-go/v2/shim" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" ) // CC example simple Chaincode implementation type CC struct{} -func (t *CC) Init(stub shim.ChaincodeStubInterface) pb.Response { +func (t *CC) Init(stub shim.ChaincodeStubInterface) *pb.Response { err := stub.PutState("foo", []byte("caller:foo")) if err != nil { return shim.Error(err.Error()) @@ -23,7 +23,7 @@ func (t *CC) Init(stub shim.ChaincodeStubInterface) pb.Response { return shim.Success(nil) } -func (t *CC) Invoke(stub shim.ChaincodeStubInterface) pb.Response { +func (t *CC) Invoke(stub shim.ChaincodeStubInterface) *pb.Response { fn, args := stub.GetFunctionAndParameters() switch fn { case "INVOKE": diff --git a/integration/lifecycle/chaincode/caller/cmd/main.go b/integration/lifecycle/chaincode/caller/cmd/main.go index 7ac2e49dcf2..90c4359c9e0 100644 --- a/integration/lifecycle/chaincode/caller/cmd/main.go +++ b/integration/lifecycle/chaincode/caller/cmd/main.go @@ -10,7 +10,7 @@ import ( "fmt" "os" - "github.com/hyperledger/fabric-chaincode-go/shim" + "github.com/hyperledger/fabric-chaincode-go/v2/shim" "github.com/hyperledger/fabric/integration/lifecycle/chaincode/caller" ) diff --git a/integration/lifecycle/interop_test.go b/integration/lifecycle/interop_test.go index 449dc71940a..8c63a37c2f3 100644 --- a/integration/lifecycle/interop_test.go +++ b/integration/lifecycle/interop_test.go @@ -13,8 +13,8 @@ import ( "syscall" docker "github.com/fsouza/go-dockerclient" - ab "github.com/hyperledger/fabric-protos-go/orderer" - pb "github.com/hyperledger/fabric-protos-go/peer" + ab "github.com/hyperledger/fabric-protos-go-apiv2/orderer" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/integration/channelparticipation" "github.com/hyperledger/fabric/integration/nwo" "github.com/hyperledger/fabric/integration/nwo/commands" diff --git a/integration/lifecycle/lifecycle_suite_test.go b/integration/lifecycle/lifecycle_suite_test.go index 7bc9be98971..c5af5701b1f 100644 --- a/integration/lifecycle/lifecycle_suite_test.go +++ b/integration/lifecycle/lifecycle_suite_test.go @@ -15,9 +15,9 @@ import ( "time" "github.com/hyperledger/fabric-lib-go/common/flogging" - pcommon "github.com/hyperledger/fabric-protos-go/common" - ab "github.com/hyperledger/fabric-protos-go/orderer" - pb "github.com/hyperledger/fabric-protos-go/peer" + pcommon "github.com/hyperledger/fabric-protos-go-apiv2/common" + ab "github.com/hyperledger/fabric-protos-go-apiv2/orderer" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/integration" "github.com/hyperledger/fabric/integration/nwo" "github.com/hyperledger/fabric/integration/nwo/commands" diff --git a/integration/lifecycle/lifecycle_test.go b/integration/lifecycle/lifecycle_test.go index 10c87989dd0..1a4fd515306 100644 --- a/integration/lifecycle/lifecycle_test.go +++ b/integration/lifecycle/lifecycle_test.go @@ -13,10 +13,9 @@ import ( "syscall" docker "github.com/fsouza/go-dockerclient" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-config/protolator" "github.com/hyperledger/fabric-config/protolator/protoext/peerext" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/integration/channelparticipation" "github.com/hyperledger/fabric/integration/nwo" "github.com/hyperledger/fabric/integration/nwo/commands" @@ -29,6 +28,7 @@ import ( . "github.com/onsi/gomega/gstruct" "github.com/tedsuo/ifrit" ginkgomon "github.com/tedsuo/ifrit/ginkgomon_v2" + "google.golang.org/protobuf/proto" ) var _ = Describe("Lifecycle", func() { @@ -191,8 +191,8 @@ var _ = Describe("Lifecycle", func() { }) Expect(err).NotTo(HaveOccurred()) Eventually(sess, network.EventuallyTimeout).Should(gexec.Exit(1)) - Expect(sess.Err).To(gbytes.Say("Error: endorsement failure during query. response: status:500 " + - "message:\"make sure the chaincode My_1st-Chaincode has been successfully defined on channel testchannel and try " + + Expect(sess.Err).To(gbytes.Say("Error: endorsement failure during query. response: status:500 ")) + Expect(sess.Err).To(gbytes.Say("message:\"make sure the chaincode My_1st-Chaincode has been successfully defined on channel testchannel and try " + "again: chaincode definition for 'My_1st-Chaincode' exists, but chaincode is not installed\"")) By("setting the correct package ID to restore the chaincode") diff --git a/integration/nwo/configblock.go b/integration/nwo/configblock.go index 7af1cc560ed..acc7970875e 100644 --- a/integration/nwo/configblock.go +++ b/integration/nwo/configblock.go @@ -14,16 +14,16 @@ import ( "github.com/hyperledger/fabric/common/channelconfig" "github.com/hyperledger/fabric/common/policies" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/msp" - protosorderer "github.com/hyperledger/fabric-protos-go/orderer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/msp" + protosorderer "github.com/hyperledger/fabric-protos-go-apiv2/orderer" "github.com/hyperledger/fabric/integration/nwo/commands" "github.com/hyperledger/fabric/internal/configtxlator/update" "github.com/hyperledger/fabric/protoutil" . "github.com/onsi/gomega" "github.com/onsi/gomega/gbytes" "github.com/onsi/gomega/gexec" + "google.golang.org/protobuf/proto" ) // GetConfigBlock retrieves the current config block for a channel. diff --git a/integration/nwo/deploy.go b/integration/nwo/deploy.go index 259a4da467c..218e392346a 100644 --- a/integration/nwo/deploy.go +++ b/integration/nwo/deploy.go @@ -14,9 +14,8 @@ import ( "strconv" "strings" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/peer/lifecycle" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/peer/lifecycle" "github.com/hyperledger/fabric/common/util" "github.com/hyperledger/fabric/integration/nwo/commands" "github.com/hyperledger/fabric/protoutil" @@ -25,6 +24,7 @@ import ( "github.com/onsi/gomega/gbytes" "github.com/onsi/gomega/gexec" "github.com/onsi/gomega/gstruct" + "google.golang.org/protobuf/proto" ) type Chaincode struct { diff --git a/integration/nwo/network.go b/integration/nwo/network.go index 982f43b4db2..cc0d888b07d 100644 --- a/integration/nwo/network.go +++ b/integration/nwo/network.go @@ -8,7 +8,6 @@ package nwo import ( "bytes" - "context" "crypto/tls" "crypto/x509" "fmt" @@ -26,9 +25,8 @@ import ( "time" docker "github.com/fsouza/go-dockerclient" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/common" - pb "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/integration/nwo/commands" "github.com/hyperledger/fabric/integration/nwo/fabricconfig" "github.com/hyperledger/fabric/integration/nwo/runner" @@ -44,6 +42,7 @@ import ( "github.com/tedsuo/ifrit/grouper" "google.golang.org/grpc" "google.golang.org/grpc/credentials" + "google.golang.org/protobuf/proto" "gopkg.in/yaml.v2" ) @@ -1436,14 +1435,8 @@ func (n *Network) NewClientConn(address, caCertPath string, clientCertPath strin creds = credentials.NewTLS(config) } - ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) - defer cancel() - - conn, err := grpc.DialContext( - ctx, + conn, err := grpc.NewClient( address, - grpc.WithBlock(), - grpc.FailOnNonTempDialError(true), grpc.WithTransportCredentials(creds), ) Expect(err).NotTo(HaveOccurred()) diff --git a/integration/nwo/signingid.go b/integration/nwo/signingid.go index d0fa576815e..e9cb7e65088 100644 --- a/integration/nwo/signingid.go +++ b/integration/nwo/signingid.go @@ -16,9 +16,9 @@ import ( "fmt" "os" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/bccsp/utils" - "github.com/hyperledger/fabric-protos-go/msp" + "github.com/hyperledger/fabric-protos-go-apiv2/msp" + "google.golang.org/protobuf/proto" ) // A SigningIdentity represents an MSP signing identity. diff --git a/integration/ordererclient/envelope_creator.go b/integration/ordererclient/envelope_creator.go index 7b624515674..9da99308532 100644 --- a/integration/ordererclient/envelope_creator.go +++ b/integration/ordererclient/envelope_creator.go @@ -10,7 +10,7 @@ import ( "github.com/hyperledger/fabric/protoutil" . "github.com/onsi/gomega" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/integration/nwo" ) diff --git a/integration/ordererclient/orderer_client.go b/integration/ordererclient/orderer_client.go index 57b5d6341eb..dbaa5d9ed08 100644 --- a/integration/ordererclient/orderer_client.go +++ b/integration/ordererclient/orderer_client.go @@ -9,8 +9,8 @@ package ordererclient import ( "context" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/orderer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer" "github.com/hyperledger/fabric/integration/nwo" "github.com/pkg/errors" ) diff --git a/integration/pvtdata/pvtdata_test.go b/integration/pvtdata/pvtdata_test.go index 284ad7c555e..0ff64d4cede 100644 --- a/integration/pvtdata/pvtdata_test.go +++ b/integration/pvtdata/pvtdata_test.go @@ -19,13 +19,12 @@ import ( "syscall" docker "github.com/fsouza/go-dockerclient" - "github.com/golang/protobuf/proto" - cb "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/ledger/rwset" - "github.com/hyperledger/fabric-protos-go/ledger/rwset/kvrwset" - mspp "github.com/hyperledger/fabric-protos-go/msp" - ab "github.com/hyperledger/fabric-protos-go/orderer" - pb "github.com/hyperledger/fabric-protos-go/peer" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset/kvrwset" + mspp "github.com/hyperledger/fabric-protos-go-apiv2/msp" + ab "github.com/hyperledger/fabric-protos-go-apiv2/orderer" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/crypto" "github.com/hyperledger/fabric/core/ledger/util" "github.com/hyperledger/fabric/integration/channelparticipation" @@ -41,6 +40,7 @@ import ( "github.com/pkg/errors" "github.com/tedsuo/ifrit" "google.golang.org/grpc" + "google.golang.org/protobuf/proto" "google.golang.org/protobuf/types/known/timestamppb" ) @@ -136,7 +136,10 @@ var _ = Describe("PrivateData", func() { }, WaitForEvent: true, } - expectedErrMsg := `Error: endorsement failure during invoke. response: status:500 message:"error in simulation: failed to distribute private collection` + expectedErrMsg := []string{ + `Error: endorsement failure during invoke. response: status:500`, + `message:"error in simulation: failed to distribute private collection`, + } invokeChaincodeExpectErr(network, network.Peer("Org1", "peer0"), command, expectedErrMsg) }) @@ -846,7 +849,7 @@ var _ = Describe("PrivateData", func() { } peer1 := network.Peer("Org1", "peer0") expectedErrMsg := "tx creator does not have write access permission" - invokeChaincodeExpectErr(network, peer1, command, expectedErrMsg) + invokeChaincodeExpectErr(network, peer1, command, []string{expectedErrMsg}) assertMarbleAPIs() assertDeliverWithPrivateDataACLBehavior() @@ -972,11 +975,13 @@ func installChaincode(n *nwo.Network, chaincode nwo.Chaincode, peer *nwo.Peer) { nwo.PackageAndInstallChaincode(n, chaincode, peer) } -func invokeChaincodeExpectErr(n *nwo.Network, peer *nwo.Peer, command commands.ChaincodeInvoke, expectedErrMsg string) { +func invokeChaincodeExpectErr(n *nwo.Network, peer *nwo.Peer, command commands.ChaincodeInvoke, expectedErrMsgs []string) { sess, err := n.PeerUserSession(peer, "User1", command) Expect(err).NotTo(HaveOccurred()) Eventually(sess, n.EventuallyTimeout).Should(gexec.Exit(1)) - Expect(sess.Err).To(gbytes.Say(expectedErrMsg)) + for _, msg := range expectedErrMsgs { + Expect(sess.Err).To(gbytes.Say(msg)) + } } func approveChaincodeForMyOrgExpectErr(n *nwo.Network, orderer *nwo.Orderer, chaincode nwo.Chaincode, expectedErrMsg string, peers ...*nwo.Peer) { diff --git a/integration/pvtdatapurge/data_purge_test.go b/integration/pvtdatapurge/data_purge_test.go index bbad513394a..fb416c92d7c 100644 --- a/integration/pvtdatapurge/data_purge_test.go +++ b/integration/pvtdatapurge/data_purge_test.go @@ -16,11 +16,10 @@ import ( "syscall" "time" - "github.com/golang/protobuf/proto" - cb "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/ledger/rwset/kvrwset" - ab "github.com/hyperledger/fabric-protos-go/orderer" - pb "github.com/hyperledger/fabric-protos-go/peer" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset/kvrwset" + ab "github.com/hyperledger/fabric-protos-go-apiv2/orderer" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/integration/channelparticipation" "github.com/hyperledger/fabric/integration/nwo" "github.com/hyperledger/fabric/integration/nwo/commands" @@ -32,6 +31,7 @@ import ( "github.com/onsi/gomega/gexec" "github.com/tedsuo/ifrit" ginkgomon "github.com/tedsuo/ifrit/ginkgomon_v2" + "google.golang.org/protobuf/proto" ) const channelID = "testchannel" diff --git a/integration/raft/cft_test.go b/integration/raft/cft_test.go index 721066a4ef0..5d0bd2a8f67 100644 --- a/integration/raft/cft_test.go +++ b/integration/raft/cft_test.go @@ -22,12 +22,11 @@ import ( "time" docker "github.com/fsouza/go-dockerclient" - "github.com/golang/protobuf/proto" conftx "github.com/hyperledger/fabric-config/configtx" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/msp" - orderer2 "github.com/hyperledger/fabric-protos-go/orderer" - "github.com/hyperledger/fabric-protos-go/orderer/etcdraft" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/msp" + orderer2 "github.com/hyperledger/fabric-protos-go-apiv2/orderer" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer/etcdraft" "github.com/hyperledger/fabric/common/configtx" "github.com/hyperledger/fabric/common/util" "github.com/hyperledger/fabric/integration/channelparticipation" @@ -42,6 +41,7 @@ import ( "github.com/tedsuo/ifrit" ginkgomon "github.com/tedsuo/ifrit/ginkgomon_v2" "github.com/tedsuo/ifrit/grouper" + "google.golang.org/protobuf/proto" ) var _ = Describe("EndToEnd Crash Fault Tolerance", func() { @@ -169,6 +169,7 @@ var _ = Describe("EndToEnd Crash Fault Tolerance", func() { close(envs) // Broadcast all envelopes in parallel from 50 clients + By("Send envs for TPS1") Eventually(oRunner.Err, time.Minute).Should(gbytes.Say("Start accepting requests as Raft leader")) TPS := measureTPS(5000, network, orderer, envs) Expect(TPS).To(BeNumerically(">", 500)) @@ -191,9 +192,11 @@ var _ = Describe("EndToEnd Crash Fault Tolerance", func() { close(envs) // Broadcast all envelopes in parallel from 50 clients and ensure it's not as fast as earlier + By("Send envs for TPS2") Eventually(oRunner.Err, time.Minute).Should(gbytes.Say("Start accepting requests as Raft leader")) TPS = measureTPS(5000, network, orderer, envs) - Expect(TPS).To(Equal(500)) + Expect(TPS).To(BeNumerically(">", 440)) + Expect(TPS).To(BeNumerically("<", 560)) }) }) @@ -1079,7 +1082,7 @@ func measureTPS(txNum int, network *nwo.Network, orderer *nwo.Orderer, envs chan bcastWG.Add(50) var lock sync.Mutex - cond := &sync.Cond{L: &lock} + cond := sync.NewCond(&lock) var wg sync.WaitGroup wg.Add(50) @@ -1121,8 +1124,8 @@ func measureTPS(txNum int, network *nwo.Network, orderer *nwo.Orderer, envs chan }() } - start := time.Now() wg.Wait() + start := time.Now() cond.Broadcast() bcastWG.Wait() diff --git a/integration/raft/channel_participation_test.go b/integration/raft/channel_participation_test.go index 98e14c4c246..359da388acd 100644 --- a/integration/raft/channel_participation_test.go +++ b/integration/raft/channel_participation_test.go @@ -21,12 +21,11 @@ import ( "time" docker "github.com/fsouza/go-dockerclient" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-config/configtx" "github.com/hyperledger/fabric-config/configtx/orderer" "github.com/hyperledger/fabric-lib-go/bccsp" "github.com/hyperledger/fabric-lib-go/common/metrics/disabled" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/common/ledger/blockledger/fileledger" "github.com/hyperledger/fabric/integration/channelparticipation" conftx "github.com/hyperledger/fabric/integration/configtx" @@ -38,6 +37,7 @@ import ( "github.com/onsi/gomega/gbytes" "github.com/tedsuo/ifrit" ginkgomon "github.com/tedsuo/ifrit/ginkgomon_v2" + "google.golang.org/protobuf/proto" ) var _ = Describe("ChannelParticipation", func() { diff --git a/integration/raft/client.go b/integration/raft/client.go index 11e3cafbc9e..6df88834fe9 100644 --- a/integration/raft/client.go +++ b/integration/raft/client.go @@ -7,8 +7,8 @@ SPDX-License-Identifier: Apache-2.0 package raft import ( - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/orderer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer" "github.com/hyperledger/fabric/integration/nwo" "github.com/hyperledger/fabric/integration/ordererclient" "github.com/hyperledger/fabric/protoutil" diff --git a/integration/raft/config_test.go b/integration/raft/config_test.go index 695084ed5da..eb9ebd0ca27 100644 --- a/integration/raft/config_test.go +++ b/integration/raft/config_test.go @@ -20,11 +20,10 @@ import ( "time" docker "github.com/fsouza/go-dockerclient" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/msp" - protosorderer "github.com/hyperledger/fabric-protos-go/orderer" - "github.com/hyperledger/fabric-protos-go/orderer/etcdraft" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/msp" + protosorderer "github.com/hyperledger/fabric-protos-go-apiv2/orderer" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer/etcdraft" "github.com/hyperledger/fabric/common/crypto/tlsgen" "github.com/hyperledger/fabric/integration/channelparticipation" "github.com/hyperledger/fabric/integration/nwo" @@ -37,6 +36,7 @@ import ( "github.com/onsi/gomega/gexec" "github.com/tedsuo/ifrit" ginkgomon "github.com/tedsuo/ifrit/ginkgomon_v2" + "google.golang.org/protobuf/proto" ) var _ = Describe("EndToEnd reconfiguration and onboarding", func() { @@ -922,7 +922,7 @@ var _ = Describe("EndToEnd reconfiguration and onboarding", func() { channelparticipation.Join(network, o4, "testchannel3", configBlock, expectedChannelInfo) By("checking the logs that indicate that channel3 cannot be pulled using the delivery service, as the read policy is corrupt") - Eventually(orderer4Runner.Err(), network.EventuallyTimeout).Should(gbytes.Say("Received status:FORBIDDEN from 127\\.0\\.0\\.1:[0-9]+: forbidden pulling the channel channel=testchannel3")) + Eventually(orderer4Runner.Err(), network.EventuallyTimeout).Should(gbytes.Say("Received status:FORBIDDEN from 127\\.0\\.0\\.1:[0-9]+: forbidden pulling the channel channel=testchannel3")) }) }) diff --git a/integration/raft/migration_test.go b/integration/raft/migration_test.go index 86549fa787d..1efffb65ce8 100644 --- a/integration/raft/migration_test.go +++ b/integration/raft/migration_test.go @@ -16,11 +16,10 @@ import ( "time" docker "github.com/fsouza/go-dockerclient" - "github.com/golang/protobuf/proto" "github.com/hyperledger-labs/SmartBFT/pkg/types" - "github.com/hyperledger/fabric-protos-go/common" - protosorderer "github.com/hyperledger/fabric-protos-go/orderer" - "github.com/hyperledger/fabric-protos-go/orderer/smartbft" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + protosorderer "github.com/hyperledger/fabric-protos-go-apiv2/orderer" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer/smartbft" "github.com/hyperledger/fabric/common/capabilities" "github.com/hyperledger/fabric/common/channelconfig" "github.com/hyperledger/fabric/common/policies" @@ -36,6 +35,7 @@ import ( "github.com/onsi/gomega/gexec" "github.com/tedsuo/ifrit" ginkgomon "github.com/tedsuo/ifrit/ginkgomon_v2" + "google.golang.org/protobuf/proto" ) var _ = Describe("ConsensusTypeMigration", func() { @@ -321,7 +321,7 @@ var _ = Describe("ConsensusTypeMigration", func() { // === The green path ====================================================================================== - //=== Step 3: Config update on standard channel, MAINTENANCE, again === + // === Step 3: Config update on standard channel, MAINTENANCE, again === By("3) Config update on standard channel, State=MAINTENANCE, enter maintenance-mode again") config, updatedConfig = prepareTransition(network, peer, o1, "testchannel", "etcdraft", protosorderer.ConsensusType_STATE_NORMAL, diff --git a/integration/sbe/sbe_test.go b/integration/sbe/sbe_test.go index 240c786d7a1..a5a3ad7ebfa 100644 --- a/integration/sbe/sbe_test.go +++ b/integration/sbe/sbe_test.go @@ -14,7 +14,7 @@ import ( "syscall" docker "github.com/fsouza/go-dockerclient" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/integration/channelparticipation" "github.com/hyperledger/fabric/integration/nwo" "github.com/hyperledger/fabric/integration/nwo/commands" diff --git a/integration/smartbft/mock_orderer.go b/integration/smartbft/mock_orderer.go index 48135e46881..e4eb07caead 100644 --- a/integration/smartbft/mock_orderer.go +++ b/integration/smartbft/mock_orderer.go @@ -12,14 +12,14 @@ import ( "math" "time" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/common/flogging" - cb "github.com/hyperledger/fabric-protos-go/common" - ab "github.com/hyperledger/fabric-protos-go/orderer" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + ab "github.com/hyperledger/fabric-protos-go-apiv2/orderer" "github.com/hyperledger/fabric/common/util" "github.com/hyperledger/fabric/internal/pkg/comm" "github.com/hyperledger/fabric/protoutil" "github.com/pkg/errors" + "google.golang.org/protobuf/proto" ) type MockOrderer struct { diff --git a/integration/smartbft/smartbft_block_deliverer_test.go b/integration/smartbft/smartbft_block_deliverer_test.go index 7e7ca027ddf..f4cb92e80b6 100644 --- a/integration/smartbft/smartbft_block_deliverer_test.go +++ b/integration/smartbft/smartbft_block_deliverer_test.go @@ -18,8 +18,8 @@ import ( docker "github.com/fsouza/go-dockerclient" "github.com/hyperledger/fabric-lib-go/common/metrics/disabled" - "github.com/hyperledger/fabric-protos-go/common" - ordererProtos "github.com/hyperledger/fabric-protos-go/orderer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + ordererProtos "github.com/hyperledger/fabric-protos-go-apiv2/orderer" "github.com/hyperledger/fabric/common/ledger/blkstorage" "github.com/hyperledger/fabric/common/ledger/blockledger/fileledger" "github.com/hyperledger/fabric/integration/nwo" diff --git a/integration/smartbft/smartbft_test.go b/integration/smartbft/smartbft_test.go index 9aa5072cea0..06dfaf467cd 100644 --- a/integration/smartbft/smartbft_test.go +++ b/integration/smartbft/smartbft_test.go @@ -24,12 +24,11 @@ import ( "time" docker "github.com/fsouza/go-dockerclient" - "github.com/golang/protobuf/proto" protos "github.com/hyperledger-labs/SmartBFT/smartbftprotos" "github.com/hyperledger/fabric-config/configtx" "github.com/hyperledger/fabric-config/configtx/orderer" - "github.com/hyperledger/fabric-protos-go/common" - ordererProtos "github.com/hyperledger/fabric-protos-go/orderer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + ordererProtos "github.com/hyperledger/fabric-protos-go-apiv2/orderer" "github.com/hyperledger/fabric/integration/channelparticipation" conftx "github.com/hyperledger/fabric/integration/configtx" "github.com/hyperledger/fabric/integration/nwo" @@ -46,6 +45,7 @@ import ( "github.com/tedsuo/ifrit" ginkgomon "github.com/tedsuo/ifrit/ginkgomon_v2" "github.com/tedsuo/ifrit/grouper" + "google.golang.org/protobuf/proto" ) var _ = Describe("EndToEnd Smart BFT configuration test", func() { diff --git a/internal/configtxgen/encoder/encoder.go b/internal/configtxgen/encoder/encoder.go index e5e82470691..03f9f134f26 100644 --- a/internal/configtxgen/encoder/encoder.go +++ b/internal/configtxgen/encoder/encoder.go @@ -10,11 +10,10 @@ import ( "fmt" "os" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/common/flogging" - cb "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/orderer/smartbft" - pb "github.com/hyperledger/fabric-protos-go/peer" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer/smartbft" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/channelconfig" "github.com/hyperledger/fabric/common/genesis" "github.com/hyperledger/fabric/common/policies" @@ -26,6 +25,7 @@ import ( "github.com/hyperledger/fabric/msp" "github.com/hyperledger/fabric/protoutil" "github.com/pkg/errors" + "google.golang.org/protobuf/proto" ) const ( diff --git a/internal/configtxgen/encoder/encoder_test.go b/internal/configtxgen/encoder/encoder_test.go index 107c6c2017f..6bf62d3db4d 100644 --- a/internal/configtxgen/encoder/encoder_test.go +++ b/internal/configtxgen/encoder/encoder_test.go @@ -14,17 +14,17 @@ import ( . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" - "github.com/golang/protobuf/proto" - cb "github.com/hyperledger/fabric-protos-go/common" - ab "github.com/hyperledger/fabric-protos-go/orderer" - "github.com/hyperledger/fabric-protos-go/orderer/etcdraft" - "github.com/hyperledger/fabric-protos-go/orderer/smartbft" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + ab "github.com/hyperledger/fabric-protos-go-apiv2/orderer" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer/etcdraft" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer/smartbft" "github.com/hyperledger/fabric/common/util" "github.com/hyperledger/fabric/internal/configtxgen/encoder" "github.com/hyperledger/fabric/internal/configtxgen/encoder/fakes" "github.com/hyperledger/fabric/internal/configtxgen/genesisconfig" "github.com/hyperledger/fabric/internal/pkg/identity" "github.com/hyperledger/fabric/protoutil" + "google.golang.org/protobuf/proto" ) //go:generate counterfeiter -o fakes/signer_serializer.go --fake-name SignerSerializer . signerSerializer diff --git a/internal/configtxgen/encoder/integration_test.go b/internal/configtxgen/encoder/integration_test.go index 2a28c7bba15..46b146fc0ec 100644 --- a/internal/configtxgen/encoder/integration_test.go +++ b/internal/configtxgen/encoder/integration_test.go @@ -11,12 +11,11 @@ import ( . "github.com/onsi/gomega" "github.com/hyperledger/fabric-lib-go/bccsp/sw" - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/common/channelconfig" "github.com/hyperledger/fabric/core/config/configtest" "github.com/hyperledger/fabric/internal/configtxgen/encoder" "github.com/hyperledger/fabric/internal/configtxgen/genesisconfig" - "github.com/pkg/errors" ) diff --git a/internal/configtxgen/genesisconfig/config.go b/internal/configtxgen/genesisconfig/config.go index 75d45d45951..03c0f301040 100644 --- a/internal/configtxgen/genesisconfig/config.go +++ b/internal/configtxgen/genesisconfig/config.go @@ -15,8 +15,8 @@ import ( "github.com/hyperledger-labs/SmartBFT/pkg/types" "github.com/hyperledger/fabric-lib-go/common/flogging" - "github.com/hyperledger/fabric-protos-go/orderer/etcdraft" - "github.com/hyperledger/fabric-protos-go/orderer/smartbft" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer/etcdraft" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer/smartbft" "github.com/hyperledger/fabric/common/viperutil" cf "github.com/hyperledger/fabric/core/config" "github.com/hyperledger/fabric/msp" diff --git a/internal/configtxgen/genesisconfig/config_test.go b/internal/configtxgen/genesisconfig/config_test.go index 0c2e64d8981..7bcf27763ae 100644 --- a/internal/configtxgen/genesisconfig/config_test.go +++ b/internal/configtxgen/genesisconfig/config_test.go @@ -9,7 +9,7 @@ package genesisconfig import ( "testing" - "github.com/hyperledger/fabric-protos-go/orderer/etcdraft" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer/etcdraft" "github.com/hyperledger/fabric/common/viperutil" "github.com/hyperledger/fabric/core/config/configtest" "github.com/stretchr/testify/require" diff --git a/internal/configtxlator/rest/configtxlator_handlers.go b/internal/configtxlator/rest/configtxlator_handlers.go index fff77b35169..e0a41be6d15 100644 --- a/internal/configtxlator/rest/configtxlator_handlers.go +++ b/internal/configtxlator/rest/configtxlator_handlers.go @@ -11,9 +11,9 @@ import ( "io" "net/http" - "github.com/golang/protobuf/proto" - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/internal/configtxlator/update" + "google.golang.org/protobuf/proto" ) func fieldBytes(fieldName string, r *http.Request) ([]byte, error) { diff --git a/internal/configtxlator/rest/configtxlator_handlers_test.go b/internal/configtxlator/rest/configtxlator_handlers_test.go index 94bc041c62c..f634253e147 100644 --- a/internal/configtxlator/rest/configtxlator_handlers_test.go +++ b/internal/configtxlator/rest/configtxlator_handlers_test.go @@ -13,7 +13,7 @@ import ( "net/http/httptest" "testing" - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/protoutil" "github.com/stretchr/testify/require" ) diff --git a/internal/configtxlator/rest/protolator_handlers.go b/internal/configtxlator/rest/protolator_handlers.go index 04ac35bf210..bc39e1dbf68 100644 --- a/internal/configtxlator/rest/protolator_handlers.go +++ b/internal/configtxlator/rest/protolator_handlers.go @@ -13,10 +13,10 @@ import ( "net/http" "reflect" - "github.com/golang/protobuf/proto" "github.com/gorilla/mux" "github.com/hyperledger/fabric-config/protolator" "github.com/pkg/errors" + "google.golang.org/protobuf/proto" "google.golang.org/protobuf/reflect/protoreflect" "google.golang.org/protobuf/reflect/protoregistry" ) @@ -30,7 +30,7 @@ func getMsgType(r *http.Request) (proto.Message, error) { return nil, errors.Wrapf(err, "message type not found") } - msgType := reflect.TypeOf(proto.MessageV1(mt.Zero().Interface())) + msgType := reflect.TypeOf(mt.Zero().Interface()) if msgType == nil { return nil, fmt.Errorf("message name not found") diff --git a/internal/configtxlator/rest/protolator_handlers_test.go b/internal/configtxlator/rest/protolator_handlers_test.go index 93310bae19e..f7f1bd8ffe0 100644 --- a/internal/configtxlator/rest/protolator_handlers_test.go +++ b/internal/configtxlator/rest/protolator_handlers_test.go @@ -14,11 +14,10 @@ import ( "strings" "testing" - "github.com/golang/protobuf/proto" - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/protoutil" "github.com/stretchr/testify/require" - "google.golang.org/protobuf/protoadapt" + "google.golang.org/protobuf/proto" ) var ( @@ -42,13 +41,13 @@ var ( }, } - testOutput = `{"data":{"data":[{"payload":{"data":null,"header":{"channel_header":{"channel_id":"","epoch":"0","extension":null,"timestamp":null,"tls_cert_hash":null,"tx_id":"","type":1,"version":0},"signature_header":null}},"signature":"YmFy"}]},"header":{"data_hash":null,"number":"0","previous_hash":"Zm9v"},"metadata":null}` + testOutput = `{"data":{"data":[{"payload":{"data":null,"header":{"channel_header":{"channel_id":"","epoch":"0","extension":null,"timestamp":null,"tls_cert_hash":"","tx_id":"","type":1,"version":0},"signature_header":null}},"signature":"YmFy"}]},"header":{"data_hash":"","number":"0","previous_hash":"Zm9v"},"metadata":null}` ) func TestProtolatorDecode(t *testing.T) { data, err := proto.Marshal(testProto) require.NoError(t, err) - url := fmt.Sprintf("/protolator/decode/%s", protoadapt.MessageV2Of(testProto).ProtoReflect().Descriptor().FullName()) + url := fmt.Sprintf("/protolator/decode/%s", testProto.ProtoReflect().Descriptor().FullName()) req, _ := http.NewRequest("POST", url, bytes.NewReader(data)) rec := httptest.NewRecorder() @@ -64,7 +63,7 @@ func TestProtolatorDecode(t *testing.T) { } func TestProtolatorEncode(t *testing.T) { - url := fmt.Sprintf("/protolator/encode/%s", protoadapt.MessageV2Of(testProto).ProtoReflect().Descriptor().FullName()) + url := fmt.Sprintf("/protolator/encode/%s", testProto.ProtoReflect().Descriptor().FullName()) req, _ := http.NewRequest("POST", url, bytes.NewReader([]byte(testOutput))) rec := httptest.NewRecorder() @@ -99,7 +98,7 @@ func TestProtolatorEncodeNonExistantProto(t *testing.T) { } func TestProtolatorDecodeBadData(t *testing.T) { - url := fmt.Sprintf("/protolator/decode/%s", protoadapt.MessageV2Of(testProto).ProtoReflect().Descriptor().FullName()) + url := fmt.Sprintf("/protolator/decode/%s", testProto.ProtoReflect().Descriptor().FullName()) req, _ := http.NewRequest("POST", url, bytes.NewReader([]byte("Garbage"))) @@ -111,7 +110,7 @@ func TestProtolatorDecodeBadData(t *testing.T) { } func TestProtolatorEncodeBadData(t *testing.T) { - url := fmt.Sprintf("/protolator/encode/%s", protoadapt.MessageV2Of(testProto).ProtoReflect().Descriptor().FullName()) + url := fmt.Sprintf("/protolator/encode/%s", testProto.ProtoReflect().Descriptor().FullName()) req, _ := http.NewRequest("POST", url, bytes.NewReader([]byte("Garbage"))) diff --git a/internal/configtxlator/update/update.go b/internal/configtxlator/update/update.go index 5e089bc486a..f0030b0cd50 100644 --- a/internal/configtxlator/update/update.go +++ b/internal/configtxlator/update/update.go @@ -10,9 +10,9 @@ import ( "bytes" "fmt" - "github.com/golang/protobuf/proto" - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/protoutil" + "google.golang.org/protobuf/proto" ) func computePoliciesMapUpdate(original, updated map[string]*cb.ConfigPolicy) (readSet, writeSet, sameSet map[string]*cb.ConfigPolicy, updatedMembers bool) { diff --git a/internal/configtxlator/update/update_test.go b/internal/configtxlator/update/update_test.go index 49d31382bfc..e5d6da1767d 100644 --- a/internal/configtxlator/update/update_test.go +++ b/internal/configtxlator/update/update_test.go @@ -9,7 +9,9 @@ package update import ( "testing" - cb "github.com/hyperledger/fabric-protos-go/common" + "google.golang.org/protobuf/proto" + + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/stretchr/testify/require" ) @@ -143,7 +145,7 @@ func TestGroupPolicyModification(t *testing.T) { Groups: map[string]*cb.ConfigGroup{}, } - require.Equal(t, expectedWriteSet, cu.WriteSet, "Mismatched write set") + require.True(t, proto.Equal(expectedWriteSet, cu.WriteSet), "Mismatched write set") } func TestGroupValueModification(t *testing.T) { diff --git a/internal/ledgerutil/compare/compare.go b/internal/ledgerutil/compare/compare.go index 769479eeb06..37f5ebf6d80 100644 --- a/internal/ledgerutil/compare/compare.go +++ b/internal/ledgerutil/compare/compare.go @@ -17,12 +17,12 @@ import ( "path/filepath" "strings" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric/common/ledger/util" "github.com/hyperledger/fabric/core/ledger/kvledger" "github.com/hyperledger/fabric/core/ledger/kvledger/txmgmt/privacyenabledstate" "github.com/hyperledger/fabric/internal/fileutil" "github.com/pkg/errors" + "google.golang.org/protobuf/proto" ) const ( diff --git a/internal/ledgerutil/identifytxs/identifytxs.go b/internal/ledgerutil/identifytxs/identifytxs.go index 9b8bc5c32b8..a0a75b2ecfd 100644 --- a/internal/ledgerutil/identifytxs/identifytxs.go +++ b/internal/ledgerutil/identifytxs/identifytxs.go @@ -14,7 +14,7 @@ import ( "strings" "github.com/hyperledger/fabric-lib-go/common/metrics/disabled" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/common/ledger/blkstorage" "github.com/hyperledger/fabric/core/ledger/kvledger" "github.com/hyperledger/fabric/core/ledger/kvledger/txmgmt/rwsetutil" diff --git a/internal/ledgerutil/verify/verify.go b/internal/ledgerutil/verify/verify.go index 1ee2008ecec..631eef52101 100644 --- a/internal/ledgerutil/verify/verify.go +++ b/internal/ledgerutil/verify/verify.go @@ -12,7 +12,7 @@ import ( "path/filepath" "github.com/hyperledger/fabric-lib-go/common/metrics/disabled" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/common/ledger/blkstorage" "github.com/hyperledger/fabric/core/ledger/kvledger" "github.com/hyperledger/fabric/internal/fileutil" diff --git a/internal/peer/chaincode/common.go b/internal/peer/chaincode/common.go index cc19de0848c..695169d7d7f 100644 --- a/internal/peer/chaincode/common.go +++ b/internal/peer/chaincode/common.go @@ -16,12 +16,11 @@ import ( "strings" "sync" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-chaincode-go/shim" + "github.com/hyperledger/fabric-chaincode-go/v2/shim" "github.com/hyperledger/fabric-lib-go/bccsp" - pcommon "github.com/hyperledger/fabric-protos-go/common" - ab "github.com/hyperledger/fabric-protos-go/orderer" - pb "github.com/hyperledger/fabric-protos-go/peer" + pcommon "github.com/hyperledger/fabric-protos-go-apiv2/common" + ab "github.com/hyperledger/fabric-protos-go-apiv2/orderer" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/policydsl" "github.com/hyperledger/fabric/common/util" "github.com/hyperledger/fabric/internal/peer/common" @@ -30,6 +29,7 @@ import ( "github.com/pkg/errors" "github.com/spf13/cobra" "github.com/spf13/viper" + "google.golang.org/protobuf/proto" ) // getChaincodeSpec get chaincode spec from the cli cmd parameters diff --git a/internal/peer/chaincode/common_test.go b/internal/peer/chaincode/common_test.go index 0623698746a..6bab2dd1c3c 100644 --- a/internal/peer/chaincode/common_test.go +++ b/internal/peer/chaincode/common_test.go @@ -18,10 +18,9 @@ import ( "testing" "time" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/bccsp/sw" - cb "github.com/hyperledger/fabric-protos-go/common" - pb "github.com/hyperledger/fabric-protos-go/peer" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/policydsl" "github.com/hyperledger/fabric/core/config/configtest" "github.com/hyperledger/fabric/internal/peer/chaincode/mock" @@ -31,6 +30,7 @@ import ( "github.com/spf13/cobra" "github.com/spf13/viper" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) func TestCheckChaincodeCmdParamsWithNewCallingSchema(t *testing.T) { diff --git a/internal/peer/chaincode/invoke_test.go b/internal/peer/chaincode/invoke_test.go index c64b02a2db9..e24e1be4ae4 100644 --- a/internal/peer/chaincode/invoke_test.go +++ b/internal/peer/chaincode/invoke_test.go @@ -16,8 +16,8 @@ import ( "github.com/hyperledger/fabric-lib-go/bccsp" "github.com/hyperledger/fabric-lib-go/bccsp/sw" "github.com/hyperledger/fabric-lib-go/common/flogging/floggingtest" - cb "github.com/hyperledger/fabric-protos-go/common" - pb "github.com/hyperledger/fabric-protos-go/peer" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/internal/peer/chaincode/mock" "github.com/hyperledger/fabric/internal/peer/common" "github.com/hyperledger/fabric/msp" @@ -226,7 +226,7 @@ func TestInvokeCmdEndorsementFailure(t *testing.T) { err = cmd.Execute() require.Error(t, err) require.Contains(t, err.Error(), "endorsement failure during invoke") - require.Contains(t, err.Error(), fmt.Sprintf("response: status:%d payload:\"%s\"", ccRespStatus[i], ccRespPayload[i])) + require.Contains(t, err.Error(), fmt.Sprintf("response: status:%d payload:\"%s\"", ccRespStatus[i], ccRespPayload[i])) } } diff --git a/internal/peer/chaincode/mock/deliver.go b/internal/peer/chaincode/mock/deliver.go index 5d1a5e3c37e..ef1e1adb8c3 100644 --- a/internal/peer/chaincode/mock/deliver.go +++ b/internal/peer/chaincode/mock/deliver.go @@ -5,8 +5,8 @@ import ( "context" "sync" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "google.golang.org/grpc/metadata" ) diff --git a/internal/peer/chaincode/mock/deliver_client.go b/internal/peer/chaincode/mock/deliver_client.go index 7f6dc4d391a..a56eb8a13c1 100644 --- a/internal/peer/chaincode/mock/deliver_client.go +++ b/internal/peer/chaincode/mock/deliver_client.go @@ -5,7 +5,7 @@ import ( "context" "sync" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "google.golang.org/grpc" ) diff --git a/internal/peer/chaincode/query_test.go b/internal/peer/chaincode/query_test.go index 3eeb53c4889..f5c9762b55b 100644 --- a/internal/peer/chaincode/query_test.go +++ b/internal/peer/chaincode/query_test.go @@ -80,7 +80,7 @@ func TestQueryCmdEndorsementFailure(t *testing.T) { err = cmd.Execute() require.Error(t, err) require.Regexp(t, "endorsement failure during query", err.Error()) - require.Regexp(t, fmt.Sprintf("response: status:%d payload:\"%s\"", ccRespStatus[i], ccRespPayload[i]), err.Error()) + require.Regexp(t, fmt.Sprintf("response: status:%d payload:\"%s\"", ccRespStatus[i], ccRespPayload[i]), err.Error()) } // failure - nil proposal response diff --git a/internal/peer/chaincode/testdata/src/chaincodes/noop/chaincode.go b/internal/peer/chaincode/testdata/src/chaincodes/noop/chaincode.go index 71058bd41fa..4dbc59ac936 100644 --- a/internal/peer/chaincode/testdata/src/chaincodes/noop/chaincode.go +++ b/internal/peer/chaincode/testdata/src/chaincodes/noop/chaincode.go @@ -9,18 +9,18 @@ package main import ( "fmt" - "github.com/hyperledger/fabric-chaincode-go/shim" - pb "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-chaincode-go/v2/shim" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" ) // No-op test chaincode type TestChaincode struct{} -func (t *TestChaincode) Init(stub shim.ChaincodeStubInterface) pb.Response { +func (t *TestChaincode) Init(stub shim.ChaincodeStubInterface) *pb.Response { return shim.Success(nil) } -func (t *TestChaincode) Invoke(stub shim.ChaincodeStubInterface) pb.Response { +func (t *TestChaincode) Invoke(stub shim.ChaincodeStubInterface) *pb.Response { return shim.Success(nil) } diff --git a/internal/peer/channel/channel.go b/internal/peer/channel/channel.go index 4b6243854f8..5fb0dd7487f 100644 --- a/internal/peer/channel/channel.go +++ b/internal/peer/channel/channel.go @@ -11,8 +11,8 @@ import ( "time" "github.com/hyperledger/fabric-lib-go/common/flogging" - cb "github.com/hyperledger/fabric-protos-go/common" - pb "github.com/hyperledger/fabric-protos-go/peer" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/internal/peer/common" "github.com/hyperledger/fabric/msp" "github.com/pkg/errors" diff --git a/internal/peer/channel/create.go b/internal/peer/channel/create.go index 044f12f1fa8..a8af990b059 100644 --- a/internal/peer/channel/create.go +++ b/internal/peer/channel/create.go @@ -11,8 +11,7 @@ import ( "os" "time" - "github.com/golang/protobuf/proto" - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/common/configtx" "github.com/hyperledger/fabric/common/util" "github.com/hyperledger/fabric/internal/configtxgen/encoder" @@ -22,6 +21,7 @@ import ( "github.com/hyperledger/fabric/protoutil" "github.com/pkg/errors" "github.com/spf13/cobra" + "google.golang.org/protobuf/proto" ) // ConfigTxFileNotFound channel create configuration tx file not found diff --git a/internal/peer/channel/create_test.go b/internal/peer/channel/create_test.go index b296255f233..38bd40cb1e3 100644 --- a/internal/peer/channel/create_test.go +++ b/internal/peer/channel/create_test.go @@ -18,9 +18,8 @@ import ( "testing" "time" - "github.com/golang/protobuf/proto" - cb "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/orderer" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer" "github.com/hyperledger/fabric/core/config/configtest" "github.com/hyperledger/fabric/internal/peer/common" "github.com/hyperledger/fabric/internal/peer/common/mock" @@ -30,6 +29,7 @@ import ( "github.com/spf13/viper" "github.com/stretchr/testify/require" "google.golang.org/grpc" + "google.golang.org/protobuf/proto" ) //go:generate counterfeiter -o mock/signer_serializer.go --fake-name SignerSerializer . signerSerializer diff --git a/internal/peer/channel/fetch.go b/internal/peer/channel/fetch.go index 684d53aa505..7f961a36d04 100644 --- a/internal/peer/channel/fetch.go +++ b/internal/peer/channel/fetch.go @@ -12,11 +12,12 @@ import ( "strconv" "strings" - "github.com/golang/protobuf/proto" - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/internal/peer/common" "github.com/hyperledger/fabric/protoutil" + "github.com/pkg/errors" "github.com/spf13/cobra" + "google.golang.org/protobuf/proto" ) func fetchCmd(cf *ChannelCmdFactory) *cobra.Command { @@ -88,11 +89,13 @@ func fetch(cmd *cobra.Command, args []string, cf *ChannelCmdFactory) error { } block, err = cf.DeliverClient.GetSpecifiedBlock(uint64(num)) } - if err != nil { return err } + if block == nil { + return errors.New("proto: Marshal called with nil") + } b, err := proto.Marshal(block) if err != nil { return err diff --git a/internal/peer/channel/fetch_test.go b/internal/peer/channel/fetch_test.go index 91230690d4e..d04e141c949 100644 --- a/internal/peer/channel/fetch_test.go +++ b/internal/peer/channel/fetch_test.go @@ -13,8 +13,8 @@ import ( "testing" "time" - cb "github.com/hyperledger/fabric-protos-go/common" - ab "github.com/hyperledger/fabric-protos-go/orderer" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + ab "github.com/hyperledger/fabric-protos-go-apiv2/orderer" "github.com/hyperledger/fabric/core/config/configtest" "github.com/hyperledger/fabric/internal/peer/common" "github.com/hyperledger/fabric/internal/peer/common/mock" diff --git a/internal/peer/channel/getinfo.go b/internal/peer/channel/getinfo.go index 72be254b84c..9e01015f1b6 100644 --- a/internal/peer/channel/getinfo.go +++ b/internal/peer/channel/getinfo.go @@ -11,14 +11,14 @@ import ( "encoding/json" "fmt" - "github.com/golang/protobuf/proto" - cb "github.com/hyperledger/fabric-protos-go/common" - pb "github.com/hyperledger/fabric-protos-go/peer" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/core/scc/qscc" "github.com/hyperledger/fabric/internal/peer/common" "github.com/hyperledger/fabric/protoutil" "github.com/pkg/errors" "github.com/spf13/cobra" + "google.golang.org/protobuf/proto" ) func getinfoCmd(cf *ChannelCmdFactory) *cobra.Command { diff --git a/internal/peer/channel/getinfo_test.go b/internal/peer/channel/getinfo_test.go index b9cf143d3ff..41e503ac5ff 100644 --- a/internal/peer/channel/getinfo_test.go +++ b/internal/peer/channel/getinfo_test.go @@ -9,11 +9,11 @@ package channel import ( "testing" - "github.com/golang/protobuf/proto" - cb "github.com/hyperledger/fabric-protos-go/common" - pb "github.com/hyperledger/fabric-protos-go/peer" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/internal/peer/common" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) func TestGetChannelInfo(t *testing.T) { diff --git a/internal/peer/channel/join.go b/internal/peer/channel/join.go index d47dd6c3406..ab635718f62 100644 --- a/internal/peer/channel/join.go +++ b/internal/peer/channel/join.go @@ -12,8 +12,8 @@ import ( "fmt" "os" - pcommon "github.com/hyperledger/fabric-protos-go/common" - pb "github.com/hyperledger/fabric-protos-go/peer" + pcommon "github.com/hyperledger/fabric-protos-go-apiv2/common" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/core/scc/cscc" "github.com/hyperledger/fabric/internal/peer/common" "github.com/hyperledger/fabric/protoutil" diff --git a/internal/peer/channel/join_test.go b/internal/peer/channel/join_test.go index 70c2bbb8b8c..d40c36d4f1f 100644 --- a/internal/peer/channel/join_test.go +++ b/internal/peer/channel/join_test.go @@ -12,7 +12,7 @@ import ( "testing" "time" - pb "github.com/hyperledger/fabric-protos-go/peer" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/internal/peer/common" "github.com/spf13/viper" "github.com/stretchr/testify/require" diff --git a/internal/peer/channel/joinbysnapshot.go b/internal/peer/channel/joinbysnapshot.go index 27b89e46dd3..7451923d291 100644 --- a/internal/peer/channel/joinbysnapshot.go +++ b/internal/peer/channel/joinbysnapshot.go @@ -9,7 +9,7 @@ package channel import ( "errors" - pb "github.com/hyperledger/fabric-protos-go/peer" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/core/scc/cscc" "github.com/hyperledger/fabric/internal/peer/common" "github.com/spf13/cobra" diff --git a/internal/peer/channel/joinbysnapshot_test.go b/internal/peer/channel/joinbysnapshot_test.go index 9cff8f447bd..5c7842c474a 100644 --- a/internal/peer/channel/joinbysnapshot_test.go +++ b/internal/peer/channel/joinbysnapshot_test.go @@ -10,7 +10,7 @@ import ( "testing" "time" - pb "github.com/hyperledger/fabric-protos-go/peer" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/internal/peer/common" "github.com/spf13/viper" "github.com/stretchr/testify/require" diff --git a/internal/peer/channel/joinbysnapshotstatus.go b/internal/peer/channel/joinbysnapshotstatus.go index a36d7624bf3..b079aa22b3b 100644 --- a/internal/peer/channel/joinbysnapshotstatus.go +++ b/internal/peer/channel/joinbysnapshotstatus.go @@ -10,12 +10,12 @@ import ( "context" "fmt" - "github.com/golang/protobuf/proto" - common2 "github.com/hyperledger/fabric-protos-go/common" - pb "github.com/hyperledger/fabric-protos-go/peer" + common2 "github.com/hyperledger/fabric-protos-go-apiv2/common" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/core/scc/cscc" "github.com/hyperledger/fabric/protoutil" "github.com/spf13/cobra" + "google.golang.org/protobuf/proto" ) func joinBySnapshotStatusCmd(cf *ChannelCmdFactory) *cobra.Command { diff --git a/internal/peer/channel/joinbysnapshotstatus_test.go b/internal/peer/channel/joinbysnapshotstatus_test.go index bd7fbb7de8d..837e68a2af3 100644 --- a/internal/peer/channel/joinbysnapshotstatus_test.go +++ b/internal/peer/channel/joinbysnapshotstatus_test.go @@ -10,12 +10,12 @@ import ( "testing" "time" - "github.com/golang/protobuf/proto" - pb "github.com/hyperledger/fabric-protos-go/peer" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/internal/peer/common" "github.com/hyperledger/fabric/protoutil" "github.com/spf13/viper" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) func TestJoinBySnapshotStatus(t *testing.T) { diff --git a/internal/peer/channel/list.go b/internal/peer/channel/list.go index 9b569e58e71..d85da32930c 100644 --- a/internal/peer/channel/list.go +++ b/internal/peer/channel/list.go @@ -10,12 +10,12 @@ import ( "context" "fmt" - "github.com/golang/protobuf/proto" - common2 "github.com/hyperledger/fabric-protos-go/common" - pb "github.com/hyperledger/fabric-protos-go/peer" + common2 "github.com/hyperledger/fabric-protos-go-apiv2/common" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/core/scc/cscc" "github.com/hyperledger/fabric/protoutil" "github.com/spf13/cobra" + "google.golang.org/protobuf/proto" ) type endorserClient struct { diff --git a/internal/peer/channel/list_test.go b/internal/peer/channel/list_test.go index 84f783f2c53..0aa2138273c 100644 --- a/internal/peer/channel/list_test.go +++ b/internal/peer/channel/list_test.go @@ -10,11 +10,11 @@ import ( "errors" "testing" - "github.com/golang/protobuf/proto" - pb "github.com/hyperledger/fabric-protos-go/peer" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/internal/peer/common" "github.com/hyperledger/fabric/msp" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) func TestListChannels(t *testing.T) { diff --git a/internal/peer/channel/signconfigtx_test.go b/internal/peer/channel/signconfigtx_test.go index cf055187c7f..56fce7bfadb 100644 --- a/internal/peer/channel/signconfigtx_test.go +++ b/internal/peer/channel/signconfigtx_test.go @@ -10,7 +10,7 @@ import ( "path/filepath" "testing" - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/internal/peer/common" "github.com/stretchr/testify/require" ) diff --git a/internal/peer/channel/update_test.go b/internal/peer/channel/update_test.go index 0ce5f1d680e..eb9796cd7d5 100644 --- a/internal/peer/channel/update_test.go +++ b/internal/peer/channel/update_test.go @@ -10,7 +10,7 @@ import ( "path/filepath" "testing" - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/internal/peer/common" "github.com/stretchr/testify/require" ) diff --git a/internal/peer/common/broadcastclient.go b/internal/peer/common/broadcastclient.go index d694b75c28c..c2f6fbc4030 100644 --- a/internal/peer/common/broadcastclient.go +++ b/internal/peer/common/broadcastclient.go @@ -7,7 +7,7 @@ SPDX-License-Identifier: Apache-2.0 package common import ( - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/pkg/errors" ) diff --git a/internal/peer/common/common.go b/internal/peer/common/common.go index ab842c295a3..7fe84d567ee 100644 --- a/internal/peer/common/common.go +++ b/internal/peer/common/common.go @@ -14,12 +14,11 @@ import ( "strings" "time" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/bccsp" "github.com/hyperledger/fabric-lib-go/bccsp/factory" "github.com/hyperledger/fabric-lib-go/common/flogging" - pcommon "github.com/hyperledger/fabric-protos-go/common" - pb "github.com/hyperledger/fabric-protos-go/peer" + pcommon "github.com/hyperledger/fabric-protos-go-apiv2/common" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/channelconfig" "github.com/hyperledger/fabric/core/config" "github.com/hyperledger/fabric/core/scc/cscc" @@ -32,6 +31,7 @@ import ( "github.com/spf13/cobra" "github.com/spf13/viper" "google.golang.org/grpc" + "google.golang.org/protobuf/proto" ) // UndefinedParamValue defines what undefined parameters in the command line will initialise to diff --git a/internal/peer/common/common_test.go b/internal/peer/common/common_test.go index 9596a31c0c9..ae8d07f6596 100644 --- a/internal/peer/common/common_test.go +++ b/internal/peer/common/common_test.go @@ -18,8 +18,8 @@ import ( "github.com/hyperledger/fabric-lib-go/bccsp/factory" "github.com/hyperledger/fabric-lib-go/bccsp/sw" "github.com/hyperledger/fabric-lib-go/common/flogging" - cb "github.com/hyperledger/fabric-protos-go/common" - pb "github.com/hyperledger/fabric-protos-go/peer" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/crypto/tlsgen" "github.com/hyperledger/fabric/common/util" "github.com/hyperledger/fabric/core/config/configtest" diff --git a/internal/peer/common/deliverclient.go b/internal/peer/common/deliverclient.go index 2028a473b98..80bc14e7c1b 100644 --- a/internal/peer/common/deliverclient.go +++ b/internal/peer/common/deliverclient.go @@ -8,9 +8,9 @@ package common import ( "github.com/hyperledger/fabric-lib-go/common/flogging" - cb "github.com/hyperledger/fabric-protos-go/common" - ab "github.com/hyperledger/fabric-protos-go/orderer" - pb "github.com/hyperledger/fabric-protos-go/peer" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + ab "github.com/hyperledger/fabric-protos-go-apiv2/orderer" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/util" "github.com/hyperledger/fabric/internal/pkg/identity" "github.com/hyperledger/fabric/protoutil" diff --git a/internal/peer/common/deliverclient_test.go b/internal/peer/common/deliverclient_test.go index cad5ca914ef..cf6d9cedeaf 100644 --- a/internal/peer/common/deliverclient_test.go +++ b/internal/peer/common/deliverclient_test.go @@ -12,8 +12,8 @@ import ( "sync" "testing" - cb "github.com/hyperledger/fabric-protos-go/common" - ab "github.com/hyperledger/fabric-protos-go/orderer" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + ab "github.com/hyperledger/fabric-protos-go-apiv2/orderer" "github.com/hyperledger/fabric/core/config/configtest" "github.com/hyperledger/fabric/internal/peer/common/mock" "github.com/hyperledger/fabric/internal/pkg/identity" diff --git a/internal/peer/common/mock/deliverservice.go b/internal/peer/common/mock/deliverservice.go index ed00cf9b3a7..11d4c06f683 100644 --- a/internal/peer/common/mock/deliverservice.go +++ b/internal/peer/common/mock/deliverservice.go @@ -5,8 +5,8 @@ import ( "context" "sync" - commona "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/orderer" + commona "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer" "google.golang.org/grpc/metadata" ) diff --git a/internal/peer/common/mockclient.go b/internal/peer/common/mockclient.go index 6b6cecc1f6b..8f7c836b218 100644 --- a/internal/peer/common/mockclient.go +++ b/internal/peer/common/mockclient.go @@ -9,8 +9,8 @@ package common import ( "context" - cb "github.com/hyperledger/fabric-protos-go/common" - pb "github.com/hyperledger/fabric-protos-go/peer" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "google.golang.org/grpc" ) diff --git a/internal/peer/common/ordererclient.go b/internal/peer/common/ordererclient.go index 0745cf0fb48..04efa889ef5 100644 --- a/internal/peer/common/ordererclient.go +++ b/internal/peer/common/ordererclient.go @@ -11,8 +11,8 @@ import ( "fmt" "strings" - cb "github.com/hyperledger/fabric-protos-go/common" - ab "github.com/hyperledger/fabric-protos-go/orderer" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + ab "github.com/hyperledger/fabric-protos-go-apiv2/orderer" "github.com/pkg/errors" "google.golang.org/grpc" ) diff --git a/internal/peer/common/peerclient.go b/internal/peer/common/peerclient.go index 140002f8221..570e04127fc 100644 --- a/internal/peer/common/peerclient.go +++ b/internal/peer/common/peerclient.go @@ -12,7 +12,7 @@ import ( "os" "time" - pb "github.com/hyperledger/fabric-protos-go/peer" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/internal/pkg/comm" "github.com/pkg/errors" "github.com/spf13/viper" diff --git a/internal/peer/gossip/deserializer.go b/internal/peer/gossip/deserializer.go index c758fca3a5a..843b4a0d198 100644 --- a/internal/peer/gossip/deserializer.go +++ b/internal/peer/gossip/deserializer.go @@ -7,7 +7,7 @@ SPDX-License-Identifier: Apache-2.0 package gossip import ( - mspproto "github.com/hyperledger/fabric-protos-go/msp" + mspproto "github.com/hyperledger/fabric-protos-go-apiv2/msp" "github.com/hyperledger/fabric/msp" "github.com/hyperledger/fabric/msp/mgmt" "github.com/hyperledger/fabric/protoutil" diff --git a/internal/peer/gossip/mcs.go b/internal/peer/gossip/mcs.go index 6273e3384e5..e9fbc516159 100644 --- a/internal/peer/gossip/mcs.go +++ b/internal/peer/gossip/mcs.go @@ -13,7 +13,7 @@ import ( "github.com/hyperledger/fabric-lib-go/bccsp" "github.com/hyperledger/fabric-lib-go/common/flogging" - pcommon "github.com/hyperledger/fabric-protos-go/common" + pcommon "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/common/channelconfig" "github.com/hyperledger/fabric/common/policies" "github.com/hyperledger/fabric/gossip/api" diff --git a/internal/peer/gossip/mcs_test.go b/internal/peer/gossip/mcs_test.go index e955c91dca7..151b6e93f83 100644 --- a/internal/peer/gossip/mcs_test.go +++ b/internal/peer/gossip/mcs_test.go @@ -10,15 +10,13 @@ import ( "crypto/sha256" "errors" "reflect" - "strings" "testing" "time" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/bccsp/sw" - "github.com/hyperledger/fabric-protos-go/common" - pmsp "github.com/hyperledger/fabric-protos-go/msp" - protospeer "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + pmsp "github.com/hyperledger/fabric-protos-go-apiv2/msp" + protospeer "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/channelconfig" "github.com/hyperledger/fabric/common/policies" "github.com/hyperledger/fabric/common/util" @@ -31,6 +29,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) //go:generate counterfeiter -o mocks/policy_manager.go -fake-name PolicyManager . policyManager @@ -103,13 +102,13 @@ func TestPKIidOfCert(t *testing.T) { // The PKI-ID is calculated by concatenating the MspId with IdBytes. // Ensure that additional fields haven't been introduced in the code v := reflect.Indirect(reflect.ValueOf(id)).Type() - fieldsThatStartWithXXX := 0 + fieldsNoExported := 0 for i := 0; i < v.NumField(); i++ { - if strings.Index(v.Field(i).Name, "XXX_") == 0 { - fieldsThatStartWithXXX++ + if !v.Field(i).IsExported() { + fieldsNoExported++ } } - require.Equal(t, 2+fieldsThatStartWithXXX, v.NumField()) + require.Equal(t, 2+fieldsNoExported, v.NumField()) } func TestPKIidOfNil(t *testing.T) { diff --git a/internal/peer/gossip/mocks/mocks.go b/internal/peer/gossip/mocks/mocks.go index 6b4641c7b42..72719fcffd9 100644 --- a/internal/peer/gossip/mocks/mocks.go +++ b/internal/peer/gossip/mocks/mocks.go @@ -12,7 +12,7 @@ import ( "fmt" "time" - mspproto "github.com/hyperledger/fabric-protos-go/msp" + mspproto "github.com/hyperledger/fabric-protos-go-apiv2/msp" "github.com/hyperledger/fabric/common/policies" "github.com/hyperledger/fabric/msp" "github.com/hyperledger/fabric/protoutil" diff --git a/internal/peer/gossip/mocks/orderer.go b/internal/peer/gossip/mocks/orderer.go index 1d543b4eff9..cbc8fe121c4 100644 --- a/internal/peer/gossip/mocks/orderer.go +++ b/internal/peer/gossip/mocks/orderer.go @@ -5,8 +5,8 @@ import ( "sync" "time" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/orderer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer" "github.com/hyperledger/fabric/common/channelconfig" ) diff --git a/internal/peer/lifecycle/chaincode/approveformyorg.go b/internal/peer/lifecycle/chaincode/approveformyorg.go index 5f78cefffce..3115bcf9bef 100644 --- a/internal/peer/lifecycle/chaincode/approveformyorg.go +++ b/internal/peer/lifecycle/chaincode/approveformyorg.go @@ -11,17 +11,17 @@ import ( "crypto/tls" "time" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/bccsp" - cb "github.com/hyperledger/fabric-protos-go/common" - pb "github.com/hyperledger/fabric-protos-go/peer" - lb "github.com/hyperledger/fabric-protos-go/peer/lifecycle" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" + lb "github.com/hyperledger/fabric-protos-go-apiv2/peer/lifecycle" "github.com/hyperledger/fabric/internal/peer/chaincode" "github.com/hyperledger/fabric/internal/peer/common" "github.com/hyperledger/fabric/protoutil" "github.com/pkg/errors" "github.com/spf13/cobra" "github.com/spf13/viper" + "google.golang.org/protobuf/proto" ) // ApproverForMyOrg holds the dependencies needed to approve diff --git a/internal/peer/lifecycle/chaincode/approveformyorg_test.go b/internal/peer/lifecycle/chaincode/approveformyorg_test.go index d39441e8ae4..543edd194e4 100644 --- a/internal/peer/lifecycle/chaincode/approveformyorg_test.go +++ b/internal/peer/lifecycle/chaincode/approveformyorg_test.go @@ -12,15 +12,14 @@ import ( "time" "github.com/hyperledger/fabric-lib-go/bccsp/sw" - pb "github.com/hyperledger/fabric-protos-go/peer" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/internal/peer/lifecycle/chaincode" "github.com/hyperledger/fabric/internal/peer/lifecycle/chaincode/mock" + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" "github.com/pkg/errors" "github.com/spf13/cobra" "google.golang.org/grpc" - - . "github.com/onsi/ginkgo/v2" - . "github.com/onsi/gomega" ) var _ = Describe("ApproverForMyOrg", func() { diff --git a/internal/peer/lifecycle/chaincode/calculatepackageid_test.go b/internal/peer/lifecycle/chaincode/calculatepackageid_test.go index 8bc864b9f54..a45f3f7e9af 100644 --- a/internal/peer/lifecycle/chaincode/calculatepackageid_test.go +++ b/internal/peer/lifecycle/chaincode/calculatepackageid_test.go @@ -13,12 +13,11 @@ import ( "github.com/hyperledger/fabric/internal/peer/lifecycle/chaincode" "github.com/hyperledger/fabric/internal/peer/lifecycle/chaincode/mock" - "github.com/pkg/errors" - "github.com/spf13/cobra" - . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "github.com/onsi/gomega/gbytes" + "github.com/pkg/errors" + "github.com/spf13/cobra" ) var _ = Describe("CalculatePackageID", func() { diff --git a/internal/peer/lifecycle/chaincode/chaincode_suite_test.go b/internal/peer/lifecycle/chaincode/chaincode_suite_test.go index a50d3f6c3e8..9f84fba2494 100644 --- a/internal/peer/lifecycle/chaincode/chaincode_suite_test.go +++ b/internal/peer/lifecycle/chaincode/chaincode_suite_test.go @@ -12,7 +12,7 @@ import ( "testing" "github.com/hyperledger/fabric-lib-go/common/flogging" - pb "github.com/hyperledger/fabric-protos-go/peer" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/internal/peer/common" "github.com/hyperledger/fabric/internal/peer/lifecycle/chaincode" msptesttools "github.com/hyperledger/fabric/msp/mgmt/testtools" diff --git a/internal/peer/lifecycle/chaincode/checkcommitreadiness.go b/internal/peer/lifecycle/chaincode/checkcommitreadiness.go index 9f83e01a4ce..3df3353a79d 100644 --- a/internal/peer/lifecycle/chaincode/checkcommitreadiness.go +++ b/internal/peer/lifecycle/chaincode/checkcommitreadiness.go @@ -14,16 +14,16 @@ import ( "sort" "strings" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/bccsp" - cb "github.com/hyperledger/fabric-protos-go/common" - pb "github.com/hyperledger/fabric-protos-go/peer" - lb "github.com/hyperledger/fabric-protos-go/peer/lifecycle" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" + lb "github.com/hyperledger/fabric-protos-go-apiv2/peer/lifecycle" "github.com/hyperledger/fabric/internal/pkg/identity" "github.com/hyperledger/fabric/protoutil" "github.com/pkg/errors" "github.com/spf13/cobra" "github.com/spf13/viper" + "google.golang.org/protobuf/proto" ) // CommitReadinessChecker holds the dependencies needed to diff --git a/internal/peer/lifecycle/chaincode/checkcommitreadiness_test.go b/internal/peer/lifecycle/chaincode/checkcommitreadiness_test.go index 464b97af309..73a984d653f 100644 --- a/internal/peer/lifecycle/chaincode/checkcommitreadiness_test.go +++ b/internal/peer/lifecycle/chaincode/checkcommitreadiness_test.go @@ -10,18 +10,17 @@ import ( "encoding/json" "fmt" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/bccsp/sw" - pb "github.com/hyperledger/fabric-protos-go/peer" - lb "github.com/hyperledger/fabric-protos-go/peer/lifecycle" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" + lb "github.com/hyperledger/fabric-protos-go-apiv2/peer/lifecycle" "github.com/hyperledger/fabric/internal/peer/lifecycle/chaincode" "github.com/hyperledger/fabric/internal/peer/lifecycle/chaincode/mock" - "github.com/pkg/errors" - "github.com/spf13/cobra" - . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "github.com/onsi/gomega/gbytes" + "github.com/pkg/errors" + "github.com/spf13/cobra" + "google.golang.org/protobuf/proto" ) var _ = Describe("CheckCommitReadiness", func() { diff --git a/internal/peer/lifecycle/chaincode/client_connections.go b/internal/peer/lifecycle/chaincode/client_connections.go index 2945a7a87d9..74eaa46351d 100644 --- a/internal/peer/lifecycle/chaincode/client_connections.go +++ b/internal/peer/lifecycle/chaincode/client_connections.go @@ -10,7 +10,7 @@ import ( "crypto/tls" "github.com/hyperledger/fabric-lib-go/bccsp" - pb "github.com/hyperledger/fabric-protos-go/peer" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/internal/peer/common" "github.com/hyperledger/fabric/internal/pkg/identity" "github.com/pkg/errors" diff --git a/internal/peer/lifecycle/chaincode/commit.go b/internal/peer/lifecycle/chaincode/commit.go index 74e7f899883..a13d4abc29b 100644 --- a/internal/peer/lifecycle/chaincode/commit.go +++ b/internal/peer/lifecycle/chaincode/commit.go @@ -11,17 +11,17 @@ import ( "crypto/tls" "time" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/bccsp" - cb "github.com/hyperledger/fabric-protos-go/common" - pb "github.com/hyperledger/fabric-protos-go/peer" - lb "github.com/hyperledger/fabric-protos-go/peer/lifecycle" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" + lb "github.com/hyperledger/fabric-protos-go-apiv2/peer/lifecycle" "github.com/hyperledger/fabric/internal/peer/chaincode" "github.com/hyperledger/fabric/internal/peer/common" "github.com/hyperledger/fabric/protoutil" "github.com/pkg/errors" "github.com/spf13/cobra" "github.com/spf13/viper" + "google.golang.org/protobuf/proto" ) // Committer holds the dependencies needed to commit diff --git a/internal/peer/lifecycle/chaincode/commit_test.go b/internal/peer/lifecycle/chaincode/commit_test.go index 5c0c98a6737..f57293f78b6 100644 --- a/internal/peer/lifecycle/chaincode/commit_test.go +++ b/internal/peer/lifecycle/chaincode/commit_test.go @@ -12,15 +12,14 @@ import ( "time" "github.com/hyperledger/fabric-lib-go/bccsp/sw" - pb "github.com/hyperledger/fabric-protos-go/peer" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/internal/peer/lifecycle/chaincode" "github.com/hyperledger/fabric/internal/peer/lifecycle/chaincode/mock" + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" "github.com/pkg/errors" "github.com/spf13/cobra" "google.golang.org/grpc" - - . "github.com/onsi/ginkgo/v2" - . "github.com/onsi/gomega" ) var _ = Describe("Commit", func() { diff --git a/internal/peer/lifecycle/chaincode/common.go b/internal/peer/lifecycle/chaincode/common.go index 1773e5bf104..4a266b781b3 100644 --- a/internal/peer/lifecycle/chaincode/common.go +++ b/internal/peer/lifecycle/chaincode/common.go @@ -12,13 +12,13 @@ import ( "fmt" "io" - "github.com/golang/protobuf/proto" - pb "github.com/hyperledger/fabric-protos-go/peer" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/policydsl" "github.com/hyperledger/fabric/internal/peer/chaincode" "github.com/hyperledger/fabric/protoutil" "github.com/pkg/errors" "google.golang.org/grpc" + "google.golang.org/protobuf/proto" ) // EndorserClient defines the interface for sending a proposal diff --git a/internal/peer/lifecycle/chaincode/getinstalledpackage.go b/internal/peer/lifecycle/chaincode/getinstalledpackage.go index 99ef82f84c9..a2fb16f2fb5 100644 --- a/internal/peer/lifecycle/chaincode/getinstalledpackage.go +++ b/internal/peer/lifecycle/chaincode/getinstalledpackage.go @@ -10,16 +10,16 @@ import ( "context" "path/filepath" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/bccsp" - cb "github.com/hyperledger/fabric-protos-go/common" - pb "github.com/hyperledger/fabric-protos-go/peer" - lb "github.com/hyperledger/fabric-protos-go/peer/lifecycle" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" + lb "github.com/hyperledger/fabric-protos-go-apiv2/peer/lifecycle" "github.com/hyperledger/fabric/core/chaincode/persistence" "github.com/hyperledger/fabric/protoutil" "github.com/pkg/errors" "github.com/spf13/cobra" "github.com/spf13/viper" + "google.golang.org/protobuf/proto" ) // InstalledPackageGetter holds the dependencies needed to retrieve diff --git a/internal/peer/lifecycle/chaincode/getinstalledpackage_test.go b/internal/peer/lifecycle/chaincode/getinstalledpackage_test.go index 1910714208d..76e343712dc 100644 --- a/internal/peer/lifecycle/chaincode/getinstalledpackage_test.go +++ b/internal/peer/lifecycle/chaincode/getinstalledpackage_test.go @@ -12,14 +12,13 @@ import ( "path/filepath" "github.com/hyperledger/fabric-lib-go/bccsp/sw" - pb "github.com/hyperledger/fabric-protos-go/peer" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/internal/peer/lifecycle/chaincode" "github.com/hyperledger/fabric/internal/peer/lifecycle/chaincode/mock" - "github.com/pkg/errors" - "github.com/spf13/cobra" - . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" + "github.com/pkg/errors" + "github.com/spf13/cobra" ) var _ = Describe("GetInstalledPackage", func() { diff --git a/internal/peer/lifecycle/chaincode/install.go b/internal/peer/lifecycle/chaincode/install.go index d5835f2f212..5424e69297f 100644 --- a/internal/peer/lifecycle/chaincode/install.go +++ b/internal/peer/lifecycle/chaincode/install.go @@ -9,16 +9,16 @@ package chaincode import ( "context" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/bccsp" - cb "github.com/hyperledger/fabric-protos-go/common" - pb "github.com/hyperledger/fabric-protos-go/peer" - lb "github.com/hyperledger/fabric-protos-go/peer/lifecycle" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" + lb "github.com/hyperledger/fabric-protos-go-apiv2/peer/lifecycle" "github.com/hyperledger/fabric/core/chaincode/persistence" "github.com/hyperledger/fabric/protoutil" "github.com/pkg/errors" "github.com/spf13/cobra" "github.com/spf13/viper" + "google.golang.org/protobuf/proto" ) // Reader defines the interface needed for reading a file. diff --git a/internal/peer/lifecycle/chaincode/install_test.go b/internal/peer/lifecycle/chaincode/install_test.go index fcda58f7558..8f3e43b4056 100644 --- a/internal/peer/lifecycle/chaincode/install_test.go +++ b/internal/peer/lifecycle/chaincode/install_test.go @@ -8,14 +8,13 @@ package chaincode_test import ( "github.com/hyperledger/fabric-lib-go/bccsp/sw" - pb "github.com/hyperledger/fabric-protos-go/peer" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/internal/peer/lifecycle/chaincode" "github.com/hyperledger/fabric/internal/peer/lifecycle/chaincode/mock" - "github.com/pkg/errors" - "github.com/spf13/cobra" - . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" + "github.com/pkg/errors" + "github.com/spf13/cobra" ) var _ = Describe("Install", func() { diff --git a/internal/peer/lifecycle/chaincode/mock/broadcast_client.go b/internal/peer/lifecycle/chaincode/mock/broadcast_client.go index 78fa9d6837c..f23f9a3d42f 100644 --- a/internal/peer/lifecycle/chaincode/mock/broadcast_client.go +++ b/internal/peer/lifecycle/chaincode/mock/broadcast_client.go @@ -4,7 +4,7 @@ package mock import ( "sync" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" ) type BroadcastClient struct { diff --git a/internal/peer/lifecycle/chaincode/mock/deliver.go b/internal/peer/lifecycle/chaincode/mock/deliver.go index 5d1a5e3c37e..ef1e1adb8c3 100644 --- a/internal/peer/lifecycle/chaincode/mock/deliver.go +++ b/internal/peer/lifecycle/chaincode/mock/deliver.go @@ -5,8 +5,8 @@ import ( "context" "sync" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "google.golang.org/grpc/metadata" ) diff --git a/internal/peer/lifecycle/chaincode/mock/endorser_client.go b/internal/peer/lifecycle/chaincode/mock/endorser_client.go index 42f6ed6bee6..7df7085aabb 100644 --- a/internal/peer/lifecycle/chaincode/mock/endorser_client.go +++ b/internal/peer/lifecycle/chaincode/mock/endorser_client.go @@ -5,7 +5,7 @@ import ( "context" "sync" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "google.golang.org/grpc" ) diff --git a/internal/peer/lifecycle/chaincode/mock/peer_deliver_client.go b/internal/peer/lifecycle/chaincode/mock/peer_deliver_client.go index 7f6dc4d391a..a56eb8a13c1 100644 --- a/internal/peer/lifecycle/chaincode/mock/peer_deliver_client.go +++ b/internal/peer/lifecycle/chaincode/mock/peer_deliver_client.go @@ -5,7 +5,7 @@ import ( "context" "sync" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "google.golang.org/grpc" ) diff --git a/internal/peer/lifecycle/chaincode/package_test.go b/internal/peer/lifecycle/chaincode/package_test.go index 5e6548d536c..0511e2c6374 100644 --- a/internal/peer/lifecycle/chaincode/package_test.go +++ b/internal/peer/lifecycle/chaincode/package_test.go @@ -16,11 +16,10 @@ import ( "github.com/hyperledger/fabric/internal/peer/lifecycle/chaincode" "github.com/hyperledger/fabric/internal/peer/lifecycle/chaincode/mock" - "github.com/pkg/errors" - "github.com/spf13/cobra" - . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" + "github.com/pkg/errors" + "github.com/spf13/cobra" ) var _ = Describe("Package", func() { diff --git a/internal/peer/lifecycle/chaincode/queryapproved.go b/internal/peer/lifecycle/chaincode/queryapproved.go index 00ec8efdeeb..a96d5cefc83 100644 --- a/internal/peer/lifecycle/chaincode/queryapproved.go +++ b/internal/peer/lifecycle/chaincode/queryapproved.go @@ -13,15 +13,15 @@ import ( "os" "strings" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/bccsp" - cb "github.com/hyperledger/fabric-protos-go/common" - pb "github.com/hyperledger/fabric-protos-go/peer" - lb "github.com/hyperledger/fabric-protos-go/peer/lifecycle" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" + lb "github.com/hyperledger/fabric-protos-go-apiv2/peer/lifecycle" "github.com/hyperledger/fabric/protoutil" "github.com/pkg/errors" "github.com/spf13/cobra" "github.com/spf13/viper" + "google.golang.org/protobuf/proto" ) // ApprovedQuerier holds the dependencies needed to query diff --git a/internal/peer/lifecycle/chaincode/queryapproved_test.go b/internal/peer/lifecycle/chaincode/queryapproved_test.go index f42ba641ae5..8e733248a9f 100644 --- a/internal/peer/lifecycle/chaincode/queryapproved_test.go +++ b/internal/peer/lifecycle/chaincode/queryapproved_test.go @@ -10,18 +10,17 @@ import ( "encoding/json" "fmt" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/bccsp/sw" - pb "github.com/hyperledger/fabric-protos-go/peer" - lb "github.com/hyperledger/fabric-protos-go/peer/lifecycle" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" + lb "github.com/hyperledger/fabric-protos-go-apiv2/peer/lifecycle" "github.com/hyperledger/fabric/internal/peer/lifecycle/chaincode" "github.com/hyperledger/fabric/internal/peer/lifecycle/chaincode/mock" - "github.com/pkg/errors" - "github.com/spf13/cobra" - . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "github.com/onsi/gomega/gbytes" + "github.com/pkg/errors" + "github.com/spf13/cobra" + "google.golang.org/protobuf/proto" ) var _ = Describe("QueryApproved", func() { diff --git a/internal/peer/lifecycle/chaincode/querycommitted.go b/internal/peer/lifecycle/chaincode/querycommitted.go index 49565a95f25..80b42fe75c9 100644 --- a/internal/peer/lifecycle/chaincode/querycommitted.go +++ b/internal/peer/lifecycle/chaincode/querycommitted.go @@ -14,15 +14,15 @@ import ( "sort" "strings" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/bccsp" - cb "github.com/hyperledger/fabric-protos-go/common" - pb "github.com/hyperledger/fabric-protos-go/peer" - lb "github.com/hyperledger/fabric-protos-go/peer/lifecycle" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" + lb "github.com/hyperledger/fabric-protos-go-apiv2/peer/lifecycle" "github.com/hyperledger/fabric/protoutil" "github.com/pkg/errors" "github.com/spf13/cobra" "github.com/spf13/viper" + "google.golang.org/protobuf/proto" ) // CommittedQuerier holds the dependencies needed to query diff --git a/internal/peer/lifecycle/chaincode/querycommitted_test.go b/internal/peer/lifecycle/chaincode/querycommitted_test.go index 168b91bdbe0..abdd43a9fd2 100644 --- a/internal/peer/lifecycle/chaincode/querycommitted_test.go +++ b/internal/peer/lifecycle/chaincode/querycommitted_test.go @@ -10,18 +10,17 @@ import ( "encoding/json" "fmt" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/bccsp/sw" - pb "github.com/hyperledger/fabric-protos-go/peer" - lb "github.com/hyperledger/fabric-protos-go/peer/lifecycle" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" + lb "github.com/hyperledger/fabric-protos-go-apiv2/peer/lifecycle" "github.com/hyperledger/fabric/internal/peer/lifecycle/chaincode" "github.com/hyperledger/fabric/internal/peer/lifecycle/chaincode/mock" - "github.com/pkg/errors" - "github.com/spf13/cobra" - . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "github.com/onsi/gomega/gbytes" + "github.com/pkg/errors" + "github.com/spf13/cobra" + "google.golang.org/protobuf/proto" ) var _ = Describe("QueryCommitted", func() { diff --git a/internal/peer/lifecycle/chaincode/queryinstalled.go b/internal/peer/lifecycle/chaincode/queryinstalled.go index 506721f78c7..a8bb1f0b931 100644 --- a/internal/peer/lifecycle/chaincode/queryinstalled.go +++ b/internal/peer/lifecycle/chaincode/queryinstalled.go @@ -13,15 +13,15 @@ import ( "os" "strings" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/bccsp" - cb "github.com/hyperledger/fabric-protos-go/common" - pb "github.com/hyperledger/fabric-protos-go/peer" - lb "github.com/hyperledger/fabric-protos-go/peer/lifecycle" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" + lb "github.com/hyperledger/fabric-protos-go-apiv2/peer/lifecycle" "github.com/hyperledger/fabric/protoutil" "github.com/pkg/errors" "github.com/spf13/cobra" "github.com/spf13/viper" + "google.golang.org/protobuf/proto" ) // InstalledQuerier holds the dependencies needed to query diff --git a/internal/peer/lifecycle/chaincode/queryinstalled_test.go b/internal/peer/lifecycle/chaincode/queryinstalled_test.go index ac256941689..bd8588b053a 100644 --- a/internal/peer/lifecycle/chaincode/queryinstalled_test.go +++ b/internal/peer/lifecycle/chaincode/queryinstalled_test.go @@ -10,18 +10,17 @@ import ( "encoding/json" "fmt" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/bccsp/sw" - pb "github.com/hyperledger/fabric-protos-go/peer" - lb "github.com/hyperledger/fabric-protos-go/peer/lifecycle" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" + lb "github.com/hyperledger/fabric-protos-go-apiv2/peer/lifecycle" "github.com/hyperledger/fabric/internal/peer/lifecycle/chaincode" "github.com/hyperledger/fabric/internal/peer/lifecycle/chaincode/mock" - "github.com/pkg/errors" - "github.com/spf13/cobra" - . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "github.com/onsi/gomega/gbytes" + "github.com/pkg/errors" + "github.com/spf13/cobra" + "google.golang.org/protobuf/proto" ) var _ = Describe("QueryInstalled", func() { diff --git a/internal/peer/node/mock/peer_ledger.go b/internal/peer/node/mock/peer_ledger.go index 31c8838efbc..f283690d21e 100644 --- a/internal/peer/node/mock/peer_ledger.go +++ b/internal/peer/node/mock/peer_ledger.go @@ -4,8 +4,8 @@ package mock import ( "sync" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" ledgera "github.com/hyperledger/fabric/common/ledger" "github.com/hyperledger/fabric/core/ledger" ) diff --git a/internal/peer/node/start.go b/internal/peer/node/start.go index 4fde38d723a..719801fae5c 100644 --- a/internal/peer/node/start.go +++ b/internal/peer/node/start.go @@ -20,15 +20,14 @@ import ( "time" docker "github.com/fsouza/go-dockerclient" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/bccsp/factory" "github.com/hyperledger/fabric-lib-go/common/flogging" floggingmetrics "github.com/hyperledger/fabric-lib-go/common/flogging/metrics" "github.com/hyperledger/fabric-lib-go/common/metrics" - cb "github.com/hyperledger/fabric-protos-go/common" - discprotos "github.com/hyperledger/fabric-protos-go/discovery" - gatewayprotos "github.com/hyperledger/fabric-protos-go/gateway" - pb "github.com/hyperledger/fabric-protos-go/peer" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + discprotos "github.com/hyperledger/fabric-protos-go-apiv2/discovery" + gatewayprotos "github.com/hyperledger/fabric-protos-go-apiv2/gateway" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/cauthdsl" ccdef "github.com/hyperledger/fabric/common/chaincode" "github.com/hyperledger/fabric/common/crypto" @@ -100,6 +99,7 @@ import ( "github.com/spf13/viper" "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" + "google.golang.org/protobuf/proto" "gopkg.in/yaml.v2" ) diff --git a/internal/peer/node/start_test.go b/internal/peer/node/start_test.go index 2ca21ae1c27..6ed0459728f 100644 --- a/internal/peer/node/start_test.go +++ b/internal/peer/node/start_test.go @@ -12,7 +12,7 @@ import ( "testing" "time" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/core/handlers/library" "github.com/hyperledger/fabric/core/testutil" "github.com/hyperledger/fabric/internal/peer/node/mock" diff --git a/internal/peer/snapshot/cancelrequest.go b/internal/peer/snapshot/cancelrequest.go index d1af323e791..687cd3ca2a4 100644 --- a/internal/peer/snapshot/cancelrequest.go +++ b/internal/peer/snapshot/cancelrequest.go @@ -11,7 +11,7 @@ import ( "fmt" "github.com/hyperledger/fabric-lib-go/bccsp" - pb "github.com/hyperledger/fabric-protos-go/peer" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/pkg/errors" "github.com/spf13/cobra" ) diff --git a/internal/peer/snapshot/cancelrequest_test.go b/internal/peer/snapshot/cancelrequest_test.go index f9d89b037cc..5a4f92c57a5 100644 --- a/internal/peer/snapshot/cancelrequest_test.go +++ b/internal/peer/snapshot/cancelrequest_test.go @@ -10,17 +10,17 @@ import ( "fmt" "testing" - "github.com/golang/protobuf/ptypes/empty" "github.com/hyperledger/fabric/internal/peer/snapshot/mock" "github.com/onsi/gomega/gbytes" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/types/known/emptypb" ) func TestCancelRequestCmd(t *testing.T) { mockSigner := &mock.Signer{} mockSigner.SignReturns([]byte("snapshot-request-signature"), nil) mockSnapshotClient := &mock.SnapshotClient{} - mockSnapshotClient.CancelReturns(&empty.Empty{}, nil) + mockSnapshotClient.CancelReturns(&emptypb.Empty{}, nil) buffer := gbytes.NewBuffer() mockClient := &client{mockSnapshotClient, mockSigner, buffer} diff --git a/internal/peer/snapshot/client.go b/internal/peer/snapshot/client.go index e6f19a243a2..19f3d62c911 100644 --- a/internal/peer/snapshot/client.go +++ b/internal/peer/snapshot/client.go @@ -11,7 +11,7 @@ import ( "os" "github.com/hyperledger/fabric-lib-go/bccsp" - pb "github.com/hyperledger/fabric-protos-go/peer" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/internal/peer/common" "github.com/pkg/errors" "github.com/spf13/viper" diff --git a/internal/peer/snapshot/client_test.go b/internal/peer/snapshot/client_test.go index ab902f74e7b..ec3f02eea55 100644 --- a/internal/peer/snapshot/client_test.go +++ b/internal/peer/snapshot/client_test.go @@ -9,7 +9,7 @@ package snapshot import ( "testing" - pb "github.com/hyperledger/fabric-protos-go/peer" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/internal/peer/common" "github.com/spf13/viper" "github.com/stretchr/testify/require" diff --git a/internal/peer/snapshot/listpending.go b/internal/peer/snapshot/listpending.go index 0b07a9a429a..0183a351fed 100644 --- a/internal/peer/snapshot/listpending.go +++ b/internal/peer/snapshot/listpending.go @@ -11,7 +11,7 @@ import ( "fmt" "github.com/hyperledger/fabric-lib-go/bccsp" - pb "github.com/hyperledger/fabric-protos-go/peer" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/pkg/errors" "github.com/spf13/cobra" ) diff --git a/internal/peer/snapshot/listpending_test.go b/internal/peer/snapshot/listpending_test.go index f058130211e..f7f5e9c86ab 100644 --- a/internal/peer/snapshot/listpending_test.go +++ b/internal/peer/snapshot/listpending_test.go @@ -10,7 +10,7 @@ import ( "fmt" "testing" - pb "github.com/hyperledger/fabric-protos-go/peer" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/internal/peer/snapshot/mock" "github.com/onsi/gomega/gbytes" "github.com/stretchr/testify/require" diff --git a/internal/peer/snapshot/mock/snapshot_client.go b/internal/peer/snapshot/mock/snapshot_client.go index ca7e15006ae..2697699dec4 100644 --- a/internal/peer/snapshot/mock/snapshot_client.go +++ b/internal/peer/snapshot/mock/snapshot_client.go @@ -5,13 +5,13 @@ import ( "context" "sync" - "github.com/golang/protobuf/ptypes/empty" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "google.golang.org/grpc" + "google.golang.org/protobuf/types/known/emptypb" ) type SnapshotClient struct { - CancelStub func(context.Context, *peer.SignedSnapshotRequest, ...grpc.CallOption) (*empty.Empty, error) + CancelStub func(context.Context, *peer.SignedSnapshotRequest, ...grpc.CallOption) (*emptypb.Empty, error) cancelMutex sync.RWMutex cancelArgsForCall []struct { arg1 context.Context @@ -19,14 +19,14 @@ type SnapshotClient struct { arg3 []grpc.CallOption } cancelReturns struct { - result1 *empty.Empty + result1 *emptypb.Empty result2 error } cancelReturnsOnCall map[int]struct { - result1 *empty.Empty + result1 *emptypb.Empty result2 error } - GenerateStub func(context.Context, *peer.SignedSnapshotRequest, ...grpc.CallOption) (*empty.Empty, error) + GenerateStub func(context.Context, *peer.SignedSnapshotRequest, ...grpc.CallOption) (*emptypb.Empty, error) generateMutex sync.RWMutex generateArgsForCall []struct { arg1 context.Context @@ -34,11 +34,11 @@ type SnapshotClient struct { arg3 []grpc.CallOption } generateReturns struct { - result1 *empty.Empty + result1 *emptypb.Empty result2 error } generateReturnsOnCall map[int]struct { - result1 *empty.Empty + result1 *emptypb.Empty result2 error } QueryPendingsStub func(context.Context, *peer.SignedSnapshotRequest, ...grpc.CallOption) (*peer.QueryPendingSnapshotsResponse, error) @@ -60,7 +60,7 @@ type SnapshotClient struct { invocationsMutex sync.RWMutex } -func (fake *SnapshotClient) Cancel(arg1 context.Context, arg2 *peer.SignedSnapshotRequest, arg3 ...grpc.CallOption) (*empty.Empty, error) { +func (fake *SnapshotClient) Cancel(arg1 context.Context, arg2 *peer.SignedSnapshotRequest, arg3 ...grpc.CallOption) (*emptypb.Empty, error) { fake.cancelMutex.Lock() ret, specificReturn := fake.cancelReturnsOnCall[len(fake.cancelArgsForCall)] fake.cancelArgsForCall = append(fake.cancelArgsForCall, struct { @@ -68,15 +68,16 @@ func (fake *SnapshotClient) Cancel(arg1 context.Context, arg2 *peer.SignedSnapsh arg2 *peer.SignedSnapshotRequest arg3 []grpc.CallOption }{arg1, arg2, arg3}) + stub := fake.CancelStub + fakeReturns := fake.cancelReturns fake.recordInvocation("Cancel", []interface{}{arg1, arg2, arg3}) fake.cancelMutex.Unlock() - if fake.CancelStub != nil { - return fake.CancelStub(arg1, arg2, arg3...) + if stub != nil { + return stub(arg1, arg2, arg3...) } if specificReturn { return ret.result1, ret.result2 } - fakeReturns := fake.cancelReturns return fakeReturns.result1, fakeReturns.result2 } @@ -86,7 +87,7 @@ func (fake *SnapshotClient) CancelCallCount() int { return len(fake.cancelArgsForCall) } -func (fake *SnapshotClient) CancelCalls(stub func(context.Context, *peer.SignedSnapshotRequest, ...grpc.CallOption) (*empty.Empty, error)) { +func (fake *SnapshotClient) CancelCalls(stub func(context.Context, *peer.SignedSnapshotRequest, ...grpc.CallOption) (*emptypb.Empty, error)) { fake.cancelMutex.Lock() defer fake.cancelMutex.Unlock() fake.CancelStub = stub @@ -99,33 +100,33 @@ func (fake *SnapshotClient) CancelArgsForCall(i int) (context.Context, *peer.Sig return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3 } -func (fake *SnapshotClient) CancelReturns(result1 *empty.Empty, result2 error) { +func (fake *SnapshotClient) CancelReturns(result1 *emptypb.Empty, result2 error) { fake.cancelMutex.Lock() defer fake.cancelMutex.Unlock() fake.CancelStub = nil fake.cancelReturns = struct { - result1 *empty.Empty + result1 *emptypb.Empty result2 error }{result1, result2} } -func (fake *SnapshotClient) CancelReturnsOnCall(i int, result1 *empty.Empty, result2 error) { +func (fake *SnapshotClient) CancelReturnsOnCall(i int, result1 *emptypb.Empty, result2 error) { fake.cancelMutex.Lock() defer fake.cancelMutex.Unlock() fake.CancelStub = nil if fake.cancelReturnsOnCall == nil { fake.cancelReturnsOnCall = make(map[int]struct { - result1 *empty.Empty + result1 *emptypb.Empty result2 error }) } fake.cancelReturnsOnCall[i] = struct { - result1 *empty.Empty + result1 *emptypb.Empty result2 error }{result1, result2} } -func (fake *SnapshotClient) Generate(arg1 context.Context, arg2 *peer.SignedSnapshotRequest, arg3 ...grpc.CallOption) (*empty.Empty, error) { +func (fake *SnapshotClient) Generate(arg1 context.Context, arg2 *peer.SignedSnapshotRequest, arg3 ...grpc.CallOption) (*emptypb.Empty, error) { fake.generateMutex.Lock() ret, specificReturn := fake.generateReturnsOnCall[len(fake.generateArgsForCall)] fake.generateArgsForCall = append(fake.generateArgsForCall, struct { @@ -133,15 +134,16 @@ func (fake *SnapshotClient) Generate(arg1 context.Context, arg2 *peer.SignedSnap arg2 *peer.SignedSnapshotRequest arg3 []grpc.CallOption }{arg1, arg2, arg3}) + stub := fake.GenerateStub + fakeReturns := fake.generateReturns fake.recordInvocation("Generate", []interface{}{arg1, arg2, arg3}) fake.generateMutex.Unlock() - if fake.GenerateStub != nil { - return fake.GenerateStub(arg1, arg2, arg3...) + if stub != nil { + return stub(arg1, arg2, arg3...) } if specificReturn { return ret.result1, ret.result2 } - fakeReturns := fake.generateReturns return fakeReturns.result1, fakeReturns.result2 } @@ -151,7 +153,7 @@ func (fake *SnapshotClient) GenerateCallCount() int { return len(fake.generateArgsForCall) } -func (fake *SnapshotClient) GenerateCalls(stub func(context.Context, *peer.SignedSnapshotRequest, ...grpc.CallOption) (*empty.Empty, error)) { +func (fake *SnapshotClient) GenerateCalls(stub func(context.Context, *peer.SignedSnapshotRequest, ...grpc.CallOption) (*emptypb.Empty, error)) { fake.generateMutex.Lock() defer fake.generateMutex.Unlock() fake.GenerateStub = stub @@ -164,28 +166,28 @@ func (fake *SnapshotClient) GenerateArgsForCall(i int) (context.Context, *peer.S return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3 } -func (fake *SnapshotClient) GenerateReturns(result1 *empty.Empty, result2 error) { +func (fake *SnapshotClient) GenerateReturns(result1 *emptypb.Empty, result2 error) { fake.generateMutex.Lock() defer fake.generateMutex.Unlock() fake.GenerateStub = nil fake.generateReturns = struct { - result1 *empty.Empty + result1 *emptypb.Empty result2 error }{result1, result2} } -func (fake *SnapshotClient) GenerateReturnsOnCall(i int, result1 *empty.Empty, result2 error) { +func (fake *SnapshotClient) GenerateReturnsOnCall(i int, result1 *emptypb.Empty, result2 error) { fake.generateMutex.Lock() defer fake.generateMutex.Unlock() fake.GenerateStub = nil if fake.generateReturnsOnCall == nil { fake.generateReturnsOnCall = make(map[int]struct { - result1 *empty.Empty + result1 *emptypb.Empty result2 error }) } fake.generateReturnsOnCall[i] = struct { - result1 *empty.Empty + result1 *emptypb.Empty result2 error }{result1, result2} } @@ -198,15 +200,16 @@ func (fake *SnapshotClient) QueryPendings(arg1 context.Context, arg2 *peer.Signe arg2 *peer.SignedSnapshotRequest arg3 []grpc.CallOption }{arg1, arg2, arg3}) + stub := fake.QueryPendingsStub + fakeReturns := fake.queryPendingsReturns fake.recordInvocation("QueryPendings", []interface{}{arg1, arg2, arg3}) fake.queryPendingsMutex.Unlock() - if fake.QueryPendingsStub != nil { - return fake.QueryPendingsStub(arg1, arg2, arg3...) + if stub != nil { + return stub(arg1, arg2, arg3...) } if specificReturn { return ret.result1, ret.result2 } - fakeReturns := fake.queryPendingsReturns return fakeReturns.result1, fakeReturns.result2 } diff --git a/internal/peer/snapshot/snapshot.go b/internal/peer/snapshot/snapshot.go index 14b3d2b94fb..42126079837 100644 --- a/internal/peer/snapshot/snapshot.go +++ b/internal/peer/snapshot/snapshot.go @@ -7,15 +7,15 @@ SPDX-License-Identifier: Apache-2.0 package snapshot import ( - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/bccsp" "github.com/hyperledger/fabric-lib-go/common/flogging" - cb "github.com/hyperledger/fabric-protos-go/common" - pb "github.com/hyperledger/fabric-protos-go/peer" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/internal/peer/common" "github.com/hyperledger/fabric/protoutil" "github.com/spf13/cobra" "github.com/spf13/pflag" + "google.golang.org/protobuf/proto" ) var logger = flogging.MustGetLogger("cli.snapshot") diff --git a/internal/peer/snapshot/submitrequest.go b/internal/peer/snapshot/submitrequest.go index a0e3c5a479c..2fc91612e11 100644 --- a/internal/peer/snapshot/submitrequest.go +++ b/internal/peer/snapshot/submitrequest.go @@ -11,7 +11,7 @@ import ( "fmt" "github.com/hyperledger/fabric-lib-go/bccsp" - pb "github.com/hyperledger/fabric-protos-go/peer" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/pkg/errors" "github.com/spf13/cobra" ) diff --git a/internal/peer/snapshot/submitrequest_test.go b/internal/peer/snapshot/submitrequest_test.go index 3b79b2877da..94ef8691a50 100644 --- a/internal/peer/snapshot/submitrequest_test.go +++ b/internal/peer/snapshot/submitrequest_test.go @@ -10,17 +10,17 @@ import ( "fmt" "testing" - "github.com/golang/protobuf/ptypes/empty" "github.com/hyperledger/fabric/internal/peer/snapshot/mock" "github.com/onsi/gomega/gbytes" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/types/known/emptypb" ) func TestSubmitRequestCmd(t *testing.T) { mockSigner := &mock.Signer{} mockSigner.SignReturns([]byte("snapshot-request-signature"), nil) mockSnapshotClient := &mock.SnapshotClient{} - mockSnapshotClient.GenerateReturns(&empty.Empty{}, nil) + mockSnapshotClient.GenerateReturns(&emptypb.Empty{}, nil) buffer := gbytes.NewBuffer() mockClient := &client{mockSnapshotClient, mockSigner, buffer} diff --git a/internal/pkg/comm/client_test.go b/internal/pkg/comm/client_test.go index 608a2418d03..d97111a09f0 100644 --- a/internal/pkg/comm/client_test.go +++ b/internal/pkg/comm/client_test.go @@ -15,13 +15,13 @@ import ( "testing" "time" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric/internal/pkg/comm" "github.com/hyperledger/fabric/internal/pkg/comm/testpb" "github.com/pkg/errors" "github.com/stretchr/testify/require" "google.golang.org/grpc" "google.golang.org/grpc/credentials" + "google.golang.org/protobuf/proto" ) const testTimeout = 1 * time.Second // conservative diff --git a/internal/pkg/comm/testpb/test.pb.go b/internal/pkg/comm/testpb/test.pb.go index 41bdb2b9ee1..3935963d33c 100644 --- a/internal/pkg/comm/testpb/test.pb.go +++ b/internal/pkg/comm/testpb/test.pb.go @@ -1,384 +1,219 @@ +// +//Copyright IBM Corp. All Rights Reserved. +// +//SPDX-License-Identifier: Apache-2.0 + // Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.34.2 +// protoc v5.27.3 // source: test.proto package testpb import ( - context "context" - fmt "fmt" - math "math" + reflect "reflect" + sync "sync" - proto "github.com/golang/protobuf/proto" - grpc "google.golang.org/grpc" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) type Empty struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Empty) Reset() { *m = Empty{} } -func (m *Empty) String() string { return proto.CompactTextString(m) } -func (*Empty) ProtoMessage() {} -func (*Empty) Descriptor() ([]byte, []int) { - return fileDescriptor_c161fcfdc0c3ff1e, []int{0} -} - -func (m *Empty) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Empty.Unmarshal(m, b) -} -func (m *Empty) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Empty.Marshal(b, m, deterministic) -} -func (m *Empty) XXX_Merge(src proto.Message) { - xxx_messageInfo_Empty.Merge(m, src) -} -func (m *Empty) XXX_Size() int { - return xxx_messageInfo_Empty.Size(m) -} -func (m *Empty) XXX_DiscardUnknown() { - xxx_messageInfo_Empty.DiscardUnknown(m) -} - -var xxx_messageInfo_Empty proto.InternalMessageInfo - -type Echo struct { - Payload []byte `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Echo) Reset() { *m = Echo{} } -func (m *Echo) String() string { return proto.CompactTextString(m) } -func (*Echo) ProtoMessage() {} -func (*Echo) Descriptor() ([]byte, []int) { - return fileDescriptor_c161fcfdc0c3ff1e, []int{1} -} - -func (m *Echo) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Echo.Unmarshal(m, b) -} -func (m *Echo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Echo.Marshal(b, m, deterministic) -} -func (m *Echo) XXX_Merge(src proto.Message) { - xxx_messageInfo_Echo.Merge(m, src) -} -func (m *Echo) XXX_Size() int { - return xxx_messageInfo_Echo.Size(m) -} -func (m *Echo) XXX_DiscardUnknown() { - xxx_messageInfo_Echo.DiscardUnknown(m) + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields } -var xxx_messageInfo_Echo proto.InternalMessageInfo - -func (m *Echo) GetPayload() []byte { - if m != nil { - return m.Payload - } - return nil -} - -func init() { - proto.RegisterType((*Empty)(nil), "Empty") - proto.RegisterType((*Echo)(nil), "Echo") -} - -func init() { proto.RegisterFile("test.proto", fileDescriptor_c161fcfdc0c3ff1e) } - -var fileDescriptor_c161fcfdc0c3ff1e = []byte{ - // 203 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x90, 0x31, 0x4f, 0x87, 0x30, - 0x14, 0xc4, 0xd3, 0xc4, 0x3f, 0xe8, 0x83, 0xa9, 0x13, 0xc1, 0x05, 0x59, 0x24, 0x0e, 0x2d, 0xc1, - 0x6f, 0xa0, 0x61, 0x75, 0x50, 0x27, 0xb7, 0xb6, 0x3c, 0x81, 0xa4, 0x4d, 0x9b, 0x52, 0x4d, 0xf8, - 0xf6, 0xa6, 0x45, 0x16, 0x27, 0xa7, 0xfb, 0x5d, 0x7a, 0xbd, 0xbc, 0x1c, 0x40, 0xc0, 0x2d, 0x30, - 0xe7, 0x6d, 0xb0, 0x6d, 0x0e, 0x97, 0xd1, 0xb8, 0xb0, 0xb7, 0x0d, 0x5c, 0x8d, 0x6a, 0xb1, 0xb4, - 0x82, 0xdc, 0x89, 0x5d, 0x5b, 0x31, 0x55, 0xa4, 0x21, 0x5d, 0xf9, 0x7a, 0xda, 0xe1, 0x01, 0x8a, - 0x77, 0xdc, 0xc2, 0x1b, 0xfa, 0xef, 0x55, 0x21, 0xbd, 0x85, 0x9b, 0xf4, 0xf3, 0x59, 0x68, 0x4d, - 0x33, 0x96, 0xb8, 0xfe, 0xd5, 0xe1, 0x05, 0xca, 0x04, 0xff, 0x09, 0xd3, 0x3b, 0x28, 0x8e, 0x70, - 0xf0, 0x28, 0xcc, 0xdf, 0xe7, 0x8e, 0xf4, 0x64, 0xb8, 0x87, 0x22, 0x5e, 0x77, 0xd6, 0x55, 0x70, - 0x1d, 0x6d, 0x6a, 0xbb, 0xb0, 0x88, 0xf5, 0x21, 0x4f, 0xfd, 0x07, 0x9b, 0xd7, 0xb0, 0x7c, 0x49, - 0xa6, 0xac, 0xe1, 0xcb, 0xee, 0xd0, 0x6b, 0x9c, 0x66, 0xf4, 0xfc, 0x53, 0x48, 0xbf, 0x2a, 0xae, - 0xac, 0x47, 0xae, 0xac, 0x31, 0x3c, 0xae, 0xe0, 0xa4, 0xcc, 0xd2, 0x10, 0x8f, 0x3f, 0x01, 0x00, - 0x00, 0xff, 0xff, 0x34, 0x99, 0xfa, 0xcc, 0x16, 0x01, 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// TestServiceClient is the client API for TestService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type TestServiceClient interface { - EmptyCall(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error) -} - -type testServiceClient struct { - cc *grpc.ClientConn -} - -func NewTestServiceClient(cc *grpc.ClientConn) TestServiceClient { - return &testServiceClient{cc} -} - -func (c *testServiceClient) EmptyCall(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error) { - out := new(Empty) - err := c.cc.Invoke(ctx, "/TestService/EmptyCall", in, out, opts...) - if err != nil { - return nil, err +func (x *Empty) Reset() { + *x = Empty{} + if protoimpl.UnsafeEnabled { + mi := &file_test_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } - return out, nil } -// TestServiceServer is the server API for TestService service. -type TestServiceServer interface { - EmptyCall(context.Context, *Empty) (*Empty, error) +func (x *Empty) String() string { + return protoimpl.X.MessageStringOf(x) } -func RegisterTestServiceServer(s *grpc.Server, srv TestServiceServer) { - s.RegisterService(&_TestService_serviceDesc, srv) -} +func (*Empty) ProtoMessage() {} -func _TestService_EmptyCall_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(Empty) - if err := dec(in); err != nil { - return nil, err +func (x *Empty) ProtoReflect() protoreflect.Message { + mi := &file_test_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms } - if interceptor == nil { - return srv.(TestServiceServer).EmptyCall(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/TestService/EmptyCall", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TestServiceServer).EmptyCall(ctx, req.(*Empty)) - } - return interceptor(ctx, in, info, handler) -} - -var _TestService_serviceDesc = grpc.ServiceDesc{ - ServiceName: "TestService", - HandlerType: (*TestServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "EmptyCall", - Handler: _TestService_EmptyCall_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "test.proto", + return mi.MessageOf(x) } -// EmptyServiceClient is the client API for EmptyService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type EmptyServiceClient interface { - EmptyCall(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error) - EmptyStream(ctx context.Context, opts ...grpc.CallOption) (EmptyService_EmptyStreamClient, error) -} - -type emptyServiceClient struct { - cc *grpc.ClientConn -} - -func NewEmptyServiceClient(cc *grpc.ClientConn) EmptyServiceClient { - return &emptyServiceClient{cc} -} - -func (c *emptyServiceClient) EmptyCall(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error) { - out := new(Empty) - err := c.cc.Invoke(ctx, "/EmptyService/EmptyCall", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *emptyServiceClient) EmptyStream(ctx context.Context, opts ...grpc.CallOption) (EmptyService_EmptyStreamClient, error) { - stream, err := c.cc.NewStream(ctx, &_EmptyService_serviceDesc.Streams[0], "/EmptyService/EmptyStream", opts...) - if err != nil { - return nil, err - } - x := &emptyServiceEmptyStreamClient{stream} - return x, nil -} - -type EmptyService_EmptyStreamClient interface { - Send(*Empty) error - Recv() (*Empty, error) - grpc.ClientStream -} - -type emptyServiceEmptyStreamClient struct { - grpc.ClientStream -} - -func (x *emptyServiceEmptyStreamClient) Send(m *Empty) error { - return x.ClientStream.SendMsg(m) -} - -func (x *emptyServiceEmptyStreamClient) Recv() (*Empty, error) { - m := new(Empty) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil +// Deprecated: Use Empty.ProtoReflect.Descriptor instead. +func (*Empty) Descriptor() ([]byte, []int) { + return file_test_proto_rawDescGZIP(), []int{0} } -// EmptyServiceServer is the server API for EmptyService service. -type EmptyServiceServer interface { - EmptyCall(context.Context, *Empty) (*Empty, error) - EmptyStream(EmptyService_EmptyStreamServer) error -} +type Echo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func RegisterEmptyServiceServer(s *grpc.Server, srv EmptyServiceServer) { - s.RegisterService(&_EmptyService_serviceDesc, srv) + Payload []byte `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"` } -func _EmptyService_EmptyCall_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(Empty) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(EmptyServiceServer).EmptyCall(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/EmptyService/EmptyCall", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(EmptyServiceServer).EmptyCall(ctx, req.(*Empty)) +func (x *Echo) Reset() { + *x = Echo{} + if protoimpl.UnsafeEnabled { + mi := &file_test_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } - return interceptor(ctx, in, info, handler) } -func _EmptyService_EmptyStream_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(EmptyServiceServer).EmptyStream(&emptyServiceEmptyStreamServer{stream}) +func (x *Echo) String() string { + return protoimpl.X.MessageStringOf(x) } -type EmptyService_EmptyStreamServer interface { - Send(*Empty) error - Recv() (*Empty, error) - grpc.ServerStream -} - -type emptyServiceEmptyStreamServer struct { - grpc.ServerStream -} +func (*Echo) ProtoMessage() {} -func (x *emptyServiceEmptyStreamServer) Send(m *Empty) error { - return x.ServerStream.SendMsg(m) -} - -func (x *emptyServiceEmptyStreamServer) Recv() (*Empty, error) { - m := new(Empty) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err +func (x *Echo) ProtoReflect() protoreflect.Message { + mi := &file_test_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms } - return m, nil -} - -var _EmptyService_serviceDesc = grpc.ServiceDesc{ - ServiceName: "EmptyService", - HandlerType: (*EmptyServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "EmptyCall", - Handler: _EmptyService_EmptyCall_Handler, - }, - }, - Streams: []grpc.StreamDesc{ - { - StreamName: "EmptyStream", - Handler: _EmptyService_EmptyStream_Handler, - ServerStreams: true, - ClientStreams: true, - }, - }, - Metadata: "test.proto", -} - -// EchoServiceClient is the client API for EchoService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type EchoServiceClient interface { - EchoCall(ctx context.Context, in *Echo, opts ...grpc.CallOption) (*Echo, error) -} - -type echoServiceClient struct { - cc *grpc.ClientConn + return mi.MessageOf(x) } -func NewEchoServiceClient(cc *grpc.ClientConn) EchoServiceClient { - return &echoServiceClient{cc} +// Deprecated: Use Echo.ProtoReflect.Descriptor instead. +func (*Echo) Descriptor() ([]byte, []int) { + return file_test_proto_rawDescGZIP(), []int{1} } -func (c *echoServiceClient) EchoCall(ctx context.Context, in *Echo, opts ...grpc.CallOption) (*Echo, error) { - out := new(Echo) - err := c.cc.Invoke(ctx, "/EchoService/EchoCall", in, out, opts...) - if err != nil { - return nil, err +func (x *Echo) GetPayload() []byte { + if x != nil { + return x.Payload } - return out, nil -} - -// EchoServiceServer is the server API for EchoService service. -type EchoServiceServer interface { - EchoCall(context.Context, *Echo) (*Echo, error) -} - -func RegisterEchoServiceServer(s *grpc.Server, srv EchoServiceServer) { - s.RegisterService(&_EchoService_serviceDesc, srv) + return nil } -func _EchoService_EchoCall_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(Echo) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(EchoServiceServer).EchoCall(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/EchoService/EchoCall", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(EchoServiceServer).EchoCall(ctx, req.(*Echo)) - } - return interceptor(ctx, in, info, handler) -} +var File_test_proto protoreflect.FileDescriptor + +var file_test_proto_rawDesc = []byte{ + 0x0a, 0x0a, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x07, 0x0a, 0x05, + 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x20, 0x0a, 0x04, 0x45, 0x63, 0x68, 0x6f, 0x12, 0x18, 0x0a, + 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, + 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x32, 0x2a, 0x0a, 0x0b, 0x54, 0x65, 0x73, 0x74, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x43, + 0x61, 0x6c, 0x6c, 0x12, 0x06, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x06, 0x2e, 0x45, 0x6d, + 0x70, 0x74, 0x79, 0x32, 0x4e, 0x0a, 0x0c, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x43, 0x61, 0x6c, 0x6c, + 0x12, 0x06, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x06, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, + 0x12, 0x21, 0x0a, 0x0b, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, + 0x06, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x06, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x28, + 0x01, 0x30, 0x01, 0x32, 0x27, 0x0a, 0x0b, 0x45, 0x63, 0x68, 0x6f, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x12, 0x18, 0x0a, 0x08, 0x45, 0x63, 0x68, 0x6f, 0x43, 0x61, 0x6c, 0x6c, 0x12, 0x05, + 0x2e, 0x45, 0x63, 0x68, 0x6f, 0x1a, 0x05, 0x2e, 0x45, 0x63, 0x68, 0x6f, 0x42, 0x30, 0x5a, 0x2e, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x79, 0x70, 0x65, 0x72, + 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2f, 0x66, 0x61, 0x62, 0x72, 0x69, 0x63, 0x2f, 0x63, 0x6f, + 0x72, 0x65, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_test_proto_rawDescOnce sync.Once + file_test_proto_rawDescData = file_test_proto_rawDesc +) -var _EchoService_serviceDesc = grpc.ServiceDesc{ - ServiceName: "EchoService", - HandlerType: (*EchoServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "EchoCall", - Handler: _EchoService_EchoCall_Handler, +func file_test_proto_rawDescGZIP() []byte { + file_test_proto_rawDescOnce.Do(func() { + file_test_proto_rawDescData = protoimpl.X.CompressGZIP(file_test_proto_rawDescData) + }) + return file_test_proto_rawDescData +} + +var file_test_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_test_proto_goTypes = []any{ + (*Empty)(nil), // 0: Empty + (*Echo)(nil), // 1: Echo +} +var file_test_proto_depIdxs = []int32{ + 0, // 0: TestService.EmptyCall:input_type -> Empty + 0, // 1: EmptyService.EmptyCall:input_type -> Empty + 0, // 2: EmptyService.EmptyStream:input_type -> Empty + 1, // 3: EchoService.EchoCall:input_type -> Echo + 0, // 4: TestService.EmptyCall:output_type -> Empty + 0, // 5: EmptyService.EmptyCall:output_type -> Empty + 0, // 6: EmptyService.EmptyStream:output_type -> Empty + 1, // 7: EchoService.EchoCall:output_type -> Echo + 4, // [4:8] is the sub-list for method output_type + 0, // [0:4] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_test_proto_init() } +func file_test_proto_init() { + if File_test_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_test_proto_msgTypes[0].Exporter = func(v any, i int) any { + switch v := v.(*Empty); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_test_proto_msgTypes[1].Exporter = func(v any, i int) any { + switch v := v.(*Echo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_test_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 3, }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "test.proto", + GoTypes: file_test_proto_goTypes, + DependencyIndexes: file_test_proto_depIdxs, + MessageInfos: file_test_proto_msgTypes, + }.Build() + File_test_proto = out.File + file_test_proto_rawDesc = nil + file_test_proto_goTypes = nil + file_test_proto_depIdxs = nil } diff --git a/internal/pkg/comm/testpb/test_grpc.pb.go b/internal/pkg/comm/testpb/test_grpc.pb.go new file mode 100644 index 00000000000..66b0dbc5267 --- /dev/null +++ b/internal/pkg/comm/testpb/test_grpc.pb.go @@ -0,0 +1,357 @@ +// +//Copyright IBM Corp. All Rights Reserved. +// +//SPDX-License-Identifier: Apache-2.0 + +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.5.1 +// - protoc v5.27.3 +// source: test.proto + +package testpb + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 + +const ( + TestService_EmptyCall_FullMethodName = "/TestService/EmptyCall" +) + +// TestServiceClient is the client API for TestService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type TestServiceClient interface { + EmptyCall(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error) +} + +type testServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewTestServiceClient(cc grpc.ClientConnInterface) TestServiceClient { + return &testServiceClient{cc} +} + +func (c *testServiceClient) EmptyCall(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Empty) + err := c.cc.Invoke(ctx, TestService_EmptyCall_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// TestServiceServer is the server API for TestService service. +// All implementations should embed UnimplementedTestServiceServer +// for forward compatibility. +type TestServiceServer interface { + EmptyCall(context.Context, *Empty) (*Empty, error) +} + +// UnimplementedTestServiceServer should be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedTestServiceServer struct{} + +func (UnimplementedTestServiceServer) EmptyCall(context.Context, *Empty) (*Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method EmptyCall not implemented") +} +func (UnimplementedTestServiceServer) testEmbeddedByValue() {} + +// UnsafeTestServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to TestServiceServer will +// result in compilation errors. +type UnsafeTestServiceServer interface { + mustEmbedUnimplementedTestServiceServer() +} + +func RegisterTestServiceServer(s grpc.ServiceRegistrar, srv TestServiceServer) { + // If the following call pancis, it indicates UnimplementedTestServiceServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } + s.RegisterService(&TestService_ServiceDesc, srv) +} + +func _TestService_EmptyCall_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TestServiceServer).EmptyCall(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: TestService_EmptyCall_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TestServiceServer).EmptyCall(ctx, req.(*Empty)) + } + return interceptor(ctx, in, info, handler) +} + +// TestService_ServiceDesc is the grpc.ServiceDesc for TestService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var TestService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "TestService", + HandlerType: (*TestServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "EmptyCall", + Handler: _TestService_EmptyCall_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "test.proto", +} + +const ( + EmptyService_EmptyCall_FullMethodName = "/EmptyService/EmptyCall" + EmptyService_EmptyStream_FullMethodName = "/EmptyService/EmptyStream" +) + +// EmptyServiceClient is the client API for EmptyService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type EmptyServiceClient interface { + EmptyCall(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error) + EmptyStream(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[Empty, Empty], error) +} + +type emptyServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewEmptyServiceClient(cc grpc.ClientConnInterface) EmptyServiceClient { + return &emptyServiceClient{cc} +} + +func (c *emptyServiceClient) EmptyCall(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Empty) + err := c.cc.Invoke(ctx, EmptyService_EmptyCall_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *emptyServiceClient) EmptyStream(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[Empty, Empty], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &EmptyService_ServiceDesc.Streams[0], EmptyService_EmptyStream_FullMethodName, cOpts...) + if err != nil { + return nil, err + } + x := &grpc.GenericClientStream[Empty, Empty]{ClientStream: stream} + return x, nil +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type EmptyService_EmptyStreamClient = grpc.BidiStreamingClient[Empty, Empty] + +// EmptyServiceServer is the server API for EmptyService service. +// All implementations should embed UnimplementedEmptyServiceServer +// for forward compatibility. +type EmptyServiceServer interface { + EmptyCall(context.Context, *Empty) (*Empty, error) + EmptyStream(grpc.BidiStreamingServer[Empty, Empty]) error +} + +// UnimplementedEmptyServiceServer should be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedEmptyServiceServer struct{} + +func (UnimplementedEmptyServiceServer) EmptyCall(context.Context, *Empty) (*Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method EmptyCall not implemented") +} +func (UnimplementedEmptyServiceServer) EmptyStream(grpc.BidiStreamingServer[Empty, Empty]) error { + return status.Errorf(codes.Unimplemented, "method EmptyStream not implemented") +} +func (UnimplementedEmptyServiceServer) testEmbeddedByValue() {} + +// UnsafeEmptyServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to EmptyServiceServer will +// result in compilation errors. +type UnsafeEmptyServiceServer interface { + mustEmbedUnimplementedEmptyServiceServer() +} + +func RegisterEmptyServiceServer(s grpc.ServiceRegistrar, srv EmptyServiceServer) { + // If the following call pancis, it indicates UnimplementedEmptyServiceServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } + s.RegisterService(&EmptyService_ServiceDesc, srv) +} + +func _EmptyService_EmptyCall_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(EmptyServiceServer).EmptyCall(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: EmptyService_EmptyCall_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(EmptyServiceServer).EmptyCall(ctx, req.(*Empty)) + } + return interceptor(ctx, in, info, handler) +} + +func _EmptyService_EmptyStream_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(EmptyServiceServer).EmptyStream(&grpc.GenericServerStream[Empty, Empty]{ServerStream: stream}) +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type EmptyService_EmptyStreamServer = grpc.BidiStreamingServer[Empty, Empty] + +// EmptyService_ServiceDesc is the grpc.ServiceDesc for EmptyService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var EmptyService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "EmptyService", + HandlerType: (*EmptyServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "EmptyCall", + Handler: _EmptyService_EmptyCall_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "EmptyStream", + Handler: _EmptyService_EmptyStream_Handler, + ServerStreams: true, + ClientStreams: true, + }, + }, + Metadata: "test.proto", +} + +const ( + EchoService_EchoCall_FullMethodName = "/EchoService/EchoCall" +) + +// EchoServiceClient is the client API for EchoService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type EchoServiceClient interface { + EchoCall(ctx context.Context, in *Echo, opts ...grpc.CallOption) (*Echo, error) +} + +type echoServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewEchoServiceClient(cc grpc.ClientConnInterface) EchoServiceClient { + return &echoServiceClient{cc} +} + +func (c *echoServiceClient) EchoCall(ctx context.Context, in *Echo, opts ...grpc.CallOption) (*Echo, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Echo) + err := c.cc.Invoke(ctx, EchoService_EchoCall_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// EchoServiceServer is the server API for EchoService service. +// All implementations should embed UnimplementedEchoServiceServer +// for forward compatibility. +type EchoServiceServer interface { + EchoCall(context.Context, *Echo) (*Echo, error) +} + +// UnimplementedEchoServiceServer should be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedEchoServiceServer struct{} + +func (UnimplementedEchoServiceServer) EchoCall(context.Context, *Echo) (*Echo, error) { + return nil, status.Errorf(codes.Unimplemented, "method EchoCall not implemented") +} +func (UnimplementedEchoServiceServer) testEmbeddedByValue() {} + +// UnsafeEchoServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to EchoServiceServer will +// result in compilation errors. +type UnsafeEchoServiceServer interface { + mustEmbedUnimplementedEchoServiceServer() +} + +func RegisterEchoServiceServer(s grpc.ServiceRegistrar, srv EchoServiceServer) { + // If the following call pancis, it indicates UnimplementedEchoServiceServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } + s.RegisterService(&EchoService_ServiceDesc, srv) +} + +func _EchoService_EchoCall_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Echo) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(EchoServiceServer).EchoCall(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: EchoService_EchoCall_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(EchoServiceServer).EchoCall(ctx, req.(*Echo)) + } + return interceptor(ctx, in, info, handler) +} + +// EchoService_ServiceDesc is the grpc.ServiceDesc for EchoService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var EchoService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "EchoService", + HandlerType: (*EchoServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "EchoCall", + Handler: _EchoService_EchoCall_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "test.proto", +} diff --git a/internal/pkg/gateway/api_test.go b/internal/pkg/gateway/api_test.go index 8fc50a97859..1482944afce 100644 --- a/internal/pkg/gateway/api_test.go +++ b/internal/pkg/gateway/api_test.go @@ -11,14 +11,13 @@ import ( "testing" "time" - "github.com/golang/protobuf/proto" - cp "github.com/hyperledger/fabric-protos-go/common" - dp "github.com/hyperledger/fabric-protos-go/discovery" - pb "github.com/hyperledger/fabric-protos-go/gateway" - "github.com/hyperledger/fabric-protos-go/gossip" - "github.com/hyperledger/fabric-protos-go/msp" - ab "github.com/hyperledger/fabric-protos-go/orderer" - "github.com/hyperledger/fabric-protos-go/peer" + cp "github.com/hyperledger/fabric-protos-go-apiv2/common" + dp "github.com/hyperledger/fabric-protos-go-apiv2/discovery" + pb "github.com/hyperledger/fabric-protos-go-apiv2/gateway" + "github.com/hyperledger/fabric-protos-go-apiv2/gossip" + "github.com/hyperledger/fabric-protos-go-apiv2/msp" + ab "github.com/hyperledger/fabric-protos-go-apiv2/orderer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/channelconfig" "github.com/hyperledger/fabric/common/crypto/tlsgen" "github.com/hyperledger/fabric/common/deliverclient/orderers" @@ -39,6 +38,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" ) // The following private interfaces are here purely to prevent counterfeiter creating an import cycle in the unit test @@ -68,7 +68,7 @@ type commitFinder interface { CommitFinder } -//go:generate counterfeiter -o mocks/chaincodeeventsserver.go --fake-name ChaincodeEventsServer github.com/hyperledger/fabric-protos-go/gateway.Gateway_ChaincodeEventsServer +//go:generate counterfeiter -o mocks/chaincodeeventsserver.go --fake-name ChaincodeEventsServer github.com/hyperledger/fabric-protos-go-apiv2/gateway.Gateway_ChaincodeEventsServer //go:generate counterfeiter -o mocks/aclchecker.go --fake-name ACLChecker . aclChecker type aclChecker interface { @@ -563,8 +563,14 @@ func checkError(t *testing.T, tt *testDef, err error) (checked bool) { if detailsCheck { require.Len(t, s.Details(), len(tt.errDetails)) + external: for _, detail := range s.Details() { - require.Contains(t, tt.errDetails, proto.MessageV1(detail), "error details, expected: %v", tt.errDetails) + for _, errDetail := range tt.errDetails { + if proto.Equal(errDetail, detail.(*pb.ErrorDetail)) { + continue external + } + } + require.Fail(t, "error match detail", "error details, expected: %v", tt.errDetails) } } @@ -690,13 +696,13 @@ func createEndpointFactory(t *testing.T, definition *endpointDef, dialer dialer, require.NoError(t, err, "failed to create client key pair") return &endpointFactory{ timeout: 5 * time.Second, - connectEndorser: func(conn *grpc.ClientConn) peer.EndorserClient { + connectEndorser: func(conn grpc.ClientConnInterface) peer.EndorserClient { if ep, ok := endorsers[endpoint]; ok && ep.client != nil { return ep.client } return nil }, - connectOrderer: func(conn *grpc.ClientConn) ab.AtomicBroadcastClient { + connectOrderer: func(conn grpc.ClientConnInterface) ab.AtomicBroadcastClient { if ep, ok := ordererMocks[endpoint]; ok && ep.client != nil { return ep.client } diff --git a/internal/pkg/gateway/apiutils.go b/internal/pkg/gateway/apiutils.go index 812482ce3a4..28a19c6e162 100644 --- a/internal/pkg/gateway/apiutils.go +++ b/internal/pkg/gateway/apiutils.go @@ -10,12 +10,13 @@ import ( "fmt" "strings" - "github.com/golang/protobuf/proto" - gp "github.com/hyperledger/fabric-protos-go/gateway" - "github.com/hyperledger/fabric-protos-go/peer" + gp "github.com/hyperledger/fabric-protos-go-apiv2/gateway" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/core/chaincode" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/protoadapt" ) // responseStatus unpacks the proposal response and error values that are returned from ProcessProposal and @@ -58,7 +59,13 @@ func responseStatus(response *peer.ProposalResponse, err error) (statusCode code func newRpcError(code codes.Code, message string, details ...proto.Message) error { st := status.New(code, message) if len(details) != 0 { - std, err := st.WithDetails(details...) + var ds []protoadapt.MessageV1 + for _, detail := range details { + d := protoadapt.MessageV1Of(detail) + ds = append(ds, d) + } + + std, err := st.WithDetails(ds...) if err == nil { return std.Err() } // otherwise return the error without the details diff --git a/internal/pkg/gateway/chaincodeevents.go b/internal/pkg/gateway/chaincodeevents.go index 5e4e876304f..95e97d9998b 100644 --- a/internal/pkg/gateway/chaincodeevents.go +++ b/internal/pkg/gateway/chaincodeevents.go @@ -9,16 +9,16 @@ package gateway import ( "io" - "github.com/golang/protobuf/proto" - gp "github.com/hyperledger/fabric-protos-go/gateway" - ab "github.com/hyperledger/fabric-protos-go/orderer" - "github.com/hyperledger/fabric-protos-go/peer" + gp "github.com/hyperledger/fabric-protos-go-apiv2/gateway" + ab "github.com/hyperledger/fabric-protos-go-apiv2/orderer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/core/aclmgmt/resources" "github.com/hyperledger/fabric/internal/pkg/gateway/event" "github.com/hyperledger/fabric/internal/pkg/gateway/ledger" "github.com/hyperledger/fabric/protoutil" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" ) // ChaincodeEvents supplies a stream of responses, each containing all the events emitted by the requested chaincode diff --git a/internal/pkg/gateway/chaincodeevents_test.go b/internal/pkg/gateway/chaincodeevents_test.go index 249b3de2269..8861e81d7e2 100644 --- a/internal/pkg/gateway/chaincodeevents_test.go +++ b/internal/pkg/gateway/chaincodeevents_test.go @@ -9,23 +9,21 @@ package gateway import ( "io" "testing" - "time" - "github.com/golang/protobuf/proto" - "github.com/golang/protobuf/ptypes/timestamp" - cp "github.com/hyperledger/fabric-protos-go/common" - pb "github.com/hyperledger/fabric-protos-go/gateway" - ab "github.com/hyperledger/fabric-protos-go/orderer" - "github.com/hyperledger/fabric-protos-go/peer" + cp "github.com/hyperledger/fabric-protos-go-apiv2/common" + pb "github.com/hyperledger/fabric-protos-go-apiv2/gateway" + ab "github.com/hyperledger/fabric-protos-go-apiv2/orderer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/protoutil" "github.com/pkg/errors" "github.com/stretchr/testify/require" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/types/known/timestamppb" ) func TestChaincodeEvents(t *testing.T) { - now := time.Now() lastTransactionID := "LAST_TX_ID" newChaincodeEvent := func(chaincodeName string, transactionID string) *peer.ChaincodeEvent { @@ -40,12 +38,9 @@ func TestChaincodeEvents(t *testing.T) { newTransactionHeader := func(transactionID string) *cp.Header { return &cp.Header{ ChannelHeader: protoutil.MarshalOrPanic(&cp.ChannelHeader{ - Type: int32(cp.HeaderType_ENDORSER_TRANSACTION), - Timestamp: ×tamp.Timestamp{ - Seconds: now.Unix(), - Nanos: int32(now.Nanosecond()), - }, - TxId: transactionID, + Type: int32(cp.HeaderType_ENDORSER_TRANSACTION), + Timestamp: timestamppb.Now(), + TxId: transactionID, }), } } diff --git a/internal/pkg/gateway/commit/finder.go b/internal/pkg/gateway/commit/finder.go index 8c95005445c..ff991b1fc42 100644 --- a/internal/pkg/gateway/commit/finder.go +++ b/internal/pkg/gateway/commit/finder.go @@ -11,9 +11,8 @@ package commit import ( "context" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/internal/pkg/gateway/ledger" - "github.com/pkg/errors" ) diff --git a/internal/pkg/gateway/commit/finder_test.go b/internal/pkg/gateway/commit/finder_test.go index 1aa2b44ae28..f00d3227f02 100644 --- a/internal/pkg/gateway/commit/finder_test.go +++ b/internal/pkg/gateway/commit/finder_test.go @@ -11,7 +11,7 @@ import ( "testing" "time" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/core/ledger" "github.com/hyperledger/fabric/internal/pkg/gateway/ledger/mocks" "github.com/pkg/errors" diff --git a/internal/pkg/gateway/commit/notifier_test.go b/internal/pkg/gateway/commit/notifier_test.go index dc1caa27434..9279b32fe24 100644 --- a/internal/pkg/gateway/commit/notifier_test.go +++ b/internal/pkg/gateway/commit/notifier_test.go @@ -9,12 +9,12 @@ package commit import ( "testing" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/core/ledger" "github.com/hyperledger/fabric/internal/pkg/gateway/ledger/mocks" "github.com/pkg/errors" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) func newLedgerMocks() (*mocks.Provider, *mocks.Ledger) { diff --git a/internal/pkg/gateway/commitstatus.go b/internal/pkg/gateway/commitstatus.go index 7396ea2fd6d..2e03f67f11d 100644 --- a/internal/pkg/gateway/commitstatus.go +++ b/internal/pkg/gateway/commitstatus.go @@ -9,12 +9,12 @@ package gateway import ( "context" - "github.com/golang/protobuf/proto" - gp "github.com/hyperledger/fabric-protos-go/gateway" + gp "github.com/hyperledger/fabric-protos-go-apiv2/gateway" "github.com/hyperledger/fabric/core/aclmgmt/resources" "github.com/hyperledger/fabric/protoutil" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" ) // CommitStatus returns the validation code for a specific transaction on a specific channel. If the transaction is diff --git a/internal/pkg/gateway/commitstatus_test.go b/internal/pkg/gateway/commitstatus_test.go index c37211cd2fc..5cb3d3a5696 100644 --- a/internal/pkg/gateway/commitstatus_test.go +++ b/internal/pkg/gateway/commitstatus_test.go @@ -10,14 +10,14 @@ import ( "context" "testing" - "github.com/golang/protobuf/proto" - pb "github.com/hyperledger/fabric-protos-go/gateway" - "github.com/hyperledger/fabric-protos-go/peer" + pb "github.com/hyperledger/fabric-protos-go-apiv2/gateway" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/internal/pkg/gateway/commit" "github.com/hyperledger/fabric/protoutil" "github.com/pkg/errors" "github.com/stretchr/testify/require" "google.golang.org/grpc/codes" + "google.golang.org/protobuf/proto" ) func TestCommitStatus(t *testing.T) { diff --git a/internal/pkg/gateway/diff.go b/internal/pkg/gateway/diff.go index 2529c0767ba..8c2d2cdeff3 100644 --- a/internal/pkg/gateway/diff.go +++ b/internal/pkg/gateway/diff.go @@ -11,7 +11,7 @@ import ( "encoding/hex" "fmt" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/protoutil" ) diff --git a/internal/pkg/gateway/diff_test.go b/internal/pkg/gateway/diff_test.go index 3ecd5f6ac68..3df97a546de 100644 --- a/internal/pkg/gateway/diff_test.go +++ b/internal/pkg/gateway/diff_test.go @@ -8,13 +8,14 @@ package gateway import ( "math" + "strings" "testing" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/ledger/rwset" - "github.com/hyperledger/fabric-protos-go/ledger/rwset/kvrwset" - "github.com/hyperledger/fabric-protos-go/msp" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset/kvrwset" + "github.com/hyperledger/fabric-protos-go-apiv2/msp" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/stretchr/testify/require" ) @@ -353,10 +354,17 @@ func TestPayloadDifferenceSBEPolicy(t *testing.T) { require.NoError(t, err) expected := [][]interface{}{ - {"type", "write metadata mismatch (SBE policy)", "namespace", "ns1", "key", "key1", "name", "VALIDATION_PARAMETER", "initial-endorser-value", "rule: > > identities: ", "invoked-endorser-value", "rule: > > identities: "}, - {"type", "missing metadata write (SBE policy)", "namespace", "ns1", "key", "key2", "name", "VALIDATION_PARAMETER", "initial-endorser-value", "rule: > > identities: ", "invoked-endorser-value", ""}, + {"type", "write metadata mismatch (SBE policy)", "namespace", "ns1", "key", "key1", "name", "VALIDATION_PARAMETER", "initial-endorser-value", "rule:{n_out_of:{n:1 rules:{signed_by:0}}} identities:{principal:\"orgA\"}", "invoked-endorser-value", "rule:{n_out_of:{n:1 rules:{signed_by:0}}} identities:{principal:\"orgB\"}"}, + {"type", "missing metadata write (SBE policy)", "namespace", "ns1", "key", "key2", "name", "VALIDATION_PARAMETER", "initial-endorser-value", "rule:{n_out_of:{n:1 rules:{signed_by:0}}} identities:{principal:\"orgA\"}", "invoked-endorser-value", ""}, } - require.ElementsMatch(t, expected, diff.details()) + dif := diff.details() + for i := range expected { + for j := range expected[i] { + expected[i][j] = strings.ReplaceAll(expected[i][j].(string), " ", "") + dif[i][j] = strings.ReplaceAll(dif[i][j].(string), " ", "") + } + } + require.ElementsMatch(t, expected, dif) } func TestPayloadDifferenceChaincodeResponse(t *testing.T) { diff --git a/internal/pkg/gateway/endorse.go b/internal/pkg/gateway/endorse.go index d305c876ba5..0c68485afe0 100644 --- a/internal/pkg/gateway/endorse.go +++ b/internal/pkg/gateway/endorse.go @@ -10,13 +10,13 @@ import ( "context" "fmt" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/common/flogging" - gp "github.com/hyperledger/fabric-protos-go/gateway" - "github.com/hyperledger/fabric-protos-go/peer" + gp "github.com/hyperledger/fabric-protos-go-apiv2/gateway" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/protoutil" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" ) // Endorse will collect endorsements by invoking the transaction function specified in the SignedProposal against diff --git a/internal/pkg/gateway/endorse_test.go b/internal/pkg/gateway/endorse_test.go index a5c190ce6e0..06611bf23eb 100644 --- a/internal/pkg/gateway/endorse_test.go +++ b/internal/pkg/gateway/endorse_test.go @@ -15,10 +15,10 @@ import ( "github.com/hyperledger/fabric-lib-go/common/flogging" "github.com/hyperledger/fabric-lib-go/common/flogging/mock" - cp "github.com/hyperledger/fabric-protos-go/common" - dp "github.com/hyperledger/fabric-protos-go/discovery" - pb "github.com/hyperledger/fabric-protos-go/gateway" - "github.com/hyperledger/fabric-protos-go/peer" + cp "github.com/hyperledger/fabric-protos-go-apiv2/common" + dp "github.com/hyperledger/fabric-protos-go-apiv2/discovery" + pb "github.com/hyperledger/fabric-protos-go-apiv2/gateway" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/internal/pkg/gateway/mocks" "github.com/hyperledger/fabric/protoutil" "github.com/pkg/errors" diff --git a/internal/pkg/gateway/endorsement.go b/internal/pkg/gateway/endorsement.go index d969327661d..e1ccaf30448 100644 --- a/internal/pkg/gateway/endorsement.go +++ b/internal/pkg/gateway/endorsement.go @@ -11,10 +11,10 @@ import ( "fmt" "sync" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/common/flogging" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "go.uber.org/zap/zapcore" + "google.golang.org/protobuf/proto" ) type layout struct { diff --git a/internal/pkg/gateway/endorsement_test.go b/internal/pkg/gateway/endorsement_test.go index e2c66751486..cf6e92f65dc 100644 --- a/internal/pkg/gateway/endorsement_test.go +++ b/internal/pkg/gateway/endorsement_test.go @@ -9,7 +9,7 @@ package gateway import ( "testing" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/stretchr/testify/require" ) diff --git a/internal/pkg/gateway/endpoint.go b/internal/pkg/gateway/endpoint.go index 8c38cfac517..35d7070b61b 100644 --- a/internal/pkg/gateway/endpoint.go +++ b/internal/pkg/gateway/endpoint.go @@ -11,8 +11,8 @@ import ( "fmt" "time" - ab "github.com/hyperledger/fabric-protos-go/orderer" - "github.com/hyperledger/fabric-protos-go/peer" + ab "github.com/hyperledger/fabric-protos-go-apiv2/orderer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/deliverclient/orderers" "github.com/hyperledger/fabric/gossip/common" "github.com/hyperledger/fabric/internal/pkg/comm" @@ -41,8 +41,8 @@ type endpointConfig struct { } type ( - endorserConnector func(*grpc.ClientConn) peer.EndorserClient - ordererConnector func(*grpc.ClientConn) ab.AtomicBroadcastClient + endorserConnector func(conn grpc.ClientConnInterface) peer.EndorserClient + ordererConnector func(conn grpc.ClientConnInterface) ab.AtomicBroadcastClient ) //go:generate counterfeiter -o mocks/dialer.go --fake-name Dialer . dialer diff --git a/internal/pkg/gateway/endpoint_test.go b/internal/pkg/gateway/endpoint_test.go index e5535b4c072..6541794ae4b 100644 --- a/internal/pkg/gateway/endpoint_test.go +++ b/internal/pkg/gateway/endpoint_test.go @@ -10,7 +10,7 @@ import ( "testing" "time" - peerprotos "github.com/hyperledger/fabric-protos-go/peer" + peerprotos "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/crypto/tlsgen" "github.com/hyperledger/fabric/gossip/common" "github.com/hyperledger/fabric/internal/pkg/comm" diff --git a/internal/pkg/gateway/evaluate.go b/internal/pkg/gateway/evaluate.go index e3378da281c..f3e41235a2a 100644 --- a/internal/pkg/gateway/evaluate.go +++ b/internal/pkg/gateway/evaluate.go @@ -10,13 +10,13 @@ import ( "context" "fmt" - "github.com/golang/protobuf/proto" - gp "github.com/hyperledger/fabric-protos-go/gateway" - "github.com/hyperledger/fabric-protos-go/peer" + gp "github.com/hyperledger/fabric-protos-go-apiv2/gateway" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/protoutil" "github.com/pkg/errors" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" ) // Evaluate will invoke the transaction function as specified in the SignedProposal diff --git a/internal/pkg/gateway/evaluate_test.go b/internal/pkg/gateway/evaluate_test.go index 7dca501562f..593350dd616 100644 --- a/internal/pkg/gateway/evaluate_test.go +++ b/internal/pkg/gateway/evaluate_test.go @@ -12,8 +12,8 @@ import ( "testing" "time" - pb "github.com/hyperledger/fabric-protos-go/gateway" - "github.com/hyperledger/fabric-protos-go/peer" + pb "github.com/hyperledger/fabric-protos-go-apiv2/gateway" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/gossip/common" gdiscovery "github.com/hyperledger/fabric/gossip/discovery" "github.com/hyperledger/fabric/internal/pkg/gateway/mocks" diff --git a/internal/pkg/gateway/event/block.go b/internal/pkg/gateway/event/block.go index e65c5c2fb8d..f861c6b939f 100644 --- a/internal/pkg/gateway/event/block.go +++ b/internal/pkg/gateway/event/block.go @@ -6,9 +6,9 @@ SPDX-License-Identifier: Apache-2.0 package event import ( - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" + "google.golang.org/protobuf/proto" ) type Block struct { diff --git a/internal/pkg/gateway/event/blockiterator.go b/internal/pkg/gateway/event/blockiterator.go index 56c372c2b02..94e9f44ab41 100644 --- a/internal/pkg/gateway/event/blockiterator.go +++ b/internal/pkg/gateway/event/blockiterator.go @@ -6,7 +6,7 @@ SPDX-License-Identifier: Apache-2.0 package event import ( - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/common/ledger" "github.com/pkg/errors" ) diff --git a/internal/pkg/gateway/event/chaincode.go b/internal/pkg/gateway/event/chaincode.go index ddfc9a0770a..ca5a80dc1fc 100644 --- a/internal/pkg/gateway/event/chaincode.go +++ b/internal/pkg/gateway/event/chaincode.go @@ -6,7 +6,7 @@ SPDX-License-Identifier: Apache-2.0 package event import ( - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" ) type ChaincodeEvent struct { diff --git a/internal/pkg/gateway/event/chaincodeiterator.go b/internal/pkg/gateway/event/chaincodeiterator.go index 42ff1700876..471fc1408a3 100644 --- a/internal/pkg/gateway/event/chaincodeiterator.go +++ b/internal/pkg/gateway/event/chaincodeiterator.go @@ -6,8 +6,8 @@ SPDX-License-Identifier: Apache-2.0 package event import ( - "github.com/hyperledger/fabric-protos-go/gateway" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/gateway" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/ledger" ) diff --git a/internal/pkg/gateway/event/iterator_test.go b/internal/pkg/gateway/event/iterator_test.go index 0a842daf710..ec5e3ad994e 100644 --- a/internal/pkg/gateway/event/iterator_test.go +++ b/internal/pkg/gateway/event/iterator_test.go @@ -10,17 +10,17 @@ import ( "testing" "time" - "github.com/golang/protobuf/proto" - "github.com/golang/protobuf/ptypes/timestamp" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/gateway" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/gateway" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/ledger" "github.com/hyperledger/fabric/internal/pkg/gateway/event" "github.com/hyperledger/fabric/internal/pkg/gateway/event/mocks" "github.com/hyperledger/fabric/protoutil" "github.com/pkg/errors" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/types/known/timestamppb" ) //go:generate counterfeiter -o mocks/resultsiterator.go --fake-name ResultsIterator . mockResultsIterator @@ -43,12 +43,9 @@ func TestIterators(t *testing.T) { Payload: protoutil.MarshalOrPanic(&common.Payload{ Header: &common.Header{ ChannelHeader: protoutil.MarshalOrPanic(&common.ChannelHeader{ - Type: int32(common.HeaderType_ENDORSER_TRANSACTION), - Timestamp: ×tamp.Timestamp{ - Seconds: now.Unix(), - Nanos: int32(now.Nanosecond()), - }, - TxId: transactionId, + Type: int32(common.HeaderType_ENDORSER_TRANSACTION), + Timestamp: timestamppb.New(now), + TxId: transactionId, }), }, Data: protoutil.MarshalOrPanic(&peer.Transaction{ @@ -118,7 +115,7 @@ func TestIterators(t *testing.T) { require.Equal(t, block, transaction.Block(), "transaction[%d].Block()", txIndex) require.Equal(t, transactionId, transaction.ID(), "transaction[%d].ID()", txIndex) require.EqualValues(t, now.Unix(), transaction.Timestamp().Seconds, "transaction[%d].Timestamp.Seconds", txIndex) - require.EqualValues(t, now.Nanosecond(), transaction.Timestamp().Nanos, "transaction[%d].Tomestamp.Nanos", txIndex) + require.EqualValues(t, now.Nanosecond(), int(transaction.Timestamp().Nanos), "transaction[%d].Tomestamp.Nanos", txIndex) events, err := transaction.ChaincodeEvents() require.NoError(t, err, "ChaincodeEvents()") diff --git a/internal/pkg/gateway/event/transaction.go b/internal/pkg/gateway/event/transaction.go index f128508a20a..0adaad4f831 100644 --- a/internal/pkg/gateway/event/transaction.go +++ b/internal/pkg/gateway/event/transaction.go @@ -6,17 +6,17 @@ SPDX-License-Identifier: Apache-2.0 package event import ( - "github.com/golang/protobuf/proto" - "github.com/golang/protobuf/ptypes/timestamp" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/types/known/timestamppb" ) type Transaction struct { parent *Block payload *common.Payload id string - timestamp *timestamp.Timestamp + timestamp *timestamppb.Timestamp status peer.TxValidationCode chaincodeEvents []*ChaincodeEvent } @@ -29,7 +29,7 @@ func (tx *Transaction) ID() string { return tx.id } -func (tx *Transaction) Timestamp() *timestamp.Timestamp { +func (tx *Transaction) Timestamp() *timestamppb.Timestamp { return tx.timestamp } diff --git a/internal/pkg/gateway/gateway.go b/internal/pkg/gateway/gateway.go index 1ed1e6a9a64..59b869c8631 100644 --- a/internal/pkg/gateway/gateway.go +++ b/internal/pkg/gateway/gateway.go @@ -9,7 +9,7 @@ import ( "context" "github.com/hyperledger/fabric-lib-go/common/flogging" - peerproto "github.com/hyperledger/fabric-protos-go/peer" + peerproto "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/channelconfig" "github.com/hyperledger/fabric/common/deliverclient/orderers" "github.com/hyperledger/fabric/core/peer" diff --git a/internal/pkg/gateway/ledger/mocks/ledger.go b/internal/pkg/gateway/ledger/mocks/ledger.go index 481d4c0077f..0a40967206d 100644 --- a/internal/pkg/gateway/ledger/mocks/ledger.go +++ b/internal/pkg/gateway/ledger/mocks/ledger.go @@ -4,8 +4,8 @@ package mocks import ( "sync" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" ledgerb "github.com/hyperledger/fabric/common/ledger" ledgera "github.com/hyperledger/fabric/core/ledger" "github.com/hyperledger/fabric/internal/pkg/gateway/ledger" diff --git a/internal/pkg/gateway/ledger/peeradapter.go b/internal/pkg/gateway/ledger/peeradapter.go index 7379b9f048f..c6ee329bb69 100644 --- a/internal/pkg/gateway/ledger/peeradapter.go +++ b/internal/pkg/gateway/ledger/peeradapter.go @@ -7,8 +7,8 @@ SPDX-License-Identifier: Apache-2.0 package ledger import ( - "github.com/hyperledger/fabric-protos-go/common" - peerproto "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + peerproto "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/ledger" peerledger "github.com/hyperledger/fabric/core/ledger" "github.com/hyperledger/fabric/core/peer" diff --git a/internal/pkg/gateway/mocks/abbclient.go b/internal/pkg/gateway/mocks/abbclient.go index 7a5222d5a43..b65d9a329d4 100644 --- a/internal/pkg/gateway/mocks/abbclient.go +++ b/internal/pkg/gateway/mocks/abbclient.go @@ -5,8 +5,8 @@ import ( "context" "sync" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/orderer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer" "google.golang.org/grpc/metadata" ) diff --git a/internal/pkg/gateway/mocks/abclient.go b/internal/pkg/gateway/mocks/abclient.go index 09624741d2a..971f32a4ac9 100644 --- a/internal/pkg/gateway/mocks/abclient.go +++ b/internal/pkg/gateway/mocks/abclient.go @@ -5,7 +5,7 @@ import ( "context" "sync" - "github.com/hyperledger/fabric-protos-go/orderer" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer" "google.golang.org/grpc" ) diff --git a/internal/pkg/gateway/mocks/chaincodeeventsserver.go b/internal/pkg/gateway/mocks/chaincodeeventsserver.go index 8f8d73247cb..f278bfad0c1 100644 --- a/internal/pkg/gateway/mocks/chaincodeeventsserver.go +++ b/internal/pkg/gateway/mocks/chaincodeeventsserver.go @@ -5,7 +5,7 @@ import ( "context" "sync" - "github.com/hyperledger/fabric-protos-go/gateway" + "github.com/hyperledger/fabric-protos-go-apiv2/gateway" "google.golang.org/grpc/metadata" ) diff --git a/internal/pkg/gateway/mocks/discovery.go b/internal/pkg/gateway/mocks/discovery.go index 782c43162c4..7231e0d7d87 100644 --- a/internal/pkg/gateway/mocks/discovery.go +++ b/internal/pkg/gateway/mocks/discovery.go @@ -4,8 +4,8 @@ package mocks import ( "sync" - "github.com/hyperledger/fabric-protos-go/discovery" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/discovery" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/gossip/api" "github.com/hyperledger/fabric/gossip/common" discoverya "github.com/hyperledger/fabric/gossip/discovery" diff --git a/internal/pkg/gateway/mocks/endorserclient.go b/internal/pkg/gateway/mocks/endorserclient.go index f363a343508..99fb20e4034 100644 --- a/internal/pkg/gateway/mocks/endorserclient.go +++ b/internal/pkg/gateway/mocks/endorserclient.go @@ -5,7 +5,7 @@ import ( "context" "sync" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "google.golang.org/grpc" ) diff --git a/internal/pkg/gateway/mocks/endorserserver.go b/internal/pkg/gateway/mocks/endorserserver.go index 6a389e6f2a0..07744091b87 100644 --- a/internal/pkg/gateway/mocks/endorserserver.go +++ b/internal/pkg/gateway/mocks/endorserserver.go @@ -5,7 +5,7 @@ import ( "context" "sync" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" ) type EndorserServer struct { diff --git a/internal/pkg/gateway/mocks/orderer.go b/internal/pkg/gateway/mocks/orderer.go index 636edaf0299..7f33a260e3d 100644 --- a/internal/pkg/gateway/mocks/orderer.go +++ b/internal/pkg/gateway/mocks/orderer.go @@ -5,8 +5,8 @@ import ( "sync" "time" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/orderer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer" "github.com/hyperledger/fabric/common/channelconfig" ) diff --git a/internal/pkg/gateway/registry.go b/internal/pkg/gateway/registry.go index 6ef5865ec3c..628ad8370a2 100644 --- a/internal/pkg/gateway/registry.go +++ b/internal/pkg/gateway/registry.go @@ -13,11 +13,10 @@ import ( "strings" "sync" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/common/flogging" - dp "github.com/hyperledger/fabric-protos-go/discovery" - "github.com/hyperledger/fabric-protos-go/gossip" - "github.com/hyperledger/fabric-protos-go/peer" + dp "github.com/hyperledger/fabric-protos-go-apiv2/discovery" + "github.com/hyperledger/fabric-protos-go-apiv2/gossip" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/channelconfig" "github.com/hyperledger/fabric/core/scc" gossipapi "github.com/hyperledger/fabric/gossip/api" @@ -26,7 +25,7 @@ import ( "github.com/hyperledger/fabric/internal/pkg/gateway/ledger" "github.com/pkg/errors" "google.golang.org/protobuf/encoding/prototext" - "google.golang.org/protobuf/protoadapt" + "google.golang.org/protobuf/proto" ) type Discovery interface { @@ -60,7 +59,7 @@ type endorserState struct { func (reg *registry) endorsementPlan(channel string, interest *peer.ChaincodeInterest, preferredEndorser *endorser) (*plan, error) { descriptor, err := reg.discovery.PeersForEndorsement(gossipcommon.ChannelID(channel), interest) if err != nil { - b, _ := prototext.Marshal(protoadapt.MessageV2Of(interest)) + b, _ := prototext.Marshal(interest) logger.Errorw("PeersForEndorsement failed.", "error", err, "channel", channel, "ChaincodeInterest", b) return nil, errors.Wrap(err, "no combination of peers can be derived which satisfy the endorsement policy") } diff --git a/internal/pkg/gateway/registry_test.go b/internal/pkg/gateway/registry_test.go index 29d01af74a7..9fea95893df 100644 --- a/internal/pkg/gateway/registry_test.go +++ b/internal/pkg/gateway/registry_test.go @@ -10,9 +10,9 @@ import ( "testing" "github.com/hyperledger/fabric-lib-go/bccsp/sw" - cb "github.com/hyperledger/fabric-protos-go/common" - dp "github.com/hyperledger/fabric-protos-go/discovery" - "github.com/hyperledger/fabric-protos-go/msp" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + dp "github.com/hyperledger/fabric-protos-go-apiv2/discovery" + "github.com/hyperledger/fabric-protos-go-apiv2/msp" "github.com/hyperledger/fabric/common/channelconfig" "github.com/hyperledger/fabric/common/crypto/tlsgen" "github.com/hyperledger/fabric/core/config/configtest" diff --git a/internal/pkg/gateway/submit.go b/internal/pkg/gateway/submit.go index 274f8fed0cd..5dc58607e09 100644 --- a/internal/pkg/gateway/submit.go +++ b/internal/pkg/gateway/submit.go @@ -14,15 +14,15 @@ import ( "sync/atomic" "time" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/common/flogging" - "github.com/hyperledger/fabric-protos-go/common" - gp "github.com/hyperledger/fabric-protos-go/gateway" - ab "github.com/hyperledger/fabric-protos-go/orderer" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + gp "github.com/hyperledger/fabric-protos-go-apiv2/gateway" + ab "github.com/hyperledger/fabric-protos-go-apiv2/orderer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/protoutil" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" ) // Submit will send the signed transaction to the ordering service. The response indicates whether the transaction was diff --git a/internal/pkg/gateway/submit_test.go b/internal/pkg/gateway/submit_test.go index 7111735eebd..1a1440a944c 100644 --- a/internal/pkg/gateway/submit_test.go +++ b/internal/pkg/gateway/submit_test.go @@ -12,12 +12,11 @@ import ( "testing" "time" - "github.com/golang/protobuf/proto" - cp "github.com/hyperledger/fabric-protos-go/common" - dp "github.com/hyperledger/fabric-protos-go/discovery" - pb "github.com/hyperledger/fabric-protos-go/gateway" - "github.com/hyperledger/fabric-protos-go/msp" - ab "github.com/hyperledger/fabric-protos-go/orderer" + cp "github.com/hyperledger/fabric-protos-go-apiv2/common" + dp "github.com/hyperledger/fabric-protos-go-apiv2/discovery" + pb "github.com/hyperledger/fabric-protos-go-apiv2/gateway" + "github.com/hyperledger/fabric-protos-go-apiv2/msp" + ab "github.com/hyperledger/fabric-protos-go-apiv2/orderer" "github.com/hyperledger/fabric/common/deliverclient/orderers" "github.com/hyperledger/fabric/internal/pkg/gateway/mocks" "github.com/pkg/errors" @@ -25,6 +24,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" ) func TestSubmit(t *testing.T) { diff --git a/internal/pkg/txflags/validation_flags.go b/internal/pkg/txflags/validation_flags.go index 3950c8f49a8..c3b667b9cc6 100644 --- a/internal/pkg/txflags/validation_flags.go +++ b/internal/pkg/txflags/validation_flags.go @@ -7,7 +7,7 @@ SPDX-License-Identifier: Apache-2.0 package txflags import ( - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" ) // ValidationFlags is array of transaction validation codes. It is used when committer validates block. diff --git a/internal/pkg/txflags/validation_flags_test.go b/internal/pkg/txflags/validation_flags_test.go index e0aa9022554..d85ea8a4318 100644 --- a/internal/pkg/txflags/validation_flags_test.go +++ b/internal/pkg/txflags/validation_flags_test.go @@ -9,7 +9,7 @@ package txflags import ( "testing" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/stretchr/testify/require" ) diff --git a/internal/test/matcher.go b/internal/test/matcher.go index 52846ffa3e5..176ef0d3fcd 100644 --- a/internal/test/matcher.go +++ b/internal/test/matcher.go @@ -10,9 +10,9 @@ import ( "fmt" "strings" - "github.com/golang/protobuf/proto" "github.com/onsi/gomega/types" "google.golang.org/protobuf/encoding/prototext" + "google.golang.org/protobuf/proto" ) // ProtoEqual provides a Gomega matcher that uses proto.Equal to compare actual with expected. @@ -64,10 +64,10 @@ func (m *protoEqualMatcher) NegatedFailureMessage(actual interface{}) string { } func (m *protoEqualMatcher) format(message proto.Message) string { - formatted := strings.TrimSpace(m.marshal.Format(proto.MessageV2(message))) + formatted := strings.TrimSpace(m.marshal.Format(message)) return fmt.Sprintf("%s{\n%s\n}", messageType(message), m.indent(formatted)) } func messageType(message proto.Message) string { - return string(proto.MessageV2(message).ProtoReflect().Descriptor().Name()) + return string(message.ProtoReflect().Descriptor().Name()) } diff --git a/msp/cache/cache.go b/msp/cache/cache.go index b42fe1cd532..8b4c124e25a 100644 --- a/msp/cache/cache.go +++ b/msp/cache/cache.go @@ -8,7 +8,7 @@ package cache import ( "github.com/hyperledger/fabric-lib-go/common/flogging" - pmsp "github.com/hyperledger/fabric-protos-go/msp" + pmsp "github.com/hyperledger/fabric-protos-go-apiv2/msp" "github.com/hyperledger/fabric/msp" "github.com/pkg/errors" ) diff --git a/msp/cache/cache_test.go b/msp/cache/cache_test.go index fccf8521fa6..bd7a0d4fada 100644 --- a/msp/cache/cache_test.go +++ b/msp/cache/cache_test.go @@ -10,7 +10,7 @@ import ( "sync" "testing" - msp2 "github.com/hyperledger/fabric-protos-go/msp" + msp2 "github.com/hyperledger/fabric-protos-go-apiv2/msp" "github.com/hyperledger/fabric/msp" "github.com/hyperledger/fabric/msp/mocks" "github.com/pkg/errors" diff --git a/msp/configbuilder.go b/msp/configbuilder.go index d3905400f57..1f8d4407cfb 100644 --- a/msp/configbuilder.go +++ b/msp/configbuilder.go @@ -12,11 +12,11 @@ import ( "path/filepath" "github.com/IBM/idemix" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/bccsp" "github.com/hyperledger/fabric-lib-go/bccsp/factory" - "github.com/hyperledger/fabric-protos-go/msp" + "github.com/hyperledger/fabric-protos-go-apiv2/msp" "github.com/pkg/errors" + "google.golang.org/protobuf/proto" "gopkg.in/yaml.v2" ) diff --git a/msp/idemix.go b/msp/idemix.go index 78234d9874d..cf37a224d09 100644 --- a/msp/idemix.go +++ b/msp/idemix.go @@ -7,7 +7,7 @@ package msp import ( "github.com/IBM/idemix" - "github.com/hyperledger/fabric-protos-go/msp" + "github.com/hyperledger/fabric-protos-go-apiv2/msp" ) type idemixSigningIdentityWrapper struct { diff --git a/msp/identities.go b/msp/identities.go index a9a2b3790cb..0bb84c2aaa2 100644 --- a/msp/identities.go +++ b/msp/identities.go @@ -16,12 +16,12 @@ import ( "sync" "time" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/bccsp" "github.com/hyperledger/fabric-lib-go/common/flogging" - "github.com/hyperledger/fabric-protos-go/msp" + "github.com/hyperledger/fabric-protos-go-apiv2/msp" "github.com/pkg/errors" "go.uber.org/zap/zapcore" + "google.golang.org/protobuf/proto" ) var mspIdentityLogger = flogging.MustGetLogger("msp.identity") diff --git a/msp/identities_test.go b/msp/identities_test.go index 43381086d19..625561ad193 100644 --- a/msp/identities_test.go +++ b/msp/identities_test.go @@ -15,12 +15,12 @@ import ( "encoding/pem" "testing" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/bccsp" "github.com/hyperledger/fabric-lib-go/bccsp/factory" "github.com/hyperledger/fabric-lib-go/bccsp/signer" "github.com/hyperledger/fabric-lib-go/bccsp/utils" - "github.com/hyperledger/fabric-protos-go/msp" + "github.com/hyperledger/fabric-protos-go-apiv2/msp" + "google.golang.org/protobuf/proto" "github.com/onsi/gomega" ) diff --git a/msp/mocks/mocks.go b/msp/mocks/mocks.go index 1a9180c8071..bd74364868d 100644 --- a/msp/mocks/mocks.go +++ b/msp/mocks/mocks.go @@ -9,7 +9,7 @@ package mocks import ( "time" - pmsp "github.com/hyperledger/fabric-protos-go/msp" + pmsp "github.com/hyperledger/fabric-protos-go-apiv2/msp" "github.com/hyperledger/fabric/msp" "github.com/stretchr/testify/mock" ) diff --git a/msp/msp.go b/msp/msp.go index c1d07c66c73..a2ba5b1ebd9 100644 --- a/msp/msp.go +++ b/msp/msp.go @@ -9,7 +9,7 @@ package msp import ( "time" - "github.com/hyperledger/fabric-protos-go/msp" + "github.com/hyperledger/fabric-protos-go-apiv2/msp" ) // IdentityDeserializer is implemented by both MSPManger and MSP diff --git a/msp/msp_test.go b/msp/msp_test.go index c2ef414e771..694064e79b3 100644 --- a/msp/msp_test.go +++ b/msp/msp_test.go @@ -26,15 +26,15 @@ import ( "testing" "time" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/bccsp" "github.com/hyperledger/fabric-lib-go/bccsp/factory" "github.com/hyperledger/fabric-lib-go/bccsp/sw" "github.com/hyperledger/fabric-lib-go/bccsp/utils" - "github.com/hyperledger/fabric-protos-go/msp" + "github.com/hyperledger/fabric-protos-go-apiv2/msp" "github.com/hyperledger/fabric/core/config/configtest" "github.com/hyperledger/fabric/protoutil" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) var notACert = `-----BEGIN X509 CRL----- diff --git a/msp/mspimpl.go b/msp/mspimpl.go index 446ff4ffed1..86da88e4ca7 100644 --- a/msp/mspimpl.go +++ b/msp/mspimpl.go @@ -16,14 +16,14 @@ import ( "fmt" "strings" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/bccsp" "github.com/hyperledger/fabric-lib-go/bccsp/factory" "github.com/hyperledger/fabric-lib-go/bccsp/signer" "github.com/hyperledger/fabric-lib-go/bccsp/sw" "github.com/hyperledger/fabric-lib-go/bccsp/utils" - m "github.com/hyperledger/fabric-protos-go/msp" + m "github.com/hyperledger/fabric-protos-go-apiv2/msp" "github.com/pkg/errors" + "google.golang.org/protobuf/proto" ) // mspSetupFuncType is the prototype of the setup function diff --git a/msp/mspimplsetup.go b/msp/mspimplsetup.go index d3faffe9e00..363c1fe8e37 100644 --- a/msp/mspimplsetup.go +++ b/msp/mspimplsetup.go @@ -14,11 +14,11 @@ import ( "fmt" "time" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/bccsp" "github.com/hyperledger/fabric-lib-go/bccsp/utils" - m "github.com/hyperledger/fabric-protos-go/msp" + m "github.com/hyperledger/fabric-protos-go-apiv2/msp" "github.com/pkg/errors" + "google.golang.org/protobuf/proto" ) func (msp *bccspmsp) getCertifiersIdentifier(certRaw []byte) ([]byte, error) { diff --git a/msp/mspimplsetup_test.go b/msp/mspimplsetup_test.go index e85357fa9b9..91010457e91 100644 --- a/msp/mspimplsetup_test.go +++ b/msp/mspimplsetup_test.go @@ -12,9 +12,8 @@ import ( "github.com/hyperledger/fabric-lib-go/bccsp" "github.com/hyperledger/fabric-lib-go/bccsp/sw" - "github.com/hyperledger/fabric-protos-go/msp" + "github.com/hyperledger/fabric-protos-go-apiv2/msp" "github.com/hyperledger/fabric/common/crypto/tlsgen" - "github.com/onsi/gomega" ) diff --git a/msp/mspmgrimpl.go b/msp/mspmgrimpl.go index 3f96019b9c5..cb698b370e4 100644 --- a/msp/mspmgrimpl.go +++ b/msp/mspmgrimpl.go @@ -7,10 +7,10 @@ SPDX-License-Identifier: Apache-2.0 package msp import ( - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/common/flogging" - "github.com/hyperledger/fabric-protos-go/msp" + "github.com/hyperledger/fabric-protos-go-apiv2/msp" "github.com/pkg/errors" + "google.golang.org/protobuf/proto" ) var mspLogger = flogging.MustGetLogger("msp") diff --git a/msp/nodeous_test.go b/msp/nodeous_test.go index 37b4bc9bac0..5d55e3a8073 100644 --- a/msp/nodeous_test.go +++ b/msp/nodeous_test.go @@ -20,10 +20,10 @@ import ( "path/filepath" "testing" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/bccsp/sw" - "github.com/hyperledger/fabric-protos-go/msp" + "github.com/hyperledger/fabric-protos-go-apiv2/msp" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) func TestInvalidAdminNodeOU(t *testing.T) { diff --git a/msp/revocation_test.go b/msp/revocation_test.go index 5b22fa2dfca..e5184b213ac 100644 --- a/msp/revocation_test.go +++ b/msp/revocation_test.go @@ -24,10 +24,10 @@ import ( "path/filepath" "testing" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/bccsp/sw" - "github.com/hyperledger/fabric-protos-go/msp" + "github.com/hyperledger/fabric-protos-go-apiv2/msp" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) func TestRevocation(t *testing.T) { diff --git a/orderer/common/blockcutter/blockcutter.go b/orderer/common/blockcutter/blockcutter.go index 45926a91874..6587b96ed54 100644 --- a/orderer/common/blockcutter/blockcutter.go +++ b/orderer/common/blockcutter/blockcutter.go @@ -10,7 +10,7 @@ import ( "time" "github.com/hyperledger/fabric-lib-go/common/flogging" - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/common/channelconfig" ) diff --git a/orderer/common/blockcutter/blockcutter_test.go b/orderer/common/blockcutter/blockcutter_test.go index 02cee4c01bc..5267a76e2ae 100644 --- a/orderer/common/blockcutter/blockcutter_test.go +++ b/orderer/common/blockcutter/blockcutter_test.go @@ -10,8 +10,8 @@ import ( . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" - cb "github.com/hyperledger/fabric-protos-go/common" - ab "github.com/hyperledger/fabric-protos-go/orderer" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + ab "github.com/hyperledger/fabric-protos-go-apiv2/orderer" "github.com/hyperledger/fabric/orderer/common/blockcutter" "github.com/hyperledger/fabric/orderer/common/blockcutter/mock" ) diff --git a/orderer/common/blockcutter/mock/orderer_config.go b/orderer/common/blockcutter/mock/orderer_config.go index db0aef2fb60..62bbf0e64ff 100644 --- a/orderer/common/blockcutter/mock/orderer_config.go +++ b/orderer/common/blockcutter/mock/orderer_config.go @@ -5,8 +5,8 @@ import ( "sync" "time" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/orderer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer" "github.com/hyperledger/fabric/common/channelconfig" ) diff --git a/orderer/common/broadcast/broadcast.go b/orderer/common/broadcast/broadcast.go index 1cb056bc778..a51db99040f 100644 --- a/orderer/common/broadcast/broadcast.go +++ b/orderer/common/broadcast/broadcast.go @@ -11,8 +11,8 @@ import ( "time" "github.com/hyperledger/fabric-lib-go/common/flogging" - cb "github.com/hyperledger/fabric-protos-go/common" - ab "github.com/hyperledger/fabric-protos-go/orderer" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + ab "github.com/hyperledger/fabric-protos-go-apiv2/orderer" "github.com/hyperledger/fabric/common/util" "github.com/hyperledger/fabric/orderer/common/msgprocessor" "github.com/pkg/errors" diff --git a/orderer/common/broadcast/broadcast_suite_test.go b/orderer/common/broadcast/broadcast_suite_test.go index eafb4e4207a..4488a167c5d 100644 --- a/orderer/common/broadcast/broadcast_suite_test.go +++ b/orderer/common/broadcast/broadcast_suite_test.go @@ -10,8 +10,7 @@ import ( "testing" "github.com/hyperledger/fabric-lib-go/common/metrics" - ab "github.com/hyperledger/fabric-protos-go/orderer" - + ab "github.com/hyperledger/fabric-protos-go-apiv2/orderer" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/orderer/common/broadcast/broadcast_test.go b/orderer/common/broadcast/broadcast_test.go index d4278e4e1d8..0d70cb68ec2 100644 --- a/orderer/common/broadcast/broadcast_test.go +++ b/orderer/common/broadcast/broadcast_test.go @@ -11,15 +11,14 @@ import ( "fmt" "io" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + ab "github.com/hyperledger/fabric-protos-go-apiv2/orderer" . "github.com/hyperledger/fabric/internal/test" - . "github.com/onsi/ginkgo/v2" - . "github.com/onsi/gomega" - - cb "github.com/hyperledger/fabric-protos-go/common" - ab "github.com/hyperledger/fabric-protos-go/orderer" "github.com/hyperledger/fabric/orderer/common/broadcast" "github.com/hyperledger/fabric/orderer/common/broadcast/mock" "github.com/hyperledger/fabric/orderer/common/msgprocessor" + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" ) var _ = Describe("Broadcast", func() { diff --git a/orderer/common/broadcast/metrics_test.go b/orderer/common/broadcast/metrics_test.go index 2d82ebdbcdf..19ab12daa43 100644 --- a/orderer/common/broadcast/metrics_test.go +++ b/orderer/common/broadcast/metrics_test.go @@ -7,11 +7,10 @@ SPDX-License-Identifier: Apache-2.0 package broadcast_test import ( - . "github.com/onsi/ginkgo/v2" - . "github.com/onsi/gomega" - "github.com/hyperledger/fabric/orderer/common/broadcast" "github.com/hyperledger/fabric/orderer/common/broadcast/mock" + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" ) var _ = Describe("Metrics", func() { diff --git a/orderer/common/broadcast/mock/ab_server.go b/orderer/common/broadcast/mock/ab_server.go index ed0b78f79a1..7a5bb1ab280 100644 --- a/orderer/common/broadcast/mock/ab_server.go +++ b/orderer/common/broadcast/mock/ab_server.go @@ -5,8 +5,8 @@ import ( "context" "sync" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/orderer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer" "google.golang.org/grpc/metadata" ) diff --git a/orderer/common/broadcast/mock/channel_support.go b/orderer/common/broadcast/mock/channel_support.go index 71c0e2ddcb8..1db31ab2731 100644 --- a/orderer/common/broadcast/mock/channel_support.go +++ b/orderer/common/broadcast/mock/channel_support.go @@ -4,7 +4,7 @@ package mock import ( "sync" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/orderer/common/broadcast" "github.com/hyperledger/fabric/orderer/common/msgprocessor" ) diff --git a/orderer/common/broadcast/mock/channel_support_registrar.go b/orderer/common/broadcast/mock/channel_support_registrar.go index f5a4a854231..6b248ac277e 100644 --- a/orderer/common/broadcast/mock/channel_support_registrar.go +++ b/orderer/common/broadcast/mock/channel_support_registrar.go @@ -4,7 +4,7 @@ package mock import ( "sync" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/orderer/common/broadcast" ) diff --git a/orderer/common/channelparticipation/mocks/channel_management.go b/orderer/common/channelparticipation/mocks/channel_management.go index fc48723aa14..f73a183e100 100644 --- a/orderer/common/channelparticipation/mocks/channel_management.go +++ b/orderer/common/channelparticipation/mocks/channel_management.go @@ -4,7 +4,7 @@ package mocks import ( "sync" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/orderer/common/channelparticipation" "github.com/hyperledger/fabric/orderer/common/types" ) diff --git a/orderer/common/channelparticipation/restapi.go b/orderer/common/channelparticipation/restapi.go index bd935deacd5..09405a6e69e 100644 --- a/orderer/common/channelparticipation/restapi.go +++ b/orderer/common/channelparticipation/restapi.go @@ -15,14 +15,14 @@ import ( "path" "strings" - "github.com/golang/protobuf/proto" "github.com/gorilla/mux" "github.com/hyperledger/fabric-lib-go/common/flogging" - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/common/configtx" "github.com/hyperledger/fabric/orderer/common/localconfig" "github.com/hyperledger/fabric/orderer/common/types" "github.com/pkg/errors" + "google.golang.org/protobuf/proto" ) const ( diff --git a/orderer/common/channelparticipation/restapi_test.go b/orderer/common/channelparticipation/restapi_test.go index 53ecd6c3218..34dbf948131 100644 --- a/orderer/common/channelparticipation/restapi_test.go +++ b/orderer/common/channelparticipation/restapi_test.go @@ -17,7 +17,7 @@ import ( "path" "testing" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/orderer/common/channelparticipation" "github.com/hyperledger/fabric/orderer/common/channelparticipation/mocks" "github.com/hyperledger/fabric/orderer/common/localconfig" diff --git a/orderer/common/channelparticipation/validator.go b/orderer/common/channelparticipation/validator.go index e55e3c80771..7a3bb6f890c 100644 --- a/orderer/common/channelparticipation/validator.go +++ b/orderer/common/channelparticipation/validator.go @@ -10,7 +10,7 @@ import ( "bytes" "github.com/hyperledger/fabric-lib-go/bccsp/factory" - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/common/channelconfig" "github.com/hyperledger/fabric/orderer/common/types" "github.com/hyperledger/fabric/protoutil" diff --git a/orderer/common/channelparticipation/validator_test.go b/orderer/common/channelparticipation/validator_test.go index 8e5c813001e..462cce77d1f 100644 --- a/orderer/common/channelparticipation/validator_test.go +++ b/orderer/common/channelparticipation/validator_test.go @@ -11,12 +11,12 @@ import ( "math" "testing" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/bccsp" - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/orderer/common/channelparticipation" "github.com/hyperledger/fabric/protoutil" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) func TestValidateJoinBlock(t *testing.T) { diff --git a/orderer/common/cluster/clusterservice.go b/orderer/common/cluster/clusterservice.go index 35283171e7c..7f76c7b64d3 100644 --- a/orderer/common/cluster/clusterservice.go +++ b/orderer/common/cluster/clusterservice.go @@ -17,8 +17,8 @@ import ( "time" "github.com/hyperledger/fabric-lib-go/common/flogging" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/orderer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer" "github.com/hyperledger/fabric/common/crypto" "github.com/hyperledger/fabric/common/util" "github.com/pkg/errors" diff --git a/orderer/common/cluster/clusterservice_test.go b/orderer/common/cluster/clusterservice_test.go index b5fb3fecbd6..c714bf9fe7f 100644 --- a/orderer/common/cluster/clusterservice_test.go +++ b/orderer/common/cluster/clusterservice_test.go @@ -17,11 +17,10 @@ import ( "testing" "time" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/common/flogging" "github.com/hyperledger/fabric-lib-go/common/metrics/disabled" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/orderer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer" "github.com/hyperledger/fabric/common/crypto" "github.com/hyperledger/fabric/common/util" comm_utils "github.com/hyperledger/fabric/internal/pkg/comm" @@ -34,6 +33,7 @@ import ( "go.uber.org/zap/zapcore" "google.golang.org/grpc" "google.golang.org/grpc/credentials" + "google.golang.org/protobuf/proto" "google.golang.org/protobuf/types/known/timestamppb" ) diff --git a/orderer/common/cluster/comm.go b/orderer/common/cluster/comm.go index 066f7d21492..36a25751303 100644 --- a/orderer/common/cluster/comm.go +++ b/orderer/common/cluster/comm.go @@ -15,13 +15,13 @@ import ( "sync/atomic" "time" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/common/flogging" - "github.com/hyperledger/fabric-protos-go/orderer" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer" "github.com/hyperledger/fabric/common/util" "github.com/pkg/errors" "google.golang.org/grpc" "google.golang.org/grpc/connectivity" + "google.golang.org/protobuf/proto" ) const ( diff --git a/orderer/common/cluster/comm_test.go b/orderer/common/cluster/comm_test.go index 62e95aa74c7..8ad5d1471da 100644 --- a/orderer/common/cluster/comm_test.go +++ b/orderer/common/cluster/comm_test.go @@ -18,13 +18,12 @@ import ( "testing" "time" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/common/flogging" "github.com/hyperledger/fabric-lib-go/common/metrics" "github.com/hyperledger/fabric-lib-go/common/metrics/disabled" "github.com/hyperledger/fabric-lib-go/common/metrics/metricsfakes" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/orderer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer" "github.com/hyperledger/fabric/common/crypto" "github.com/hyperledger/fabric/common/crypto/tlsgen" comm_utils "github.com/hyperledger/fabric/internal/pkg/comm" @@ -37,6 +36,7 @@ import ( "go.uber.org/zap" "go.uber.org/zap/zapcore" "google.golang.org/grpc" + "google.golang.org/protobuf/proto" ) const ( diff --git a/orderer/common/cluster/commauth.go b/orderer/common/cluster/commauth.go index 2969c2be03d..b195a335f3f 100644 --- a/orderer/common/cluster/commauth.go +++ b/orderer/common/cluster/commauth.go @@ -13,7 +13,7 @@ import ( "sync" "github.com/hyperledger/fabric-lib-go/common/flogging" - "github.com/hyperledger/fabric-protos-go/orderer" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer" "github.com/hyperledger/fabric/internal/pkg/identity" "github.com/pkg/errors" "google.golang.org/grpc" diff --git a/orderer/common/cluster/commauth_test.go b/orderer/common/cluster/commauth_test.go index be9033b110b..09f0a2f9228 100644 --- a/orderer/common/cluster/commauth_test.go +++ b/orderer/common/cluster/commauth_test.go @@ -16,19 +16,18 @@ import ( "testing" "time" - crypto2 "github.com/hyperledger/fabric/common/crypto" - - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/common/flogging" "github.com/hyperledger/fabric-lib-go/common/metrics/disabled" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/orderer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer" + crypto2 "github.com/hyperledger/fabric/common/crypto" comm_utils "github.com/hyperledger/fabric/internal/pkg/comm" "github.com/hyperledger/fabric/orderer/common/cluster" "github.com/hyperledger/fabric/orderer/common/cluster/mocks" "github.com/onsi/gomega" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) type clusterServiceNode struct { diff --git a/orderer/common/cluster/deliver.go b/orderer/common/cluster/deliver.go index 444717e4af2..487231e39c6 100644 --- a/orderer/common/cluster/deliver.go +++ b/orderer/common/cluster/deliver.go @@ -17,8 +17,8 @@ import ( "time" "github.com/hyperledger/fabric-lib-go/common/flogging" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/orderer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer" "github.com/hyperledger/fabric/common/util" "github.com/hyperledger/fabric/internal/pkg/identity" "github.com/hyperledger/fabric/protoutil" diff --git a/orderer/common/cluster/deliver_test.go b/orderer/common/cluster/deliver_test.go index e3be3927b5d..058eb26b01f 100644 --- a/orderer/common/cluster/deliver_test.go +++ b/orderer/common/cluster/deliver_test.go @@ -21,11 +21,10 @@ import ( "testing" "time" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/bccsp/factory" "github.com/hyperledger/fabric-lib-go/common/flogging" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/orderer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer" "github.com/hyperledger/fabric/internal/pkg/comm" "github.com/hyperledger/fabric/internal/pkg/identity" "github.com/hyperledger/fabric/orderer/common/cluster" @@ -40,6 +39,7 @@ import ( "google.golang.org/grpc/balancer" "google.golang.org/grpc/balancer/roundrobin" "google.golang.org/grpc/credentials/insecure" + "google.golang.org/protobuf/proto" ) // protects gRPC balancer registration @@ -1120,7 +1120,7 @@ func TestBlockPullerBadBlocks(t *testing.T) { { name: "bad type", corruptBlock: statusType, - expectedErrMsg: "faulty node, received: status:INTERNAL_SERVER_ERROR ", + expectedErrMsg: "faulty node, received: status:INTERNAL_SERVER_ERROR", }, { name: "wrong number", diff --git a/orderer/common/cluster/interfaces.go b/orderer/common/cluster/interfaces.go index 7e29fdccad2..087a63c6d0b 100644 --- a/orderer/common/cluster/interfaces.go +++ b/orderer/common/cluster/interfaces.go @@ -10,8 +10,8 @@ import ( "context" "fmt" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/orderer" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer" + "google.golang.org/protobuf/proto" ) //go:generate mockery --dir . --name Communicator --case underscore --output ./mocks/ diff --git a/orderer/common/cluster/mocks/StepClientStream.go b/orderer/common/cluster/mocks/StepClientStream.go index 3d67f14c801..6f2f31fa544 100644 --- a/orderer/common/cluster/mocks/StepClientStream.go +++ b/orderer/common/cluster/mocks/StepClientStream.go @@ -5,7 +5,7 @@ package mocks import ( context "context" - orderer "github.com/hyperledger/fabric-protos-go/orderer" + orderer "github.com/hyperledger/fabric-protos-go-apiv2/orderer" mock "github.com/stretchr/testify/mock" ) diff --git a/orderer/common/cluster/mocks/block_retriever.go b/orderer/common/cluster/mocks/block_retriever.go index d57405d1f80..5f959857a3e 100644 --- a/orderer/common/cluster/mocks/block_retriever.go +++ b/orderer/common/cluster/mocks/block_retriever.go @@ -3,7 +3,7 @@ package mocks import ( - common "github.com/hyperledger/fabric-protos-go/common" + common "github.com/hyperledger/fabric-protos-go-apiv2/common" mock "github.com/stretchr/testify/mock" ) diff --git a/orderer/common/cluster/mocks/chain_puller.go b/orderer/common/cluster/mocks/chain_puller.go index 571f667ea32..c15f240d5d5 100644 --- a/orderer/common/cluster/mocks/chain_puller.go +++ b/orderer/common/cluster/mocks/chain_puller.go @@ -3,7 +3,7 @@ package mocks import ( - common "github.com/hyperledger/fabric-protos-go/common" + common "github.com/hyperledger/fabric-protos-go-apiv2/common" mock "github.com/stretchr/testify/mock" ) diff --git a/orderer/common/cluster/mocks/cluster_client.go b/orderer/common/cluster/mocks/cluster_client.go index c3e3018ac3d..25d99edec4b 100644 --- a/orderer/common/cluster/mocks/cluster_client.go +++ b/orderer/common/cluster/mocks/cluster_client.go @@ -9,7 +9,7 @@ import ( mock "github.com/stretchr/testify/mock" - orderer "github.com/hyperledger/fabric-protos-go/orderer" + orderer "github.com/hyperledger/fabric-protos-go-apiv2/orderer" ) // ClusterClient is an autogenerated mock type for the ClusterClient type diff --git a/orderer/common/cluster/mocks/cluster_step_stream.go b/orderer/common/cluster/mocks/cluster_step_stream.go index 0d25493b1e2..ee212101433 100644 --- a/orderer/common/cluster/mocks/cluster_step_stream.go +++ b/orderer/common/cluster/mocks/cluster_step_stream.go @@ -8,7 +8,7 @@ import ( mock "github.com/stretchr/testify/mock" metadata "google.golang.org/grpc/metadata" - orderer "github.com/hyperledger/fabric-protos-go/orderer" + orderer "github.com/hyperledger/fabric-protos-go-apiv2/orderer" ) // ClusterStepStream is an autogenerated mock type for the ClusterStepStream type diff --git a/orderer/common/cluster/mocks/dispatcher.go b/orderer/common/cluster/mocks/dispatcher.go index 3fdb8a5d7a2..4ce50ff9b6f 100644 --- a/orderer/common/cluster/mocks/dispatcher.go +++ b/orderer/common/cluster/mocks/dispatcher.go @@ -5,7 +5,7 @@ package mocks import ( context "context" - orderer "github.com/hyperledger/fabric-protos-go/orderer" + orderer "github.com/hyperledger/fabric-protos-go-apiv2/orderer" mock "github.com/stretchr/testify/mock" ) diff --git a/orderer/common/cluster/mocks/handler.go b/orderer/common/cluster/mocks/handler.go index 0da10f586c8..4acb053b525 100644 --- a/orderer/common/cluster/mocks/handler.go +++ b/orderer/common/cluster/mocks/handler.go @@ -3,7 +3,7 @@ package mocks import ( - orderer "github.com/hyperledger/fabric-protos-go/orderer" + orderer "github.com/hyperledger/fabric-protos-go-apiv2/orderer" mock "github.com/stretchr/testify/mock" ) diff --git a/orderer/common/cluster/mocks/step_client.go b/orderer/common/cluster/mocks/step_client.go index 7dc8eaeda28..7cf1c39e91b 100644 --- a/orderer/common/cluster/mocks/step_client.go +++ b/orderer/common/cluster/mocks/step_client.go @@ -8,7 +8,7 @@ import ( mock "github.com/stretchr/testify/mock" metadata "google.golang.org/grpc/metadata" - orderer "github.com/hyperledger/fabric-protos-go/orderer" + orderer "github.com/hyperledger/fabric-protos-go-apiv2/orderer" ) // StepClient is an autogenerated mock type for the StepClient type diff --git a/orderer/common/cluster/mocks/step_stream.go b/orderer/common/cluster/mocks/step_stream.go index 4b0073692ba..5ceddf33b13 100644 --- a/orderer/common/cluster/mocks/step_stream.go +++ b/orderer/common/cluster/mocks/step_stream.go @@ -8,7 +8,7 @@ import ( mock "github.com/stretchr/testify/mock" metadata "google.golang.org/grpc/metadata" - orderer "github.com/hyperledger/fabric-protos-go/orderer" + orderer "github.com/hyperledger/fabric-protos-go-apiv2/orderer" ) // StepStream is an autogenerated mock type for the StepStream type diff --git a/orderer/common/cluster/remotecontext.go b/orderer/common/cluster/remotecontext.go index b66c059245a..852ab62824b 100644 --- a/orderer/common/cluster/remotecontext.go +++ b/orderer/common/cluster/remotecontext.go @@ -13,7 +13,7 @@ import ( "time" "github.com/hyperledger/fabric-lib-go/common/flogging" - "github.com/hyperledger/fabric-protos-go/orderer" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer" "github.com/hyperledger/fabric/common/util" "github.com/pkg/errors" "go.uber.org/zap" diff --git a/orderer/common/cluster/rpc.go b/orderer/common/cluster/rpc.go index 8848f60e92a..3fcef30ade7 100644 --- a/orderer/common/cluster/rpc.go +++ b/orderer/common/cluster/rpc.go @@ -13,7 +13,7 @@ import ( "time" "github.com/hyperledger/fabric-lib-go/common/flogging" - "github.com/hyperledger/fabric-protos-go/orderer" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer" "github.com/pkg/errors" "go.uber.org/zap/zapcore" "google.golang.org/grpc" diff --git a/orderer/common/cluster/rpc_test.go b/orderer/common/cluster/rpc_test.go index f7786d04f10..27e49b51e40 100644 --- a/orderer/common/cluster/rpc_test.go +++ b/orderer/common/cluster/rpc_test.go @@ -16,8 +16,8 @@ import ( "github.com/hyperledger/fabric-lib-go/common/flogging" "github.com/hyperledger/fabric-lib-go/common/metrics/disabled" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/orderer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer" "github.com/hyperledger/fabric/orderer/common/cluster" "github.com/hyperledger/fabric/orderer/common/cluster/mocks" "github.com/pkg/errors" diff --git a/orderer/common/cluster/service.go b/orderer/common/cluster/service.go index c0b08cf453e..83c76a14f3c 100644 --- a/orderer/common/cluster/service.go +++ b/orderer/common/cluster/service.go @@ -12,7 +12,7 @@ import ( "time" "github.com/hyperledger/fabric-lib-go/common/flogging" - "github.com/hyperledger/fabric-protos-go/orderer" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer" "github.com/hyperledger/fabric/common/util" "github.com/pkg/errors" "go.uber.org/zap" diff --git a/orderer/common/cluster/service_test.go b/orderer/common/cluster/service_test.go index 358ccec58df..11a2ed4c979 100644 --- a/orderer/common/cluster/service_test.go +++ b/orderer/common/cluster/service_test.go @@ -15,7 +15,7 @@ import ( "github.com/hyperledger/fabric-lib-go/common/flogging" "github.com/hyperledger/fabric-lib-go/common/metrics/disabled" - "github.com/hyperledger/fabric-protos-go/orderer" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer" "github.com/hyperledger/fabric/common/crypto/tlsgen" "github.com/hyperledger/fabric/internal/pkg/comm" "github.com/hyperledger/fabric/orderer/common/cluster" diff --git a/orderer/common/cluster/stream.go b/orderer/common/cluster/stream.go index 0bfa054a267..5a5c3eeaf71 100644 --- a/orderer/common/cluster/stream.go +++ b/orderer/common/cluster/stream.go @@ -13,7 +13,7 @@ import ( "time" "github.com/hyperledger/fabric-lib-go/common/flogging" - "github.com/hyperledger/fabric-protos-go/orderer" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer" "github.com/pkg/errors" "go.uber.org/zap" ) diff --git a/orderer/common/cluster/util.go b/orderer/common/cluster/util.go index 0027d5aec2c..2d0e1410425 100644 --- a/orderer/common/cluster/util.go +++ b/orderer/common/cluster/util.go @@ -24,13 +24,11 @@ import ( "sync/atomic" "time" - "github.com/golang/protobuf/proto" - "github.com/golang/protobuf/ptypes/timestamp" "github.com/hyperledger/fabric-config/protolator" "github.com/hyperledger/fabric-lib-go/bccsp" "github.com/hyperledger/fabric-lib-go/common/flogging" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/orderer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer" "github.com/hyperledger/fabric/common/channelconfig" "github.com/hyperledger/fabric/common/deliverclient" "github.com/hyperledger/fabric/common/policies" @@ -41,6 +39,8 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/credentials" "google.golang.org/grpc/peer" + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/types/known/timestamppb" ) // ConnByCertMap maps certificates represented as strings @@ -815,7 +815,7 @@ func LatestHeightAndEndpoint(puller ChainPuller) (string, uint64, error) { return mostUpToDateEndpoint, maxHeight, nil } -func EncodeTimestamp(t *timestamp.Timestamp) []byte { +func EncodeTimestamp(t *timestamppb.Timestamp) []byte { b := make([]byte, 8) binary.LittleEndian.PutUint64(b, uint64(t.Seconds)) return b diff --git a/orderer/common/cluster/util_test.go b/orderer/common/cluster/util_test.go index a1483a1d3d2..4dbad4ecf9a 100644 --- a/orderer/common/cluster/util_test.go +++ b/orderer/common/cluster/util_test.go @@ -22,14 +22,13 @@ import ( "testing" "time" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/bccsp" "github.com/hyperledger/fabric-lib-go/bccsp/sw" "github.com/hyperledger/fabric-lib-go/common/flogging" "github.com/hyperledger/fabric-lib-go/common/metrics/disabled" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/msp" - "github.com/hyperledger/fabric-protos-go/orderer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/msp" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer" "github.com/hyperledger/fabric/common/capabilities" "github.com/hyperledger/fabric/common/channelconfig" "github.com/hyperledger/fabric/common/configtx" @@ -45,6 +44,7 @@ import ( "github.com/hyperledger/fabric/protoutil" "github.com/onsi/gomega/gexec" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) //go:generate counterfeiter -o mocks/policy.go --fake-name Policy . policy diff --git a/orderer/common/follower/block_puller.go b/orderer/common/follower/block_puller.go index 806a7b17769..d721d512e8d 100644 --- a/orderer/common/follower/block_puller.go +++ b/orderer/common/follower/block_puller.go @@ -14,7 +14,7 @@ import ( "github.com/hyperledger/fabric-lib-go/bccsp" "github.com/hyperledger/fabric-lib-go/common/flogging" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/internal/pkg/identity" "github.com/hyperledger/fabric/orderer/common/cluster" "github.com/hyperledger/fabric/orderer/common/localconfig" diff --git a/orderer/common/follower/block_puller_test.go b/orderer/common/follower/block_puller_test.go index 9057be3b14d..e8bb926c8e5 100644 --- a/orderer/common/follower/block_puller_test.go +++ b/orderer/common/follower/block_puller_test.go @@ -15,7 +15,7 @@ import ( "github.com/hyperledger/fabric-lib-go/bccsp" "github.com/hyperledger/fabric-lib-go/bccsp/sw" - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/common/crypto/tlsgen" "github.com/hyperledger/fabric/core/config/configtest" "github.com/hyperledger/fabric/internal/configtxgen/encoder" diff --git a/orderer/common/follower/follower_chain.go b/orderer/common/follower/follower_chain.go index 26cc9266324..ba1529f158a 100644 --- a/orderer/common/follower/follower_chain.go +++ b/orderer/common/follower/follower_chain.go @@ -12,15 +12,15 @@ import ( "sync/atomic" "time" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/bccsp" "github.com/hyperledger/fabric-lib-go/common/flogging" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/orderer/common/cluster" "github.com/hyperledger/fabric/orderer/common/types" "github.com/hyperledger/fabric/orderer/consensus" "github.com/hyperledger/fabric/protoutil" "github.com/pkg/errors" + "google.golang.org/protobuf/proto" ) // ErrChainStopped is returned when the chain is stopped during execution. diff --git a/orderer/common/follower/follower_chain_test.go b/orderer/common/follower/follower_chain_test.go index 1aa1064f60b..4e11e6b95dd 100644 --- a/orderer/common/follower/follower_chain_test.go +++ b/orderer/common/follower/follower_chain_test.go @@ -12,11 +12,10 @@ import ( "testing" "time" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/bccsp" "github.com/hyperledger/fabric-lib-go/bccsp/sw" "github.com/hyperledger/fabric-lib-go/common/flogging" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/orderer/common/follower" "github.com/hyperledger/fabric/orderer/common/follower/mocks" "github.com/hyperledger/fabric/orderer/common/types" @@ -24,6 +23,7 @@ import ( "github.com/hyperledger/fabric/protoutil" "github.com/pkg/errors" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) //go:generate counterfeiter -o mocks/cluster_consenter.go -fake-name ClusterConsenter . clusterConsenter diff --git a/orderer/common/follower/mocks/block_puller_factory.go b/orderer/common/follower/mocks/block_puller_factory.go index c56eaf06a02..e1f8ade3e01 100644 --- a/orderer/common/follower/mocks/block_puller_factory.go +++ b/orderer/common/follower/mocks/block_puller_factory.go @@ -4,7 +4,7 @@ package mocks import ( "sync" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/orderer/common/follower" ) diff --git a/orderer/common/follower/mocks/channel_puller.go b/orderer/common/follower/mocks/channel_puller.go index 1d9c2b868da..a3453ddb18a 100644 --- a/orderer/common/follower/mocks/channel_puller.go +++ b/orderer/common/follower/mocks/channel_puller.go @@ -4,7 +4,7 @@ package mocks import ( "sync" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/orderer/common/cluster" "github.com/hyperledger/fabric/orderer/common/follower" ) diff --git a/orderer/common/follower/mocks/cluster_consenter.go b/orderer/common/follower/mocks/cluster_consenter.go index 72b8d3a3a00..15dfabd3d4f 100644 --- a/orderer/common/follower/mocks/cluster_consenter.go +++ b/orderer/common/follower/mocks/cluster_consenter.go @@ -4,7 +4,7 @@ package mocks import ( "sync" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" ) type ClusterConsenter struct { diff --git a/orderer/common/follower/mocks/ledger_resources.go b/orderer/common/follower/mocks/ledger_resources.go index 11a93e7387f..2e5b38bb5ae 100644 --- a/orderer/common/follower/mocks/ledger_resources.go +++ b/orderer/common/follower/mocks/ledger_resources.go @@ -4,7 +4,7 @@ package mocks import ( "sync" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/orderer/common/follower" ) diff --git a/orderer/common/msgprocessor/expiration.go b/orderer/common/msgprocessor/expiration.go index 89a131108af..35d593ae552 100644 --- a/orderer/common/msgprocessor/expiration.go +++ b/orderer/common/msgprocessor/expiration.go @@ -9,7 +9,7 @@ package msgprocessor import ( "time" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/common/channelconfig" "github.com/hyperledger/fabric/common/crypto" "github.com/hyperledger/fabric/protoutil" diff --git a/orderer/common/msgprocessor/expiration_test.go b/orderer/common/msgprocessor/expiration_test.go index 2c9880de7e8..768220be0f7 100644 --- a/orderer/common/msgprocessor/expiration_test.go +++ b/orderer/common/msgprocessor/expiration_test.go @@ -11,13 +11,13 @@ import ( "path/filepath" "testing" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/msp" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/msp" "github.com/hyperledger/fabric/common/channelconfig" "github.com/hyperledger/fabric/orderer/common/msgprocessor/mocks" "github.com/hyperledger/fabric/protoutil" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) //go:generate counterfeiter -o mocks/config_resources.go --fake-name Resources . configResources diff --git a/orderer/common/msgprocessor/filter.go b/orderer/common/msgprocessor/filter.go index 45b75af2da0..7c4181ec497 100644 --- a/orderer/common/msgprocessor/filter.go +++ b/orderer/common/msgprocessor/filter.go @@ -9,7 +9,7 @@ package msgprocessor import ( "errors" - ab "github.com/hyperledger/fabric-protos-go/common" + ab "github.com/hyperledger/fabric-protos-go-apiv2/common" ) // ErrEmptyMessage is returned by the empty message filter on rejection. diff --git a/orderer/common/msgprocessor/filter_test.go b/orderer/common/msgprocessor/filter_test.go index 4b40e1d1c64..91173d2efc2 100644 --- a/orderer/common/msgprocessor/filter_test.go +++ b/orderer/common/msgprocessor/filter_test.go @@ -10,7 +10,7 @@ import ( "fmt" "testing" - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/stretchr/testify/require" ) diff --git a/orderer/common/msgprocessor/maintenancefilter.go b/orderer/common/msgprocessor/maintenancefilter.go index 720a3e4c609..3e65f339196 100644 --- a/orderer/common/msgprocessor/maintenancefilter.go +++ b/orderer/common/msgprocessor/maintenancefilter.go @@ -9,18 +9,17 @@ package msgprocessor import ( "bytes" - "github.com/hyperledger/fabric/orderer/consensus/smartbft/util" - - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/bccsp" - cb "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/orderer" - "github.com/hyperledger/fabric-protos-go/orderer/etcdraft" - "github.com/hyperledger/fabric-protos-go/orderer/smartbft" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer/etcdraft" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer/smartbft" "github.com/hyperledger/fabric/common/channelconfig" "github.com/hyperledger/fabric/common/configtx" + "github.com/hyperledger/fabric/orderer/consensus/smartbft/util" "github.com/hyperledger/fabric/protoutil" "github.com/pkg/errors" + "google.golang.org/protobuf/proto" ) // MaintenanceFilterSupport provides the resources required for the maintenance filter. diff --git a/orderer/common/msgprocessor/maintenancefilter_test.go b/orderer/common/msgprocessor/maintenancefilter_test.go index e0e2ee76769..12730eceafb 100644 --- a/orderer/common/msgprocessor/maintenancefilter_test.go +++ b/orderer/common/msgprocessor/maintenancefilter_test.go @@ -10,15 +10,15 @@ import ( "fmt" "os" "path" + "strings" "testing" - "github.com/golang/protobuf/proto" "github.com/hyperledger-labs/SmartBFT/pkg/types" "github.com/hyperledger/fabric-lib-go/bccsp/sw" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/orderer" - "github.com/hyperledger/fabric-protos-go/orderer/etcdraft" - "github.com/hyperledger/fabric-protos-go/orderer/smartbft" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer/etcdraft" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer/smartbft" "github.com/hyperledger/fabric/common/capabilities" "github.com/hyperledger/fabric/common/channelconfig" "github.com/hyperledger/fabric/common/crypto/tlsgen" @@ -29,6 +29,7 @@ import ( "github.com/hyperledger/fabric/orderer/common/msgprocessor/mocks" "github.com/hyperledger/fabric/protoutil" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) func newMockOrdererConfig(migration bool, state orderer.ConsensusType_State) *mocks.OrdererConfig { @@ -283,8 +284,10 @@ func TestMaintenanceInspectChange(t *testing.T) { configTx := makeConfigEnvelopeWithExtraStuff(t, current, next, 0, 2) err := mf.Apply(configTx) require.Error(t, err) - require.EqualError(t, err, - "config transaction inspection failed: invalid BFT consenter mapping configuration: No suitable BFT consenter for Raft consenter: host:\"127.0.0.1\" port:4000 client_tls_cert:\"\\001\\002\\003\" server_tls_cert:\"\\004\\005\\006\" ") + + t1 := strings.ReplaceAll(err.Error(), " ", "") + t2 := strings.ReplaceAll("config transaction inspection failed: invalid BFT consenter mapping configuration: No suitable BFT consenter for Raft consenter: host:\"127.0.0.1\" port:4000 client_tls_cert:\"\\x01\\x02\\x03\" server_tls_cert:\"\\x04\\x05\\x06\"", " ", "") + require.Equal(t, t1, t2) }) t.Run("Bad: good type change with valid BFT metadata but missing consenters", func(t *testing.T) { diff --git a/orderer/common/msgprocessor/mocks/orderer_config.go b/orderer/common/msgprocessor/mocks/orderer_config.go index 82c28c0bd47..b03232e6e05 100644 --- a/orderer/common/msgprocessor/mocks/orderer_config.go +++ b/orderer/common/msgprocessor/mocks/orderer_config.go @@ -5,8 +5,8 @@ import ( "sync" "time" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/orderer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer" "github.com/hyperledger/fabric/common/channelconfig" ) diff --git a/orderer/common/msgprocessor/msgprocessor.go b/orderer/common/msgprocessor/msgprocessor.go index 6bde023745b..9873e3f1522 100644 --- a/orderer/common/msgprocessor/msgprocessor.go +++ b/orderer/common/msgprocessor/msgprocessor.go @@ -12,7 +12,7 @@ import ( "errors" "github.com/hyperledger/fabric-lib-go/common/flogging" - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" ) const ( diff --git a/orderer/common/msgprocessor/sigfilter.go b/orderer/common/msgprocessor/sigfilter.go index b45d66ab3d7..e74b6df2af9 100644 --- a/orderer/common/msgprocessor/sigfilter.go +++ b/orderer/common/msgprocessor/sigfilter.go @@ -9,8 +9,8 @@ package msgprocessor import ( "fmt" - cb "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/orderer" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer" "github.com/hyperledger/fabric/common/channelconfig" "github.com/hyperledger/fabric/common/policies" "github.com/hyperledger/fabric/protoutil" diff --git a/orderer/common/msgprocessor/sigfilter_test.go b/orderer/common/msgprocessor/sigfilter_test.go index 63bac6efcfb..3c56beeb321 100644 --- a/orderer/common/msgprocessor/sigfilter_test.go +++ b/orderer/common/msgprocessor/sigfilter_test.go @@ -11,8 +11,8 @@ import ( "testing" "github.com/hyperledger/fabric-lib-go/common/flogging" - cb "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/orderer" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer" "github.com/hyperledger/fabric/common/policies" "github.com/hyperledger/fabric/orderer/common/msgprocessor/mocks" "github.com/hyperledger/fabric/protoutil" diff --git a/orderer/common/msgprocessor/sizefilter.go b/orderer/common/msgprocessor/sizefilter.go index 3e09aba2c3f..a3c6f2b269f 100644 --- a/orderer/common/msgprocessor/sizefilter.go +++ b/orderer/common/msgprocessor/sizefilter.go @@ -9,7 +9,7 @@ package msgprocessor import ( "fmt" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/common/channelconfig" ) diff --git a/orderer/common/msgprocessor/sizefilter_test.go b/orderer/common/msgprocessor/sizefilter_test.go index 3c1f4eef0b0..deaa825435a 100644 --- a/orderer/common/msgprocessor/sizefilter_test.go +++ b/orderer/common/msgprocessor/sizefilter_test.go @@ -9,11 +9,11 @@ package msgprocessor import ( "testing" - "github.com/golang/protobuf/proto" - cb "github.com/hyperledger/fabric-protos-go/common" - ab "github.com/hyperledger/fabric-protos-go/orderer" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + ab "github.com/hyperledger/fabric-protos-go-apiv2/orderer" "github.com/hyperledger/fabric/orderer/common/msgprocessor/mocks" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) func TestMaxBytesRule(t *testing.T) { diff --git a/orderer/common/msgprocessor/standardchannel.go b/orderer/common/msgprocessor/standardchannel.go index 6ac56cedc0d..f1da1170f27 100644 --- a/orderer/common/msgprocessor/standardchannel.go +++ b/orderer/common/msgprocessor/standardchannel.go @@ -8,14 +8,13 @@ package msgprocessor import ( "github.com/hyperledger/fabric-lib-go/bccsp" - cb "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/orderer" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer" "github.com/hyperledger/fabric/common/channelconfig" "github.com/hyperledger/fabric/common/policies" "github.com/hyperledger/fabric/internal/pkg/identity" - "github.com/hyperledger/fabric/protoutil" - "github.com/hyperledger/fabric/orderer/common/localconfig" + "github.com/hyperledger/fabric/protoutil" "github.com/pkg/errors" ) diff --git a/orderer/common/msgprocessor/standardchannel_test.go b/orderer/common/msgprocessor/standardchannel_test.go index 57cdf343e86..6243d5dcb1e 100644 --- a/orderer/common/msgprocessor/standardchannel_test.go +++ b/orderer/common/msgprocessor/standardchannel_test.go @@ -11,8 +11,8 @@ import ( "testing" "github.com/hyperledger/fabric-lib-go/bccsp/sw" - cb "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/orderer" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer" "github.com/hyperledger/fabric/common/channelconfig" "github.com/hyperledger/fabric/internal/pkg/identity" "github.com/hyperledger/fabric/orderer/common/msgprocessor/mocks" diff --git a/orderer/common/multichannel/blockwriter.go b/orderer/common/multichannel/blockwriter.go index c856b479fb4..cbda9ed60d4 100644 --- a/orderer/common/multichannel/blockwriter.go +++ b/orderer/common/multichannel/blockwriter.go @@ -9,14 +9,14 @@ package multichannel import ( "sync" - "github.com/golang/protobuf/proto" - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" newchannelconfig "github.com/hyperledger/fabric/common/channelconfig" "github.com/hyperledger/fabric/common/configtx" "github.com/hyperledger/fabric/common/ledger/blockledger" "github.com/hyperledger/fabric/common/util" "github.com/hyperledger/fabric/internal/pkg/identity" "github.com/hyperledger/fabric/protoutil" + "google.golang.org/protobuf/proto" ) type blockWriterSupport interface { diff --git a/orderer/common/multichannel/blockwriter_test.go b/orderer/common/multichannel/blockwriter_test.go index cc6aa097626..918093773c0 100644 --- a/orderer/common/multichannel/blockwriter_test.go +++ b/orderer/common/multichannel/blockwriter_test.go @@ -9,12 +9,11 @@ package multichannel import ( "testing" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/bccsp" "github.com/hyperledger/fabric-lib-go/bccsp/sw" "github.com/hyperledger/fabric-lib-go/common/metrics/disabled" - cb "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/orderer" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer" "github.com/hyperledger/fabric/common/channelconfig" "github.com/hyperledger/fabric/common/configtx" "github.com/hyperledger/fabric/common/ledger/blockledger" @@ -27,6 +26,7 @@ import ( "github.com/hyperledger/fabric/orderer/common/multichannel/mocks" "github.com/hyperledger/fabric/protoutil" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) //go:generate counterfeiter -o mocks/configtx_validator.go --fake-name ConfigTXValidator . configtxValidator diff --git a/orderer/common/multichannel/chainsupport.go b/orderer/common/multichannel/chainsupport.go index 1018e3810ca..9f22f184702 100644 --- a/orderer/common/multichannel/chainsupport.go +++ b/orderer/common/multichannel/chainsupport.go @@ -8,7 +8,7 @@ package multichannel import ( "github.com/hyperledger/fabric-lib-go/bccsp" - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/common/ledger/blockledger" "github.com/hyperledger/fabric/internal/pkg/identity" "github.com/hyperledger/fabric/orderer/common/blockcutter" diff --git a/orderer/common/multichannel/chainsupport_test.go b/orderer/common/multichannel/chainsupport_test.go index 4da1bf5889b..14c9e1d78a1 100644 --- a/orderer/common/multichannel/chainsupport_test.go +++ b/orderer/common/multichannel/chainsupport_test.go @@ -10,7 +10,7 @@ import ( "testing" "github.com/hyperledger/fabric-lib-go/bccsp/sw" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" msgprocessormocks "github.com/hyperledger/fabric/orderer/common/msgprocessor/mocks" "github.com/hyperledger/fabric/orderer/common/multichannel/mocks" "github.com/pkg/errors" diff --git a/orderer/common/multichannel/ledger_resources.go b/orderer/common/multichannel/ledger_resources.go index 8134332e21d..bb218a6853c 100644 --- a/orderer/common/multichannel/ledger_resources.go +++ b/orderer/common/multichannel/ledger_resources.go @@ -8,7 +8,7 @@ package multichannel import ( "github.com/hyperledger/fabric-lib-go/bccsp" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/common/channelconfig" "github.com/hyperledger/fabric/common/ledger/blockledger" "github.com/hyperledger/fabric/protoutil" diff --git a/orderer/common/multichannel/ledger_resources_test.go b/orderer/common/multichannel/ledger_resources_test.go index e22267826e1..19a6c2fa192 100644 --- a/orderer/common/multichannel/ledger_resources_test.go +++ b/orderer/common/multichannel/ledger_resources_test.go @@ -9,10 +9,9 @@ package multichannel import ( "testing" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/bccsp/sw" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/orderer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer" "github.com/hyperledger/fabric/common/channelconfig" "github.com/hyperledger/fabric/common/deliver/mock" "github.com/hyperledger/fabric/common/ledger/blockledger" @@ -22,6 +21,7 @@ import ( "github.com/hyperledger/fabric/internal/configtxgen/genesisconfig" "github.com/hyperledger/fabric/orderer/common/multichannel/mocks" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) //go:generate counterfeiter -o mocks/policy.go --fake-name Policy . policy diff --git a/orderer/common/multichannel/mocks/configtx_validator.go b/orderer/common/multichannel/mocks/configtx_validator.go index cd41bd39c6e..3c041483869 100644 --- a/orderer/common/multichannel/mocks/configtx_validator.go +++ b/orderer/common/multichannel/mocks/configtx_validator.go @@ -4,7 +4,7 @@ package mocks import ( "sync" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" ) type ConfigTXValidator struct { diff --git a/orderer/common/multichannel/mocks/consenter.go b/orderer/common/multichannel/mocks/consenter.go index b257370cc13..c82deccdad9 100644 --- a/orderer/common/multichannel/mocks/consenter.go +++ b/orderer/common/multichannel/mocks/consenter.go @@ -4,7 +4,7 @@ package mocks import ( "sync" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/orderer/consensus" ) diff --git a/orderer/common/multichannel/mocks/orderer_config.go b/orderer/common/multichannel/mocks/orderer_config.go index 3f1e49f81a3..f26d106d0a4 100644 --- a/orderer/common/multichannel/mocks/orderer_config.go +++ b/orderer/common/multichannel/mocks/orderer_config.go @@ -5,8 +5,8 @@ import ( "sync" "time" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/orderer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer" "github.com/hyperledger/fabric/common/channelconfig" ) diff --git a/orderer/common/multichannel/mocks/read_writer.go b/orderer/common/multichannel/mocks/read_writer.go index be2768bc0c5..cf4f61a831b 100644 --- a/orderer/common/multichannel/mocks/read_writer.go +++ b/orderer/common/multichannel/mocks/read_writer.go @@ -4,8 +4,8 @@ package mocks import ( "sync" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/orderer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer" "github.com/hyperledger/fabric/common/ledger/blockledger" ) diff --git a/orderer/common/multichannel/registrar.go b/orderer/common/multichannel/registrar.go index aef5b2ea143..40127fa3525 100644 --- a/orderer/common/multichannel/registrar.go +++ b/orderer/common/multichannel/registrar.go @@ -13,11 +13,10 @@ import ( "path/filepath" "sync" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/bccsp" "github.com/hyperledger/fabric-lib-go/common/flogging" "github.com/hyperledger/fabric-lib-go/common/metrics" - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/common/channelconfig" "github.com/hyperledger/fabric/common/configtx" "github.com/hyperledger/fabric/common/ledger/blockledger" @@ -34,6 +33,7 @@ import ( "github.com/hyperledger/fabric/orderer/consensus/etcdraft" "github.com/hyperledger/fabric/protoutil" "github.com/pkg/errors" + "google.golang.org/protobuf/proto" ) const ( @@ -652,6 +652,9 @@ func (r *Registrar) JoinChannel(channelID string, configBlock *cb.Block) (info t return types.ChannelInfo{}, err } + if configBlock == nil { + return types.ChannelInfo{}, errors.Wrap(err, "failed marshaling joinblock: proto: Marshal called with nil") + } blockBytes, err := proto.Marshal(configBlock) if err != nil { return types.ChannelInfo{}, errors.Wrap(err, "failed marshaling joinblock") diff --git a/orderer/common/multichannel/registrar_test.go b/orderer/common/multichannel/registrar_test.go index 31b292f113a..ac837ceac9a 100644 --- a/orderer/common/multichannel/registrar_test.go +++ b/orderer/common/multichannel/registrar_test.go @@ -14,12 +14,11 @@ import ( "testing" "time" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/bccsp" "github.com/hyperledger/fabric-lib-go/bccsp/sw" "github.com/hyperledger/fabric-lib-go/common/metrics/disabled" - cb "github.com/hyperledger/fabric-protos-go/common" - ab "github.com/hyperledger/fabric-protos-go/orderer" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + ab "github.com/hyperledger/fabric-protos-go-apiv2/orderer" "github.com/hyperledger/fabric/common/channelconfig" "github.com/hyperledger/fabric/common/crypto/tlsgen" "github.com/hyperledger/fabric/common/ledger/blockledger" @@ -39,6 +38,7 @@ import ( "github.com/pkg/errors" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) //go:generate counterfeiter -o mocks/resources.go --fake-name Resources . resources diff --git a/orderer/common/multichannel/util_test.go b/orderer/common/multichannel/util_test.go index d356e46f348..cc51685d30f 100644 --- a/orderer/common/multichannel/util_test.go +++ b/orderer/common/multichannel/util_test.go @@ -9,7 +9,7 @@ package multichannel import ( "fmt" - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/common/capabilities" "github.com/hyperledger/fabric/common/channelconfig" "github.com/hyperledger/fabric/common/configtx" diff --git a/orderer/common/server/attestationserver.go b/orderer/common/server/attestationserver.go index 3ded35461eb..771dea74450 100644 --- a/orderer/common/server/attestationserver.go +++ b/orderer/common/server/attestationserver.go @@ -11,8 +11,8 @@ import ( "time" "github.com/hyperledger/fabric-lib-go/common/metrics" - cb "github.com/hyperledger/fabric-protos-go/common" - ab "github.com/hyperledger/fabric-protos-go/orderer" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + ab "github.com/hyperledger/fabric-protos-go-apiv2/orderer" "github.com/hyperledger/fabric/common/deliver" "github.com/hyperledger/fabric/common/policies" "github.com/hyperledger/fabric/orderer/common/localconfig" diff --git a/orderer/common/server/attestationserver_test.go b/orderer/common/server/attestationserver_test.go index eec44c984ce..3508f6f8d1a 100644 --- a/orderer/common/server/attestationserver_test.go +++ b/orderer/common/server/attestationserver_test.go @@ -12,8 +12,8 @@ import ( "time" "github.com/hyperledger/fabric-lib-go/common/metrics/disabled" - cb "github.com/hyperledger/fabric-protos-go/common" - ab "github.com/hyperledger/fabric-protos-go/orderer" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + ab "github.com/hyperledger/fabric-protos-go-apiv2/orderer" "github.com/hyperledger/fabric/common/ledger/blockledger" "github.com/hyperledger/fabric/common/ledger/blockledger/fileledger" "github.com/hyperledger/fabric/common/util" diff --git a/orderer/common/server/main.go b/orderer/common/server/main.go index 7cc19a1fc51..12f31f83fe5 100644 --- a/orderer/common/server/main.go +++ b/orderer/common/server/main.go @@ -25,7 +25,7 @@ import ( floggingmetrics "github.com/hyperledger/fabric-lib-go/common/flogging/metrics" "github.com/hyperledger/fabric-lib-go/common/metrics" "github.com/hyperledger/fabric-lib-go/common/metrics/disabled" - ab "github.com/hyperledger/fabric-protos-go/orderer" + ab "github.com/hyperledger/fabric-protos-go-apiv2/orderer" "github.com/hyperledger/fabric/common/channelconfig" "github.com/hyperledger/fabric/common/crypto" "github.com/hyperledger/fabric/common/fabhttp" diff --git a/orderer/common/server/main_test.go b/orderer/common/server/main_test.go index ee8d8d7d840..0d438797554 100644 --- a/orderer/common/server/main_test.go +++ b/orderer/common/server/main_test.go @@ -23,7 +23,7 @@ import ( "github.com/hyperledger/fabric-lib-go/common/flogging/floggingtest" "github.com/hyperledger/fabric-lib-go/common/metrics/disabled" "github.com/hyperledger/fabric-lib-go/common/metrics/prometheus" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/common/channelconfig" "github.com/hyperledger/fabric/common/crypto/tlsgen" "github.com/hyperledger/fabric/common/ledger/blockledger" diff --git a/orderer/common/server/mock/broadcastservice.go b/orderer/common/server/mock/broadcastservice.go index 8b987563867..3246626d3a1 100644 --- a/orderer/common/server/mock/broadcastservice.go +++ b/orderer/common/server/mock/broadcastservice.go @@ -4,7 +4,7 @@ package mock import ( "sync" - "github.com/hyperledger/fabric-protos-go/orderer" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer" "github.com/hyperledger/fabric/orderer/common/server" ) diff --git a/orderer/common/server/server.go b/orderer/common/server/server.go index 6682ae55fac..705352f5e95 100644 --- a/orderer/common/server/server.go +++ b/orderer/common/server/server.go @@ -12,10 +12,9 @@ import ( "runtime/debug" "time" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/common/metrics" - cb "github.com/hyperledger/fabric-protos-go/common" - ab "github.com/hyperledger/fabric-protos-go/orderer" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + ab "github.com/hyperledger/fabric-protos-go-apiv2/orderer" "github.com/hyperledger/fabric/common/deliver" "github.com/hyperledger/fabric/common/policies" "github.com/hyperledger/fabric/orderer/common/broadcast" @@ -24,6 +23,7 @@ import ( "github.com/hyperledger/fabric/orderer/common/multichannel" "github.com/hyperledger/fabric/protoutil" "github.com/pkg/errors" + "google.golang.org/protobuf/proto" ) type broadcastSupport struct { @@ -122,6 +122,10 @@ func (mt *msgTracer) trace(traceDir string, msg *cb.Envelope, err error) { path := fmt.Sprintf("%s%c%d_%p.%s", traceDir, os.PathSeparator, now, msg, mt.function) logger.Debugf("Writing %s request trace to %s", mt.function, path) go func() { + if msg == nil { + logger.Debugf("Error marshaling trace msg for %s: proto: Marshal called with nil", path) + return + } pb, err := proto.Marshal(msg) if err != nil { logger.Debugf("Error marshaling trace msg for %s: %s", path, err) diff --git a/orderer/common/server/server_test.go b/orderer/common/server/server_test.go index 2a71b0102d8..b411ea95c21 100644 --- a/orderer/common/server/server_test.go +++ b/orderer/common/server/server_test.go @@ -12,14 +12,14 @@ import ( "testing" "time" - "github.com/golang/protobuf/proto" - cb "github.com/hyperledger/fabric-protos-go/common" - ab "github.com/hyperledger/fabric-protos-go/orderer" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + ab "github.com/hyperledger/fabric-protos-go-apiv2/orderer" "github.com/hyperledger/fabric/orderer/common/localconfig" "github.com/hyperledger/fabric/orderer/common/multichannel" "github.com/hyperledger/fabric/protoutil" "github.com/stretchr/testify/require" "google.golang.org/grpc" + "google.golang.org/protobuf/proto" ) func TestBroadcastNoPanic(t *testing.T) { diff --git a/orderer/common/server/throttle_test.go b/orderer/common/server/throttle_test.go index 66692008f22..cd74eaafa78 100644 --- a/orderer/common/server/throttle_test.go +++ b/orderer/common/server/throttle_test.go @@ -13,7 +13,7 @@ import ( "encoding/hex" "testing" - "github.com/hyperledger/fabric-protos-go/orderer" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer" "github.com/hyperledger/fabric/orderer/common/broadcast/mock" "github.com/hyperledger/fabric/orderer/common/server" mock2 "github.com/hyperledger/fabric/orderer/common/server/mock" diff --git a/orderer/common/server/util.go b/orderer/common/server/util.go index 5996b278519..54aaf327ffa 100644 --- a/orderer/common/server/util.go +++ b/orderer/common/server/util.go @@ -10,11 +10,10 @@ import ( "encoding/hex" "time" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/bccsp" "github.com/hyperledger/fabric-lib-go/common/metrics" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/orderer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer" "github.com/hyperledger/fabric/common/channelconfig" "github.com/hyperledger/fabric/common/ledger/blockledger" "github.com/hyperledger/fabric/common/ledger/blockledger/fileledger" @@ -22,6 +21,7 @@ import ( config "github.com/hyperledger/fabric/orderer/common/localconfig" "github.com/hyperledger/fabric/orderer/common/throttle" "github.com/pkg/errors" + "google.golang.org/protobuf/proto" ) func createLedgerFactory(conf *config.TopLevel, metricsProvider metrics.Provider) (blockledger.Factory, error) { diff --git a/orderer/common/server/util_test.go b/orderer/common/server/util_test.go index 4b12e8fdda3..ed9d3be1514 100644 --- a/orderer/common/server/util_test.go +++ b/orderer/common/server/util_test.go @@ -11,13 +11,13 @@ import ( "path/filepath" "testing" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/bccsp/sw" "github.com/hyperledger/fabric-lib-go/common/metrics/disabled" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/core/config/configtest" config "github.com/hyperledger/fabric/orderer/common/localconfig" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) func TestCreateLedgerFactory(t *testing.T) { diff --git a/orderer/consensus/consensus.go b/orderer/consensus/consensus.go index e0aac0b78d1..18f214973bd 100644 --- a/orderer/consensus/consensus.go +++ b/orderer/consensus/consensus.go @@ -7,7 +7,7 @@ SPDX-License-Identifier: Apache-2.0 package consensus import ( - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/common/channelconfig" "github.com/hyperledger/fabric/internal/pkg/identity" "github.com/hyperledger/fabric/orderer/common/blockcutter" diff --git a/orderer/consensus/etcdraft/blockcreator.go b/orderer/consensus/etcdraft/blockcreator.go index c4881441cd0..d9ba1dfd4a7 100644 --- a/orderer/consensus/etcdraft/blockcreator.go +++ b/orderer/consensus/etcdraft/blockcreator.go @@ -7,10 +7,10 @@ SPDX-License-Identifier: Apache-2.0 package etcdraft import ( - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/common/flogging" - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/protoutil" + "google.golang.org/protobuf/proto" ) // blockCreator holds number and hash of latest block diff --git a/orderer/consensus/etcdraft/blockcreator_test.go b/orderer/consensus/etcdraft/blockcreator_test.go index a1a38726a41..3de7d97f5d4 100644 --- a/orderer/consensus/etcdraft/blockcreator_test.go +++ b/orderer/consensus/etcdraft/blockcreator_test.go @@ -10,7 +10,7 @@ import ( "testing" "github.com/hyperledger/fabric-lib-go/common/flogging" - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/protoutil" "github.com/stretchr/testify/require" "go.uber.org/zap" diff --git a/orderer/consensus/etcdraft/blockpuller.go b/orderer/consensus/etcdraft/blockpuller.go index 664b81b1e14..df2bd4214be 100644 --- a/orderer/consensus/etcdraft/blockpuller.go +++ b/orderer/consensus/etcdraft/blockpuller.go @@ -12,7 +12,7 @@ import ( "github.com/hyperledger/fabric-lib-go/bccsp" "github.com/hyperledger/fabric-lib-go/common/flogging" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/orderer/common/cluster" "github.com/hyperledger/fabric/orderer/common/localconfig" "github.com/hyperledger/fabric/orderer/consensus" diff --git a/orderer/consensus/etcdraft/blockpuller_test.go b/orderer/consensus/etcdraft/blockpuller_test.go index 0026ffc23aa..120db07d873 100644 --- a/orderer/consensus/etcdraft/blockpuller_test.go +++ b/orderer/consensus/etcdraft/blockpuller_test.go @@ -10,9 +10,8 @@ import ( "os" "testing" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/bccsp/sw" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/common/crypto/tlsgen" "github.com/hyperledger/fabric/internal/pkg/comm" "github.com/hyperledger/fabric/orderer/common/cluster" @@ -23,6 +22,7 @@ import ( "github.com/hyperledger/fabric/orderer/mocks/common/multichannel" "github.com/hyperledger/fabric/protoutil" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) func TestEndpointconfigFromFromSupport(t *testing.T) { diff --git a/orderer/consensus/etcdraft/chain.go b/orderer/consensus/etcdraft/chain.go index e82151fc75d..3d4bef1e1d1 100644 --- a/orderer/consensus/etcdraft/chain.go +++ b/orderer/consensus/etcdraft/chain.go @@ -15,12 +15,11 @@ import ( "time" "code.cloudfoundry.org/clock" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/bccsp" "github.com/hyperledger/fabric-lib-go/common/flogging" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/orderer" - "github.com/hyperledger/fabric-protos-go/orderer/etcdraft" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer/etcdraft" "github.com/hyperledger/fabric/common/channelconfig" "github.com/hyperledger/fabric/common/configtx" "github.com/hyperledger/fabric/orderer/common/cluster" @@ -31,6 +30,8 @@ import ( "go.etcd.io/etcd/raft/v3" "go.etcd.io/etcd/raft/v3/raftpb" "go.etcd.io/etcd/server/v3/wal" + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/protoadapt" ) const ( @@ -507,10 +508,11 @@ func (c *Chain) Consensus(req *orderer.ConsensusRequest, sender uint64) error { return err } - stepMsg := &raftpb.Message{} - if err := proto.Unmarshal(req.Payload, stepMsg); err != nil { + tmp := protoadapt.MessageV2Of(&raftpb.Message{}) + if err := proto.Unmarshal(req.Payload, tmp); err != nil { return fmt.Errorf("failed to unmarshal StepRequest payload to Raft Message: %s", err) } + stepMsg := protoadapt.MessageV1Of(tmp).(*raftpb.Message) if stepMsg.To != c.raftID { c.logger.Warnf("Received msg to %d, my ID is probably wrong due to out of date, cowardly halting", stepMsg.To) diff --git a/orderer/consensus/etcdraft/chain_test.go b/orderer/consensus/etcdraft/chain_test.go index b6e4b8c3e29..343f62ed0a2 100644 --- a/orderer/consensus/etcdraft/chain_test.go +++ b/orderer/consensus/etcdraft/chain_test.go @@ -17,14 +17,13 @@ import ( "time" "code.cloudfoundry.org/clock/fakeclock" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/bccsp" "github.com/hyperledger/fabric-lib-go/bccsp/factory" "github.com/hyperledger/fabric-lib-go/bccsp/sw" "github.com/hyperledger/fabric-lib-go/common/flogging" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/orderer" - raftprotos "github.com/hyperledger/fabric-protos-go/orderer/etcdraft" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer" + raftprotos "github.com/hyperledger/fabric-protos-go-apiv2/orderer/etcdraft" "github.com/hyperledger/fabric/common/channelconfig" "github.com/hyperledger/fabric/common/crypto/tlsgen" "github.com/hyperledger/fabric/orderer/common/cluster" @@ -41,6 +40,8 @@ import ( "go.etcd.io/etcd/raft/v3" "go.etcd.io/etcd/raft/v3/raftpb" "go.uber.org/zap" + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/protoadapt" ) const ( @@ -206,7 +207,7 @@ var _ = Describe("Chain", func() { campaign := func(c *etcdraft.Chain, observeC <-chan raft.SoftState) { Eventually(func() <-chan raft.SoftState { - c.Consensus(&orderer.ConsensusRequest{Payload: protoutil.MarshalOrPanic(&raftpb.Message{Type: raftpb.MsgTimeoutNow, To: 1})}, 0) + c.Consensus(&orderer.ConsensusRequest{Payload: protoutil.MarshalOrPanic(protoadapt.MessageV2Of(&raftpb.Message{Type: raftpb.MsgTimeoutNow, To: 1}))}, 0) return observeC }, LongEventualTimeout).Should(Receive(StateEqual(1, raft.StateLeader))) } @@ -1578,10 +1579,11 @@ var _ = Describe("Chain", func() { step1 := c1.getStepFunc() c1.setStepFunc(func(dest uint64, msg *orderer.ConsensusRequest) error { - stepMsg := &raftpb.Message{} - if err := proto.Unmarshal(msg.Payload, stepMsg); err != nil { + tmp := protoadapt.MessageV2Of(&raftpb.Message{}) + if err := proto.Unmarshal(msg.Payload, tmp); err != nil { return fmt.Errorf("failed to unmarshal StepRequest payload to Raft Message: %s", err) } + stepMsg := protoadapt.MessageV1Of(tmp).(*raftpb.Message) if stepMsg.Type == raftpb.MsgTimeoutNow && atomic.CompareAndSwapUint32(&messageOmission, 0, 1) { return nil @@ -2351,7 +2353,7 @@ var _ = Describe("Chain", func() { if retry > 0 { retry -= 1 By("leadership transfer not complete, hence retrying") - c2.Consensus(&orderer.ConsensusRequest{Payload: protoutil.MarshalOrPanic(&raftpb.Message{Type: raftpb.MsgTimeoutNow, To: 2})}, 0) + c2.Consensus(&orderer.ConsensusRequest{Payload: protoutil.MarshalOrPanic(protoadapt.MessageV2Of(&raftpb.Message{Type: raftpb.MsgTimeoutNow, To: 2}))}, 0) continue } Fail("Expected a new leader to present") @@ -2782,9 +2784,9 @@ var _ = Describe("Chain", func() { // // Instead, we can simply send artificial MsgHeartbeatResp to leader to resume. m2 := &raftpb.Message{To: c1.id, From: c2.id, Type: raftpb.MsgHeartbeatResp} - c1.Consensus(&orderer.ConsensusRequest{Channel: channelID, Payload: protoutil.MarshalOrPanic(m2)}, c2.id) + c1.Consensus(&orderer.ConsensusRequest{Channel: channelID, Payload: protoutil.MarshalOrPanic(protoadapt.MessageV2Of(m2))}, c2.id) m3 := &raftpb.Message{To: c1.id, From: c3.id, Type: raftpb.MsgHeartbeatResp} - c1.Consensus(&orderer.ConsensusRequest{Channel: channelID, Payload: protoutil.MarshalOrPanic(m3)}, c3.id) + c1.Consensus(&orderer.ConsensusRequest{Channel: channelID, Payload: protoutil.MarshalOrPanic(protoadapt.MessageV2Of(m3))}, c3.id) network.exec(func(c *chain) { Eventually(c.support.WriteBlockCallCount, LongEventualTimeout).Should(Equal(3)) @@ -2813,8 +2815,9 @@ var _ = Describe("Chain", func() { step1 := c1.getStepFunc() c1.setStepFunc(func(dest uint64, msg *orderer.ConsensusRequest) error { - stepMsg := &raftpb.Message{} - Expect(proto.Unmarshal(msg.Payload, stepMsg)).NotTo(HaveOccurred()) + tmp := protoadapt.MessageV2Of(&raftpb.Message{}) + Expect(proto.Unmarshal(msg.Payload, tmp)).NotTo(HaveOccurred()) + stepMsg := protoadapt.MessageV1Of(tmp).(*raftpb.Message) if dest == 3 { return nil @@ -2837,8 +2840,9 @@ var _ = Describe("Chain", func() { step2 := c2.getStepFunc() c2.setStepFunc(func(dest uint64, msg *orderer.ConsensusRequest) error { - stepMsg := &raftpb.Message{} - Expect(proto.Unmarshal(msg.Payload, stepMsg)).NotTo(HaveOccurred()) + tmp := protoadapt.MessageV2Of(&raftpb.Message{}) + Expect(proto.Unmarshal(msg.Payload, tmp)).NotTo(HaveOccurred()) + stepMsg := protoadapt.MessageV1Of(tmp).(*raftpb.Message) if stepMsg.Type == raftpb.MsgApp && len(stepMsg.Entries) != 0 && dest == 3 { for _, ent := range stepMsg.Entries { @@ -2990,12 +2994,13 @@ var _ = Describe("Chain", func() { step1 := c1.getStepFunc() c1.setStepFunc(func(dest uint64, msg *orderer.ConsensusRequest) error { - stepMsg := &raftpb.Message{} - Expect(proto.Unmarshal(msg.Payload, stepMsg)).NotTo(HaveOccurred()) + tmp := protoadapt.MessageV2Of(&raftpb.Message{}) + Expect(proto.Unmarshal(msg.Payload, tmp)).NotTo(HaveOccurred()) + stepMsg := protoadapt.MessageV1Of(tmp).(*raftpb.Message) if dest == 3 && stepMsg.Type == raftpb.MsgApp && len(stepMsg.Entries) > 0 { stepMsg.Entries = stepMsg.Entries[0:1] stepMsg.Entries[0].Data = nil - msg.Payload = protoutil.MarshalOrPanic(stepMsg) + msg.Payload = protoutil.MarshalOrPanic(protoadapt.MessageV2Of(stepMsg)) } return step1(dest, msg) }) @@ -3009,8 +3014,9 @@ var _ = Describe("Chain", func() { // order data on all nodes except node 3, send raft raftpb.EntryConfChange message to node 3 // node 1 should take a snapshot but node 3 should not c1.setStepFunc(func(dest uint64, msg *orderer.ConsensusRequest) error { - stepMsg := &raftpb.Message{} - Expect(proto.Unmarshal(msg.Payload, stepMsg)).NotTo(HaveOccurred()) + tmp := protoadapt.MessageV2Of(&raftpb.Message{}) + Expect(proto.Unmarshal(msg.Payload, tmp)).NotTo(HaveOccurred()) + stepMsg := protoadapt.MessageV1Of(tmp).(*raftpb.Message) if dest == 3 && stepMsg.Type == raftpb.MsgApp && len(stepMsg.Entries) > 0 { stepMsg.Entries = stepMsg.Entries[0:1] // change message type to raftpb.EntryConfChange @@ -3019,7 +3025,7 @@ var _ = Describe("Chain", func() { data, err := cc.Marshal() Expect(err).NotTo(HaveOccurred()) stepMsg.Entries[0].Data = data - msg.Payload = protoutil.MarshalOrPanic(stepMsg) + msg.Payload = protoutil.MarshalOrPanic(protoadapt.MessageV2Of(stepMsg)) } return step1(dest, msg) }) @@ -3934,7 +3940,7 @@ func (n *network) elect(id uint64) { // Send node an artificial MsgTimeoutNow to emulate leadership transfer. fmt.Fprintf(GinkgoWriter, "Send artificial MsgTimeoutNow to elect node %d\n", id) - candidate.Consensus(&orderer.ConsensusRequest{Payload: protoutil.MarshalOrPanic(&raftpb.Message{Type: raftpb.MsgTimeoutNow, To: id})}, 0) + candidate.Consensus(&orderer.ConsensusRequest{Payload: protoutil.MarshalOrPanic(protoadapt.MessageV2Of(&raftpb.Message{Type: raftpb.MsgTimeoutNow, To: id}))}, 0) Eventually(candidate.observe, LongEventualTimeout).Should(Receive(StateEqual(id, raft.StateLeader))) n.Lock() diff --git a/orderer/consensus/etcdraft/consenter.go b/orderer/consensus/etcdraft/consenter.go index 7f704ba5064..1141948d1bc 100644 --- a/orderer/consensus/etcdraft/consenter.go +++ b/orderer/consensus/etcdraft/consenter.go @@ -12,13 +12,12 @@ import ( "time" "code.cloudfoundry.org/clock" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/bccsp" "github.com/hyperledger/fabric-lib-go/common/flogging" "github.com/hyperledger/fabric-lib-go/common/metrics" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/orderer" - "github.com/hyperledger/fabric-protos-go/orderer/etcdraft" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer/etcdraft" "github.com/hyperledger/fabric/common/channelconfig" "github.com/hyperledger/fabric/common/crypto" "github.com/hyperledger/fabric/internal/pkg/comm" @@ -30,6 +29,7 @@ import ( "github.com/mitchellh/mapstructure" "github.com/pkg/errors" "go.etcd.io/etcd/raft/v3" + "google.golang.org/protobuf/proto" ) //go:generate counterfeiter -o mocks/chain_manager.go --fake-name ChainManager . ChainManager diff --git a/orderer/consensus/etcdraft/consenter_test.go b/orderer/consensus/etcdraft/consenter_test.go index 346b2e14992..c0ec5b41d4f 100644 --- a/orderer/consensus/etcdraft/consenter_test.go +++ b/orderer/consensus/etcdraft/consenter_test.go @@ -15,12 +15,11 @@ import ( "strings" "time" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/bccsp/sw" "github.com/hyperledger/fabric-lib-go/common/flogging" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/orderer" - etcdraftproto "github.com/hyperledger/fabric-protos-go/orderer/etcdraft" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer" + etcdraftproto "github.com/hyperledger/fabric-protos-go-apiv2/orderer/etcdraft" "github.com/hyperledger/fabric/common/channelconfig" "github.com/hyperledger/fabric/common/crypto/tlsgen" "github.com/hyperledger/fabric/common/ledger/testutil" @@ -41,6 +40,7 @@ import ( "github.com/stretchr/testify/mock" "go.uber.org/zap" "go.uber.org/zap/zapcore" + "google.golang.org/protobuf/proto" ) var certAsPEM []byte diff --git a/orderer/consensus/etcdraft/dispatcher.go b/orderer/consensus/etcdraft/dispatcher.go index 896df9334e9..9ba16a163e2 100644 --- a/orderer/consensus/etcdraft/dispatcher.go +++ b/orderer/consensus/etcdraft/dispatcher.go @@ -8,7 +8,7 @@ package etcdraft import ( "github.com/hyperledger/fabric-lib-go/common/flogging" - "github.com/hyperledger/fabric-protos-go/orderer" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer" "github.com/pkg/errors" ) diff --git a/orderer/consensus/etcdraft/dispatcher_test.go b/orderer/consensus/etcdraft/dispatcher_test.go index 493b51d2236..0f75526bbe2 100644 --- a/orderer/consensus/etcdraft/dispatcher_test.go +++ b/orderer/consensus/etcdraft/dispatcher_test.go @@ -10,7 +10,7 @@ import ( "testing" "github.com/hyperledger/fabric-lib-go/common/flogging" - "github.com/hyperledger/fabric-protos-go/orderer" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer" "github.com/hyperledger/fabric/orderer/consensus/etcdraft" "github.com/hyperledger/fabric/orderer/consensus/etcdraft/mocks" "github.com/pkg/errors" diff --git a/orderer/consensus/etcdraft/disseminator.go b/orderer/consensus/etcdraft/disseminator.go index cae7f9bbbd5..664b5bfb91a 100644 --- a/orderer/consensus/etcdraft/disseminator.go +++ b/orderer/consensus/etcdraft/disseminator.go @@ -9,7 +9,7 @@ package etcdraft import ( "sync" - "github.com/hyperledger/fabric-protos-go/orderer" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer" ) // Disseminator piggybacks cluster metadata, if any, to egress messages. diff --git a/orderer/consensus/etcdraft/eviction.go b/orderer/consensus/etcdraft/eviction.go index d7cb1368c1e..9a55e8908cb 100644 --- a/orderer/consensus/etcdraft/eviction.go +++ b/orderer/consensus/etcdraft/eviction.go @@ -13,7 +13,7 @@ import ( "time" "github.com/hyperledger/fabric-lib-go/common/flogging" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/orderer/common/cluster" "github.com/hyperledger/fabric/protoutil" "go.etcd.io/etcd/raft/v3/raftpb" diff --git a/orderer/consensus/etcdraft/eviction_test.go b/orderer/consensus/etcdraft/eviction_test.go index f93c96eeff8..a27450f7bdc 100644 --- a/orderer/consensus/etcdraft/eviction_test.go +++ b/orderer/consensus/etcdraft/eviction_test.go @@ -13,7 +13,7 @@ import ( "time" "github.com/hyperledger/fabric-lib-go/common/flogging" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/orderer/common/cluster" "github.com/hyperledger/fabric/orderer/common/cluster/mocks" "github.com/hyperledger/fabric/protoutil" diff --git a/orderer/consensus/etcdraft/membership.go b/orderer/consensus/etcdraft/membership.go index a550ce761c6..e008d61f1c0 100644 --- a/orderer/consensus/etcdraft/membership.go +++ b/orderer/consensus/etcdraft/membership.go @@ -9,11 +9,11 @@ package etcdraft import ( "fmt" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/orderer/etcdraft" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer/etcdraft" "github.com/pkg/errors" "go.etcd.io/etcd/raft/v3" "go.etcd.io/etcd/raft/v3/raftpb" + "google.golang.org/protobuf/proto" ) // MembershipByCert convert consenters map into set encapsulated by map diff --git a/orderer/consensus/etcdraft/membership_test.go b/orderer/consensus/etcdraft/membership_test.go index 314bd7ee4df..21f8c3cfc7b 100644 --- a/orderer/consensus/etcdraft/membership_test.go +++ b/orderer/consensus/etcdraft/membership_test.go @@ -7,15 +7,19 @@ SPDX-License-Identifier: Apache-2.0 package etcdraft_test import ( + "cmp" + "slices" + "strings" "testing" - etcdraftproto "github.com/hyperledger/fabric-protos-go/orderer/etcdraft" + etcdraftproto "github.com/hyperledger/fabric-protos-go-apiv2/orderer/etcdraft" "github.com/hyperledger/fabric/common/channelconfig" "github.com/hyperledger/fabric/common/crypto/tlsgen" "github.com/hyperledger/fabric/orderer/consensus/etcdraft" "github.com/hyperledger/fabric/orderer/consensus/etcdraft/mocks" "github.com/stretchr/testify/require" "go.etcd.io/etcd/raft/v3/raftpb" + "google.golang.org/protobuf/proto" ) func TestQuorumCheck(t *testing.T) { @@ -332,11 +336,46 @@ func TestMembershipChanges(t *testing.T) { t.Run(test.Name, func(t *testing.T) { changes, err := etcdraft.ComputeMembershipChanges(blockMetadata, test.OldConsenters, test.NewConsenters) + sortSlice := func(e *etcdraftproto.Consenter, e2 *etcdraftproto.Consenter) int { + if n := strings.Compare(e.Host, e2.Host); n != 0 { + return n + } + return cmp.Compare(e.Port, e2.Port) + } + if test.ExpectedErr != "" { require.EqualError(t, err, test.ExpectedErr) } else { require.NoError(t, err) - require.Equal(t, test.Changes, changes) + if test.Changes != nil && changes != nil { + require.Equal(t, test.Changes.ConfChange, changes.ConfChange) + require.Equal(t, test.Changes.RotatedNode, changes.RotatedNode) + require.True(t, proto.Equal(test.Changes.NewBlockMetadata, changes.NewBlockMetadata)) + + require.Equal(t, len(test.Changes.NewConsenters), len(changes.NewConsenters)) + for k, v := range test.Changes.NewConsenters { + v1, ok := changes.NewConsenters[k] + require.True(t, ok) + require.True(t, proto.Equal(v, v1)) + } + + require.Equal(t, len(test.Changes.AddedNodes), len(changes.AddedNodes)) + slices.SortFunc(test.Changes.AddedNodes, sortSlice) + slices.SortFunc(changes.AddedNodes, sortSlice) + for i := range test.Changes.AddedNodes { + require.True(t, proto.Equal(test.Changes.AddedNodes[i], changes.AddedNodes[i])) + } + + require.Equal(t, len(test.Changes.RemovedNodes), len(changes.RemovedNodes)) + slices.SortFunc(test.Changes.RemovedNodes, sortSlice) + slices.SortFunc(changes.RemovedNodes, sortSlice) + for i := range test.Changes.RemovedNodes { + require.True(t, proto.Equal(test.Changes.RemovedNodes[i], changes.RemovedNodes[i])) + } + } else { + require.Equal(t, test.Changes, changes) + } + require.Equal(t, test.Changed, changes.Changed()) require.Equal(t, test.Rotated, changes.Rotated()) } diff --git a/orderer/consensus/etcdraft/mocks/message_receiver.go b/orderer/consensus/etcdraft/mocks/message_receiver.go index 6bc09ef178d..c0d5f0aef4f 100644 --- a/orderer/consensus/etcdraft/mocks/message_receiver.go +++ b/orderer/consensus/etcdraft/mocks/message_receiver.go @@ -3,7 +3,7 @@ package mocks import ( - orderer "github.com/hyperledger/fabric-protos-go/orderer" + orderer "github.com/hyperledger/fabric-protos-go-apiv2/orderer" mock "github.com/stretchr/testify/mock" ) diff --git a/orderer/consensus/etcdraft/mocks/mock_blockpuller.go b/orderer/consensus/etcdraft/mocks/mock_blockpuller.go index 8aa2dc76722..4634ef5c68f 100644 --- a/orderer/consensus/etcdraft/mocks/mock_blockpuller.go +++ b/orderer/consensus/etcdraft/mocks/mock_blockpuller.go @@ -4,7 +4,7 @@ package mocks import ( "sync" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/orderer/consensus/etcdraft" ) diff --git a/orderer/consensus/etcdraft/mocks/mock_rpc.go b/orderer/consensus/etcdraft/mocks/mock_rpc.go index 946a5fed161..be57481441c 100644 --- a/orderer/consensus/etcdraft/mocks/mock_rpc.go +++ b/orderer/consensus/etcdraft/mocks/mock_rpc.go @@ -4,7 +4,7 @@ package mocks import ( "sync" - "github.com/hyperledger/fabric-protos-go/orderer" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer" "github.com/hyperledger/fabric/orderer/consensus/etcdraft" ) diff --git a/orderer/consensus/etcdraft/mocks/msp.go b/orderer/consensus/etcdraft/mocks/msp.go index 7033ee45400..ce489840d0f 100644 --- a/orderer/consensus/etcdraft/mocks/msp.go +++ b/orderer/consensus/etcdraft/mocks/msp.go @@ -4,7 +4,7 @@ package mocks import ( "sync" - mspa "github.com/hyperledger/fabric-protos-go/msp" + mspa "github.com/hyperledger/fabric-protos-go-apiv2/msp" "github.com/hyperledger/fabric/msp" ) diff --git a/orderer/consensus/etcdraft/mocks/orderer_config.go b/orderer/consensus/etcdraft/mocks/orderer_config.go index 3f1e49f81a3..f26d106d0a4 100644 --- a/orderer/consensus/etcdraft/mocks/orderer_config.go +++ b/orderer/consensus/etcdraft/mocks/orderer_config.go @@ -5,8 +5,8 @@ import ( "sync" "time" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/orderer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer" "github.com/hyperledger/fabric/common/channelconfig" ) diff --git a/orderer/consensus/etcdraft/node.go b/orderer/consensus/etcdraft/node.go index 54089b4a81b..a35bb4f072d 100644 --- a/orderer/consensus/etcdraft/node.go +++ b/orderer/consensus/etcdraft/node.go @@ -15,13 +15,14 @@ import ( "code.cloudfoundry.org/clock" "github.com/hyperledger/fabric-lib-go/common/flogging" - "github.com/hyperledger/fabric-protos-go/orderer" - "github.com/hyperledger/fabric-protos-go/orderer/etcdraft" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer/etcdraft" "github.com/hyperledger/fabric/protoutil" "github.com/pkg/errors" "go.etcd.io/etcd/raft/v3" "go.etcd.io/etcd/raft/v3/raftpb" "google.golang.org/protobuf/encoding/protowire" + "google.golang.org/protobuf/protoadapt" ) var ( @@ -205,7 +206,7 @@ func (n *node) send(msgs []raftpb.Message) { } } - msgBytes := protoutil.MarshalOrPanic(&msg) + msgBytes := protoutil.MarshalOrPanic(protoadapt.MessageV2Of(&msg)) err := n.rpc.SendConsensus(msg.To, &orderer.ConsensusRequest{Channel: n.chainID, Payload: msgBytes}) if err != nil { n.ReportUnreachable(msg.To) diff --git a/orderer/consensus/etcdraft/tracker.go b/orderer/consensus/etcdraft/tracker.go index 1ad00351cbc..5013366a973 100644 --- a/orderer/consensus/etcdraft/tracker.go +++ b/orderer/consensus/etcdraft/tracker.go @@ -11,7 +11,7 @@ import ( "github.com/hyperledger/fabric-lib-go/common/flogging" "github.com/hyperledger/fabric-lib-go/common/metrics" - "github.com/hyperledger/fabric-protos-go/orderer/etcdraft" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer/etcdraft" "github.com/hyperledger/fabric/protoutil" "go.etcd.io/etcd/raft/v3" ) diff --git a/orderer/consensus/etcdraft/util.go b/orderer/consensus/etcdraft/util.go index cf45ad3babf..85e8fcd2ac4 100644 --- a/orderer/consensus/etcdraft/util.go +++ b/orderer/consensus/etcdraft/util.go @@ -11,12 +11,11 @@ import ( "encoding/pem" "time" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/bccsp" "github.com/hyperledger/fabric-lib-go/common/flogging" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/orderer" - "github.com/hyperledger/fabric-protos-go/orderer/etcdraft" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer/etcdraft" "github.com/hyperledger/fabric/common/channelconfig" "github.com/hyperledger/fabric/common/configtx" "github.com/hyperledger/fabric/common/crypto" @@ -25,6 +24,7 @@ import ( "github.com/pkg/errors" "go.etcd.io/etcd/raft/v3" "go.etcd.io/etcd/raft/v3/raftpb" + "google.golang.org/protobuf/proto" ) // RaftPeers maps consenters to slice of raft.Peer diff --git a/orderer/consensus/etcdraft/util_test.go b/orderer/consensus/etcdraft/util_test.go index 47114813fe5..4c6c7359f53 100644 --- a/orderer/consensus/etcdraft/util_test.go +++ b/orderer/consensus/etcdraft/util_test.go @@ -17,18 +17,17 @@ import ( "testing" "time" - "github.com/hyperledger/fabric-protos-go/orderer" - - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/bccsp/sw" "github.com/hyperledger/fabric-lib-go/common/flogging" - "github.com/hyperledger/fabric-protos-go/common" - etcdraftproto "github.com/hyperledger/fabric-protos-go/orderer/etcdraft" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer" + etcdraftproto "github.com/hyperledger/fabric-protos-go-apiv2/orderer/etcdraft" "github.com/hyperledger/fabric/common/crypto/tlsgen" "github.com/hyperledger/fabric/orderer/common/cluster" "github.com/hyperledger/fabric/protoutil" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) func TestIsConsenterOfChannel(t *testing.T) { diff --git a/orderer/consensus/etcdraft/validator_test.go b/orderer/consensus/etcdraft/validator_test.go index f522a446f34..9e76a490f9a 100644 --- a/orderer/consensus/etcdraft/validator_test.go +++ b/orderer/consensus/etcdraft/validator_test.go @@ -10,10 +10,9 @@ import ( "os" "time" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/bccsp" "github.com/hyperledger/fabric-lib-go/bccsp/sw" - raftprotos "github.com/hyperledger/fabric-protos-go/orderer/etcdraft" + raftprotos "github.com/hyperledger/fabric-protos-go-apiv2/orderer/etcdraft" "github.com/hyperledger/fabric/common/channelconfig" "github.com/hyperledger/fabric/common/crypto/tlsgen" "github.com/hyperledger/fabric/orderer/consensus/etcdraft" @@ -21,6 +20,7 @@ import ( consensusmocks "github.com/hyperledger/fabric/orderer/consensus/mocks" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" + "google.golang.org/protobuf/proto" ) func makeOrdererOrg(caCert []byte) *mocks.OrdererOrg { diff --git a/orderer/consensus/mocks/mock_consenter_support.go b/orderer/consensus/mocks/mock_consenter_support.go index ceb9bd1de79..3463f09383d 100644 --- a/orderer/consensus/mocks/mock_consenter_support.go +++ b/orderer/consensus/mocks/mock_consenter_support.go @@ -4,7 +4,7 @@ package mocks import ( "sync" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/common/channelconfig" "github.com/hyperledger/fabric/orderer/common/blockcutter" "github.com/hyperledger/fabric/orderer/common/msgprocessor" diff --git a/orderer/consensus/smartbft/assembler.go b/orderer/consensus/smartbft/assembler.go index a49bce79241..a9ab98e384a 100644 --- a/orderer/consensus/smartbft/assembler.go +++ b/orderer/consensus/smartbft/assembler.go @@ -12,7 +12,7 @@ import ( "github.com/hyperledger-labs/SmartBFT/pkg/types" "github.com/hyperledger/fabric-lib-go/common/flogging" - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/orderer/common/cluster" "github.com/hyperledger/fabric/protoutil" "github.com/pkg/errors" diff --git a/orderer/consensus/smartbft/assembler_test.go b/orderer/consensus/smartbft/assembler_test.go index 9d4976b1ffc..ee6a9eaec45 100644 --- a/orderer/consensus/smartbft/assembler_test.go +++ b/orderer/consensus/smartbft/assembler_test.go @@ -12,7 +12,7 @@ import ( "github.com/hyperledger-labs/SmartBFT/pkg/types" "github.com/hyperledger/fabric-lib-go/common/flogging" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/orderer/consensus/smartbft" "github.com/hyperledger/fabric/orderer/consensus/smartbft/mocks" "github.com/hyperledger/fabric/protoutil" diff --git a/orderer/consensus/smartbft/block_puller_factory.go b/orderer/consensus/smartbft/block_puller_factory.go index 4a15426ec54..0e39f75d2df 100644 --- a/orderer/consensus/smartbft/block_puller_factory.go +++ b/orderer/consensus/smartbft/block_puller_factory.go @@ -12,7 +12,7 @@ import ( "github.com/hyperledger/fabric-lib-go/bccsp" "github.com/hyperledger/fabric-lib-go/common/flogging" - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/orderer/common/cluster" "github.com/hyperledger/fabric/orderer/common/localconfig" "github.com/hyperledger/fabric/orderer/consensus" diff --git a/orderer/consensus/smartbft/chain.go b/orderer/consensus/smartbft/chain.go index bd87ceed1f3..e61ff292195 100644 --- a/orderer/consensus/smartbft/chain.go +++ b/orderer/consensus/smartbft/chain.go @@ -15,7 +15,6 @@ import ( "sync/atomic" "time" - "github.com/golang/protobuf/proto" "github.com/hyperledger-labs/SmartBFT/pkg/api" smartbft "github.com/hyperledger-labs/SmartBFT/pkg/consensus" "github.com/hyperledger-labs/SmartBFT/pkg/types" @@ -23,8 +22,8 @@ import ( "github.com/hyperledger-labs/SmartBFT/smartbftprotos" "github.com/hyperledger/fabric-lib-go/bccsp" "github.com/hyperledger/fabric-lib-go/common/flogging" - cb "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/msp" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/msp" "github.com/hyperledger/fabric/common/policies" "github.com/hyperledger/fabric/orderer/common/cluster" "github.com/hyperledger/fabric/orderer/common/localconfig" @@ -34,6 +33,7 @@ import ( "github.com/hyperledger/fabric/protoutil" "github.com/pkg/errors" "go.uber.org/zap" + "google.golang.org/protobuf/proto" ) // WALConfig consensus specific configuration parameters from orderer.yaml; for SmartBFT only WALDir is relevant. @@ -306,6 +306,9 @@ func (c *BFTChain) pruneBadRequests() { } func (c *BFTChain) submit(env *cb.Envelope, configSeq uint64) error { + if env == nil { + return errors.New("failed to marshal request envelope: proto: Marshal called with nil") + } reqBytes, err := proto.Marshal(env) if err != nil { return errors.Wrapf(err, "failed to marshal request envelope") diff --git a/orderer/consensus/smartbft/chain_test.go b/orderer/consensus/smartbft/chain_test.go index 1abd15464d5..8470ab5dbb5 100644 --- a/orderer/consensus/smartbft/chain_test.go +++ b/orderer/consensus/smartbft/chain_test.go @@ -12,9 +12,8 @@ import ( "testing" "time" - "github.com/golang/protobuf/proto" - cb "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/msp" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/msp" "github.com/hyperledger/fabric/common/channelconfig" "github.com/hyperledger/fabric/common/crypto/tlsgen" "github.com/hyperledger/fabric/internal/configtxlator/update" @@ -22,6 +21,7 @@ import ( "github.com/hyperledger/fabric/protoutil" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) var nonce uint64 = 0 diff --git a/orderer/consensus/smartbft/configverifier.go b/orderer/consensus/smartbft/configverifier.go index 0afe3cf0247..7d689aa0120 100644 --- a/orderer/consensus/smartbft/configverifier.go +++ b/orderer/consensus/smartbft/configverifier.go @@ -9,18 +9,18 @@ package smartbft import ( "fmt" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/common/flogging" - cb "github.com/hyperledger/fabric-protos-go/common" - mspa "github.com/hyperledger/fabric-protos-go/msp" - protosorderer "github.com/hyperledger/fabric-protos-go/orderer" - "github.com/hyperledger/fabric-protos-go/orderer/smartbft" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + mspa "github.com/hyperledger/fabric-protos-go-apiv2/msp" + protosorderer "github.com/hyperledger/fabric-protos-go-apiv2/orderer" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer/smartbft" "github.com/hyperledger/fabric/common/channelconfig" "github.com/hyperledger/fabric/common/configtx" "github.com/hyperledger/fabric/common/policies" "github.com/hyperledger/fabric/common/policydsl" "github.com/hyperledger/fabric/protoutil" "github.com/pkg/errors" + "google.golang.org/protobuf/proto" ) //go:generate mockery -dir . -name Filters -case underscore -output mocks diff --git a/orderer/consensus/smartbft/configverifier_test.go b/orderer/consensus/smartbft/configverifier_test.go index 949913f1670..583edd4c918 100644 --- a/orderer/consensus/smartbft/configverifier_test.go +++ b/orderer/consensus/smartbft/configverifier_test.go @@ -10,9 +10,8 @@ import ( "strings" "testing" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/common/flogging" - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/common/capabilities" "github.com/hyperledger/fabric/common/configtx" "github.com/hyperledger/fabric/core/config/configtest" @@ -24,6 +23,7 @@ import ( "github.com/pkg/errors" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" + "google.golang.org/protobuf/proto" ) func TestValidateConfig(t *testing.T) { diff --git a/orderer/consensus/smartbft/consenter.go b/orderer/consensus/smartbft/consenter.go index 05de8933683..d12e038beb9 100644 --- a/orderer/consensus/smartbft/consenter.go +++ b/orderer/consensus/smartbft/consenter.go @@ -17,15 +17,14 @@ import ( "sync/atomic" "time" - "github.com/golang/protobuf/proto" "github.com/hyperledger-labs/SmartBFT/pkg/api" "github.com/hyperledger-labs/SmartBFT/pkg/wal" "github.com/hyperledger/fabric-lib-go/bccsp" "github.com/hyperledger/fabric-lib-go/common/flogging" "github.com/hyperledger/fabric-lib-go/common/metrics" - cb "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/msp" - ab "github.com/hyperledger/fabric-protos-go/orderer" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/msp" + ab "github.com/hyperledger/fabric-protos-go-apiv2/orderer" "github.com/hyperledger/fabric/common/channelconfig" "github.com/hyperledger/fabric/common/crypto" "github.com/hyperledger/fabric/common/policies" @@ -39,6 +38,7 @@ import ( "github.com/mitchellh/mapstructure" "github.com/pkg/errors" "go.uber.org/zap" + "google.golang.org/protobuf/proto" ) // CreateChainCallback creates a new chain diff --git a/orderer/consensus/smartbft/egress.go b/orderer/consensus/smartbft/egress.go index fddcb6e6efd..80c3f4e3cd4 100644 --- a/orderer/consensus/smartbft/egress.go +++ b/orderer/consensus/smartbft/egress.go @@ -9,13 +9,13 @@ package smartbft import ( "sync/atomic" - "github.com/golang/protobuf/proto" "github.com/hyperledger-labs/SmartBFT/pkg/api" protos "github.com/hyperledger-labs/SmartBFT/smartbftprotos" - cb "github.com/hyperledger/fabric-protos-go/common" - ab "github.com/hyperledger/fabric-protos-go/orderer" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + ab "github.com/hyperledger/fabric-protos-go-apiv2/orderer" "github.com/hyperledger/fabric/orderer/common/cluster" "github.com/hyperledger/fabric/protoutil" + "google.golang.org/protobuf/proto" ) //go:generate mockery --dir . --name EgressComm --case underscore --with-expecter=true --output mocks diff --git a/orderer/consensus/smartbft/egress_test.go b/orderer/consensus/smartbft/egress_test.go index e916d95db21..202cd22bf27 100644 --- a/orderer/consensus/smartbft/egress_test.go +++ b/orderer/consensus/smartbft/egress_test.go @@ -11,8 +11,8 @@ import ( protos "github.com/hyperledger-labs/SmartBFT/smartbftprotos" "github.com/hyperledger/fabric-lib-go/common/flogging" - cb "github.com/hyperledger/fabric-protos-go/common" - ab "github.com/hyperledger/fabric-protos-go/orderer" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + ab "github.com/hyperledger/fabric-protos-go-apiv2/orderer" "github.com/hyperledger/fabric/orderer/consensus/smartbft" "github.com/hyperledger/fabric/orderer/consensus/smartbft/mocks" "github.com/hyperledger/fabric/protoutil" diff --git a/orderer/consensus/smartbft/ingress.go b/orderer/consensus/smartbft/ingress.go index db67d06a1b1..97c6fc5a3a5 100644 --- a/orderer/consensus/smartbft/ingress.go +++ b/orderer/consensus/smartbft/ingress.go @@ -7,11 +7,11 @@ SPDX-License-Identifier: Apache-2.0 package smartbft import ( - "github.com/golang/protobuf/proto" protos "github.com/hyperledger-labs/SmartBFT/smartbftprotos" - ab "github.com/hyperledger/fabric-protos-go/orderer" + ab "github.com/hyperledger/fabric-protos-go-apiv2/orderer" "github.com/hyperledger/fabric/protoutil" "github.com/pkg/errors" + "google.golang.org/protobuf/proto" ) //go:generate mockery -dir . -name MessageReceiver -case underscore -output mocks diff --git a/orderer/consensus/smartbft/ingress_test.go b/orderer/consensus/smartbft/ingress_test.go index eb7c31cd8c8..0b0adbd49ce 100644 --- a/orderer/consensus/smartbft/ingress_test.go +++ b/orderer/consensus/smartbft/ingress_test.go @@ -9,16 +9,16 @@ package smartbft_test import ( "testing" - "github.com/golang/protobuf/proto" protos "github.com/hyperledger-labs/SmartBFT/smartbftprotos" "github.com/hyperledger/fabric-lib-go/common/flogging" - cb "github.com/hyperledger/fabric-protos-go/common" - ab "github.com/hyperledger/fabric-protos-go/orderer" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + ab "github.com/hyperledger/fabric-protos-go-apiv2/orderer" "github.com/hyperledger/fabric/orderer/consensus/smartbft" "github.com/hyperledger/fabric/orderer/consensus/smartbft/mocks" "github.com/hyperledger/fabric/protoutil" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" + "google.golang.org/protobuf/proto" ) func TestDispatchConsensus(t *testing.T) { diff --git a/orderer/consensus/smartbft/mocks/bft_block_deliverer.go b/orderer/consensus/smartbft/mocks/bft_block_deliverer.go index 569782b8766..508adcfa3f7 100644 --- a/orderer/consensus/smartbft/mocks/bft_block_deliverer.go +++ b/orderer/consensus/smartbft/mocks/bft_block_deliverer.go @@ -4,7 +4,7 @@ package mocks import ( "sync" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/orderer/consensus/smartbft" ) diff --git a/orderer/consensus/smartbft/mocks/block_puller.go b/orderer/consensus/smartbft/mocks/block_puller.go index b7d38752292..397493e67ba 100644 --- a/orderer/consensus/smartbft/mocks/block_puller.go +++ b/orderer/consensus/smartbft/mocks/block_puller.go @@ -4,7 +4,7 @@ package mocks import ( "sync" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/orderer/consensus/smartbft" ) diff --git a/orderer/consensus/smartbft/mocks/config_tx_validator.go b/orderer/consensus/smartbft/mocks/config_tx_validator.go index 0cd2b8c1138..a52f36354ef 100644 --- a/orderer/consensus/smartbft/mocks/config_tx_validator.go +++ b/orderer/consensus/smartbft/mocks/config_tx_validator.go @@ -3,7 +3,7 @@ package mocks import ( - common "github.com/hyperledger/fabric-protos-go/common" + common "github.com/hyperledger/fabric-protos-go-apiv2/common" mock "github.com/stretchr/testify/mock" ) diff --git a/orderer/consensus/smartbft/mocks/config_update_proposer.go b/orderer/consensus/smartbft/mocks/config_update_proposer.go index 5c6fc1f18ab..cd879343606 100644 --- a/orderer/consensus/smartbft/mocks/config_update_proposer.go +++ b/orderer/consensus/smartbft/mocks/config_update_proposer.go @@ -3,7 +3,7 @@ package mocks import ( - common "github.com/hyperledger/fabric-protos-go/common" + common "github.com/hyperledger/fabric-protos-go-apiv2/common" mock "github.com/stretchr/testify/mock" ) diff --git a/orderer/consensus/smartbft/mocks/config_validator.go b/orderer/consensus/smartbft/mocks/config_validator.go index 9498539a8e6..edb518abd9a 100644 --- a/orderer/consensus/smartbft/mocks/config_validator.go +++ b/orderer/consensus/smartbft/mocks/config_validator.go @@ -3,7 +3,7 @@ package mocks import ( - common "github.com/hyperledger/fabric-protos-go/common" + common "github.com/hyperledger/fabric-protos-go-apiv2/common" mock "github.com/stretchr/testify/mock" ) diff --git a/orderer/consensus/smartbft/mocks/consenter_support.go b/orderer/consensus/smartbft/mocks/consenter_support.go index 95b64172761..ed2d970e6a0 100644 --- a/orderer/consensus/smartbft/mocks/consenter_support.go +++ b/orderer/consensus/smartbft/mocks/consenter_support.go @@ -6,7 +6,7 @@ import ( channelconfig "github.com/hyperledger/fabric/common/channelconfig" blockcutter "github.com/hyperledger/fabric/orderer/common/blockcutter" - common "github.com/hyperledger/fabric-protos-go/common" + common "github.com/hyperledger/fabric-protos-go-apiv2/common" mock "github.com/stretchr/testify/mock" diff --git a/orderer/consensus/smartbft/mocks/filters.go b/orderer/consensus/smartbft/mocks/filters.go index c06b84cbbf0..686304bb478 100644 --- a/orderer/consensus/smartbft/mocks/filters.go +++ b/orderer/consensus/smartbft/mocks/filters.go @@ -3,7 +3,7 @@ package mocks import ( - common "github.com/hyperledger/fabric-protos-go/common" + common "github.com/hyperledger/fabric-protos-go-apiv2/common" mock "github.com/stretchr/testify/mock" ) diff --git a/orderer/consensus/smartbft/mocks/ledger.go b/orderer/consensus/smartbft/mocks/ledger.go index 183446348c1..d9f3280bcf9 100644 --- a/orderer/consensus/smartbft/mocks/ledger.go +++ b/orderer/consensus/smartbft/mocks/ledger.go @@ -3,7 +3,7 @@ package mocks import ( - common "github.com/hyperledger/fabric-protos-go/common" + common "github.com/hyperledger/fabric-protos-go-apiv2/common" mock "github.com/stretchr/testify/mock" ) diff --git a/orderer/consensus/smartbft/mocks/mock_block_puller.go b/orderer/consensus/smartbft/mocks/mock_block_puller.go index dc38e1e2444..bdc797bd9fc 100644 --- a/orderer/consensus/smartbft/mocks/mock_block_puller.go +++ b/orderer/consensus/smartbft/mocks/mock_block_puller.go @@ -3,7 +3,7 @@ package mocks import ( - common "github.com/hyperledger/fabric-protos-go/common" + common "github.com/hyperledger/fabric-protos-go-apiv2/common" mock "github.com/stretchr/testify/mock" ) diff --git a/orderer/consensus/smartbft/mocks/orderer_config.go b/orderer/consensus/smartbft/mocks/orderer_config.go index 3f1e49f81a3..f26d106d0a4 100644 --- a/orderer/consensus/smartbft/mocks/orderer_config.go +++ b/orderer/consensus/smartbft/mocks/orderer_config.go @@ -5,8 +5,8 @@ import ( "sync" "time" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/orderer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer" "github.com/hyperledger/fabric/common/channelconfig" ) diff --git a/orderer/consensus/smartbft/mocks/rpc.go b/orderer/consensus/smartbft/mocks/rpc.go index bcc4e18a0f3..069a2317878 100644 --- a/orderer/consensus/smartbft/mocks/rpc.go +++ b/orderer/consensus/smartbft/mocks/rpc.go @@ -3,7 +3,7 @@ package mocks import ( - orderer "github.com/hyperledger/fabric-protos-go/orderer" + orderer "github.com/hyperledger/fabric-protos-go-apiv2/orderer" mock "github.com/stretchr/testify/mock" ) diff --git a/orderer/consensus/smartbft/mocks/synchronizer_factory.go b/orderer/consensus/smartbft/mocks/synchronizer_factory.go index 1b3cfae8238..1953a5a5947 100644 --- a/orderer/consensus/smartbft/mocks/synchronizer_factory.go +++ b/orderer/consensus/smartbft/mocks/synchronizer_factory.go @@ -8,7 +8,7 @@ import ( cluster "github.com/hyperledger/fabric/orderer/common/cluster" - common "github.com/hyperledger/fabric-protos-go/common" + common "github.com/hyperledger/fabric-protos-go-apiv2/common" consensus "github.com/hyperledger/fabric/orderer/consensus" diff --git a/orderer/consensus/smartbft/mocks/updatable_block_verifier.go b/orderer/consensus/smartbft/mocks/updatable_block_verifier.go index df4ef59c550..86e78e2607b 100644 --- a/orderer/consensus/smartbft/mocks/updatable_block_verifier.go +++ b/orderer/consensus/smartbft/mocks/updatable_block_verifier.go @@ -4,7 +4,7 @@ package mocks import ( "sync" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/common/deliverclient" ) diff --git a/orderer/consensus/smartbft/mocks/verifier_factory.go b/orderer/consensus/smartbft/mocks/verifier_factory.go index 74e63057689..f847c245945 100644 --- a/orderer/consensus/smartbft/mocks/verifier_factory.go +++ b/orderer/consensus/smartbft/mocks/verifier_factory.go @@ -6,7 +6,7 @@ import ( "github.com/hyperledger/fabric-lib-go/bccsp" "github.com/hyperledger/fabric-lib-go/common/flogging" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/common/deliverclient" "github.com/hyperledger/fabric/orderer/consensus/smartbft" ) diff --git a/orderer/consensus/smartbft/signature.go b/orderer/consensus/smartbft/signature.go index bb4033dbd49..dd3f9bd5ab9 100644 --- a/orderer/consensus/smartbft/signature.go +++ b/orderer/consensus/smartbft/signature.go @@ -10,11 +10,11 @@ import ( "encoding/asn1" "math/big" - "github.com/golang/protobuf/proto" "github.com/hyperledger-labs/SmartBFT/pkg/types" - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/common/util" "github.com/pkg/errors" + "google.golang.org/protobuf/proto" ) // Signature implementation diff --git a/orderer/consensus/smartbft/signer.go b/orderer/consensus/smartbft/signer.go index 3eaa59601e8..62cf7704d8a 100644 --- a/orderer/consensus/smartbft/signer.go +++ b/orderer/consensus/smartbft/signer.go @@ -8,7 +8,7 @@ package smartbft import ( "github.com/hyperledger-labs/SmartBFT/pkg/types" - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/common/crypto" "github.com/hyperledger/fabric/internal/pkg/identity" "github.com/hyperledger/fabric/protoutil" diff --git a/orderer/consensus/smartbft/signer_test.go b/orderer/consensus/smartbft/signer_test.go index c13501f394f..132804943c8 100644 --- a/orderer/consensus/smartbft/signer_test.go +++ b/orderer/consensus/smartbft/signer_test.go @@ -11,15 +11,15 @@ import ( "sync/atomic" "testing" - "github.com/golang/protobuf/proto" "github.com/hyperledger-labs/SmartBFT/pkg/types" "github.com/hyperledger/fabric-lib-go/common/flogging" - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/orderer/consensus/smartbft" "github.com/hyperledger/fabric/orderer/consensus/smartbft/mocks" "github.com/hyperledger/fabric/protoutil" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" + "google.golang.org/protobuf/proto" ) func TestSigner(t *testing.T) { diff --git a/orderer/consensus/smartbft/sync_buffer.go b/orderer/consensus/smartbft/sync_buffer.go index aea90554b46..ceba98df5f8 100644 --- a/orderer/consensus/smartbft/sync_buffer.go +++ b/orderer/consensus/smartbft/sync_buffer.go @@ -9,7 +9,7 @@ package smartbft import ( "sync" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/pkg/errors" ) diff --git a/orderer/consensus/smartbft/sync_buffer_test.go b/orderer/consensus/smartbft/sync_buffer_test.go index 68e986c0260..2213c405318 100644 --- a/orderer/consensus/smartbft/sync_buffer_test.go +++ b/orderer/consensus/smartbft/sync_buffer_test.go @@ -7,13 +7,13 @@ SPDX-License-Identifier: Apache-2.0 package smartbft_test import ( - "reflect" "sync" "testing" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/orderer/consensus/smartbft" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) func TestNewSyncBuffer(t *testing.T) { @@ -51,7 +51,7 @@ func TestSyncBuffer_PullBlock(t *testing.T) { go func() { blockOut := buff.PullBlock(2) require.NotNil(t, blockOut) - require.True(t, reflect.DeepEqual(blockIn, blockOut)) + require.True(t, proto.Equal(blockIn, blockOut)) wg.Done() }() @@ -97,7 +97,7 @@ func TestSyncBuffer_PullBlock(t *testing.T) { go func() { blockOut := buff.PullBlock(3) require.NotNil(t, blockOut) - require.True(t, reflect.DeepEqual(blockIn3, blockOut)) + require.True(t, proto.Equal(blockIn3, blockOut)) wg.Done() }() diff --git a/orderer/consensus/smartbft/synchronizer.go b/orderer/consensus/smartbft/synchronizer.go index e95107cff03..4775be13928 100644 --- a/orderer/consensus/smartbft/synchronizer.go +++ b/orderer/consensus/smartbft/synchronizer.go @@ -13,7 +13,7 @@ import ( "github.com/hyperledger-labs/SmartBFT/smartbftprotos" "github.com/hyperledger/fabric-lib-go/bccsp" "github.com/hyperledger/fabric-lib-go/common/flogging" - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/orderer/common/cluster" "github.com/hyperledger/fabric/orderer/common/localconfig" "github.com/hyperledger/fabric/orderer/consensus" diff --git a/orderer/consensus/smartbft/synchronizer_bft.go b/orderer/consensus/smartbft/synchronizer_bft.go index e331eaf964a..b0476e20d9c 100644 --- a/orderer/consensus/smartbft/synchronizer_bft.go +++ b/orderer/consensus/smartbft/synchronizer_bft.go @@ -14,7 +14,7 @@ import ( "github.com/hyperledger-labs/SmartBFT/pkg/types" "github.com/hyperledger/fabric-lib-go/bccsp" "github.com/hyperledger/fabric-lib-go/common/flogging" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/common/deliverclient" "github.com/hyperledger/fabric/common/deliverclient/blocksprovider" "github.com/hyperledger/fabric/common/deliverclient/orderers" @@ -86,7 +86,7 @@ func (s *BFTSynchronizer) Buffer() *SyncBuffer { } func (s *BFTSynchronizer) synchronize() (*types.Decision, error) { - //=== We probe all the endpoints and establish a target height, as well as detect the self endpoint. + // === We probe all the endpoints and establish a target height, as well as detect the self endpoint. targetHeight, myEndpoint, err := s.detectTargetHeight() if err != nil { return nil, errors.Wrapf(err, "cannot get detect target height") @@ -97,7 +97,7 @@ func (s *BFTSynchronizer) synchronize() (*types.Decision, error) { return nil, errors.Errorf("already at target height of %d", targetHeight) } - //=== Create a buffer to accept the blocks delivered from the BFTDeliverer. + // === Create a buffer to accept the blocks delivered from the BFTDeliverer. capacityBlocks := uint(s.LocalConfigCluster.ReplicationBufferSize) / uint(s.Support.SharedConfig().BatchSize().AbsoluteMaxBytes) if capacityBlocks < 100 { capacityBlocks = 100 @@ -106,7 +106,7 @@ func (s *BFTSynchronizer) synchronize() (*types.Decision, error) { s.syncBuff = NewSyncBuffer(capacityBlocks) s.mutex.Unlock() - //=== Create the BFT block deliverer and start a go-routine that fetches block and inserts them into the syncBuffer. + // === Create the BFT block deliverer and start a go-routine that fetches block and inserts them into the syncBuffer. bftDeliverer, err := s.createBFTDeliverer(startHeight, myEndpoint) if err != nil { return nil, errors.Wrapf(err, "cannot create BFT block deliverer") @@ -115,7 +115,7 @@ func (s *BFTSynchronizer) synchronize() (*types.Decision, error) { go bftDeliverer.DeliverBlocks() defer bftDeliverer.Stop() - //=== Loop on sync-buffer and pull blocks, writing them to the ledger, returning the last block pulled. + // === Loop on sync-buffer and pull blocks, writing them to the ledger, returning the last block pulled. lastPulledBlock, err := s.getBlocksFromSyncBuffer(startHeight, targetHeight) if err != nil { return nil, errors.Wrapf(err, "failed to get any blocks from SyncBuffer") diff --git a/orderer/consensus/smartbft/synchronizer_bft_test.go b/orderer/consensus/smartbft/synchronizer_bft_test.go index 07dccba2877..93585ce5980 100644 --- a/orderer/consensus/smartbft/synchronizer_bft_test.go +++ b/orderer/consensus/smartbft/synchronizer_bft_test.go @@ -11,12 +11,11 @@ import ( "sync" "testing" - "github.com/golang/protobuf/proto" "github.com/hyperledger-labs/SmartBFT/pkg/types" "github.com/hyperledger-labs/SmartBFT/smartbftprotos" "github.com/hyperledger/fabric-lib-go/common/flogging" - cb "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/orderer" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer" "github.com/hyperledger/fabric/common/channelconfig" "github.com/hyperledger/fabric/common/deliverclient" "github.com/hyperledger/fabric/internal/pkg/comm" @@ -27,6 +26,7 @@ import ( "github.com/hyperledger/fabric/orderer/consensus/smartbft/mocks" "github.com/pkg/errors" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) //go:generate counterfeiter -o mocks/updatable_block_verifier.go --fake-name UpdatableBlockVerifier . updatableBlockVerifier diff --git a/orderer/consensus/smartbft/synchronizer_factory.go b/orderer/consensus/smartbft/synchronizer_factory.go index a8d3b36588e..222b95ffa99 100644 --- a/orderer/consensus/smartbft/synchronizer_factory.go +++ b/orderer/consensus/smartbft/synchronizer_factory.go @@ -11,7 +11,7 @@ import ( "github.com/hyperledger-labs/SmartBFT/pkg/types" "github.com/hyperledger/fabric-lib-go/bccsp" "github.com/hyperledger/fabric-lib-go/common/flogging" - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/orderer/common/cluster" "github.com/hyperledger/fabric/orderer/common/localconfig" "github.com/hyperledger/fabric/orderer/consensus" diff --git a/orderer/consensus/smartbft/synchronizer_test.go b/orderer/consensus/smartbft/synchronizer_test.go index ffa1cdf48aa..e57922059ea 100644 --- a/orderer/consensus/smartbft/synchronizer_test.go +++ b/orderer/consensus/smartbft/synchronizer_test.go @@ -10,11 +10,10 @@ import ( "os" "testing" - "github.com/golang/protobuf/proto" "github.com/hyperledger-labs/SmartBFT/pkg/types" "github.com/hyperledger-labs/SmartBFT/smartbftprotos" "github.com/hyperledger/fabric-lib-go/common/flogging" - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/internal/pkg/comm" "github.com/hyperledger/fabric/orderer/common/cluster" "github.com/hyperledger/fabric/orderer/common/localconfig" @@ -25,6 +24,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.uber.org/zap" + "google.golang.org/protobuf/proto" ) func noopUpdateLastHash(_ *cb.Block) types.Reconfig { return types.Reconfig{} } diff --git a/orderer/consensus/smartbft/util.go b/orderer/consensus/smartbft/util.go index 40042370f4f..a3bcf171b5f 100644 --- a/orderer/consensus/smartbft/util.go +++ b/orderer/consensus/smartbft/util.go @@ -16,14 +16,13 @@ import ( "sort" "time" - "github.com/golang/protobuf/proto" "github.com/hyperledger-labs/SmartBFT/pkg/types" "github.com/hyperledger-labs/SmartBFT/smartbftprotos" "github.com/hyperledger/fabric-lib-go/bccsp" "github.com/hyperledger/fabric-lib-go/common/flogging" - cb "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/msp" - "github.com/hyperledger/fabric-protos-go/orderer/smartbft" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/msp" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer/smartbft" "github.com/hyperledger/fabric/common/channelconfig" "github.com/hyperledger/fabric/common/crypto" "github.com/hyperledger/fabric/common/deliverclient" @@ -34,6 +33,7 @@ import ( "github.com/hyperledger/fabric/orderer/consensus/smartbft/util" "github.com/hyperledger/fabric/protoutil" "github.com/pkg/errors" + "google.golang.org/protobuf/proto" ) // RuntimeConfig defines the configuration of the consensus @@ -178,6 +178,9 @@ func (ri *RequestInspector) requestIDFromSigHeader(sigHdr *cb.SignatureHeader) ( } func (ri *RequestInspector) requestIDFromEnvelope(envelope *cb.Envelope) (types.RequestInfo, error) { + if envelope == nil { + return types.RequestInfo{}, errors.New("proto: Marshal called with nil") + } data, err := proto.Marshal(envelope) if err != nil { return types.RequestInfo{}, err diff --git a/orderer/consensus/smartbft/util/util.go b/orderer/consensus/smartbft/util/util.go index 8e003546358..f2f4a0e2686 100644 --- a/orderer/consensus/smartbft/util/util.go +++ b/orderer/consensus/smartbft/util/util.go @@ -10,7 +10,7 @@ import ( "time" "github.com/hyperledger-labs/SmartBFT/pkg/types" - "github.com/hyperledger/fabric-protos-go/orderer/smartbft" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer/smartbft" "github.com/pkg/errors" ) diff --git a/orderer/consensus/smartbft/util_network_test.go b/orderer/consensus/smartbft/util_network_test.go index 219a8c84162..58bb710e8cb 100644 --- a/orderer/consensus/smartbft/util_network_test.go +++ b/orderer/consensus/smartbft/util_network_test.go @@ -18,7 +18,6 @@ import ( "testing" "time" - "github.com/golang/protobuf/proto" "github.com/hyperledger-labs/SmartBFT/pkg/api" "github.com/hyperledger-labs/SmartBFT/pkg/types" "github.com/hyperledger-labs/SmartBFT/pkg/wal" @@ -26,7 +25,7 @@ import ( "github.com/hyperledger/fabric-lib-go/bccsp/sw" "github.com/hyperledger/fabric-lib-go/common/flogging" "github.com/hyperledger/fabric-lib-go/common/metrics/disabled" - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/common/channelconfig" "github.com/hyperledger/fabric/common/crypto/tlsgen" "github.com/hyperledger/fabric/common/policies" @@ -40,6 +39,7 @@ import ( "github.com/hyperledger/fabric/protoutil" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) // ConfigInfo stores the block numbers which are configuration blocks diff --git a/orderer/consensus/smartbft/verifier.go b/orderer/consensus/smartbft/verifier.go index 63be7e4256b..0e5c6ee3b20 100644 --- a/orderer/consensus/smartbft/verifier.go +++ b/orderer/consensus/smartbft/verifier.go @@ -14,17 +14,17 @@ import ( "sync" "sync/atomic" - "github.com/golang/protobuf/proto" "github.com/hyperledger-labs/SmartBFT/pkg/types" "github.com/hyperledger-labs/SmartBFT/smartbftprotos" "github.com/hyperledger/fabric-lib-go/common/flogging" - cb "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/msp" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/msp" "github.com/hyperledger/fabric/common/policies" "github.com/hyperledger/fabric/common/util" "github.com/hyperledger/fabric/protoutil" "github.com/pkg/errors" "go.uber.org/zap/zapcore" + "google.golang.org/protobuf/proto" ) //go:generate mockery -dir . -name Sequencer -case underscore -output mocks diff --git a/orderer/consensus/smartbft/verifier_test.go b/orderer/consensus/smartbft/verifier_test.go index e285ea4cab8..8187002268e 100644 --- a/orderer/consensus/smartbft/verifier_test.go +++ b/orderer/consensus/smartbft/verifier_test.go @@ -14,18 +14,18 @@ import ( "sync/atomic" "testing" - "github.com/golang/protobuf/proto" "github.com/hyperledger-labs/SmartBFT/pkg/types" "github.com/hyperledger-labs/SmartBFT/smartbftprotos" "github.com/hyperledger/fabric-lib-go/common/flogging" - cb "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/msp" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/msp" "github.com/hyperledger/fabric/orderer/consensus/smartbft" "github.com/hyperledger/fabric/orderer/consensus/smartbft/mocks" "github.com/hyperledger/fabric/protoutil" "github.com/pkg/errors" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" + "google.golang.org/protobuf/proto" ) var hashOfZero = hex.EncodeToString(sha256.New().Sum(nil)) diff --git a/orderer/mocks/common/blockcutter/blockcutter.go b/orderer/mocks/common/blockcutter/blockcutter.go index e9b82eda668..871f8d7282f 100644 --- a/orderer/mocks/common/blockcutter/blockcutter.go +++ b/orderer/mocks/common/blockcutter/blockcutter.go @@ -10,7 +10,7 @@ import ( "sync" "github.com/hyperledger/fabric-lib-go/common/flogging" - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" ) var logger = flogging.MustGetLogger("orderer.mocks.common.blockcutter") diff --git a/orderer/mocks/common/multichannel/multichannel.go b/orderer/mocks/common/multichannel/multichannel.go index 9fb67fd792e..27a5cb904be 100644 --- a/orderer/mocks/common/multichannel/multichannel.go +++ b/orderer/mocks/common/multichannel/multichannel.go @@ -7,7 +7,7 @@ SPDX-License-Identifier: Apache-2.0 package multichannel import ( - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/common/channelconfig" "github.com/hyperledger/fabric/orderer/common/blockcutter" "github.com/hyperledger/fabric/orderer/common/msgprocessor" diff --git a/orderer/sample_clients/broadcast_config/client.go b/orderer/sample_clients/broadcast_config/client.go index e1a1e32113c..3549daa503e 100644 --- a/orderer/sample_clients/broadcast_config/client.go +++ b/orderer/sample_clients/broadcast_config/client.go @@ -10,8 +10,8 @@ import ( "os" "github.com/hyperledger/fabric-lib-go/bccsp/factory" - cb "github.com/hyperledger/fabric-protos-go/common" - ab "github.com/hyperledger/fabric-protos-go/orderer" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + ab "github.com/hyperledger/fabric-protos-go-apiv2/orderer" "github.com/hyperledger/fabric/msp" mspmgmt "github.com/hyperledger/fabric/msp/mgmt" "github.com/hyperledger/fabric/orderer/common/localconfig" diff --git a/orderer/sample_clients/broadcast_config/newchain.go b/orderer/sample_clients/broadcast_config/newchain.go index 1809883b833..e09e1906635 100644 --- a/orderer/sample_clients/broadcast_config/newchain.go +++ b/orderer/sample_clients/broadcast_config/newchain.go @@ -4,7 +4,7 @@ package main import ( - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/internal/configtxgen/encoder" "github.com/hyperledger/fabric/internal/configtxgen/genesisconfig" "github.com/hyperledger/fabric/internal/pkg/identity" diff --git a/orderer/sample_clients/broadcast_msg/client.go b/orderer/sample_clients/broadcast_msg/client.go index 92c733bbe97..88cec642331 100644 --- a/orderer/sample_clients/broadcast_msg/client.go +++ b/orderer/sample_clients/broadcast_msg/client.go @@ -12,8 +12,8 @@ import ( "github.com/cheggaaa/pb" "github.com/hyperledger/fabric-lib-go/bccsp/factory" - cb "github.com/hyperledger/fabric-protos-go/common" - ab "github.com/hyperledger/fabric-protos-go/orderer" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + ab "github.com/hyperledger/fabric-protos-go-apiv2/orderer" "github.com/hyperledger/fabric/internal/pkg/identity" "github.com/hyperledger/fabric/msp" mspmgmt "github.com/hyperledger/fabric/msp/mgmt" diff --git a/orderer/sample_clients/deliver_stdout/client.go b/orderer/sample_clients/deliver_stdout/client.go index b5cd16e464d..9f3e6a20413 100644 --- a/orderer/sample_clients/deliver_stdout/client.go +++ b/orderer/sample_clients/deliver_stdout/client.go @@ -12,8 +12,8 @@ import ( "github.com/hyperledger/fabric-config/protolator" "github.com/hyperledger/fabric-lib-go/bccsp/factory" - cb "github.com/hyperledger/fabric-protos-go/common" - ab "github.com/hyperledger/fabric-protos-go/orderer" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + ab "github.com/hyperledger/fabric-protos-go-apiv2/orderer" "github.com/hyperledger/fabric/internal/pkg/identity" "github.com/hyperledger/fabric/msp" mspmgmt "github.com/hyperledger/fabric/msp/mgmt" diff --git a/pkg/tx/interfaces.go b/pkg/tx/interfaces.go index 5dc423acbcc..747890ba252 100644 --- a/pkg/tx/interfaces.go +++ b/pkg/tx/interfaces.go @@ -10,8 +10,8 @@ import ( "fmt" "io" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/pkg/statedata" ) diff --git a/protoutil/blockutils.go b/protoutil/blockutils.go index 967a2d19cb0..18962c4d2aa 100644 --- a/protoutil/blockutils.go +++ b/protoutil/blockutils.go @@ -14,11 +14,11 @@ import ( "fmt" "math/big" - "github.com/golang/protobuf/proto" - cb "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/msp" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/msp" "github.com/hyperledger/fabric/common/util" "github.com/pkg/errors" + "google.golang.org/protobuf/proto" ) // NewBlock constructs a block with no data and no metadata. diff --git a/protoutil/blockutils_test.go b/protoutil/blockutils_test.go index 9da5a1b53b1..c86f1bdb668 100644 --- a/protoutil/blockutils_test.go +++ b/protoutil/blockutils_test.go @@ -12,13 +12,13 @@ import ( "math" "testing" - "github.com/golang/protobuf/proto" - cb "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/msp" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/msp" configtxtest "github.com/hyperledger/fabric/common/configtx/test" "github.com/hyperledger/fabric/protoutil" "github.com/hyperledger/fabric/protoutil/mocks" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) var testChannelID = "myuniquetestchainid" diff --git a/protoutil/commonutils.go b/protoutil/commonutils.go index e4ce843b5e0..21648c624f7 100644 --- a/protoutil/commonutils.go +++ b/protoutil/commonutils.go @@ -9,18 +9,20 @@ package protoutil import ( "crypto/rand" "fmt" - "time" - "github.com/golang/protobuf/proto" - "github.com/golang/protobuf/ptypes/timestamp" - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/internal/pkg/identity" "github.com/pkg/errors" + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/types/known/timestamppb" ) // MarshalOrPanic serializes a protobuf message and panics if this // operation fails func MarshalOrPanic(pb proto.Message) []byte { + if !pb.ProtoReflect().IsValid() { + panic(errors.New("proto: Marshal called with nil")) + } data, err := proto.Marshal(pb) if err != nil { panic(err) @@ -30,6 +32,9 @@ func MarshalOrPanic(pb proto.Message) []byte { // Marshal serializes a protobuf message. func Marshal(pb proto.Message) ([]byte, error) { + if !pb.ProtoReflect().IsValid() { + return nil, errors.New("proto: Marshal called with nil") + } return proto.Marshal(pb) } @@ -104,13 +109,12 @@ func ExtractEnvelope(block *cb.Block, index int) (*cb.Envelope, error) { // MakeChannelHeader creates a ChannelHeader. func MakeChannelHeader(headerType cb.HeaderType, version int32, chainID string, epoch uint64) *cb.ChannelHeader { + tm := timestamppb.Now() + tm.Nanos = 0 return &cb.ChannelHeader{ - Type: int32(headerType), - Version: version, - Timestamp: ×tamp.Timestamp{ - Seconds: time.Now().Unix(), - Nanos: 0, - }, + Type: int32(headerType), + Version: version, + Timestamp: tm, ChannelId: chainID, Epoch: epoch, } diff --git a/protoutil/commonutils_test.go b/protoutil/commonutils_test.go index 33032c1950f..bce20a979cc 100644 --- a/protoutil/commonutils_test.go +++ b/protoutil/commonutils_test.go @@ -11,12 +11,12 @@ import ( "errors" "testing" - "github.com/golang/protobuf/proto" - cb "github.com/hyperledger/fabric-protos-go/common" - pb "github.com/hyperledger/fabric-protos-go/peer" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/common/crypto" "github.com/hyperledger/fabric/protoutil/fakes" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) //go:generate counterfeiter -o fakes/signer_serializer.go --fake-name SignerSerializer . signerSerializer diff --git a/protoutil/configtxutils.go b/protoutil/configtxutils.go index b635e221d7c..8f5140e7954 100644 --- a/protoutil/configtxutils.go +++ b/protoutil/configtxutils.go @@ -6,7 +6,7 @@ SPDX-License-Identifier: Apache-2.0 package protoutil -import "github.com/hyperledger/fabric-protos-go/common" +import "github.com/hyperledger/fabric-protos-go-apiv2/common" func NewConfigGroup() *common.ConfigGroup { return &common.ConfigGroup{ diff --git a/protoutil/configtxutils_test.go b/protoutil/configtxutils_test.go index 39c368061c4..08b8c639a3b 100644 --- a/protoutil/configtxutils_test.go +++ b/protoutil/configtxutils_test.go @@ -9,7 +9,7 @@ package protoutil_test import ( "testing" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric/protoutil" "github.com/stretchr/testify/require" ) diff --git a/protoutil/proputils.go b/protoutil/proputils.go index 37e81787af2..d8b587a4647 100644 --- a/protoutil/proputils.go +++ b/protoutil/proputils.go @@ -10,10 +10,10 @@ import ( "crypto/sha256" "encoding/hex" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/pkg/errors" + "google.golang.org/protobuf/proto" "google.golang.org/protobuf/types/known/timestamppb" ) @@ -133,18 +133,27 @@ func GetBytesProposalResponsePayload(hash []byte, response *peer.Response, resul // GetBytesChaincodeProposalPayload gets the chaincode proposal payload func GetBytesChaincodeProposalPayload(cpp *peer.ChaincodeProposalPayload) ([]byte, error) { + if cpp == nil { + return nil, errors.New("error marshaling ChaincodeProposalPayload: proto: Marshal called with nil") + } cppBytes, err := proto.Marshal(cpp) return cppBytes, errors.Wrap(err, "error marshaling ChaincodeProposalPayload") } // GetBytesResponse gets the bytes of Response func GetBytesResponse(res *peer.Response) ([]byte, error) { + if res == nil { + return nil, errors.New("error marshaling Response: proto: Marshal called with nil") + } resBytes, err := proto.Marshal(res) return resBytes, errors.Wrap(err, "error marshaling Response") } // GetBytesChaincodeEvent gets the bytes of ChaincodeEvent func GetBytesChaincodeEvent(event *peer.ChaincodeEvent) ([]byte, error) { + if event == nil { + return nil, errors.New("error marshaling ChaincodeEvent: proto: Marshal called with nil") + } eventBytes, err := proto.Marshal(event) return eventBytes, errors.Wrap(err, "error marshaling ChaincodeEvent") } @@ -152,42 +161,63 @@ func GetBytesChaincodeEvent(event *peer.ChaincodeEvent) ([]byte, error) { // GetBytesChaincodeActionPayload get the bytes of ChaincodeActionPayload from // the message func GetBytesChaincodeActionPayload(cap *peer.ChaincodeActionPayload) ([]byte, error) { + if cap == nil { + return nil, errors.New("error marshaling ChaincodeActionPayload: proto: Marshal called with nil") + } capBytes, err := proto.Marshal(cap) return capBytes, errors.Wrap(err, "error marshaling ChaincodeActionPayload") } // GetBytesProposalResponse gets proposal bytes response func GetBytesProposalResponse(pr *peer.ProposalResponse) ([]byte, error) { + if pr == nil { + return nil, errors.New("error marshaling ProposalResponse: proto: Marshal called with nil") + } respBytes, err := proto.Marshal(pr) return respBytes, errors.Wrap(err, "error marshaling ProposalResponse") } // GetBytesHeader get the bytes of Header from the message func GetBytesHeader(hdr *common.Header) ([]byte, error) { + if hdr == nil { + return nil, errors.New("error marshaling Header: proto: Marshal called with nil") + } bytes, err := proto.Marshal(hdr) return bytes, errors.Wrap(err, "error marshaling Header") } // GetBytesSignatureHeader get the bytes of SignatureHeader from the message func GetBytesSignatureHeader(hdr *common.SignatureHeader) ([]byte, error) { + if hdr == nil { + return nil, errors.New("error marshaling SignatureHeader: proto: Marshal called with nil") + } bytes, err := proto.Marshal(hdr) return bytes, errors.Wrap(err, "error marshaling SignatureHeader") } // GetBytesTransaction get the bytes of Transaction from the message func GetBytesTransaction(tx *peer.Transaction) ([]byte, error) { + if tx == nil { + return nil, errors.New("error marshaling Transaction: proto: Marshal called with nil") + } bytes, err := proto.Marshal(tx) return bytes, errors.Wrap(err, "error unmarshalling Transaction") } // GetBytesPayload get the bytes of Payload from the message func GetBytesPayload(payl *common.Payload) ([]byte, error) { + if payl == nil { + return nil, errors.New("error marshaling Payload: proto: Marshal called with nil") + } bytes, err := proto.Marshal(payl) return bytes, errors.Wrap(err, "error marshaling Payload") } // GetBytesEnvelope get the bytes of Envelope from the message func GetBytesEnvelope(env *common.Envelope) ([]byte, error) { + if env == nil { + return nil, errors.New("error marshaling Envelope: proto: Marshal called with nil") + } bytes, err := proto.Marshal(env) return bytes, errors.Wrap(err, "error marshaling Envelope") } @@ -312,6 +342,9 @@ func createProposalFromCDS(channelID string, msg proto.Message, creator []byte, var b []byte var err error if msg != nil { + if !msg.ProtoReflect().IsValid() { + return nil, "", errors.New("proto: Marshal called with nil") + } b, err = proto.Marshal(msg) if err != nil { return nil, "", err diff --git a/protoutil/proputils_test.go b/protoutil/proputils_test.go index 7a9a65b4754..18fbb974c18 100644 --- a/protoutil/proputils_test.go +++ b/protoutil/proputils_test.go @@ -14,15 +14,15 @@ import ( "os" "testing" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-lib-go/bccsp/sw" - "github.com/hyperledger/fabric-protos-go/common" - pb "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/hyperledger/fabric/msp" mspmgmt "github.com/hyperledger/fabric/msp/mgmt" msptesttools "github.com/hyperledger/fabric/msp/mgmt/testtools" "github.com/hyperledger/fabric/protoutil" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) func createCIS() *pb.ChaincodeInvocationSpec { diff --git a/protoutil/signeddata.go b/protoutil/signeddata.go index 71f15f7c2ef..661e9fb243e 100644 --- a/protoutil/signeddata.go +++ b/protoutil/signeddata.go @@ -13,9 +13,9 @@ import ( "fmt" "strings" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/msp" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/msp" + "google.golang.org/protobuf/proto" ) // SignedData is used to represent the general triplet required to verify a signature diff --git a/protoutil/signeddata_test.go b/protoutil/signeddata_test.go index 1b7f6584e0a..c92f902732d 100644 --- a/protoutil/signeddata_test.go +++ b/protoutil/signeddata_test.go @@ -13,12 +13,12 @@ import ( "path/filepath" "testing" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/msp" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/msp" "github.com/hyperledger/fabric/protoutil" "github.com/pkg/errors" "github.com/stretchr/testify/require" + "google.golang.org/protobuf/proto" ) // More duplicate utility which should go away, but the utils are a bit of a mess right now with import cycles diff --git a/protoutil/txutils.go b/protoutil/txutils.go index 320593cc9b0..933d77c61c1 100644 --- a/protoutil/txutils.go +++ b/protoutil/txutils.go @@ -11,10 +11,10 @@ import ( "crypto/sha256" b64 "encoding/base64" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/pkg/errors" + "google.golang.org/protobuf/proto" ) // GetPayloads gets the underlying payload objects in a TransactionAction @@ -94,6 +94,9 @@ func CreateSignedEnvelopeWithTLSBinding( } } + if !dataMsg.ProtoReflect().IsValid() { + return nil, errors.New("error marshaling: proto: Marshal called with nil") + } data, err := proto.Marshal(dataMsg) if err != nil { return nil, errors.Wrap(err, "error marshaling") @@ -387,6 +390,9 @@ func MockSignedEndorserProposalOrPanic( panic(err) } + if prop == nil { + panic(errors.New("proto: Marshal called with nil")) + } propBytes, err := proto.Marshal(prop) if err != nil { panic(err) diff --git a/protoutil/txutils_test.go b/protoutil/txutils_test.go index 2fb9978939e..91c2ea738bb 100644 --- a/protoutil/txutils_test.go +++ b/protoutil/txutils_test.go @@ -13,9 +13,9 @@ import ( "strings" "testing" - "github.com/golang/protobuf/proto" - cb "github.com/hyperledger/fabric-protos-go/common" - pb "github.com/hyperledger/fabric-protos-go/peer" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" + "google.golang.org/protobuf/proto" "github.com/hyperledger/fabric/protoutil" "github.com/hyperledger/fabric/protoutil/fakes" diff --git a/protoutil/unmarshalers.go b/protoutil/unmarshalers.go index 8b65f0cd461..fde475aedb9 100644 --- a/protoutil/unmarshalers.go +++ b/protoutil/unmarshalers.go @@ -7,13 +7,13 @@ SPDX-License-Identifier: Apache-2.0 package protoutil import ( - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/ledger/rwset" - "github.com/hyperledger/fabric-protos-go/ledger/rwset/kvrwset" - "github.com/hyperledger/fabric-protos-go/msp" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset/kvrwset" + "github.com/hyperledger/fabric-protos-go-apiv2/msp" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/pkg/errors" + "google.golang.org/protobuf/proto" ) // the implicit contract of all these unmarshalers is that they diff --git a/tools/go.mod b/tools/go.mod index 66f4272bf2b..26a253f11a4 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -7,13 +7,14 @@ require ( github.com/axw/gocov v1.0.0 github.com/client9/misspell v0.3.4 github.com/go-swagger/go-swagger v0.25.0 - github.com/golang/protobuf v1.5.3 github.com/hyperledger/fabric-lib-go v1.1.1 github.com/maxbrunsfeld/counterfeiter/v6 v6.8.1 github.com/onsi/ginkgo/v2 v2.13.2 github.com/vektra/mockery/v2 v2.45.0 golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 - golang.org/x/tools v0.17.0 + golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d + google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.5.1 + google.golang.org/protobuf v1.34.2 honnef.co/go/tools v0.4.7 mvdan.cc/gofumpt v0.1.0 ) @@ -38,8 +39,10 @@ require ( github.com/go-openapi/validate v0.19.10 // indirect github.com/go-stack/stack v1.8.0 // indirect github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect + github.com/golang/protobuf v1.5.4 // indirect github.com/google/go-cmp v0.6.0 // indirect github.com/google/pprof v0.0.0-20240130152714-0ed6a68c8d9e // indirect + github.com/google/uuid v1.6.0 // indirect github.com/gorilla/handlers v1.4.2 // indirect github.com/hashicorp/hcl v1.0.0 // indirect github.com/huandu/xstrings v1.4.0 // indirect @@ -70,14 +73,13 @@ require ( github.com/toqueteos/webbrowser v1.2.0 // indirect go.mongodb.org/mongo-driver v1.5.1 // indirect golang.org/x/exp/typeparams v0.0.0-20221208152030-732eee02a75a // indirect - golang.org/x/mod v0.14.0 // indirect - golang.org/x/net v0.23.0 // indirect - golang.org/x/sys v0.18.0 // indirect - golang.org/x/term v0.18.0 // indirect - golang.org/x/text v0.14.0 // indirect + golang.org/x/mod v0.17.0 // indirect + golang.org/x/net v0.26.0 // indirect + golang.org/x/sync v0.7.0 // indirect + golang.org/x/sys v0.21.0 // indirect + golang.org/x/term v0.21.0 // indirect + golang.org/x/text v0.16.0 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) - -replace github.com/golang/protobuf => github.com/golang/protobuf v1.3.3 diff --git a/tools/go.sum b/tools/go.sum index edef7b22ecc..e5c286c4d87 100644 --- a/tools/go.sum +++ b/tools/go.sum @@ -188,13 +188,24 @@ github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4er github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= -github.com/golang/protobuf v1.3.3 h1:gyjaxf+svBWX08ZjK86iN9geUJF0H6gp2IRKX6Nf6/I= -github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= @@ -209,8 +220,8 @@ github.com/google/pprof v0.0.0-20240130152714-0ed6a68c8d9e/go.mod h1:czg5+yv1E0Z github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.4.0 h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4= -github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= @@ -490,8 +501,8 @@ golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0= -golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= +golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181005035420-146acd28ed58/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -516,8 +527,8 @@ golang.org/x/net v0.0.0-20200602114024-627f9648deb9/go.mod h1:qpuaurCH72eLCgpAm/ golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs= -golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= +golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= +golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -531,8 +542,8 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= -golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -559,17 +570,17 @@ golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= -golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8= -golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= +golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= +golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/term v0.21.0 h1:WVXCp+/EBEHOj53Rvu+7KiT/iElMrO8ACK16SMZ3jaA= +golang.org/x/term v0.21.0/go.mod h1:ooXLefLobQVslOqselCNF4SxFAaoS6KujMbsGzSDmX0= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= -golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= +golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -601,8 +612,8 @@ golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200717024301-6ddee64345a6/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20210101214203-2dba1e4ea05c/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.17.0 h1:FvmRgNOcs3kOa+T20R1uhfP9F6HgG2mfxDv1vrx1Htc= -golang.org/x/tools v0.17.0/go.mod h1:xsh6VxdV005rRVaS6SSAf9oiAqljS7UZUacMZ8Bnsps= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -627,13 +638,29 @@ google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98 google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20231106174013-bbf56f31fb17 h1:wpZ8pe2x1Q3f2KyT5f8oP/fa9rHAKgFPr/HZdNuS+PQ= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117 h1:1GBuWVLM/KMVUv1t1En5Gs+gFZCNd360GGb4sSxtrhU= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc= +google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ= +google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.5.1 h1:F29+wU6Ee6qgu9TddPgooOdaqsxTMunOoj8KA5yuS5A= +google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.5.1/go.mod h1:5KF+wpkbTSbGcR9zteSqZV6fqFOWBl4Yde8En8MryZA= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/tools/tools.go b/tools/tools.go index 061240b4e69..0cd8ad4838a 100644 --- a/tools/tools.go +++ b/tools/tools.go @@ -14,13 +14,14 @@ import ( _ "github.com/axw/gocov/gocov" _ "github.com/client9/misspell/cmd/misspell" _ "github.com/go-swagger/go-swagger/cmd/swagger" - _ "github.com/golang/protobuf/protoc-gen-go" _ "github.com/hyperledger/fabric-lib-go/common/metrics/cmd/gendoc" _ "github.com/maxbrunsfeld/counterfeiter/v6" _ "github.com/onsi/ginkgo/v2/ginkgo" _ "github.com/vektra/mockery/v2" _ "golang.org/x/lint/golint" _ "golang.org/x/tools/cmd/goimports" + _ "google.golang.org/grpc/cmd/protoc-gen-go-grpc" + _ "google.golang.org/protobuf/cmd/protoc-gen-go" _ "honnef.co/go/tools/cmd/staticcheck" _ "mvdan.cc/gofumpt" ) diff --git a/vendor/github.com/IBM/idemix/README.md b/vendor/github.com/IBM/idemix/README.md index c8f888495d4..aa620720bee 100644 --- a/vendor/github.com/IBM/idemix/README.md +++ b/vendor/github.com/IBM/idemix/README.md @@ -29,228 +29,273 @@ TBD (Group etc.) ## Generation of issue certificate -The input for this step are the 4 attributes that are certified, namely `OU`, `Role`, `EnrollmentID` and `RevocationHandle` (call them ). +The input for this step are the 4 attributes that are certified, namely `OU`, `Role`, `EnrollmentID` and `RevocationHandle` (call them $`a_{0}, \ldots, a_{3}`$). Given these attributes, the CA samples the issuer secret key at random - +$`ISK \gets_{\scriptscriptstyle\$} \mathbb{Z}_{r}`$ And then computes - +$`W \leftarrow g_{2}^{ISK}`$ -For each attribute the CA picks a random element and generates a base for that attribute +For each attribute $`a_{i} \in \{a_{0}, \ldots, a_{3}\}`$ the CA picks a random element $`r_{i} \gets_{\scriptscriptstyle\$} \mathbb{Z}_{r}`$ and generates a base for that attribute - +$`H_{a_{i}} \leftarrow g_{1}^{r_{i}}`$ -The CA randomly selects and computes bases +The CA randomly selects $`r_{ISK}, r, \bar{r}`$ and computes bases - - - - +$`H_{ISK} \leftarrow g_{1}^{r_{ISK}}`$ -Then the CA randomly selects and computes +$`H_{r} \leftarrow g_{1}^{r}`$ - - +$`\bar{g_1} \leftarrow g_{1}^{\bar{r}}`$ + +$`\bar{g_2} \leftarrow \bar{g_1}^{ISK}`$ + +Then the CA randomly selects $`r_p`$ and computes + +$`t_1 \leftarrow g_2^{r_p}`$ + +$`t_2 \leftarrow \bar{g_1}^{r_p}`$ It also generates - - +$`C \leftarrow H(t_1||t_2||g_2||\bar{g_1}||W||\bar{g_2})`$ + +$`s \leftarrow r_{p} %2B C \cdot ISK`$ -The issuer public key is +The issuer public key $`PK_{I}`$ is - +$`PK_{I} \leftarrow \{ a_{0}, \ldots, a_{3}, H_{a_{0}}, \ldots, H_{a_{3}}, H_{ISK}, H_{r}, W, \bar{g_1}, \bar{g_2}, C, s, h_{CA} \}`$ -where is a hash of all fields of the public key. +where $`h_{CA}`$ is a hash of all fields of the public key. -and the issuer private key is is +and the issuer private key is $`SK_{I}`$ is - +$`SK_{I} \leftarrow \{ ISK \}`$ ## Generation of client certificate -Given a client with attributes , the client samples the secret key +Given a client $`c`$ with attributes $`a_{c0}, \ldots, a_{c3}`$, the client samples the secret key - +$`sk_{c} \gets_{\scriptscriptstyle\$} \mathbb{Z}_{r}`$ and random elements - - +$`r_{sk} \gets_{\scriptscriptstyle\$} \mathbb{Z}_{r}`$ + +$`nonce \gets_{\scriptscriptstyle\$} \mathbb{Z}_{r}`$ and then computes - - - - +$`N \leftarrow H_{ISK}^{sk_{c}}`$ -The credential request sent to the CA is . +$`t \leftarrow H_{ISK}^{r_{sk}}`$ + +$`C \leftarrow H(t||H_{ISK}||N||nonce||h_{CA})`$ + +$`s \leftarrow r_{sk} %2B C \cdot sk_{c}`$ + +The credential request sent to the CA is $`\{ N, nonce, C, s \}`$. The CA computes - +$`t' \leftarrow \frac{H_{ISK}^{s}}{N^C}`$ and checks whether - +$`C = H(t'||H_{ISK}||N||nonce||h_{CA})`$ If so, the CA picks random elements - - +$`E \gets_{\scriptscriptstyle\$} \mathbb{Z}_{r}`$ + +$`S \gets_{\scriptscriptstyle\$} \mathbb{Z}_{r}`$ and computes - - - +$$B \leftarrow g_{1} \cdot N \cdot H_{r}^S \cdot \prod_{i=0}^{4} H_{a_{i}}^{a_{ci}}$$ + +$`e \leftarrow \frac{1}{E %2B ISK}`$ + +$`A \leftarrow B^e`$ -The CA returns the credential to the user. +The CA returns the credential $`\{ A, B, S, E \}`$ to the user. The user verifies the credential by computing - +$$B' \leftarrow g_{1} \cdot H_{ISK}^{sk_{c}} \cdot H_{r}^S \cdot \prod_{i=0}^4 H_{a_{i}}^{a_{ci}}$$ -If the user aborts. Otherwise it verifies the signature by checking whether the following equality +If $`B \neq B'`$ the user aborts. Otherwise it verifies the signature by checking whether the following equality - +$`e(g_{2}^E \cdot W, A) = e(g_{2}, B)`$ -holds. If so, the user accepts private key and the user public key is . +holds. If so, the user accepts private key $`SK_{C} \leftarrow \{ sk_{c} \}`$ and the user public key is $`PK_{C} \leftarrow \{ A, B, E, S \}`$. ## Generation of signature -To sign message and simultaneously disclose a subset of attributes (tracked by the bits such that if the bit is one the corresponding attribute is disclosed; notationally, ), the client chooses a new random element and generates a new pseudonym +To sign message $`m`$ and simultaneously disclose a subset of attributes $`a_{c0}, \ldots, a_{c3}`$ (tracked by the bits $`d_{0}, \ldots, d_{3}`$ such that if the bit is one the corresponding attribute is disclosed; notationally, $`\bar{d}_{i} = d_{i} %2B 1 mod 2`$), the client chooses a new random element $`r_{n} \gets_{\scriptscriptstyle\$} \mathbb{Z}_{r}`$ and generates a new pseudonym - +$`Nym \leftarrow N \cdot H_{r}^{r_{n}}`$ And then generates the new signature as follows - - - - - - - - +$`n \gets_{\scriptscriptstyle\$} \mathbb{Z}_{r}`$ + +$`r_1 \gets_{\scriptscriptstyle\$} \mathbb{Z}_{r}`$ + +$`r_2 \gets_{\scriptscriptstyle\$} \mathbb{Z}_{r}`$ + +$`r_3 \leftarrow \frac{1}{r_1}`$ + +$`A' \leftarrow A^{r_1}`$ + +$`\bar{A} \leftarrow B^{r1} \cdot A'^{-E}`$ + +$`B' \leftarrow \frac{B^{r1}}{H_{r}^{r_2}}`$ + +$`S' \leftarrow S-r_2 \cdot r_3`$ The client then generates random elements - - - - - - - - - - +$`r_{sk_{c}} \gets_{\scriptscriptstyle\$} \mathbb{Z}_{r}`$ + +$`r_{e} \gets_{\scriptscriptstyle\$} \mathbb{Z}_{r}`$ + +$`r_{r_2} \gets_{\scriptscriptstyle\$} \mathbb{Z}_{r}`$ + +$`r_{r_3} \gets_{\scriptscriptstyle\$} \mathbb{Z}_{r}`$ + +$`r_{S'} \gets_{\scriptscriptstyle\$} \mathbb{Z}_{r}`$ + +$`r_{r_{n}} \gets_{\scriptscriptstyle\$} \mathbb{Z}_{r}`$ + +$`r_{a_{0}} \gets_{\scriptscriptstyle\$} \mathbb{Z}_{r}`$ + +$`r_{a_{1}} \gets_{\scriptscriptstyle\$} \mathbb{Z}_{r}`$ + +$`r_{a_{2}} \gets_{\scriptscriptstyle\$} \mathbb{Z}_{r}`$ + +$`r_{a_{3}} \gets_{\scriptscriptstyle\$} \mathbb{Z}_{r}`$ and then generates - - - - - - - - - - +$`t_1 \leftarrow A'^{r_{e}} \cdot H_{r}^{r_{r_2}}`$ + +$$t_2 \leftarrow B'^{r_{r_3}} \cdot H_{ISK}^{r_{sk_{c}}} \cdot H_{r}^{r_{S'}} \cdot \prod_{i=0}^4 H_{a_{i}}^{r_{a_{i}} \bar{d}_i}$$ + +$`t_3 \leftarrow H_{ISK}^{r_{sk_{c}}} \cdot H_{r}^{r_{r_{n}}}`$ + +$`C \leftarrow H(H(t_1||t_2||t_3||A'||\bar{A}||B'||Nym||h_{CA}||d_0||\ldots||d_3||m)||n)`$ + +$`S_{sk_{c}} \leftarrow r_{sk_{c}} %2B sk_{c} C`$ + +$`S_{E} \leftarrow r_{e} - E C`$ + +$`S_{r_2} \leftarrow r_{r_2} %2B r_2 C`$ -and for each attribute that requires disclosure, it generates +$`S_{r_3} \leftarrow r_{r_3} - r_3 C`$ - +$`S_{S'} \leftarrow r_{S'} %2B S' C`$ -The signature is . +$`S_{r_{n}} \leftarrow r_{r_{n}} %2B r_{n} C`$ + +and for each attribute $`a_{i}`$ that requires disclosure, it generates + +$`S_{a_{i}} \leftarrow r_{a_{i}} %2B a_{i} C`$ + +The signature $`\sigma`$ is $`\sigma \leftarrow \{ Nym, A', \bar{A}, B', C, S_{sk_{c}}, S_{E}, S_{r_2}, S_{r_3}, S_{S'}, S_{r_{n}}, \ldots S_{a_{i}} \ldots, d_{0}, \ldots, d_{3}, \ldots a_{i} \ldots, n \}`$. ## Verification of a signature -Upon receipt of a signature is over message the verifier checks whether the following equality holds +Upon receipt of a signature $`\sigma`$ is $`\sigma \leftarrow \{ Nym, A', \bar{A}, B', C, S_{sk_{c}}, S_{E}, S_{r_2}, S_{r_3}, S_{S'}, S_{r_{n}}, \ldots S_{a_{i}} \ldots, d_{0}, \ldots, d_{3}, \ldots a_{i} \ldots, n \}`$ over message $`m`$ the verifier checks whether the following equality holds - +$`e(W, A') = e(g_{2}, \bar{A})`$ If so, it recomputes - - - +$`t'_1 \leftarrow \frac{A'^{S_{E}} \cdot H_{r}^{S_{r_2}}}{\left( \bar{A} \cdot B'^{-1} \right)^C}`$ + +$`t'_2 \leftarrow H_{r}^{S_{S'}} \cdot B'^{S_{r_3}} \cdot H_{ISK}^{S_{sk_{c}}} \cdot \prod_{i=0}^4 H_{a_{i}}^{S_{a_{i}} \bar{d}_i} \cdot \left(g_{1} \cdot \prod_{i=0}^4 H_{a_{i}}^{a_{i} d_i} \right)^C`$ + +$`t'_3 \leftarrow \frac{H_{ISK}^{S_{sk_{c}}} \cdot H_{r}^{S_{r_{n}}}}{Nym^C}`$ and accepts the signature if - +$`C = H(H(t'_1||t'_2||t'_3||A'||\bar{A}||B'||Nym||h_{CA}||d_0||\ldots||d_3||m)||n)`$ This verification also verifies the disclosed subset of attributes. ## Generation of a pseudonymous signature -Differently from a standard signature, a pseudonymous signature does not prove that the pseudonym possesses a user certificate signed by a CA. It only proves that the pseudonym signed message . The signature is generated starting from the pseudonym (as generated in the section above) together with secret key and randomness as follows: at first it picks random elements +Differently from a standard signature, a pseudonymous signature does not prove that the pseudonym possesses a user certificate signed by a CA. It only proves that the pseudonym $`Nym`$ signed message $`m`$. The signature is generated starting from the pseudonym (as generated in the section above) together with secret key $`sk_{c}`$ and randomness $`r_{n}`$ as follows: at first it picks random elements + +$`n \gets_{\scriptscriptstyle\$} \mathbb{Z}_{r}`$ - - - +$`r_{sk_{c}} \gets_{\scriptscriptstyle\$} \mathbb{Z}_{r}`$ + +$`r_{r_{n}} \gets_{\scriptscriptstyle\$} \mathbb{Z}_{r}`$ Then it generates - - - - +$`t \leftarrow H_{ISK}^{r_{sk_{c}}} \cdot H_{r}^{r_{r_{n}}}`$ + +$`C \leftarrow H(H(t||Nym||h_{CA}||m)||n)`$ + +$`S_{sk_{c}} \leftarrow r_{sk_{c}} %2B sk_{c} C`$ -The signature is . +$`S_{r_{n}} \leftarrow r_{r_{n}} %2B r_{n} C`$ + +The signature $`\sigma`$ is $`\sigma \leftarrow \{ Nym, C, S_{sk_{c}}, S_{r_{n}}, n \}`$. ## Verification of a pseudonymous signature -Upon receipt of a pseudonymous signature over message the verifier recomputes +Upon receipt of a pseudonymous signature $`\sigma \leftarrow \{ Nym, C, S_{sk_{c}}, S_{r_{n}}, n \}`$ over message $`m`$ the verifier recomputes - +$`t' \leftarrow \frac{H_{ISK}^{S_{sk_{c}}} \cdot H_{r}^{S_{r_{n}}}}{Nym^C}`$ and accepts the signature if - +$`C = H(H(t'||Nym||h_{CA}||m)||n)`$ ## Extensions ### Adding a pseudonym as a function of the Enrollment ID (eid) -The enrollment id is one of the cerified attributes ( with value ). This extension introduces a pseudonym which is a function of the enrollment ID, together with a proof that it was correclty generated. +The enrollment id is one of the cerified attributes ($`a_{2}`$ with value $`a_{c2}`$). This extension introduces a pseudonym which is a function of the enrollment ID, together with a proof that it was correclty generated. #### Signature generation The pseudonym is computed by sampling - - +$`r_{eid} \gets_{\scriptscriptstyle\$} \mathbb{Z}_{r}`$ + +$`r_{r_{eid}} \gets_{\scriptscriptstyle\$} \mathbb{Z}_{r}`$ and by generating the pseudonym - +$`Nym_{eid} \leftarrow H_{a_{2}}^{a_{c2}} \cdot H_{r}^{r_{eid}}`$ -Signature generation is similar to the scheme [above](#sign); in particular, the term is the same used by the original sign algorithm. The extensions include: +Signature generation is similar to the scheme [above](#sign); in particular, the term $`r_{a_{2}}`$ is the same used by the original sign algorithm. The extensions include: - * the client computes an additional value ; + * the client computes an additional value $`t_4 \leftarrow H_{a_{2}}^{r_{a_{2}}} \cdot H_{r}^{r_{r_{eid}}}`$; - * the client includes in the challenge computation: (if is included, it should always be set to 0 otherwise the value of the enrollment ID would be revealed); + * the client includes $`(Nym_{eid}, t_4)`$ in the challenge computation: $`C \leftarrow H(H(t_1||t_2||t_3||t_4||A'||\bar{A}||B'||Nym||Nym_{eid}||h_{CA}||d_0||\ldots||d_3||m)||n)`$ (if $`d_2`$ is included, it should always be set to 0 otherwise the value of the enrollment ID would be revealed); - * the client computes an additional proof ; + * the client computes an additional proof $`S_{r_{eid}} \leftarrow r_{r_{eid}} %2B r_{eid} C`$; - * The signature includes the additional proof and pseudonym . + * The signature includes the additional proof $`S_{r_{eid}}`$ and pseudonym $`Nym_{eid}`$. #### Signature verification Signature verification is the same as above except that - * verifier computes ; + * verifier computes $`t'_4 \leftarrow \frac{H_{a_{2}}^{S_{a_2}} \cdot H_{r}^{S_{r_{eid}}}}{Nym_{eid}^C}`$; - * verifier checks if . + * verifier checks if $`C \leftarrow H(H(t'_1||t'_2||t'_3||t'_4||A'||\bar{A}||B'||Nym||Nym_{eid}||h_{CA}||d_0||\ldots||d_3||m)||n)`$. #### Auditing NymEid -To Audit NymEid the client reveals pair and the auditor checks if . +To Audit NymEid the client reveals pair $`a_{c2}, r_{eid}`$ and the auditor checks if $`Nym_{eid} \leftarrow H_{a_{2}}^{a_{c2}} \cdot H_{r}^{r_{eid}}`$. diff --git a/vendor/github.com/IBM/idemix/bccsp/bccsp.go b/vendor/github.com/IBM/idemix/bccsp/bccsp.go index 0583c9dbed3..91426808b56 100644 --- a/vendor/github.com/IBM/idemix/bccsp/bccsp.go +++ b/vendor/github.com/IBM/idemix/bccsp/bccsp.go @@ -194,7 +194,9 @@ func NewAries(keyStore bccsp.KeyStore, curve *math.Curve, _translator idemix.Tra base.AddWrapper(reflect.TypeOf(&bccsp.IdemixIssuerKeyGenOpts{}), &handlers.IssuerKeyGen{ Exportable: exportable, - Issuer: &aries.Issuer{}, + Issuer: &aries.Issuer{ + Curve: curve, + }, }) base.AddWrapper(reflect.TypeOf(&bccsp.IdemixUserSecretKeyGenOpts{}), &handlers.UserKeyGen{ @@ -233,6 +235,9 @@ func NewAries(keyStore bccsp.KeyStore, curve *math.Curve, _translator idemix.Tra Rng: rng, }}, nymSigner: &handlers.NymSigner{ + SmartcardNymSignatureScheme: &aries.SmartcardIdemixBackend{ + Curve: curve, + }, NymSignatureScheme: &aries.NymSigner{ Curve: curve, Rng: rng, @@ -247,7 +252,7 @@ func NewAries(keyStore bccsp.KeyStore, curve *math.Curve, _translator idemix.Tra &handlers.CredentialSigner{ Credential: &aries.Cred{ Curve: curve, - Bls: bbs12381g2pub.New(), + Bls: bbs12381g2pub.New(curve), }, }) base.AddWrapper(reflect.TypeOf(handlers.NewRevocationSecretKey(nil, true)), @@ -274,6 +279,9 @@ func NewAries(keyStore bccsp.KeyStore, curve *math.Curve, _translator idemix.Tra }) base.AddWrapper(reflect.TypeOf(handlers.NewNymPublicKey(nil, _translator)), &handlers.NymVerifier{ + SmartcardNymSignatureScheme: &aries.SmartcardIdemixBackend{ + Curve: curve, + }, NymSignatureScheme: &aries.NymSigner{ Curve: curve, Rng: rng, @@ -283,7 +291,7 @@ func NewAries(keyStore bccsp.KeyStore, curve *math.Curve, _translator idemix.Tra &handlers.CredentialVerifier{ Credential: &aries.Cred{ Curve: curve, - Bls: bbs12381g2pub.New(), + Bls: bbs12381g2pub.New(curve), }, }) base.AddWrapper(reflect.TypeOf(handlers.NewRevocationPublicKey(nil)), @@ -305,12 +313,16 @@ func NewAries(keyStore bccsp.KeyStore, curve *math.Curve, _translator idemix.Tra }) base.AddWrapper(reflect.TypeOf(&bccsp.IdemixIssuerPublicKeyImportOpts{}), &handlers.IssuerPublicKeyImporter{ - Issuer: &aries.Issuer{}, + Issuer: &aries.Issuer{ + Curve: curve, + }, }) base.AddWrapper(reflect.TypeOf(&bccsp.IdemixIssuerKeyImportOpts{}), &handlers.IssuerKeyImporter{ Exportable: exportable, - Issuer: &aries.Issuer{}, + Issuer: &aries.Issuer{ + Curve: curve, + }, }) base.AddWrapper(reflect.TypeOf(&bccsp.IdemixNymPublicKeyImportOpts{}), &handlers.NymPublicKeyImporter{ diff --git a/vendor/github.com/IBM/idemix/bccsp/handlers/nym.go b/vendor/github.com/IBM/idemix/bccsp/handlers/nym.go index 6c35fa41c7c..dcc31a1fbaf 100644 --- a/vendor/github.com/IBM/idemix/bccsp/handlers/nym.go +++ b/vendor/github.com/IBM/idemix/bccsp/handlers/nym.go @@ -160,7 +160,18 @@ func (i *NymPublicKeyImporter) KeyImport(raw interface{}, opts bccsp.KeyImportOp pk, err := i.User.NewPublicNymFromBytes(bytes) if err != nil { - return nil, err + // A Nym public key is just a group element. There are 2 main ways of serialising + // an uncompressed point: either the two coordinates, or the prefix `0x04` and the + // two coordinates. Typically these serialisation issues are handled with a + // `translator` object which gets bytes, understands the serialisation and produces + // a group element. This code does not have that, however. As a consequence, we + // handle the issue by prefixing the `0x04` byte and re-attempting deserialisation + // in case it first failed. Issue https://github.com/IBM/idemix/issues/42 has + // been created to fix this properly by adding the translator. + pk, err = i.User.NewPublicNymFromBytes(append([]byte{04}, bytes...)) + if err != nil { + return nil, err + } } return &nymPublicKey{pk: pk, translator: i.Translator}, nil diff --git a/vendor/github.com/IBM/idemix/bccsp/handlers/nymsigner.go b/vendor/github.com/IBM/idemix/bccsp/handlers/nymsigner.go index f62068d6ba4..58b855e7b1d 100644 --- a/vendor/github.com/IBM/idemix/bccsp/handlers/nymsigner.go +++ b/vendor/github.com/IBM/idemix/bccsp/handlers/nymsigner.go @@ -6,22 +6,19 @@ SPDX-License-Identifier: Apache-2.0 package handlers import ( + "fmt" + "github.com/IBM/idemix/bccsp/types" - bccsp "github.com/IBM/idemix/bccsp/types" "github.com/pkg/errors" ) type NymSigner struct { - NymSignatureScheme types.NymSignatureScheme + NymSignatureScheme types.NymSignatureScheme + SmartcardNymSignatureScheme types.SmartcardNymSignatureScheme } -func (s *NymSigner) Sign(k bccsp.Key, digest []byte, opts bccsp.SignerOpts) ([]byte, error) { - userSecretKey, ok := k.(*UserSecretKey) - if !ok { - return nil, errors.New("invalid key, expected *userSecretKey") - } - - signerOpts, ok := opts.(*bccsp.IdemixNymSignerOpts) +func (s *NymSigner) Sign(k types.Key, digest []byte, opts types.SignerOpts) ([]byte, error) { + signerOpts, ok := opts.(*types.IdemixNymSignerOpts) if !ok { return nil, errors.New("invalid options, expected *IdemixNymSignerOpts") } @@ -35,6 +32,32 @@ func (s *NymSigner) Sign(k bccsp.Key, digest []byte, opts bccsp.SignerOpts) ([]b return nil, errors.New("invalid issuer public key, expected *issuerPublicKey") } + // handle the smartcard case + if signerOpts.IsSmartcard { + if s.SmartcardNymSignatureScheme == nil { + return nil, fmt.Errorf("smartcard mode is unsupported") + } + + if signerOpts.Smartcard == nil { + return nil, fmt.Errorf("no s/w smartcard supplied in opts") + } + + sigma, nym, rNym, err := s.SmartcardNymSignatureScheme.Sign(signerOpts.Smartcard, ipk.pk, digest) + if err != nil { + return nil, err + } + + signerOpts.NymG1 = nym + signerOpts.RNym = rNym + + return sigma, nil + } + + userSecretKey, ok := k.(*UserSecretKey) + if !ok { + return nil, errors.New("invalid key, expected *userSecretKey") + } + // Nym if signerOpts.Nym == nil { return nil, errors.New("invalid options, missing nym key") @@ -57,16 +80,17 @@ func (s *NymSigner) Sign(k bccsp.Key, digest []byte, opts bccsp.SignerOpts) ([]b } type NymVerifier struct { - NymSignatureScheme types.NymSignatureScheme + NymSignatureScheme types.NymSignatureScheme + SmartcardNymSignatureScheme types.SmartcardNymSignatureScheme } -func (v *NymVerifier) Verify(k bccsp.Key, signature, digest []byte, opts bccsp.SignerOpts) (bool, error) { +func (v *NymVerifier) Verify(k types.Key, signature, digest []byte, opts types.SignerOpts) (bool, error) { nymPublicKey, ok := k.(*nymPublicKey) if !ok { return false, errors.New("invalid key, expected *nymPublicKey") } - signerOpts, ok := opts.(*bccsp.IdemixNymSignerOpts) + signerOpts, ok := opts.(*types.IdemixNymSignerOpts) if !ok { return false, errors.New("invalid options, expected *IdemixNymSignerOpts") } @@ -83,6 +107,27 @@ func (v *NymVerifier) Verify(k bccsp.Key, signature, digest []byte, opts bccsp.S return false, errors.New("invalid signature, it must not be empty") } + // handle the smartcard case + if signerOpts.IsSmartcard { + if v.SmartcardNymSignatureScheme == nil { + return false, fmt.Errorf("smartcard mode is unsupported") + } + if signerOpts.NymEid == nil { + return false, fmt.Errorf("nym eid missing") + } + + err := v.SmartcardNymSignatureScheme.Verify( + ipk.pk, + signerOpts.NymEid, + signature, + digest) + if err != nil { + return false, err + } + + return true, nil + } + err := v.NymSignatureScheme.Verify( ipk.pk, nymPublicKey.pk, diff --git a/vendor/github.com/IBM/idemix/bccsp/handlers/signer.go b/vendor/github.com/IBM/idemix/bccsp/handlers/signer.go index bd0e76b694d..c56fb6bd861 100644 --- a/vendor/github.com/IBM/idemix/bccsp/handlers/signer.go +++ b/vendor/github.com/IBM/idemix/bccsp/handlers/signer.go @@ -7,10 +7,10 @@ package handlers import ( "crypto/ecdsa" - "github.com/pkg/errors" "github.com/IBM/idemix/bccsp/types" bccsp "github.com/IBM/idemix/bccsp/types" + "github.com/pkg/errors" ) type Signer struct { diff --git a/vendor/github.com/IBM/idemix/bccsp/schemes/aries/blind_sign.go b/vendor/github.com/IBM/idemix/bccsp/schemes/aries/blind_sign.go index 3478e76b4d4..a9ab99d2e05 100644 --- a/vendor/github.com/IBM/idemix/bccsp/schemes/aries/blind_sign.go +++ b/vendor/github.com/IBM/idemix/bccsp/schemes/aries/blind_sign.go @@ -11,6 +11,7 @@ import ( "errors" "fmt" + math "github.com/IBM/mathlib" ml "github.com/IBM/mathlib" "github.com/ale-linux/aries-framework-go/component/kmscrypto/crypto/primitive/bbs12381g2pub" ) @@ -51,7 +52,7 @@ func ParseBlindedMessages(bytes []byte, curve *ml.Curve) (*BlindedMessages, erro offset += curve.CompressedG1ByteSize - proof, err := bbs12381g2pub.ParseProofG1(bytes[offset:]) + proof, err := bbs12381g2pub.NewBBSLib(curve).ParseProofG1(bytes[offset:]) if err != nil { return nil, fmt.Errorf("parse G1 proof: %w", err) } @@ -101,12 +102,12 @@ func (b *POKOfBlindedMessages) VerifyProof(messages []bool, commitment *ml.G1, c // VerifyBlinding verifies that `msgCommit` is a valid // commitment of a set of messages against the appropriate bases. -func VerifyBlinding(messageBitmap []bool, msgCommit *ml.G1, bmProof *POKOfBlindedMessages, PK *bbs12381g2pub.PublicKey, nonce []byte) error { +func VerifyBlinding(messageBitmap []bool, msgCommit *ml.G1, bmProof *POKOfBlindedMessages, PK *bbs12381g2pub.PublicKey, nonce []byte, curve *math.Curve) error { challengeBytes := msgCommit.Bytes() challengeBytes = append(challengeBytes, bmProof.C.Bytes()...) challengeBytes = append(challengeBytes, nonce...) - return bmProof.VerifyProof(messageBitmap, msgCommit, bbs12381g2pub.FrFromOKM(challengeBytes), PK) + return bmProof.VerifyProof(messageBitmap, msgCommit, bbs12381g2pub.FrFromOKM(challengeBytes, curve), PK) } // BlindMessages constructs a commitment to a set of messages @@ -120,7 +121,7 @@ func BlindMessages(messages [][]byte, PK *bbs12381g2pub.PublicKey, blindedMsgCou continue } - zrs[i] = bbs12381g2pub.FrFromOKM(msg) + zrs[i] = bbs12381g2pub.FrFromOKM(msg, curve) } return BlindMessagesZr(zrs, PK, blindedMsgCount, nonce, curve) @@ -135,7 +136,7 @@ func BlindMessagesZr(zrs []*ml.Zr, PK *bbs12381g2pub.PublicKey, blindedMsgCount return nil, fmt.Errorf("build generators from public key: %w", err) } - commit := bbs12381g2pub.NewProverCommittingG1() + commit := bbs12381g2pub.NewBBSLib(curve).NewProverCommittingG1() cb := bbs12381g2pub.NewCommitmentBuilder(blindedMsgCount + 1) secrets := make([]*ml.Zr, 0, blindedMsgCount+1) @@ -168,14 +169,14 @@ func BlindMessagesZr(zrs []*ml.Zr, PK *bbs12381g2pub.PublicKey, blindedMsgCount C: C, PoK: &POKOfBlindedMessages{ C: U.Commitment, - ProofC: U.GenerateProof(bbs12381g2pub.FrFromOKM(challengeBytes), secrets), + ProofC: U.GenerateProof(bbs12381g2pub.FrFromOKM(challengeBytes, curve), secrets), }, }, nil } // BlindSign signs disclosed and blinded messages using private key in compressed form. -func BlindSign(messages []*bbs12381g2pub.SignatureMessage, msgCount int, commitment *ml.G1, privKeyBytes []byte) ([]byte, error) { - privKey, err := bbs12381g2pub.UnmarshalPrivateKey(privKeyBytes) +func BlindSign(messages []*bbs12381g2pub.SignatureMessage, msgCount int, commitment *ml.G1, privKeyBytes []byte, curve *math.Curve) ([]byte, error) { + privKey, err := bbs12381g2pub.NewBBSLib(curve).UnmarshalPrivateKey(privKeyBytes) if err != nil { return nil, fmt.Errorf("unmarshal private key: %w", err) } @@ -184,14 +185,14 @@ func BlindSign(messages []*bbs12381g2pub.SignatureMessage, msgCount int, commitm return nil, errors.New("messages are not defined") } - bbs := bbs12381g2pub.New() + bbs := bbs12381g2pub.New(curve) return bbs.SignWithKeyFr(messages, msgCount, commitment, privKey) } // UnblindSign converts a signature over some blind messages into a standard signature. func UnblindSign(sigBytes []byte, S *ml.Zr, curve *ml.Curve) ([]byte, error) { - signature, err := bbs12381g2pub.ParseSignature(sigBytes) + signature, err := bbs12381g2pub.NewBBSLib(curve).ParseSignature(sigBytes) if err != nil { return nil, fmt.Errorf("parse signature: %w", err) } diff --git a/vendor/github.com/IBM/idemix/bccsp/schemes/aries/cred.go b/vendor/github.com/IBM/idemix/bccsp/schemes/aries/cred.go index a2659a74ff8..eede6f4d8a7 100644 --- a/vendor/github.com/IBM/idemix/bccsp/schemes/aries/cred.go +++ b/vendor/github.com/IBM/idemix/bccsp/schemes/aries/cred.go @@ -36,7 +36,7 @@ func (c *Cred) Sign(key types.IssuerSecretKey, credentialRequest []byte, attribu msgsZr := attributesToSignatureMessage(nil, attributes, c.Curve) - sig, err := BlindSign(msgsZr, len(attributes)+1, blindedMsg.C, isk.SK.FR.Bytes()) + sig, err := BlindSign(msgsZr, len(attributes)+1, blindedMsg.C, isk.SK.FR.Bytes(), c.Curve) if err != nil { return nil, fmt.Errorf("ParseBlindedMessages failed [%w]", err) } @@ -73,7 +73,7 @@ func (c *Cred) Verify(sk *math.Zr, key types.IssuerPublicKey, credBytes []byte, return fmt.Errorf("proto.Unmarshal failed [%w]", err) } - sigma, err := bbs12381g2pub.ParseSignature(credential.Cred) + sigma, err := bbs12381g2pub.NewBBSLib(c.Curve).ParseSignature(credential.Cred) if err != nil { return fmt.Errorf("ParseSignature failed [%w]", err) } @@ -93,7 +93,7 @@ func (c *Cred) Verify(sk *math.Zr, key types.IssuerPublicKey, credBytes []byte, case types.IdemixHiddenAttribute: continue case types.IdemixBytesAttribute: - fr := bbs12381g2pub.FrFromOKM(attributes[i].Value.([]byte)) + fr := bbs12381g2pub.FrFromOKM(attributes[i].Value.([]byte), c.Curve) if !fr.Equals(sm[i+1].FR) { return errors.Errorf("credential does not contain the correct attribute value at position [%d]", i) } diff --git a/vendor/github.com/IBM/idemix/bccsp/schemes/aries/credrequest.go b/vendor/github.com/IBM/idemix/bccsp/schemes/aries/credrequest.go index fbe54c47a36..7aad806d367 100644 --- a/vendor/github.com/IBM/idemix/bccsp/schemes/aries/credrequest.go +++ b/vendor/github.com/IBM/idemix/bccsp/schemes/aries/credrequest.go @@ -52,7 +52,7 @@ func (c *CredRequest) BlindVerify(credRequest []byte, key types.IssuerPublicKey, return fmt.Errorf("ParseBlindedMessages failed [%w]", err) } - return VerifyBlinding(bitmap, blindedMsg.C, blindedMsg.PoK, ipk.PK, nonce) + return VerifyBlinding(bitmap, blindedMsg.C, blindedMsg.PoK, ipk.PK, nonce, c.Curve) } // Unblind takes a blinded signature and a blinding and produces a standard signature diff --git a/vendor/github.com/IBM/idemix/bccsp/schemes/aries/issuer.go b/vendor/github.com/IBM/idemix/bccsp/schemes/aries/issuer.go index bc935aeb473..9f727d331fb 100644 --- a/vendor/github.com/IBM/idemix/bccsp/schemes/aries/issuer.go +++ b/vendor/github.com/IBM/idemix/bccsp/schemes/aries/issuer.go @@ -11,6 +11,7 @@ import ( "fmt" "github.com/IBM/idemix/bccsp/types" + math "github.com/IBM/mathlib" "github.com/ale-linux/aries-framework-go/component/kmscrypto/crypto/primitive/bbs12381g2pub" ) @@ -39,7 +40,7 @@ func (i *IssuerPublicKey) Hash() []byte { return i.PK.PointG2.Compressed() } -// IssuerPublicKey is the issuer secret key +// IssuerSecretKey is the issuer secret key type IssuerSecretKey struct { IssuerPublicKey SK *bbs12381g2pub.PrivateKey @@ -57,6 +58,7 @@ func (i *IssuerSecretKey) Public() types.IssuerPublicKey { // Issuer is a local interface to decouple from the idemix implementation type Issuer struct { + Curve *math.Curve } // NewKey generates a new idemix issuer key w.r.t the passed attribute names. @@ -68,7 +70,7 @@ func (i *Issuer) NewKey(AttributeNames []string) (types.IssuerSecretKey, error) return nil, fmt.Errorf("rand.Read failed [%w]", err) } - PK, SK, err := bbs12381g2pub.GenerateKeyPair(sha256.New, seed) + PK, SK, err := bbs12381g2pub.NewBBSLib(i.Curve).GenerateKeyPair(sha256.New, seed) if err != nil { return nil, fmt.Errorf("GenerateKeyPair failed [%w]", err) } @@ -91,7 +93,7 @@ func (i *Issuer) NewKey(AttributeNames []string) (types.IssuerSecretKey, error) // NewPublicKeyFromBytes converts the passed bytes to an Issuer key // It makes sure that the so obtained key has the passed attributes, if specified func (i *Issuer) NewKeyFromBytes(raw []byte, attributes []string) (types.IssuerSecretKey, error) { - SK, err := bbs12381g2pub.UnmarshalPrivateKey(raw) + SK, err := bbs12381g2pub.NewBBSLib(i.Curve).UnmarshalPrivateKey(raw) if err != nil { return nil, fmt.Errorf("UnmarshalPrivateKey failed [%w]", err) } @@ -116,7 +118,7 @@ func (i *Issuer) NewKeyFromBytes(raw []byte, attributes []string) (types.IssuerS // NewPublicKeyFromBytes converts the passed bytes to an Issuer public key // It makes sure that the so obtained public key has the passed attributes, if specified func (i *Issuer) NewPublicKeyFromBytes(raw []byte, attributes []string) (types.IssuerPublicKey, error) { - PK, err := bbs12381g2pub.UnmarshalPublicKey(raw) + PK, err := bbs12381g2pub.NewBBSLib(i.Curve).UnmarshalPublicKey(raw) if err != nil { return nil, fmt.Errorf("UnmarshalPublicKey failed [%w]", err) } diff --git a/vendor/github.com/IBM/idemix/bccsp/schemes/aries/nymsigner.go b/vendor/github.com/IBM/idemix/bccsp/schemes/aries/nymsigner.go index 69c7fe98243..97b74cdaa54 100644 --- a/vendor/github.com/IBM/idemix/bccsp/schemes/aries/nymsigner.go +++ b/vendor/github.com/IBM/idemix/bccsp/schemes/aries/nymsigner.go @@ -37,7 +37,7 @@ func (s *NymSigner) Sign( Nonce := s.Curve.NewRandomZr(s.Rng) - commit := bbs12381g2pub.NewProverCommittingG1() + commit := bbs12381g2pub.NewBBSLib(s.Curve).NewProverCommittingG1() commit.Commit(ipk.PKwG.H0) commit.Commit(ipk.PKwG.H[0]) commitNym := commit.Finish() @@ -47,11 +47,11 @@ func (s *NymSigner) Sign( challengeBytes = append(challengeBytes, commitNym.ToBytes()...) challengeBytes = append(challengeBytes, digest...) - proofChallenge := bbs12381g2pub.FrFromOKM(challengeBytes) + proofChallenge := bbs12381g2pub.FrFromOKM(challengeBytes, s.Curve) challengeBytes = proofChallenge.Bytes() challengeBytes = append(challengeBytes, Nonce.Bytes()...) - proofChallenge = bbs12381g2pub.FrFromOKM(challengeBytes) + proofChallenge = bbs12381g2pub.FrFromOKM(challengeBytes, s.Curve) proof := commitNym.GenerateProof(proofChallenge, []*math.Zr{RNym, sk}) @@ -80,7 +80,7 @@ func (s *NymSigner) Verify( return fmt.Errorf("error unmarshalling signature: [%w]", err) } - nymProof, err := bbs12381g2pub.ParseProofG1(sig.MainSignature) + nymProof, err := bbs12381g2pub.NewBBSLib(s.Curve).ParseProofG1(sig.MainSignature) if err != nil { return fmt.Errorf("parse nym proof: %w", err) } @@ -92,11 +92,11 @@ func (s *NymSigner) Verify( challengeBytes = append(challengeBytes, nymProof.Commitment.Bytes()...) challengeBytes = append(challengeBytes, digest...) - proofChallenge := bbs12381g2pub.FrFromOKM(challengeBytes) + proofChallenge := bbs12381g2pub.FrFromOKM(challengeBytes, s.Curve) challengeBytes = proofChallenge.Bytes() challengeBytes = append(challengeBytes, sig.Nonce...) - proofChallenge = bbs12381g2pub.FrFromOKM(challengeBytes) + proofChallenge = bbs12381g2pub.FrFromOKM(challengeBytes, s.Curve) return nymProof.Verify([]*math.G1{ipk.PKwG.H0, ipk.PKwG.H[0]}, Nym, proofChallenge) } diff --git a/vendor/github.com/IBM/idemix/bccsp/schemes/aries/signer.go b/vendor/github.com/IBM/idemix/bccsp/schemes/aries/signer.go index c7601402e62..e32ea2d6af5 100644 --- a/vendor/github.com/IBM/idemix/bccsp/schemes/aries/signer.go +++ b/vendor/github.com/IBM/idemix/bccsp/schemes/aries/signer.go @@ -25,6 +25,7 @@ const IndexOffsetVC2Attributes = 2 const signLabel = "sign" const signWithEidNymLabel = "signWithEidNym" const signWithEidNymRhNymLabel = "signWithEidNymRhNym" // When the revocation handle is present the enrollment id must also be present +const signWithSmartcardLabel = "signWithSmartcard" type Signer struct { Curve *math.Curve @@ -36,6 +37,9 @@ func (s *Signer) getPoKOfSignature( attributes []types.IdemixAttribute, sk *math.Zr, ipk *bbs12381g2pub.PublicKeyWithGenerators, + sigtype types.SignatureType, + Nym *math.G1, + RNym *math.Zr, ) (*bbs12381g2pub.PoKOfSignature, []*bbs12381g2pub.SignatureMessage, error) { credential := &Credential{} err := proto.Unmarshal(credBytes, credential) @@ -43,14 +47,32 @@ func (s *Signer) getPoKOfSignature( return nil, nil, fmt.Errorf("proto.Unmarshal failed [%w]", err) } - signature, err := bbs12381g2pub.ParseSignature(credential.Cred) + signature, err := bbs12381g2pub.NewBBSLib(s.Curve).ParseSignature(credential.Cred) if err != nil { return nil, nil, fmt.Errorf("parse signature: %w", err) } messagesFr := credential.toSignatureMessage(sk, s.Curve) - pokOS, err := bbs12381g2pub.NewPoKOfSignature(signature, messagesFr, revealedAttributesIndex(attributes), ipk) + var pokOS *bbs12381g2pub.PoKOfSignature + if sigtype == types.Smartcard { + // this mode implements the protocol from https://eprint.iacr.org/2023/853. + // The protocol is between 3 parties, a user, a smartcard and a + // verifier, where user and smartcard can jointly convince a + // verifier they posses a tuple of attributes, one of which is + // only known by the smartcard. + + // As such, we assume that `Nym` and `RNym` were generated by the smartcard + // and so we cannot prove their knowledge. We therefore pass them in to + // `NewPoKOfSignatureExt` as their as, since thier correctiness has already + // been proven by the smartcard in a separate proof. + messagesFr = append([]*bbs12381g2pub.SignatureMessage{{}}, messagesFr...) + C := Nym.Copy() + C.Sub(ipk.H0.Mul(RNym)) + pokOS, err = bbs12381g2pub.NewBBSLib(s.Curve).NewPoKOfSignatureExt(signature, messagesFr[1:], revealedAttributesIndexNoSk(attributes), ipk, Nym, RNym, C) + } else { + pokOS, err = bbs12381g2pub.NewBBSLib(s.Curve).NewPoKOfSignatureExt(signature, messagesFr, revealedAttributesIndex(attributes), ipk, nil, nil, nil) + } if err != nil { return nil, nil, fmt.Errorf("bbs12381g2pub.NewPoKOfSignature error: %w", err) } @@ -61,7 +83,7 @@ func (s *Signer) getPoKOfSignature( func (s *Signer) getChallengeHash( pokSignature *bbs12381g2pub.PoKOfSignature, Nym *math.G1, - commitNym *math.G1, + commitNym *bbs12381g2pub.ProverCommittedG1, eid *attributeCommitment, rh *attributeCommitment, msg []byte, @@ -77,6 +99,8 @@ func (s *Signer) getChallengeHash( challengeBytes = []byte(signWithEidNymLabel) case types.EidNymRhNym: challengeBytes = []byte(signWithEidNymRhNymLabel) + case types.Smartcard: + challengeBytes = []byte(signWithSmartcardLabel) default: panic("programming error") } @@ -86,10 +110,12 @@ func (s *Signer) getChallengeHash( // hash the Nym and t-value challengeBytes = append(challengeBytes, Nym.Bytes()...) - challengeBytes = append(challengeBytes, commitNym.Bytes()...) + if sigType != types.Smartcard { + challengeBytes = append(challengeBytes, commitNym.Commitment.Bytes()...) + } // hash the NymEid and t-value - if sigType == types.EidNym || sigType == types.EidNymRhNym { + if sigType == types.EidNym || sigType == types.EidNymRhNym || sigType == types.Smartcard { challengeBytes = append(challengeBytes, eid.comm.Bytes()...) challengeBytes = append(challengeBytes, eid.proof.Commitment.Bytes()...) } @@ -101,18 +127,18 @@ func (s *Signer) getChallengeHash( } // hash the nonce - proofNonce := bbs12381g2pub.ParseProofNonce(msg) + proofNonce := bbs12381g2pub.ParseProofNonce(msg, s.Curve) proofNonceBytes := proofNonce.ToBytes() challengeBytes = append(challengeBytes, proofNonceBytes...) - c := bbs12381g2pub.FrFromOKM(challengeBytes) + c := bbs12381g2pub.FrFromOKM(challengeBytes, s.Curve) Nonce := s.Curve.NewRandomZr(s.Rng) challengeBytes = c.Bytes() challengeBytes = append(challengeBytes, Nonce.Bytes()...) - return bbs12381g2pub.FrFromOKM(challengeBytes), Nonce + return bbs12381g2pub.FrFromOKM(challengeBytes, s.Curve), Nonce } func (s *Signer) packageProof( @@ -140,7 +166,6 @@ func (s *Signer) packageProof( MainSignature: signatureProofBytes, Nonce: nonce.Bytes(), Nym: Nym.Bytes(), - NymProof: proofNym.ToBytes(), RevocationEpochPk: cri.EpochPk, RevocationPkSig: cri.EpochPkSig, Epoch: cri.Epoch, @@ -149,6 +174,10 @@ func (s *Signer) packageProof( }, } + if proofNym != nil { + sig.NymProof = proofNym.ToBytes() + } + if nymEid != nil { sig.NymEid = nymEid.comm.Bytes() sig.NymEidProof = proofNymEid.ToBytes() @@ -167,11 +196,16 @@ func (s *Signer) packageProof( func (s *Signer) getCommitNym( ipk *IssuerPublicKey, pokSignature *bbs12381g2pub.PoKOfSignature, + sigType types.SignatureType, ) *bbs12381g2pub.ProverCommittedG1 { + if sigType == types.Smartcard { + return nil + } + // Nym is H0^{RNym} \cdot H[0]^{sk} - commit := bbs12381g2pub.NewProverCommittingG1() + commit := bbs12381g2pub.NewBBSLib(s.Curve).NewProverCommittingG1() commit.Commit(ipk.PKwG.H0) commit.Commit(ipk.PKwG.H[UserSecretKeyIndex]) // we force the same blinding factor used in PokVC2 to prove equality. @@ -261,7 +295,7 @@ func (s *Signer) getAttributeCommitment( return nil, fmt.Errorf("error determining index for attribute: %w", err) } - commit := bbs12381g2pub.NewProverCommittingG1() + commit := bbs12381g2pub.NewBBSLib(s.Curve).NewProverCommittingG1() commit.Commit(ipk.PKwG.H0) commit.Commit(ipk.PKwG.H[idxInBases]) @@ -313,12 +347,12 @@ func (s *Signer) Sign( // arg check // /////////////// - if sigType == types.EidNym && + if (sigType == types.EidNym || sigType == types.Smartcard) && attributes[eidIndex].Type != types.IdemixHiddenAttribute { return nil, nil, fmt.Errorf("cannot create idemix signature: disclosure of enrollment ID requested for EidNym signature") } - if sigType == types.EidNymRhNym && + if (sigType == types.EidNymRhNym || sigType == types.Smartcard) && (attributes[eidIndex].Type != types.IdemixHiddenAttribute || attributes[rhIndex].Type != types.IdemixHiddenAttribute) { return nil, nil, fmt.Errorf("cannot create idemix signature: disclosure of enrollment ID or RH requested for EidNymRhNym signature") @@ -348,7 +382,7 @@ func (s *Signer) Sign( // Generate main PoK (1st move) // ////////////////////////////////// - pokSignature, messagesFr, err := s.getPoKOfSignature(credBytes, attributes, sk, ipk.PKwG) + pokSignature, messagesFr, err := s.getPoKOfSignature(credBytes, attributes, sk, ipk.PKwG, sigType, Nym, RNym) if err != nil { return nil, nil, err } @@ -357,7 +391,7 @@ func (s *Signer) Sign( // Handling Nym // ////////////////// - commitNym := s.getCommitNym(ipk, pokSignature) + commitNym := s.getCommitNym(ipk, pokSignature, sigType) /////////////////// // Handle NymEID // @@ -387,7 +421,7 @@ func (s *Signer) Sign( // Get the challenge // /////////////////////// - proofChallenge, Nonce := s.getChallengeHash(pokSignature, Nym, commitNym.Commitment, nymEid, rhNym, msg, sigType) + proofChallenge, Nonce := s.getChallengeHash(pokSignature, Nym, commitNym, nymEid, rhNym, msg, sigType) //////////////////////// // Generate responses // @@ -396,7 +430,10 @@ func (s *Signer) Sign( // 1) main proof := pokSignature.GenerateProof(proofChallenge) // 2) Nym - proofNym := commitNym.GenerateProof(proofChallenge, []*math.Zr{RNym, sk}) + var proofNym *bbs12381g2pub.ProofG1 + if commitNym != nil { + proofNym = commitNym.GenerateProof(proofChallenge, []*math.Zr{RNym, sk}) + } // 3) NymEid var proofNymEid *bbs12381g2pub.ProofG1 if nymEid != nil { @@ -418,7 +455,7 @@ func (s *Signer) Sign( } var m *types.IdemixSignerMetadata - if sigType == types.EidNym { + if sigType == types.EidNym || sigType == types.Smartcard { m = &types.IdemixSignerMetadata{ EidNymAuditData: &types.AttrNymAuditData{ Nym: nymEid.comm, @@ -496,7 +533,7 @@ func (s *Signer) Verify( } verifyRHNym := (verType == types.BestEffort && sig.NymRh != nil) || verType == types.ExpectEidNymRhNym - verifyEIDNym := (verType == types.BestEffort && sig.NymEid != nil) || verType == types.ExpectEidNym || verType == types.ExpectEidNymRhNym || verifyRHNym + verifyEIDNym := (verType == types.BestEffort && sig.NymEid != nil) || verType == types.ExpectEidNym || verType == types.ExpectEidNymRhNym || verType == types.ExpectSmartcard || verifyRHNym messages := attributesToSignatureMessage(nil, attributes, s.Curve) @@ -505,7 +542,7 @@ func (s *Signer) Verify( return fmt.Errorf("parse signature proof: %w", err) } - signatureProof, err := bbs12381g2pub.ParseSignatureProof(sig.MainSignature[payload.LenInBytes():]) + signatureProof, err := bbs12381g2pub.NewBBSLib(s.Curve).ParseSignatureProof(sig.MainSignature[payload.LenInBytes():]) if err != nil { return fmt.Errorf("parse signature proof: %w", err) } @@ -514,25 +551,23 @@ func (s *Signer) Verify( return fmt.Errorf("payload revealed bigger from messages") } - revealedMessages := make(map[int]*bbs12381g2pub.SignatureMessage) - for i := range payload.Revealed { - revealedMessages[payload.Revealed[i]] = messages[i] - } - Nym, err := s.Curve.NewG1FromBytes(sig.Nym) if err != nil { return fmt.Errorf("parse nym commit: %w", err) } - nymProof, err := bbs12381g2pub.ParseProofG1(sig.NymProof) - if err != nil { - return fmt.Errorf("parse nym proof: %w", err) + var nymProof *bbs12381g2pub.ProofG1 + if verType != types.ExpectSmartcard { + nymProof, err = bbs12381g2pub.NewBBSLib(s.Curve).ParseProofG1(sig.NymProof) + if err != nil { + return fmt.Errorf("parse nym proof: %w", err) + } } var nymEidProof *bbs12381g2pub.ProofG1 var NymEid *math.G1 if verifyEIDNym { - nymEidProof, err = bbs12381g2pub.ParseProofG1(sig.NymEidProof) + nymEidProof, err = bbs12381g2pub.NewBBSLib(s.Curve).ParseProofG1(sig.NymEidProof) if err != nil { return fmt.Errorf("parse nym proof: %w", err) } @@ -546,7 +581,7 @@ func (s *Signer) Verify( var rhNymProof *bbs12381g2pub.ProofG1 var RhNym *math.G1 if verifyRHNym { - rhNymProof, err = bbs12381g2pub.ParseProofG1(sig.NymRhProof) + rhNymProof, err = bbs12381g2pub.NewBBSLib(s.Curve).ParseProofG1(sig.NymRhProof) if err != nil { return fmt.Errorf("parse rh proof: %w", err) } @@ -563,7 +598,9 @@ func (s *Signer) Verify( // hash the signature type first var challengeBytes []byte - if verifyRHNym { + if verType == types.ExpectSmartcard { + challengeBytes = []byte(signWithSmartcardLabel) + } else if verifyRHNym { challengeBytes = []byte(signWithEidNymRhNymLabel) } else if verifyEIDNym { challengeBytes = []byte(signWithEidNymLabel) @@ -571,10 +608,25 @@ func (s *Signer) Verify( challengeBytes = []byte(signLabel) } + revealedMessages := make(map[int]*bbs12381g2pub.SignatureMessage) + for i := range payload.Revealed { + revealedMessages[payload.Revealed[i]] = messages[i] + } + + if verType == types.ExpectSmartcard { + // we add this so that GetBytesForChallenge thinks we disclose attr 0 and doesn't add its base to the ZKP chall + // we will remove it later + revealedMessages[0] = &bbs12381g2pub.SignatureMessage{} + } challengeBytes = append(challengeBytes, signatureProof.GetBytesForChallenge(revealedMessages, ipk.PKwG)...) + if verType == types.ExpectSmartcard { + delete(revealedMessages, 0) + } challengeBytes = append(challengeBytes, sig.Nym...) - challengeBytes = append(challengeBytes, nymProof.Commitment.Bytes()...) + if verType != types.ExpectSmartcard { + challengeBytes = append(challengeBytes, nymProof.Commitment.Bytes()...) + } if verifyEIDNym { challengeBytes = append(challengeBytes, sig.NymEid...) @@ -586,14 +638,14 @@ func (s *Signer) Verify( challengeBytes = append(challengeBytes, rhNymProof.Commitment.Bytes()...) } - proofNonce := bbs12381g2pub.ParseProofNonce(msg) + proofNonce := bbs12381g2pub.ParseProofNonce(msg, s.Curve) proofNonceBytes := proofNonce.ToBytes() challengeBytes = append(challengeBytes, proofNonceBytes...) - proofChallenge := bbs12381g2pub.FrFromOKM(challengeBytes) + proofChallenge := bbs12381g2pub.FrFromOKM(challengeBytes, s.Curve) challengeBytes = proofChallenge.Bytes() challengeBytes = append(challengeBytes, sig.Nonce...) - proofChallenge = bbs12381g2pub.FrFromOKM(challengeBytes) + proofChallenge = bbs12381g2pub.FrFromOKM(challengeBytes, s.Curve) ////////////////////// // Verify responses // @@ -654,15 +706,17 @@ func (s *Signer) Verify( } } - // verify that `sk` in the Nym is the same as the one in the signature - if !nymProof.Responses[AttributeIndexInNym].Equals(signatureProof.ProofVC2.Responses[IndexOffsetVC2Attributes+UserSecretKeyIndex]) { - return fmt.Errorf("failed equality proof for sk") - } + if verType != types.ExpectSmartcard { + // verify that `sk` in the Nym is the same as the one in the signature + if !nymProof.Responses[AttributeIndexInNym].Equals(signatureProof.ProofVC2.Responses[IndexOffsetVC2Attributes+UserSecretKeyIndex]) { + return fmt.Errorf("failed equality proof for sk") + } - // verify the proof of knowledge of the Nym - err = nymProof.Verify([]*math.G1{ipk.PKwG.H0, ipk.PKwG.H[UserSecretKeyIndex]}, Nym, proofChallenge) - if err != nil { - return fmt.Errorf("verify nym proof: %w", err) + // verify the proof of knowledge of the Nym + err = nymProof.Verify([]*math.G1{ipk.PKwG.H0, ipk.PKwG.H[UserSecretKeyIndex]}, Nym, proofChallenge) + if err != nil { + return fmt.Errorf("verify nym proof: %w", err) + } } if verifyEIDNym { @@ -692,7 +746,11 @@ func (s *Signer) Verify( } // verify the proof of knowledge of the signature - return signatureProof.Verify(proofChallenge, ipk.PKwG, revealedMessages, messages) + if verType != types.ExpectSmartcard { + return signatureProof.Verify(proofChallenge, ipk.PKwG, revealedMessages, messages) + } else { + return signatureProof.VerifyExt(proofChallenge, ipk.PKwG, revealedMessages, messages, Nym) + } } // AuditNymEid permits the auditing of the nym eid generated by a signer @@ -734,7 +792,7 @@ func (s *Signer) AuditNymEid( return fmt.Errorf("invalid audit type [%d]", verType) } - eidAttr := bbs12381g2pub.FrFromOKM([]byte(enrollmentID)) + eidAttr := bbs12381g2pub.FrFromOKM([]byte(enrollmentID), s.Curve) ne := ipk.PKwG.H[eidIndex+1].Mul2(eidAttr, ipk.PKwG.H0, RNymEid) @@ -782,7 +840,7 @@ func (s *Signer) AuditNymRh( return fmt.Errorf("invalid audit type [%d]", verType) } - rhAttr := bbs12381g2pub.FrFromOKM([]byte(revocationHandle)) + rhAttr := bbs12381g2pub.FrFromOKM([]byte(revocationHandle), s.Curve) nr := ipk.PKwG.H[rhIndex+1].Mul2(rhAttr, ipk.PKwG.H0, RNymRh) diff --git a/vendor/github.com/IBM/idemix/bccsp/schemes/aries/smartcard.go b/vendor/github.com/IBM/idemix/bccsp/schemes/aries/smartcard.go new file mode 100644 index 00000000000..41503347e8b --- /dev/null +++ b/vendor/github.com/IBM/idemix/bccsp/schemes/aries/smartcard.go @@ -0,0 +1,206 @@ +/* +Copyright IBM Corp. All Rights Reserved. + +SPDX-License-Identifier: Apache-2.0 +*/ + +package aries + +import ( + "crypto/cipher" + "crypto/rand" + "crypto/sha256" + "fmt" + "io" + + "github.com/IBM/idemix/bccsp/types" + math "github.com/IBM/mathlib" +) + +// Smartcard is an implementation of an idemix joint signature where one of +// the attributes is only known to a smartcard. This structure plays a dual +// role: +// 1. emulation of the smartcard to be able to test verification without +// external hardware. (`PRF`, `NymEid`, `NymSign` methods). These +// functions are never used in production. +// 2. implementation of the verification of signatures produced by a +// real smartcard (`NymVerify` method). This function is used in production. +type Smartcard struct { + H0, H1, H2 *math.G1 + Uid_sk, EID *math.Zr + PRF_K0, PRF_K1 cipher.Block + Curve *math.Curve + Rng io.Reader + + ctr int16 +} + +func (sc *Smartcard) PRF(input []byte, K cipher.Block) *math.Zr { + bytes := make([]byte, sc.Curve.ScalarByteSize) + + PRF := cipher.NewCBCEncrypter(K, make([]byte, K.BlockSize())) + PRF.CryptBlocks(bytes, input) + PRF.CryptBlocks(bytes[sc.PRF_K1.BlockSize():], input) + + return sc.Curve.NewZrFromBytes(bytes) +} + +func (sc *Smartcard) getNymEid() (*math.Zr, *math.G1) { + // set PRNG_input from counter + PRNG_input := make([]byte, 16) + PRNG_input[0] = byte(sc.ctr & 0xff) + PRNG_input[1] = byte((sc.ctr >> 8) & 0xff) + + // sample random s + s := sc.PRF(PRNG_input, sc.PRF_K0) + + // tau0 = h0^s h2^id + tau0 := sc.H0.Mul2(s, sc.H2, sc.EID) + + return s, tau0 +} + +func (sc *Smartcard) NymEid() (*math.Zr, *math.G1) { + // increment counter + sc.ctr++ + + return sc.getNymEid() +} + +func (sc *Smartcard) NymSign(msg []byte) ([]byte, error) { + + // set PRNG_input from random + PRNG_input := make([]byte, 16) + _, err := rand.Read(PRNG_input) + if err != nil { + return nil, fmt.Errorf("rand.Read returned error [%w]", err) + } + + // sample random r1 + r1 := sc.PRF(PRNG_input, sc.PRF_K1) + + // B = h0^r1 h1^uid + B := sc.H0.Mul2(r1, sc.H1, sc.Uid_sk) + + x_tilde, r_tilde := sc.Curve.NewRandomZr(sc.Rng), sc.Curve.NewRandomZr(sc.Rng) + + // B_ = h0^r~ h1^x~ + B_ := sc.H0.Mul2(r_tilde, sc.H1, x_tilde) + + _, tau0 := sc.getNymEid() + + var challengeBytes []byte + challengeBytes = append(challengeBytes, sc.H0.Bytes()[1:]...) + challengeBytes = append(challengeBytes, sc.H1.Bytes()[1:]...) + challengeBytes = append(challengeBytes, sc.H2.Bytes()[1:]...) + challengeBytes = append(challengeBytes, B.Bytes()[1:]...) + challengeBytes = append(challengeBytes, B_.Bytes()[1:]...) + challengeBytes = append(challengeBytes, tau0.Bytes()[1:]...) + challengeBytes = append(challengeBytes, msg...) + + h := sha256.Sum256(challengeBytes) + + c := sc.Curve.NewZrFromBytes(h[:]) + + /* + expected return: + PRNG_input (16) + B (65) + B_ (65) + x_hat (32) + r_hat (32) + */ + + resp := make([]byte, 0) + resp = append(resp, PRNG_input...) + resp = append(resp, B.Bytes()...) + resp = append(resp, B_.Bytes()...) + resp = append(resp, x_tilde.Plus(c.Mul(sc.Uid_sk)).Bytes()...) + resp = append(resp, r_tilde.Plus(c.Mul(r1)).Bytes()...) + + return resp, nil +} + +func (sc *Smartcard) NymVerify(proofBytes []byte, nymEid *math.G1, msg []byte) error { + + offset := 16 + + B, err := sc.Curve.NewG1FromBytes(proofBytes[offset : offset+sc.Curve.G1ByteSize]) + if err != nil { + return fmt.Errorf("could not parse B, err %w", err) + } + offset += sc.Curve.G1ByteSize + + B_, err := sc.Curve.NewG1FromBytes(proofBytes[offset : offset+sc.Curve.G1ByteSize]) + if err != nil { + return fmt.Errorf("could not parse B_, err %w", err) + } + offset += sc.Curve.G1ByteSize + + x_hat := sc.Curve.NewZrFromBytes(proofBytes[offset : offset+sc.Curve.ScalarByteSize]) + offset += sc.Curve.ScalarByteSize + + r_hat := sc.Curve.NewZrFromBytes(proofBytes[offset : offset+sc.Curve.ScalarByteSize]) + offset += sc.Curve.ScalarByteSize + + var challengeBytes []byte + challengeBytes = append(challengeBytes, sc.H0.Bytes()[1:]...) + challengeBytes = append(challengeBytes, sc.H1.Bytes()[1:]...) + challengeBytes = append(challengeBytes, sc.H2.Bytes()[1:]...) + challengeBytes = append(challengeBytes, B.Bytes()[1:]...) + challengeBytes = append(challengeBytes, B_.Bytes()[1:]...) + challengeBytes = append(challengeBytes, nymEid.Bytes()[1:]...) + challengeBytes = append(challengeBytes, msg...) + + h := sha256.Sum256(challengeBytes) + + c := sc.Curve.NewZrFromBytes(h[:]) + + lhs := sc.H0.Mul2(r_hat, sc.H1, x_hat) + rhs := B_.Mul2(sc.Curve.NewZrFromInt(1), B, c) + + if lhs.Equals(rhs) { + return nil + } + + return fmt.Errorf("invalid proof") +} + +type SmartcardIdemixBackend struct { + Curve *math.Curve +} + +// Sign creates a new idemix pseudonym signature +func (s *SmartcardIdemixBackend) Sign(isc interface{}, ipk types.IssuerPublicKey, digest []byte) ([]byte, *math.G1, *math.Zr, error) { + sc, ok := isc.(*Smartcard) + if !ok { + return nil, nil, nil, fmt.Errorf("invalid interface conversion for %T to *Smartcard", isc) + } + + sig, err := sc.NymSign(digest) + if err != nil { + return nil, nil, nil, err + } + + seed := sig[0:16] + + rNym := sc.PRF(seed, sc.PRF_K1) + nym, err := sc.Curve.NewG1FromBytes(sig[16 : 16+sc.Curve.G1ByteSize]) + if err != nil { + return nil, nil, nil, err + } + + return sig, nym, rNym, err +} + +// Verify verifies an idemix NymSignature +func (s *SmartcardIdemixBackend) Verify(ipk types.IssuerPublicKey, Nym *math.G1, signature, digest []byte) error { + sc := &Smartcard{} + + sc.H0 = ipk.(*IssuerPublicKey).PKwG.H0 + sc.H1 = ipk.(*IssuerPublicKey).PKwG.H[0] + sc.H2 = ipk.(*IssuerPublicKey).PKwG.H[3] + sc.Curve = s.Curve + + return sc.NymVerify(signature, Nym, digest) +} diff --git a/vendor/github.com/IBM/idemix/bccsp/schemes/aries/util.go b/vendor/github.com/IBM/idemix/bccsp/schemes/aries/util.go index 9021617afe3..9516f42487c 100644 --- a/vendor/github.com/IBM/idemix/bccsp/schemes/aries/util.go +++ b/vendor/github.com/IBM/idemix/bccsp/schemes/aries/util.go @@ -29,7 +29,7 @@ func attributesToSignatureMessage(sk *math.Zr, attributes []types.IdemixAttribut switch msg.Type { case types.IdemixBytesAttribute: msgsZr = append(msgsZr, &bbs12381g2pub.SignatureMessage{ - FR: bbs12381g2pub.FrFromOKM(msg.Value.([]byte)), + FR: bbs12381g2pub.FrFromOKM(msg.Value.([]byte), curve), Idx: i + 1, }) case types.IdemixIntAttribute: @@ -45,6 +45,18 @@ func attributesToSignatureMessage(sk *math.Zr, attributes []types.IdemixAttribut return msgsZr } +func revealedAttributesIndexNoSk(attributes []types.IdemixAttribute) []int { + revealed := make([]int, 0, len(attributes)) + + for i, msg := range attributes { + if msg.Type != types.IdemixHiddenAttribute { + revealed = append(revealed, i) + } + } + + return revealed +} + func revealedAttributesIndex(attributes []types.IdemixAttribute) []int { revealed := make([]int, 0, len(attributes)) diff --git a/vendor/github.com/IBM/idemix/bccsp/types/idemix.go b/vendor/github.com/IBM/idemix/bccsp/types/idemix.go index a44c74a922f..9722bfe9383 100644 --- a/vendor/github.com/IBM/idemix/bccsp/types/idemix.go +++ b/vendor/github.com/IBM/idemix/bccsp/types/idemix.go @@ -177,3 +177,13 @@ type NymSignatureScheme interface { // Verify verifies an idemix NymSignature Verify(pk IssuerPublicKey, Nym *math.G1, signature, digest []byte) error } + +// SmartcardNymSignatureScheme is a local interface to decouple from the idemix implementation +// the nym sign-related operations +type SmartcardNymSignatureScheme interface { + // Sign creates a new idemix pseudonym signature + Sign(isc interface{}, ipk IssuerPublicKey, digest []byte) ([]byte, *math.G1, *math.Zr, error) + + // Verify verifies an idemix NymSignature + Verify(pk IssuerPublicKey, Nym *math.G1, signature, digest []byte) error +} diff --git a/vendor/github.com/IBM/idemix/bccsp/types/idemixopts.go b/vendor/github.com/IBM/idemix/bccsp/types/idemixopts.go index 393f3262e70..fdaf2adca37 100644 --- a/vendor/github.com/IBM/idemix/bccsp/types/idemixopts.go +++ b/vendor/github.com/IBM/idemix/bccsp/types/idemixopts.go @@ -350,6 +350,21 @@ type IdemixNymSignerOpts struct { IssuerPK Key // H is the hash function to be used H crypto.Hash + + // IsSmartcard checks whether this nym signature was generated by a smartcard + IsSmartcard bool + + // Smartcard is a software smartcard used to support signing in s/w + // this field is only used in testing to emulate a real smartcard + // and may never be set in production. + Smartcard interface{} + + // NymEid is the nym eid to use in the verification + NymEid *math.G1 + + // data about the nym returned by the smartcard implementation + NymG1 *math.G1 + RNym *math.Zr } // HashFunc returns an identifier for the hash function used to produce @@ -433,6 +448,8 @@ const ( EidNym // EidNymRhNym adds a hiding and binding commitment to both the enrollment id and the revocation handle and proves each of their correctness EidNymRhNym + // Smartcard has a separate component do the nym signing + Smartcard ) // VerificationType describes the type of verification that is required @@ -449,6 +466,8 @@ const ( ExpectEidNym // ExpectEidNymRhNym expects a SignatureType of EidNymRhNym ExpectEidNymRhNym + // Smartcard has a separate component do the nym signing + ExpectSmartcard ) // AuditVerificationType describes the type of audit verification that is required diff --git a/vendor/github.com/IBM/idemix/idemix_roles.go b/vendor/github.com/IBM/idemix/idemix_roles.go index 53e823b45d9..aa3a7a0f616 100644 --- a/vendor/github.com/IBM/idemix/idemix_roles.go +++ b/vendor/github.com/IBM/idemix/idemix_roles.go @@ -6,7 +6,7 @@ SPDX-License-Identifier: Apache-2.0 package idemix import ( - m "github.com/hyperledger/fabric-protos-go/msp" + m "github.com/hyperledger/fabric-protos-go-apiv2/msp" ) // Role : Represents a IdemixRole diff --git a/vendor/github.com/IBM/idemix/idemixmsp.go b/vendor/github.com/IBM/idemix/idemixmsp.go index 34542451208..37ea48e1158 100644 --- a/vendor/github.com/IBM/idemix/idemixmsp.go +++ b/vendor/github.com/IBM/idemix/idemixmsp.go @@ -22,7 +22,7 @@ import ( im "github.com/IBM/idemix/idemixmsp" math "github.com/IBM/mathlib" "github.com/golang/protobuf/proto" - m "github.com/hyperledger/fabric-protos-go/msp" + m "github.com/hyperledger/fabric-protos-go-apiv2/msp" "github.com/pkg/errors" "go.uber.org/zap/zapcore" ) diff --git a/vendor/github.com/IBM/idemix/msp.go b/vendor/github.com/IBM/idemix/msp.go index cc07a74135f..daad00cb1c8 100644 --- a/vendor/github.com/IBM/idemix/msp.go +++ b/vendor/github.com/IBM/idemix/msp.go @@ -9,7 +9,7 @@ package idemix import ( "time" - "github.com/hyperledger/fabric-protos-go/msp" + "github.com/hyperledger/fabric-protos-go-apiv2/msp" ) // IdentityDeserializer is implemented by both MSPManger and MSP diff --git a/vendor/github.com/ale-linux/aries-framework-go/component/kmscrypto/crypto/primitive/bbs12381g2pub/bbs12381g2pub.go b/vendor/github.com/ale-linux/aries-framework-go/component/kmscrypto/crypto/primitive/bbs12381g2pub/bbs12381g2pub.go index 6b4353295be..a9c5c1aa6a1 100644 --- a/vendor/github.com/ale-linux/aries-framework-go/component/kmscrypto/crypto/primitive/bbs12381g2pub/bbs12381g2pub.go +++ b/vendor/github.com/ale-linux/aries-framework-go/component/kmscrypto/crypto/primitive/bbs12381g2pub/bbs12381g2pub.go @@ -19,58 +19,69 @@ import ( "fmt" "sort" - ml "github.com/IBM/mathlib" + math "github.com/IBM/mathlib" ) -// nolint:gochecknoglobals -var curve = ml.Curves[ml.BLS12_381_BBS] +func NewBBSLib(curve *math.Curve) *bbsLib { + return &bbsLib{ + curve: curve, -// BBSG2Pub defines BBS+ signature scheme where public key is a point in the field of G2. -// BBS+ signature scheme (as defined in https://eprint.iacr.org/2016/663.pdf, section 4.3). -type BBSG2Pub struct{} + // Signature length. + bls12381SignatureLen: curve.CompressedG1ByteSize + 2*frCompressedSize, -// New creates a new BBSG2Pub. -func New() *BBSG2Pub { - return &BBSG2Pub{} -} + // Default BLS 12-381 public key length in G2 field. + bls12381G2PublicKeyLen: curve.CompressedG2ByteSize, -// Number of bytes in scalar compressed form. -const frCompressedSize = 32 + // Number of bytes in G1 X coordinate. + g1CompressedSize: curve.CompressedG1ByteSize, -var ( - // nolint:gochecknoglobals - // Signature length. - bls12381SignatureLen = curve.CompressedG1ByteSize + 2*frCompressedSize + // Number of bytes in G1 X and Y coordinates. + g1UncompressedSize: curve.G1ByteSize, - // nolint:gochecknoglobals - // Default BLS 12-381 public key length in G2 field. - bls12381G2PublicKeyLen = curve.CompressedG2ByteSize + // Number of bytes in G2 X(a, b) and Y(a, b) coordinates. + g2UncompressedSize: curve.G2ByteSize, - // nolint:gochecknoglobals - // Number of bytes in G1 X coordinate. - g1CompressedSize = curve.CompressedG1ByteSize + // Number of bytes in scalar uncompressed form. + frUncompressedSize: curve.ScalarByteSize, + } +} - // nolint:gochecknoglobals - // Number of bytes in G1 X and Y coordinates. - g1UncompressedSize = curve.G1ByteSize +type bbsLib struct { + curve *math.Curve + bls12381SignatureLen int + bls12381G2PublicKeyLen int + g1CompressedSize int + g1UncompressedSize int + g2UncompressedSize int + frUncompressedSize int +} - // nolint:gochecknoglobals - // Number of bytes in G2 X(a, b) and Y(a, b) coordinates. - g2UncompressedSize = curve.G2ByteSize +// BBSG2Pub defines BBS+ signature scheme where public key is a point in the field of G2. +// BBS+ signature scheme (as defined in https://eprint.iacr.org/2016/663.pdf, section 4.3). +type BBSG2Pub struct { + curve *math.Curve + lib *bbsLib +} - // nolint:gochecknoglobals - // Number of bytes in scalar uncompressed form. - frUncompressedSize = curve.ScalarByteSize -) +// New creates a new BBSG2Pub. +func New(curve *math.Curve) *BBSG2Pub { + return &BBSG2Pub{ + curve: curve, + lib: NewBBSLib(curve), + } +} + +// Number of bytes in scalar compressed form. +const frCompressedSize = 32 // Verify makes BLS BBS12-381 signature verification. func (bbs *BBSG2Pub) Verify(messages [][]byte, sigBytes, pubKeyBytes []byte) error { - signature, err := ParseSignature(sigBytes) + signature, err := bbs.lib.ParseSignature(sigBytes) if err != nil { return fmt.Errorf("parse signature: %w", err) } - pubKey, err := UnmarshalPublicKey(pubKeyBytes) + pubKey, err := bbs.lib.UnmarshalPublicKey(pubKeyBytes) if err != nil { return fmt.Errorf("parse public key: %w", err) } @@ -82,14 +93,14 @@ func (bbs *BBSG2Pub) Verify(messages [][]byte, sigBytes, pubKeyBytes []byte) err return fmt.Errorf("build generators from public key: %w", err) } - messagesFr := messagesToFr(messages) + messagesFr := messagesToFr(messages, bbs.curve) return signature.Verify(messagesFr, publicKeyWithGenerators) } // Sign signs the one or more messages using private key in compressed form. func (bbs *BBSG2Pub) Sign(messages [][]byte, privKeyBytes []byte) ([]byte, error) { - privKey, err := UnmarshalPrivateKey(privKeyBytes) + privKey, err := bbs.lib.UnmarshalPrivateKey(privKeyBytes) if err != nil { return nil, fmt.Errorf("unmarshal private key: %w", err) } @@ -104,7 +115,7 @@ func (bbs *BBSG2Pub) Sign(messages [][]byte, privKeyBytes []byte) ([]byte, error // VerifyProof verifies BBS+ signature proof for one ore more revealed messages. func (bbs *BBSG2Pub) VerifyProof(messagesBytes [][]byte, proof, nonce, pubKeyBytes []byte) error { - messages := messagesToFr(messagesBytes) + messages := messagesToFr(messagesBytes, bbs.curve) return bbs.VerifyProofFr(messages, proof, nonce, pubKeyBytes) } @@ -116,12 +127,12 @@ func (bbs *BBSG2Pub) VerifyProofFr(messages []*SignatureMessage, proof, nonce, p return fmt.Errorf("parse signature proof: %w", err) } - signatureProof, err := ParseSignatureProof(proof[payload.LenInBytes():]) + signatureProof, err := bbs.lib.ParseSignatureProof(proof[payload.LenInBytes():]) if err != nil { return fmt.Errorf("parse signature proof: %w", err) } - pubKey, err := UnmarshalPublicKey(pubKeyBytes) + pubKey, err := bbs.lib.UnmarshalPublicKey(pubKeyBytes) if err != nil { return fmt.Errorf("parse public key: %w", err) } @@ -141,10 +152,10 @@ func (bbs *BBSG2Pub) VerifyProofFr(messages []*SignatureMessage, proof, nonce, p } challengeBytes := signatureProof.GetBytesForChallenge(revealedMessages, publicKeyWithGenerators) - proofNonce := ParseProofNonce(nonce) + proofNonce := ParseProofNonce(nonce, bbs.curve) proofNonceBytes := proofNonce.ToBytes() challengeBytes = append(challengeBytes, proofNonceBytes...) - proofChallenge := FrFromOKM(challengeBytes) + proofChallenge := FrFromOKM(challengeBytes, bbs.curve) return signatureProof.Verify(proofChallenge, publicKeyWithGenerators, revealedMessages, messages) } @@ -153,7 +164,7 @@ func (bbs *BBSG2Pub) VerifyProofFr(messages []*SignatureMessage, proof, nonce, p func (bbs *BBSG2Pub) DeriveProof(messages [][]byte, sigBytes, nonce, pubKeyBytes []byte, revealedIndexes []int) ([]byte, error) { - return bbs.DeriveProofZr(messagesToFr(messages), sigBytes, nonce, pubKeyBytes, revealedIndexes) + return bbs.DeriveProofZr(messagesToFr(messages, bbs.curve), sigBytes, nonce, pubKeyBytes, revealedIndexes) } // DeriveProof derives a proof of BBS+ signature with some messages disclosed. @@ -168,7 +179,7 @@ func (bbs *BBSG2Pub) DeriveProofZr(messagesFr []*SignatureMessage, sigBytes, non messagesCount := len(messagesFr) - pubKey, err := UnmarshalPublicKey(pubKeyBytes) + pubKey, err := bbs.lib.UnmarshalPublicKey(pubKeyBytes) if err != nil { return nil, fmt.Errorf("parse public key: %w", err) } @@ -178,23 +189,23 @@ func (bbs *BBSG2Pub) DeriveProofZr(messagesFr []*SignatureMessage, sigBytes, non return nil, fmt.Errorf("build generators from public key: %w", err) } - signature, err := ParseSignature(sigBytes) + signature, err := bbs.lib.ParseSignature(sigBytes) if err != nil { return nil, fmt.Errorf("parse signature: %w", err) } - pokSignature, err := NewPoKOfSignature(signature, messagesFr, revealedIndexes, publicKeyWithGenerators) + pokSignature, err := bbs.lib.NewPoKOfSignature(signature, messagesFr, revealedIndexes, publicKeyWithGenerators) if err != nil { return nil, fmt.Errorf("init proof of knowledge signature: %w", err) } challengeBytes := pokSignature.ToBytes() - proofNonce := ParseProofNonce(nonce) + proofNonce := ParseProofNonce(nonce, bbs.curve) proofNonceBytes := proofNonce.ToBytes() challengeBytes = append(challengeBytes, proofNonceBytes...) - proofChallenge := FrFromOKM(challengeBytes) + proofChallenge := FrFromOKM(challengeBytes, bbs.curve) proof := pokSignature.GenerateProof(proofChallenge) @@ -211,7 +222,7 @@ func (bbs *BBSG2Pub) DeriveProofZr(messagesFr []*SignatureMessage, sigBytes, non } // SignWithKey signs the one or more messages using BBS+ key pair. -func (bbs *BBSG2Pub) SignWithKey(messages [][]byte, commitment *ml.G1, privKey *PrivateKey) ([]byte, error) { +func (bbs *BBSG2Pub) SignWithKey(messages [][]byte, commitment *math.G1, privKey *PrivateKey) ([]byte, error) { messagesFr := make([]*SignatureMessage, 0, len(messages)) @@ -220,14 +231,14 @@ func (bbs *BBSG2Pub) SignWithKey(messages [][]byte, commitment *ml.G1, privKey * continue } - messagesFr = append(messagesFr, ParseSignatureMessage(messages[i], i)) + messagesFr = append(messagesFr, ParseSignatureMessage(messages[i], i, bbs.curve)) } return bbs.SignWithKeyFr(messagesFr, len(messages), commitment, privKey) } // SignWithKey signs the one or more messages using BBS+ key pair. -func (bbs *BBSG2Pub) SignWithKeyFr(messagesFr []*SignatureMessage, messagesCount int, commitment *ml.G1, privKey *PrivateKey) ([]byte, error) { +func (bbs *BBSG2Pub) SignWithKeyFr(messagesFr []*SignatureMessage, messagesCount int, commitment *math.G1, privKey *PrivateKey) ([]byte, error) { var err error pubKey := privKey.PublicKey() @@ -237,12 +248,12 @@ func (bbs *BBSG2Pub) SignWithKeyFr(messagesFr []*SignatureMessage, messagesCount return nil, fmt.Errorf("build generators from public key: %w", err) } - e, s := createRandSignatureFr(), createRandSignatureFr() + e, s := bbs.lib.createRandSignatureFr(), bbs.lib.createRandSignatureFr() exp := privKey.FR.Copy() exp = exp.Plus(e) - exp.InvModP(curve.GroupOrder) + exp.InvModP(bbs.curve.GroupOrder) - b := computeB(s, messagesFr, pubKeyWithGenerators) + b := computeB(s, messagesFr, pubKeyWithGenerators, bbs.curve) if len(messagesFr) != messagesCount { b.Add(commitment) } @@ -250,15 +261,16 @@ func (bbs *BBSG2Pub) SignWithKeyFr(messagesFr []*SignatureMessage, messagesCount sig := b.Mul(frToRepr(exp)) signature := &Signature{ - A: sig, - E: e, - S: s, + A: sig, + E: e, + S: s, + curve: bbs.curve, } return signature.ToBytes() } -func computeB(s *ml.Zr, messages []*SignatureMessage, key *PublicKeyWithGenerators) *ml.G1 { +func computeB(s *math.Zr, messages []*SignatureMessage, key *PublicKeyWithGenerators, curve *math.Curve) *math.G1 { const basesOffset = 2 cb := NewCommitmentBuilder(len(messages) + basesOffset) @@ -274,28 +286,28 @@ func computeB(s *ml.Zr, messages []*SignatureMessage, key *PublicKeyWithGenerato } type commitmentBuilder struct { - bases []*ml.G1 - scalars []*ml.Zr + bases []*math.G1 + scalars []*math.Zr } func NewCommitmentBuilder(expectedSize int) *commitmentBuilder { return &commitmentBuilder{ - bases: make([]*ml.G1, 0, expectedSize), - scalars: make([]*ml.Zr, 0, expectedSize), + bases: make([]*math.G1, 0, expectedSize), + scalars: make([]*math.Zr, 0, expectedSize), } } -func (cb *commitmentBuilder) Add(base *ml.G1, scalar *ml.Zr) { +func (cb *commitmentBuilder) Add(base *math.G1, scalar *math.Zr) { cb.bases = append(cb.bases, base) cb.scalars = append(cb.scalars, scalar) } -func (cb *commitmentBuilder) Build() *ml.G1 { +func (cb *commitmentBuilder) Build() *math.G1 { return sumOfG1Products(cb.bases, cb.scalars) } -func sumOfG1Products(bases []*ml.G1, scalars []*ml.Zr) *ml.G1 { - var res *ml.G1 +func sumOfG1Products(bases []*math.G1, scalars []*math.Zr) *math.G1 { + var res *math.G1 for i := 0; i < len(bases); i++ { b := bases[i] @@ -312,8 +324,8 @@ func sumOfG1Products(bases []*ml.G1, scalars []*ml.Zr) *ml.G1 { return res } -func compareTwoPairings(p1 *ml.G1, q1 *ml.G2, - p2 *ml.G1, q2 *ml.G2) bool { +func compareTwoPairings(p1 *math.G1, q1 *math.G2, + p2 *math.G1, q2 *math.G2, curve *math.Curve) bool { p := curve.Pairing2(q1, p1, q2, p2) p = curve.FExp(p) @@ -322,13 +334,13 @@ func compareTwoPairings(p1 *ml.G1, q1 *ml.G2, // ProofNonce is a nonce for Proof of Knowledge proof. type ProofNonce struct { - fr *ml.Zr + fr *math.Zr } // ParseProofNonce creates a new ProofNonce from bytes. -func ParseProofNonce(proofNonceBytes []byte) *ProofNonce { +func ParseProofNonce(proofNonceBytes []byte, curve *math.Curve) *ProofNonce { return &ProofNonce{ - FrFromOKM(proofNonceBytes), + FrFromOKM(proofNonceBytes, curve), } } diff --git a/vendor/github.com/ale-linux/aries-framework-go/component/kmscrypto/crypto/primitive/bbs12381g2pub/fr.go b/vendor/github.com/ale-linux/aries-framework-go/component/kmscrypto/crypto/primitive/bbs12381g2pub/fr.go index c43a2a36672..811161b62f5 100644 --- a/vendor/github.com/ale-linux/aries-framework-go/component/kmscrypto/crypto/primitive/bbs12381g2pub/fr.go +++ b/vendor/github.com/ale-linux/aries-framework-go/component/kmscrypto/crypto/primitive/bbs12381g2pub/fr.go @@ -9,12 +9,13 @@ package bbs12381g2pub import ( "crypto/rand" + math "github.com/IBM/mathlib" ml "github.com/IBM/mathlib" "golang.org/x/crypto/blake2b" ) -func parseFr(data []byte) *ml.Zr { - return curve.NewZrFromBytes(data) +func (b *bbsLib) parseFr(data []byte) *ml.Zr { + return b.curve.NewZrFromBytes(data) } // nolint:gochecknoglobals @@ -25,11 +26,11 @@ var f2192Bytes = []byte{ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, } -func f2192() *ml.Zr { +func f2192(curve *math.Curve) *ml.Zr { return curve.NewZrFromBytes(f2192Bytes) } -func FrFromOKM(message []byte) *ml.Zr { +func FrFromOKM(message []byte, curve *math.Curve) *ml.Zr { const ( eightBytes = 8 okmMiddle = 24 @@ -44,7 +45,7 @@ func FrFromOKM(message []byte) *ml.Zr { emptyEightBytes := make([]byte, eightBytes) elm := curve.NewZrFromBytes(append(emptyEightBytes, okm[:okmMiddle]...)) - elm = elm.Mul(f2192()) + elm = elm.Mul(f2192(curve)) fr := curve.NewZrFromBytes(append(emptyEightBytes, okm[okmMiddle:]...)) elm = elm.Plus(fr) @@ -56,16 +57,16 @@ func frToRepr(fr *ml.Zr) *ml.Zr { return fr.Copy() } -func messagesToFr(messages [][]byte) []*SignatureMessage { +func messagesToFr(messages [][]byte, curve *math.Curve) []*SignatureMessage { messagesFr := make([]*SignatureMessage, len(messages)) for i := range messages { - messagesFr[i] = ParseSignatureMessage(messages[i], i) + messagesFr[i] = ParseSignatureMessage(messages[i], i, curve) } return messagesFr } -func createRandSignatureFr() *ml.Zr { - return curve.NewRandomZr(rand.Reader) +func (b *bbsLib) createRandSignatureFr() *ml.Zr { + return b.curve.NewRandomZr(rand.Reader) } diff --git a/vendor/github.com/ale-linux/aries-framework-go/component/kmscrypto/crypto/primitive/bbs12381g2pub/keys.go b/vendor/github.com/ale-linux/aries-framework-go/component/kmscrypto/crypto/primitive/bbs12381g2pub/keys.go index dd6da5bd6d5..65a286bb213 100644 --- a/vendor/github.com/ale-linux/aries-framework-go/component/kmscrypto/crypto/primitive/bbs12381g2pub/keys.go +++ b/vendor/github.com/ale-linux/aries-framework-go/component/kmscrypto/crypto/primitive/bbs12381g2pub/keys.go @@ -13,6 +13,7 @@ import ( "hash" "io" + math "github.com/IBM/mathlib" ml "github.com/IBM/mathlib" "golang.org/x/crypto/hkdf" ) @@ -27,12 +28,14 @@ var ( // PublicKey defines BLS Public Key. type PublicKey struct { + curve *math.Curve PointG2 *ml.G2 } // PrivateKey defines BLS Public Key. type PrivateKey struct { - FR *ml.Zr + FR *ml.Zr + curve *math.Curve } // PublicKeyWithGenerators extends PublicKey with a blinding generator h0, a commitment to the secret key w, @@ -48,11 +51,11 @@ type PublicKeyWithGenerators struct { // ToPublicKeyWithGenerators creates PublicKeyWithGenerators from the PublicKey. func (pk *PublicKey) ToPublicKeyWithGenerators(messagesCount int) (*PublicKeyWithGenerators, error) { - offset := g2UncompressedSize + 1 + offset := pk.curve.G2ByteSize + 1 data := calcData(pk, messagesCount) - h0 := hashToG1(data) + h0 := hashToG1(data, pk.curve) h := make([]*ml.G1, messagesCount) @@ -66,7 +69,7 @@ func (pk *PublicKey) ToPublicKeyWithGenerators(messagesCount int) (*PublicKeyWit dataCopy[j+offset] = iBytes[j] } - h[i-1] = hashToG1(dataCopy) + h[i-1] = hashToG1(dataCopy, pk.curve) } return &PublicKeyWithGenerators{ @@ -89,22 +92,23 @@ func calcData(key *PublicKey, messagesCount int) []byte { return data } -func hashToG1(data []byte) *ml.G1 { +func hashToG1(data []byte, curve *math.Curve) *ml.G1 { var dstG1 = []byte("BLS12381G1_XMD:BLAKE2B_SSWU_RO_BBS+_SIGNATURES:1_0_0") return curve.HashToG1WithDomain(data, dstG1) } // UnmarshalPrivateKey unmarshals PrivateKey. -func UnmarshalPrivateKey(privKeyBytes []byte) (*PrivateKey, error) { +func (b *bbsLib) UnmarshalPrivateKey(privKeyBytes []byte) (*PrivateKey, error) { if len(privKeyBytes) != frCompressedSize { return nil, errors.New("invalid size of private key") } - fr := parseFr(privKeyBytes) + fr := b.parseFr(privKeyBytes) return &PrivateKey{ - FR: fr, + FR: fr, + curve: b.curve, }, nil } @@ -116,24 +120,28 @@ func (k *PrivateKey) Marshal() ([]byte, error) { // PublicKey returns a Public Key as G2 point generated from the Private Key. func (k *PrivateKey) PublicKey() *PublicKey { - pointG2 := curve.GenG2.Mul(frToRepr(k.FR)) + pointG2 := k.curve.GenG2.Mul(frToRepr(k.FR)) - return &PublicKey{pointG2} + return &PublicKey{ + curve: k.curve, + PointG2: pointG2, + } } // UnmarshalPublicKey parses a PublicKey from bytes. -func UnmarshalPublicKey(pubKeyBytes []byte) (*PublicKey, error) { - if len(pubKeyBytes) != bls12381G2PublicKeyLen { +func (b *bbsLib) UnmarshalPublicKey(pubKeyBytes []byte) (*PublicKey, error) { + if len(pubKeyBytes) != b.bls12381G2PublicKeyLen { return nil, errors.New("invalid size of public key") } - pointG2, err := curve.NewG2FromCompressed(pubKeyBytes) + pointG2, err := b.curve.NewG2FromCompressed(pubKeyBytes) if err != nil { return nil, fmt.Errorf("deserialize public key: %w", err) } return &PublicKey{ PointG2: pointG2, + curve: b.curve, }, nil } @@ -145,25 +153,28 @@ func (pk *PublicKey) Marshal() ([]byte, error) { } // GenerateKeyPair generates BBS+ PublicKey and PrivateKey pair. -func GenerateKeyPair(h func() hash.Hash, seed []byte) (*PublicKey, *PrivateKey, error) { +func (b *bbsLib) GenerateKeyPair(h func() hash.Hash, seed []byte) (*PublicKey, *PrivateKey, error) { if len(seed) != 0 && len(seed) != seedSize { return nil, nil, errors.New("invalid size of seed") } - okm, err := generateOKM(seed, h) + okm, err := generateOKM(seed, h, b.curve) if err != nil { return nil, nil, err } - privKeyFr := FrFromOKM(okm) + privKeyFr := FrFromOKM(okm, b.curve) - privKey := &PrivateKey{privKeyFr} + privKey := &PrivateKey{ + FR: privKeyFr, + curve: b.curve, + } pubKey := privKey.PublicKey() return pubKey, privKey, nil } -func generateOKM(ikm []byte, h func() hash.Hash) ([]byte, error) { +func generateOKM(ikm []byte, h func() hash.Hash, curve *math.Curve) ([]byte, error) { salt := []byte(generateKeySalt) info := make([]byte, 2) @@ -180,7 +191,7 @@ func generateOKM(ikm []byte, h func() hash.Hash) ([]byte, error) { ikm[seedSize] = 0 } - return newHKDF(h, ikm, salt, info, frUncompressedSize) + return newHKDF(h, ikm, salt, info, curve.ScalarByteSize) } func newHKDF(h func() hash.Hash, ikm, salt, info []byte, length int) ([]byte, error) { diff --git a/vendor/github.com/ale-linux/aries-framework-go/component/kmscrypto/crypto/primitive/bbs12381g2pub/proof_of_knowledge.go b/vendor/github.com/ale-linux/aries-framework-go/component/kmscrypto/crypto/primitive/bbs12381g2pub/proof_of_knowledge.go index eb29f44e08d..cc1b36fae25 100644 --- a/vendor/github.com/ale-linux/aries-framework-go/component/kmscrypto/crypto/primitive/bbs12381g2pub/proof_of_knowledge.go +++ b/vendor/github.com/ale-linux/aries-framework-go/component/kmscrypto/crypto/primitive/bbs12381g2pub/proof_of_knowledge.go @@ -9,6 +9,7 @@ package bbs12381g2pub import ( "fmt" + math "github.com/IBM/mathlib" ml "github.com/IBM/mathlib" ) @@ -25,18 +26,40 @@ type PoKOfSignature struct { secrets2 []*ml.Zr revealedMessages map[int]*SignatureMessage + + curve *math.Curve } // NewPoKOfSignature creates a new PoKOfSignature. -func NewPoKOfSignature(signature *Signature, messages []*SignatureMessage, revealedIndexes []int, - pubKey *PublicKeyWithGenerators) (*PoKOfSignature, error) { - err := signature.Verify(messages, pubKey) - if err != nil { - return nil, fmt.Errorf("verify input signature: %w", err) - } +func (bl *bbsLib) NewPoKOfSignature( + signature *Signature, + messages []*SignatureMessage, + revealedIndexes []int, + pubKey *PublicKeyWithGenerators, +) (*PoKOfSignature, error) { + return bl.NewPoKOfSignatureExt(signature, messages, revealedIndexes, pubKey, nil, nil, nil) +} - r1, r2 := createRandSignatureFr(), createRandSignatureFr() - b := computeB(signature.S, messages, pubKey) +// NewPoKOfSignatureExt creates a new PoKOfSignature. +func (bl *bbsLib) NewPoKOfSignatureExt( + signature *Signature, + messages []*SignatureMessage, + revealedIndexes []int, + pubKey *PublicKeyWithGenerators, + B *ml.G1, // this is assumed to be H0^r H[0]^sk + r *ml.Zr, + C *ml.G1, // this is assumed to be H[0]^sk +) (*PoKOfSignature, error) { + // err := signature.Verify(messages, pubKey) + // if err != nil { + // return nil, fmt.Errorf("verify input signature: %w", err) + // } + + r1, r2 := bl.createRandSignatureFr(), bl.createRandSignatureFr() + b := computeB(signature.S, messages, pubKey, bl.curve) + if B != nil { + b.Add(C) + } aPrime := signature.A.Mul(frToRepr(r1)) aBarDenom := aPrime.Mul(frToRepr(signature.E)) @@ -54,13 +77,13 @@ func NewPoKOfSignature(signature *Signature, messages []*SignatureMessage, revea d := cb.Build() r3 := r1.Copy() - r3.InvModP(curve.GroupOrder) + r3.InvModP(bl.curve.GroupOrder) sPrime := r2.Mul(r3) sPrime.Neg() sPrime = sPrime.Plus(signature.S) - pokVC1, secrets1 := newVC1Signature(aPrime, pubKey.H0, signature.E, r2) + pokVC1, secrets1 := bl.newVC1Signature(aPrime, pubKey.H0, signature.E, r2) revealedMessages := make(map[int]*SignatureMessage, len(revealedIndexes)) @@ -70,10 +93,15 @@ func NewPoKOfSignature(signature *Signature, messages []*SignatureMessage, revea } for _, ind := range revealedIndexes { - revealedMessages[ind] = messages[ind] + revealedMessages[messages[ind].Idx] = messages[ind] + } + + if B != nil { + sPrime = sPrime.Minus(r) + // messages = messages[1:] } - pokVC2, secrets2 := newVC2Signature(d, r3, pubKey, sPrime, messages, revealedMessages) + pokVC2, secrets2 := bl.newVC2Signature(d, r3, pubKey, sPrime, messages, revealedMessages) return &PoKOfSignature{ aPrime: aPrime, @@ -84,12 +112,13 @@ func NewPoKOfSignature(signature *Signature, messages []*SignatureMessage, revea PokVC2: pokVC2, secrets2: secrets2, revealedMessages: revealedMessages, + curve: bl.curve, }, nil } -func newVC1Signature(aPrime *ml.G1, h0 *ml.G1, +func (b *bbsLib) newVC1Signature(aPrime *ml.G1, h0 *ml.G1, e, r2 *ml.Zr) (*ProverCommittedG1, []*ml.Zr) { - committing1 := NewProverCommittingG1() + committing1 := b.NewProverCommittingG1() secrets1 := make([]*ml.Zr, 2) committing1.Commit(aPrime) @@ -106,10 +135,10 @@ func newVC1Signature(aPrime *ml.G1, h0 *ml.G1, return pokVC1, secrets1 } -func newVC2Signature(d *ml.G1, r3 *ml.Zr, pubKey *PublicKeyWithGenerators, sPrime *ml.Zr, +func (b *bbsLib) newVC2Signature(d *ml.G1, r3 *ml.Zr, pubKey *PublicKeyWithGenerators, sPrime *ml.Zr, messages []*SignatureMessage, revealedMessages map[int]*SignatureMessage) (*ProverCommittedG1, []*ml.Zr) { messagesCount := len(messages) - committing2 := NewProverCommittingG1() + committing2 := b.NewProverCommittingG1() baseSecretsCount := 2 secrets2 := make([]*ml.Zr, 0, baseSecretsCount+messagesCount) @@ -124,14 +153,14 @@ func newVC2Signature(d *ml.G1, r3 *ml.Zr, pubKey *PublicKeyWithGenerators, sPrim secrets2 = append(secrets2, sPrime) - for i := 0; i < messagesCount; i++ { - if _, ok := revealedMessages[i]; ok { + for _, msg := range messages { + if _, ok := revealedMessages[msg.Idx]; ok { continue } - committing2.Commit(pubKey.H[i]) + committing2.Commit(pubKey.H[msg.Idx]) - sourceFR := messages[i].FR + sourceFR := msg.FR hiddenFRCopy := sourceFR.Copy() secrets2 = append(secrets2, hiddenFRCopy) @@ -159,6 +188,7 @@ func (pos *PoKOfSignature) GenerateProof(challengeHash *ml.Zr) *PoKOfSignaturePr d: pos.d, proofVC1: pos.pokVC1.GenerateProof(challengeHash, pos.secrets1), ProofVC2: pos.PokVC2.GenerateProof(challengeHash, pos.secrets2), + curve: pos.curve, } } @@ -201,20 +231,22 @@ func (g *ProverCommittedG1) GenerateProof(challenge *ml.Zr, secrets []*ml.Zr) *P type ProverCommittingG1 struct { bases []*ml.G1 BlindingFactors []*ml.Zr + b *bbsLib } // NewProverCommittingG1 creates a new ProverCommittingG1. -func NewProverCommittingG1() *ProverCommittingG1 { +func (bl *bbsLib) NewProverCommittingG1() *ProverCommittingG1 { return &ProverCommittingG1{ bases: make([]*ml.G1, 0), BlindingFactors: make([]*ml.Zr, 0), + b: bl, } } // Commit append a base point and randomly generated blinding factor. func (pc *ProverCommittingG1) Commit(base *ml.G1) { pc.bases = append(pc.bases, base) - r := createRandSignatureFr() + r := pc.b.createRandSignatureFr() pc.BlindingFactors = append(pc.BlindingFactors, r) } diff --git a/vendor/github.com/ale-linux/aries-framework-go/component/kmscrypto/crypto/primitive/bbs12381g2pub/signature.go b/vendor/github.com/ale-linux/aries-framework-go/component/kmscrypto/crypto/primitive/bbs12381g2pub/signature.go index 3491e48e424..0a1bd741b8d 100644 --- a/vendor/github.com/ale-linux/aries-framework-go/component/kmscrypto/crypto/primitive/bbs12381g2pub/signature.go +++ b/vendor/github.com/ale-linux/aries-framework-go/component/kmscrypto/crypto/primitive/bbs12381g2pub/signature.go @@ -10,44 +10,47 @@ import ( "errors" "fmt" + math "github.com/IBM/mathlib" ml "github.com/IBM/mathlib" ) // Signature defines BLS signature. type Signature struct { - A *ml.G1 - E *ml.Zr - S *ml.Zr + A *ml.G1 + E *ml.Zr + S *ml.Zr + curve *math.Curve } // ParseSignature parses a Signature from bytes. -func ParseSignature(sigBytes []byte) (*Signature, error) { - if len(sigBytes) != bls12381SignatureLen { +func (b *bbsLib) ParseSignature(sigBytes []byte) (*Signature, error) { + if len(sigBytes) != b.bls12381SignatureLen { return nil, errors.New("invalid size of signature") } - pointG1, err := curve.NewG1FromCompressed(sigBytes[:g1CompressedSize]) + pointG1, err := b.curve.NewG1FromCompressed(sigBytes[:b.g1CompressedSize]) if err != nil { return nil, fmt.Errorf("deserialize G1 compressed signature: %w", err) } - e := parseFr(sigBytes[g1CompressedSize : g1CompressedSize+frCompressedSize]) - s := parseFr(sigBytes[g1CompressedSize+frCompressedSize:]) + e := b.parseFr(sigBytes[b.g1CompressedSize : b.g1CompressedSize+frCompressedSize]) + s := b.parseFr(sigBytes[b.g1CompressedSize+frCompressedSize:]) return &Signature{ - A: pointG1, - E: e, - S: s, + A: pointG1, + E: e, + S: s, + curve: b.curve, }, nil } // ToBytes converts signature to bytes using compression of G1 point and E, S FR points. func (s *Signature) ToBytes() ([]byte, error) { - bytes := make([]byte, bls12381SignatureLen) + bytes := make([]byte, s.curve.CompressedG1ByteSize+2*frCompressedSize) copy(bytes, s.A.Compressed()) - copy(bytes[g1CompressedSize:g1CompressedSize+frCompressedSize], s.E.Bytes()) - copy(bytes[g1CompressedSize+frCompressedSize:], s.S.Bytes()) + copy(bytes[s.curve.CompressedG1ByteSize:s.curve.CompressedG1ByteSize+frCompressedSize], s.E.Bytes()) + copy(bytes[s.curve.CompressedG1ByteSize+frCompressedSize:], s.S.Bytes()) return bytes, nil } @@ -56,13 +59,13 @@ func (s *Signature) ToBytes() ([]byte, error) { func (s *Signature) Verify(messages []*SignatureMessage, pubKey *PublicKeyWithGenerators) error { p1 := s.A - q1 := curve.GenG2.Mul(frToRepr(s.E)) + q1 := s.curve.GenG2.Mul(frToRepr(s.E)) q1.Add(pubKey.w) - p2 := computeB(s.S, messages, pubKey) + p2 := computeB(s.S, messages, pubKey, s.curve) p2.Neg() - if compareTwoPairings(p1, q1, p2, curve.GenG2) { + if compareTwoPairings(p1, q1, p2, s.curve.GenG2, s.curve) { return nil } diff --git a/vendor/github.com/ale-linux/aries-framework-go/component/kmscrypto/crypto/primitive/bbs12381g2pub/signature_message.go b/vendor/github.com/ale-linux/aries-framework-go/component/kmscrypto/crypto/primitive/bbs12381g2pub/signature_message.go index ec8d9cd196c..8b4bf85cdb6 100644 --- a/vendor/github.com/ale-linux/aries-framework-go/component/kmscrypto/crypto/primitive/bbs12381g2pub/signature_message.go +++ b/vendor/github.com/ale-linux/aries-framework-go/component/kmscrypto/crypto/primitive/bbs12381g2pub/signature_message.go @@ -7,6 +7,7 @@ SPDX-License-Identifier: Apache-2.0 package bbs12381g2pub import ( + math "github.com/IBM/mathlib" ml "github.com/IBM/mathlib" ) @@ -17,8 +18,8 @@ type SignatureMessage struct { } // ParseSignatureMessage parses SignatureMessage from bytes. -func ParseSignatureMessage(message []byte, idx int) *SignatureMessage { - elm := FrFromOKM(message) +func ParseSignatureMessage(message []byte, idx int, curve *math.Curve) *SignatureMessage { + elm := FrFromOKM(message, curve) return &SignatureMessage{ FR: elm, diff --git a/vendor/github.com/ale-linux/aries-framework-go/component/kmscrypto/crypto/primitive/bbs12381g2pub/signature_proof.go b/vendor/github.com/ale-linux/aries-framework-go/component/kmscrypto/crypto/primitive/bbs12381g2pub/signature_proof.go index 3a13079ef95..dccf7b837b0 100644 --- a/vendor/github.com/ale-linux/aries-framework-go/component/kmscrypto/crypto/primitive/bbs12381g2pub/signature_proof.go +++ b/vendor/github.com/ale-linux/aries-framework-go/component/kmscrypto/crypto/primitive/bbs12381g2pub/signature_proof.go @@ -11,6 +11,7 @@ import ( "errors" "fmt" + math "github.com/IBM/mathlib" ml "github.com/IBM/mathlib" ) @@ -23,6 +24,8 @@ type PoKOfSignatureProof struct { proofVC1 *ProofG1 ProofVC2 *ProofG1 + + curve *math.Curve } // GetBytesForChallenge creates bytes for proof challenge. @@ -30,7 +33,7 @@ func (sp *PoKOfSignatureProof) GetBytesForChallenge(revealedMessages map[int]*Si pubKey *PublicKeyWithGenerators) []byte { hiddenCount := pubKey.messagesCount - len(revealedMessages) - bytesLen := (7 + hiddenCount) * g1UncompressedSize //nolint:gomnd + bytesLen := (7 + hiddenCount) * sp.curve.CompressedG1ByteSize //nolint:gomnd bytes := make([]byte, 0, bytesLen) bytes = append(bytes, sp.aBar.Bytes()...) @@ -54,10 +57,21 @@ func (sp *PoKOfSignatureProof) GetBytesForChallenge(revealedMessages map[int]*Si // Verify verifies PoKOfSignatureProof. func (sp *PoKOfSignatureProof) Verify(challenge *ml.Zr, pubKey *PublicKeyWithGenerators, revealedMessages map[int]*SignatureMessage, messages []*SignatureMessage) error { + return sp.VerifyExt(challenge, pubKey, revealedMessages, messages, nil) +} + +// VerifyExt verifies PoKOfSignatureProof. +func (sp *PoKOfSignatureProof) VerifyExt( + challenge *ml.Zr, + pubKey *PublicKeyWithGenerators, + revealedMessages map[int]*SignatureMessage, + messages []*SignatureMessage, + B *math.G1, +) error { aBar := sp.aBar.Copy() aBar.Neg() - ok := compareTwoPairings(sp.aPrime, pubKey.w, aBar, curve.GenG2) + ok := compareTwoPairings(sp.aPrime, pubKey.w, aBar, sp.curve.GenG2, sp.curve) if !ok { return errors.New("bad signature") } @@ -67,7 +81,7 @@ func (sp *PoKOfSignatureProof) Verify(challenge *ml.Zr, pubKey *PublicKeyWithGen return err } - return sp.verifyVC2Proof(challenge, pubKey, revealedMessages, messages) + return sp.verifyVC2Proof(challenge, pubKey, revealedMessages, messages, B) } func (sp *PoKOfSignatureProof) verifyVC1Proof(challenge *ml.Zr, pubKey *PublicKeyWithGenerators) error { @@ -84,7 +98,7 @@ func (sp *PoKOfSignatureProof) verifyVC1Proof(challenge *ml.Zr, pubKey *PublicKe } func (sp *PoKOfSignatureProof) verifyVC2Proof(challenge *ml.Zr, pubKey *PublicKeyWithGenerators, - revealedMessages map[int]*SignatureMessage, messages []*SignatureMessage) error { + revealedMessages map[int]*SignatureMessage, messages []*SignatureMessage, B *math.G1) error { revealedMessagesCount := len(revealedMessages) basesVC2 := make([]*ml.G1, 0, 2+pubKey.messagesCount-revealedMessagesCount) @@ -93,12 +107,16 @@ func (sp *PoKOfSignatureProof) verifyVC2Proof(challenge *ml.Zr, pubKey *PublicKe basesDisclosed := make([]*ml.G1, 0, 1+revealedMessagesCount) exponents := make([]*ml.Zr, 0, 1+revealedMessagesCount) - basesDisclosed = append(basesDisclosed, curve.GenG1) - exponents = append(exponents, curve.NewZrFromInt(1)) + basesDisclosed = append(basesDisclosed, sp.curve.GenG1) + exponents = append(exponents, sp.curve.NewZrFromInt(1)) revealedMessagesInd := 0 for i := range pubKey.H { + if B != nil && i == 0 { + continue + } + if _, ok := revealedMessages[i]; ok { basesDisclosed = append(basesDisclosed, pubKey.H[i]) exponents = append(exponents, messages[revealedMessagesInd].FR) @@ -108,9 +126,14 @@ func (sp *PoKOfSignatureProof) verifyVC2Proof(challenge *ml.Zr, pubKey *PublicKe } } + if B != nil { + basesDisclosed = append(basesDisclosed, B) + exponents = append(exponents, sp.curve.NewZrFromInt(1)) + } + // TODO: expose 0 - pr := curve.GenG1.Copy() - pr.Sub(curve.GenG1) + pr := sp.curve.GenG1.Copy() + pr.Sub(sp.curve.GenG1) for i := 0; i < len(basesDisclosed); i++ { b := basesDisclosed[i] @@ -203,8 +226,8 @@ func (pg1 *ProofG1) ToBytes() []byte { } // ParseSignatureProof parses a signature proof. -func ParseSignatureProof(sigProofBytes []byte) (*PoKOfSignatureProof, error) { - if len(sigProofBytes) < g1CompressedSize*3 { +func (b *bbsLib) ParseSignatureProof(sigProofBytes []byte) (*PoKOfSignatureProof, error) { + if len(sigProofBytes) < b.g1CompressedSize*3 { return nil, errors.New("invalid size of signature proof") } @@ -212,26 +235,26 @@ func ParseSignatureProof(sigProofBytes []byte) (*PoKOfSignatureProof, error) { offset := 0 for i := range g1Points { - g1Point, err := curve.NewG1FromCompressed(sigProofBytes[offset : offset+g1CompressedSize]) + g1Point, err := b.curve.NewG1FromCompressed(sigProofBytes[offset : offset+b.g1CompressedSize]) if err != nil { return nil, fmt.Errorf("parse G1 point: %w", err) } g1Points[i] = g1Point - offset += g1CompressedSize + offset += b.g1CompressedSize } proof1BytesLen := int(uint32FromBytes(sigProofBytes[offset : offset+4])) offset += 4 - proofVc1, err := ParseProofG1(sigProofBytes[offset : offset+proof1BytesLen]) + proofVc1, err := b.ParseProofG1(sigProofBytes[offset : offset+proof1BytesLen]) if err != nil { return nil, fmt.Errorf("parse G1 proof: %w", err) } offset += proof1BytesLen - proofVc2, err := ParseProofG1(sigProofBytes[offset:]) + proofVc2, err := b.ParseProofG1(sigProofBytes[offset:]) if err != nil { return nil, fmt.Errorf("parse G1 proof: %w", err) } @@ -242,33 +265,34 @@ func ParseSignatureProof(sigProofBytes []byte) (*PoKOfSignatureProof, error) { d: g1Points[2], proofVC1: proofVc1, ProofVC2: proofVc2, + curve: b.curve, }, nil } // ParseProofG1 parses ProofG1 from bytes. -func ParseProofG1(bytes []byte) (*ProofG1, error) { - if len(bytes) < g1CompressedSize+4 { +func (b *bbsLib) ParseProofG1(bytes []byte) (*ProofG1, error) { + if len(bytes) < b.g1CompressedSize+4 { return nil, errors.New("invalid size of G1 signature proof") } offset := 0 - commitment, err := curve.NewG1FromCompressed(bytes[:g1CompressedSize]) + commitment, err := b.curve.NewG1FromCompressed(bytes[:b.g1CompressedSize]) if err != nil { return nil, fmt.Errorf("parse G1 point: %w", err) } - offset += g1CompressedSize + offset += b.g1CompressedSize length := int(uint32FromBytes(bytes[offset : offset+4])) offset += 4 - if len(bytes) < g1CompressedSize+4+length*frCompressedSize { + if len(bytes) < b.g1CompressedSize+4+length*frCompressedSize { return nil, errors.New("invalid size of G1 signature proof") } responses := make([]*ml.Zr, length) for i := 0; i < length; i++ { - responses[i] = parseFr(bytes[offset : offset+frCompressedSize]) + responses[i] = b.parseFr(bytes[offset : offset+frCompressedSize]) offset += frCompressedSize } diff --git a/vendor/github.com/alecthomas/units/README.md b/vendor/github.com/alecthomas/units/README.md index bee884e3c1c..57b458aef31 100644 --- a/vendor/github.com/alecthomas/units/README.md +++ b/vendor/github.com/alecthomas/units/README.md @@ -1,3 +1,5 @@ +[![Go Reference](https://pkg.go.dev/badge/github.com/alecthomas/units.svg)](https://pkg.go.dev/github.com/alecthomas/units) + # Units - Helpful unit multipliers and functions for Go The goal of this package is to have functionality similar to the [time](http://golang.org/pkg/time/) package. diff --git a/vendor/github.com/alecthomas/units/bytes.go b/vendor/github.com/alecthomas/units/bytes.go index f740537f03f..f13a842e4aa 100644 --- a/vendor/github.com/alecthomas/units/bytes.go +++ b/vendor/github.com/alecthomas/units/bytes.go @@ -52,9 +52,64 @@ func (b *Base2Bytes) UnmarshalText(text []byte) error { return err } -var ( - metricBytesUnitMap = MakeUnitMap("B", "B", 1000) -) +// Floor returns Base2Bytes with all but the largest unit zeroed out. So that e.g. 1GiB1MiB1KiB → 1GiB. +func (b Base2Bytes) Floor() Base2Bytes { + switch { + case b > Exbibyte: + return (b / Exbibyte) * Exbibyte + case b > Pebibyte: + return (b / Pebibyte) * Pebibyte + case b > Tebibyte: + return (b / Tebibyte) * Tebibyte + case b > Gibibyte: + return (b / Gibibyte) * Gibibyte + case b > Mebibyte: + return (b / Mebibyte) * Mebibyte + case b > Kibibyte: + return (b / Kibibyte) * Kibibyte + default: + return b + } +} + +// Round returns Base2Bytes with all but the first n units zeroed out. So that e.g. 1GiB1MiB1KiB → 1GiB1MiB, if n is 2. +func (b Base2Bytes) Round(n int) Base2Bytes { + idx := 0 + + switch { + case b > Exbibyte: + idx = n + case b > Pebibyte: + idx = n + 1 + case b > Tebibyte: + idx = n + 2 + case b > Gibibyte: + idx = n + 3 + case b > Mebibyte: + idx = n + 4 + case b > Kibibyte: + idx = n + 5 + } + + switch idx { + case 1: + return b - b%Exbibyte + case 2: + return b - b%Pebibyte + case 3: + return b - b%Tebibyte + case 4: + return b - b%Gibibyte + case 5: + return b - b%Mebibyte + case 6: + return b - b%Kibibyte + default: + return b + } +} + +var metricBytesUnitMap = MakeUnitMap("B", "B", 1000) // MetricBytes are SI byte units (1000 bytes in a kilobyte). type MetricBytes SI @@ -86,6 +141,63 @@ func (m MetricBytes) String() string { return ToString(int64(m), 1000, "B", "B") } +// Floor returns MetricBytes with all but the largest unit zeroed out. So that e.g. 1GB1MB1KB → 1GB. +func (b MetricBytes) Floor() MetricBytes { + switch { + case b > Exabyte: + return (b / Exabyte) * Exabyte + case b > Petabyte: + return (b / Petabyte) * Petabyte + case b > Terabyte: + return (b / Terabyte) * Terabyte + case b > Gigabyte: + return (b / Gigabyte) * Gigabyte + case b > Megabyte: + return (b / Megabyte) * Megabyte + case b > Kilobyte: + return (b / Kilobyte) * Kilobyte + default: + return b + } +} + +// Round returns MetricBytes with all but the first n units zeroed out. So that e.g. 1GB1MB1KB → 1GB1MB, if n is 2. +func (b MetricBytes) Round(n int) MetricBytes { + idx := 0 + + switch { + case b > Exabyte: + idx = n + case b > Petabyte: + idx = n + 1 + case b > Terabyte: + idx = n + 2 + case b > Gigabyte: + idx = n + 3 + case b > Megabyte: + idx = n + 4 + case b > Kilobyte: + idx = n + 5 + } + + switch idx { + case 1: + return b - b%Exabyte + case 2: + return b - b%Petabyte + case 3: + return b - b%Terabyte + case 4: + return b - b%Gigabyte + case 5: + return b - b%Megabyte + case 6: + return b - b%Kilobyte + default: + return b + } +} + // ParseStrictBytes supports both iB and B suffixes for base 2 and metric, // respectively. That is, KiB represents 1024 and kB, KB represent 1000. func ParseStrictBytes(s string) (int64, error) { diff --git a/vendor/github.com/alecthomas/units/renovate.json5 b/vendor/github.com/alecthomas/units/renovate.json5 new file mode 100644 index 00000000000..897864b852f --- /dev/null +++ b/vendor/github.com/alecthomas/units/renovate.json5 @@ -0,0 +1,11 @@ +{ + $schema: "https://docs.renovatebot.com/renovate-schema.json", + extends: [ + "config:recommended", + ":semanticCommits", + ":semanticCommitTypeAll(chore)", + ":semanticCommitScope(deps)", + "group:allNonMajor", + "schedule:earlyMondays", // Run once a week. + ], +} diff --git a/vendor/github.com/consensys/gnark-crypto/ecc/bls12-377/bls12-377.go b/vendor/github.com/consensys/gnark-crypto/ecc/bls12-377/bls12-377.go index 43fbe1f6c7a..4b3ea6fbc0f 100644 --- a/vendor/github.com/consensys/gnark-crypto/ecc/bls12-377/bls12-377.go +++ b/vendor/github.com/consensys/gnark-crypto/ecc/bls12-377/bls12-377.go @@ -62,7 +62,7 @@ var g1Infinity G1Jac var g2Infinity G2Jac // optimal Ate loop counter -var loopCounter [64]int8 +var LoopCounter [64]int8 // Parameters useful for the GLV scalar multiplication. The third roots define the // endomorphisms ϕ₁ and ϕ₂ for and . lambda is such that lies above @@ -134,7 +134,7 @@ func init() { endo.v.A0.SetString("216465761340224619389371505802605247630151569547285782856803747159100223055385581585702401816380679166954762214499") // binary decomposition of x₀ little endian - loopCounter = [64]int8{1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1} + LoopCounter = [64]int8{1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1} // x₀ xGen.SetString("9586122913090633729", 10) diff --git a/vendor/github.com/consensys/gnark-crypto/ecc/bls12-377/fr/generator.go b/vendor/github.com/consensys/gnark-crypto/ecc/bls12-377/fr/generator.go new file mode 100644 index 00000000000..138f039e84f --- /dev/null +++ b/vendor/github.com/consensys/gnark-crypto/ecc/bls12-377/fr/generator.go @@ -0,0 +1,47 @@ +// Copyright 2020 Consensys Software Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by consensys/gnark-crypto DO NOT EDIT + +package fr + +import ( + "fmt" + "math/big" + "math/bits" + + "github.com/consensys/gnark-crypto/ecc" +) + +// Generator returns a generator for Z/2^(log(m))Z +// or an error if m is too big (required root of unity doesn't exist) +func Generator(m uint64) (Element, error) { + x := ecc.NextPowerOfTwo(m) + + var rootOfUnity Element + + rootOfUnity.SetString("8065159656716812877374967518403273466521432693661810619979959746626482506078") + const maxOrderRoot uint64 = 47 + + // find generator for Z/2^(log(m))Z + logx := uint64(bits.TrailingZeros64(x)) + if logx > maxOrderRoot { + return Element{}, fmt.Errorf("m (%d) is too big: the required root of unity does not exist", m) + } + + expo := uint64(1 << (maxOrderRoot - logx)) + var generator Element + generator.Exp(rootOfUnity, big.NewInt(int64(expo))) // order x + return generator, nil +} diff --git a/vendor/github.com/consensys/gnark-crypto/ecc/bls12-377/g1.go b/vendor/github.com/consensys/gnark-crypto/ecc/bls12-377/g1.go index e1bc1809f45..246583da636 100644 --- a/vendor/github.com/consensys/gnark-crypto/ecc/bls12-377/g1.go +++ b/vendor/github.com/consensys/gnark-crypto/ecc/bls12-377/g1.go @@ -65,14 +65,6 @@ func (p *G1Affine) ScalarMultiplication(a *G1Affine, s *big.Int) *G1Affine { return p } -// ScalarMultiplicationAffine computes and returns p = a ⋅ s -// Takes an affine point and returns a Jacobian point (useful for KZG) -func (p *G1Jac) ScalarMultiplicationAffine(a *G1Affine, s *big.Int) *G1Jac { - p.FromAffine(a) - p.mulGLV(p, s) - return p -} - // ScalarMultiplicationBase computes and returns p = g ⋅ s where g is the prime subgroup generator func (p *G1Affine) ScalarMultiplicationBase(s *big.Int) *G1Affine { var _p G1Jac @@ -82,34 +74,65 @@ func (p *G1Affine) ScalarMultiplicationBase(s *big.Int) *G1Affine { } // Add adds two point in affine coordinates. -// This should rarely be used as it is very inefficient compared to Jacobian +// Jacobian addition with Z1=Z2=1 +// https://www.hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#addition-mmadd-2007-bl func (p *G1Affine) Add(a, b *G1Affine) *G1Affine { - var p1, p2 G1Jac - p1.FromAffine(a) - p2.FromAffine(b) - p1.AddAssign(&p2) - p.FromJacobian(&p1) - return p + var q G1Jac + // a is infinity, return b + if a.IsInfinity() { + p.Set(b) + return p + } + // b is infinity, return a + if b.IsInfinity() { + p.Set(a) + return p + } + if a.X.Equal(&b.X) { + // if b == a, we double instead + if a.Y.Equal(&b.Y) { + q.DoubleMixed(a) + return p.FromJacobian(&q) + } else { + // if b == -a, we return 0 + return p.setInfinity() + } + } + var H, HH, I, J, r, V fp.Element + H.Sub(&b.X, &a.X) + HH.Square(&H) + I.Double(&HH).Double(&I) + J.Mul(&H, &I) + r.Sub(&b.Y, &a.Y) + r.Double(&r) + V.Mul(&a.X, &I) + q.X.Square(&r). + Sub(&q.X, &J). + Sub(&q.X, &V). + Sub(&q.X, &V) + q.Y.Sub(&V, &q.X). + Mul(&q.Y, &r) + J.Mul(&a.Y, &J).Double(&J) + q.Y.Sub(&q.Y, &J) + q.Z.Double(&H) + + return p.FromJacobian(&q) } // Double doubles a point in affine coordinates. -// This should rarely be used as it is very inefficient compared to Jacobian func (p *G1Affine) Double(a *G1Affine) *G1Affine { - var p1 G1Jac - p1.FromAffine(a) - p1.Double(&p1) - p.FromJacobian(&p1) + var q G1Jac + q.FromAffine(a) + q.DoubleMixed(a) + p.FromJacobian(&q) return p } // Sub subs two point in affine coordinates. -// This should rarely be used as it is very inefficient compared to Jacobian func (p *G1Affine) Sub(a, b *G1Affine) *G1Affine { - var p1, p2 G1Jac - p1.FromAffine(a) - p2.FromAffine(b) - p1.SubAssign(&p2) - p.FromJacobian(&p1) + var bneg G1Affine + bneg.Neg(b) + p.Add(a, &bneg) return p } @@ -279,6 +302,35 @@ func (p *G1Jac) AddAssign(a *G1Jac) *G1Jac { return p } +// DoubleMixed point addition +// http://www.hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#doubling-mdbl-2007-bl +func (p *G1Jac) DoubleMixed(a *G1Affine) *G1Jac { + var XX, YY, YYYY, S, M, T fp.Element + XX.Square(&a.X) + YY.Square(&a.Y) + YYYY.Square(&YY) + S.Add(&a.X, &YY). + Square(&S). + Sub(&S, &XX). + Sub(&S, &YYYY). + Double(&S) + M.Double(&XX). + Add(&M, &XX) // -> + a, but a=0 here + T.Square(&M). + Sub(&T, &S). + Sub(&T, &S) + p.X.Set(&T) + p.Y.Sub(&S, &T). + Mul(&p.Y, &M) + YYYY.Double(&YYYY). + Double(&YYYY). + Double(&YYYY) + p.Y.Sub(&p.Y, &YYYY) + p.Z.Double(&a.Y) + + return p +} + // AddMixed point addition // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#addition-madd-2007-bl func (p *G1Jac) AddMixed(a *G1Affine) *G1Jac { @@ -303,7 +355,7 @@ func (p *G1Jac) AddMixed(a *G1Affine) *G1Jac { // if p == a, we double instead if U2.Equal(&p.X) && S2.Equal(&p.Y) { - return p.DoubleAssign() + return p.DoubleMixed(a) } H.Sub(&U2, &p.X) @@ -374,6 +426,11 @@ func (p *G1Jac) ScalarMultiplication(a *G1Jac, s *big.Int) *G1Jac { return p.mulGLV(a, s) } +// ScalarMultiplicationBase computes and returns p = g ⋅ s where g is the prime subgroup generator +func (p *G1Jac) ScalarMultiplicationBase(s *big.Int) *G1Jac { + return p.mulGLV(&g1Gen, s) +} + // String returns canonical representation of the point in affine coordinates func (p *G1Jac) String() string { _p := G1Affine{} @@ -397,14 +454,12 @@ func (p *G1Jac) FromAffine(Q *G1Affine) *G1Jac { // IsOnCurve returns true if p in on the curve func (p *G1Jac) IsOnCurve() bool { - var left, right, tmp fp.Element + var left, right, tmp, ZZ fp.Element left.Square(&p.Y) right.Square(&p.X).Mul(&right, &p.X) - tmp.Square(&p.Z). - Square(&tmp). - Mul(&tmp, &p.Z). - Mul(&tmp, &p.Z). - Mul(&tmp, &bCurveCoeff) + ZZ.Square(&p.Z) + tmp.Square(&ZZ).Mul(&tmp, &ZZ) + // Mul tmp by bCurveCoeff=1 (nothing to do) right.Add(&right, &tmp) return left.Equal(&right) } @@ -561,14 +616,13 @@ func (p *G1Jac) ClearCofactor(a *G1Jac) *G1Jac { } -// JointScalarMultiplicationBase computes [s1]g+[s2]a using Straus-Shamir technique -// where g is the prime subgroup generator -func (p *G1Jac) JointScalarMultiplicationBase(a *G1Affine, s1, s2 *big.Int) *G1Jac { +// JointScalarMultiplication computes [s1]a1+[s2]a2 using Straus-Shamir technique +func (p *G1Jac) JointScalarMultiplication(a1, a2 *G1Affine, s1, s2 *big.Int) *G1Jac { var res, p1, p2 G1Jac res.Set(&g1Infinity) - p1.Set(&g1Gen) - p2.FromAffine(a) + p1.FromAffine(a1) + p2.FromAffine(a2) var table [15]G1Jac @@ -632,6 +686,12 @@ func (p *G1Jac) JointScalarMultiplicationBase(a *G1Affine, s1, s2 *big.Int) *G1J } +// JointScalarMultiplicationBase computes [s1]g+[s2]a using Straus-Shamir technique +// where g is the prime subgroup generator +func (p *G1Jac) JointScalarMultiplicationBase(a *G1Affine, s1, s2 *big.Int) *G1Jac { + return p.JointScalarMultiplication(&g1GenAff, a, s1, s2) +} + // ------------------------------------------------------------------------------------------------- // Jacobian extended diff --git a/vendor/github.com/consensys/gnark-crypto/ecc/bls12-377/g2.go b/vendor/github.com/consensys/gnark-crypto/ecc/bls12-377/g2.go index c256d8210e8..04a5031c0c6 100644 --- a/vendor/github.com/consensys/gnark-crypto/ecc/bls12-377/g2.go +++ b/vendor/github.com/consensys/gnark-crypto/ecc/bls12-377/g2.go @@ -70,35 +70,74 @@ func (p *G2Affine) ScalarMultiplication(a *G2Affine, s *big.Int) *G2Affine { return p } +// ScalarMultiplicationBase computes and returns p = g ⋅ s where g is the prime subgroup generator +func (p *G2Affine) ScalarMultiplicationBase(s *big.Int) *G2Affine { + var _p G2Jac + _p.mulGLV(&g2Gen, s) + p.FromJacobian(&_p) + return p +} + // Add adds two point in affine coordinates. -// This should rarely be used as it is very inefficient compared to Jacobian +// Jacobian addition with Z1=Z2=1 +// https://www.hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#addition-mmadd-2007-bl func (p *G2Affine) Add(a, b *G2Affine) *G2Affine { - var p1, p2 G2Jac - p1.FromAffine(a) - p2.FromAffine(b) - p1.AddAssign(&p2) - p.FromJacobian(&p1) - return p + var q G2Jac + // a is infinity, return b + if a.IsInfinity() { + p.Set(b) + return p + } + // b is infinity, return a + if b.IsInfinity() { + p.Set(a) + return p + } + if a.X.Equal(&b.X) { + // if b == a, we double instead + if a.Y.Equal(&b.Y) { + q.DoubleMixed(a) + return p.FromJacobian(&q) + } else { + // if b == -a, we return 0 + return p.setInfinity() + } + } + var H, HH, I, J, r, V fptower.E2 + H.Sub(&b.X, &a.X) + HH.Square(&H) + I.Double(&HH).Double(&I) + J.Mul(&H, &I) + r.Sub(&b.Y, &a.Y) + r.Double(&r) + V.Mul(&a.X, &I) + q.X.Square(&r). + Sub(&q.X, &J). + Sub(&q.X, &V). + Sub(&q.X, &V) + q.Y.Sub(&V, &q.X). + Mul(&q.Y, &r) + J.Mul(&a.Y, &J).Double(&J) + q.Y.Sub(&q.Y, &J) + q.Z.Double(&H) + + return p.FromJacobian(&q) } // Double doubles a point in affine coordinates. -// This should rarely be used as it is very inefficient compared to Jacobian func (p *G2Affine) Double(a *G2Affine) *G2Affine { - var p1 G2Jac - p1.FromAffine(a) - p1.Double(&p1) - p.FromJacobian(&p1) + var q G2Jac + q.FromAffine(a) + q.DoubleMixed(a) + p.FromJacobian(&q) return p } // Sub subs two point in affine coordinates. -// This should rarely be used as it is very inefficient compared to Jacobian func (p *G2Affine) Sub(a, b *G2Affine) *G2Affine { - var p1, p2 G2Jac - p1.FromAffine(a) - p2.FromAffine(b) - p1.SubAssign(&p2) - p.FromJacobian(&p1) + var bneg G2Affine + bneg.Neg(b) + p.Add(a, &bneg) return p } @@ -268,6 +307,35 @@ func (p *G2Jac) AddAssign(a *G2Jac) *G2Jac { return p } +// DoubleMixed point addition +// http://www.hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#doubling-mdbl-2007-bl +func (p *G2Jac) DoubleMixed(a *G2Affine) *G2Jac { + var XX, YY, YYYY, S, M, T fptower.E2 + XX.Square(&a.X) + YY.Square(&a.Y) + YYYY.Square(&YY) + S.Add(&a.X, &YY). + Square(&S). + Sub(&S, &XX). + Sub(&S, &YYYY). + Double(&S) + M.Double(&XX). + Add(&M, &XX) // -> + a, but a=0 here + T.Square(&M). + Sub(&T, &S). + Sub(&T, &S) + p.X.Set(&T) + p.Y.Sub(&S, &T). + Mul(&p.Y, &M) + YYYY.Double(&YYYY). + Double(&YYYY). + Double(&YYYY) + p.Y.Sub(&p.Y, &YYYY) + p.Z.Double(&a.Y) + + return p +} + // AddMixed point addition // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#addition-madd-2007-bl func (p *G2Jac) AddMixed(a *G2Affine) *G2Jac { @@ -292,7 +360,7 @@ func (p *G2Jac) AddMixed(a *G2Affine) *G2Jac { // if p == a, we double instead if U2.Equal(&p.X) && S2.Equal(&p.Y) { - return p.DoubleAssign() + return p.DoubleMixed(a) } H.Sub(&U2, &p.X) @@ -363,6 +431,11 @@ func (p *G2Jac) ScalarMultiplication(a *G2Jac, s *big.Int) *G2Jac { return p.mulGLV(a, s) } +// ScalarMultiplicationBase computes and returns p = g ⋅ s where g is the prime subgroup generator +func (p *G2Jac) ScalarMultiplicationBase(s *big.Int) *G2Jac { + return p.mulGLV(&g2Gen, s) +} + // String returns canonical representation of the point in affine coordinates func (p *G2Jac) String() string { _p := G2Affine{} @@ -386,14 +459,12 @@ func (p *G2Jac) FromAffine(Q *G2Affine) *G2Jac { // IsOnCurve returns true if p in on the curve func (p *G2Jac) IsOnCurve() bool { - var left, right, tmp fptower.E2 + var left, right, tmp, ZZ fptower.E2 left.Square(&p.Y) right.Square(&p.X).Mul(&right, &p.X) - tmp.Square(&p.Z). - Square(&tmp). - Mul(&tmp, &p.Z). - Mul(&tmp, &p.Z). - Mul(&tmp, &bTwistCurveCoeff) + ZZ.Square(&p.Z) + tmp.Square(&ZZ).Mul(&tmp, &ZZ) + tmp.MulBybTwistCurveCoeff(&tmp) right.Add(&right, &tmp) return left.Equal(&right) } diff --git a/vendor/github.com/consensys/gnark-crypto/ecc/bls12-377/internal/fptower/e12_pairing.go b/vendor/github.com/consensys/gnark-crypto/ecc/bls12-377/internal/fptower/e12_pairing.go index 6888dfc4fca..3af62247399 100644 --- a/vendor/github.com/consensys/gnark-crypto/ecc/bls12-377/internal/fptower/e12_pairing.go +++ b/vendor/github.com/consensys/gnark-crypto/ecc/bls12-377/internal/fptower/e12_pairing.go @@ -52,9 +52,31 @@ func (z *E12) MulBy034(c0, c3, c4 *E2) *E12 { b.Set(&z.C1) b.MulBy01(c3, c4) - c0.Add(c0, c3) + var d0 E2 + d0.Add(c0, c3) d.Add(&z.C0, &z.C1) - d.MulBy01(c0, c4) + d.MulBy01(&d0, c4) + + z.C1.Add(&a, &b).Neg(&z.C1).Add(&z.C1, &d) + z.C0.MulByNonResidue(&b).Add(&z.C0, &a) + + return z +} + +// MulBy34 multiplication by sparse element (1,0,0,c3,c4,0) +func (z *E12) MulBy34(c3, c4 *E2) *E12 { + + var a, b, d E6 + + a.Set(&z.C0) + + b.Set(&z.C1) + b.MulBy01(c3, c4) + + var d0 E2 + d0.SetOne().Add(&d0, c3) + d.Add(&z.C0, &z.C1) + d.MulBy01(&d0, c4) z.C1.Add(&a, &b).Neg(&z.C1).Add(&z.C1, &d) z.C0.MulByNonResidue(&b).Add(&z.C0, &a) @@ -90,6 +112,26 @@ func Mul034By034(d0, d3, d4, c0, c3, c4 *E2) [5]E2 { return [5]E2{z00, x3, x34, x03, x04} } +// Mul34By34 multiplication of sparse element (1,0,0,c3,c4,0) by sparse element (1,0,0,d3,d4,0) +func Mul34By34(d3, d4, c3, c4 *E2) [5]E2 { + var z00, tmp, x0, x3, x4, x04, x03, x34 E2 + x3.Mul(c3, d3) + x4.Mul(c4, d4) + x04.Add(c4, d4) + x03.Add(c3, d3) + tmp.Add(c3, c4) + x34.Add(d3, d4). + Mul(&x34, &tmp). + Sub(&x34, &x3). + Sub(&x34, &x4) + + x0.SetOne() + z00.MulByNonResidue(&x4). + Add(&z00, &x0) + + return [5]E2{z00, x3, x34, x03, x04} +} + // MulBy01234 multiplies z by an E12 sparse element of the form (x0, x1, x2, x3, x4, 0) func (z *E12) MulBy01234(x *[5]E2) *E12 { var c1, a, b, c, z0, z1 E6 diff --git a/vendor/github.com/consensys/gnark-crypto/ecc/bls12-377/pairing.go b/vendor/github.com/consensys/gnark-crypto/ecc/bls12-377/pairing.go index f670902e4b0..dcb1428232c 100644 --- a/vendor/github.com/consensys/gnark-crypto/ecc/bls12-377/pairing.go +++ b/vendor/github.com/consensys/gnark-crypto/ecc/bls12-377/pairing.go @@ -17,6 +17,7 @@ package bls12377 import ( "errors" + "github.com/consensys/gnark-crypto/ecc/bls12-377/fp" "github.com/consensys/gnark-crypto/ecc/bls12-377/internal/fptower" ) @@ -147,7 +148,7 @@ func MillerLoop(P []G1Affine, Q []G2Affine) (GT, error) { if n >= 1 { // i = 62, separately to avoid an E12 Square // (Square(res) = 1² = 1) - // loopCounter[62] = 0 + // LoopCounter[62] = 0 // k = 0, separately to avoid MulBy034 (res × ℓ) // (assign line to res) @@ -189,7 +190,7 @@ func MillerLoop(P []G1Affine, Q []G2Affine) (GT, error) { } // i <= 61 - for i := len(loopCounter) - 3; i >= 1; i-- { + for i := len(LoopCounter) - 3; i >= 1; i-- { // mutualize the square among n Miller loops // (∏ᵢfᵢ)² result.Square(&result) @@ -201,7 +202,7 @@ func MillerLoop(P []G1Affine, Q []G2Affine) (GT, error) { l1.r0.MulByElement(&l1.r0, &p[k].Y) l1.r1.MulByElement(&l1.r1, &p[k].X) - if loopCounter[i] == 0 { + if LoopCounter[i] == 0 { // ℓ × res result.MulBy034(&l1.r0, &l1.r1, &l1.r2) } else { @@ -221,7 +222,7 @@ func MillerLoop(P []G1Affine, Q []G2Affine) (GT, error) { } // i = 0, separately to avoid a point addition - // loopCounter[0] = 1 + // LoopCounter[0] = 1 result.Square(&result) for k := 0; k < n; k++ { // qProj[k] ← 2qProj[k] and l1 the tangent ℓ passing 2qProj[k] @@ -341,3 +342,234 @@ func (p *g2Proj) lineCompute(evaluations *lineEvaluation, a *G2Affine) { evaluations.r1.Neg(&O) evaluations.r2.Set(&J) } + +// ---------------------- +// Fixed-argument pairing +// ---------------------- + +type LineEvaluationAff struct { + R0 fptower.E2 + R1 fptower.E2 +} + +// PairFixedQ calculates the reduced pairing for a set of points +// ∏ᵢ e(Pᵢ, Qᵢ) where Q are fixed points in G2. +// +// This function doesn't check that the inputs are in the correct subgroup. See IsInSubGroup. +func PairFixedQ(P []G1Affine, lines [][2][len(LoopCounter) - 1]LineEvaluationAff) (GT, error) { + f, err := MillerLoopFixedQ(P, lines) + if err != nil { + return GT{}, err + } + return FinalExponentiation(&f), nil +} + +// PairingCheckFixedQ calculates the reduced pairing for a set of points and returns True if the result is One +// ∏ᵢ e(Pᵢ, Qᵢ) =? 1 where Q are fixed points in G2. +// +// This function doesn't check that the inputs are in the correct subgroup. See IsInSubGroup. +func PairingCheckFixedQ(P []G1Affine, lines [][2][len(LoopCounter) - 1]LineEvaluationAff) (bool, error) { + f, err := PairFixedQ(P, lines) + if err != nil { + return false, err + } + var one GT + one.SetOne() + return f.Equal(&one), nil +} + +// PrecomputeLines precomputes the lines for the fixed-argument Miller loop +func PrecomputeLines(Q G2Affine) (PrecomputedLines [2][len(LoopCounter) - 1]LineEvaluationAff) { + var accQ G2Affine + accQ.Set(&Q) + + for i := len(LoopCounter) - 2; i >= 0; i-- { + accQ.doubleStep(&PrecomputedLines[0][i]) + if LoopCounter[i] == 0 { + continue + } else { + accQ.addStep(&PrecomputedLines[1][i], &Q) + } + } + return PrecomputedLines +} + +// MillerLoopFixedQ computes the multi-Miller loop as in MillerLoop +// but Qᵢ are fixed points in G2 known in advance. +func MillerLoopFixedQ(P []G1Affine, lines [][2][len(LoopCounter) - 1]LineEvaluationAff) (GT, error) { + n := len(P) + if n == 0 || n != len(lines) { + return GT{}, errors.New("invalid inputs sizes") + } + + // no need to filter infinity points: + // 1. if Pᵢ=(0,0) then -x/y=1/y=0 by gnark-crypto convention and so + // lines R0 and R1 are 0. At the end it happens that result will stay + // 1 through the Miller loop because MulBy34(1,0,0)==1 + // Mul34By34(1,0,0,1,0,0)==1 and MulBy01234(1,0,0,0,0)==1. + // + // 2. if Qᵢ=(0,0) then PrecomputeLines(Qᵢ) will return lines R0 and R1 + // that are 0 because of gnark-convention (*/0==0) in doubleStep and + // addStep. Similarly to Pᵢ=(0,0) it happens that result stays 1 + // throughout the MillerLoop. + + // precomputations + yInv := make([]fp.Element, n) + xNegOverY := make([]fp.Element, n) + for k := 0; k < n; k++ { + yInv[k].Set(&P[k].Y) + } + yInv = fp.BatchInvert(yInv) + for k := 0; k < n; k++ { + xNegOverY[k].Mul(&P[k].X, &yInv[k]). + Neg(&xNegOverY[k]) + } + + var result GT + result.SetOne() + var prodLines [5]E2 + + // Compute ∏ᵢ { fᵢ_{x₀,Q}(P) } + if n >= 1 { + // i = 62, separately to avoid an E12 Square + // (Square(res) = 1² = 1) + // LoopCounter[62] = 0 + // k = 0, separately to avoid MulBy34 (res × ℓ) + // (assign line to res) + + // line evaluation at P[0] (assign) + result.C1.B0.MulByElement(&lines[0][0][62].R0, &xNegOverY[0]) + result.C1.B1.MulByElement(&lines[0][0][62].R1, &yInv[0]) + // the coefficient which MulBy34 sets to 1 happens to be already 1 (result = 1) + } + + if n >= 2 { + // k = 1, separately to avoid MulBy34 (res × ℓ) + // (res is also a line at this point, so we use Mul34By34 ℓ × ℓ) + // line evaluation at P[1] + lines[1][0][62].R0.MulByElement(&lines[1][0][62].R0, &xNegOverY[1]) + lines[1][0][62].R1.MulByElement(&lines[1][0][62].R1, &yInv[1]) + // ℓ × res + prodLines = fptower.Mul34By34(&lines[1][0][62].R0, &lines[1][0][62].R1, &result.C1.B0, &result.C1.B1) + result.C0.B0 = prodLines[0] + result.C0.B1 = prodLines[1] + result.C0.B2 = prodLines[2] + result.C1.B0 = prodLines[3] + result.C1.B1 = prodLines[4] + } + + // k >= 2 + for k := 2; k < n; k++ { + // line evaluation at P[k] + lines[k][0][62].R0.MulByElement(&lines[k][0][62].R0, &xNegOverY[k]) + lines[k][0][62].R1.MulByElement(&lines[k][0][62].R1, &yInv[k]) + // ℓ × res + result.MulBy34( + &lines[k][0][62].R0, + &lines[k][0][62].R1, + ) + } + + for i := len(LoopCounter) - 3; i >= 0; i-- { + // mutualize the square among n Miller loops + // (∏ᵢfᵢ)² + result.Square(&result) + + for k := 0; k < n; k++ { + // line evaluation at P[k] + lines[k][0][i].R0. + MulByElement( + &lines[k][0][i].R0, + &xNegOverY[k], + ) + lines[k][0][i].R1. + MulByElement( + &lines[k][0][i].R1, + &yInv[k], + ) + + if LoopCounter[i] == 0 { + // ℓ × res + result.MulBy34( + &lines[k][0][i].R0, + &lines[k][0][i].R1, + ) + } else { + // line evaluation at P[k] + lines[k][1][i].R0. + MulByElement( + &lines[k][1][i].R0, + &xNegOverY[k], + ) + lines[k][1][i].R1. + MulByElement( + &lines[k][1][i].R1, + &yInv[k], + ) + // ℓ × ℓ + prodLines = fptower.Mul34By34( + &lines[k][0][i].R0, &lines[k][0][i].R1, + &lines[k][1][i].R0, &lines[k][1][i].R1, + ) + // (ℓ × ℓ) × res + result.MulBy01234(&prodLines) + } + } + } + + return result, nil +} + +func (p *G2Affine) doubleStep(evaluations *LineEvaluationAff) { + + var n, d, λ, xr, yr fptower.E2 + // λ = 3x²/2y + n.Square(&p.X) + λ.Double(&n). + Add(&λ, &n) + d.Double(&p.Y) + λ.Div(&λ, &d) + + // xr = λ²-2x + xr.Square(&λ). + Sub(&xr, &p.X). + Sub(&xr, &p.X) + + // yr = λ(x-xr)-y + yr.Sub(&p.X, &xr). + Mul(&yr, &λ). + Sub(&yr, &p.Y) + + evaluations.R0.Set(&λ) + evaluations.R1.Mul(&λ, &p.X). + Sub(&evaluations.R1, &p.Y) + + p.X.Set(&xr) + p.Y.Set(&yr) +} + +func (p *G2Affine) addStep(evaluations *LineEvaluationAff, a *G2Affine) { + var n, d, λ, λλ, xr, yr fptower.E2 + + // compute λ = (y2-y1)/(x2-x1) + n.Sub(&a.Y, &p.Y) + d.Sub(&a.X, &p.X) + λ.Div(&n, &d) + + // xr = λ²-x1-x2 + λλ.Square(&λ) + n.Add(&p.X, &a.X) + xr.Sub(&λλ, &n) + + // yr = λ(x1-xr) - y1 + yr.Sub(&p.X, &xr). + Mul(&yr, &λ). + Sub(&yr, &p.Y) + + evaluations.R0.Set(&λ) + evaluations.R1.Mul(&λ, &p.X). + Sub(&evaluations.R1, &p.Y) + + p.X.Set(&xr) + p.Y.Set(&yr) +} diff --git a/vendor/github.com/consensys/gnark-crypto/ecc/bls12-381/bls12-381.go b/vendor/github.com/consensys/gnark-crypto/ecc/bls12-381/bls12-381.go index 86ab933a19f..aa9acbf34c4 100644 --- a/vendor/github.com/consensys/gnark-crypto/ecc/bls12-381/bls12-381.go +++ b/vendor/github.com/consensys/gnark-crypto/ecc/bls12-381/bls12-381.go @@ -62,7 +62,7 @@ var g1Infinity G1Jac var g2Infinity G2Jac // optimal Ate loop counter -var loopCounter [64]int8 +var LoopCounter [64]int8 // Parameters useful for the GLV scalar multiplication. The third roots define the // endomorphisms ϕ₁ and ϕ₂ for and . lambda is such that lies above @@ -135,7 +135,7 @@ func init() { endo.v.A1.SetString("1028732146235106349975324479215795277384839936929757896155643118032610843298655225875571310552543014690878354869257") // binary decomposition of -x₀ little endian - loopCounter = [64]int8{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1} + LoopCounter = [64]int8{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1} // -x₀ xGen.SetString("15132376222941642752", 10) diff --git a/vendor/github.com/consensys/gnark-crypto/ecc/bls12-381/fr/generator.go b/vendor/github.com/consensys/gnark-crypto/ecc/bls12-381/fr/generator.go new file mode 100644 index 00000000000..15f2595e40c --- /dev/null +++ b/vendor/github.com/consensys/gnark-crypto/ecc/bls12-381/fr/generator.go @@ -0,0 +1,47 @@ +// Copyright 2020 Consensys Software Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by consensys/gnark-crypto DO NOT EDIT + +package fr + +import ( + "fmt" + "math/big" + "math/bits" + + "github.com/consensys/gnark-crypto/ecc" +) + +// Generator returns a generator for Z/2^(log(m))Z +// or an error if m is too big (required root of unity doesn't exist) +func Generator(m uint64) (Element, error) { + x := ecc.NextPowerOfTwo(m) + + var rootOfUnity Element + + rootOfUnity.SetString("10238227357739495823651030575849232062558860180284477541189508159991286009131") + const maxOrderRoot uint64 = 32 + + // find generator for Z/2^(log(m))Z + logx := uint64(bits.TrailingZeros64(x)) + if logx > maxOrderRoot { + return Element{}, fmt.Errorf("m (%d) is too big: the required root of unity does not exist", m) + } + + expo := uint64(1 << (maxOrderRoot - logx)) + var generator Element + generator.Exp(rootOfUnity, big.NewInt(int64(expo))) // order x + return generator, nil +} diff --git a/vendor/github.com/consensys/gnark-crypto/ecc/bls12-381/g1.go b/vendor/github.com/consensys/gnark-crypto/ecc/bls12-381/g1.go index c24a82cda65..909ff12f169 100644 --- a/vendor/github.com/consensys/gnark-crypto/ecc/bls12-381/g1.go +++ b/vendor/github.com/consensys/gnark-crypto/ecc/bls12-381/g1.go @@ -65,14 +65,6 @@ func (p *G1Affine) ScalarMultiplication(a *G1Affine, s *big.Int) *G1Affine { return p } -// ScalarMultiplicationAffine computes and returns p = a ⋅ s -// Takes an affine point and returns a Jacobian point (useful for KZG) -func (p *G1Jac) ScalarMultiplicationAffine(a *G1Affine, s *big.Int) *G1Jac { - p.FromAffine(a) - p.mulGLV(p, s) - return p -} - // ScalarMultiplicationBase computes and returns p = g ⋅ s where g is the prime subgroup generator func (p *G1Affine) ScalarMultiplicationBase(s *big.Int) *G1Affine { var _p G1Jac @@ -82,34 +74,65 @@ func (p *G1Affine) ScalarMultiplicationBase(s *big.Int) *G1Affine { } // Add adds two point in affine coordinates. -// This should rarely be used as it is very inefficient compared to Jacobian +// Jacobian addition with Z1=Z2=1 +// https://www.hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#addition-mmadd-2007-bl func (p *G1Affine) Add(a, b *G1Affine) *G1Affine { - var p1, p2 G1Jac - p1.FromAffine(a) - p2.FromAffine(b) - p1.AddAssign(&p2) - p.FromJacobian(&p1) - return p + var q G1Jac + // a is infinity, return b + if a.IsInfinity() { + p.Set(b) + return p + } + // b is infinity, return a + if b.IsInfinity() { + p.Set(a) + return p + } + if a.X.Equal(&b.X) { + // if b == a, we double instead + if a.Y.Equal(&b.Y) { + q.DoubleMixed(a) + return p.FromJacobian(&q) + } else { + // if b == -a, we return 0 + return p.setInfinity() + } + } + var H, HH, I, J, r, V fp.Element + H.Sub(&b.X, &a.X) + HH.Square(&H) + I.Double(&HH).Double(&I) + J.Mul(&H, &I) + r.Sub(&b.Y, &a.Y) + r.Double(&r) + V.Mul(&a.X, &I) + q.X.Square(&r). + Sub(&q.X, &J). + Sub(&q.X, &V). + Sub(&q.X, &V) + q.Y.Sub(&V, &q.X). + Mul(&q.Y, &r) + J.Mul(&a.Y, &J).Double(&J) + q.Y.Sub(&q.Y, &J) + q.Z.Double(&H) + + return p.FromJacobian(&q) } // Double doubles a point in affine coordinates. -// This should rarely be used as it is very inefficient compared to Jacobian func (p *G1Affine) Double(a *G1Affine) *G1Affine { - var p1 G1Jac - p1.FromAffine(a) - p1.Double(&p1) - p.FromJacobian(&p1) + var q G1Jac + q.FromAffine(a) + q.DoubleMixed(a) + p.FromJacobian(&q) return p } // Sub subs two point in affine coordinates. -// This should rarely be used as it is very inefficient compared to Jacobian func (p *G1Affine) Sub(a, b *G1Affine) *G1Affine { - var p1, p2 G1Jac - p1.FromAffine(a) - p2.FromAffine(b) - p1.SubAssign(&p2) - p.FromJacobian(&p1) + var bneg G1Affine + bneg.Neg(b) + p.Add(a, &bneg) return p } @@ -279,6 +302,35 @@ func (p *G1Jac) AddAssign(a *G1Jac) *G1Jac { return p } +// DoubleMixed point addition +// http://www.hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#doubling-mdbl-2007-bl +func (p *G1Jac) DoubleMixed(a *G1Affine) *G1Jac { + var XX, YY, YYYY, S, M, T fp.Element + XX.Square(&a.X) + YY.Square(&a.Y) + YYYY.Square(&YY) + S.Add(&a.X, &YY). + Square(&S). + Sub(&S, &XX). + Sub(&S, &YYYY). + Double(&S) + M.Double(&XX). + Add(&M, &XX) // -> + a, but a=0 here + T.Square(&M). + Sub(&T, &S). + Sub(&T, &S) + p.X.Set(&T) + p.Y.Sub(&S, &T). + Mul(&p.Y, &M) + YYYY.Double(&YYYY). + Double(&YYYY). + Double(&YYYY) + p.Y.Sub(&p.Y, &YYYY) + p.Z.Double(&a.Y) + + return p +} + // AddMixed point addition // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#addition-madd-2007-bl func (p *G1Jac) AddMixed(a *G1Affine) *G1Jac { @@ -303,7 +355,7 @@ func (p *G1Jac) AddMixed(a *G1Affine) *G1Jac { // if p == a, we double instead if U2.Equal(&p.X) && S2.Equal(&p.Y) { - return p.DoubleAssign() + return p.DoubleMixed(a) } H.Sub(&U2, &p.X) @@ -374,6 +426,11 @@ func (p *G1Jac) ScalarMultiplication(a *G1Jac, s *big.Int) *G1Jac { return p.mulGLV(a, s) } +// ScalarMultiplicationBase computes and returns p = g ⋅ s where g is the prime subgroup generator +func (p *G1Jac) ScalarMultiplicationBase(s *big.Int) *G1Jac { + return p.mulGLV(&g1Gen, s) +} + // String returns canonical representation of the point in affine coordinates func (p *G1Jac) String() string { _p := G1Affine{} @@ -397,14 +454,13 @@ func (p *G1Jac) FromAffine(Q *G1Affine) *G1Jac { // IsOnCurve returns true if p in on the curve func (p *G1Jac) IsOnCurve() bool { - var left, right, tmp fp.Element + var left, right, tmp, ZZ fp.Element left.Square(&p.Y) right.Square(&p.X).Mul(&right, &p.X) - tmp.Square(&p.Z). - Square(&tmp). - Mul(&tmp, &p.Z). - Mul(&tmp, &p.Z). - Mul(&tmp, &bCurveCoeff) + ZZ.Square(&p.Z) + tmp.Square(&ZZ).Mul(&tmp, &ZZ) + // Mul tmp by bCurveCoeff=4 + tmp.Double(&tmp).Double(&tmp) right.Add(&right, &tmp) return left.Equal(&right) } @@ -561,14 +617,13 @@ func (p *G1Jac) ClearCofactor(a *G1Jac) *G1Jac { } -// JointScalarMultiplicationBase computes [s1]g+[s2]a using Straus-Shamir technique -// where g is the prime subgroup generator -func (p *G1Jac) JointScalarMultiplicationBase(a *G1Affine, s1, s2 *big.Int) *G1Jac { +// JointScalarMultiplication computes [s1]a1+[s2]a2 using Straus-Shamir technique +func (p *G1Jac) JointScalarMultiplication(a1, a2 *G1Affine, s1, s2 *big.Int) *G1Jac { var res, p1, p2 G1Jac res.Set(&g1Infinity) - p1.Set(&g1Gen) - p2.FromAffine(a) + p1.FromAffine(a1) + p2.FromAffine(a2) var table [15]G1Jac @@ -632,6 +687,12 @@ func (p *G1Jac) JointScalarMultiplicationBase(a *G1Affine, s1, s2 *big.Int) *G1J } +// JointScalarMultiplicationBase computes [s1]g+[s2]a using Straus-Shamir technique +// where g is the prime subgroup generator +func (p *G1Jac) JointScalarMultiplicationBase(a *G1Affine, s1, s2 *big.Int) *G1Jac { + return p.JointScalarMultiplication(&g1GenAff, a, s1, s2) +} + // ------------------------------------------------------------------------------------------------- // Jacobian extended diff --git a/vendor/github.com/consensys/gnark-crypto/ecc/bls12-381/g2.go b/vendor/github.com/consensys/gnark-crypto/ecc/bls12-381/g2.go index cd32bfb46b0..5d49b493664 100644 --- a/vendor/github.com/consensys/gnark-crypto/ecc/bls12-381/g2.go +++ b/vendor/github.com/consensys/gnark-crypto/ecc/bls12-381/g2.go @@ -70,35 +70,74 @@ func (p *G2Affine) ScalarMultiplication(a *G2Affine, s *big.Int) *G2Affine { return p } +// ScalarMultiplicationBase computes and returns p = g ⋅ s where g is the prime subgroup generator +func (p *G2Affine) ScalarMultiplicationBase(s *big.Int) *G2Affine { + var _p G2Jac + _p.mulGLV(&g2Gen, s) + p.FromJacobian(&_p) + return p +} + // Add adds two point in affine coordinates. -// This should rarely be used as it is very inefficient compared to Jacobian +// Jacobian addition with Z1=Z2=1 +// https://www.hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#addition-mmadd-2007-bl func (p *G2Affine) Add(a, b *G2Affine) *G2Affine { - var p1, p2 G2Jac - p1.FromAffine(a) - p2.FromAffine(b) - p1.AddAssign(&p2) - p.FromJacobian(&p1) - return p + var q G2Jac + // a is infinity, return b + if a.IsInfinity() { + p.Set(b) + return p + } + // b is infinity, return a + if b.IsInfinity() { + p.Set(a) + return p + } + if a.X.Equal(&b.X) { + // if b == a, we double instead + if a.Y.Equal(&b.Y) { + q.DoubleMixed(a) + return p.FromJacobian(&q) + } else { + // if b == -a, we return 0 + return p.setInfinity() + } + } + var H, HH, I, J, r, V fptower.E2 + H.Sub(&b.X, &a.X) + HH.Square(&H) + I.Double(&HH).Double(&I) + J.Mul(&H, &I) + r.Sub(&b.Y, &a.Y) + r.Double(&r) + V.Mul(&a.X, &I) + q.X.Square(&r). + Sub(&q.X, &J). + Sub(&q.X, &V). + Sub(&q.X, &V) + q.Y.Sub(&V, &q.X). + Mul(&q.Y, &r) + J.Mul(&a.Y, &J).Double(&J) + q.Y.Sub(&q.Y, &J) + q.Z.Double(&H) + + return p.FromJacobian(&q) } // Double doubles a point in affine coordinates. -// This should rarely be used as it is very inefficient compared to Jacobian func (p *G2Affine) Double(a *G2Affine) *G2Affine { - var p1 G2Jac - p1.FromAffine(a) - p1.Double(&p1) - p.FromJacobian(&p1) + var q G2Jac + q.FromAffine(a) + q.DoubleMixed(a) + p.FromJacobian(&q) return p } // Sub subs two point in affine coordinates. -// This should rarely be used as it is very inefficient compared to Jacobian func (p *G2Affine) Sub(a, b *G2Affine) *G2Affine { - var p1, p2 G2Jac - p1.FromAffine(a) - p2.FromAffine(b) - p1.SubAssign(&p2) - p.FromJacobian(&p1) + var bneg G2Affine + bneg.Neg(b) + p.Add(a, &bneg) return p } @@ -268,6 +307,35 @@ func (p *G2Jac) AddAssign(a *G2Jac) *G2Jac { return p } +// DoubleMixed point addition +// http://www.hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#doubling-mdbl-2007-bl +func (p *G2Jac) DoubleMixed(a *G2Affine) *G2Jac { + var XX, YY, YYYY, S, M, T fptower.E2 + XX.Square(&a.X) + YY.Square(&a.Y) + YYYY.Square(&YY) + S.Add(&a.X, &YY). + Square(&S). + Sub(&S, &XX). + Sub(&S, &YYYY). + Double(&S) + M.Double(&XX). + Add(&M, &XX) // -> + a, but a=0 here + T.Square(&M). + Sub(&T, &S). + Sub(&T, &S) + p.X.Set(&T) + p.Y.Sub(&S, &T). + Mul(&p.Y, &M) + YYYY.Double(&YYYY). + Double(&YYYY). + Double(&YYYY) + p.Y.Sub(&p.Y, &YYYY) + p.Z.Double(&a.Y) + + return p +} + // AddMixed point addition // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#addition-madd-2007-bl func (p *G2Jac) AddMixed(a *G2Affine) *G2Jac { @@ -292,7 +360,7 @@ func (p *G2Jac) AddMixed(a *G2Affine) *G2Jac { // if p == a, we double instead if U2.Equal(&p.X) && S2.Equal(&p.Y) { - return p.DoubleAssign() + return p.DoubleMixed(a) } H.Sub(&U2, &p.X) @@ -363,6 +431,11 @@ func (p *G2Jac) ScalarMultiplication(a *G2Jac, s *big.Int) *G2Jac { return p.mulGLV(a, s) } +// ScalarMultiplicationBase computes and returns p = g ⋅ s where g is the prime subgroup generator +func (p *G2Jac) ScalarMultiplicationBase(s *big.Int) *G2Jac { + return p.mulGLV(&g2Gen, s) +} + // String returns canonical representation of the point in affine coordinates func (p *G2Jac) String() string { _p := G2Affine{} @@ -386,14 +459,12 @@ func (p *G2Jac) FromAffine(Q *G2Affine) *G2Jac { // IsOnCurve returns true if p in on the curve func (p *G2Jac) IsOnCurve() bool { - var left, right, tmp fptower.E2 + var left, right, tmp, ZZ fptower.E2 left.Square(&p.Y) right.Square(&p.X).Mul(&right, &p.X) - tmp.Square(&p.Z). - Square(&tmp). - Mul(&tmp, &p.Z). - Mul(&tmp, &p.Z). - Mul(&tmp, &bTwistCurveCoeff) + ZZ.Square(&p.Z) + tmp.Square(&ZZ).Mul(&tmp, &ZZ) + tmp.MulBybTwistCurveCoeff(&tmp) right.Add(&right, &tmp) return left.Equal(&right) } diff --git a/vendor/github.com/consensys/gnark-crypto/ecc/bls12-381/internal/fptower/e12_pairing.go b/vendor/github.com/consensys/gnark-crypto/ecc/bls12-381/internal/fptower/e12_pairing.go index 880520f815f..035f26e73b2 100644 --- a/vendor/github.com/consensys/gnark-crypto/ecc/bls12-381/internal/fptower/e12_pairing.go +++ b/vendor/github.com/consensys/gnark-crypto/ecc/bls12-381/internal/fptower/e12_pairing.go @@ -66,6 +66,28 @@ func (z *E12) MulBy014(c0, c1, c4 *E2) *E12 { return z } +// MulBy01 multiplication by sparse element (c0, c1, 0, 0, 1) +func (z *E12) MulBy01(c0, c1 *E2) *E12 { + + var a, b E6 + var d E2 + + a.Set(&z.C0) + a.MulBy01(c0, c1) + + b.MulByNonResidue(&z.C1) + d.SetOne().Add(c1, &d) + + z.C1.Add(&z.C1, &z.C0) + z.C1.MulBy01(c0, &d) + z.C1.Sub(&z.C1, &a) + z.C1.Sub(&z.C1, &b) + z.C0.MulByNonResidue(&b) + z.C0.Add(&z.C0, &a) + + return z +} + // Mul014By014 multiplication of sparse element (c0,c1,0,0,c4,0) by sparse element (d0,d1,0,0,d4,0) func Mul014By014(d0, d1, d4, c0, c1, c4 *E2) [5]E2 { var z00, tmp, x0, x1, x4, x04, x01, x14 E2 @@ -94,6 +116,26 @@ func Mul014By014(d0, d1, d4, c0, c1, c4 *E2) [5]E2 { return [5]E2{z00, x01, x1, x04, x14} } +// Mul01By01 multiplication of sparse element (c0,c1,0,0,1,0) by sparse element (d0,d1,0,0,1,0) +func Mul01By01(d0, d1, c0, c1 *E2) [5]E2 { + var z00, tmp, x0, x1, x4, x04, x01, x14 E2 + x0.Mul(c0, d0) + x1.Mul(c1, d1) + x4.SetOne() + x04.Add(d0, c0) + tmp.Add(c0, c1) + x01.Add(d0, d1). + Mul(&x01, &tmp). + Sub(&x01, &x0). + Sub(&x01, &x1) + x14.Add(d1, c1) + + z00.MulByNonResidue(&x4). + Add(&z00, &x0) + + return [5]E2{z00, x01, x1, x04, x14} +} + // MulBy01245 multiplies z by an E12 sparse element of the form (x0, x1, x2, 0, x4, x5) func (z *E12) MulBy01245(x *[5]E2) *E12 { var c1, a, b, c, z0, z1 E6 diff --git a/vendor/github.com/consensys/gnark-crypto/ecc/bls12-381/pairing.go b/vendor/github.com/consensys/gnark-crypto/ecc/bls12-381/pairing.go index e2c362f9b51..b7c1bf66b20 100644 --- a/vendor/github.com/consensys/gnark-crypto/ecc/bls12-381/pairing.go +++ b/vendor/github.com/consensys/gnark-crypto/ecc/bls12-381/pairing.go @@ -17,6 +17,7 @@ package bls12381 import ( "errors" + "github.com/consensys/gnark-crypto/ecc/bls12-381/fp" "github.com/consensys/gnark-crypto/ecc/bls12-381/internal/fptower" ) @@ -146,7 +147,7 @@ func MillerLoop(P []G1Affine, Q []G2Affine) (GT, error) { if n >= 1 { // i = 62, separately to avoid an E12 Square // (Square(res) = 1² = 1) - // loopCounter[62] = 1 + // LoopCounter[62] = 1 // k = 0, separately to avoid MulBy014 (res × ℓ) // (assign line to res) @@ -193,7 +194,7 @@ func MillerLoop(P []G1Affine, Q []G2Affine) (GT, error) { } // i <= 61 - for i := len(loopCounter) - 3; i >= 1; i-- { + for i := len(LoopCounter) - 3; i >= 1; i-- { // mutualize the square among n Miller loops // (∏ᵢfᵢ)² result.Square(&result) @@ -205,7 +206,7 @@ func MillerLoop(P []G1Affine, Q []G2Affine) (GT, error) { l1.r1.MulByElement(&l1.r1, &p[k].X) l1.r2.MulByElement(&l1.r2, &p[k].Y) - if loopCounter[i] == 0 { + if LoopCounter[i] == 0 { // ℓ × res result.MulBy014(&l1.r0, &l1.r1, &l1.r2) } else { @@ -224,7 +225,7 @@ func MillerLoop(P []G1Affine, Q []G2Affine) (GT, error) { } // i = 0, separately to avoid a point doubling - // loopCounter[0] = 0 + // LoopCounter[0] = 0 result.Square(&result) for k := 0; k < n; k++ { // l1 the tangent ℓ passing 2qProj[k] @@ -345,3 +346,198 @@ func (p *g2Proj) tangentLine(l *lineEvaluation) { Add(&l.r1, &J) l.r2.Neg(&H) } + +// ---------------------- +// Fixed-argument pairing +// ---------------------- + +type LineEvaluationAff struct { + R0 fptower.E2 + R1 fptower.E2 +} + +// PairFixedQ calculates the reduced pairing for a set of points +// ∏ᵢ e(Pᵢ, Qᵢ) where Q are fixed points in G2. +// +// This function doesn't check that the inputs are in the correct subgroup. See IsInSubGroup. +func PairFixedQ(P []G1Affine, lines [][2][len(LoopCounter) - 1]LineEvaluationAff) (GT, error) { + f, err := MillerLoopFixedQ(P, lines) + if err != nil { + return GT{}, err + } + return FinalExponentiation(&f), nil +} + +// PairingCheckFixedQ calculates the reduced pairing for a set of points and returns True if the result is One +// ∏ᵢ e(Pᵢ, Qᵢ) =? 1 where Q are fixed points in G2. +// +// This function doesn't check that the inputs are in the correct subgroup. See IsInSubGroup. +func PairingCheckFixedQ(P []G1Affine, lines [][2][len(LoopCounter) - 1]LineEvaluationAff) (bool, error) { + f, err := PairFixedQ(P, lines) + if err != nil { + return false, err + } + var one GT + one.SetOne() + return f.Equal(&one), nil +} + +// PrecomputeLines precomputes the lines for the fixed-argument Miller loop +func PrecomputeLines(Q G2Affine) (PrecomputedLines [2][len(LoopCounter) - 1]LineEvaluationAff) { + var accQ G2Affine + accQ.Set(&Q) + + n := len(LoopCounter) + for i := n - 2; i >= 0; i-- { + accQ.doubleStep(&PrecomputedLines[0][i]) + if LoopCounter[i] == 0 { + continue + } else { + accQ.addStep(&PrecomputedLines[1][i], &Q) + } + } + return PrecomputedLines +} + +// MillerLoopFixedQ computes the multi-Miller loop as in MillerLoop +// but Qᵢ are fixed points in G2 known in advance. +func MillerLoopFixedQ(P []G1Affine, lines [][2][len(LoopCounter) - 1]LineEvaluationAff) (GT, error) { + n := len(P) + if n == 0 || n != len(lines) { + return GT{}, errors.New("invalid inputs sizes") + } + + // no need to filter infinity points: + // 1. if Pᵢ=(0,0) then -x/y=1/y=0 by gnark-crypto convention and so + // lines R0 and R1 are 0. It happens that result will stay, through + // the Miller loop, in 𝔽p⁶ because MulBy01(0,0,1), + // Mul01By01(0,0,1,0,0,1) and MulBy01245 set result.C0 to 0. At the + // end result will be in a proper subgroup of Fp¹² so it be reduced to + // 1 in FinalExponentiation. + // + // and/or + // + // 2. if Qᵢ=(0,0) then PrecomputeLines(Qᵢ) will return lines R0 and R1 + // that are 0 because of gnark-convention (*/0==0) in doubleStep and + // addStep. Similarly to Pᵢ=(0,0) it happens that result be 1 + // after the FinalExponentiation. + + // precomputations + yInv := make([]fp.Element, n) + xNegOverY := make([]fp.Element, n) + for k := 0; k < n; k++ { + yInv[k].Set(&P[k].Y) + } + yInv = fp.BatchInvert(yInv) + for k := 0; k < n; k++ { + xNegOverY[k].Mul(&P[k].X, &yInv[k]). + Neg(&xNegOverY[k]) + } + + var result GT + result.SetOne() + var prodLines [5]E2 + + // Compute ∏ᵢ { fᵢ_{x₀,Q}(P) } + for i := len(LoopCounter) - 2; i >= 0; i-- { + // mutualize the square among n Miller loops + // (∏ᵢfᵢ)² + result.Square(&result) + + for k := 0; k < n; k++ { + // line evaluation at P[k] + lines[k][0][i].R1. + MulByElement( + &lines[k][0][i].R1, + &yInv[k], + ) + lines[k][0][i].R0. + MulByElement(&lines[k][0][i].R0, + &xNegOverY[k], + ) + if LoopCounter[i] == 0 { + // ℓ × res + result.MulBy01( + &lines[k][0][i].R1, + &lines[k][0][i].R0, + ) + + } else { + lines[k][1][i].R1. + MulByElement( + &lines[k][1][i].R1, + &yInv[k], + ) + lines[k][1][i].R0. + MulByElement( + &lines[k][1][i].R0, + &xNegOverY[k], + ) + prodLines = fptower.Mul01By01( + &lines[k][0][i].R1, &lines[k][0][i].R0, + &lines[k][1][i].R1, &lines[k][1][i].R0, + ) + result.MulBy01245(&prodLines) + } + } + } + + // negative x₀ + result.Conjugate(&result) + + return result, nil +} + +func (p *G2Affine) doubleStep(evaluations *LineEvaluationAff) { + + var n, d, λ, xr, yr fptower.E2 + // λ = 3x²/2y + n.Square(&p.X) + λ.Double(&n). + Add(&λ, &n) + d.Double(&p.Y) + λ.Div(&λ, &d) + + // xr = λ²-2x + xr.Square(&λ). + Sub(&xr, &p.X). + Sub(&xr, &p.X) + + // yr = λ(x-xr)-y + yr.Sub(&p.X, &xr). + Mul(&yr, &λ). + Sub(&yr, &p.Y) + + evaluations.R0.Set(&λ) + evaluations.R1.Mul(&λ, &p.X). + Sub(&evaluations.R1, &p.Y) + + p.X.Set(&xr) + p.Y.Set(&yr) +} + +func (p *G2Affine) addStep(evaluations *LineEvaluationAff, a *G2Affine) { + var n, d, λ, λλ, xr, yr fptower.E2 + + // compute λ = (y2-y1)/(x2-x1) + n.Sub(&a.Y, &p.Y) + d.Sub(&a.X, &p.X) + λ.Div(&n, &d) + + // xr = λ²-x1-x2 + λλ.Square(&λ) + n.Add(&p.X, &a.X) + xr.Sub(&λλ, &n) + + // yr = λ(x1-xr) - y1 + yr.Sub(&p.X, &xr). + Mul(&yr, &λ). + Sub(&yr, &p.Y) + + evaluations.R0.Set(&λ) + evaluations.R1.Mul(&λ, &p.X). + Sub(&evaluations.R1, &p.Y) + + p.X.Set(&xr) + p.Y.Set(&yr) +} diff --git a/vendor/github.com/consensys/gnark-crypto/ecc/bn254/bn254.go b/vendor/github.com/consensys/gnark-crypto/ecc/bn254/bn254.go index f6f2990ca39..6c52a4c7f6f 100644 --- a/vendor/github.com/consensys/gnark-crypto/ecc/bn254/bn254.go +++ b/vendor/github.com/consensys/gnark-crypto/ecc/bn254/bn254.go @@ -76,7 +76,7 @@ var g1Infinity G1Jac var g2Infinity G2Jac // optimal Ate loop counter -var loopCounter [66]int8 +var LoopCounter [66]int8 // Parameters useful for the GLV scalar multiplication. The third roots define the // endomorphisms ϕ₁ and ϕ₂ for and . lambda is such that lies above @@ -152,7 +152,7 @@ func init() { // 2-NAF decomposition of 6x₀+2 little endian optimaAteLoop, _ := new(big.Int).SetString("29793968203157093288", 10) - ecc.NafDecomposition(optimaAteLoop, loopCounter[:]) + ecc.NafDecomposition(optimaAteLoop, LoopCounter[:]) xGen.SetString("4965661367192848881", 10) diff --git a/vendor/github.com/consensys/gnark-crypto/ecc/bn254/fr/generator.go b/vendor/github.com/consensys/gnark-crypto/ecc/bn254/fr/generator.go new file mode 100644 index 00000000000..fa7b82df0b6 --- /dev/null +++ b/vendor/github.com/consensys/gnark-crypto/ecc/bn254/fr/generator.go @@ -0,0 +1,47 @@ +// Copyright 2020 Consensys Software Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by consensys/gnark-crypto DO NOT EDIT + +package fr + +import ( + "fmt" + "math/big" + "math/bits" + + "github.com/consensys/gnark-crypto/ecc" +) + +// Generator returns a generator for Z/2^(log(m))Z +// or an error if m is too big (required root of unity doesn't exist) +func Generator(m uint64) (Element, error) { + x := ecc.NextPowerOfTwo(m) + + var rootOfUnity Element + + rootOfUnity.SetString("19103219067921713944291392827692070036145651957329286315305642004821462161904") + const maxOrderRoot uint64 = 28 + + // find generator for Z/2^(log(m))Z + logx := uint64(bits.TrailingZeros64(x)) + if logx > maxOrderRoot { + return Element{}, fmt.Errorf("m (%d) is too big: the required root of unity does not exist", m) + } + + expo := uint64(1 << (maxOrderRoot - logx)) + var generator Element + generator.Exp(rootOfUnity, big.NewInt(int64(expo))) // order x + return generator, nil +} diff --git a/vendor/github.com/consensys/gnark-crypto/ecc/bn254/g1.go b/vendor/github.com/consensys/gnark-crypto/ecc/bn254/g1.go index e64b53ffa7a..5fdd0d83008 100644 --- a/vendor/github.com/consensys/gnark-crypto/ecc/bn254/g1.go +++ b/vendor/github.com/consensys/gnark-crypto/ecc/bn254/g1.go @@ -65,14 +65,6 @@ func (p *G1Affine) ScalarMultiplication(a *G1Affine, s *big.Int) *G1Affine { return p } -// ScalarMultiplicationAffine computes and returns p = a ⋅ s -// Takes an affine point and returns a Jacobian point (useful for KZG) -func (p *G1Jac) ScalarMultiplicationAffine(a *G1Affine, s *big.Int) *G1Jac { - p.FromAffine(a) - p.mulGLV(p, s) - return p -} - // ScalarMultiplicationBase computes and returns p = g ⋅ s where g is the prime subgroup generator func (p *G1Affine) ScalarMultiplicationBase(s *big.Int) *G1Affine { var _p G1Jac @@ -82,34 +74,65 @@ func (p *G1Affine) ScalarMultiplicationBase(s *big.Int) *G1Affine { } // Add adds two point in affine coordinates. -// This should rarely be used as it is very inefficient compared to Jacobian +// Jacobian addition with Z1=Z2=1 +// https://www.hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#addition-mmadd-2007-bl func (p *G1Affine) Add(a, b *G1Affine) *G1Affine { - var p1, p2 G1Jac - p1.FromAffine(a) - p2.FromAffine(b) - p1.AddAssign(&p2) - p.FromJacobian(&p1) - return p + var q G1Jac + // a is infinity, return b + if a.IsInfinity() { + p.Set(b) + return p + } + // b is infinity, return a + if b.IsInfinity() { + p.Set(a) + return p + } + if a.X.Equal(&b.X) { + // if b == a, we double instead + if a.Y.Equal(&b.Y) { + q.DoubleMixed(a) + return p.FromJacobian(&q) + } else { + // if b == -a, we return 0 + return p.setInfinity() + } + } + var H, HH, I, J, r, V fp.Element + H.Sub(&b.X, &a.X) + HH.Square(&H) + I.Double(&HH).Double(&I) + J.Mul(&H, &I) + r.Sub(&b.Y, &a.Y) + r.Double(&r) + V.Mul(&a.X, &I) + q.X.Square(&r). + Sub(&q.X, &J). + Sub(&q.X, &V). + Sub(&q.X, &V) + q.Y.Sub(&V, &q.X). + Mul(&q.Y, &r) + J.Mul(&a.Y, &J).Double(&J) + q.Y.Sub(&q.Y, &J) + q.Z.Double(&H) + + return p.FromJacobian(&q) } // Double doubles a point in affine coordinates. -// This should rarely be used as it is very inefficient compared to Jacobian func (p *G1Affine) Double(a *G1Affine) *G1Affine { - var p1 G1Jac - p1.FromAffine(a) - p1.Double(&p1) - p.FromJacobian(&p1) + var q G1Jac + q.FromAffine(a) + q.DoubleMixed(a) + p.FromJacobian(&q) return p } // Sub subs two point in affine coordinates. -// This should rarely be used as it is very inefficient compared to Jacobian func (p *G1Affine) Sub(a, b *G1Affine) *G1Affine { - var p1, p2 G1Jac - p1.FromAffine(a) - p2.FromAffine(b) - p1.SubAssign(&p2) - p.FromJacobian(&p1) + var bneg G1Affine + bneg.Neg(b) + p.Add(a, &bneg) return p } @@ -279,6 +302,35 @@ func (p *G1Jac) AddAssign(a *G1Jac) *G1Jac { return p } +// DoubleMixed point addition +// http://www.hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#doubling-mdbl-2007-bl +func (p *G1Jac) DoubleMixed(a *G1Affine) *G1Jac { + var XX, YY, YYYY, S, M, T fp.Element + XX.Square(&a.X) + YY.Square(&a.Y) + YYYY.Square(&YY) + S.Add(&a.X, &YY). + Square(&S). + Sub(&S, &XX). + Sub(&S, &YYYY). + Double(&S) + M.Double(&XX). + Add(&M, &XX) // -> + a, but a=0 here + T.Square(&M). + Sub(&T, &S). + Sub(&T, &S) + p.X.Set(&T) + p.Y.Sub(&S, &T). + Mul(&p.Y, &M) + YYYY.Double(&YYYY). + Double(&YYYY). + Double(&YYYY) + p.Y.Sub(&p.Y, &YYYY) + p.Z.Double(&a.Y) + + return p +} + // AddMixed point addition // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#addition-madd-2007-bl func (p *G1Jac) AddMixed(a *G1Affine) *G1Jac { @@ -303,7 +355,7 @@ func (p *G1Jac) AddMixed(a *G1Affine) *G1Jac { // if p == a, we double instead if U2.Equal(&p.X) && S2.Equal(&p.Y) { - return p.DoubleAssign() + return p.DoubleMixed(a) } H.Sub(&U2, &p.X) @@ -374,6 +426,11 @@ func (p *G1Jac) ScalarMultiplication(a *G1Jac, s *big.Int) *G1Jac { return p.mulGLV(a, s) } +// ScalarMultiplicationBase computes and returns p = g ⋅ s where g is the prime subgroup generator +func (p *G1Jac) ScalarMultiplicationBase(s *big.Int) *G1Jac { + return p.mulGLV(&g1Gen, s) +} + // String returns canonical representation of the point in affine coordinates func (p *G1Jac) String() string { _p := G1Affine{} @@ -397,14 +454,13 @@ func (p *G1Jac) FromAffine(Q *G1Affine) *G1Jac { // IsOnCurve returns true if p in on the curve func (p *G1Jac) IsOnCurve() bool { - var left, right, tmp fp.Element + var left, right, tmp, ZZ fp.Element left.Square(&p.Y) right.Square(&p.X).Mul(&right, &p.X) - tmp.Square(&p.Z). - Square(&tmp). - Mul(&tmp, &p.Z). - Mul(&tmp, &p.Z). - Mul(&tmp, &bCurveCoeff) + ZZ.Square(&p.Z) + tmp.Square(&ZZ).Mul(&tmp, &ZZ) + // Mul tmp by bCurveCoeff=3 + fp.MulBy3(&tmp) right.Add(&right, &tmp) return left.Equal(&right) } @@ -532,14 +588,13 @@ func (p *G1Jac) mulGLV(a *G1Jac, s *big.Int) *G1Jac { return p } -// JointScalarMultiplicationBase computes [s1]g+[s2]a using Straus-Shamir technique -// where g is the prime subgroup generator -func (p *G1Jac) JointScalarMultiplicationBase(a *G1Affine, s1, s2 *big.Int) *G1Jac { +// JointScalarMultiplication computes [s1]a1+[s2]a2 using Straus-Shamir technique +func (p *G1Jac) JointScalarMultiplication(a1, a2 *G1Affine, s1, s2 *big.Int) *G1Jac { var res, p1, p2 G1Jac res.Set(&g1Infinity) - p1.Set(&g1Gen) - p2.FromAffine(a) + p1.FromAffine(a1) + p2.FromAffine(a2) var table [15]G1Jac @@ -603,6 +658,12 @@ func (p *G1Jac) JointScalarMultiplicationBase(a *G1Affine, s1, s2 *big.Int) *G1J } +// JointScalarMultiplicationBase computes [s1]g+[s2]a using Straus-Shamir technique +// where g is the prime subgroup generator +func (p *G1Jac) JointScalarMultiplicationBase(a *G1Affine, s1, s2 *big.Int) *G1Jac { + return p.JointScalarMultiplication(&g1GenAff, a, s1, s2) +} + // ------------------------------------------------------------------------------------------------- // Jacobian extended diff --git a/vendor/github.com/consensys/gnark-crypto/ecc/bn254/g2.go b/vendor/github.com/consensys/gnark-crypto/ecc/bn254/g2.go index b4f279fc379..911b3c7b069 100644 --- a/vendor/github.com/consensys/gnark-crypto/ecc/bn254/g2.go +++ b/vendor/github.com/consensys/gnark-crypto/ecc/bn254/g2.go @@ -70,35 +70,74 @@ func (p *G2Affine) ScalarMultiplication(a *G2Affine, s *big.Int) *G2Affine { return p } +// ScalarMultiplicationBase computes and returns p = g ⋅ s where g is the prime subgroup generator +func (p *G2Affine) ScalarMultiplicationBase(s *big.Int) *G2Affine { + var _p G2Jac + _p.mulGLV(&g2Gen, s) + p.FromJacobian(&_p) + return p +} + // Add adds two point in affine coordinates. -// This should rarely be used as it is very inefficient compared to Jacobian +// Jacobian addition with Z1=Z2=1 +// https://www.hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#addition-mmadd-2007-bl func (p *G2Affine) Add(a, b *G2Affine) *G2Affine { - var p1, p2 G2Jac - p1.FromAffine(a) - p2.FromAffine(b) - p1.AddAssign(&p2) - p.FromJacobian(&p1) - return p + var q G2Jac + // a is infinity, return b + if a.IsInfinity() { + p.Set(b) + return p + } + // b is infinity, return a + if b.IsInfinity() { + p.Set(a) + return p + } + if a.X.Equal(&b.X) { + // if b == a, we double instead + if a.Y.Equal(&b.Y) { + q.DoubleMixed(a) + return p.FromJacobian(&q) + } else { + // if b == -a, we return 0 + return p.setInfinity() + } + } + var H, HH, I, J, r, V fptower.E2 + H.Sub(&b.X, &a.X) + HH.Square(&H) + I.Double(&HH).Double(&I) + J.Mul(&H, &I) + r.Sub(&b.Y, &a.Y) + r.Double(&r) + V.Mul(&a.X, &I) + q.X.Square(&r). + Sub(&q.X, &J). + Sub(&q.X, &V). + Sub(&q.X, &V) + q.Y.Sub(&V, &q.X). + Mul(&q.Y, &r) + J.Mul(&a.Y, &J).Double(&J) + q.Y.Sub(&q.Y, &J) + q.Z.Double(&H) + + return p.FromJacobian(&q) } // Double doubles a point in affine coordinates. -// This should rarely be used as it is very inefficient compared to Jacobian func (p *G2Affine) Double(a *G2Affine) *G2Affine { - var p1 G2Jac - p1.FromAffine(a) - p1.Double(&p1) - p.FromJacobian(&p1) + var q G2Jac + q.FromAffine(a) + q.DoubleMixed(a) + p.FromJacobian(&q) return p } // Sub subs two point in affine coordinates. -// This should rarely be used as it is very inefficient compared to Jacobian func (p *G2Affine) Sub(a, b *G2Affine) *G2Affine { - var p1, p2 G2Jac - p1.FromAffine(a) - p2.FromAffine(b) - p1.SubAssign(&p2) - p.FromJacobian(&p1) + var bneg G2Affine + bneg.Neg(b) + p.Add(a, &bneg) return p } @@ -268,6 +307,35 @@ func (p *G2Jac) AddAssign(a *G2Jac) *G2Jac { return p } +// DoubleMixed point addition +// http://www.hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#doubling-mdbl-2007-bl +func (p *G2Jac) DoubleMixed(a *G2Affine) *G2Jac { + var XX, YY, YYYY, S, M, T fptower.E2 + XX.Square(&a.X) + YY.Square(&a.Y) + YYYY.Square(&YY) + S.Add(&a.X, &YY). + Square(&S). + Sub(&S, &XX). + Sub(&S, &YYYY). + Double(&S) + M.Double(&XX). + Add(&M, &XX) // -> + a, but a=0 here + T.Square(&M). + Sub(&T, &S). + Sub(&T, &S) + p.X.Set(&T) + p.Y.Sub(&S, &T). + Mul(&p.Y, &M) + YYYY.Double(&YYYY). + Double(&YYYY). + Double(&YYYY) + p.Y.Sub(&p.Y, &YYYY) + p.Z.Double(&a.Y) + + return p +} + // AddMixed point addition // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#addition-madd-2007-bl func (p *G2Jac) AddMixed(a *G2Affine) *G2Jac { @@ -292,7 +360,7 @@ func (p *G2Jac) AddMixed(a *G2Affine) *G2Jac { // if p == a, we double instead if U2.Equal(&p.X) && S2.Equal(&p.Y) { - return p.DoubleAssign() + return p.DoubleMixed(a) } H.Sub(&U2, &p.X) @@ -363,6 +431,11 @@ func (p *G2Jac) ScalarMultiplication(a *G2Jac, s *big.Int) *G2Jac { return p.mulGLV(a, s) } +// ScalarMultiplicationBase computes and returns p = g ⋅ s where g is the prime subgroup generator +func (p *G2Jac) ScalarMultiplicationBase(s *big.Int) *G2Jac { + return p.mulGLV(&g2Gen, s) +} + // String returns canonical representation of the point in affine coordinates func (p *G2Jac) String() string { _p := G2Affine{} @@ -386,14 +459,12 @@ func (p *G2Jac) FromAffine(Q *G2Affine) *G2Jac { // IsOnCurve returns true if p in on the curve func (p *G2Jac) IsOnCurve() bool { - var left, right, tmp fptower.E2 + var left, right, tmp, ZZ fptower.E2 left.Square(&p.Y) right.Square(&p.X).Mul(&right, &p.X) - tmp.Square(&p.Z). - Square(&tmp). - Mul(&tmp, &p.Z). - Mul(&tmp, &p.Z). - Mul(&tmp, &bTwistCurveCoeff) + ZZ.Square(&p.Z) + tmp.Square(&ZZ).Mul(&tmp, &ZZ) + tmp.MulBybTwistCurveCoeff(&tmp) right.Add(&right, &tmp) return left.Equal(&right) } diff --git a/vendor/github.com/consensys/gnark-crypto/ecc/bn254/internal/fptower/e12_pairing.go b/vendor/github.com/consensys/gnark-crypto/ecc/bn254/internal/fptower/e12_pairing.go index 78c94d2f613..4a068d7a105 100644 --- a/vendor/github.com/consensys/gnark-crypto/ecc/bn254/internal/fptower/e12_pairing.go +++ b/vendor/github.com/consensys/gnark-crypto/ecc/bn254/internal/fptower/e12_pairing.go @@ -142,9 +142,31 @@ func (z *E12) MulBy034(c0, c3, c4 *E2) *E12 { b.Set(&z.C1) b.MulBy01(c3, c4) - c0.Add(c0, c3) + var d0 E2 + d0.Add(c0, c3) d.Add(&z.C0, &z.C1) - d.MulBy01(c0, c4) + d.MulBy01(&d0, c4) + + z.C1.Add(&a, &b).Neg(&z.C1).Add(&z.C1, &d) + z.C0.MulByNonResidue(&b).Add(&z.C0, &a) + + return z +} + +// MulBy34 multiplication by sparse element (1,0,0,c3,c4,0) +func (z *E12) MulBy34(c3, c4 *E2) *E12 { + + var a, b, d E6 + + a.Set(&z.C0) + + b.Set(&z.C1) + b.MulBy01(c3, c4) + + var d0 E2 + d0.SetOne().Add(&d0, c3) + d.Add(&z.C0, &z.C1) + d.MulBy01(&d0, c4) z.C1.Add(&a, &b).Neg(&z.C1).Add(&z.C1, &d) z.C0.MulByNonResidue(&b).Add(&z.C0, &a) @@ -180,6 +202,26 @@ func Mul034By034(d0, d3, d4, c0, c3, c4 *E2) [5]E2 { return [5]E2{z00, x3, x34, x03, x04} } +// Mul34By34 multiplication of sparse element (1,0,0,c3,c4,0) by sparse element (1,0,0,d3,d4,0) +func Mul34By34(d3, d4, c3, c4 *E2) [5]E2 { + var z00, tmp, x0, x3, x4, x04, x03, x34 E2 + x3.Mul(c3, d3) + x4.Mul(c4, d4) + x04.Add(c4, d4) + x03.Add(c3, d3) + tmp.Add(c3, c4) + x34.Add(d3, d4). + Mul(&x34, &tmp). + Sub(&x34, &x3). + Sub(&x34, &x4) + + x0.SetOne() + z00.MulByNonResidue(&x4). + Add(&z00, &x0) + + return [5]E2{z00, x3, x34, x03, x04} +} + // MulBy01234 multiplies z by an E12 sparse element of the form (x0, x1, x2, x3, x4, 0) func (z *E12) MulBy01234(x *[5]E2) *E12 { var c1, a, b, c, z0, z1 E6 diff --git a/vendor/github.com/consensys/gnark-crypto/ecc/bn254/pairing.go b/vendor/github.com/consensys/gnark-crypto/ecc/bn254/pairing.go index ec342fe80e2..675eebedf36 100644 --- a/vendor/github.com/consensys/gnark-crypto/ecc/bn254/pairing.go +++ b/vendor/github.com/consensys/gnark-crypto/ecc/bn254/pairing.go @@ -17,6 +17,7 @@ package bn254 import ( "errors" + "github.com/consensys/gnark-crypto/ecc/bn254/fp" "github.com/consensys/gnark-crypto/ecc/bn254/internal/fptower" ) @@ -154,7 +155,7 @@ func MillerLoop(P []G1Affine, Q []G2Affine) (GT, error) { if n >= 1 { // i = 64, separately to avoid an E12 Square // (Square(res) = 1² = 1) - // loopCounter[64] = 0 + // LoopCounter[64] = 0 // k = 0, separately to avoid MulBy034 (res × ℓ) // (assign line to res) @@ -195,7 +196,7 @@ func MillerLoop(P []G1Affine, Q []G2Affine) (GT, error) { result.MulBy034(&l1.r0, &l1.r1, &l1.r2) } - // i = 63, separately to avoid a doubleStep (loopCounter[63]=-1) + // i = 63, separately to avoid a doubleStep (LoopCounter[63]=-1) // (at this point qProj = 2Q, so 2qProj-Q=3Q is equivalent to qProj+Q=3Q // this means doubleStep followed by an addMixedStep is equivalent to an // addMixedStep here) @@ -221,7 +222,7 @@ func MillerLoop(P []G1Affine, Q []G2Affine) (GT, error) { } // i <= 62 - for i := len(loopCounter) - 4; i >= 0; i-- { + for i := len(LoopCounter) - 4; i >= 0; i-- { // mutualize the square among n Miller loops // (∏ᵢfᵢ)² result.Square(&result) @@ -233,7 +234,7 @@ func MillerLoop(P []G1Affine, Q []G2Affine) (GT, error) { l1.r0.MulByElement(&l1.r0, &p[k].Y) l1.r1.MulByElement(&l1.r1, &p[k].X) - if loopCounter[i] == 1 { + if LoopCounter[i] == 1 { // qProj[k] ← qProj[k]+Q[k] and // l2 the line ℓ passing qProj[k] and Q[k] qProj[k].addMixedStep(&l2, &q[k]) @@ -245,7 +246,7 @@ func MillerLoop(P []G1Affine, Q []G2Affine) (GT, error) { // (ℓ × ℓ) × res result.MulBy01234(&prodLines) - } else if loopCounter[i] == -1 { + } else if LoopCounter[i] == -1 { // qProj[k] ← qProj[k]-Q[k] and // l2 the line ℓ passing qProj[k] and -Q[k] qProj[k].addMixedStep(&l2, &qNeg[k]) @@ -394,3 +395,329 @@ func (p *g2Proj) lineCompute(evaluations *lineEvaluation, a *G2Affine) { evaluations.r1.Neg(&O) evaluations.r2.Set(&J) } + +// ---------------------- +// Fixed-argument pairing +// ---------------------- + +type LineEvaluationAff struct { + R0 fptower.E2 + R1 fptower.E2 +} + +// PairFixedQ calculates the reduced pairing for a set of points +// ∏ᵢ e(Pᵢ, Qᵢ) where Q are fixed points in G2. +// +// This function doesn't check that the inputs are in the correct subgroup. See IsInSubGroup. +func PairFixedQ(P []G1Affine, lines [][2][len(LoopCounter)]LineEvaluationAff) (GT, error) { + f, err := MillerLoopFixedQ(P, lines) + if err != nil { + return GT{}, err + } + return FinalExponentiation(&f), nil +} + +// PairingCheckFixedQ calculates the reduced pairing for a set of points and returns True if the result is One +// ∏ᵢ e(Pᵢ, Qᵢ) =? 1 where Q are fixed points in G2. +// +// This function doesn't check that the inputs are in the correct subgroup. See IsInSubGroup. +func PairingCheckFixedQ(P []G1Affine, lines [][2][len(LoopCounter)]LineEvaluationAff) (bool, error) { + f, err := PairFixedQ(P, lines) + if err != nil { + return false, err + } + var one GT + one.SetOne() + return f.Equal(&one), nil +} + +// PrecomputeLines precomputes the lines for the fixed-argument Miller loop +func PrecomputeLines(Q G2Affine) (PrecomputedLines [2][len(LoopCounter)]LineEvaluationAff) { + var accQ, negQ G2Affine + accQ.Set(&Q) + negQ.Neg(&Q) + + n := len(LoopCounter) + for i := n - 2; i >= 0; i-- { + switch LoopCounter[i] { + case 0: + accQ.doubleStep(&PrecomputedLines[0][i]) + case 1: + accQ.doubleAndAddStep(&PrecomputedLines[0][i], &PrecomputedLines[1][i], &Q) + case -1: + accQ.doubleAndAddStep(&PrecomputedLines[0][i], &PrecomputedLines[1][i], &negQ) + default: + return [2][len(LoopCounter)]LineEvaluationAff{} + } + } + + var psiQ, phiQ G2Affine + phiQ.X.Conjugate(&Q.X).MulByNonResidue1Power2(&phiQ.X) + phiQ.Y.Conjugate(&Q.Y).MulByNonResidue1Power3(&phiQ.Y) + psiQ.X.MulByNonResidue2Power2(&Q.X) + psiQ.Y.MulByNonResidue2Power3(&Q.Y).Neg(&psiQ.Y) + + accQ.addStep(&PrecomputedLines[1][n-1], &phiQ) + accQ.addStep(&PrecomputedLines[0][n-1], &psiQ) + + return PrecomputedLines +} + +// MillerLoopFixedQ computes the multi-Miller loop as in MillerLoop +// but Qᵢ are fixed points in G2 known in advance. +func MillerLoopFixedQ(P []G1Affine, lines [][2][len(LoopCounter)]LineEvaluationAff) (GT, error) { + n := len(P) + if n == 0 || n != len(lines) { + return GT{}, errors.New("invalid inputs sizes") + } + + // no need to filter infinity points: + // 1. if Pᵢ=(0,0) then -x/y=1/y=0 by gnark-crypto convention and so + // lines R0 and R1 are 0. At the end it happens that result will stay + // 1 through the Miller loop because MulBy34(1,0,0)==1 + // Mul34By34(1,0,0,1,0,0)==1 and MulBy01234(1,0,0,0,0)==1. + // + // 2. if Qᵢ=(0,0) then PrecomputeLines(Qᵢ) will return lines R0 and R1 + // that are 0 because of gnark-convention (*/0==0) in doubleStep and + // addStep. Similarly to Pᵢ=(0,0) it happens that result stays 1 + // throughout the MillerLoop. + + // precomputations + yInv := make([]fp.Element, n) + xNegOverY := make([]fp.Element, n) + for k := 0; k < n; k++ { + yInv[k].Set(&P[k].Y) + } + yInv = fp.BatchInvert(yInv) + for k := 0; k < n; k++ { + xNegOverY[k].Mul(&P[k].X, &yInv[k]). + Neg(&xNegOverY[k]) + } + + var result GT + result.SetOne() + var prodLines [5]E2 + + // Compute ∏ᵢ { fᵢ_{6x₀+2,Q}(P) } + if n >= 1 { + // i = 64, separately to avoid an E12 Square + // (Square(res) = 1² = 1) + // LoopCounter[64] = 0 + // k = 0, separately to avoid MulBy34 (res × ℓ) + // (assign line to res) + + // line evaluation at P[0] (assign) + result.C1.B0.MulByElement(&lines[0][0][64].R0, &xNegOverY[0]) + result.C1.B1.MulByElement(&lines[0][0][64].R1, &yInv[0]) + // the coefficient which MulBy34 sets to 1 happens to be already 1 (result = 1) + } + + if n >= 2 { + // k = 1, separately to avoid MulBy34 (res × ℓ) + // (res is also a line at this point, so we use Mul34By34 ℓ × ℓ) + // line evaluation at P[1] + lines[1][0][64].R0.MulByElement(&lines[1][0][64].R0, &xNegOverY[1]) + lines[1][0][64].R1.MulByElement(&lines[1][0][64].R1, &yInv[1]) + // ℓ × res + prodLines = fptower.Mul34By34(&lines[1][0][64].R0, &lines[1][0][64].R1, &result.C1.B0, &result.C1.B1) + result.C0.B0 = prodLines[0] + result.C0.B1 = prodLines[1] + result.C0.B2 = prodLines[2] + result.C1.B0 = prodLines[3] + result.C1.B1 = prodLines[4] + } + + // k >= 2 + for k := 2; k < n; k++ { + // line evaluation at P[k] + lines[k][0][64].R0.MulByElement(&lines[k][0][64].R0, &xNegOverY[k]) + lines[k][0][64].R1.MulByElement(&lines[k][0][64].R1, &yInv[k]) + // ℓ × res + result.MulBy34( + &lines[k][0][64].R0, + &lines[k][0][64].R1, + ) + } + + for i := len(LoopCounter) - 3; i >= 0; i-- { + // mutualize the square among n Miller loops + // (∏ᵢfᵢ)² + result.Square(&result) + + for k := 0; k < n; k++ { + // line evaluation at P[k] + lines[k][0][i].R0. + MulByElement( + &lines[k][0][i].R0, + &xNegOverY[k], + ) + lines[k][0][i].R1. + MulByElement( + &lines[k][0][i].R1, + &yInv[k], + ) + + if LoopCounter[i] == 0 { + // ℓ × res + result.MulBy34( + &lines[k][0][i].R0, + &lines[k][0][i].R1, + ) + } else { + // line evaluation at P[k] + lines[k][1][i].R0. + MulByElement( + &lines[k][1][i].R0, + &xNegOverY[k], + ) + lines[k][1][i].R1. + MulByElement( + &lines[k][1][i].R1, + &yInv[k], + ) + // ℓ × ℓ + prodLines = fptower.Mul34By34( + &lines[k][0][i].R0, &lines[k][0][i].R1, + &lines[k][1][i].R0, &lines[k][1][i].R1, + ) + // (ℓ × ℓ) × res + result.MulBy01234(&prodLines) + } + } + } + + // Compute ∏ᵢ { ℓᵢ_{[6x₀+2]Q,π(Q)}(P) · ℓᵢ_{[6x₀+2]Q+π(Q),-π²(Q)}(P) } + for k := 0; k < n; k++ { + // line evaluation at P[k] + lines[k][1][65].R0. + MulByElement( + &lines[k][1][65].R0, + &xNegOverY[k], + ) + lines[k][1][65].R1. + MulByElement( + &lines[k][1][65].R1, + &yInv[k], + ) + // line evaluation at P[k] + lines[k][0][65].R0. + MulByElement( + &lines[k][0][65].R0, + &xNegOverY[k], + ) + lines[k][0][65].R1. + MulByElement( + &lines[k][0][65].R1, + &yInv[k], + ) + // ℓ × ℓ + prodLines = fptower.Mul34By34( + &lines[k][1][65].R0, &lines[k][1][65].R1, + &lines[k][0][65].R0, &lines[k][0][65].R1, + ) + // (ℓ × ℓ) × res + result.MulBy01234(&prodLines) + } + + return result, nil +} + +func (p *G2Affine) doubleStep(evaluations *LineEvaluationAff) { + + var n, d, λ, xr, yr fptower.E2 + // λ = 3x²/2y + n.Square(&p.X) + λ.Double(&n). + Add(&λ, &n) + d.Double(&p.Y) + λ.Div(&λ, &d) + + // xr = λ²-2x + xr.Square(&λ). + Sub(&xr, &p.X). + Sub(&xr, &p.X) + + // yr = λ(x-xr)-y + yr.Sub(&p.X, &xr). + Mul(&yr, &λ). + Sub(&yr, &p.Y) + + evaluations.R0.Set(&λ) + evaluations.R1.Mul(&λ, &p.X). + Sub(&evaluations.R1, &p.Y) + + p.X.Set(&xr) + p.Y.Set(&yr) +} + +func (p *G2Affine) addStep(evaluations *LineEvaluationAff, a *G2Affine) { + var n, d, λ, λλ, xr, yr fptower.E2 + + // compute λ = (y2-y1)/(x2-x1) + n.Sub(&a.Y, &p.Y) + d.Sub(&a.X, &p.X) + λ.Div(&n, &d) + + // xr = λ²-x1-x2 + λλ.Square(&λ) + n.Add(&p.X, &a.X) + xr.Sub(&λλ, &n) + + // yr = λ(x1-xr) - y1 + yr.Sub(&p.X, &xr). + Mul(&yr, &λ). + Sub(&yr, &p.Y) + + evaluations.R0.Set(&λ) + evaluations.R1.Mul(&λ, &p.X). + Sub(&evaluations.R1, &p.Y) + + p.X.Set(&xr) + p.Y.Set(&yr) +} + +func (p *G2Affine) doubleAndAddStep(evaluations1, evaluations2 *LineEvaluationAff, a *G2Affine) { + var n, d, l1, x3, l2, x4, y4 fptower.E2 + + // compute λ1 = (y2-y1)/(x2-x1) + n.Sub(&p.Y, &a.Y) + d.Sub(&p.X, &a.X) + l1.Div(&n, &d) + + // compute x3 =λ1²-x1-x2 + x3.Square(&l1) + x3.Sub(&x3, &p.X) + x3.Sub(&x3, &a.X) + + // omit y3 computation + + // compute line1 + evaluations1.R0.Set(&l1) + evaluations1.R1.Mul(&l1, &p.X) + evaluations1.R1.Sub(&evaluations1.R1, &p.Y) + + // compute λ2 = -λ1-2y1/(x3-x1) + n.Double(&p.Y) + d.Sub(&x3, &p.X) + l2.Div(&n, &d) + l2.Add(&l2, &l1) + l2.Neg(&l2) + + // compute x4 = λ2²-x1-x3 + x4.Square(&l2) + x4.Sub(&x4, &p.X) + x4.Sub(&x4, &x3) + + // compute y4 = λ2(x1 - x4)-y1 + y4.Sub(&p.X, &x4) + y4.Mul(&l2, &y4) + y4.Sub(&y4, &p.Y) + + // compute line2 + evaluations2.R0.Set(&l2) + evaluations2.R1.Mul(&l2, &p.X) + evaluations2.R1.Sub(&evaluations2.R1, &p.Y) + + p.X.Set(&x4) + p.Y.Set(&y4) +} diff --git a/vendor/github.com/consensys/gnark-crypto/ecc/ecc.go b/vendor/github.com/consensys/gnark-crypto/ecc/ecc.go index 5fa1bd961bb..a9c4b6dfb86 100644 --- a/vendor/github.com/consensys/gnark-crypto/ecc/ecc.go +++ b/vendor/github.com/consensys/gnark-crypto/ecc/ecc.go @@ -27,6 +27,7 @@ limitations under the License. package ecc import ( + "errors" "math/big" "strings" @@ -57,6 +58,15 @@ func Implemented() []ID { return []ID{BN254, BLS12_377, BLS12_381, BW6_761, BLS24_315, BW6_633, BLS12_378, BW6_756, BLS24_317, STARK_CURVE, SECP256K1} } +func IDFromString(s string) (ID, error) { + for _, id := range Implemented() { + if strings.ToLower(s) == id.String() { + return id, nil + } + } + return UNKNOWN, errors.New("unknown curve ID") +} + func (id ID) String() string { cfg := id.config() return strings.ToLower(cfg.EnumID) diff --git a/vendor/github.com/consensys/gnark-crypto/field/hash/hashutils.go b/vendor/github.com/consensys/gnark-crypto/field/hash/hashutils.go index db7cff3e130..7c3b970686d 100644 --- a/vendor/github.com/consensys/gnark-crypto/field/hash/hashutils.go +++ b/vendor/github.com/consensys/gnark-crypto/field/hash/hashutils.go @@ -6,8 +6,8 @@ import ( ) // ExpandMsgXmd expands msg to a slice of lenInBytes bytes. -// https://tools.ietf.org/html/draft-irtf-cfrg-hash-to-curve-06#section-5 -// https://tools.ietf.org/html/rfc8017#section-4.1 (I2OSP/O2ISP) +// https://datatracker.ietf.org/doc/html/rfc9380#name-expand_message_xmd +// https://datatracker.ietf.org/doc/html/rfc9380#name-utility-functions (I2OSP/O2ISP) func ExpandMsgXmd(msg, dst []byte, lenInBytes int) ([]byte, error) { h := sha256.New() @@ -22,7 +22,7 @@ func ExpandMsgXmd(msg, dst []byte, lenInBytes int) ([]byte, error) { // Z_pad = I2OSP(0, r_in_bytes) // l_i_b_str = I2OSP(len_in_bytes, 2) - // DST_prime = I2OSP(len(DST), 1) ∥ DST + // DST_prime = DST ∥ I2OSP(len(DST), 1) // b₀ = H(Z_pad ∥ msg ∥ l_i_b_str ∥ I2OSP(0, 1) ∥ DST_prime) h.Reset() if _, err := h.Write(make([]byte, h.BlockSize())); err != nil { diff --git a/vendor/github.com/consensys/gnark-crypto/internal/generator/config/bw6-633.go b/vendor/github.com/consensys/gnark-crypto/internal/generator/config/bw6-633.go index a0584e29ea8..9805f1caca7 100644 --- a/vendor/github.com/consensys/gnark-crypto/internal/generator/config/bw6-633.go +++ b/vendor/github.com/consensys/gnark-crypto/internal/generator/config/bw6-633.go @@ -13,7 +13,6 @@ var BW6_633 = Curve{ GLV: true, CofactorCleaning: true, CRange: []int{4, 5, 8, 16}, - Projective: true, }, G2: Point{ CoordType: "fp.Element", @@ -22,6 +21,7 @@ var BW6_633 = Curve{ GLV: true, CofactorCleaning: true, CRange: []int{4, 5, 8, 16}, + Projective: true, }, // 7-isogeny HashE1: &HashSuiteSswu{ diff --git a/vendor/github.com/consensys/gnark-crypto/internal/generator/config/bw6-756.go b/vendor/github.com/consensys/gnark-crypto/internal/generator/config/bw6-756.go index 4657c6cc4bf..21ab364ccfd 100644 --- a/vendor/github.com/consensys/gnark-crypto/internal/generator/config/bw6-756.go +++ b/vendor/github.com/consensys/gnark-crypto/internal/generator/config/bw6-756.go @@ -13,7 +13,6 @@ var BW6_756 = Curve{ GLV: true, CofactorCleaning: true, CRange: []int{4, 5, 8, 16}, - Projective: true, }, G2: Point{ CoordType: "fp.Element", @@ -22,6 +21,7 @@ var BW6_756 = Curve{ GLV: true, CofactorCleaning: true, CRange: []int{4, 5, 8, 16}, + Projective: true, }, // 2-isogeny HashE1: &HashSuiteSswu{ diff --git a/vendor/github.com/consensys/gnark-crypto/internal/generator/config/bw6-761.go b/vendor/github.com/consensys/gnark-crypto/internal/generator/config/bw6-761.go index 33f34ae6994..aa2ec6c363a 100644 --- a/vendor/github.com/consensys/gnark-crypto/internal/generator/config/bw6-761.go +++ b/vendor/github.com/consensys/gnark-crypto/internal/generator/config/bw6-761.go @@ -13,7 +13,6 @@ var BW6_761 = Curve{ GLV: true, CofactorCleaning: true, CRange: []int{4, 5, 8, 16}, - Projective: true, }, G2: Point{ CoordType: "fp.Element", @@ -22,6 +21,7 @@ var BW6_761 = Curve{ GLV: true, CofactorCleaning: true, CRange: []int{4, 5, 8, 16}, + Projective: true, }, // 2-isogeny HashE1: &HashSuiteSswu{ diff --git a/vendor/github.com/golang/protobuf/jsonpb/decode.go b/vendor/github.com/golang/protobuf/jsonpb/decode.go deleted file mode 100644 index c6f66f10393..00000000000 --- a/vendor/github.com/golang/protobuf/jsonpb/decode.go +++ /dev/null @@ -1,531 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package jsonpb - -import ( - "encoding/json" - "errors" - "fmt" - "io" - "math" - "reflect" - "strconv" - "strings" - "time" - - "github.com/golang/protobuf/proto" - "google.golang.org/protobuf/encoding/protojson" - protoV2 "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/reflect/protoreflect" - "google.golang.org/protobuf/reflect/protoregistry" -) - -const wrapJSONUnmarshalV2 = false - -// UnmarshalNext unmarshals the next JSON object from d into m. -func UnmarshalNext(d *json.Decoder, m proto.Message) error { - return new(Unmarshaler).UnmarshalNext(d, m) -} - -// Unmarshal unmarshals a JSON object from r into m. -func Unmarshal(r io.Reader, m proto.Message) error { - return new(Unmarshaler).Unmarshal(r, m) -} - -// UnmarshalString unmarshals a JSON object from s into m. -func UnmarshalString(s string, m proto.Message) error { - return new(Unmarshaler).Unmarshal(strings.NewReader(s), m) -} - -// Unmarshaler is a configurable object for converting from a JSON -// representation to a protocol buffer object. -type Unmarshaler struct { - // AllowUnknownFields specifies whether to allow messages to contain - // unknown JSON fields, as opposed to failing to unmarshal. - AllowUnknownFields bool - - // AnyResolver is used to resolve the google.protobuf.Any well-known type. - // If unset, the global registry is used by default. - AnyResolver AnyResolver -} - -// JSONPBUnmarshaler is implemented by protobuf messages that customize the way -// they are unmarshaled from JSON. Messages that implement this should also -// implement JSONPBMarshaler so that the custom format can be produced. -// -// The JSON unmarshaling must follow the JSON to proto specification: -// -// https://developers.google.com/protocol-buffers/docs/proto3#json -// -// Deprecated: Custom types should implement protobuf reflection instead. -type JSONPBUnmarshaler interface { - UnmarshalJSONPB(*Unmarshaler, []byte) error -} - -// Unmarshal unmarshals a JSON object from r into m. -func (u *Unmarshaler) Unmarshal(r io.Reader, m proto.Message) error { - return u.UnmarshalNext(json.NewDecoder(r), m) -} - -// UnmarshalNext unmarshals the next JSON object from d into m. -func (u *Unmarshaler) UnmarshalNext(d *json.Decoder, m proto.Message) error { - if m == nil { - return errors.New("invalid nil message") - } - - // Parse the next JSON object from the stream. - raw := json.RawMessage{} - if err := d.Decode(&raw); err != nil { - return err - } - - // Check for custom unmarshalers first since they may not properly - // implement protobuf reflection that the logic below relies on. - if jsu, ok := m.(JSONPBUnmarshaler); ok { - return jsu.UnmarshalJSONPB(u, raw) - } - - mr := proto.MessageReflect(m) - - // NOTE: For historical reasons, a top-level null is treated as a noop. - // This is incorrect, but kept for compatibility. - if string(raw) == "null" && mr.Descriptor().FullName() != "google.protobuf.Value" { - return nil - } - - if wrapJSONUnmarshalV2 { - // NOTE: If input message is non-empty, we need to preserve merge semantics - // of the old jsonpb implementation. These semantics are not supported by - // the protobuf JSON specification. - isEmpty := true - mr.Range(func(protoreflect.FieldDescriptor, protoreflect.Value) bool { - isEmpty = false // at least one iteration implies non-empty - return false - }) - if !isEmpty { - // Perform unmarshaling into a newly allocated, empty message. - mr = mr.New() - - // Use a defer to copy all unmarshaled fields into the original message. - dst := proto.MessageReflect(m) - defer mr.Range(func(fd protoreflect.FieldDescriptor, v protoreflect.Value) bool { - dst.Set(fd, v) - return true - }) - } - - // Unmarshal using the v2 JSON unmarshaler. - opts := protojson.UnmarshalOptions{ - DiscardUnknown: u.AllowUnknownFields, - } - if u.AnyResolver != nil { - opts.Resolver = anyResolver{u.AnyResolver} - } - return opts.Unmarshal(raw, mr.Interface()) - } else { - if err := u.unmarshalMessage(mr, raw); err != nil { - return err - } - return protoV2.CheckInitialized(mr.Interface()) - } -} - -func (u *Unmarshaler) unmarshalMessage(m protoreflect.Message, in []byte) error { - md := m.Descriptor() - fds := md.Fields() - - if jsu, ok := proto.MessageV1(m.Interface()).(JSONPBUnmarshaler); ok { - return jsu.UnmarshalJSONPB(u, in) - } - - if string(in) == "null" && md.FullName() != "google.protobuf.Value" { - return nil - } - - switch wellKnownType(md.FullName()) { - case "Any": - var jsonObject map[string]json.RawMessage - if err := json.Unmarshal(in, &jsonObject); err != nil { - return err - } - - rawTypeURL, ok := jsonObject["@type"] - if !ok { - return errors.New("Any JSON doesn't have '@type'") - } - typeURL, err := unquoteString(string(rawTypeURL)) - if err != nil { - return fmt.Errorf("can't unmarshal Any's '@type': %q", rawTypeURL) - } - m.Set(fds.ByNumber(1), protoreflect.ValueOfString(typeURL)) - - var m2 protoreflect.Message - if u.AnyResolver != nil { - mi, err := u.AnyResolver.Resolve(typeURL) - if err != nil { - return err - } - m2 = proto.MessageReflect(mi) - } else { - mt, err := protoregistry.GlobalTypes.FindMessageByURL(typeURL) - if err != nil { - if err == protoregistry.NotFound { - return fmt.Errorf("could not resolve Any message type: %v", typeURL) - } - return err - } - m2 = mt.New() - } - - if wellKnownType(m2.Descriptor().FullName()) != "" { - rawValue, ok := jsonObject["value"] - if !ok { - return errors.New("Any JSON doesn't have 'value'") - } - if err := u.unmarshalMessage(m2, rawValue); err != nil { - return fmt.Errorf("can't unmarshal Any nested proto %v: %v", typeURL, err) - } - } else { - delete(jsonObject, "@type") - rawJSON, err := json.Marshal(jsonObject) - if err != nil { - return fmt.Errorf("can't generate JSON for Any's nested proto to be unmarshaled: %v", err) - } - if err = u.unmarshalMessage(m2, rawJSON); err != nil { - return fmt.Errorf("can't unmarshal Any nested proto %v: %v", typeURL, err) - } - } - - rawWire, err := protoV2.Marshal(m2.Interface()) - if err != nil { - return fmt.Errorf("can't marshal proto %v into Any.Value: %v", typeURL, err) - } - m.Set(fds.ByNumber(2), protoreflect.ValueOfBytes(rawWire)) - return nil - case "BoolValue", "BytesValue", "StringValue", - "Int32Value", "UInt32Value", "FloatValue", - "Int64Value", "UInt64Value", "DoubleValue": - fd := fds.ByNumber(1) - v, err := u.unmarshalValue(m.NewField(fd), in, fd) - if err != nil { - return err - } - m.Set(fd, v) - return nil - case "Duration": - v, err := unquoteString(string(in)) - if err != nil { - return err - } - d, err := time.ParseDuration(v) - if err != nil { - return fmt.Errorf("bad Duration: %v", err) - } - - sec := d.Nanoseconds() / 1e9 - nsec := d.Nanoseconds() % 1e9 - m.Set(fds.ByNumber(1), protoreflect.ValueOfInt64(int64(sec))) - m.Set(fds.ByNumber(2), protoreflect.ValueOfInt32(int32(nsec))) - return nil - case "Timestamp": - v, err := unquoteString(string(in)) - if err != nil { - return err - } - t, err := time.Parse(time.RFC3339Nano, v) - if err != nil { - return fmt.Errorf("bad Timestamp: %v", err) - } - - sec := t.Unix() - nsec := t.Nanosecond() - m.Set(fds.ByNumber(1), protoreflect.ValueOfInt64(int64(sec))) - m.Set(fds.ByNumber(2), protoreflect.ValueOfInt32(int32(nsec))) - return nil - case "Value": - switch { - case string(in) == "null": - m.Set(fds.ByNumber(1), protoreflect.ValueOfEnum(0)) - case string(in) == "true": - m.Set(fds.ByNumber(4), protoreflect.ValueOfBool(true)) - case string(in) == "false": - m.Set(fds.ByNumber(4), protoreflect.ValueOfBool(false)) - case hasPrefixAndSuffix('"', in, '"'): - s, err := unquoteString(string(in)) - if err != nil { - return fmt.Errorf("unrecognized type for Value %q", in) - } - m.Set(fds.ByNumber(3), protoreflect.ValueOfString(s)) - case hasPrefixAndSuffix('[', in, ']'): - v := m.Mutable(fds.ByNumber(6)) - return u.unmarshalMessage(v.Message(), in) - case hasPrefixAndSuffix('{', in, '}'): - v := m.Mutable(fds.ByNumber(5)) - return u.unmarshalMessage(v.Message(), in) - default: - f, err := strconv.ParseFloat(string(in), 0) - if err != nil { - return fmt.Errorf("unrecognized type for Value %q", in) - } - m.Set(fds.ByNumber(2), protoreflect.ValueOfFloat64(f)) - } - return nil - case "ListValue": - var jsonArray []json.RawMessage - if err := json.Unmarshal(in, &jsonArray); err != nil { - return fmt.Errorf("bad ListValue: %v", err) - } - - lv := m.Mutable(fds.ByNumber(1)).List() - for _, raw := range jsonArray { - ve := lv.NewElement() - if err := u.unmarshalMessage(ve.Message(), raw); err != nil { - return err - } - lv.Append(ve) - } - return nil - case "Struct": - var jsonObject map[string]json.RawMessage - if err := json.Unmarshal(in, &jsonObject); err != nil { - return fmt.Errorf("bad StructValue: %v", err) - } - - mv := m.Mutable(fds.ByNumber(1)).Map() - for key, raw := range jsonObject { - kv := protoreflect.ValueOf(key).MapKey() - vv := mv.NewValue() - if err := u.unmarshalMessage(vv.Message(), raw); err != nil { - return fmt.Errorf("bad value in StructValue for key %q: %v", key, err) - } - mv.Set(kv, vv) - } - return nil - } - - var jsonObject map[string]json.RawMessage - if err := json.Unmarshal(in, &jsonObject); err != nil { - return err - } - - // Handle known fields. - for i := 0; i < fds.Len(); i++ { - fd := fds.Get(i) - if fd.IsWeak() && fd.Message().IsPlaceholder() { - continue // weak reference is not linked in - } - - // Search for any raw JSON value associated with this field. - var raw json.RawMessage - name := string(fd.Name()) - if fd.Kind() == protoreflect.GroupKind { - name = string(fd.Message().Name()) - } - if v, ok := jsonObject[name]; ok { - delete(jsonObject, name) - raw = v - } - name = string(fd.JSONName()) - if v, ok := jsonObject[name]; ok { - delete(jsonObject, name) - raw = v - } - - field := m.NewField(fd) - // Unmarshal the field value. - if raw == nil || (string(raw) == "null" && !isSingularWellKnownValue(fd) && !isSingularJSONPBUnmarshaler(field, fd)) { - continue - } - v, err := u.unmarshalValue(field, raw, fd) - if err != nil { - return err - } - m.Set(fd, v) - } - - // Handle extension fields. - for name, raw := range jsonObject { - if !strings.HasPrefix(name, "[") || !strings.HasSuffix(name, "]") { - continue - } - - // Resolve the extension field by name. - xname := protoreflect.FullName(name[len("[") : len(name)-len("]")]) - xt, _ := protoregistry.GlobalTypes.FindExtensionByName(xname) - if xt == nil && isMessageSet(md) { - xt, _ = protoregistry.GlobalTypes.FindExtensionByName(xname.Append("message_set_extension")) - } - if xt == nil { - continue - } - delete(jsonObject, name) - fd := xt.TypeDescriptor() - if fd.ContainingMessage().FullName() != m.Descriptor().FullName() { - return fmt.Errorf("extension field %q does not extend message %q", xname, m.Descriptor().FullName()) - } - - field := m.NewField(fd) - // Unmarshal the field value. - if raw == nil || (string(raw) == "null" && !isSingularWellKnownValue(fd) && !isSingularJSONPBUnmarshaler(field, fd)) { - continue - } - v, err := u.unmarshalValue(field, raw, fd) - if err != nil { - return err - } - m.Set(fd, v) - } - - if !u.AllowUnknownFields && len(jsonObject) > 0 { - for name := range jsonObject { - return fmt.Errorf("unknown field %q in %v", name, md.FullName()) - } - } - return nil -} - -func isSingularWellKnownValue(fd protoreflect.FieldDescriptor) bool { - if fd.Cardinality() == protoreflect.Repeated { - return false - } - if md := fd.Message(); md != nil { - return md.FullName() == "google.protobuf.Value" - } - if ed := fd.Enum(); ed != nil { - return ed.FullName() == "google.protobuf.NullValue" - } - return false -} - -func isSingularJSONPBUnmarshaler(v protoreflect.Value, fd protoreflect.FieldDescriptor) bool { - if fd.Message() != nil && fd.Cardinality() != protoreflect.Repeated { - _, ok := proto.MessageV1(v.Interface()).(JSONPBUnmarshaler) - return ok - } - return false -} - -func (u *Unmarshaler) unmarshalValue(v protoreflect.Value, in []byte, fd protoreflect.FieldDescriptor) (protoreflect.Value, error) { - switch { - case fd.IsList(): - var jsonArray []json.RawMessage - if err := json.Unmarshal(in, &jsonArray); err != nil { - return v, err - } - lv := v.List() - for _, raw := range jsonArray { - ve, err := u.unmarshalSingularValue(lv.NewElement(), raw, fd) - if err != nil { - return v, err - } - lv.Append(ve) - } - return v, nil - case fd.IsMap(): - var jsonObject map[string]json.RawMessage - if err := json.Unmarshal(in, &jsonObject); err != nil { - return v, err - } - kfd := fd.MapKey() - vfd := fd.MapValue() - mv := v.Map() - for key, raw := range jsonObject { - var kv protoreflect.MapKey - if kfd.Kind() == protoreflect.StringKind { - kv = protoreflect.ValueOf(key).MapKey() - } else { - v, err := u.unmarshalSingularValue(kfd.Default(), []byte(key), kfd) - if err != nil { - return v, err - } - kv = v.MapKey() - } - - vv, err := u.unmarshalSingularValue(mv.NewValue(), raw, vfd) - if err != nil { - return v, err - } - mv.Set(kv, vv) - } - return v, nil - default: - return u.unmarshalSingularValue(v, in, fd) - } -} - -var nonFinite = map[string]float64{ - `"NaN"`: math.NaN(), - `"Infinity"`: math.Inf(+1), - `"-Infinity"`: math.Inf(-1), -} - -func (u *Unmarshaler) unmarshalSingularValue(v protoreflect.Value, in []byte, fd protoreflect.FieldDescriptor) (protoreflect.Value, error) { - switch fd.Kind() { - case protoreflect.BoolKind: - return unmarshalValue(in, new(bool)) - case protoreflect.Int32Kind, protoreflect.Sint32Kind, protoreflect.Sfixed32Kind: - return unmarshalValue(trimQuote(in), new(int32)) - case protoreflect.Int64Kind, protoreflect.Sint64Kind, protoreflect.Sfixed64Kind: - return unmarshalValue(trimQuote(in), new(int64)) - case protoreflect.Uint32Kind, protoreflect.Fixed32Kind: - return unmarshalValue(trimQuote(in), new(uint32)) - case protoreflect.Uint64Kind, protoreflect.Fixed64Kind: - return unmarshalValue(trimQuote(in), new(uint64)) - case protoreflect.FloatKind: - if f, ok := nonFinite[string(in)]; ok { - return protoreflect.ValueOfFloat32(float32(f)), nil - } - return unmarshalValue(trimQuote(in), new(float32)) - case protoreflect.DoubleKind: - if f, ok := nonFinite[string(in)]; ok { - return protoreflect.ValueOfFloat64(float64(f)), nil - } - return unmarshalValue(trimQuote(in), new(float64)) - case protoreflect.StringKind: - return unmarshalValue(in, new(string)) - case protoreflect.BytesKind: - return unmarshalValue(in, new([]byte)) - case protoreflect.EnumKind: - if hasPrefixAndSuffix('"', in, '"') { - vd := fd.Enum().Values().ByName(protoreflect.Name(trimQuote(in))) - if vd == nil { - return v, fmt.Errorf("unknown value %q for enum %s", in, fd.Enum().FullName()) - } - return protoreflect.ValueOfEnum(vd.Number()), nil - } - return unmarshalValue(in, new(protoreflect.EnumNumber)) - case protoreflect.MessageKind, protoreflect.GroupKind: - err := u.unmarshalMessage(v.Message(), in) - return v, err - default: - panic(fmt.Sprintf("invalid kind %v", fd.Kind())) - } -} - -func unmarshalValue(in []byte, v interface{}) (protoreflect.Value, error) { - err := json.Unmarshal(in, v) - return protoreflect.ValueOf(reflect.ValueOf(v).Elem().Interface()), err -} - -func unquoteString(in string) (out string, err error) { - err = json.Unmarshal([]byte(in), &out) - return out, err -} - -func hasPrefixAndSuffix(prefix byte, in []byte, suffix byte) bool { - if len(in) >= 2 && in[0] == prefix && in[len(in)-1] == suffix { - return true - } - return false -} - -// trimQuote is like unquoteString but simply strips surrounding quotes. -// This is incorrect, but is behavior done by the legacy implementation. -func trimQuote(in []byte) []byte { - if len(in) >= 2 && in[0] == '"' && in[len(in)-1] == '"' { - in = in[1 : len(in)-1] - } - return in -} diff --git a/vendor/github.com/golang/protobuf/jsonpb/encode.go b/vendor/github.com/golang/protobuf/jsonpb/encode.go deleted file mode 100644 index e9438a93f33..00000000000 --- a/vendor/github.com/golang/protobuf/jsonpb/encode.go +++ /dev/null @@ -1,560 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package jsonpb - -import ( - "encoding/json" - "errors" - "fmt" - "io" - "math" - "reflect" - "sort" - "strconv" - "strings" - "time" - - "github.com/golang/protobuf/proto" - "google.golang.org/protobuf/encoding/protojson" - protoV2 "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/reflect/protoreflect" - "google.golang.org/protobuf/reflect/protoregistry" -) - -const wrapJSONMarshalV2 = false - -// Marshaler is a configurable object for marshaling protocol buffer messages -// to the specified JSON representation. -type Marshaler struct { - // OrigName specifies whether to use the original protobuf name for fields. - OrigName bool - - // EnumsAsInts specifies whether to render enum values as integers, - // as opposed to string values. - EnumsAsInts bool - - // EmitDefaults specifies whether to render fields with zero values. - EmitDefaults bool - - // Indent controls whether the output is compact or not. - // If empty, the output is compact JSON. Otherwise, every JSON object - // entry and JSON array value will be on its own line. - // Each line will be preceded by repeated copies of Indent, where the - // number of copies is the current indentation depth. - Indent string - - // AnyResolver is used to resolve the google.protobuf.Any well-known type. - // If unset, the global registry is used by default. - AnyResolver AnyResolver -} - -// JSONPBMarshaler is implemented by protobuf messages that customize the -// way they are marshaled to JSON. Messages that implement this should also -// implement JSONPBUnmarshaler so that the custom format can be parsed. -// -// The JSON marshaling must follow the proto to JSON specification: -// -// https://developers.google.com/protocol-buffers/docs/proto3#json -// -// Deprecated: Custom types should implement protobuf reflection instead. -type JSONPBMarshaler interface { - MarshalJSONPB(*Marshaler) ([]byte, error) -} - -// Marshal serializes a protobuf message as JSON into w. -func (jm *Marshaler) Marshal(w io.Writer, m proto.Message) error { - b, err := jm.marshal(m) - if len(b) > 0 { - if _, err := w.Write(b); err != nil { - return err - } - } - return err -} - -// MarshalToString serializes a protobuf message as JSON in string form. -func (jm *Marshaler) MarshalToString(m proto.Message) (string, error) { - b, err := jm.marshal(m) - if err != nil { - return "", err - } - return string(b), nil -} - -func (jm *Marshaler) marshal(m proto.Message) ([]byte, error) { - v := reflect.ValueOf(m) - if m == nil || (v.Kind() == reflect.Ptr && v.IsNil()) { - return nil, errors.New("Marshal called with nil") - } - - // Check for custom marshalers first since they may not properly - // implement protobuf reflection that the logic below relies on. - if jsm, ok := m.(JSONPBMarshaler); ok { - return jsm.MarshalJSONPB(jm) - } - - if wrapJSONMarshalV2 { - opts := protojson.MarshalOptions{ - UseProtoNames: jm.OrigName, - UseEnumNumbers: jm.EnumsAsInts, - EmitUnpopulated: jm.EmitDefaults, - Indent: jm.Indent, - } - if jm.AnyResolver != nil { - opts.Resolver = anyResolver{jm.AnyResolver} - } - return opts.Marshal(proto.MessageReflect(m).Interface()) - } else { - // Check for unpopulated required fields first. - m2 := proto.MessageReflect(m) - if err := protoV2.CheckInitialized(m2.Interface()); err != nil { - return nil, err - } - - w := jsonWriter{Marshaler: jm} - err := w.marshalMessage(m2, "", "") - return w.buf, err - } -} - -type jsonWriter struct { - *Marshaler - buf []byte -} - -func (w *jsonWriter) write(s string) { - w.buf = append(w.buf, s...) -} - -func (w *jsonWriter) marshalMessage(m protoreflect.Message, indent, typeURL string) error { - if jsm, ok := proto.MessageV1(m.Interface()).(JSONPBMarshaler); ok { - b, err := jsm.MarshalJSONPB(w.Marshaler) - if err != nil { - return err - } - if typeURL != "" { - // we are marshaling this object to an Any type - var js map[string]*json.RawMessage - if err = json.Unmarshal(b, &js); err != nil { - return fmt.Errorf("type %T produced invalid JSON: %v", m.Interface(), err) - } - turl, err := json.Marshal(typeURL) - if err != nil { - return fmt.Errorf("failed to marshal type URL %q to JSON: %v", typeURL, err) - } - js["@type"] = (*json.RawMessage)(&turl) - if b, err = json.Marshal(js); err != nil { - return err - } - } - w.write(string(b)) - return nil - } - - md := m.Descriptor() - fds := md.Fields() - - // Handle well-known types. - const secondInNanos = int64(time.Second / time.Nanosecond) - switch wellKnownType(md.FullName()) { - case "Any": - return w.marshalAny(m, indent) - case "BoolValue", "BytesValue", "StringValue", - "Int32Value", "UInt32Value", "FloatValue", - "Int64Value", "UInt64Value", "DoubleValue": - fd := fds.ByNumber(1) - return w.marshalValue(fd, m.Get(fd), indent) - case "Duration": - const maxSecondsInDuration = 315576000000 - // "Generated output always contains 0, 3, 6, or 9 fractional digits, - // depending on required precision." - s := m.Get(fds.ByNumber(1)).Int() - ns := m.Get(fds.ByNumber(2)).Int() - if s < -maxSecondsInDuration || s > maxSecondsInDuration { - return fmt.Errorf("seconds out of range %v", s) - } - if ns <= -secondInNanos || ns >= secondInNanos { - return fmt.Errorf("ns out of range (%v, %v)", -secondInNanos, secondInNanos) - } - if (s > 0 && ns < 0) || (s < 0 && ns > 0) { - return errors.New("signs of seconds and nanos do not match") - } - var sign string - if s < 0 || ns < 0 { - sign, s, ns = "-", -1*s, -1*ns - } - x := fmt.Sprintf("%s%d.%09d", sign, s, ns) - x = strings.TrimSuffix(x, "000") - x = strings.TrimSuffix(x, "000") - x = strings.TrimSuffix(x, ".000") - w.write(fmt.Sprintf(`"%vs"`, x)) - return nil - case "Timestamp": - // "RFC 3339, where generated output will always be Z-normalized - // and uses 0, 3, 6 or 9 fractional digits." - s := m.Get(fds.ByNumber(1)).Int() - ns := m.Get(fds.ByNumber(2)).Int() - if ns < 0 || ns >= secondInNanos { - return fmt.Errorf("ns out of range [0, %v)", secondInNanos) - } - t := time.Unix(s, ns).UTC() - // time.RFC3339Nano isn't exactly right (we need to get 3/6/9 fractional digits). - x := t.Format("2006-01-02T15:04:05.000000000") - x = strings.TrimSuffix(x, "000") - x = strings.TrimSuffix(x, "000") - x = strings.TrimSuffix(x, ".000") - w.write(fmt.Sprintf(`"%vZ"`, x)) - return nil - case "Value": - // JSON value; which is a null, number, string, bool, object, or array. - od := md.Oneofs().Get(0) - fd := m.WhichOneof(od) - if fd == nil { - return errors.New("nil Value") - } - return w.marshalValue(fd, m.Get(fd), indent) - case "Struct", "ListValue": - // JSON object or array. - fd := fds.ByNumber(1) - return w.marshalValue(fd, m.Get(fd), indent) - } - - w.write("{") - if w.Indent != "" { - w.write("\n") - } - - firstField := true - if typeURL != "" { - if err := w.marshalTypeURL(indent, typeURL); err != nil { - return err - } - firstField = false - } - - for i := 0; i < fds.Len(); { - fd := fds.Get(i) - if od := fd.ContainingOneof(); od != nil { - fd = m.WhichOneof(od) - i += od.Fields().Len() - if fd == nil { - continue - } - } else { - i++ - } - - v := m.Get(fd) - - if !m.Has(fd) { - if !w.EmitDefaults || fd.ContainingOneof() != nil { - continue - } - if fd.Cardinality() != protoreflect.Repeated && (fd.Message() != nil || fd.Syntax() == protoreflect.Proto2) { - v = protoreflect.Value{} // use "null" for singular messages or proto2 scalars - } - } - - if !firstField { - w.writeComma() - } - if err := w.marshalField(fd, v, indent); err != nil { - return err - } - firstField = false - } - - // Handle proto2 extensions. - if md.ExtensionRanges().Len() > 0 { - // Collect a sorted list of all extension descriptor and values. - type ext struct { - desc protoreflect.FieldDescriptor - val protoreflect.Value - } - var exts []ext - m.Range(func(fd protoreflect.FieldDescriptor, v protoreflect.Value) bool { - if fd.IsExtension() { - exts = append(exts, ext{fd, v}) - } - return true - }) - sort.Slice(exts, func(i, j int) bool { - return exts[i].desc.Number() < exts[j].desc.Number() - }) - - for _, ext := range exts { - if !firstField { - w.writeComma() - } - if err := w.marshalField(ext.desc, ext.val, indent); err != nil { - return err - } - firstField = false - } - } - - if w.Indent != "" { - w.write("\n") - w.write(indent) - } - w.write("}") - return nil -} - -func (w *jsonWriter) writeComma() { - if w.Indent != "" { - w.write(",\n") - } else { - w.write(",") - } -} - -func (w *jsonWriter) marshalAny(m protoreflect.Message, indent string) error { - // "If the Any contains a value that has a special JSON mapping, - // it will be converted as follows: {"@type": xxx, "value": yyy}. - // Otherwise, the value will be converted into a JSON object, - // and the "@type" field will be inserted to indicate the actual data type." - md := m.Descriptor() - typeURL := m.Get(md.Fields().ByNumber(1)).String() - rawVal := m.Get(md.Fields().ByNumber(2)).Bytes() - - var m2 protoreflect.Message - if w.AnyResolver != nil { - mi, err := w.AnyResolver.Resolve(typeURL) - if err != nil { - return err - } - m2 = proto.MessageReflect(mi) - } else { - mt, err := protoregistry.GlobalTypes.FindMessageByURL(typeURL) - if err != nil { - return err - } - m2 = mt.New() - } - - if err := protoV2.Unmarshal(rawVal, m2.Interface()); err != nil { - return err - } - - if wellKnownType(m2.Descriptor().FullName()) == "" { - return w.marshalMessage(m2, indent, typeURL) - } - - w.write("{") - if w.Indent != "" { - w.write("\n") - } - if err := w.marshalTypeURL(indent, typeURL); err != nil { - return err - } - w.writeComma() - if w.Indent != "" { - w.write(indent) - w.write(w.Indent) - w.write(`"value": `) - } else { - w.write(`"value":`) - } - if err := w.marshalMessage(m2, indent+w.Indent, ""); err != nil { - return err - } - if w.Indent != "" { - w.write("\n") - w.write(indent) - } - w.write("}") - return nil -} - -func (w *jsonWriter) marshalTypeURL(indent, typeURL string) error { - if w.Indent != "" { - w.write(indent) - w.write(w.Indent) - } - w.write(`"@type":`) - if w.Indent != "" { - w.write(" ") - } - b, err := json.Marshal(typeURL) - if err != nil { - return err - } - w.write(string(b)) - return nil -} - -// marshalField writes field description and value to the Writer. -func (w *jsonWriter) marshalField(fd protoreflect.FieldDescriptor, v protoreflect.Value, indent string) error { - if w.Indent != "" { - w.write(indent) - w.write(w.Indent) - } - w.write(`"`) - switch { - case fd.IsExtension(): - // For message set, use the fname of the message as the extension name. - name := string(fd.FullName()) - if isMessageSet(fd.ContainingMessage()) { - name = strings.TrimSuffix(name, ".message_set_extension") - } - - w.write("[" + name + "]") - case w.OrigName: - name := string(fd.Name()) - if fd.Kind() == protoreflect.GroupKind { - name = string(fd.Message().Name()) - } - w.write(name) - default: - w.write(string(fd.JSONName())) - } - w.write(`":`) - if w.Indent != "" { - w.write(" ") - } - return w.marshalValue(fd, v, indent) -} - -func (w *jsonWriter) marshalValue(fd protoreflect.FieldDescriptor, v protoreflect.Value, indent string) error { - switch { - case fd.IsList(): - w.write("[") - comma := "" - lv := v.List() - for i := 0; i < lv.Len(); i++ { - w.write(comma) - if w.Indent != "" { - w.write("\n") - w.write(indent) - w.write(w.Indent) - w.write(w.Indent) - } - if err := w.marshalSingularValue(fd, lv.Get(i), indent+w.Indent); err != nil { - return err - } - comma = "," - } - if w.Indent != "" { - w.write("\n") - w.write(indent) - w.write(w.Indent) - } - w.write("]") - return nil - case fd.IsMap(): - kfd := fd.MapKey() - vfd := fd.MapValue() - mv := v.Map() - - // Collect a sorted list of all map keys and values. - type entry struct{ key, val protoreflect.Value } - var entries []entry - mv.Range(func(k protoreflect.MapKey, v protoreflect.Value) bool { - entries = append(entries, entry{k.Value(), v}) - return true - }) - sort.Slice(entries, func(i, j int) bool { - switch kfd.Kind() { - case protoreflect.BoolKind: - return !entries[i].key.Bool() && entries[j].key.Bool() - case protoreflect.Int32Kind, protoreflect.Sint32Kind, protoreflect.Sfixed32Kind, protoreflect.Int64Kind, protoreflect.Sint64Kind, protoreflect.Sfixed64Kind: - return entries[i].key.Int() < entries[j].key.Int() - case protoreflect.Uint32Kind, protoreflect.Fixed32Kind, protoreflect.Uint64Kind, protoreflect.Fixed64Kind: - return entries[i].key.Uint() < entries[j].key.Uint() - case protoreflect.StringKind: - return entries[i].key.String() < entries[j].key.String() - default: - panic("invalid kind") - } - }) - - w.write(`{`) - comma := "" - for _, entry := range entries { - w.write(comma) - if w.Indent != "" { - w.write("\n") - w.write(indent) - w.write(w.Indent) - w.write(w.Indent) - } - - s := fmt.Sprint(entry.key.Interface()) - b, err := json.Marshal(s) - if err != nil { - return err - } - w.write(string(b)) - - w.write(`:`) - if w.Indent != "" { - w.write(` `) - } - - if err := w.marshalSingularValue(vfd, entry.val, indent+w.Indent); err != nil { - return err - } - comma = "," - } - if w.Indent != "" { - w.write("\n") - w.write(indent) - w.write(w.Indent) - } - w.write(`}`) - return nil - default: - return w.marshalSingularValue(fd, v, indent) - } -} - -func (w *jsonWriter) marshalSingularValue(fd protoreflect.FieldDescriptor, v protoreflect.Value, indent string) error { - switch { - case !v.IsValid(): - w.write("null") - return nil - case fd.Message() != nil: - return w.marshalMessage(v.Message(), indent+w.Indent, "") - case fd.Enum() != nil: - if fd.Enum().FullName() == "google.protobuf.NullValue" { - w.write("null") - return nil - } - - vd := fd.Enum().Values().ByNumber(v.Enum()) - if vd == nil || w.EnumsAsInts { - w.write(strconv.Itoa(int(v.Enum()))) - } else { - w.write(`"` + string(vd.Name()) + `"`) - } - return nil - default: - switch v.Interface().(type) { - case float32, float64: - switch { - case math.IsInf(v.Float(), +1): - w.write(`"Infinity"`) - return nil - case math.IsInf(v.Float(), -1): - w.write(`"-Infinity"`) - return nil - case math.IsNaN(v.Float()): - w.write(`"NaN"`) - return nil - } - case int64, uint64: - w.write(fmt.Sprintf(`"%d"`, v.Interface())) - return nil - } - - b, err := json.Marshal(v.Interface()) - if err != nil { - return err - } - w.write(string(b)) - return nil - } -} diff --git a/vendor/github.com/golang/protobuf/jsonpb/json.go b/vendor/github.com/golang/protobuf/jsonpb/json.go deleted file mode 100644 index 480e2448de6..00000000000 --- a/vendor/github.com/golang/protobuf/jsonpb/json.go +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package jsonpb provides functionality to marshal and unmarshal between a -// protocol buffer message and JSON. It follows the specification at -// https://developers.google.com/protocol-buffers/docs/proto3#json. -// -// Do not rely on the default behavior of the standard encoding/json package -// when called on generated message types as it does not operate correctly. -// -// Deprecated: Use the "google.golang.org/protobuf/encoding/protojson" -// package instead. -package jsonpb - -import ( - "github.com/golang/protobuf/proto" - "google.golang.org/protobuf/reflect/protoreflect" - "google.golang.org/protobuf/reflect/protoregistry" - "google.golang.org/protobuf/runtime/protoimpl" -) - -// AnyResolver takes a type URL, present in an Any message, -// and resolves it into an instance of the associated message. -type AnyResolver interface { - Resolve(typeURL string) (proto.Message, error) -} - -type anyResolver struct{ AnyResolver } - -func (r anyResolver) FindMessageByName(message protoreflect.FullName) (protoreflect.MessageType, error) { - return r.FindMessageByURL(string(message)) -} - -func (r anyResolver) FindMessageByURL(url string) (protoreflect.MessageType, error) { - m, err := r.Resolve(url) - if err != nil { - return nil, err - } - return protoimpl.X.MessageTypeOf(m), nil -} - -func (r anyResolver) FindExtensionByName(field protoreflect.FullName) (protoreflect.ExtensionType, error) { - return protoregistry.GlobalTypes.FindExtensionByName(field) -} - -func (r anyResolver) FindExtensionByNumber(message protoreflect.FullName, field protoreflect.FieldNumber) (protoreflect.ExtensionType, error) { - return protoregistry.GlobalTypes.FindExtensionByNumber(message, field) -} - -func wellKnownType(s protoreflect.FullName) string { - if s.Parent() == "google.protobuf" { - switch s.Name() { - case "Empty", "Any", - "BoolValue", "BytesValue", "StringValue", - "Int32Value", "UInt32Value", "FloatValue", - "Int64Value", "UInt64Value", "DoubleValue", - "Duration", "Timestamp", - "NullValue", "Struct", "Value", "ListValue": - return string(s.Name()) - } - } - return "" -} - -func isMessageSet(md protoreflect.MessageDescriptor) bool { - ms, ok := md.(interface{ IsMessageSet() bool }) - return ok && ms.IsMessageSet() -} diff --git a/vendor/github.com/golang/protobuf/ptypes/empty/empty.pb.go b/vendor/github.com/golang/protobuf/ptypes/empty/empty.pb.go deleted file mode 100644 index 16686a65523..00000000000 --- a/vendor/github.com/golang/protobuf/ptypes/empty/empty.pb.go +++ /dev/null @@ -1,62 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: github.com/golang/protobuf/ptypes/empty/empty.proto - -package empty - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - emptypb "google.golang.org/protobuf/types/known/emptypb" - reflect "reflect" -) - -// Symbols defined in public import of google/protobuf/empty.proto. - -type Empty = emptypb.Empty - -var File_github_com_golang_protobuf_ptypes_empty_empty_proto protoreflect.FileDescriptor - -var file_github_com_golang_protobuf_ptypes_empty_empty_proto_rawDesc = []byte{ - 0x0a, 0x33, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x6c, - 0x61, 0x6e, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x70, 0x74, 0x79, - 0x70, 0x65, 0x73, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x42, 0x2f, 0x5a, 0x2d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2f, 0x70, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x3b, 0x65, 0x6d, - 0x70, 0x74, 0x79, 0x50, 0x00, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var file_github_com_golang_protobuf_ptypes_empty_empty_proto_goTypes = []interface{}{} -var file_github_com_golang_protobuf_ptypes_empty_empty_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_github_com_golang_protobuf_ptypes_empty_empty_proto_init() } -func file_github_com_golang_protobuf_ptypes_empty_empty_proto_init() { - if File_github_com_golang_protobuf_ptypes_empty_empty_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_github_com_golang_protobuf_ptypes_empty_empty_proto_rawDesc, - NumEnums: 0, - NumMessages: 0, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_github_com_golang_protobuf_ptypes_empty_empty_proto_goTypes, - DependencyIndexes: file_github_com_golang_protobuf_ptypes_empty_empty_proto_depIdxs, - }.Build() - File_github_com_golang_protobuf_ptypes_empty_empty_proto = out.File - file_github_com_golang_protobuf_ptypes_empty_empty_proto_rawDesc = nil - file_github_com_golang_protobuf_ptypes_empty_empty_proto_goTypes = nil - file_github_com_golang_protobuf_ptypes_empty_empty_proto_depIdxs = nil -} diff --git a/vendor/github.com/hyperledger/fabric-chaincode-go/LICENSE b/vendor/github.com/hyperledger/fabric-chaincode-go/v2/LICENSE similarity index 100% rename from vendor/github.com/hyperledger/fabric-chaincode-go/LICENSE rename to vendor/github.com/hyperledger/fabric-chaincode-go/v2/LICENSE diff --git a/vendor/github.com/hyperledger/fabric-chaincode-go/pkg/statebased/interfaces.go b/vendor/github.com/hyperledger/fabric-chaincode-go/v2/pkg/statebased/interfaces.go similarity index 98% rename from vendor/github.com/hyperledger/fabric-chaincode-go/pkg/statebased/interfaces.go rename to vendor/github.com/hyperledger/fabric-chaincode-go/v2/pkg/statebased/interfaces.go index 97e8d817fb6..7f410afd8bd 100644 --- a/vendor/github.com/hyperledger/fabric-chaincode-go/pkg/statebased/interfaces.go +++ b/vendor/github.com/hyperledger/fabric-chaincode-go/v2/pkg/statebased/interfaces.go @@ -46,6 +46,6 @@ type KeyEndorsementPolicy interface { // policy for this KVS key. DelOrgs(organizations ...string) - // ListOrgs returns an array of channel orgs that are required to endorse chnages + // ListOrgs returns an array of channel orgs that are required to endorse changes. ListOrgs() []string } diff --git a/vendor/github.com/hyperledger/fabric-chaincode-go/pkg/statebased/statebasedimpl.go b/vendor/github.com/hyperledger/fabric-chaincode-go/v2/pkg/statebased/statebasedimpl.go similarity index 92% rename from vendor/github.com/hyperledger/fabric-chaincode-go/pkg/statebased/statebasedimpl.go rename to vendor/github.com/hyperledger/fabric-chaincode-go/v2/pkg/statebased/statebasedimpl.go index a87176550eb..db17a737501 100644 --- a/vendor/github.com/hyperledger/fabric-chaincode-go/pkg/statebased/statebasedimpl.go +++ b/vendor/github.com/hyperledger/fabric-chaincode-go/v2/pkg/statebased/statebasedimpl.go @@ -7,9 +7,9 @@ import ( "fmt" "sort" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/msp" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/msp" + "google.golang.org/protobuf/proto" ) // stateEP implements the KeyEndorsementPolicy @@ -35,7 +35,7 @@ func NewStateEP(policy []byte) (KeyEndorsementPolicy, error) { return s, nil } -// Policy returns the endorsement policy as bytes +// Policy returns the endorsement policy as bytes. func (s *stateEP) Policy() ([]byte, error) { spe, err := s.policyFromMSPIDs() if err != nil { @@ -48,7 +48,7 @@ func (s *stateEP) Policy() ([]byte, error) { return spBytes, nil } -// AddOrgs adds the specified channel orgs to the existing key-level EP +// AddOrgs adds the specified channel orgs to the existing key-level EP. func (s *stateEP) AddOrgs(role RoleType, neworgs ...string) error { var mspRole msp.MSPRole_MSPRoleType switch role { @@ -68,14 +68,14 @@ func (s *stateEP) AddOrgs(role RoleType, neworgs ...string) error { return nil } -// DelOrgs delete the specified channel orgs from the existing key-level EP +// DelOrgs delete the specified channel orgs from the existing key-level EP. func (s *stateEP) DelOrgs(delorgs ...string) { for _, delorg := range delorgs { delete(s.orgs, delorg) } } -// ListOrgs returns an array of channel orgs that are required to endorse chnages +// ListOrgs returns an array of channel orgs that are required to endorse changes. func (s *stateEP) ListOrgs() []string { orgNames := make([]string, 0, len(s.orgs)) for mspid := range s.orgs { @@ -87,7 +87,7 @@ func (s *stateEP) ListOrgs() []string { func (s *stateEP) setMSPIDsFromSP(sp *common.SignaturePolicyEnvelope) error { // iterate over the identities in this envelope for _, identity := range sp.Identities { - // this imlementation only supports the ROLE type + // this implementation only supports the ROLE type if identity.PrincipalClassification == msp.MSPPrincipal_ROLE { msprole := &msp.MSPRole{} err := proto.Unmarshal(identity.Principal, msprole) diff --git a/vendor/github.com/hyperledger/fabric-chaincode-go/shim/chaincodeserver.go b/vendor/github.com/hyperledger/fabric-chaincode-go/v2/shim/chaincodeserver.go similarity index 88% rename from vendor/github.com/hyperledger/fabric-chaincode-go/shim/chaincodeserver.go rename to vendor/github.com/hyperledger/fabric-chaincode-go/v2/shim/chaincodeserver.go index 2904e967b1f..455ec4a1d93 100644 --- a/vendor/github.com/hyperledger/fabric-chaincode-go/shim/chaincodeserver.go +++ b/vendor/github.com/hyperledger/fabric-chaincode-go/v2/shim/chaincodeserver.go @@ -7,8 +7,8 @@ import ( "crypto/tls" "errors" - "github.com/hyperledger/fabric-chaincode-go/shim/internal" - pb "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-chaincode-go/v2/shim/internal" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "google.golang.org/grpc/keepalive" ) @@ -38,7 +38,7 @@ type ChaincodeServer struct { } // Connect the bidi stream entry point called by chaincode to register with the Peer. -func (cs *ChaincodeServer) Connect(stream pb.Chaincode_ConnectServer) error { +func (cs *ChaincodeServer) Connect(stream peer.Chaincode_ConnectServer) error { return chatWithPeer(cs.CCID, stream, cs.CC) } @@ -72,7 +72,7 @@ func (cs *ChaincodeServer) Start() error { } // register the server with grpc ... - pb.RegisterChaincodeServer(server.Server, cs) + peer.RegisterChaincodeServer(server.Server, cs) // ... and start return server.Start() diff --git a/vendor/github.com/hyperledger/fabric-chaincode-go/shim/handler.go b/vendor/github.com/hyperledger/fabric-chaincode-go/v2/shim/handler.go similarity index 63% rename from vendor/github.com/hyperledger/fabric-chaincode-go/shim/handler.go rename to vendor/github.com/hyperledger/fabric-chaincode-go/v2/shim/handler.go index 9b66a0872e2..a465ae2639f 100644 --- a/vendor/github.com/hyperledger/fabric-chaincode-go/shim/handler.go +++ b/vendor/github.com/hyperledger/fabric-chaincode-go/v2/shim/handler.go @@ -8,8 +8,8 @@ import ( "fmt" "sync" - "github.com/golang/protobuf/proto" - pb "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" + "google.golang.org/protobuf/proto" ) type state string @@ -23,8 +23,8 @@ const ( // PeerChaincodeStream is the common stream interface for Peer - chaincode communication. // Both chaincode-as-server and chaincode-as-client patterns need to support this type PeerChaincodeStream interface { - Send(*pb.ChaincodeMessage) error - Recv() (*pb.ChaincodeMessage, error) + Send(*peer.ChaincodeMessage) error + Recv() (*peer.ChaincodeMessage, error) } // ClientStream supports the (original) chaincode-as-client interaction pattern @@ -52,7 +52,7 @@ type Handler struct { // need lock to protect chaincode from attempting // concurrent requests to the peer responseChannelsMutex sync.Mutex - responseChannels map[string]chan pb.ChaincodeMessage + responseChannels map[string]chan *peer.ChaincodeMessage } func shorttxid(txid string) string { @@ -63,7 +63,7 @@ func shorttxid(txid string) string { } // serialSend serializes calls to Send on the gRPC client. -func (h *Handler) serialSend(msg *pb.ChaincodeMessage) error { +func (h *Handler) serialSend(msg *peer.ChaincodeMessage) error { h.serialLock.Lock() defer h.serialLock.Unlock() @@ -73,7 +73,7 @@ func (h *Handler) serialSend(msg *pb.ChaincodeMessage) error { // serialSendAsync sends the provided message asynchronously in a separate // goroutine. The result of the send is communicated back to the caller via // errc. -func (h *Handler) serialSendAsync(msg *pb.ChaincodeMessage, errc chan<- error) { +func (h *Handler) serialSendAsync(msg *peer.ChaincodeMessage, errc chan<- error) { go func() { errc <- h.serialSend(msg) }() @@ -85,7 +85,7 @@ func transactionContextID(chainID, txid string) string { return chainID + txid } -func (h *Handler) createResponseChannel(channelID, txid string) (<-chan pb.ChaincodeMessage, error) { +func (h *Handler) createResponseChannel(channelID, txid string) (<-chan *peer.ChaincodeMessage, error) { h.responseChannelsMutex.Lock() defer h.responseChannelsMutex.Unlock() @@ -98,7 +98,7 @@ func (h *Handler) createResponseChannel(channelID, txid string) (<-chan pb.Chain return nil, fmt.Errorf("[%s] channel exists", shorttxid(txCtxID)) } - responseChan := make(chan pb.ChaincodeMessage) + responseChan := make(chan *peer.ChaincodeMessage) h.responseChannels[txCtxID] = responseChan return responseChan, nil } @@ -112,7 +112,7 @@ func (h *Handler) deleteResponseChannel(channelID, txid string) { } } -func (h *Handler) handleResponse(msg *pb.ChaincodeMessage) error { +func (h *Handler) handleResponse(msg *peer.ChaincodeMessage) error { h.responseChannelsMutex.Lock() defer h.responseChannelsMutex.Unlock() @@ -125,7 +125,7 @@ func (h *Handler) handleResponse(msg *pb.ChaincodeMessage) error { if responseCh == nil { return fmt.Errorf("[%s] responseChannel does not exist", shorttxid(msg.Txid)) } - responseCh <- *msg + responseCh <- msg return nil } @@ -133,10 +133,10 @@ func (h *Handler) handleResponse(msg *pb.ChaincodeMessage) error { // the provided responseChan. On success, the response message will be // returned. An error will be returned msg was not successfully sent to the // peer. -func (h *Handler) sendReceive(msg *pb.ChaincodeMessage, responseChan <-chan pb.ChaincodeMessage) (pb.ChaincodeMessage, error) { +func (h *Handler) sendReceive(msg *peer.ChaincodeMessage, responseChan <-chan *peer.ChaincodeMessage) (*peer.ChaincodeMessage, error) { err := h.serialSend(msg) if err != nil { - return pb.ChaincodeMessage{}, err + return &peer.ChaincodeMessage{}, err } outmsg := <-responseChan @@ -148,25 +148,25 @@ func newChaincodeHandler(peerChatStream PeerChaincodeStream, chaincode Chaincode return &Handler{ chatStream: peerChatStream, cc: chaincode, - responseChannels: map[string]chan pb.ChaincodeMessage{}, + responseChannels: map[string]chan *peer.ChaincodeMessage{}, state: created, } } -type stubHandlerFunc func(*pb.ChaincodeMessage) (*pb.ChaincodeMessage, error) +type stubHandlerFunc func(*peer.ChaincodeMessage) (*peer.ChaincodeMessage, error) -func (h *Handler) handleStubInteraction(handler stubHandlerFunc, msg *pb.ChaincodeMessage, errc chan<- error) { +func (h *Handler) handleStubInteraction(handler stubHandlerFunc, msg *peer.ChaincodeMessage, errc chan<- error) { resp, err := handler(msg) if err != nil { - resp = &pb.ChaincodeMessage{Type: pb.ChaincodeMessage_ERROR, Payload: []byte(err.Error()), Txid: msg.Txid, ChannelId: msg.ChannelId} + resp = &peer.ChaincodeMessage{Type: peer.ChaincodeMessage_ERROR, Payload: []byte(err.Error()), Txid: msg.Txid, ChannelId: msg.ChannelId} } h.serialSendAsync(resp, errc) } // handleInit calls the Init function of the associated chaincode. -func (h *Handler) handleInit(msg *pb.ChaincodeMessage) (*pb.ChaincodeMessage, error) { +func (h *Handler) handleInit(msg *peer.ChaincodeMessage) (*peer.ChaincodeMessage, error) { // Get the function and args from Payload - input := &pb.ChaincodeInput{} + input := &peer.ChaincodeInput{} err := proto.Unmarshal(msg.Payload, input) if err != nil { return nil, fmt.Errorf("failed to unmarshal input: %s", err) @@ -180,21 +180,21 @@ func (h *Handler) handleInit(msg *pb.ChaincodeMessage) (*pb.ChaincodeMessage, er res := h.cc.Init(stub) if res.Status >= ERROR { - return &pb.ChaincodeMessage{Type: pb.ChaincodeMessage_ERROR, Payload: []byte(res.Message), Txid: msg.Txid, ChaincodeEvent: stub.chaincodeEvent, ChannelId: msg.ChannelId}, nil + return &peer.ChaincodeMessage{Type: peer.ChaincodeMessage_ERROR, Payload: []byte(res.Message), Txid: msg.Txid, ChaincodeEvent: stub.chaincodeEvent, ChannelId: msg.ChannelId}, nil } - resBytes, err := proto.Marshal(&res) + resBytes, err := proto.Marshal(res) if err != nil { return nil, fmt.Errorf("failed to marshal response: %s", err) } - return &pb.ChaincodeMessage{Type: pb.ChaincodeMessage_COMPLETED, Payload: resBytes, Txid: msg.Txid, ChaincodeEvent: stub.chaincodeEvent, ChannelId: stub.ChannelID}, nil + return &peer.ChaincodeMessage{Type: peer.ChaincodeMessage_COMPLETED, Payload: resBytes, Txid: msg.Txid, ChaincodeEvent: stub.chaincodeEvent, ChannelId: stub.ChannelID}, nil } // handleTransaction calls Invoke on the associated chaincode. -func (h *Handler) handleTransaction(msg *pb.ChaincodeMessage) (*pb.ChaincodeMessage, error) { +func (h *Handler) handleTransaction(msg *peer.ChaincodeMessage) (*peer.ChaincodeMessage, error) { // Get the function and args from Payload - input := &pb.ChaincodeInput{} + input := &peer.ChaincodeInput{} err := proto.Unmarshal(msg.Payload, input) if err != nil { return nil, fmt.Errorf("failed to unmarshal input: %s", err) @@ -209,21 +209,21 @@ func (h *Handler) handleTransaction(msg *pb.ChaincodeMessage) (*pb.ChaincodeMess res := h.cc.Invoke(stub) // Endorser will handle error contained in Response. - resBytes, err := proto.Marshal(&res) + resBytes, err := proto.Marshal(res) if err != nil { return nil, fmt.Errorf("failed to marshal response: %s", err) } - return &pb.ChaincodeMessage{Type: pb.ChaincodeMessage_COMPLETED, Payload: resBytes, Txid: msg.Txid, ChaincodeEvent: stub.chaincodeEvent, ChannelId: stub.ChannelID}, nil + return &peer.ChaincodeMessage{Type: peer.ChaincodeMessage_COMPLETED, Payload: resBytes, Txid: msg.Txid, ChaincodeEvent: stub.chaincodeEvent, ChannelId: stub.ChannelID}, nil } // callPeerWithChaincodeMsg sends a chaincode message to the peer for the given // txid and channel and receives the response. -func (h *Handler) callPeerWithChaincodeMsg(msg *pb.ChaincodeMessage, channelID, txid string) (pb.ChaincodeMessage, error) { +func (h *Handler) callPeerWithChaincodeMsg(msg *peer.ChaincodeMessage, channelID, txid string) (*peer.ChaincodeMessage, error) { // Create the channel on which to communicate the response from the peer respChan, err := h.createResponseChannel(channelID, txid) if err != nil { - return pb.ChaincodeMessage{}, err + return &peer.ChaincodeMessage{}, err } defer h.deleteResponseChannel(channelID, txid) @@ -233,66 +233,66 @@ func (h *Handler) callPeerWithChaincodeMsg(msg *pb.ChaincodeMessage, channelID, // handleGetState communicates with the peer to fetch the requested state information from the ledger. func (h *Handler) handleGetState(collection string, key string, channelID string, txid string) ([]byte, error) { // Construct payload for GET_STATE - payloadBytes := marshalOrPanic(&pb.GetState{Collection: collection, Key: key}) + payloadBytes := marshalOrPanic(&peer.GetState{Collection: collection, Key: key}) - msg := &pb.ChaincodeMessage{Type: pb.ChaincodeMessage_GET_STATE, Payload: payloadBytes, Txid: txid, ChannelId: channelID} + msg := &peer.ChaincodeMessage{Type: peer.ChaincodeMessage_GET_STATE, Payload: payloadBytes, Txid: txid, ChannelId: channelID} responseMsg, err := h.callPeerWithChaincodeMsg(msg, channelID, txid) if err != nil { - return nil, fmt.Errorf("[%s] error sending %s: %s", shorttxid(txid), pb.ChaincodeMessage_GET_STATE, err) + return nil, fmt.Errorf("[%s] error sending %s: %s", shorttxid(txid), peer.ChaincodeMessage_GET_STATE, err) } - if responseMsg.Type == pb.ChaincodeMessage_RESPONSE { + if responseMsg.Type == peer.ChaincodeMessage_RESPONSE { // Success response return responseMsg.Payload, nil } - if responseMsg.Type == pb.ChaincodeMessage_ERROR { + if responseMsg.Type == peer.ChaincodeMessage_ERROR { // Error response return nil, fmt.Errorf("%s", responseMsg.Payload[:]) } // Incorrect chaincode message received - return nil, fmt.Errorf("[%s] incorrect chaincode message %s received. Expecting %s or %s", shorttxid(responseMsg.Txid), responseMsg.Type, pb.ChaincodeMessage_RESPONSE, pb.ChaincodeMessage_ERROR) + return nil, fmt.Errorf("[%s] incorrect chaincode message %s received. Expecting %s or %s", shorttxid(responseMsg.Txid), responseMsg.Type, peer.ChaincodeMessage_RESPONSE, peer.ChaincodeMessage_ERROR) } func (h *Handler) handleGetPrivateDataHash(collection string, key string, channelID string, txid string) ([]byte, error) { // Construct payload for GET_PRIVATE_DATA_HASH - payloadBytes := marshalOrPanic(&pb.GetState{Collection: collection, Key: key}) + payloadBytes := marshalOrPanic(&peer.GetState{Collection: collection, Key: key}) - msg := &pb.ChaincodeMessage{Type: pb.ChaincodeMessage_GET_PRIVATE_DATA_HASH, Payload: payloadBytes, Txid: txid, ChannelId: channelID} + msg := &peer.ChaincodeMessage{Type: peer.ChaincodeMessage_GET_PRIVATE_DATA_HASH, Payload: payloadBytes, Txid: txid, ChannelId: channelID} responseMsg, err := h.callPeerWithChaincodeMsg(msg, channelID, txid) if err != nil { - return nil, fmt.Errorf("[%s] error sending %s: %s", shorttxid(txid), pb.ChaincodeMessage_GET_PRIVATE_DATA_HASH, err) + return nil, fmt.Errorf("[%s] error sending %s: %s", shorttxid(txid), peer.ChaincodeMessage_GET_PRIVATE_DATA_HASH, err) } - if responseMsg.Type == pb.ChaincodeMessage_RESPONSE { + if responseMsg.Type == peer.ChaincodeMessage_RESPONSE { // Success response return responseMsg.Payload, nil } - if responseMsg.Type == pb.ChaincodeMessage_ERROR { + if responseMsg.Type == peer.ChaincodeMessage_ERROR { // Error response return nil, fmt.Errorf("%s", responseMsg.Payload[:]) } // Incorrect chaincode message received - return nil, fmt.Errorf("[%s] incorrect chaincode message %s received. Expecting %s or %s", shorttxid(responseMsg.Txid), responseMsg.Type, pb.ChaincodeMessage_RESPONSE, pb.ChaincodeMessage_ERROR) + return nil, fmt.Errorf("[%s] incorrect chaincode message %s received. Expecting %s or %s", shorttxid(responseMsg.Txid), responseMsg.Type, peer.ChaincodeMessage_RESPONSE, peer.ChaincodeMessage_ERROR) } func (h *Handler) handleGetStateMetadata(collection string, key string, channelID string, txID string) (map[string][]byte, error) { // Construct payload for GET_STATE_METADATA - payloadBytes := marshalOrPanic(&pb.GetStateMetadata{Collection: collection, Key: key}) + payloadBytes := marshalOrPanic(&peer.GetStateMetadata{Collection: collection, Key: key}) - msg := &pb.ChaincodeMessage{Type: pb.ChaincodeMessage_GET_STATE_METADATA, Payload: payloadBytes, Txid: txID, ChannelId: channelID} + msg := &peer.ChaincodeMessage{Type: peer.ChaincodeMessage_GET_STATE_METADATA, Payload: payloadBytes, Txid: txID, ChannelId: channelID} responseMsg, err := h.callPeerWithChaincodeMsg(msg, channelID, txID) if err != nil { - return nil, fmt.Errorf("[%s] error sending %s: %s", shorttxid(txID), pb.ChaincodeMessage_GET_STATE_METADATA, err) + return nil, fmt.Errorf("[%s] error sending %s: %s", shorttxid(txID), peer.ChaincodeMessage_GET_STATE_METADATA, err) } - if responseMsg.Type == pb.ChaincodeMessage_RESPONSE { + if responseMsg.Type == peer.ChaincodeMessage_RESPONSE { // Success response - var mdResult pb.StateMetadataResult + var mdResult peer.StateMetadataResult err := proto.Unmarshal(responseMsg.Payload, &mdResult) if err != nil { - return nil, errors.New("Could not unmarshal metadata response") + return nil, errors.New("could not unmarshal metadata response") } metadata := make(map[string][]byte) for _, md := range mdResult.Entries { @@ -301,127 +301,127 @@ func (h *Handler) handleGetStateMetadata(collection string, key string, channelI return metadata, nil } - if responseMsg.Type == pb.ChaincodeMessage_ERROR { + if responseMsg.Type == peer.ChaincodeMessage_ERROR { // Error response return nil, fmt.Errorf("%s", responseMsg.Payload[:]) } // Incorrect chaincode message received - return nil, fmt.Errorf("[%s] incorrect chaincode message %s received. Expecting %s or %s", shorttxid(responseMsg.Txid), responseMsg.Type, pb.ChaincodeMessage_RESPONSE, pb.ChaincodeMessage_ERROR) + return nil, fmt.Errorf("[%s] incorrect chaincode message %s received. Expecting %s or %s", shorttxid(responseMsg.Txid), responseMsg.Type, peer.ChaincodeMessage_RESPONSE, peer.ChaincodeMessage_ERROR) } // handlePutState communicates with the peer to put state information into the ledger. func (h *Handler) handlePutState(collection string, key string, value []byte, channelID string, txid string) error { // Construct payload for PUT_STATE - payloadBytes := marshalOrPanic(&pb.PutState{Collection: collection, Key: key, Value: value}) + payloadBytes := marshalOrPanic(&peer.PutState{Collection: collection, Key: key, Value: value}) - msg := &pb.ChaincodeMessage{Type: pb.ChaincodeMessage_PUT_STATE, Payload: payloadBytes, Txid: txid, ChannelId: channelID} + msg := &peer.ChaincodeMessage{Type: peer.ChaincodeMessage_PUT_STATE, Payload: payloadBytes, Txid: txid, ChannelId: channelID} // Execute the request and get response responseMsg, err := h.callPeerWithChaincodeMsg(msg, channelID, txid) if err != nil { - return fmt.Errorf("[%s] error sending %s: %s", msg.Txid, pb.ChaincodeMessage_PUT_STATE, err) + return fmt.Errorf("[%s] error sending %s: %s", msg.Txid, peer.ChaincodeMessage_PUT_STATE, err) } - if responseMsg.Type == pb.ChaincodeMessage_RESPONSE { + if responseMsg.Type == peer.ChaincodeMessage_RESPONSE { // Success response return nil } - if responseMsg.Type == pb.ChaincodeMessage_ERROR { + if responseMsg.Type == peer.ChaincodeMessage_ERROR { // Error response return fmt.Errorf("%s", responseMsg.Payload[:]) } // Incorrect chaincode message received - return fmt.Errorf("[%s] incorrect chaincode message %s received. Expecting %s or %s", shorttxid(responseMsg.Txid), responseMsg.Type, pb.ChaincodeMessage_RESPONSE, pb.ChaincodeMessage_ERROR) + return fmt.Errorf("[%s] incorrect chaincode message %s received. Expecting %s or %s", shorttxid(responseMsg.Txid), responseMsg.Type, peer.ChaincodeMessage_RESPONSE, peer.ChaincodeMessage_ERROR) } func (h *Handler) handlePutStateMetadataEntry(collection string, key string, metakey string, metadata []byte, channelID string, txID string) error { // Construct payload for PUT_STATE_METADATA - md := &pb.StateMetadata{Metakey: metakey, Value: metadata} - payloadBytes := marshalOrPanic(&pb.PutStateMetadata{Collection: collection, Key: key, Metadata: md}) + md := &peer.StateMetadata{Metakey: metakey, Value: metadata} + payloadBytes := marshalOrPanic(&peer.PutStateMetadata{Collection: collection, Key: key, Metadata: md}) - msg := &pb.ChaincodeMessage{Type: pb.ChaincodeMessage_PUT_STATE_METADATA, Payload: payloadBytes, Txid: txID, ChannelId: channelID} + msg := &peer.ChaincodeMessage{Type: peer.ChaincodeMessage_PUT_STATE_METADATA, Payload: payloadBytes, Txid: txID, ChannelId: channelID} // Execute the request and get response responseMsg, err := h.callPeerWithChaincodeMsg(msg, channelID, txID) if err != nil { - return fmt.Errorf("[%s] error sending %s: %s", msg.Txid, pb.ChaincodeMessage_PUT_STATE_METADATA, err) + return fmt.Errorf("[%s] error sending %s: %s", msg.Txid, peer.ChaincodeMessage_PUT_STATE_METADATA, err) } - if responseMsg.Type == pb.ChaincodeMessage_RESPONSE { + if responseMsg.Type == peer.ChaincodeMessage_RESPONSE { // Success response return nil } - if responseMsg.Type == pb.ChaincodeMessage_ERROR { + if responseMsg.Type == peer.ChaincodeMessage_ERROR { // Error response return fmt.Errorf("%s", responseMsg.Payload[:]) } // Incorrect chaincode message received - return fmt.Errorf("[%s]incorrect chaincode message %s received. Expecting %s or %s", shorttxid(responseMsg.Txid), responseMsg.Type, pb.ChaincodeMessage_RESPONSE, pb.ChaincodeMessage_ERROR) + return fmt.Errorf("[%s]incorrect chaincode message %s received. Expecting %s or %s", shorttxid(responseMsg.Txid), responseMsg.Type, peer.ChaincodeMessage_RESPONSE, peer.ChaincodeMessage_ERROR) } // handleDelState communicates with the peer to delete a key from the state in the ledger. func (h *Handler) handleDelState(collection string, key string, channelID string, txid string) error { - payloadBytes := marshalOrPanic(&pb.DelState{Collection: collection, Key: key}) - msg := &pb.ChaincodeMessage{Type: pb.ChaincodeMessage_DEL_STATE, Payload: payloadBytes, Txid: txid, ChannelId: channelID} + payloadBytes := marshalOrPanic(&peer.DelState{Collection: collection, Key: key}) + msg := &peer.ChaincodeMessage{Type: peer.ChaincodeMessage_DEL_STATE, Payload: payloadBytes, Txid: txid, ChannelId: channelID} // Execute the request and get response responseMsg, err := h.callPeerWithChaincodeMsg(msg, channelID, txid) if err != nil { - return fmt.Errorf("[%s] error sending %s", shorttxid(msg.Txid), pb.ChaincodeMessage_DEL_STATE) + return fmt.Errorf("[%s] error sending %s", shorttxid(msg.Txid), peer.ChaincodeMessage_DEL_STATE) } - if responseMsg.Type == pb.ChaincodeMessage_RESPONSE { + if responseMsg.Type == peer.ChaincodeMessage_RESPONSE { // Success response return nil } - if responseMsg.Type == pb.ChaincodeMessage_ERROR { + if responseMsg.Type == peer.ChaincodeMessage_ERROR { // Error response return fmt.Errorf("%s", responseMsg.Payload[:]) } // Incorrect chaincode message received - return fmt.Errorf("[%s] incorrect chaincode message %s received. Expecting %s or %s", shorttxid(responseMsg.Txid), responseMsg.Type, pb.ChaincodeMessage_RESPONSE, pb.ChaincodeMessage_ERROR) + return fmt.Errorf("[%s] incorrect chaincode message %s received. Expecting %s or %s", shorttxid(responseMsg.Txid), responseMsg.Type, peer.ChaincodeMessage_RESPONSE, peer.ChaincodeMessage_ERROR) } -// handlerPurgeState communicates with the peer to purge a state from private data +// handlePurgeState communicates with the peer to purge a state from private data func (h *Handler) handlePurgeState(collection string, key string, channelID string, txid string) error { - payloadBytes := marshalOrPanic(&pb.DelState{Collection: collection, Key: key}) - msg := &pb.ChaincodeMessage{Type: pb.ChaincodeMessage_PURGE_PRIVATE_DATA, Payload: payloadBytes, Txid: txid, ChannelId: channelID} + payloadBytes := marshalOrPanic(&peer.DelState{Collection: collection, Key: key}) + msg := &peer.ChaincodeMessage{Type: peer.ChaincodeMessage_PURGE_PRIVATE_DATA, Payload: payloadBytes, Txid: txid, ChannelId: channelID} // Execute the request and get response responseMsg, err := h.callPeerWithChaincodeMsg(msg, channelID, txid) if err != nil { - return fmt.Errorf("[%s] error sending %s", shorttxid(msg.Txid), pb.ChaincodeMessage_DEL_STATE) + return fmt.Errorf("[%s] error sending %s", shorttxid(msg.Txid), peer.ChaincodeMessage_DEL_STATE) } - if responseMsg.Type == pb.ChaincodeMessage_RESPONSE { + if responseMsg.Type == peer.ChaincodeMessage_RESPONSE { // Success response return nil } - if responseMsg.Type == pb.ChaincodeMessage_ERROR { + if responseMsg.Type == peer.ChaincodeMessage_ERROR { // Error response return fmt.Errorf("%s", responseMsg.Payload[:]) } // Incorrect chaincode message received - return fmt.Errorf("[%s] incorrect chaincode message %s received. Expecting %s or %s", shorttxid(responseMsg.Txid), responseMsg.Type, pb.ChaincodeMessage_RESPONSE, pb.ChaincodeMessage_ERROR) + return fmt.Errorf("[%s] incorrect chaincode message %s received. Expecting %s or %s", shorttxid(responseMsg.Txid), responseMsg.Type, peer.ChaincodeMessage_RESPONSE, peer.ChaincodeMessage_ERROR) } func (h *Handler) handleGetStateByRange(collection, startKey, endKey string, metadata []byte, - channelID string, txid string) (*pb.QueryResponse, error) { + channelID string, txid string) (*peer.QueryResponse, error) { // Send GET_STATE_BY_RANGE message to peer chaincode support - payloadBytes := marshalOrPanic(&pb.GetStateByRange{Collection: collection, StartKey: startKey, EndKey: endKey, Metadata: metadata}) - msg := &pb.ChaincodeMessage{Type: pb.ChaincodeMessage_GET_STATE_BY_RANGE, Payload: payloadBytes, Txid: txid, ChannelId: channelID} + payloadBytes := marshalOrPanic(&peer.GetStateByRange{Collection: collection, StartKey: startKey, EndKey: endKey, Metadata: metadata}) + msg := &peer.ChaincodeMessage{Type: peer.ChaincodeMessage_GET_STATE_BY_RANGE, Payload: payloadBytes, Txid: txid, ChannelId: channelID} responseMsg, err := h.callPeerWithChaincodeMsg(msg, channelID, txid) if err != nil { - return nil, fmt.Errorf("[%s] error sending %s", shorttxid(msg.Txid), pb.ChaincodeMessage_GET_STATE_BY_RANGE) + return nil, fmt.Errorf("[%s] error sending %s", shorttxid(msg.Txid), peer.ChaincodeMessage_GET_STATE_BY_RANGE) } - if responseMsg.Type == pb.ChaincodeMessage_RESPONSE { + if responseMsg.Type == peer.ChaincodeMessage_RESPONSE { // Success response - rangeQueryResponse := &pb.QueryResponse{} + rangeQueryResponse := &peer.QueryResponse{} err = proto.Unmarshal(responseMsg.Payload, rangeQueryResponse) if err != nil { return nil, fmt.Errorf("[%s] GetStateByRangeResponse unmarshall error", shorttxid(responseMsg.Txid)) @@ -429,16 +429,16 @@ func (h *Handler) handleGetStateByRange(collection, startKey, endKey string, met return rangeQueryResponse, nil } - if responseMsg.Type == pb.ChaincodeMessage_ERROR { + if responseMsg.Type == peer.ChaincodeMessage_ERROR { // Error response return nil, fmt.Errorf("%s", responseMsg.Payload[:]) } // Incorrect chaincode message received - return nil, fmt.Errorf("incorrect chaincode message %s received. Expecting %s or %s", responseMsg.Type, pb.ChaincodeMessage_RESPONSE, pb.ChaincodeMessage_ERROR) + return nil, fmt.Errorf("incorrect chaincode message %s received. Expecting %s or %s", responseMsg.Type, peer.ChaincodeMessage_RESPONSE, peer.ChaincodeMessage_ERROR) } -func (h *Handler) handleQueryStateNext(id, channelID, txid string) (*pb.QueryResponse, error) { +func (h *Handler) handleQueryStateNext(id, channelID, txid string) (*peer.QueryResponse, error) { // Create the channel on which to communicate the response from validating peer respChan, err := h.createResponseChannel(channelID, txid) if err != nil { @@ -447,35 +447,35 @@ func (h *Handler) handleQueryStateNext(id, channelID, txid string) (*pb.QueryRes defer h.deleteResponseChannel(channelID, txid) // Send QUERY_STATE_NEXT message to peer chaincode support - payloadBytes := marshalOrPanic(&pb.QueryStateNext{Id: id}) + payloadBytes := marshalOrPanic(&peer.QueryStateNext{Id: id}) - msg := &pb.ChaincodeMessage{Type: pb.ChaincodeMessage_QUERY_STATE_NEXT, Payload: payloadBytes, Txid: txid, ChannelId: channelID} + msg := &peer.ChaincodeMessage{Type: peer.ChaincodeMessage_QUERY_STATE_NEXT, Payload: payloadBytes, Txid: txid, ChannelId: channelID} - var responseMsg pb.ChaincodeMessage + var responseMsg *peer.ChaincodeMessage if responseMsg, err = h.sendReceive(msg, respChan); err != nil { - return nil, fmt.Errorf("[%s] error sending %s", shorttxid(msg.Txid), pb.ChaincodeMessage_QUERY_STATE_NEXT) + return nil, fmt.Errorf("[%s] error sending %s", shorttxid(msg.Txid), peer.ChaincodeMessage_QUERY_STATE_NEXT) } - if responseMsg.Type == pb.ChaincodeMessage_RESPONSE { + if responseMsg.Type == peer.ChaincodeMessage_RESPONSE { // Success response - queryResponse := &pb.QueryResponse{} + queryResponse := &peer.QueryResponse{} if err = proto.Unmarshal(responseMsg.Payload, queryResponse); err != nil { return nil, fmt.Errorf("[%s] unmarshal error", shorttxid(responseMsg.Txid)) } return queryResponse, nil } - if responseMsg.Type == pb.ChaincodeMessage_ERROR { + if responseMsg.Type == peer.ChaincodeMessage_ERROR { // Error response return nil, fmt.Errorf("%s", responseMsg.Payload[:]) } // Incorrect chaincode message received - return nil, fmt.Errorf("incorrect chaincode message %s received. Expecting %s or %s", responseMsg.Type, pb.ChaincodeMessage_RESPONSE, pb.ChaincodeMessage_ERROR) + return nil, fmt.Errorf("incorrect chaincode message %s received. Expecting %s or %s", responseMsg.Type, peer.ChaincodeMessage_RESPONSE, peer.ChaincodeMessage_ERROR) } -func (h *Handler) handleQueryStateClose(id, channelID, txid string) (*pb.QueryResponse, error) { +func (h *Handler) handleQueryStateClose(id, channelID, txid string) (*peer.QueryResponse, error) { // Create the channel on which to communicate the response from validating peer respChan, err := h.createResponseChannel(channelID, txid) if err != nil { @@ -484,63 +484,63 @@ func (h *Handler) handleQueryStateClose(id, channelID, txid string) (*pb.QueryRe defer h.deleteResponseChannel(channelID, txid) // Send QUERY_STATE_CLOSE message to peer chaincode support - payloadBytes := marshalOrPanic(&pb.QueryStateClose{Id: id}) + payloadBytes := marshalOrPanic(&peer.QueryStateClose{Id: id}) - msg := &pb.ChaincodeMessage{Type: pb.ChaincodeMessage_QUERY_STATE_CLOSE, Payload: payloadBytes, Txid: txid, ChannelId: channelID} + msg := &peer.ChaincodeMessage{Type: peer.ChaincodeMessage_QUERY_STATE_CLOSE, Payload: payloadBytes, Txid: txid, ChannelId: channelID} - var responseMsg pb.ChaincodeMessage + var responseMsg *peer.ChaincodeMessage if responseMsg, err = h.sendReceive(msg, respChan); err != nil { - return nil, fmt.Errorf("[%s] error sending %s", shorttxid(msg.Txid), pb.ChaincodeMessage_QUERY_STATE_CLOSE) + return nil, fmt.Errorf("[%s] error sending %s", shorttxid(msg.Txid), peer.ChaincodeMessage_QUERY_STATE_CLOSE) } - if responseMsg.Type == pb.ChaincodeMessage_RESPONSE { + if responseMsg.Type == peer.ChaincodeMessage_RESPONSE { // Success response - queryResponse := &pb.QueryResponse{} + queryResponse := &peer.QueryResponse{} if err = proto.Unmarshal(responseMsg.Payload, queryResponse); err != nil { return nil, fmt.Errorf("[%s] unmarshal error", shorttxid(responseMsg.Txid)) } return queryResponse, nil } - if responseMsg.Type == pb.ChaincodeMessage_ERROR { + if responseMsg.Type == peer.ChaincodeMessage_ERROR { // Error response return nil, fmt.Errorf("%s", responseMsg.Payload[:]) } // Incorrect chaincode message received - return nil, fmt.Errorf("incorrect chaincode message %s received. Expecting %s or %s", responseMsg.Type, pb.ChaincodeMessage_RESPONSE, pb.ChaincodeMessage_ERROR) + return nil, fmt.Errorf("incorrect chaincode message %s received. Expecting %s or %s", responseMsg.Type, peer.ChaincodeMessage_RESPONSE, peer.ChaincodeMessage_ERROR) } func (h *Handler) handleGetQueryResult(collection string, query string, metadata []byte, - channelID string, txid string) (*pb.QueryResponse, error) { + channelID string, txid string) (*peer.QueryResponse, error) { // Send GET_QUERY_RESULT message to peer chaincode support - payloadBytes := marshalOrPanic(&pb.GetQueryResult{Collection: collection, Query: query, Metadata: metadata}) - msg := &pb.ChaincodeMessage{Type: pb.ChaincodeMessage_GET_QUERY_RESULT, Payload: payloadBytes, Txid: txid, ChannelId: channelID} + payloadBytes := marshalOrPanic(&peer.GetQueryResult{Collection: collection, Query: query, Metadata: metadata}) + msg := &peer.ChaincodeMessage{Type: peer.ChaincodeMessage_GET_QUERY_RESULT, Payload: payloadBytes, Txid: txid, ChannelId: channelID} responseMsg, err := h.callPeerWithChaincodeMsg(msg, channelID, txid) if err != nil { - return nil, fmt.Errorf("[%s] error sending %s", shorttxid(msg.Txid), pb.ChaincodeMessage_GET_QUERY_RESULT) + return nil, fmt.Errorf("[%s] error sending %s", shorttxid(msg.Txid), peer.ChaincodeMessage_GET_QUERY_RESULT) } - if responseMsg.Type == pb.ChaincodeMessage_RESPONSE { + if responseMsg.Type == peer.ChaincodeMessage_RESPONSE { // Success response - executeQueryResponse := &pb.QueryResponse{} + executeQueryResponse := &peer.QueryResponse{} if err = proto.Unmarshal(responseMsg.Payload, executeQueryResponse); err != nil { return nil, fmt.Errorf("[%s] unmarshal error", shorttxid(responseMsg.Txid)) } return executeQueryResponse, nil } - if responseMsg.Type == pb.ChaincodeMessage_ERROR { + if responseMsg.Type == peer.ChaincodeMessage_ERROR { // Error response return nil, fmt.Errorf("%s", responseMsg.Payload[:]) } // Incorrect chaincode message received - return nil, fmt.Errorf("incorrect chaincode message %s received. Expecting %s or %s", responseMsg.Type, pb.ChaincodeMessage_RESPONSE, pb.ChaincodeMessage_ERROR) + return nil, fmt.Errorf("incorrect chaincode message %s received. Expecting %s or %s", responseMsg.Type, peer.ChaincodeMessage_RESPONSE, peer.ChaincodeMessage_ERROR) } -func (h *Handler) handleGetHistoryForKey(key string, channelID string, txid string) (*pb.QueryResponse, error) { +func (h *Handler) handleGetHistoryForKey(key string, channelID string, txid string) (*peer.QueryResponse, error) { // Create the channel on which to communicate the response from validating peer respChan, err := h.createResponseChannel(channelID, txid) if err != nil { @@ -549,40 +549,40 @@ func (h *Handler) handleGetHistoryForKey(key string, channelID string, txid stri defer h.deleteResponseChannel(channelID, txid) // Send GET_HISTORY_FOR_KEY message to peer chaincode support - payloadBytes := marshalOrPanic(&pb.GetHistoryForKey{Key: key}) + payloadBytes := marshalOrPanic(&peer.GetHistoryForKey{Key: key}) - msg := &pb.ChaincodeMessage{Type: pb.ChaincodeMessage_GET_HISTORY_FOR_KEY, Payload: payloadBytes, Txid: txid, ChannelId: channelID} - var responseMsg pb.ChaincodeMessage + msg := &peer.ChaincodeMessage{Type: peer.ChaincodeMessage_GET_HISTORY_FOR_KEY, Payload: payloadBytes, Txid: txid, ChannelId: channelID} + var responseMsg *peer.ChaincodeMessage if responseMsg, err = h.sendReceive(msg, respChan); err != nil { - return nil, fmt.Errorf("[%s] error sending %s", shorttxid(msg.Txid), pb.ChaincodeMessage_GET_HISTORY_FOR_KEY) + return nil, fmt.Errorf("[%s] error sending %s", shorttxid(msg.Txid), peer.ChaincodeMessage_GET_HISTORY_FOR_KEY) } - if responseMsg.Type == pb.ChaincodeMessage_RESPONSE { + if responseMsg.Type == peer.ChaincodeMessage_RESPONSE { // Success response - getHistoryForKeyResponse := &pb.QueryResponse{} + getHistoryForKeyResponse := &peer.QueryResponse{} if err = proto.Unmarshal(responseMsg.Payload, getHistoryForKeyResponse); err != nil { return nil, fmt.Errorf("[%s] unmarshal error", shorttxid(responseMsg.Txid)) } return getHistoryForKeyResponse, nil } - if responseMsg.Type == pb.ChaincodeMessage_ERROR { + if responseMsg.Type == peer.ChaincodeMessage_ERROR { // Error response return nil, fmt.Errorf("%s", responseMsg.Payload[:]) } // Incorrect chaincode message received - return nil, fmt.Errorf("incorrect chaincode message %s received. Expecting %s or %s", responseMsg.Type, pb.ChaincodeMessage_RESPONSE, pb.ChaincodeMessage_ERROR) + return nil, fmt.Errorf("incorrect chaincode message %s received. Expecting %s or %s", responseMsg.Type, peer.ChaincodeMessage_RESPONSE, peer.ChaincodeMessage_ERROR) } -func (h *Handler) createResponse(status int32, payload []byte) pb.Response { - return pb.Response{Status: status, Payload: payload} +func (h *Handler) createResponse(status int32, payload []byte) *peer.Response { + return &peer.Response{Status: status, Payload: payload} } // handleInvokeChaincode communicates with the peer to invoke another chaincode. -func (h *Handler) handleInvokeChaincode(chaincodeName string, args [][]byte, channelID string, txid string) pb.Response { - payloadBytes := marshalOrPanic(&pb.ChaincodeSpec{ChaincodeId: &pb.ChaincodeID{Name: chaincodeName}, Input: &pb.ChaincodeInput{Args: args}}) +func (h *Handler) handleInvokeChaincode(chaincodeName string, args [][]byte, channelID string, txid string) *peer.Response { + payloadBytes := marshalOrPanic(&peer.ChaincodeSpec{ChaincodeId: &peer.ChaincodeID{Name: chaincodeName}, Input: &peer.ChaincodeInput{Args: args}}) // Create the channel on which to communicate the response from validating peer respChan, err := h.createResponseChannel(channelID, txid) @@ -592,54 +592,54 @@ func (h *Handler) handleInvokeChaincode(chaincodeName string, args [][]byte, cha defer h.deleteResponseChannel(channelID, txid) // Send INVOKE_CHAINCODE message to peer chaincode support - msg := &pb.ChaincodeMessage{Type: pb.ChaincodeMessage_INVOKE_CHAINCODE, Payload: payloadBytes, Txid: txid, ChannelId: channelID} + msg := &peer.ChaincodeMessage{Type: peer.ChaincodeMessage_INVOKE_CHAINCODE, Payload: payloadBytes, Txid: txid, ChannelId: channelID} - var responseMsg pb.ChaincodeMessage + var responseMsg *peer.ChaincodeMessage if responseMsg, err = h.sendReceive(msg, respChan); err != nil { - errStr := fmt.Sprintf("[%s] error sending %s", shorttxid(msg.Txid), pb.ChaincodeMessage_INVOKE_CHAINCODE) + errStr := fmt.Sprintf("[%s] error sending %s", shorttxid(msg.Txid), peer.ChaincodeMessage_INVOKE_CHAINCODE) return h.createResponse(ERROR, []byte(errStr)) } - if responseMsg.Type == pb.ChaincodeMessage_RESPONSE { + if responseMsg.Type == peer.ChaincodeMessage_RESPONSE { // Success response - respMsg := &pb.ChaincodeMessage{} + respMsg := &peer.ChaincodeMessage{} if err := proto.Unmarshal(responseMsg.Payload, respMsg); err != nil { return h.createResponse(ERROR, []byte(err.Error())) } - if respMsg.Type == pb.ChaincodeMessage_COMPLETED { + if respMsg.Type == peer.ChaincodeMessage_COMPLETED { // Success response - res := &pb.Response{} + res := &peer.Response{} if err = proto.Unmarshal(respMsg.Payload, res); err != nil { return h.createResponse(ERROR, []byte(err.Error())) } - return *res + return res } return h.createResponse(ERROR, responseMsg.Payload) } - if responseMsg.Type == pb.ChaincodeMessage_ERROR { + if responseMsg.Type == peer.ChaincodeMessage_ERROR { // Error response return h.createResponse(ERROR, responseMsg.Payload) } // Incorrect chaincode message received - return h.createResponse(ERROR, []byte(fmt.Sprintf("[%s] Incorrect chaincode message %s received. Expecting %s or %s", shorttxid(responseMsg.Txid), responseMsg.Type, pb.ChaincodeMessage_RESPONSE, pb.ChaincodeMessage_ERROR))) + return h.createResponse(ERROR, []byte(fmt.Sprintf("[%s] Incorrect chaincode message %s received. Expecting %s or %s", shorttxid(responseMsg.Txid), responseMsg.Type, peer.ChaincodeMessage_RESPONSE, peer.ChaincodeMessage_ERROR))) } // handleReady handles messages received from the peer when the handler is in the "ready" state. -func (h *Handler) handleReady(msg *pb.ChaincodeMessage, errc chan error) error { +func (h *Handler) handleReady(msg *peer.ChaincodeMessage, errc chan error) error { switch msg.Type { - case pb.ChaincodeMessage_RESPONSE, pb.ChaincodeMessage_ERROR: + case peer.ChaincodeMessage_RESPONSE, peer.ChaincodeMessage_ERROR: if err := h.handleResponse(msg); err != nil { return err } return nil - case pb.ChaincodeMessage_INIT: + case peer.ChaincodeMessage_INIT: go h.handleStubInteraction(h.handleInit, msg, errc) return nil - case pb.ChaincodeMessage_TRANSACTION: + case peer.ChaincodeMessage_TRANSACTION: go h.handleStubInteraction(h.handleTransaction, msg, errc) return nil @@ -649,8 +649,8 @@ func (h *Handler) handleReady(msg *pb.ChaincodeMessage, errc chan error) error { } // handleEstablished handles messages received from the peer when the handler is in the "established" state. -func (h *Handler) handleEstablished(msg *pb.ChaincodeMessage, errc chan error) error { - if msg.Type != pb.ChaincodeMessage_READY { +func (h *Handler) handleEstablished(msg *peer.ChaincodeMessage) error { + if msg.Type != peer.ChaincodeMessage_READY { return fmt.Errorf("[%s] Chaincode h cannot handle message (%s) while in state: %s", msg.Txid, msg.Type, h.state) } @@ -659,8 +659,8 @@ func (h *Handler) handleEstablished(msg *pb.ChaincodeMessage, errc chan error) e } // hanndleCreated handles messages received from the peer when the handler is in the "created" state. -func (h *Handler) handleCreated(msg *pb.ChaincodeMessage, errc chan error) error { - if msg.Type != pb.ChaincodeMessage_REGISTERED { +func (h *Handler) handleCreated(msg *peer.ChaincodeMessage) error { + if msg.Type != peer.ChaincodeMessage_REGISTERED { return fmt.Errorf("[%s] Chaincode h cannot handle message (%s) while in state: %s", msg.Txid, msg.Type, h.state) } @@ -669,8 +669,8 @@ func (h *Handler) handleCreated(msg *pb.ChaincodeMessage, errc chan error) error } // handleMessage message handles loop for shim side of chaincode/peer stream. -func (h *Handler) handleMessage(msg *pb.ChaincodeMessage, errc chan error) error { - if msg.Type == pb.ChaincodeMessage_KEEPALIVE { +func (h *Handler) handleMessage(msg *peer.ChaincodeMessage, errc chan error) error { + if msg.Type == peer.ChaincodeMessage_KEEPALIVE { h.serialSendAsync(msg, errc) return nil } @@ -680,17 +680,17 @@ func (h *Handler) handleMessage(msg *pb.ChaincodeMessage, errc chan error) error case ready: err = h.handleReady(msg, errc) case established: - err = h.handleEstablished(msg, errc) + err = h.handleEstablished(msg) case created: - err = h.handleCreated(msg, errc) + err = h.handleCreated(msg) default: panic(fmt.Sprintf("invalid handler state: %s", h.state)) } if err != nil { payload := []byte(err.Error()) - errorMsg := &pb.ChaincodeMessage{Type: pb.ChaincodeMessage_ERROR, Payload: payload, Txid: msg.Txid} - h.serialSend(errorMsg) + errorMsg := &peer.ChaincodeMessage{Type: peer.ChaincodeMessage_ERROR, Payload: payload, Txid: msg.Txid} + h.serialSend(errorMsg) //nolint:errcheck return err } diff --git a/vendor/github.com/hyperledger/fabric-chaincode-go/shim/interfaces.go b/vendor/github.com/hyperledger/fabric-chaincode-go/v2/shim/interfaces.go similarity index 94% rename from vendor/github.com/hyperledger/fabric-chaincode-go/shim/interfaces.go rename to vendor/github.com/hyperledger/fabric-chaincode-go/v2/shim/interfaces.go index 4eca32bf494..7e6a6431d0e 100644 --- a/vendor/github.com/hyperledger/fabric-chaincode-go/shim/interfaces.go +++ b/vendor/github.com/hyperledger/fabric-chaincode-go/v2/shim/interfaces.go @@ -4,9 +4,9 @@ package shim import ( - "github.com/golang/protobuf/ptypes/timestamp" - "github.com/hyperledger/fabric-protos-go/ledger/queryresult" - pb "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/queryresult" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" + "google.golang.org/protobuf/types/known/timestamppb" ) // Chaincode interface must be implemented by all chaincodes. The fabric runs @@ -15,12 +15,12 @@ type Chaincode interface { // Init is called during Instantiate transaction after the chaincode container // has been established for the first time, allowing the chaincode to // initialize its internal data - Init(stub ChaincodeStubInterface) pb.Response + Init(stub ChaincodeStubInterface) *peer.Response // Invoke is called to update or query the ledger in a proposal transaction. // Updated state variables are not committed to the ledger until the // transaction is committed. - Invoke(stub ChaincodeStubInterface) pb.Response + Invoke(stub ChaincodeStubInterface) *peer.Response } // ChaincodeStubInterface is used by deployable chaincode apps to access and @@ -47,13 +47,13 @@ type ChaincodeStubInterface interface { // GetTxID returns the tx_id of the transaction proposal, which is unique per // transaction and per client. See - // https://godoc.org/github.com/hyperledger/fabric-protos-go/common#ChannelHeader + // https://godoc.org/github.com/hyperledger/fabric-protos-go-apiv2/common#ChannelHeader // for further details. GetTxID() string // GetChannelID returns the channel the proposal is sent to for chaincode to process. // This would be the channel_id of the transaction proposal (see - // https://godoc.org/github.com/hyperledger/fabric-protos-go/common#ChannelHeader ) + // https://godoc.org/github.com/hyperledger/fabric-protos-go-apiv2/common#ChannelHeader ) // except where the chaincode is calling another on a different channel. GetChannelID() string @@ -71,7 +71,7 @@ type ChaincodeStubInterface interface { // the called chaincode on a different channel is a `Query`, which does not // participate in state validation checks in subsequent commit phase. // If `channel` is empty, the caller's channel is assumed. - InvokeChaincode(chaincodeName string, args [][]byte, channel string) pb.Response + InvokeChaincode(chaincodeName string, args [][]byte, channel string) *peer.Response // GetState returns the value of the specified `key` from the // ledger. Note that GetState doesn't read data from the writeset, which @@ -134,7 +134,7 @@ type ChaincodeStubInterface interface { // Call Close() on the returned StateQueryIteratorInterface object when done. // This call is only supported in a read only transaction. GetStateByRangeWithPagination(startKey, endKey string, pageSize int32, - bookmark string) (StateQueryIteratorInterface, *pb.QueryResponseMetadata, error) + bookmark string) (StateQueryIteratorInterface, *peer.QueryResponseMetadata, error) // GetStateByPartialCompositeKey queries the state in the ledger based on // a given partial composite key. This function returns an iterator @@ -147,7 +147,9 @@ type ChaincodeStubInterface interface { // See related functions SplitCompositeKey and CreateCompositeKey. // Call Close() on the returned StateQueryIteratorInterface object when done. // The query is re-executed during validation phase to ensure result set - // has not changed since transaction endorsement (phantom reads detected). + // has not changed since transaction endorsement (phantom reads detected). This function should be used only for + // a partial composite key. For a full composite key, an iter with empty response + // would be returned. GetStateByPartialCompositeKey(objectType string, keys []string) (StateQueryIteratorInterface, error) // GetStateByPartialCompositeKeyWithPagination queries the state in the ledger based on @@ -167,9 +169,11 @@ type ChaincodeStubInterface interface { // and should not contain U+0000 (nil byte) and U+10FFFF (biggest and unallocated // code point). See related functions SplitCompositeKey and CreateCompositeKey. // Call Close() on the returned StateQueryIteratorInterface object when done. - // This call is only supported in a read only transaction. + // This call is only supported in a read only transaction. This function should be used only for + // a partial composite key. For a full composite key, an iter with empty response + // would be returned. GetStateByPartialCompositeKeyWithPagination(objectType string, keys []string, - pageSize int32, bookmark string) (StateQueryIteratorInterface, *pb.QueryResponseMetadata, error) + pageSize int32, bookmark string) (StateQueryIteratorInterface, *peer.QueryResponseMetadata, error) // CreateCompositeKey combines the given `attributes` to form a composite // key. The objectType and attributes are expected to have only valid utf8 @@ -215,7 +219,7 @@ type ChaincodeStubInterface interface { // must be passed as bookmark. // This call is only supported in a read only transaction. GetQueryResultWithPagination(query string, pageSize int32, - bookmark string) (StateQueryIteratorInterface, *pb.QueryResponseMetadata, error) + bookmark string) (StateQueryIteratorInterface, *peer.QueryResponseMetadata, error) // GetHistoryForKey returns a history of key values across time. // For each historic key update, the historic value and associated @@ -307,7 +311,9 @@ type ChaincodeStubInterface interface { // See related functions SplitCompositeKey and CreateCompositeKey. // Call Close() on the returned StateQueryIteratorInterface object when done. // The query is re-executed during validation phase to ensure result set - // has not changed since transaction endorsement (phantom reads detected). + // has not changed since transaction endorsement (phantom reads detected). This function should be used only for + //a partial composite key. For a full composite key, an iter with empty response + //would be returned. GetPrivateDataByPartialCompositeKey(collection, objectType string, keys []string) (StateQueryIteratorInterface, error) // GetPrivateDataQueryResult performs a "rich" query against a given private @@ -349,12 +355,12 @@ type ChaincodeStubInterface interface { // GetSignedProposal returns the SignedProposal object, which contains all // data elements part of a transaction proposal. - GetSignedProposal() (*pb.SignedProposal, error) + GetSignedProposal() (*peer.SignedProposal, error) // GetTxTimestamp returns the timestamp when the transaction was created. This // is taken from the transaction ChannelHeader, therefore it will indicate the // client's timestamp and will have the same value across all endorsers. - GetTxTimestamp() (*timestamp.Timestamp, error) + GetTxTimestamp() (*timestamppb.Timestamp, error) // SetEvent allows the chaincode to set an event on the response to the // proposal to be included as part of a transaction. The event will be @@ -397,11 +403,3 @@ type HistoryQueryIteratorInterface interface { // Next returns the next key and value in the history query iterator. Next() (*queryresult.KeyModification, error) } - -// MockQueryIteratorInterface allows a chaincode to iterate over a set of -// key/value pairs returned by range query. -// TODO: Once the execute query and history query are implemented in MockStub, -// we need to update this interface -type MockQueryIteratorInterface interface { - StateQueryIteratorInterface -} diff --git a/vendor/github.com/hyperledger/fabric-chaincode-go/shim/internal/client.go b/vendor/github.com/hyperledger/fabric-chaincode-go/v2/shim/internal/client.go similarity index 66% rename from vendor/github.com/hyperledger/fabric-chaincode-go/shim/internal/client.go rename to vendor/github.com/hyperledger/fabric-chaincode-go/v2/shim/internal/client.go index 6b6dde0e524..4516375d129 100644 --- a/vendor/github.com/hyperledger/fabric-chaincode-go/shim/internal/client.go +++ b/vendor/github.com/hyperledger/fabric-chaincode-go/v2/shim/internal/client.go @@ -8,9 +8,10 @@ import ( "crypto/tls" "time" - peerpb "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" "google.golang.org/grpc" "google.golang.org/grpc/credentials" + "google.golang.org/grpc/credentials/insecure" "google.golang.org/grpc/keepalive" ) @@ -29,8 +30,6 @@ func NewClientConn( dialOpts := []grpc.DialOption{ grpc.WithKeepaliveParams(kaOpts), - grpc.WithBlock(), - grpc.FailOnNonTempDialError(true), grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(maxRecvMessageSize), grpc.MaxCallSendMsgSize(maxSendMessageSize), @@ -41,15 +40,13 @@ func NewClientConn( creds := credentials.NewTLS(tlsConf) dialOpts = append(dialOpts, grpc.WithTransportCredentials(creds)) } else { - dialOpts = append(dialOpts, grpc.WithInsecure()) + dialOpts = append(dialOpts, grpc.WithTransportCredentials(insecure.NewCredentials())) } - ctx, cancel := context.WithTimeout(context.Background(), dialTimeout) - defer cancel() - return grpc.DialContext(ctx, address, dialOpts...) + return grpc.NewClient(address, dialOpts...) } // NewRegisterClient ... -func NewRegisterClient(conn *grpc.ClientConn) (peerpb.ChaincodeSupport_RegisterClient, error) { - return peerpb.NewChaincodeSupportClient(conn).Register(context.Background()) +func NewRegisterClient(conn *grpc.ClientConn) (peer.ChaincodeSupport_RegisterClient, error) { + return peer.NewChaincodeSupportClient(conn).Register(context.Background()) } diff --git a/vendor/github.com/hyperledger/fabric-chaincode-go/shim/internal/config.go b/vendor/github.com/hyperledger/fabric-chaincode-go/v2/shim/internal/config.go similarity index 92% rename from vendor/github.com/hyperledger/fabric-chaincode-go/shim/internal/config.go rename to vendor/github.com/hyperledger/fabric-chaincode-go/v2/shim/internal/config.go index bed67ab2ad8..e7c2c4b5cda 100644 --- a/vendor/github.com/hyperledger/fabric-chaincode-go/shim/internal/config.go +++ b/vendor/github.com/hyperledger/fabric-chaincode-go/v2/shim/internal/config.go @@ -9,7 +9,6 @@ import ( "encoding/base64" "errors" "fmt" - "io/ioutil" "os" "strconv" "time" @@ -49,12 +48,12 @@ func LoadConfig() (Config, error) { var key []byte path, set := os.LookupEnv("CORE_TLS_CLIENT_KEY_FILE") if set { - key, err = ioutil.ReadFile(path) + key, err = os.ReadFile(path) if err != nil { return Config{}, fmt.Errorf("failed to read private key file: %s", err) } } else { - data, err := ioutil.ReadFile(os.Getenv("CORE_TLS_CLIENT_KEY_PATH")) + data, err := os.ReadFile(os.Getenv("CORE_TLS_CLIENT_KEY_PATH")) if err != nil { return Config{}, fmt.Errorf("failed to read private key file: %s", err) } @@ -67,12 +66,12 @@ func LoadConfig() (Config, error) { var cert []byte path, set = os.LookupEnv("CORE_TLS_CLIENT_CERT_FILE") if set { - cert, err = ioutil.ReadFile(path) + cert, err = os.ReadFile(path) if err != nil { return Config{}, fmt.Errorf("failed to read public key file: %s", err) } } else { - data, err := ioutil.ReadFile(os.Getenv("CORE_TLS_CLIENT_CERT_PATH")) + data, err := os.ReadFile(os.Getenv("CORE_TLS_CLIENT_CERT_PATH")) if err != nil { return Config{}, fmt.Errorf("failed to read public key file: %s", err) } @@ -82,7 +81,7 @@ func LoadConfig() (Config, error) { } } - root, err := ioutil.ReadFile(os.Getenv("CORE_PEER_TLS_ROOTCERT_FILE")) + root, err := os.ReadFile(os.Getenv("CORE_PEER_TLS_ROOTCERT_FILE")) if err != nil { return Config{}, fmt.Errorf("failed to read root cert file: %s", err) } diff --git a/vendor/github.com/hyperledger/fabric-chaincode-go/shim/internal/server.go b/vendor/github.com/hyperledger/fabric-chaincode-go/v2/shim/internal/server.go similarity index 100% rename from vendor/github.com/hyperledger/fabric-chaincode-go/shim/internal/server.go rename to vendor/github.com/hyperledger/fabric-chaincode-go/v2/shim/internal/server.go diff --git a/vendor/github.com/hyperledger/fabric-chaincode-go/shim/response.go b/vendor/github.com/hyperledger/fabric-chaincode-go/v2/shim/response.go similarity index 75% rename from vendor/github.com/hyperledger/fabric-chaincode-go/shim/response.go rename to vendor/github.com/hyperledger/fabric-chaincode-go/v2/shim/response.go index abe62866916..f56b4f68ad1 100644 --- a/vendor/github.com/hyperledger/fabric-chaincode-go/shim/response.go +++ b/vendor/github.com/hyperledger/fabric-chaincode-go/v2/shim/response.go @@ -4,7 +4,7 @@ package shim import ( - pb "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" ) const ( @@ -20,16 +20,16 @@ const ( ) // Success ... -func Success(payload []byte) pb.Response { - return pb.Response{ +func Success(payload []byte) *peer.Response { + return &peer.Response{ Status: OK, Payload: payload, } } // Error ... -func Error(msg string) pb.Response { - return pb.Response{ +func Error(msg string) *peer.Response { + return &peer.Response{ Status: ERROR, Message: msg, } diff --git a/vendor/github.com/hyperledger/fabric-chaincode-go/shim/shim.go b/vendor/github.com/hyperledger/fabric-chaincode-go/v2/shim/shim.go similarity index 85% rename from vendor/github.com/hyperledger/fabric-chaincode-go/shim/shim.go rename to vendor/github.com/hyperledger/fabric-chaincode-go/v2/shim/shim.go index 0148b86e2cb..f75839d8423 100644 --- a/vendor/github.com/hyperledger/fabric-chaincode-go/shim/shim.go +++ b/vendor/github.com/hyperledger/fabric-chaincode-go/v2/shim/shim.go @@ -13,9 +13,9 @@ import ( "os" "unicode/utf8" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-chaincode-go/shim/internal" - peerpb "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-chaincode-go/v2/shim/internal" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" + "google.golang.org/protobuf/proto" ) const ( @@ -28,14 +28,14 @@ const ( // peer as server var peerAddress = flag.String("peer.address", "", "peer address") -//this separates the chaincode stream interface establishment -//so we can replace it with a mock peer stream +// this separates the chaincode stream interface establishment +// so we can replace it with a mock peer stream type peerStreamGetter func(name string) (ClientStream, error) -//UTs to setup mock peer stream getter +// UTs to setup mock peer stream getter var streamGetter peerStreamGetter -//the non-mock user CC stream establishment func +// the non-mock user CC stream establishment func func userChaincodeStreamGetter(name string) (ClientStream, error) { if *peerAddress == "" { return nil, errors.New("flag 'peer.address' must be set") @@ -85,7 +85,7 @@ func StartInProc(chaincodename string, stream ClientStream, cc Chaincode) error // this is the chat stream resulting from the chaincode-as-client model where the chaincode initiates connection func chaincodeAsClientChat(chaincodename string, stream ClientStream, cc Chaincode) error { - defer stream.CloseSend() + defer stream.CloseSend() //nolint:Errcheck return chatWithPeer(chaincodename, stream, cc) } @@ -95,21 +95,21 @@ func chatWithPeer(chaincodename string, stream PeerChaincodeStream, cc Chaincode handler := newChaincodeHandler(stream, cc) // Send the ChaincodeID during register. - chaincodeID := &peerpb.ChaincodeID{Name: chaincodename} + chaincodeID := &peer.ChaincodeID{Name: chaincodename} payload, err := proto.Marshal(chaincodeID) if err != nil { return fmt.Errorf("error marshalling chaincodeID during chaincode registration: %s", err) } // Register on the stream - if err = handler.serialSend(&peerpb.ChaincodeMessage{Type: peerpb.ChaincodeMessage_REGISTER, Payload: payload}); err != nil { + if err = handler.serialSend(&peer.ChaincodeMessage{Type: peer.ChaincodeMessage_REGISTER, Payload: payload}); err != nil { return fmt.Errorf("error sending chaincode REGISTER: %s", err) } // holds return values from gRPC Recv below type recvMsg struct { - msg *peerpb.ChaincodeMessage + msg *peer.ChaincodeMessage err error } msgAvail := make(chan *recvMsg, 1) diff --git a/vendor/github.com/hyperledger/fabric-chaincode-go/shim/stub.go b/vendor/github.com/hyperledger/fabric-chaincode-go/v2/shim/stub.go similarity index 90% rename from vendor/github.com/hyperledger/fabric-chaincode-go/shim/stub.go rename to vendor/github.com/hyperledger/fabric-chaincode-go/v2/shim/stub.go index 09e4145eece..c4fd2a74a86 100644 --- a/vendor/github.com/hyperledger/fabric-chaincode-go/shim/stub.go +++ b/vendor/github.com/hyperledger/fabric-chaincode-go/v2/shim/stub.go @@ -11,11 +11,11 @@ import ( "os" "unicode/utf8" - "github.com/golang/protobuf/proto" - "github.com/golang/protobuf/ptypes/timestamp" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/ledger/queryresult" - pb "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/queryresult" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/types/known/timestamppb" ) // ChaincodeStub is an object passed to chaincode for shim side handling of @@ -23,11 +23,11 @@ import ( type ChaincodeStub struct { TxID string ChannelID string - chaincodeEvent *pb.ChaincodeEvent + chaincodeEvent *peer.ChaincodeEvent args [][]byte handler *Handler - signedProposal *pb.SignedProposal - proposal *pb.Proposal + signedProposal *peer.SignedProposal + proposal *peer.Proposal validationParameterMetakey string // Additional fields extracted from the signedProposal @@ -40,7 +40,7 @@ type ChaincodeStub struct { // ChaincodeInvocation functionality -func newChaincodeStub(handler *Handler, channelID, txid string, input *pb.ChaincodeInput, signedProposal *pb.SignedProposal) (*ChaincodeStub, error) { +func newChaincodeStub(handler *Handler, channelID, txid string, input *peer.ChaincodeInput, signedProposal *peer.SignedProposal) (*ChaincodeStub, error) { stub := &ChaincodeStub{ TxID: txid, ChannelID: channelID, @@ -48,7 +48,7 @@ func newChaincodeStub(handler *Handler, channelID, txid string, input *pb.Chainc handler: handler, signedProposal: signedProposal, decorations: input.Decorations, - validationParameterMetakey: pb.MetaDataKeys_VALIDATION_PARAMETER.String(), + validationParameterMetakey: peer.MetaDataKeys_VALIDATION_PARAMETER.String(), } // TODO: sanity check: verify that every call to init with a nil @@ -57,7 +57,7 @@ func newChaincodeStub(handler *Handler, channelID, txid string, input *pb.Chainc if signedProposal != nil { var err error - stub.proposal = &pb.Proposal{} + stub.proposal = &peer.Proposal{} err = proto.Unmarshal(signedProposal.ProposalBytes, stub.proposal) if err != nil { @@ -100,8 +100,8 @@ func newChaincodeStub(handler *Handler, channelID, txid string, input *pb.Chainc } stub.creator = shdr.GetCreator() - // extract trasient data from proposal payload - payload := &pb.ChaincodeProposalPayload{} + // extract transient data from proposal payload + payload := &peer.ChaincodeProposalPayload{} if err := proto.Unmarshal(stub.proposal.GetPayload(), payload); err != nil { return nil, fmt.Errorf("failed to extract proposal payload: %s", err) } @@ -148,7 +148,7 @@ func GetMSPID() (string, error) { // ------------- Call Chaincode functions --------------- // InvokeChaincode documentation can be found in interfaces.go -func (s *ChaincodeStub) InvokeChaincode(chaincodeName string, args [][]byte, channel string) pb.Response { +func (s *ChaincodeStub) InvokeChaincode(chaincodeName string, args [][]byte, channel string) *peer.Response { // Internally we handle chaincode name as a composite name if channel != "" { chaincodeName = chaincodeName + "/" + channel @@ -192,7 +192,7 @@ func (s *ChaincodeStub) PutState(key string, value []byte) error { return s.handler.handlePutState(collection, key, value, s.ChannelID, s.TxID) } -func (s *ChaincodeStub) createStateQueryIterator(response *pb.QueryResponse) *StateQueryIterator { +func (s *ChaincodeStub) createStateQueryIterator(response *peer.QueryResponse) *StateQueryIterator { return &StateQueryIterator{ CommonIterator: &CommonIterator{ handler: s.handler, @@ -343,7 +343,7 @@ type CommonIterator struct { handler *Handler channelID string txid string - response *pb.QueryResponse + response *peer.QueryResponse currentLoc int } @@ -372,8 +372,8 @@ const ( HistoryQueryResult ) -func createQueryResponseMetadata(metadataBytes []byte) (*pb.QueryResponseMetadata, error) { - metadata := &pb.QueryResponseMetadata{} +func createQueryResponseMetadata(metadataBytes []byte) (*peer.QueryResponseMetadata, error) { + metadata := &peer.QueryResponseMetadata{} err := proto.Unmarshal(metadataBytes, metadata) if err != nil { return nil, err @@ -383,7 +383,7 @@ func createQueryResponseMetadata(metadataBytes []byte) (*pb.QueryResponseMetadat } func (s *ChaincodeStub) handleGetStateByRange(collection, startKey, endKey string, - metadata []byte) (StateQueryIteratorInterface, *pb.QueryResponseMetadata, error) { + metadata []byte) (StateQueryIteratorInterface, *peer.QueryResponseMetadata, error) { response, err := s.handler.handleGetStateByRange(collection, startKey, endKey, metadata, s.ChannelID, s.TxID) if err != nil { @@ -400,7 +400,7 @@ func (s *ChaincodeStub) handleGetStateByRange(collection, startKey, endKey strin } func (s *ChaincodeStub) handleGetQueryResult(collection, query string, - metadata []byte) (StateQueryIteratorInterface, *pb.QueryResponseMetadata, error) { + metadata []byte) (StateQueryIteratorInterface, *peer.QueryResponseMetadata, error) { response, err := s.handler.handleGetQueryResult(collection, query, metadata, s.ChannelID, s.TxID) if err != nil { @@ -441,12 +441,12 @@ func (s *ChaincodeStub) GetHistoryForKey(key string) (HistoryQueryIteratorInterf return &HistoryQueryIterator{CommonIterator: &CommonIterator{s.handler, s.ChannelID, s.TxID, response, 0}}, nil } -//CreateCompositeKey documentation can be found in interfaces.go +// CreateCompositeKey documentation can be found in interfaces.go func (s *ChaincodeStub) CreateCompositeKey(objectType string, attributes []string) (string, error) { return CreateCompositeKey(objectType, attributes) } -//SplitCompositeKey documentation can be found in interfaces.go +// SplitCompositeKey documentation can be found in interfaces.go func (s *ChaincodeStub) SplitCompositeKey(compositeKey string) (string, []string, error) { return splitCompositeKey(compositeKey) } @@ -491,10 +491,10 @@ func validateCompositeKeyAttribute(str string) error { return nil } -//To ensure that simple keys do not go into composite key namespace, -//we validate simplekey to check whether the key starts with 0x00 (which -//is the namespace for compositeKey). This helps in avoding simple/composite -//key collisions. +// To ensure that simple keys do not go into composite key namespace, +// we validate simplekey to check whether the key starts with 0x00 (which +// is the namespace for compositeKey). This helps in avoiding simple/composite +// key collisions. func validateSimpleKeys(simpleKeys ...string) error { for _, key := range simpleKeys { if len(key) > 0 && key[0] == compositeKeyNamespace[0] { @@ -504,12 +504,7 @@ func validateSimpleKeys(simpleKeys ...string) error { return nil } -//GetStateByPartialCompositeKey function can be invoked by a chaincode to query the -//state based on a given partial composite key. This function returns an -//iterator which can be used to iterate over all composite keys whose prefix -//matches the given partial composite key. This function should be used only for -//a partial composite key. For a full composite key, an iter with empty response -//would be returned. +// GetStateByPartialCompositeKey documentation can be found in interfaces.go func (s *ChaincodeStub) GetStateByPartialCompositeKey(objectType string, attributes []string) (StateQueryIteratorInterface, error) { collection := "" startKey, endKey, err := s.createRangeKeysForPartialCompositeKey(objectType, attributes) @@ -524,7 +519,7 @@ func (s *ChaincodeStub) GetStateByPartialCompositeKey(objectType string, attribu func createQueryMetadata(pageSize int32, bookmark string) ([]byte, error) { // Construct the QueryMetadata with a page size and a bookmark needed for pagination - metadata := &pb.QueryMetadata{PageSize: pageSize, Bookmark: bookmark} + metadata := &peer.QueryMetadata{PageSize: pageSize, Bookmark: bookmark} metadataBytes, err := proto.Marshal(metadata) if err != nil { return nil, err @@ -534,7 +529,7 @@ func createQueryMetadata(pageSize int32, bookmark string) ([]byte, error) { // GetStateByRangeWithPagination ... func (s *ChaincodeStub) GetStateByRangeWithPagination(startKey, endKey string, pageSize int32, - bookmark string) (StateQueryIteratorInterface, *pb.QueryResponseMetadata, error) { + bookmark string) (StateQueryIteratorInterface, *peer.QueryResponseMetadata, error) { if startKey == "" { startKey = emptyKeySubstitute @@ -555,7 +550,7 @@ func (s *ChaincodeStub) GetStateByRangeWithPagination(startKey, endKey string, p // GetStateByPartialCompositeKeyWithPagination ... func (s *ChaincodeStub) GetStateByPartialCompositeKeyWithPagination(objectType string, keys []string, - pageSize int32, bookmark string) (StateQueryIteratorInterface, *pb.QueryResponseMetadata, error) { + pageSize int32, bookmark string) (StateQueryIteratorInterface, *peer.QueryResponseMetadata, error) { collection := "" @@ -573,7 +568,7 @@ func (s *ChaincodeStub) GetStateByPartialCompositeKeyWithPagination(objectType s // GetQueryResultWithPagination ... func (s *ChaincodeStub) GetQueryResultWithPagination(query string, pageSize int32, - bookmark string) (StateQueryIteratorInterface, *pb.QueryResponseMetadata, error) { + bookmark string) (StateQueryIteratorInterface, *peer.QueryResponseMetadata, error) { // Access public data by setting the collection to empty string collection := "" @@ -614,7 +609,7 @@ func (iter *CommonIterator) HasNext() bool { // or KeyModification depending on the result type (i.e., state (range/execute) // query, history query). Note that queryResult is an empty golang // interface that can hold values of any type. -func (iter *CommonIterator) getResultFromBytes(queryResultBytes *pb.QueryResultBytes, +func (iter *CommonIterator) getResultFromBytes(queryResultBytes *peer.QueryResultBytes, rType resultType) (queryResult, error) { if rType == StateQueryResult { @@ -723,7 +718,7 @@ func (s *ChaincodeStub) GetBinding() ([]byte, error) { } // GetSignedProposal documentation can be found in interfaces.go -func (s *ChaincodeStub) GetSignedProposal() (*pb.SignedProposal, error) { +func (s *ChaincodeStub) GetSignedProposal() (*peer.SignedProposal, error) { return s.signedProposal, nil } @@ -738,7 +733,7 @@ func (s *ChaincodeStub) GetArgsSlice() ([]byte, error) { } // GetTxTimestamp documentation can be found in interfaces.go -func (s *ChaincodeStub) GetTxTimestamp() (*timestamp.Timestamp, error) { +func (s *ChaincodeStub) GetTxTimestamp() (*timestamppb.Timestamp, error) { hdr := &common.Header{} if err := proto.Unmarshal(s.proposal.Header, hdr); err != nil { return nil, fmt.Errorf("error unmarshaling Header: %s", err) @@ -759,6 +754,6 @@ func (s *ChaincodeStub) SetEvent(name string, payload []byte) error { if name == "" { return errors.New("event name can not be empty string") } - s.chaincodeEvent = &pb.ChaincodeEvent{EventName: name, Payload: payload} + s.chaincodeEvent = &peer.ChaincodeEvent{EventName: name, Payload: payload} return nil } diff --git a/vendor/github.com/hyperledger/fabric-config/configtx/application.go b/vendor/github.com/hyperledger/fabric-config/configtx/application.go index 356f8147076..87f4b6a9aa9 100644 --- a/vendor/github.com/hyperledger/fabric-config/configtx/application.go +++ b/vendor/github.com/hyperledger/fabric-config/configtx/application.go @@ -10,9 +10,9 @@ import ( "errors" "fmt" - "github.com/golang/protobuf/proto" - cb "github.com/hyperledger/fabric-protos-go/common" - pb "github.com/hyperledger/fabric-protos-go/peer" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" + "google.golang.org/protobuf/proto" ) // Application is a copy of the orderer configuration with the addition of an anchor peers diff --git a/vendor/github.com/hyperledger/fabric-config/configtx/capabilities.go b/vendor/github.com/hyperledger/fabric-config/configtx/capabilities.go index 0be7434a888..c3fbe3dd010 100644 --- a/vendor/github.com/hyperledger/fabric-config/configtx/capabilities.go +++ b/vendor/github.com/hyperledger/fabric-config/configtx/capabilities.go @@ -10,8 +10,8 @@ import ( "errors" "fmt" - "github.com/golang/protobuf/proto" - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + "google.golang.org/protobuf/proto" ) // capabilitiesValue returns the config definition for a set of capabilities. diff --git a/vendor/github.com/hyperledger/fabric-config/configtx/channel.go b/vendor/github.com/hyperledger/fabric-config/configtx/channel.go index 5a8406e42a7..924aa5497ac 100644 --- a/vendor/github.com/hyperledger/fabric-config/configtx/channel.go +++ b/vendor/github.com/hyperledger/fabric-config/configtx/channel.go @@ -10,7 +10,7 @@ import ( "errors" "fmt" - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" ) // ChannelGroup encapsulates the parts of the config that control channels. diff --git a/vendor/github.com/hyperledger/fabric-config/configtx/config.go b/vendor/github.com/hyperledger/fabric-config/configtx/config.go index 261b5e16c33..3eea6f09149 100644 --- a/vendor/github.com/hyperledger/fabric-config/configtx/config.go +++ b/vendor/github.com/hyperledger/fabric-config/configtx/config.go @@ -24,11 +24,10 @@ import ( "strconv" "strings" - "github.com/golang/protobuf/proto" - "github.com/golang/protobuf/ptypes" - "github.com/golang/protobuf/ptypes/timestamp" - cb "github.com/hyperledger/fabric-protos-go/common" - mb "github.com/hyperledger/fabric-protos-go/msp" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + mb "github.com/hyperledger/fabric-protos-go-apiv2/msp" + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/types/known/timestamppb" ) // Channel is a channel configuration. @@ -535,11 +534,9 @@ func newEnvelope( // channelHeader creates a ChannelHeader. func channelHeader(headerType cb.HeaderType, version int32, channelID string, epoch uint64) *cb.ChannelHeader { return &cb.ChannelHeader{ - Type: int32(headerType), - Version: version, - Timestamp: ×tamp.Timestamp{ - Seconds: ptypes.TimestampNow().GetSeconds(), - }, + Type: int32(headerType), + Version: version, + Timestamp: timestamppb.Now(), ChannelId: channelID, Epoch: epoch, } diff --git a/vendor/github.com/hyperledger/fabric-config/configtx/consortiums.go b/vendor/github.com/hyperledger/fabric-config/configtx/consortiums.go index 094b8b7804a..e6528a420ac 100644 --- a/vendor/github.com/hyperledger/fabric-config/configtx/consortiums.go +++ b/vendor/github.com/hyperledger/fabric-config/configtx/consortiums.go @@ -10,9 +10,9 @@ import ( "errors" "fmt" - "github.com/golang/protobuf/proto" - cb "github.com/hyperledger/fabric-protos-go/common" - mb "github.com/hyperledger/fabric-protos-go/msp" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + mb "github.com/hyperledger/fabric-protos-go-apiv2/msp" + "google.golang.org/protobuf/proto" ) // Consortium is a group of non-orderer organizations used in channel transactions. diff --git a/vendor/github.com/hyperledger/fabric-config/configtx/internal/policydsl/policyparser.go b/vendor/github.com/hyperledger/fabric-config/configtx/internal/policydsl/policyparser.go index 4d545269a0e..a22c09a136f 100644 --- a/vendor/github.com/hyperledger/fabric-config/configtx/internal/policydsl/policyparser.go +++ b/vendor/github.com/hyperledger/fabric-config/configtx/internal/policydsl/policyparser.go @@ -14,9 +14,9 @@ import ( "strings" "github.com/Knetic/govaluate" - "github.com/golang/protobuf/proto" - cb "github.com/hyperledger/fabric-protos-go/common" - mb "github.com/hyperledger/fabric-protos-go/msp" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + mb "github.com/hyperledger/fabric-protos-go-apiv2/msp" + "google.golang.org/protobuf/proto" ) // Gate values diff --git a/vendor/github.com/hyperledger/fabric-config/configtx/msp.go b/vendor/github.com/hyperledger/fabric-config/configtx/msp.go index 422c1e5f9da..8aa5995175c 100644 --- a/vendor/github.com/hyperledger/fabric-config/configtx/msp.go +++ b/vendor/github.com/hyperledger/fabric-config/configtx/msp.go @@ -17,10 +17,10 @@ import ( "reflect" "time" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-config/configtx/membership" - cb "github.com/hyperledger/fabric-protos-go/common" - mb "github.com/hyperledger/fabric-protos-go/msp" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + mb "github.com/hyperledger/fabric-protos-go-apiv2/msp" + "google.golang.org/protobuf/proto" ) // MSP is the configuration information for a Fabric MSP. diff --git a/vendor/github.com/hyperledger/fabric-config/configtx/orderer.go b/vendor/github.com/hyperledger/fabric-config/configtx/orderer.go index 148a2453ed1..a4e4b744928 100644 --- a/vendor/github.com/hyperledger/fabric-config/configtx/orderer.go +++ b/vendor/github.com/hyperledger/fabric-config/configtx/orderer.go @@ -15,11 +15,11 @@ import ( "reflect" "time" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-config/configtx/orderer" - cb "github.com/hyperledger/fabric-protos-go/common" - ob "github.com/hyperledger/fabric-protos-go/orderer" - eb "github.com/hyperledger/fabric-protos-go/orderer/etcdraft" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + ob "github.com/hyperledger/fabric-protos-go-apiv2/orderer" + eb "github.com/hyperledger/fabric-protos-go-apiv2/orderer/etcdraft" + "google.golang.org/protobuf/proto" ) const ( @@ -816,10 +816,7 @@ func addOrdererValues(ordererGroup *cb.ConfigGroup, o Orderer) error { switch o.OrdererType { case orderer.ConsensusTypeSolo: case orderer.ConsensusTypeKafka: - err = setValue(ordererGroup, kafkaBrokersValue(o.Kafka.Brokers), AdminsPolicyKey) - if err != nil { - return err - } + return fmt.Errorf("the kafka consensus type is no longer supported") case orderer.ConsensusTypeEtcdRaft: if consensusMetadata, err = marshalEtcdRaftMetadata(o.EtcdRaft); err != nil { return fmt.Errorf("marshaling etcdraft metadata for orderer type '%s': %v", orderer.ConsensusTypeEtcdRaft, err) @@ -902,6 +899,7 @@ func channelRestrictionsValue(maxChannelCount uint64) *standardConfigValue { // kafkaBrokersValue returns the config definition for the addresses of the ordering service's Kafka brokers. // It is a value for the /Channel/Orderer group. +// Deprecated: the kafka consensus type is no longer supported func kafkaBrokersValue(brokers []string) *standardConfigValue { return &standardConfigValue{ key: orderer.KafkaBrokersKey, diff --git a/vendor/github.com/hyperledger/fabric-config/configtx/orderer/orderer.go b/vendor/github.com/hyperledger/fabric-config/configtx/orderer/orderer.go index aa7b89f7317..5ece74c1a07 100644 --- a/vendor/github.com/hyperledger/fabric-config/configtx/orderer/orderer.go +++ b/vendor/github.com/hyperledger/fabric-config/configtx/orderer/orderer.go @@ -22,12 +22,14 @@ const ( ConsensusTypeSolo = "solo" // ConsensusTypeKafka identifies the Kafka-based consensus implementation. + // Deprecated: the kafka consensus type is no longer supported ConsensusTypeKafka = "kafka" // ConsensusTypeEtcdRaft identifies the Raft-based consensus implementation. ConsensusTypeEtcdRaft = "etcdraft" // KafkaBrokersKey is the common.ConfigValue type key name for the KafkaBrokers message. + // Deprecated: the kafka consensus type is no longer supported KafkaBrokersKey = "KafkaBrokers" // ConsensusTypeKey is the common.ConfigValue type key name for the ConsensusType message. @@ -58,6 +60,7 @@ type BatchSize struct { } // Kafka is a list of Kafka broker endpoints. +// Deprecated: the kafka consensus type is no longer supported type Kafka struct { // Brokers contains the addresses of *at least two* kafka brokers // Must be in `IP:port` notation diff --git a/vendor/github.com/hyperledger/fabric-config/configtx/organization.go b/vendor/github.com/hyperledger/fabric-config/configtx/organization.go index c5757f0b9fd..ea5eeb4efaa 100644 --- a/vendor/github.com/hyperledger/fabric-config/configtx/organization.go +++ b/vendor/github.com/hyperledger/fabric-config/configtx/organization.go @@ -9,10 +9,10 @@ package configtx import ( "fmt" - "github.com/golang/protobuf/proto" - cb "github.com/hyperledger/fabric-protos-go/common" - mb "github.com/hyperledger/fabric-protos-go/msp" - pb "github.com/hyperledger/fabric-protos-go/peer" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + mb "github.com/hyperledger/fabric-protos-go-apiv2/msp" + pb "github.com/hyperledger/fabric-protos-go-apiv2/peer" + "google.golang.org/protobuf/proto" ) // newOrgConfigGroup returns an config group for an organization. diff --git a/vendor/github.com/hyperledger/fabric-config/configtx/policies.go b/vendor/github.com/hyperledger/fabric-config/configtx/policies.go index b69d21a0394..6df708e9ef9 100644 --- a/vendor/github.com/hyperledger/fabric-config/configtx/policies.go +++ b/vendor/github.com/hyperledger/fabric-config/configtx/policies.go @@ -12,10 +12,10 @@ import ( "strconv" "strings" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-config/configtx/internal/policydsl" - cb "github.com/hyperledger/fabric-protos-go/common" - mb "github.com/hyperledger/fabric-protos-go/msp" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + mb "github.com/hyperledger/fabric-protos-go-apiv2/msp" + "google.golang.org/protobuf/proto" ) // getPolicies returns a map of Policy from given map of ConfigPolicy in organization config group. diff --git a/vendor/github.com/hyperledger/fabric-config/configtx/signer.go b/vendor/github.com/hyperledger/fabric-config/configtx/signer.go index 22863011567..9aa0c8a9de3 100644 --- a/vendor/github.com/hyperledger/fabric-config/configtx/signer.go +++ b/vendor/github.com/hyperledger/fabric-config/configtx/signer.go @@ -18,9 +18,9 @@ import ( "io" "math/big" - "github.com/golang/protobuf/proto" - cb "github.com/hyperledger/fabric-protos-go/common" - mb "github.com/hyperledger/fabric-protos-go/msp" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + mb "github.com/hyperledger/fabric-protos-go-apiv2/msp" + "google.golang.org/protobuf/proto" ) // SigningIdentity is an MSP Identity that can be used to sign configuration diff --git a/vendor/github.com/hyperledger/fabric-config/configtx/update.go b/vendor/github.com/hyperledger/fabric-config/configtx/update.go index 81e0dbcf33a..c80b0793818 100644 --- a/vendor/github.com/hyperledger/fabric-config/configtx/update.go +++ b/vendor/github.com/hyperledger/fabric-config/configtx/update.go @@ -10,8 +10,8 @@ import ( "bytes" "fmt" - "github.com/golang/protobuf/proto" - cb "github.com/hyperledger/fabric-protos-go/common" + cb "github.com/hyperledger/fabric-protos-go-apiv2/common" + "google.golang.org/protobuf/proto" ) // Compute computes the difference between two *cb.Configs and returns the diff --git a/vendor/github.com/hyperledger/fabric-config/protolator/api.go b/vendor/github.com/hyperledger/fabric-config/protolator/api.go index 243691f2c9a..0cf6b08d342 100644 --- a/vendor/github.com/hyperledger/fabric-config/protolator/api.go +++ b/vendor/github.com/hyperledger/fabric-config/protolator/api.go @@ -7,10 +7,10 @@ SPDX-License-Identifier: Apache-2.0 package protolator import ( - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" ) -/////////////////////////////////////////////////////////////////////////////////////////////////// +// ///////////////////////////////////////////////////////////////////////////////////////////////// // // This set of interfaces and methods is designed to allow protos to have Go methods attached // to them, so that they may be automatically marshaled to human readable JSON (where the @@ -37,7 +37,7 @@ import ( // wrapping the underlying proto message in another type which can be configured at runtime with // different contextual behavior. (See tests for examples) // -/////////////////////////////////////////////////////////////////////////////////////////////////// +// ///////////////////////////////////////////////////////////////////////////////////////////////// // StaticallyOpaqueFieldProto should be implemented by protos which have bytes fields which // are the marshaled value of a fixed type @@ -100,7 +100,7 @@ type VariablyOpaqueSliceFieldProto interface { // VariablyOpaqueSliceFields returns the field names which contain opaque data VariablyOpaqueSliceFields() []string - // VariablyOpaqueFieldProto returns a newly allocated proto message of the correct + // VariablyOpaqueSliceFieldProto returns a newly allocated proto message of the correct // type for the field name. VariablyOpaqueSliceFieldProto(name string, index int) (proto.Message, error) } diff --git a/vendor/github.com/hyperledger/fabric-config/protolator/dynamic.go b/vendor/github.com/hyperledger/fabric-config/protolator/dynamic.go index 8a40b64db3f..ce9588403dc 100644 --- a/vendor/github.com/hyperledger/fabric-config/protolator/dynamic.go +++ b/vendor/github.com/hyperledger/fabric-config/protolator/dynamic.go @@ -19,7 +19,7 @@ package protolator import ( "reflect" - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" ) func dynamicFrom(dynamicMsg func(underlying proto.Message) (proto.Message, error), value interface{}, destType reflect.Type) (reflect.Value, error) { diff --git a/vendor/github.com/hyperledger/fabric-config/protolator/json.go b/vendor/github.com/hyperledger/fabric-config/protolator/json.go index e4b6d6173de..27af807cc45 100644 --- a/vendor/github.com/hyperledger/fabric-config/protolator/json.go +++ b/vendor/github.com/hyperledger/fabric-config/protolator/json.go @@ -11,12 +11,12 @@ import ( "encoding/json" "fmt" "io" - "io/ioutil" "reflect" + "strings" - "github.com/golang/protobuf/jsonpb" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-config/protolator/protoext" + "google.golang.org/protobuf/encoding/protojson" + "google.golang.org/protobuf/proto" ) // MostlyDeterministicMarshal is _NOT_ the function you are looking for. @@ -26,12 +26,9 @@ import ( // the same process wants to compare binary messages for equality without // needing to unmarshal first, but should not be used generally. func MostlyDeterministicMarshal(msg proto.Message) ([]byte, error) { - buffer := proto.NewBuffer(make([]byte, 0)) - buffer.SetDeterministic(true) - if err := buffer.Marshal(msg); err != nil { - return nil, err - } - return buffer.Bytes(), nil + return proto.MarshalOptions{ + Deterministic: true, + }.Marshal(msg) } type protoFieldFactory interface { @@ -243,18 +240,17 @@ func protoToJSON(msg proto.Message) ([]byte, error) { if reflect.ValueOf(msg).IsNil() { panic("We're nil here") } - var b bytes.Buffer - m := jsonpb.Marshaler{ - EnumsAsInts: false, - EmitDefaults: true, - Indent: " ", - OrigName: true, + m := protojson.MarshalOptions{ + UseEnumNumbers: false, + EmitUnpopulated: true, + Indent: " ", + UseProtoNames: true, } - err := m.Marshal(&b, msg) + b, err := m.Marshal(msg) if err != nil { return nil, err } - return b.Bytes(), nil + return b, nil } func mapToProto(tree map[string]interface{}, msg proto.Message) error { @@ -263,7 +259,7 @@ func mapToProto(tree map[string]interface{}, msg proto.Message) error { return err } - return jsonpb.UnmarshalString(string(jsonOut), msg) + return protojson.Unmarshal(jsonOut, msg) } // jsonToMap allocates a map[string]interface{}, unmarshals a JSON document into it @@ -315,20 +311,28 @@ func protoFields(msg proto.Message, uMsg proto.Message) ([]protoField, error) { } iResult := make([][]protoField, len(fieldFactories)) - - protoProps := proto.GetProperties(mVal.Type()) + t := mVal.Type() // TODO, this will skip oneof fields, this should be handled // correctly at some point - for _, prop := range protoProps.Prop { - fieldName := prop.OrigName - fieldValue := mVal.FieldByName(prop.Name) - fieldTypeStruct, ok := mVal.Type().FieldByName(prop.Name) + for i := 0; i < t.NumField(); i++ { + f := t.Field(i) + fieldName := f.Name + tagField := f.Tag.Get("protobuf") + for _, s := range strings.Split(tagField, ",") { + if strings.HasPrefix(s, "name=") { + fieldName = s[len("name="):] + break + } + } + + fieldValue := mVal.FieldByName(f.Name) + fieldTypeStruct, ok := mVal.Type().FieldByName(f.Name) if !ok { return nil, fmt.Errorf("programming error: proto does not have field advertised by proto package") } fieldType := fieldTypeStruct.Type - for i, factory := range fieldFactories { + for j, factory := range fieldFactories { if !factory.Handles(msg, fieldName, fieldType, fieldValue) { continue } @@ -337,7 +341,7 @@ func protoFields(msg proto.Message, uMsg proto.Message) ([]protoField, error) { if err != nil { return nil, err } - iResult[i] = append(iResult[i], field) + iResult[j] = append(iResult[j], field) break } } @@ -450,7 +454,7 @@ func recursivelyPopulateMessageFromTree(tree map[string]interface{}, msg proto.M if !ok { continue } - if err := field.PopulateFrom(specialField); err != nil { + if err = field.PopulateFrom(specialField); err != nil { return err } } @@ -461,7 +465,7 @@ func recursivelyPopulateMessageFromTree(tree map[string]interface{}, msg proto.M // DeepUnmarshalJSON takes JSON output as generated by DeepMarshalJSON and decodes it into msg // This includes re-marshaling the expanded nested elements to binary form func DeepUnmarshalJSON(r io.Reader, msg proto.Message) error { - b, err := ioutil.ReadAll(r) + b, err := io.ReadAll(r) if err != nil { return err } diff --git a/vendor/github.com/hyperledger/fabric-config/protolator/nested.go b/vendor/github.com/hyperledger/fabric-config/protolator/nested.go index 5d17ca4c941..babd035b0a4 100644 --- a/vendor/github.com/hyperledger/fabric-config/protolator/nested.go +++ b/vendor/github.com/hyperledger/fabric-config/protolator/nested.go @@ -19,8 +19,8 @@ package protolator import ( "reflect" - "github.com/golang/protobuf/proto" - "github.com/golang/protobuf/ptypes/timestamp" + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/types/known/timestamppb" ) func nestedFrom(value interface{}, destType reflect.Type) (reflect.Value, error) { @@ -38,7 +38,7 @@ func nestedTo(value reflect.Value) (interface{}, error) { return recursivelyCreateTreeFromMessage(nMsg) } -var timestampType = reflect.TypeOf(×tamp.Timestamp{}) +var timestampType = reflect.TypeOf(×tamppb.Timestamp{}) type nestedFieldFactory struct{} diff --git a/vendor/github.com/hyperledger/fabric-config/protolator/protoext/commonext/common.go b/vendor/github.com/hyperledger/fabric-config/protolator/protoext/commonext/common.go index 908b92ca6c9..c14750be054 100644 --- a/vendor/github.com/hyperledger/fabric-config/protolator/protoext/commonext/common.go +++ b/vendor/github.com/hyperledger/fabric-config/protolator/protoext/commonext/common.go @@ -9,10 +9,10 @@ package commonext import ( "fmt" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/msp" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/msp" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" + "google.golang.org/protobuf/proto" ) type Envelope struct{ *common.Envelope } diff --git a/vendor/github.com/hyperledger/fabric-config/protolator/protoext/commonext/configtx.go b/vendor/github.com/hyperledger/fabric-config/protolator/protoext/commonext/configtx.go index 841415c5a3c..6745eea0eb0 100644 --- a/vendor/github.com/hyperledger/fabric-config/protolator/protoext/commonext/configtx.go +++ b/vendor/github.com/hyperledger/fabric-config/protolator/protoext/commonext/configtx.go @@ -9,8 +9,8 @@ package commonext import ( "fmt" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "google.golang.org/protobuf/proto" ) type ConfigUpdateEnvelope struct{ *common.ConfigUpdateEnvelope } @@ -70,7 +70,7 @@ func (c *Config) DynamicFieldProto(name string, base proto.Message) (proto.Messa return &DynamicChannelGroup{ConfigGroup: cg}, nil } -// ConfigUpdateIsolatedDataTypes allows other proto packages to register types for the +// ConfigUpdateIsolatedDataTypes allows other proto packages to register types for // the isolated_data field. This is necessary to break import cycles. var ConfigUpdateIsolatedDataTypes = map[string]func(string) proto.Message{} diff --git a/vendor/github.com/hyperledger/fabric-config/protolator/protoext/commonext/configuration.go b/vendor/github.com/hyperledger/fabric-config/protolator/protoext/commonext/configuration.go index f11f86086df..10dd16d3cca 100644 --- a/vendor/github.com/hyperledger/fabric-config/protolator/protoext/commonext/configuration.go +++ b/vendor/github.com/hyperledger/fabric-config/protolator/protoext/commonext/configuration.go @@ -9,11 +9,11 @@ package commonext import ( "fmt" - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-config/protolator/protoext/ordererext" "github.com/hyperledger/fabric-config/protolator/protoext/peerext" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/msp" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/msp" + "google.golang.org/protobuf/proto" ) type DynamicChannelGroup struct { diff --git a/vendor/github.com/hyperledger/fabric-config/protolator/protoext/commonext/policies.go b/vendor/github.com/hyperledger/fabric-config/protolator/protoext/commonext/policies.go index 5cbbd3057e6..6ff1984b7b4 100644 --- a/vendor/github.com/hyperledger/fabric-config/protolator/protoext/commonext/policies.go +++ b/vendor/github.com/hyperledger/fabric-config/protolator/protoext/commonext/policies.go @@ -9,8 +9,8 @@ package commonext import ( "fmt" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/common" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "google.golang.org/protobuf/proto" ) type Policy struct{ *common.Policy } diff --git a/vendor/github.com/hyperledger/fabric-config/protolator/protoext/decorate.go b/vendor/github.com/hyperledger/fabric-config/protolator/protoext/decorate.go index a59565beaba..781507230fa 100644 --- a/vendor/github.com/hyperledger/fabric-config/protolator/protoext/decorate.go +++ b/vendor/github.com/hyperledger/fabric-config/protolator/protoext/decorate.go @@ -7,17 +7,17 @@ SPDX-License-Identifier: Apache-2.0 package protoext import ( - "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric-config/protolator/protoext/commonext" "github.com/hyperledger/fabric-config/protolator/protoext/ledger/rwsetext" "github.com/hyperledger/fabric-config/protolator/protoext/mspext" "github.com/hyperledger/fabric-config/protolator/protoext/ordererext" "github.com/hyperledger/fabric-config/protolator/protoext/peerext" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/ledger/rwset" - "github.com/hyperledger/fabric-protos-go/msp" - "github.com/hyperledger/fabric-protos-go/orderer" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset" + "github.com/hyperledger/fabric-protos-go-apiv2/msp" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" + "google.golang.org/protobuf/proto" ) // Docorate will add additional capabilities to some protobuf messages that diff --git a/vendor/github.com/hyperledger/fabric-config/protolator/protoext/ledger/rwsetext/rwset.go b/vendor/github.com/hyperledger/fabric-config/protolator/protoext/ledger/rwsetext/rwset.go index 9a578e88cd5..f70f2c0067a 100644 --- a/vendor/github.com/hyperledger/fabric-config/protolator/protoext/ledger/rwsetext/rwset.go +++ b/vendor/github.com/hyperledger/fabric-config/protolator/protoext/ledger/rwsetext/rwset.go @@ -9,9 +9,9 @@ package rwsetext import ( "fmt" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/ledger/rwset" - "github.com/hyperledger/fabric-protos-go/ledger/rwset/kvrwset" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset/kvrwset" + "google.golang.org/protobuf/proto" ) type TxReadWriteSet struct{ *rwset.TxReadWriteSet } diff --git a/vendor/github.com/hyperledger/fabric-config/protolator/protoext/mspext/msp_config.go b/vendor/github.com/hyperledger/fabric-config/protolator/protoext/mspext/msp_config.go index 8fbc7be2c4f..2bbe661ec20 100644 --- a/vendor/github.com/hyperledger/fabric-config/protolator/protoext/mspext/msp_config.go +++ b/vendor/github.com/hyperledger/fabric-config/protolator/protoext/mspext/msp_config.go @@ -9,8 +9,8 @@ package mspext import ( "fmt" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/msp" + "github.com/hyperledger/fabric-protos-go-apiv2/msp" + "google.golang.org/protobuf/proto" ) type MSPConfig struct{ *msp.MSPConfig } diff --git a/vendor/github.com/hyperledger/fabric-config/protolator/protoext/mspext/msp_principal.go b/vendor/github.com/hyperledger/fabric-config/protolator/protoext/mspext/msp_principal.go index f8c45f54837..43cb1d28ca9 100644 --- a/vendor/github.com/hyperledger/fabric-config/protolator/protoext/mspext/msp_principal.go +++ b/vendor/github.com/hyperledger/fabric-config/protolator/protoext/mspext/msp_principal.go @@ -9,8 +9,8 @@ package mspext import ( "fmt" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/msp" + "github.com/hyperledger/fabric-protos-go-apiv2/msp" + "google.golang.org/protobuf/proto" ) type MSPPrincipal struct{ *msp.MSPPrincipal } diff --git a/vendor/github.com/hyperledger/fabric-config/protolator/protoext/ordererext/configuration.go b/vendor/github.com/hyperledger/fabric-config/protolator/protoext/ordererext/configuration.go index 6c473501cf3..4aa21d398d9 100644 --- a/vendor/github.com/hyperledger/fabric-config/protolator/protoext/ordererext/configuration.go +++ b/vendor/github.com/hyperledger/fabric-config/protolator/protoext/ordererext/configuration.go @@ -9,14 +9,13 @@ package ordererext import ( "fmt" - "github.com/hyperledger/fabric-protos-go/orderer/smartbft" - - "github.com/golang/protobuf/proto" - "github.com/golang/protobuf/ptypes/empty" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/msp" - "github.com/hyperledger/fabric-protos-go/orderer" - "github.com/hyperledger/fabric-protos-go/orderer/etcdraft" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/msp" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer/etcdraft" + "github.com/hyperledger/fabric-protos-go-apiv2/orderer/smartbft" + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/types/known/emptypb" ) type DynamicOrdererGroup struct { @@ -85,7 +84,7 @@ func (ct *ConsensusType) VariablyOpaqueFieldProto(name string) (proto.Message, e case "BFT": return &smartbft.Options{}, nil default: - return &empty.Empty{}, nil + return &emptypb.Empty{}, nil } } diff --git a/vendor/github.com/hyperledger/fabric-config/protolator/protoext/peerext/configuration.go b/vendor/github.com/hyperledger/fabric-config/protolator/protoext/peerext/configuration.go index a9adc924990..a7b09e19fbf 100644 --- a/vendor/github.com/hyperledger/fabric-config/protolator/protoext/peerext/configuration.go +++ b/vendor/github.com/hyperledger/fabric-config/protolator/protoext/peerext/configuration.go @@ -9,10 +9,10 @@ package peerext import ( "fmt" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/msp" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/msp" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" + "google.golang.org/protobuf/proto" ) type DynamicApplicationGroup struct { diff --git a/vendor/github.com/hyperledger/fabric-config/protolator/protoext/peerext/proposal.go b/vendor/github.com/hyperledger/fabric-config/protolator/protoext/peerext/proposal.go index ba79d3b1c5a..e9ca4817ffb 100644 --- a/vendor/github.com/hyperledger/fabric-config/protolator/protoext/peerext/proposal.go +++ b/vendor/github.com/hyperledger/fabric-config/protolator/protoext/peerext/proposal.go @@ -9,9 +9,9 @@ package peerext import ( "fmt" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/ledger/rwset" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" + "google.golang.org/protobuf/proto" ) type ChaincodeProposalPayload struct { diff --git a/vendor/github.com/hyperledger/fabric-config/protolator/protoext/peerext/proposal_response.go b/vendor/github.com/hyperledger/fabric-config/protolator/protoext/peerext/proposal_response.go index 508284f1570..0eb859a6ddf 100644 --- a/vendor/github.com/hyperledger/fabric-config/protolator/protoext/peerext/proposal_response.go +++ b/vendor/github.com/hyperledger/fabric-config/protolator/protoext/peerext/proposal_response.go @@ -9,8 +9,8 @@ package peerext import ( "fmt" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" + "google.golang.org/protobuf/proto" ) type ProposalResponsePayload struct { diff --git a/vendor/github.com/hyperledger/fabric-config/protolator/protoext/peerext/transaction.go b/vendor/github.com/hyperledger/fabric-config/protolator/protoext/peerext/transaction.go index 552d9b33915..38708112b45 100644 --- a/vendor/github.com/hyperledger/fabric-config/protolator/protoext/peerext/transaction.go +++ b/vendor/github.com/hyperledger/fabric-config/protolator/protoext/peerext/transaction.go @@ -9,9 +9,9 @@ package peerext import ( "fmt" - "github.com/golang/protobuf/proto" - "github.com/hyperledger/fabric-protos-go/common" - "github.com/hyperledger/fabric-protos-go/peer" + "github.com/hyperledger/fabric-protos-go-apiv2/common" + "github.com/hyperledger/fabric-protos-go-apiv2/peer" + "google.golang.org/protobuf/proto" ) type TransactionAction struct { // nothing was testing this diff --git a/vendor/github.com/hyperledger/fabric-config/protolator/statically_opaque.go b/vendor/github.com/hyperledger/fabric-config/protolator/statically_opaque.go index 7e6ad81c091..b5b2e5c03f7 100644 --- a/vendor/github.com/hyperledger/fabric-config/protolator/statically_opaque.go +++ b/vendor/github.com/hyperledger/fabric-config/protolator/statically_opaque.go @@ -19,7 +19,7 @@ package protolator import ( "reflect" - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" ) func opaqueFrom(opaqueType func() (proto.Message, error), value interface{}, destType reflect.Type) (reflect.Value, error) { diff --git a/vendor/github.com/hyperledger/fabric-config/protolator/variably_opaque.go b/vendor/github.com/hyperledger/fabric-config/protolator/variably_opaque.go index f4f1e38a38a..49e38891abb 100644 --- a/vendor/github.com/hyperledger/fabric-config/protolator/variably_opaque.go +++ b/vendor/github.com/hyperledger/fabric-config/protolator/variably_opaque.go @@ -19,7 +19,7 @@ package protolator import ( "reflect" - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" ) type variablyOpaqueFieldFactory struct{} diff --git a/vendor/github.com/hyperledger/fabric-protos-go/LICENSE b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/LICENSE similarity index 100% rename from vendor/github.com/hyperledger/fabric-protos-go/LICENSE rename to vendor/github.com/hyperledger/fabric-protos-go-apiv2/LICENSE diff --git a/vendor/github.com/hyperledger/fabric-protos-go-apiv2/common/collection.pb.go b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/common/collection.pb.go new file mode 100644 index 00000000000..9fbca16a779 --- /dev/null +++ b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/common/collection.pb.go @@ -0,0 +1,536 @@ +// Copyright the Hyperledger Fabric contributors. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: common/collection.proto + +package common + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// CollectionConfigPackage represents an array of CollectionConfig +// messages; the extra struct is required because repeated oneof is +// forbidden by the protobuf syntax +// +// Deprecated: Marked as deprecated in common/collection.proto. +type CollectionConfigPackage struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Config []*CollectionConfig `protobuf:"bytes,1,rep,name=config,proto3" json:"config,omitempty"` +} + +func (x *CollectionConfigPackage) Reset() { + *x = CollectionConfigPackage{} + if protoimpl.UnsafeEnabled { + mi := &file_common_collection_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CollectionConfigPackage) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CollectionConfigPackage) ProtoMessage() {} + +func (x *CollectionConfigPackage) ProtoReflect() protoreflect.Message { + mi := &file_common_collection_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CollectionConfigPackage.ProtoReflect.Descriptor instead. +func (*CollectionConfigPackage) Descriptor() ([]byte, []int) { + return file_common_collection_proto_rawDescGZIP(), []int{0} +} + +func (x *CollectionConfigPackage) GetConfig() []*CollectionConfig { + if x != nil { + return x.Config + } + return nil +} + +// CollectionConfig defines the configuration of a collection object; +// it currently contains a single, static type. +// Dynamic collections are deferred. +// +// Deprecated: Marked as deprecated in common/collection.proto. +type CollectionConfig struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Payload: + // + // *CollectionConfig_StaticCollectionConfig + Payload isCollectionConfig_Payload `protobuf_oneof:"payload"` +} + +func (x *CollectionConfig) Reset() { + *x = CollectionConfig{} + if protoimpl.UnsafeEnabled { + mi := &file_common_collection_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CollectionConfig) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CollectionConfig) ProtoMessage() {} + +func (x *CollectionConfig) ProtoReflect() protoreflect.Message { + mi := &file_common_collection_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CollectionConfig.ProtoReflect.Descriptor instead. +func (*CollectionConfig) Descriptor() ([]byte, []int) { + return file_common_collection_proto_rawDescGZIP(), []int{1} +} + +func (m *CollectionConfig) GetPayload() isCollectionConfig_Payload { + if m != nil { + return m.Payload + } + return nil +} + +func (x *CollectionConfig) GetStaticCollectionConfig() *StaticCollectionConfig { + if x, ok := x.GetPayload().(*CollectionConfig_StaticCollectionConfig); ok { + return x.StaticCollectionConfig + } + return nil +} + +type isCollectionConfig_Payload interface { + isCollectionConfig_Payload() +} + +type CollectionConfig_StaticCollectionConfig struct { + StaticCollectionConfig *StaticCollectionConfig `protobuf:"bytes,1,opt,name=static_collection_config,json=staticCollectionConfig,proto3,oneof"` +} + +func (*CollectionConfig_StaticCollectionConfig) isCollectionConfig_Payload() {} + +// StaticCollectionConfig constitutes the configuration parameters of a +// static collection object. Static collections are collections that are +// known at chaincode instantiation time, and that cannot be changed. +// Dynamic collections are deferred. +// +// Deprecated: Marked as deprecated in common/collection.proto. +type StaticCollectionConfig struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // the name of the collection inside the denoted chaincode + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // a reference to a policy residing / managed in the config block + // to define which orgs have access to this collection’s private data + MemberOrgsPolicy *CollectionPolicyConfig `protobuf:"bytes,2,opt,name=member_orgs_policy,json=memberOrgsPolicy,proto3" json:"member_orgs_policy,omitempty"` + // The minimum number of peers private data will be sent to upon + // endorsement. The endorsement would fail if dissemination to at least + // this number of peers is not achieved. + RequiredPeerCount int32 `protobuf:"varint,3,opt,name=required_peer_count,json=requiredPeerCount,proto3" json:"required_peer_count,omitempty"` + // The maximum number of peers that private data will be sent to + // upon endorsement. This number has to be bigger than required_peer_count. + MaximumPeerCount int32 `protobuf:"varint,4,opt,name=maximum_peer_count,json=maximumPeerCount,proto3" json:"maximum_peer_count,omitempty"` + // The number of blocks after which the collection data expires. + // For instance if the value is set to 10, a key last modified by block number 100 + // will be purged at block number 111. A zero value is treated same as MaxUint64 + BlockToLive uint64 `protobuf:"varint,5,opt,name=block_to_live,json=blockToLive,proto3" json:"block_to_live,omitempty"` + // The member only read access denotes whether only collection member clients + // can read the private data (if set to true), or even non members can + // read the data (if set to false, for example if you want to implement more granular + // access logic in the chaincode) + MemberOnlyRead bool `protobuf:"varint,6,opt,name=member_only_read,json=memberOnlyRead,proto3" json:"member_only_read,omitempty"` + // The member only write access denotes whether only collection member clients + // can write the private data (if set to true), or even non members can + // write the data (if set to false, for example if you want to implement more granular + // access logic in the chaincode) + MemberOnlyWrite bool `protobuf:"varint,7,opt,name=member_only_write,json=memberOnlyWrite,proto3" json:"member_only_write,omitempty"` + // a reference to a policy residing / managed in the config block + // to define the endorsement policy for this collection + EndorsementPolicy *ApplicationPolicy `protobuf:"bytes,8,opt,name=endorsement_policy,json=endorsementPolicy,proto3" json:"endorsement_policy,omitempty"` +} + +func (x *StaticCollectionConfig) Reset() { + *x = StaticCollectionConfig{} + if protoimpl.UnsafeEnabled { + mi := &file_common_collection_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StaticCollectionConfig) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StaticCollectionConfig) ProtoMessage() {} + +func (x *StaticCollectionConfig) ProtoReflect() protoreflect.Message { + mi := &file_common_collection_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StaticCollectionConfig.ProtoReflect.Descriptor instead. +func (*StaticCollectionConfig) Descriptor() ([]byte, []int) { + return file_common_collection_proto_rawDescGZIP(), []int{2} +} + +func (x *StaticCollectionConfig) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *StaticCollectionConfig) GetMemberOrgsPolicy() *CollectionPolicyConfig { + if x != nil { + return x.MemberOrgsPolicy + } + return nil +} + +func (x *StaticCollectionConfig) GetRequiredPeerCount() int32 { + if x != nil { + return x.RequiredPeerCount + } + return 0 +} + +func (x *StaticCollectionConfig) GetMaximumPeerCount() int32 { + if x != nil { + return x.MaximumPeerCount + } + return 0 +} + +func (x *StaticCollectionConfig) GetBlockToLive() uint64 { + if x != nil { + return x.BlockToLive + } + return 0 +} + +func (x *StaticCollectionConfig) GetMemberOnlyRead() bool { + if x != nil { + return x.MemberOnlyRead + } + return false +} + +func (x *StaticCollectionConfig) GetMemberOnlyWrite() bool { + if x != nil { + return x.MemberOnlyWrite + } + return false +} + +func (x *StaticCollectionConfig) GetEndorsementPolicy() *ApplicationPolicy { + if x != nil { + return x.EndorsementPolicy + } + return nil +} + +// Collection policy configuration. Initially, the configuration can only +// contain a SignaturePolicy. In the future, the SignaturePolicy may be a +// more general Policy. Instead of containing the actual policy, the +// configuration may in the future contain a string reference to a policy. +// +// Deprecated: Marked as deprecated in common/collection.proto. +type CollectionPolicyConfig struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Payload: + // + // *CollectionPolicyConfig_SignaturePolicy + Payload isCollectionPolicyConfig_Payload `protobuf_oneof:"payload"` +} + +func (x *CollectionPolicyConfig) Reset() { + *x = CollectionPolicyConfig{} + if protoimpl.UnsafeEnabled { + mi := &file_common_collection_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CollectionPolicyConfig) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CollectionPolicyConfig) ProtoMessage() {} + +func (x *CollectionPolicyConfig) ProtoReflect() protoreflect.Message { + mi := &file_common_collection_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CollectionPolicyConfig.ProtoReflect.Descriptor instead. +func (*CollectionPolicyConfig) Descriptor() ([]byte, []int) { + return file_common_collection_proto_rawDescGZIP(), []int{3} +} + +func (m *CollectionPolicyConfig) GetPayload() isCollectionPolicyConfig_Payload { + if m != nil { + return m.Payload + } + return nil +} + +func (x *CollectionPolicyConfig) GetSignaturePolicy() *SignaturePolicyEnvelope { + if x, ok := x.GetPayload().(*CollectionPolicyConfig_SignaturePolicy); ok { + return x.SignaturePolicy + } + return nil +} + +type isCollectionPolicyConfig_Payload interface { + isCollectionPolicyConfig_Payload() +} + +type CollectionPolicyConfig_SignaturePolicy struct { + // Initially, only a signature policy is supported. + SignaturePolicy *SignaturePolicyEnvelope `protobuf:"bytes,1,opt,name=signature_policy,json=signaturePolicy,proto3,oneof"` +} + +func (*CollectionPolicyConfig_SignaturePolicy) isCollectionPolicyConfig_Payload() {} + +var File_common_collection_proto protoreflect.FileDescriptor + +var file_common_collection_proto_rawDesc = []byte{ + 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, + 0x6e, 0x1a, 0x15, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, + 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x4f, 0x0a, 0x17, 0x43, 0x6f, 0x6c, 0x6c, + 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x50, 0x61, 0x63, 0x6b, + 0x61, 0x67, 0x65, 0x12, 0x30, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x43, 0x6f, 0x6c, + 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x06, 0x63, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x3a, 0x02, 0x18, 0x01, 0x22, 0x7d, 0x0a, 0x10, 0x43, 0x6f, 0x6c, + 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x5a, 0x0a, + 0x18, 0x73, 0x74, 0x61, 0x74, 0x69, 0x63, 0x5f, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1e, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x69, 0x63, 0x43, + 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x48, + 0x00, 0x52, 0x16, 0x73, 0x74, 0x61, 0x74, 0x69, 0x63, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x3a, 0x02, 0x18, 0x01, 0x42, 0x09, 0x0a, + 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0xa0, 0x03, 0x0a, 0x16, 0x53, 0x74, 0x61, + 0x74, 0x69, 0x63, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x4c, 0x0a, 0x12, 0x6d, 0x65, 0x6d, 0x62, 0x65, + 0x72, 0x5f, 0x6f, 0x72, 0x67, 0x73, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x43, 0x6f, 0x6c, + 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x43, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x52, 0x10, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x4f, 0x72, 0x67, 0x73, 0x50, + 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x2e, 0x0a, 0x13, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, + 0x64, 0x5f, 0x70, 0x65, 0x65, 0x72, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x11, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x50, 0x65, 0x65, 0x72, + 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x2c, 0x0a, 0x12, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, + 0x5f, 0x70, 0x65, 0x65, 0x72, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x10, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x50, 0x65, 0x65, 0x72, 0x43, 0x6f, + 0x75, 0x6e, 0x74, 0x12, 0x22, 0x0a, 0x0d, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x74, 0x6f, 0x5f, + 0x6c, 0x69, 0x76, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x63, + 0x6b, 0x54, 0x6f, 0x4c, 0x69, 0x76, 0x65, 0x12, 0x28, 0x0a, 0x10, 0x6d, 0x65, 0x6d, 0x62, 0x65, + 0x72, 0x5f, 0x6f, 0x6e, 0x6c, 0x79, 0x5f, 0x72, 0x65, 0x61, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x0e, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x4f, 0x6e, 0x6c, 0x79, 0x52, 0x65, 0x61, + 0x64, 0x12, 0x2a, 0x0a, 0x11, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x5f, 0x6f, 0x6e, 0x6c, 0x79, + 0x5f, 0x77, 0x72, 0x69, 0x74, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x6d, 0x65, + 0x6d, 0x62, 0x65, 0x72, 0x4f, 0x6e, 0x6c, 0x79, 0x57, 0x72, 0x69, 0x74, 0x65, 0x12, 0x48, 0x0a, + 0x12, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x73, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x70, 0x6f, 0x6c, + 0x69, 0x63, 0x79, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, + 0x6f, 0x6e, 0x2e, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6f, + 0x6c, 0x69, 0x63, 0x79, 0x52, 0x11, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x73, 0x65, 0x6d, 0x65, 0x6e, + 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x3a, 0x02, 0x18, 0x01, 0x22, 0x75, 0x0a, 0x16, 0x43, + 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x43, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x4c, 0x0a, 0x10, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, + 0x72, 0x65, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, + 0x72, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, + 0x48, 0x00, 0x52, 0x0f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x50, 0x6f, 0x6c, + 0x69, 0x63, 0x79, 0x3a, 0x02, 0x18, 0x01, 0x42, 0x09, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, + 0x61, 0x64, 0x42, 0xa5, 0x01, 0x0a, 0x24, 0x6f, 0x72, 0x67, 0x2e, 0x68, 0x79, 0x70, 0x65, 0x72, + 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2e, 0x66, 0x61, 0x62, 0x72, 0x69, 0x63, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x42, 0x0f, 0x43, 0x6f, 0x6c, + 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x34, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x79, 0x70, 0x65, 0x72, + 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2f, 0x66, 0x61, 0x62, 0x72, 0x69, 0x63, 0x2d, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x73, 0x2d, 0x67, 0x6f, 0x2d, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x63, 0x6f, + 0x6d, 0x6d, 0x6f, 0x6e, 0xa2, 0x02, 0x03, 0x43, 0x58, 0x58, 0xaa, 0x02, 0x06, 0x43, 0x6f, 0x6d, + 0x6d, 0x6f, 0x6e, 0xca, 0x02, 0x06, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0xe2, 0x02, 0x12, 0x43, + 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0xea, 0x02, 0x06, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, +} + +var ( + file_common_collection_proto_rawDescOnce sync.Once + file_common_collection_proto_rawDescData = file_common_collection_proto_rawDesc +) + +func file_common_collection_proto_rawDescGZIP() []byte { + file_common_collection_proto_rawDescOnce.Do(func() { + file_common_collection_proto_rawDescData = protoimpl.X.CompressGZIP(file_common_collection_proto_rawDescData) + }) + return file_common_collection_proto_rawDescData +} + +var file_common_collection_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_common_collection_proto_goTypes = []interface{}{ + (*CollectionConfigPackage)(nil), // 0: common.CollectionConfigPackage + (*CollectionConfig)(nil), // 1: common.CollectionConfig + (*StaticCollectionConfig)(nil), // 2: common.StaticCollectionConfig + (*CollectionPolicyConfig)(nil), // 3: common.CollectionPolicyConfig + (*ApplicationPolicy)(nil), // 4: common.ApplicationPolicy + (*SignaturePolicyEnvelope)(nil), // 5: common.SignaturePolicyEnvelope +} +var file_common_collection_proto_depIdxs = []int32{ + 1, // 0: common.CollectionConfigPackage.config:type_name -> common.CollectionConfig + 2, // 1: common.CollectionConfig.static_collection_config:type_name -> common.StaticCollectionConfig + 3, // 2: common.StaticCollectionConfig.member_orgs_policy:type_name -> common.CollectionPolicyConfig + 4, // 3: common.StaticCollectionConfig.endorsement_policy:type_name -> common.ApplicationPolicy + 5, // 4: common.CollectionPolicyConfig.signature_policy:type_name -> common.SignaturePolicyEnvelope + 5, // [5:5] is the sub-list for method output_type + 5, // [5:5] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name +} + +func init() { file_common_collection_proto_init() } +func file_common_collection_proto_init() { + if File_common_collection_proto != nil { + return + } + file_common_policies_proto_init() + if !protoimpl.UnsafeEnabled { + file_common_collection_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CollectionConfigPackage); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_collection_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CollectionConfig); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_collection_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StaticCollectionConfig); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_collection_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CollectionPolicyConfig); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_common_collection_proto_msgTypes[1].OneofWrappers = []interface{}{ + (*CollectionConfig_StaticCollectionConfig)(nil), + } + file_common_collection_proto_msgTypes[3].OneofWrappers = []interface{}{ + (*CollectionPolicyConfig_SignaturePolicy)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_common_collection_proto_rawDesc, + NumEnums: 0, + NumMessages: 4, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_common_collection_proto_goTypes, + DependencyIndexes: file_common_collection_proto_depIdxs, + MessageInfos: file_common_collection_proto_msgTypes, + }.Build() + File_common_collection_proto = out.File + file_common_collection_proto_rawDesc = nil + file_common_collection_proto_goTypes = nil + file_common_collection_proto_depIdxs = nil +} diff --git a/vendor/github.com/hyperledger/fabric-protos-go-apiv2/common/common.pb.go b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/common/common.pb.go new file mode 100644 index 00000000000..51d7d540d84 --- /dev/null +++ b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/common/common.pb.go @@ -0,0 +1,1456 @@ +// Copyright the Hyperledger Fabric contributors. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: common/common.proto + +package common + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// These status codes are intended to resemble selected HTTP status codes +type Status int32 + +const ( + Status_UNKNOWN Status = 0 + Status_SUCCESS Status = 200 + Status_BAD_REQUEST Status = 400 + Status_FORBIDDEN Status = 403 + Status_NOT_FOUND Status = 404 + Status_REQUEST_ENTITY_TOO_LARGE Status = 413 + Status_INTERNAL_SERVER_ERROR Status = 500 + Status_NOT_IMPLEMENTED Status = 501 + Status_SERVICE_UNAVAILABLE Status = 503 +) + +// Enum value maps for Status. +var ( + Status_name = map[int32]string{ + 0: "UNKNOWN", + 200: "SUCCESS", + 400: "BAD_REQUEST", + 403: "FORBIDDEN", + 404: "NOT_FOUND", + 413: "REQUEST_ENTITY_TOO_LARGE", + 500: "INTERNAL_SERVER_ERROR", + 501: "NOT_IMPLEMENTED", + 503: "SERVICE_UNAVAILABLE", + } + Status_value = map[string]int32{ + "UNKNOWN": 0, + "SUCCESS": 200, + "BAD_REQUEST": 400, + "FORBIDDEN": 403, + "NOT_FOUND": 404, + "REQUEST_ENTITY_TOO_LARGE": 413, + "INTERNAL_SERVER_ERROR": 500, + "NOT_IMPLEMENTED": 501, + "SERVICE_UNAVAILABLE": 503, + } +) + +func (x Status) Enum() *Status { + p := new(Status) + *p = x + return p +} + +func (x Status) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Status) Descriptor() protoreflect.EnumDescriptor { + return file_common_common_proto_enumTypes[0].Descriptor() +} + +func (Status) Type() protoreflect.EnumType { + return &file_common_common_proto_enumTypes[0] +} + +func (x Status) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Status.Descriptor instead. +func (Status) EnumDescriptor() ([]byte, []int) { + return file_common_common_proto_rawDescGZIP(), []int{0} +} + +type HeaderType int32 + +const ( + HeaderType_MESSAGE HeaderType = 0 // Used for messages which are signed but opaque + HeaderType_CONFIG HeaderType = 1 // Used for messages which express the channel config + HeaderType_CONFIG_UPDATE HeaderType = 2 // Used for transactions which update the channel config + HeaderType_ENDORSER_TRANSACTION HeaderType = 3 // Used by the SDK to submit endorser based transactions + // Deprecated: Marked as deprecated in common/common.proto. + HeaderType_ORDERER_TRANSACTION HeaderType = 4 // Was used internally by the orderer for management, no longer used since system channel was removed + HeaderType_DELIVER_SEEK_INFO HeaderType = 5 // Used as the type for Envelope messages submitted to instruct the Deliver API to seek + HeaderType_CHAINCODE_PACKAGE HeaderType = 6 // Used for packaging chaincode artifacts for install +) + +// Enum value maps for HeaderType. +var ( + HeaderType_name = map[int32]string{ + 0: "MESSAGE", + 1: "CONFIG", + 2: "CONFIG_UPDATE", + 3: "ENDORSER_TRANSACTION", + 4: "ORDERER_TRANSACTION", + 5: "DELIVER_SEEK_INFO", + 6: "CHAINCODE_PACKAGE", + } + HeaderType_value = map[string]int32{ + "MESSAGE": 0, + "CONFIG": 1, + "CONFIG_UPDATE": 2, + "ENDORSER_TRANSACTION": 3, + "ORDERER_TRANSACTION": 4, + "DELIVER_SEEK_INFO": 5, + "CHAINCODE_PACKAGE": 6, + } +) + +func (x HeaderType) Enum() *HeaderType { + p := new(HeaderType) + *p = x + return p +} + +func (x HeaderType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (HeaderType) Descriptor() protoreflect.EnumDescriptor { + return file_common_common_proto_enumTypes[1].Descriptor() +} + +func (HeaderType) Type() protoreflect.EnumType { + return &file_common_common_proto_enumTypes[1] +} + +func (x HeaderType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use HeaderType.Descriptor instead. +func (HeaderType) EnumDescriptor() ([]byte, []int) { + return file_common_common_proto_rawDescGZIP(), []int{1} +} + +// This enum enlists indexes of the block metadata array +type BlockMetadataIndex int32 + +const ( + BlockMetadataIndex_SIGNATURES BlockMetadataIndex = 0 // Block metadata array position for block signatures + // Deprecated: Marked as deprecated in common/common.proto. + BlockMetadataIndex_LAST_CONFIG BlockMetadataIndex = 1 // Block metadata array position to store last configuration block sequence number + BlockMetadataIndex_TRANSACTIONS_FILTER BlockMetadataIndex = 2 // Block metadata array position to store serialized bit array filter of invalid transactions + // Deprecated: Marked as deprecated in common/common.proto. + BlockMetadataIndex_ORDERER BlockMetadataIndex = 3 // Block metadata array position to store operational metadata for orderers + BlockMetadataIndex_COMMIT_HASH BlockMetadataIndex = 4 +) + +// Enum value maps for BlockMetadataIndex. +var ( + BlockMetadataIndex_name = map[int32]string{ + 0: "SIGNATURES", + 1: "LAST_CONFIG", + 2: "TRANSACTIONS_FILTER", + 3: "ORDERER", + 4: "COMMIT_HASH", + } + BlockMetadataIndex_value = map[string]int32{ + "SIGNATURES": 0, + "LAST_CONFIG": 1, + "TRANSACTIONS_FILTER": 2, + "ORDERER": 3, + "COMMIT_HASH": 4, + } +) + +func (x BlockMetadataIndex) Enum() *BlockMetadataIndex { + p := new(BlockMetadataIndex) + *p = x + return p +} + +func (x BlockMetadataIndex) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (BlockMetadataIndex) Descriptor() protoreflect.EnumDescriptor { + return file_common_common_proto_enumTypes[2].Descriptor() +} + +func (BlockMetadataIndex) Type() protoreflect.EnumType { + return &file_common_common_proto_enumTypes[2] +} + +func (x BlockMetadataIndex) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use BlockMetadataIndex.Descriptor instead. +func (BlockMetadataIndex) EnumDescriptor() ([]byte, []int) { + return file_common_common_proto_rawDescGZIP(), []int{2} +} + +// LastConfig is the encoded value for the Metadata message which is encoded in the LAST_CONFIGURATION block metadata index +type LastConfig struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Index uint64 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"` +} + +func (x *LastConfig) Reset() { + *x = LastConfig{} + if protoimpl.UnsafeEnabled { + mi := &file_common_common_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LastConfig) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LastConfig) ProtoMessage() {} + +func (x *LastConfig) ProtoReflect() protoreflect.Message { + mi := &file_common_common_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LastConfig.ProtoReflect.Descriptor instead. +func (*LastConfig) Descriptor() ([]byte, []int) { + return file_common_common_proto_rawDescGZIP(), []int{0} +} + +func (x *LastConfig) GetIndex() uint64 { + if x != nil { + return x.Index + } + return 0 +} + +// Metadata is a common structure to be used to encode block metadata +type Metadata struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Value []byte `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` + Signatures []*MetadataSignature `protobuf:"bytes,2,rep,name=signatures,proto3" json:"signatures,omitempty"` +} + +func (x *Metadata) Reset() { + *x = Metadata{} + if protoimpl.UnsafeEnabled { + mi := &file_common_common_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Metadata) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Metadata) ProtoMessage() {} + +func (x *Metadata) ProtoReflect() protoreflect.Message { + mi := &file_common_common_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Metadata.ProtoReflect.Descriptor instead. +func (*Metadata) Descriptor() ([]byte, []int) { + return file_common_common_proto_rawDescGZIP(), []int{1} +} + +func (x *Metadata) GetValue() []byte { + if x != nil { + return x.Value + } + return nil +} + +func (x *Metadata) GetSignatures() []*MetadataSignature { + if x != nil { + return x.Signatures + } + return nil +} + +type MetadataSignature struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + SignatureHeader []byte `protobuf:"bytes,1,opt,name=signature_header,json=signatureHeader,proto3" json:"signature_header,omitempty"` // An encoded SignatureHeader + Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` // The signature over the concatenation of the Metadata value bytes, signatureHeader, and block header + IdentifierHeader []byte `protobuf:"bytes,3,opt,name=identifier_header,json=identifierHeader,proto3" json:"identifier_header,omitempty"` // An encoded IdentifierHeader. If the signature header is empty, this is used to identify the creator by id +} + +func (x *MetadataSignature) Reset() { + *x = MetadataSignature{} + if protoimpl.UnsafeEnabled { + mi := &file_common_common_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MetadataSignature) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MetadataSignature) ProtoMessage() {} + +func (x *MetadataSignature) ProtoReflect() protoreflect.Message { + mi := &file_common_common_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MetadataSignature.ProtoReflect.Descriptor instead. +func (*MetadataSignature) Descriptor() ([]byte, []int) { + return file_common_common_proto_rawDescGZIP(), []int{2} +} + +func (x *MetadataSignature) GetSignatureHeader() []byte { + if x != nil { + return x.SignatureHeader + } + return nil +} + +func (x *MetadataSignature) GetSignature() []byte { + if x != nil { + return x.Signature + } + return nil +} + +func (x *MetadataSignature) GetIdentifierHeader() []byte { + if x != nil { + return x.IdentifierHeader + } + return nil +} + +// IdentifierHeader is used as an alternative to a SignatureHeader when the creator can be referenced by id +type IdentifierHeader struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Identifier uint32 `protobuf:"varint,1,opt,name=identifier,proto3" json:"identifier,omitempty"` // A unique identifier that represents the creator of the message + Nonce []byte `protobuf:"bytes,2,opt,name=nonce,proto3" json:"nonce,omitempty"` // Arbitrary number that may only be used once. Can be used to detect replay attacks. +} + +func (x *IdentifierHeader) Reset() { + *x = IdentifierHeader{} + if protoimpl.UnsafeEnabled { + mi := &file_common_common_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *IdentifierHeader) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*IdentifierHeader) ProtoMessage() {} + +func (x *IdentifierHeader) ProtoReflect() protoreflect.Message { + mi := &file_common_common_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use IdentifierHeader.ProtoReflect.Descriptor instead. +func (*IdentifierHeader) Descriptor() ([]byte, []int) { + return file_common_common_proto_rawDescGZIP(), []int{3} +} + +func (x *IdentifierHeader) GetIdentifier() uint32 { + if x != nil { + return x.Identifier + } + return 0 +} + +func (x *IdentifierHeader) GetNonce() []byte { + if x != nil { + return x.Nonce + } + return nil +} + +type Header struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ChannelHeader []byte `protobuf:"bytes,1,opt,name=channel_header,json=channelHeader,proto3" json:"channel_header,omitempty"` + SignatureHeader []byte `protobuf:"bytes,2,opt,name=signature_header,json=signatureHeader,proto3" json:"signature_header,omitempty"` +} + +func (x *Header) Reset() { + *x = Header{} + if protoimpl.UnsafeEnabled { + mi := &file_common_common_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Header) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Header) ProtoMessage() {} + +func (x *Header) ProtoReflect() protoreflect.Message { + mi := &file_common_common_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Header.ProtoReflect.Descriptor instead. +func (*Header) Descriptor() ([]byte, []int) { + return file_common_common_proto_rawDescGZIP(), []int{4} +} + +func (x *Header) GetChannelHeader() []byte { + if x != nil { + return x.ChannelHeader + } + return nil +} + +func (x *Header) GetSignatureHeader() []byte { + if x != nil { + return x.SignatureHeader + } + return nil +} + +// Header is a generic replay prevention and identity message to include in a signed payload +type ChannelHeader struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type int32 `protobuf:"varint,1,opt,name=type,proto3" json:"type,omitempty"` // Header types 0-10000 are reserved and defined by HeaderType + // Version indicates message protocol version + Version int32 `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"` + // Timestamp is the local time when the message was created + // by the sender + Timestamp *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + // Identifier of the channel this message is bound for + ChannelId string `protobuf:"bytes,4,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` + // An unique identifier that is used end-to-end. + // - set by higher layers such as end user or SDK + // - passed to the endorser (which will check for uniqueness) + // - as the header is passed along unchanged, it will be + // be retrieved by the committer (uniqueness check here as well) + // - to be stored in the ledger + TxId string `protobuf:"bytes,5,opt,name=tx_id,json=txId,proto3" json:"tx_id,omitempty"` + // The epoch in which this header was generated, where epoch is defined based on block height + // Epoch in which the response has been generated. This field identifies a + // logical window of time. A proposal response is accepted by a peer only if + // two conditions hold: + // 1. the epoch specified in the message is the current epoch + // 2. this message has been only seen once during this epoch (i.e. it hasn't + // been replayed) + Epoch uint64 `protobuf:"varint,6,opt,name=epoch,proto3" json:"epoch,omitempty"` + // Extension that may be attached based on the header type + Extension []byte `protobuf:"bytes,7,opt,name=extension,proto3" json:"extension,omitempty"` + // If mutual TLS is employed, this represents + // the hash of the client's TLS certificate + TlsCertHash []byte `protobuf:"bytes,8,opt,name=tls_cert_hash,json=tlsCertHash,proto3" json:"tls_cert_hash,omitempty"` +} + +func (x *ChannelHeader) Reset() { + *x = ChannelHeader{} + if protoimpl.UnsafeEnabled { + mi := &file_common_common_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChannelHeader) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChannelHeader) ProtoMessage() {} + +func (x *ChannelHeader) ProtoReflect() protoreflect.Message { + mi := &file_common_common_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ChannelHeader.ProtoReflect.Descriptor instead. +func (*ChannelHeader) Descriptor() ([]byte, []int) { + return file_common_common_proto_rawDescGZIP(), []int{5} +} + +func (x *ChannelHeader) GetType() int32 { + if x != nil { + return x.Type + } + return 0 +} + +func (x *ChannelHeader) GetVersion() int32 { + if x != nil { + return x.Version + } + return 0 +} + +func (x *ChannelHeader) GetTimestamp() *timestamppb.Timestamp { + if x != nil { + return x.Timestamp + } + return nil +} + +func (x *ChannelHeader) GetChannelId() string { + if x != nil { + return x.ChannelId + } + return "" +} + +func (x *ChannelHeader) GetTxId() string { + if x != nil { + return x.TxId + } + return "" +} + +func (x *ChannelHeader) GetEpoch() uint64 { + if x != nil { + return x.Epoch + } + return 0 +} + +func (x *ChannelHeader) GetExtension() []byte { + if x != nil { + return x.Extension + } + return nil +} + +func (x *ChannelHeader) GetTlsCertHash() []byte { + if x != nil { + return x.TlsCertHash + } + return nil +} + +type SignatureHeader struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Creator of the message, a marshaled msp.SerializedIdentity + Creator []byte `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` + // Arbitrary number that may only be used once. Can be used to detect replay attacks. + Nonce []byte `protobuf:"bytes,2,opt,name=nonce,proto3" json:"nonce,omitempty"` +} + +func (x *SignatureHeader) Reset() { + *x = SignatureHeader{} + if protoimpl.UnsafeEnabled { + mi := &file_common_common_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SignatureHeader) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SignatureHeader) ProtoMessage() {} + +func (x *SignatureHeader) ProtoReflect() protoreflect.Message { + mi := &file_common_common_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SignatureHeader.ProtoReflect.Descriptor instead. +func (*SignatureHeader) Descriptor() ([]byte, []int) { + return file_common_common_proto_rawDescGZIP(), []int{6} +} + +func (x *SignatureHeader) GetCreator() []byte { + if x != nil { + return x.Creator + } + return nil +} + +func (x *SignatureHeader) GetNonce() []byte { + if x != nil { + return x.Nonce + } + return nil +} + +// Payload is the message contents (and header to allow for signing) +type Payload struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Header is included to provide identity and prevent replay + Header *Header `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + // Data, the encoding of which is defined by the type in the header + Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` +} + +func (x *Payload) Reset() { + *x = Payload{} + if protoimpl.UnsafeEnabled { + mi := &file_common_common_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Payload) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Payload) ProtoMessage() {} + +func (x *Payload) ProtoReflect() protoreflect.Message { + mi := &file_common_common_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Payload.ProtoReflect.Descriptor instead. +func (*Payload) Descriptor() ([]byte, []int) { + return file_common_common_proto_rawDescGZIP(), []int{7} +} + +func (x *Payload) GetHeader() *Header { + if x != nil { + return x.Header + } + return nil +} + +func (x *Payload) GetData() []byte { + if x != nil { + return x.Data + } + return nil +} + +// Envelope wraps a Payload with a signature so that the message may be authenticated +type Envelope struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // A marshaled Payload + Payload []byte `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"` + // A signature by the creator specified in the Payload header + Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` +} + +func (x *Envelope) Reset() { + *x = Envelope{} + if protoimpl.UnsafeEnabled { + mi := &file_common_common_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Envelope) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Envelope) ProtoMessage() {} + +func (x *Envelope) ProtoReflect() protoreflect.Message { + mi := &file_common_common_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Envelope.ProtoReflect.Descriptor instead. +func (*Envelope) Descriptor() ([]byte, []int) { + return file_common_common_proto_rawDescGZIP(), []int{8} +} + +func (x *Envelope) GetPayload() []byte { + if x != nil { + return x.Payload + } + return nil +} + +func (x *Envelope) GetSignature() []byte { + if x != nil { + return x.Signature + } + return nil +} + +// This is finalized block structure to be shared among the orderer and peer +// Note that the BlockHeader chains to the previous BlockHeader, and the BlockData hash is embedded +// in the BlockHeader. This makes it natural and obvious that the Data is included in the hash, but +// the Metadata is not. +type Block struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Header *BlockHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + Data *BlockData `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` + Metadata *BlockMetadata `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"` +} + +func (x *Block) Reset() { + *x = Block{} + if protoimpl.UnsafeEnabled { + mi := &file_common_common_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Block) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Block) ProtoMessage() {} + +func (x *Block) ProtoReflect() protoreflect.Message { + mi := &file_common_common_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Block.ProtoReflect.Descriptor instead. +func (*Block) Descriptor() ([]byte, []int) { + return file_common_common_proto_rawDescGZIP(), []int{9} +} + +func (x *Block) GetHeader() *BlockHeader { + if x != nil { + return x.Header + } + return nil +} + +func (x *Block) GetData() *BlockData { + if x != nil { + return x.Data + } + return nil +} + +func (x *Block) GetMetadata() *BlockMetadata { + if x != nil { + return x.Metadata + } + return nil +} + +// BlockHeader is the element of the block which forms the block chain +// The block header is hashed using the configured chain hashing algorithm +// over the ASN.1 encoding of the BlockHeader +type BlockHeader struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Number uint64 `protobuf:"varint,1,opt,name=number,proto3" json:"number,omitempty"` // The position in the blockchain + PreviousHash []byte `protobuf:"bytes,2,opt,name=previous_hash,json=previousHash,proto3" json:"previous_hash,omitempty"` // The hash of the previous block header + DataHash []byte `protobuf:"bytes,3,opt,name=data_hash,json=dataHash,proto3" json:"data_hash,omitempty"` // The hash of the BlockData, by MerkleTree +} + +func (x *BlockHeader) Reset() { + *x = BlockHeader{} + if protoimpl.UnsafeEnabled { + mi := &file_common_common_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BlockHeader) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BlockHeader) ProtoMessage() {} + +func (x *BlockHeader) ProtoReflect() protoreflect.Message { + mi := &file_common_common_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BlockHeader.ProtoReflect.Descriptor instead. +func (*BlockHeader) Descriptor() ([]byte, []int) { + return file_common_common_proto_rawDescGZIP(), []int{10} +} + +func (x *BlockHeader) GetNumber() uint64 { + if x != nil { + return x.Number + } + return 0 +} + +func (x *BlockHeader) GetPreviousHash() []byte { + if x != nil { + return x.PreviousHash + } + return nil +} + +func (x *BlockHeader) GetDataHash() []byte { + if x != nil { + return x.DataHash + } + return nil +} + +type BlockData struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Data [][]byte `protobuf:"bytes,1,rep,name=data,proto3" json:"data,omitempty"` +} + +func (x *BlockData) Reset() { + *x = BlockData{} + if protoimpl.UnsafeEnabled { + mi := &file_common_common_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BlockData) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BlockData) ProtoMessage() {} + +func (x *BlockData) ProtoReflect() protoreflect.Message { + mi := &file_common_common_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BlockData.ProtoReflect.Descriptor instead. +func (*BlockData) Descriptor() ([]byte, []int) { + return file_common_common_proto_rawDescGZIP(), []int{11} +} + +func (x *BlockData) GetData() [][]byte { + if x != nil { + return x.Data + } + return nil +} + +type BlockMetadata struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Metadata [][]byte `protobuf:"bytes,1,rep,name=metadata,proto3" json:"metadata,omitempty"` +} + +func (x *BlockMetadata) Reset() { + *x = BlockMetadata{} + if protoimpl.UnsafeEnabled { + mi := &file_common_common_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BlockMetadata) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BlockMetadata) ProtoMessage() {} + +func (x *BlockMetadata) ProtoReflect() protoreflect.Message { + mi := &file_common_common_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BlockMetadata.ProtoReflect.Descriptor instead. +func (*BlockMetadata) Descriptor() ([]byte, []int) { + return file_common_common_proto_rawDescGZIP(), []int{12} +} + +func (x *BlockMetadata) GetMetadata() [][]byte { + if x != nil { + return x.Metadata + } + return nil +} + +// OrdererBlockMetadata defines metadata that is set by the ordering service. +type OrdererBlockMetadata struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + LastConfig *LastConfig `protobuf:"bytes,1,opt,name=last_config,json=lastConfig,proto3" json:"last_config,omitempty"` + ConsenterMetadata []byte `protobuf:"bytes,2,opt,name=consenter_metadata,json=consenterMetadata,proto3" json:"consenter_metadata,omitempty"` +} + +func (x *OrdererBlockMetadata) Reset() { + *x = OrdererBlockMetadata{} + if protoimpl.UnsafeEnabled { + mi := &file_common_common_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *OrdererBlockMetadata) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OrdererBlockMetadata) ProtoMessage() {} + +func (x *OrdererBlockMetadata) ProtoReflect() protoreflect.Message { + mi := &file_common_common_proto_msgTypes[13] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use OrdererBlockMetadata.ProtoReflect.Descriptor instead. +func (*OrdererBlockMetadata) Descriptor() ([]byte, []int) { + return file_common_common_proto_rawDescGZIP(), []int{13} +} + +func (x *OrdererBlockMetadata) GetLastConfig() *LastConfig { + if x != nil { + return x.LastConfig + } + return nil +} + +func (x *OrdererBlockMetadata) GetConsenterMetadata() []byte { + if x != nil { + return x.ConsenterMetadata + } + return nil +} + +var File_common_common_proto protoreflect.FileDescriptor + +var file_common_common_proto_rawDesc = []byte{ + 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x1a, 0x1f, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x22, + 0x0a, 0x0a, 0x4c, 0x61, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x14, 0x0a, 0x05, + 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x69, 0x6e, 0x64, + 0x65, 0x78, 0x22, 0x5b, 0x0a, 0x08, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x14, + 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x12, 0x39, 0x0a, 0x0a, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, + 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, + 0x6e, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, + 0x75, 0x72, 0x65, 0x52, 0x0a, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x22, + 0x89, 0x01, 0x0a, 0x11, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x53, 0x69, 0x67, 0x6e, + 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x29, 0x0a, 0x10, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, + 0x72, 0x65, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x0f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x2b, + 0x0a, 0x11, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x5f, 0x68, 0x65, 0x61, + 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x10, 0x69, 0x64, 0x65, 0x6e, 0x74, + 0x69, 0x66, 0x69, 0x65, 0x72, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x22, 0x48, 0x0a, 0x10, 0x49, + 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, + 0x1e, 0x0a, 0x0a, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x12, + 0x14, 0x0a, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, + 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x22, 0x5a, 0x0a, 0x06, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, + 0x25, 0x0a, 0x0e, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0d, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, + 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x29, 0x0a, 0x10, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, + 0x75, 0x72, 0x65, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x0f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x22, 0x83, 0x02, 0x0a, 0x0d, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x48, 0x65, 0x61, + 0x64, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, + 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, + 0x6e, 0x12, 0x38, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x1d, 0x0a, 0x0a, 0x63, + 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x09, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x49, 0x64, 0x12, 0x13, 0x0a, 0x05, 0x74, 0x78, + 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x78, 0x49, 0x64, 0x12, + 0x14, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, + 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x1c, 0x0a, 0x09, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, + 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, + 0x69, 0x6f, 0x6e, 0x12, 0x22, 0x0a, 0x0d, 0x74, 0x6c, 0x73, 0x5f, 0x63, 0x65, 0x72, 0x74, 0x5f, + 0x68, 0x61, 0x73, 0x68, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x74, 0x6c, 0x73, 0x43, + 0x65, 0x72, 0x74, 0x48, 0x61, 0x73, 0x68, 0x22, 0x41, 0x0a, 0x0f, 0x53, 0x69, 0x67, 0x6e, 0x61, + 0x74, 0x75, 0x72, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x72, + 0x65, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x63, 0x72, 0x65, + 0x61, 0x74, 0x6f, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x22, 0x45, 0x0a, 0x07, 0x50, 0x61, + 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x26, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x48, + 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x12, 0x0a, + 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, + 0x61, 0x22, 0x42, 0x0a, 0x08, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x12, 0x18, 0x0a, + 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, + 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, + 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, + 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x8e, 0x01, 0x0a, 0x05, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, + 0x2b, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x13, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, + 0x61, 0x64, 0x65, 0x72, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x25, 0x0a, 0x04, + 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x63, 0x6f, 0x6d, + 0x6d, 0x6f, 0x6e, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, 0x64, + 0x61, 0x74, 0x61, 0x12, 0x31, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x42, + 0x6c, 0x6f, 0x63, 0x6b, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x08, 0x6d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x22, 0x67, 0x0a, 0x0b, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, + 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x23, 0x0a, + 0x0d, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x48, 0x61, + 0x73, 0x68, 0x12, 0x1b, 0x0a, 0x09, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x64, 0x61, 0x74, 0x61, 0x48, 0x61, 0x73, 0x68, 0x22, + 0x1f, 0x0a, 0x09, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x44, 0x61, 0x74, 0x61, 0x12, 0x12, 0x0a, 0x04, + 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, + 0x22, 0x2b, 0x0a, 0x0d, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0x12, 0x1a, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0c, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x22, 0x7a, 0x0a, + 0x14, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x72, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x4d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x33, 0x0a, 0x0b, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x63, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x63, 0x6f, 0x6d, + 0x6d, 0x6f, 0x6e, 0x2e, 0x4c, 0x61, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x0a, + 0x6c, 0x61, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x2d, 0x0a, 0x12, 0x63, 0x6f, + 0x6e, 0x73, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x11, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x74, 0x65, + 0x72, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2a, 0xc0, 0x01, 0x0a, 0x06, 0x53, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, + 0x00, 0x12, 0x0c, 0x0a, 0x07, 0x53, 0x55, 0x43, 0x43, 0x45, 0x53, 0x53, 0x10, 0xc8, 0x01, 0x12, + 0x10, 0x0a, 0x0b, 0x42, 0x41, 0x44, 0x5f, 0x52, 0x45, 0x51, 0x55, 0x45, 0x53, 0x54, 0x10, 0x90, + 0x03, 0x12, 0x0e, 0x0a, 0x09, 0x46, 0x4f, 0x52, 0x42, 0x49, 0x44, 0x44, 0x45, 0x4e, 0x10, 0x93, + 0x03, 0x12, 0x0e, 0x0a, 0x09, 0x4e, 0x4f, 0x54, 0x5f, 0x46, 0x4f, 0x55, 0x4e, 0x44, 0x10, 0x94, + 0x03, 0x12, 0x1d, 0x0a, 0x18, 0x52, 0x45, 0x51, 0x55, 0x45, 0x53, 0x54, 0x5f, 0x45, 0x4e, 0x54, + 0x49, 0x54, 0x59, 0x5f, 0x54, 0x4f, 0x4f, 0x5f, 0x4c, 0x41, 0x52, 0x47, 0x45, 0x10, 0x9d, 0x03, + 0x12, 0x1a, 0x0a, 0x15, 0x49, 0x4e, 0x54, 0x45, 0x52, 0x4e, 0x41, 0x4c, 0x5f, 0x53, 0x45, 0x52, + 0x56, 0x45, 0x52, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0xf4, 0x03, 0x12, 0x14, 0x0a, 0x0f, + 0x4e, 0x4f, 0x54, 0x5f, 0x49, 0x4d, 0x50, 0x4c, 0x45, 0x4d, 0x45, 0x4e, 0x54, 0x45, 0x44, 0x10, + 0xf5, 0x03, 0x12, 0x18, 0x0a, 0x13, 0x53, 0x45, 0x52, 0x56, 0x49, 0x43, 0x45, 0x5f, 0x55, 0x4e, + 0x41, 0x56, 0x41, 0x49, 0x4c, 0x41, 0x42, 0x4c, 0x45, 0x10, 0xf7, 0x03, 0x2a, 0xee, 0x01, 0x0a, + 0x0a, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x4d, + 0x45, 0x53, 0x53, 0x41, 0x47, 0x45, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x43, 0x4f, 0x4e, 0x46, + 0x49, 0x47, 0x10, 0x01, 0x12, 0x11, 0x0a, 0x0d, 0x43, 0x4f, 0x4e, 0x46, 0x49, 0x47, 0x5f, 0x55, + 0x50, 0x44, 0x41, 0x54, 0x45, 0x10, 0x02, 0x12, 0x18, 0x0a, 0x14, 0x45, 0x4e, 0x44, 0x4f, 0x52, + 0x53, 0x45, 0x52, 0x5f, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x10, + 0x03, 0x12, 0x1b, 0x0a, 0x13, 0x4f, 0x52, 0x44, 0x45, 0x52, 0x45, 0x52, 0x5f, 0x54, 0x52, 0x41, + 0x4e, 0x53, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x04, 0x1a, 0x02, 0x08, 0x01, 0x12, 0x15, + 0x0a, 0x11, 0x44, 0x45, 0x4c, 0x49, 0x56, 0x45, 0x52, 0x5f, 0x53, 0x45, 0x45, 0x4b, 0x5f, 0x49, + 0x4e, 0x46, 0x4f, 0x10, 0x05, 0x12, 0x15, 0x0a, 0x11, 0x43, 0x48, 0x41, 0x49, 0x4e, 0x43, 0x4f, + 0x44, 0x45, 0x5f, 0x50, 0x41, 0x43, 0x4b, 0x41, 0x47, 0x45, 0x10, 0x06, 0x22, 0x04, 0x08, 0x07, + 0x10, 0x07, 0x22, 0x04, 0x08, 0x08, 0x10, 0x08, 0x22, 0x04, 0x08, 0x09, 0x10, 0x09, 0x2a, 0x14, + 0x50, 0x45, 0x45, 0x52, 0x5f, 0x52, 0x45, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, 0x55, 0x50, + 0x44, 0x41, 0x54, 0x45, 0x2a, 0x14, 0x50, 0x45, 0x45, 0x52, 0x5f, 0x41, 0x44, 0x4d, 0x49, 0x4e, + 0x5f, 0x4f, 0x50, 0x45, 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x2a, 0x11, 0x54, 0x4f, 0x4b, 0x45, + 0x4e, 0x5f, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x2a, 0x74, 0x0a, + 0x12, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x49, 0x6e, + 0x64, 0x65, 0x78, 0x12, 0x0e, 0x0a, 0x0a, 0x53, 0x49, 0x47, 0x4e, 0x41, 0x54, 0x55, 0x52, 0x45, + 0x53, 0x10, 0x00, 0x12, 0x13, 0x0a, 0x0b, 0x4c, 0x41, 0x53, 0x54, 0x5f, 0x43, 0x4f, 0x4e, 0x46, + 0x49, 0x47, 0x10, 0x01, 0x1a, 0x02, 0x08, 0x01, 0x12, 0x17, 0x0a, 0x13, 0x54, 0x52, 0x41, 0x4e, + 0x53, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x53, 0x5f, 0x46, 0x49, 0x4c, 0x54, 0x45, 0x52, 0x10, + 0x02, 0x12, 0x0f, 0x0a, 0x07, 0x4f, 0x52, 0x44, 0x45, 0x52, 0x45, 0x52, 0x10, 0x03, 0x1a, 0x02, + 0x08, 0x01, 0x12, 0x0f, 0x0a, 0x0b, 0x43, 0x4f, 0x4d, 0x4d, 0x49, 0x54, 0x5f, 0x48, 0x41, 0x53, + 0x48, 0x10, 0x04, 0x42, 0xa1, 0x01, 0x0a, 0x24, 0x6f, 0x72, 0x67, 0x2e, 0x68, 0x79, 0x70, 0x65, + 0x72, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2e, 0x66, 0x61, 0x62, 0x72, 0x69, 0x63, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x42, 0x0b, 0x43, 0x6f, + 0x6d, 0x6d, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x34, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x65, 0x64, + 0x67, 0x65, 0x72, 0x2f, 0x66, 0x61, 0x62, 0x72, 0x69, 0x63, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x73, 0x2d, 0x67, 0x6f, 0x2d, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, + 0x6e, 0xa2, 0x02, 0x03, 0x43, 0x58, 0x58, 0xaa, 0x02, 0x06, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, + 0xca, 0x02, 0x06, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0xe2, 0x02, 0x12, 0x43, 0x6f, 0x6d, 0x6d, + 0x6f, 0x6e, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, + 0x06, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_common_common_proto_rawDescOnce sync.Once + file_common_common_proto_rawDescData = file_common_common_proto_rawDesc +) + +func file_common_common_proto_rawDescGZIP() []byte { + file_common_common_proto_rawDescOnce.Do(func() { + file_common_common_proto_rawDescData = protoimpl.X.CompressGZIP(file_common_common_proto_rawDescData) + }) + return file_common_common_proto_rawDescData +} + +var file_common_common_proto_enumTypes = make([]protoimpl.EnumInfo, 3) +var file_common_common_proto_msgTypes = make([]protoimpl.MessageInfo, 14) +var file_common_common_proto_goTypes = []interface{}{ + (Status)(0), // 0: common.Status + (HeaderType)(0), // 1: common.HeaderType + (BlockMetadataIndex)(0), // 2: common.BlockMetadataIndex + (*LastConfig)(nil), // 3: common.LastConfig + (*Metadata)(nil), // 4: common.Metadata + (*MetadataSignature)(nil), // 5: common.MetadataSignature + (*IdentifierHeader)(nil), // 6: common.IdentifierHeader + (*Header)(nil), // 7: common.Header + (*ChannelHeader)(nil), // 8: common.ChannelHeader + (*SignatureHeader)(nil), // 9: common.SignatureHeader + (*Payload)(nil), // 10: common.Payload + (*Envelope)(nil), // 11: common.Envelope + (*Block)(nil), // 12: common.Block + (*BlockHeader)(nil), // 13: common.BlockHeader + (*BlockData)(nil), // 14: common.BlockData + (*BlockMetadata)(nil), // 15: common.BlockMetadata + (*OrdererBlockMetadata)(nil), // 16: common.OrdererBlockMetadata + (*timestamppb.Timestamp)(nil), // 17: google.protobuf.Timestamp +} +var file_common_common_proto_depIdxs = []int32{ + 5, // 0: common.Metadata.signatures:type_name -> common.MetadataSignature + 17, // 1: common.ChannelHeader.timestamp:type_name -> google.protobuf.Timestamp + 7, // 2: common.Payload.header:type_name -> common.Header + 13, // 3: common.Block.header:type_name -> common.BlockHeader + 14, // 4: common.Block.data:type_name -> common.BlockData + 15, // 5: common.Block.metadata:type_name -> common.BlockMetadata + 3, // 6: common.OrdererBlockMetadata.last_config:type_name -> common.LastConfig + 7, // [7:7] is the sub-list for method output_type + 7, // [7:7] is the sub-list for method input_type + 7, // [7:7] is the sub-list for extension type_name + 7, // [7:7] is the sub-list for extension extendee + 0, // [0:7] is the sub-list for field type_name +} + +func init() { file_common_common_proto_init() } +func file_common_common_proto_init() { + if File_common_common_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_common_common_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LastConfig); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_common_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Metadata); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_common_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MetadataSignature); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_common_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*IdentifierHeader); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_common_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Header); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_common_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChannelHeader); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_common_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SignatureHeader); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_common_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Payload); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_common_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Envelope); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_common_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Block); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_common_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BlockHeader); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_common_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BlockData); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_common_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BlockMetadata); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_common_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*OrdererBlockMetadata); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_common_common_proto_rawDesc, + NumEnums: 3, + NumMessages: 14, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_common_common_proto_goTypes, + DependencyIndexes: file_common_common_proto_depIdxs, + EnumInfos: file_common_common_proto_enumTypes, + MessageInfos: file_common_common_proto_msgTypes, + }.Build() + File_common_common_proto = out.File + file_common_common_proto_rawDesc = nil + file_common_common_proto_goTypes = nil + file_common_common_proto_depIdxs = nil +} diff --git a/vendor/github.com/hyperledger/fabric-protos-go-apiv2/common/configtx.pb.go b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/common/configtx.pb.go new file mode 100644 index 00000000000..b97727243ff --- /dev/null +++ b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/common/configtx.pb.go @@ -0,0 +1,840 @@ +// Copyright the Hyperledger Fabric contributors. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: common/configtx.proto + +package common + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// ConfigEnvelope is designed to contain _all_ configuration for a chain with no dependency +// on previous configuration transactions. +// +// It is generated with the following scheme: +// 1. Retrieve the existing configuration +// 2. Note the config properties (ConfigValue, ConfigPolicy, ConfigGroup) to be modified +// 3. Add any intermediate ConfigGroups to the ConfigUpdate.read_set (sparsely) +// 4. Add any additional desired dependencies to ConfigUpdate.read_set (sparsely) +// 5. Modify the config properties, incrementing each version by 1, set them in the ConfigUpdate.write_set +// Note: any element not modified but specified should already be in the read_set, so may be specified sparsely +// 6. Create ConfigUpdate message and marshal it into ConfigUpdateEnvelope.update and encode the required signatures +// a) Each signature is of type ConfigSignature +// b) The ConfigSignature signature is over the concatenation of signature_header and the ConfigUpdate bytes (which includes a ChainHeader) +// 5. Submit new Config for ordering in Envelope signed by submitter +// a) The Envelope Payload has data set to the marshaled ConfigEnvelope +// b) The Envelope Payload has a header of type Header.Type.CONFIG_UPDATE +// +// The configuration manager will verify: +// 1. All items in the read_set exist at the read versions +// 2. All items in the write_set at a different version than, or not in, the read_set have been appropriately signed according to their mod_policy +// 3. The new configuration satisfies the ConfigSchema +type ConfigEnvelope struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Config *Config `protobuf:"bytes,1,opt,name=config,proto3" json:"config,omitempty"` // A marshaled Config structure + LastUpdate *Envelope `protobuf:"bytes,2,opt,name=last_update,json=lastUpdate,proto3" json:"last_update,omitempty"` // The last CONFIG_UPDATE message which generated this current configuration +} + +func (x *ConfigEnvelope) Reset() { + *x = ConfigEnvelope{} + if protoimpl.UnsafeEnabled { + mi := &file_common_configtx_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ConfigEnvelope) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ConfigEnvelope) ProtoMessage() {} + +func (x *ConfigEnvelope) ProtoReflect() protoreflect.Message { + mi := &file_common_configtx_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ConfigEnvelope.ProtoReflect.Descriptor instead. +func (*ConfigEnvelope) Descriptor() ([]byte, []int) { + return file_common_configtx_proto_rawDescGZIP(), []int{0} +} + +func (x *ConfigEnvelope) GetConfig() *Config { + if x != nil { + return x.Config + } + return nil +} + +func (x *ConfigEnvelope) GetLastUpdate() *Envelope { + if x != nil { + return x.LastUpdate + } + return nil +} + +// Config represents the config for a particular channel +type Config struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Sequence uint64 `protobuf:"varint,1,opt,name=sequence,proto3" json:"sequence,omitempty"` + ChannelGroup *ConfigGroup `protobuf:"bytes,2,opt,name=channel_group,json=channelGroup,proto3" json:"channel_group,omitempty"` // channel_group is a bad name for this, it should be changed to root when API breakage is allowed +} + +func (x *Config) Reset() { + *x = Config{} + if protoimpl.UnsafeEnabled { + mi := &file_common_configtx_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Config) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Config) ProtoMessage() {} + +func (x *Config) ProtoReflect() protoreflect.Message { + mi := &file_common_configtx_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Config.ProtoReflect.Descriptor instead. +func (*Config) Descriptor() ([]byte, []int) { + return file_common_configtx_proto_rawDescGZIP(), []int{1} +} + +func (x *Config) GetSequence() uint64 { + if x != nil { + return x.Sequence + } + return 0 +} + +func (x *Config) GetChannelGroup() *ConfigGroup { + if x != nil { + return x.ChannelGroup + } + return nil +} + +type ConfigUpdateEnvelope struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ConfigUpdate []byte `protobuf:"bytes,1,opt,name=config_update,json=configUpdate,proto3" json:"config_update,omitempty"` // A marshaled ConfigUpdate structure + Signatures []*ConfigSignature `protobuf:"bytes,2,rep,name=signatures,proto3" json:"signatures,omitempty"` // Signatures over the config_update +} + +func (x *ConfigUpdateEnvelope) Reset() { + *x = ConfigUpdateEnvelope{} + if protoimpl.UnsafeEnabled { + mi := &file_common_configtx_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ConfigUpdateEnvelope) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ConfigUpdateEnvelope) ProtoMessage() {} + +func (x *ConfigUpdateEnvelope) ProtoReflect() protoreflect.Message { + mi := &file_common_configtx_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ConfigUpdateEnvelope.ProtoReflect.Descriptor instead. +func (*ConfigUpdateEnvelope) Descriptor() ([]byte, []int) { + return file_common_configtx_proto_rawDescGZIP(), []int{2} +} + +func (x *ConfigUpdateEnvelope) GetConfigUpdate() []byte { + if x != nil { + return x.ConfigUpdate + } + return nil +} + +func (x *ConfigUpdateEnvelope) GetSignatures() []*ConfigSignature { + if x != nil { + return x.Signatures + } + return nil +} + +// ConfigUpdate is used to submit a subset of config and to have the orderer apply to Config +// it is always submitted inside a ConfigUpdateEnvelope which allows the addition of signatures +// resulting in a new total configuration. The update is applied as follows: +// 1. The versions from all of the elements in the read_set is verified against the versions in the existing config. +// If there is a mismatch in the read versions, then the config update fails and is rejected. +// 2. Any elements in the write_set with the same version as the read_set are ignored. +// 3. The corresponding mod_policy for every remaining element in the write_set is collected. +// 4. Each policy is checked against the signatures from the ConfigUpdateEnvelope, any failing to verify are rejected +// 5. The write_set is applied to the Config and the ConfigGroupSchema verifies that the updates were legal +type ConfigUpdate struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ChannelId string `protobuf:"bytes,1,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` // Which channel this config update is for + ReadSet *ConfigGroup `protobuf:"bytes,2,opt,name=read_set,json=readSet,proto3" json:"read_set,omitempty"` // ReadSet explicitly lists the portion of the config which was read, this should be sparse with only Version set + WriteSet *ConfigGroup `protobuf:"bytes,3,opt,name=write_set,json=writeSet,proto3" json:"write_set,omitempty"` // WriteSet lists the portion of the config which was written, this should included updated Versions + IsolatedData map[string][]byte `protobuf:"bytes,5,rep,name=isolated_data,json=isolatedData,proto3" json:"isolated_data,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // Data which is not to be reflected in the resulting Config, but is still needed for some other purpose. For instance, rscc_seed_data +} + +func (x *ConfigUpdate) Reset() { + *x = ConfigUpdate{} + if protoimpl.UnsafeEnabled { + mi := &file_common_configtx_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ConfigUpdate) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ConfigUpdate) ProtoMessage() {} + +func (x *ConfigUpdate) ProtoReflect() protoreflect.Message { + mi := &file_common_configtx_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ConfigUpdate.ProtoReflect.Descriptor instead. +func (*ConfigUpdate) Descriptor() ([]byte, []int) { + return file_common_configtx_proto_rawDescGZIP(), []int{3} +} + +func (x *ConfigUpdate) GetChannelId() string { + if x != nil { + return x.ChannelId + } + return "" +} + +func (x *ConfigUpdate) GetReadSet() *ConfigGroup { + if x != nil { + return x.ReadSet + } + return nil +} + +func (x *ConfigUpdate) GetWriteSet() *ConfigGroup { + if x != nil { + return x.WriteSet + } + return nil +} + +func (x *ConfigUpdate) GetIsolatedData() map[string][]byte { + if x != nil { + return x.IsolatedData + } + return nil +} + +// ConfigGroup is the hierarchical data structure for holding config +type ConfigGroup struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Version uint64 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` + Groups map[string]*ConfigGroup `protobuf:"bytes,2,rep,name=groups,proto3" json:"groups,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Values map[string]*ConfigValue `protobuf:"bytes,3,rep,name=values,proto3" json:"values,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Policies map[string]*ConfigPolicy `protobuf:"bytes,4,rep,name=policies,proto3" json:"policies,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + ModPolicy string `protobuf:"bytes,5,opt,name=mod_policy,json=modPolicy,proto3" json:"mod_policy,omitempty"` +} + +func (x *ConfigGroup) Reset() { + *x = ConfigGroup{} + if protoimpl.UnsafeEnabled { + mi := &file_common_configtx_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ConfigGroup) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ConfigGroup) ProtoMessage() {} + +func (x *ConfigGroup) ProtoReflect() protoreflect.Message { + mi := &file_common_configtx_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ConfigGroup.ProtoReflect.Descriptor instead. +func (*ConfigGroup) Descriptor() ([]byte, []int) { + return file_common_configtx_proto_rawDescGZIP(), []int{4} +} + +func (x *ConfigGroup) GetVersion() uint64 { + if x != nil { + return x.Version + } + return 0 +} + +func (x *ConfigGroup) GetGroups() map[string]*ConfigGroup { + if x != nil { + return x.Groups + } + return nil +} + +func (x *ConfigGroup) GetValues() map[string]*ConfigValue { + if x != nil { + return x.Values + } + return nil +} + +func (x *ConfigGroup) GetPolicies() map[string]*ConfigPolicy { + if x != nil { + return x.Policies + } + return nil +} + +func (x *ConfigGroup) GetModPolicy() string { + if x != nil { + return x.ModPolicy + } + return "" +} + +// ConfigValue represents an individual piece of config data +type ConfigValue struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Version uint64 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` + Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` + ModPolicy string `protobuf:"bytes,3,opt,name=mod_policy,json=modPolicy,proto3" json:"mod_policy,omitempty"` +} + +func (x *ConfigValue) Reset() { + *x = ConfigValue{} + if protoimpl.UnsafeEnabled { + mi := &file_common_configtx_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ConfigValue) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ConfigValue) ProtoMessage() {} + +func (x *ConfigValue) ProtoReflect() protoreflect.Message { + mi := &file_common_configtx_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ConfigValue.ProtoReflect.Descriptor instead. +func (*ConfigValue) Descriptor() ([]byte, []int) { + return file_common_configtx_proto_rawDescGZIP(), []int{5} +} + +func (x *ConfigValue) GetVersion() uint64 { + if x != nil { + return x.Version + } + return 0 +} + +func (x *ConfigValue) GetValue() []byte { + if x != nil { + return x.Value + } + return nil +} + +func (x *ConfigValue) GetModPolicy() string { + if x != nil { + return x.ModPolicy + } + return "" +} + +type ConfigPolicy struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Version uint64 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` + Policy *Policy `protobuf:"bytes,2,opt,name=policy,proto3" json:"policy,omitempty"` + ModPolicy string `protobuf:"bytes,3,opt,name=mod_policy,json=modPolicy,proto3" json:"mod_policy,omitempty"` +} + +func (x *ConfigPolicy) Reset() { + *x = ConfigPolicy{} + if protoimpl.UnsafeEnabled { + mi := &file_common_configtx_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ConfigPolicy) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ConfigPolicy) ProtoMessage() {} + +func (x *ConfigPolicy) ProtoReflect() protoreflect.Message { + mi := &file_common_configtx_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ConfigPolicy.ProtoReflect.Descriptor instead. +func (*ConfigPolicy) Descriptor() ([]byte, []int) { + return file_common_configtx_proto_rawDescGZIP(), []int{6} +} + +func (x *ConfigPolicy) GetVersion() uint64 { + if x != nil { + return x.Version + } + return 0 +} + +func (x *ConfigPolicy) GetPolicy() *Policy { + if x != nil { + return x.Policy + } + return nil +} + +func (x *ConfigPolicy) GetModPolicy() string { + if x != nil { + return x.ModPolicy + } + return "" +} + +type ConfigSignature struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + SignatureHeader []byte `protobuf:"bytes,1,opt,name=signature_header,json=signatureHeader,proto3" json:"signature_header,omitempty"` // A marshaled SignatureHeader + Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` // Signature over the concatenation signatureHeader bytes and config bytes +} + +func (x *ConfigSignature) Reset() { + *x = ConfigSignature{} + if protoimpl.UnsafeEnabled { + mi := &file_common_configtx_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ConfigSignature) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ConfigSignature) ProtoMessage() {} + +func (x *ConfigSignature) ProtoReflect() protoreflect.Message { + mi := &file_common_configtx_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ConfigSignature.ProtoReflect.Descriptor instead. +func (*ConfigSignature) Descriptor() ([]byte, []int) { + return file_common_configtx_proto_rawDescGZIP(), []int{7} +} + +func (x *ConfigSignature) GetSignatureHeader() []byte { + if x != nil { + return x.SignatureHeader + } + return nil +} + +func (x *ConfigSignature) GetSignature() []byte { + if x != nil { + return x.Signature + } + return nil +} + +var File_common_configtx_proto protoreflect.FileDescriptor + +var file_common_configtx_proto_rawDesc = []byte{ + 0x0a, 0x15, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x74, + 0x78, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x1a, + 0x13, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x15, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x70, 0x6f, 0x6c, + 0x69, 0x63, 0x69, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x6b, 0x0a, 0x0e, 0x43, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x12, 0x26, 0x0a, + 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, + 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x06, 0x63, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x31, 0x0a, 0x0b, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x75, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x63, 0x6f, 0x6d, + 0x6d, 0x6f, 0x6e, 0x2e, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x52, 0x0a, 0x6c, 0x61, + 0x73, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x22, 0x6a, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x38, + 0x0a, 0x0d, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x5f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x43, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x0c, 0x63, 0x68, 0x61, 0x6e, + 0x6e, 0x65, 0x6c, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4a, 0x04, 0x08, 0x03, 0x10, 0x04, 0x52, 0x04, + 0x74, 0x79, 0x70, 0x65, 0x22, 0x74, 0x0a, 0x14, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x12, 0x23, 0x0a, 0x0d, + 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x12, 0x37, 0x0a, 0x0a, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x18, + 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x43, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x0a, + 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x22, 0xa9, 0x02, 0x0a, 0x0c, 0x43, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x63, + 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x09, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x49, 0x64, 0x12, 0x2e, 0x0a, 0x08, 0x72, 0x65, + 0x61, 0x64, 0x5f, 0x73, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x63, + 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x47, 0x72, 0x6f, 0x75, + 0x70, 0x52, 0x07, 0x72, 0x65, 0x61, 0x64, 0x53, 0x65, 0x74, 0x12, 0x30, 0x0a, 0x09, 0x77, 0x72, + 0x69, 0x74, 0x65, 0x5f, 0x73, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, + 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x47, 0x72, 0x6f, + 0x75, 0x70, 0x52, 0x08, 0x77, 0x72, 0x69, 0x74, 0x65, 0x53, 0x65, 0x74, 0x12, 0x4b, 0x0a, 0x0d, + 0x69, 0x73, 0x6f, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x05, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x43, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x49, 0x73, 0x6f, 0x6c, 0x61, 0x74, + 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0c, 0x69, 0x73, 0x6f, + 0x6c, 0x61, 0x74, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x1a, 0x3f, 0x0a, 0x11, 0x49, 0x73, 0x6f, + 0x6c, 0x61, 0x74, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, + 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, + 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x4a, 0x04, 0x08, 0x04, 0x10, 0x05, + 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0xea, 0x03, 0x0a, 0x0b, 0x43, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, + 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, + 0x12, 0x37, 0x0a, 0x06, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x1f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x47, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x52, 0x06, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x12, 0x37, 0x0a, 0x06, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, + 0x6f, 0x6e, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x73, 0x12, 0x3d, 0x0a, 0x08, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x18, 0x04, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x43, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x69, + 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, + 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x6f, 0x64, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x6f, 0x64, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, + 0x1a, 0x4e, 0x0a, 0x0b, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, + 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, + 0x79, 0x12, 0x29, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x13, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, + 0x1a, 0x4e, 0x0a, 0x0b, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, + 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, + 0x79, 0x12, 0x29, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x13, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, + 0x1a, 0x51, 0x0a, 0x0d, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, + 0x6b, 0x65, 0x79, 0x12, 0x2a, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x43, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, + 0x02, 0x38, 0x01, 0x22, 0x5c, 0x0a, 0x0b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x56, 0x61, 0x6c, + 0x75, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x6f, 0x64, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x6f, 0x64, 0x50, 0x6f, 0x6c, 0x69, 0x63, + 0x79, 0x22, 0x6f, 0x0a, 0x0c, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x50, 0x6f, 0x6c, 0x69, 0x63, + 0x79, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x04, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x26, 0x0a, 0x06, 0x70, + 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x63, 0x6f, + 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x06, 0x70, 0x6f, 0x6c, + 0x69, 0x63, 0x79, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x6f, 0x64, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, + 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x6f, 0x64, 0x50, 0x6f, 0x6c, 0x69, + 0x63, 0x79, 0x22, 0x5a, 0x0a, 0x0f, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x53, 0x69, 0x67, 0x6e, + 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x29, 0x0a, 0x10, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, + 0x72, 0x65, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x0f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x42, 0xa3, + 0x01, 0x0a, 0x24, 0x6f, 0x72, 0x67, 0x2e, 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x65, 0x64, 0x67, + 0x65, 0x72, 0x2e, 0x66, 0x61, 0x62, 0x72, 0x69, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, + 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x42, 0x0d, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x54, + 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x34, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, + 0x2f, 0x66, 0x61, 0x62, 0x72, 0x69, 0x63, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2d, 0x67, + 0x6f, 0x2d, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0xa2, 0x02, + 0x03, 0x43, 0x58, 0x58, 0xaa, 0x02, 0x06, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0xca, 0x02, 0x06, + 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0xe2, 0x02, 0x12, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x5c, + 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x06, 0x43, 0x6f, + 0x6d, 0x6d, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_common_configtx_proto_rawDescOnce sync.Once + file_common_configtx_proto_rawDescData = file_common_configtx_proto_rawDesc +) + +func file_common_configtx_proto_rawDescGZIP() []byte { + file_common_configtx_proto_rawDescOnce.Do(func() { + file_common_configtx_proto_rawDescData = protoimpl.X.CompressGZIP(file_common_configtx_proto_rawDescData) + }) + return file_common_configtx_proto_rawDescData +} + +var file_common_configtx_proto_msgTypes = make([]protoimpl.MessageInfo, 12) +var file_common_configtx_proto_goTypes = []interface{}{ + (*ConfigEnvelope)(nil), // 0: common.ConfigEnvelope + (*Config)(nil), // 1: common.Config + (*ConfigUpdateEnvelope)(nil), // 2: common.ConfigUpdateEnvelope + (*ConfigUpdate)(nil), // 3: common.ConfigUpdate + (*ConfigGroup)(nil), // 4: common.ConfigGroup + (*ConfigValue)(nil), // 5: common.ConfigValue + (*ConfigPolicy)(nil), // 6: common.ConfigPolicy + (*ConfigSignature)(nil), // 7: common.ConfigSignature + nil, // 8: common.ConfigUpdate.IsolatedDataEntry + nil, // 9: common.ConfigGroup.GroupsEntry + nil, // 10: common.ConfigGroup.ValuesEntry + nil, // 11: common.ConfigGroup.PoliciesEntry + (*Envelope)(nil), // 12: common.Envelope + (*Policy)(nil), // 13: common.Policy +} +var file_common_configtx_proto_depIdxs = []int32{ + 1, // 0: common.ConfigEnvelope.config:type_name -> common.Config + 12, // 1: common.ConfigEnvelope.last_update:type_name -> common.Envelope + 4, // 2: common.Config.channel_group:type_name -> common.ConfigGroup + 7, // 3: common.ConfigUpdateEnvelope.signatures:type_name -> common.ConfigSignature + 4, // 4: common.ConfigUpdate.read_set:type_name -> common.ConfigGroup + 4, // 5: common.ConfigUpdate.write_set:type_name -> common.ConfigGroup + 8, // 6: common.ConfigUpdate.isolated_data:type_name -> common.ConfigUpdate.IsolatedDataEntry + 9, // 7: common.ConfigGroup.groups:type_name -> common.ConfigGroup.GroupsEntry + 10, // 8: common.ConfigGroup.values:type_name -> common.ConfigGroup.ValuesEntry + 11, // 9: common.ConfigGroup.policies:type_name -> common.ConfigGroup.PoliciesEntry + 13, // 10: common.ConfigPolicy.policy:type_name -> common.Policy + 4, // 11: common.ConfigGroup.GroupsEntry.value:type_name -> common.ConfigGroup + 5, // 12: common.ConfigGroup.ValuesEntry.value:type_name -> common.ConfigValue + 6, // 13: common.ConfigGroup.PoliciesEntry.value:type_name -> common.ConfigPolicy + 14, // [14:14] is the sub-list for method output_type + 14, // [14:14] is the sub-list for method input_type + 14, // [14:14] is the sub-list for extension type_name + 14, // [14:14] is the sub-list for extension extendee + 0, // [0:14] is the sub-list for field type_name +} + +func init() { file_common_configtx_proto_init() } +func file_common_configtx_proto_init() { + if File_common_configtx_proto != nil { + return + } + file_common_common_proto_init() + file_common_policies_proto_init() + if !protoimpl.UnsafeEnabled { + file_common_configtx_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ConfigEnvelope); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_configtx_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Config); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_configtx_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ConfigUpdateEnvelope); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_configtx_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ConfigUpdate); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_configtx_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ConfigGroup); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_configtx_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ConfigValue); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_configtx_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ConfigPolicy); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_configtx_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ConfigSignature); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_common_configtx_proto_rawDesc, + NumEnums: 0, + NumMessages: 12, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_common_configtx_proto_goTypes, + DependencyIndexes: file_common_configtx_proto_depIdxs, + MessageInfos: file_common_configtx_proto_msgTypes, + }.Build() + File_common_configtx_proto = out.File + file_common_configtx_proto_rawDesc = nil + file_common_configtx_proto_goTypes = nil + file_common_configtx_proto_depIdxs = nil +} diff --git a/vendor/github.com/hyperledger/fabric-protos-go-apiv2/common/configuration.pb.go b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/common/configuration.pb.go new file mode 100644 index 00000000000..927ebcf6fed --- /dev/null +++ b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/common/configuration.pb.go @@ -0,0 +1,705 @@ +// Copyright the Hyperledger Fabric contributors. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: common/configuration.proto + +package common + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// HashingAlgorithm is encoded into the configuration transaction as a +// configuration item of type Chain with a Key of "HashingAlgorithm" and a +// Value of HashingAlgorithm as marshaled protobuf bytes +type HashingAlgorithm struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // SHA256 is currently the only supported and tested algorithm. + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` +} + +func (x *HashingAlgorithm) Reset() { + *x = HashingAlgorithm{} + if protoimpl.UnsafeEnabled { + mi := &file_common_configuration_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HashingAlgorithm) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HashingAlgorithm) ProtoMessage() {} + +func (x *HashingAlgorithm) ProtoReflect() protoreflect.Message { + mi := &file_common_configuration_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use HashingAlgorithm.ProtoReflect.Descriptor instead. +func (*HashingAlgorithm) Descriptor() ([]byte, []int) { + return file_common_configuration_proto_rawDescGZIP(), []int{0} +} + +func (x *HashingAlgorithm) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +// BlockDataHashingStructure is encoded into the configuration transaction as a configuration item of +// type Chain with a Key of "BlockDataHashingStructure" and a Value of HashingAlgorithm as marshaled protobuf bytes +type BlockDataHashingStructure struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // width specifies the width of the Merkle tree to use when computing the BlockDataHash + // in order to replicate flat hashing, set this width to MAX_UINT32 + Width uint32 `protobuf:"varint,1,opt,name=width,proto3" json:"width,omitempty"` +} + +func (x *BlockDataHashingStructure) Reset() { + *x = BlockDataHashingStructure{} + if protoimpl.UnsafeEnabled { + mi := &file_common_configuration_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BlockDataHashingStructure) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BlockDataHashingStructure) ProtoMessage() {} + +func (x *BlockDataHashingStructure) ProtoReflect() protoreflect.Message { + mi := &file_common_configuration_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BlockDataHashingStructure.ProtoReflect.Descriptor instead. +func (*BlockDataHashingStructure) Descriptor() ([]byte, []int) { + return file_common_configuration_proto_rawDescGZIP(), []int{1} +} + +func (x *BlockDataHashingStructure) GetWidth() uint32 { + if x != nil { + return x.Width + } + return 0 +} + +// OrdererAddresses is encoded into the configuration transaction as a configuration item of type Chain +// with a Key of "OrdererAddresses" and a Value of OrdererAddresses as marshaled protobuf bytes +type OrdererAddresses struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Addresses []string `protobuf:"bytes,1,rep,name=addresses,proto3" json:"addresses,omitempty"` +} + +func (x *OrdererAddresses) Reset() { + *x = OrdererAddresses{} + if protoimpl.UnsafeEnabled { + mi := &file_common_configuration_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *OrdererAddresses) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OrdererAddresses) ProtoMessage() {} + +func (x *OrdererAddresses) ProtoReflect() protoreflect.Message { + mi := &file_common_configuration_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use OrdererAddresses.ProtoReflect.Descriptor instead. +func (*OrdererAddresses) Descriptor() ([]byte, []int) { + return file_common_configuration_proto_rawDescGZIP(), []int{2} +} + +func (x *OrdererAddresses) GetAddresses() []string { + if x != nil { + return x.Addresses + } + return nil +} + +// Consenter represents a consenting node (i.e. replica). +type Consenter struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Host string `protobuf:"bytes,2,opt,name=host,proto3" json:"host,omitempty"` + Port uint32 `protobuf:"varint,3,opt,name=port,proto3" json:"port,omitempty"` + MspId string `protobuf:"bytes,4,opt,name=msp_id,json=mspId,proto3" json:"msp_id,omitempty"` + Identity []byte `protobuf:"bytes,5,opt,name=identity,proto3" json:"identity,omitempty"` + ClientTlsCert []byte `protobuf:"bytes,6,opt,name=client_tls_cert,json=clientTlsCert,proto3" json:"client_tls_cert,omitempty"` + ServerTlsCert []byte `protobuf:"bytes,7,opt,name=server_tls_cert,json=serverTlsCert,proto3" json:"server_tls_cert,omitempty"` +} + +func (x *Consenter) Reset() { + *x = Consenter{} + if protoimpl.UnsafeEnabled { + mi := &file_common_configuration_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Consenter) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Consenter) ProtoMessage() {} + +func (x *Consenter) ProtoReflect() protoreflect.Message { + mi := &file_common_configuration_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Consenter.ProtoReflect.Descriptor instead. +func (*Consenter) Descriptor() ([]byte, []int) { + return file_common_configuration_proto_rawDescGZIP(), []int{3} +} + +func (x *Consenter) GetId() uint32 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *Consenter) GetHost() string { + if x != nil { + return x.Host + } + return "" +} + +func (x *Consenter) GetPort() uint32 { + if x != nil { + return x.Port + } + return 0 +} + +func (x *Consenter) GetMspId() string { + if x != nil { + return x.MspId + } + return "" +} + +func (x *Consenter) GetIdentity() []byte { + if x != nil { + return x.Identity + } + return nil +} + +func (x *Consenter) GetClientTlsCert() []byte { + if x != nil { + return x.ClientTlsCert + } + return nil +} + +func (x *Consenter) GetServerTlsCert() []byte { + if x != nil { + return x.ServerTlsCert + } + return nil +} + +// Orderers is encoded into the configuration transaction as a configuration item of type Chain +// with a Key of "Orderers" and a Value of Orderers as marshaled protobuf bytes +type Orderers struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ConsenterMapping []*Consenter `protobuf:"bytes,1,rep,name=consenter_mapping,json=consenterMapping,proto3" json:"consenter_mapping,omitempty"` +} + +func (x *Orderers) Reset() { + *x = Orderers{} + if protoimpl.UnsafeEnabled { + mi := &file_common_configuration_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Orderers) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Orderers) ProtoMessage() {} + +func (x *Orderers) ProtoReflect() protoreflect.Message { + mi := &file_common_configuration_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Orderers.ProtoReflect.Descriptor instead. +func (*Orderers) Descriptor() ([]byte, []int) { + return file_common_configuration_proto_rawDescGZIP(), []int{4} +} + +func (x *Orderers) GetConsenterMapping() []*Consenter { + if x != nil { + return x.ConsenterMapping + } + return nil +} + +// Consortium represents the consortium context in which the channel was created +type Consortium struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` +} + +func (x *Consortium) Reset() { + *x = Consortium{} + if protoimpl.UnsafeEnabled { + mi := &file_common_configuration_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Consortium) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Consortium) ProtoMessage() {} + +func (x *Consortium) ProtoReflect() protoreflect.Message { + mi := &file_common_configuration_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Consortium.ProtoReflect.Descriptor instead. +func (*Consortium) Descriptor() ([]byte, []int) { + return file_common_configuration_proto_rawDescGZIP(), []int{5} +} + +func (x *Consortium) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +// Capabilities message defines the capabilities a particular binary must implement +// for that binary to be able to safely participate in the channel. The capabilities +// message is defined at the /Channel level, the /Channel/Application level, and the +// /Channel/Orderer level. +// +// The /Channel level capabilties define capabilities which both the orderer and peer +// binaries must satisfy. These capabilties might be things like a new MSP type, +// or a new policy type. +// +// The /Channel/Orderer level capabilties define capabilities which must be supported +// by the orderer, but which have no bearing on the behavior of the peer. For instance +// if the orderer changes the logic for how it constructs new channels, only all orderers +// must agree on the new logic. The peers do not need to be aware of this change as +// they only interact with the channel after it has been constructed. +// +// Finally, the /Channel/Application level capabilities define capabilities which the peer +// binary must satisfy, but which have no bearing on the orderer. For instance, if the +// peer adds a new UTXO transaction type, or changes the chaincode lifecycle requirements, +// all peers must agree on the new logic. However, orderers never inspect transactions +// this deeply, and therefore have no need to be aware of the change. +// +// The capabilities strings defined in these messages typically correspond to release +// binary versions (e.g. "V1.1"), and are used primarilly as a mechanism for a fully +// upgraded network to switch from one set of logic to a new one. +// +// Although for V1.1, the orderers must be upgraded to V1.1 prior to the rest of the +// network, going forward, because of the split between the /Channel, /Channel/Orderer +// and /Channel/Application capabilities. It should be possible for the orderer and +// application networks to upgrade themselves independently (with the exception of any +// new capabilities defined at the /Channel level). +type Capabilities struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Capabilities map[string]*Capability `protobuf:"bytes,1,rep,name=capabilities,proto3" json:"capabilities,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *Capabilities) Reset() { + *x = Capabilities{} + if protoimpl.UnsafeEnabled { + mi := &file_common_configuration_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Capabilities) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Capabilities) ProtoMessage() {} + +func (x *Capabilities) ProtoReflect() protoreflect.Message { + mi := &file_common_configuration_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Capabilities.ProtoReflect.Descriptor instead. +func (*Capabilities) Descriptor() ([]byte, []int) { + return file_common_configuration_proto_rawDescGZIP(), []int{6} +} + +func (x *Capabilities) GetCapabilities() map[string]*Capability { + if x != nil { + return x.Capabilities + } + return nil +} + +// Capability is an empty message for the time being. It is defined as a protobuf +// message rather than a constant, so that we may extend capabilities with other fields +// if the need arises in the future. For the time being, a capability being in the +// capabilities map requires that that capability be supported. +type Capability struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *Capability) Reset() { + *x = Capability{} + if protoimpl.UnsafeEnabled { + mi := &file_common_configuration_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Capability) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Capability) ProtoMessage() {} + +func (x *Capability) ProtoReflect() protoreflect.Message { + mi := &file_common_configuration_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Capability.ProtoReflect.Descriptor instead. +func (*Capability) Descriptor() ([]byte, []int) { + return file_common_configuration_proto_rawDescGZIP(), []int{7} +} + +var File_common_configuration_proto protoreflect.FileDescriptor + +var file_common_configuration_proto_rawDesc = []byte{ + 0x0a, 0x1a, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x63, 0x6f, + 0x6d, 0x6d, 0x6f, 0x6e, 0x22, 0x26, 0x0a, 0x10, 0x48, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x41, + 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x31, 0x0a, 0x19, + 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x44, 0x61, 0x74, 0x61, 0x48, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, + 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x75, 0x72, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x77, 0x69, 0x64, + 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x77, 0x69, 0x64, 0x74, 0x68, 0x22, + 0x30, 0x0a, 0x10, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x65, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, + 0x73, 0x22, 0xc6, 0x01, 0x0a, 0x09, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x12, + 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, + 0x12, 0x0a, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, + 0x6f, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0d, 0x52, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x15, 0x0a, 0x06, 0x6d, 0x73, 0x70, 0x5f, 0x69, + 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6d, 0x73, 0x70, 0x49, 0x64, 0x12, 0x1a, + 0x0a, 0x08, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x08, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x26, 0x0a, 0x0f, 0x63, 0x6c, + 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x6c, 0x73, 0x5f, 0x63, 0x65, 0x72, 0x74, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x0d, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x54, 0x6c, 0x73, 0x43, 0x65, + 0x72, 0x74, 0x12, 0x26, 0x0a, 0x0f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x74, 0x6c, 0x73, + 0x5f, 0x63, 0x65, 0x72, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0d, 0x73, 0x65, 0x72, + 0x76, 0x65, 0x72, 0x54, 0x6c, 0x73, 0x43, 0x65, 0x72, 0x74, 0x22, 0x4a, 0x0a, 0x08, 0x4f, 0x72, + 0x64, 0x65, 0x72, 0x65, 0x72, 0x73, 0x12, 0x3e, 0x0a, 0x11, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, + 0x74, 0x65, 0x72, 0x5f, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x11, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x65, + 0x6e, 0x74, 0x65, 0x72, 0x52, 0x10, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x4d, + 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x22, 0x20, 0x0a, 0x0a, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x72, + 0x74, 0x69, 0x75, 0x6d, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0xaf, 0x01, 0x0a, 0x0c, 0x43, 0x61, 0x70, + 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x12, 0x4a, 0x0a, 0x0c, 0x63, 0x61, 0x70, + 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x26, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x43, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, + 0x69, 0x74, 0x69, 0x65, 0x73, 0x2e, 0x43, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, + 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0c, 0x63, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, + 0x69, 0x74, 0x69, 0x65, 0x73, 0x1a, 0x53, 0x0a, 0x11, 0x43, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, + 0x69, 0x74, 0x69, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, + 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x28, 0x0a, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x63, 0x6f, + 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x43, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x52, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x0c, 0x0a, 0x0a, 0x43, 0x61, + 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x42, 0xa8, 0x01, 0x0a, 0x24, 0x6f, 0x72, 0x67, + 0x2e, 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2e, 0x66, 0x61, 0x62, + 0x72, 0x69, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, + 0x6e, 0x42, 0x12, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x34, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2f, + 0x66, 0x61, 0x62, 0x72, 0x69, 0x63, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2d, 0x67, 0x6f, + 0x2d, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0xa2, 0x02, 0x03, + 0x43, 0x58, 0x58, 0xaa, 0x02, 0x06, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0xca, 0x02, 0x06, 0x43, + 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0xe2, 0x02, 0x12, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x5c, 0x47, + 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x06, 0x43, 0x6f, 0x6d, + 0x6d, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_common_configuration_proto_rawDescOnce sync.Once + file_common_configuration_proto_rawDescData = file_common_configuration_proto_rawDesc +) + +func file_common_configuration_proto_rawDescGZIP() []byte { + file_common_configuration_proto_rawDescOnce.Do(func() { + file_common_configuration_proto_rawDescData = protoimpl.X.CompressGZIP(file_common_configuration_proto_rawDescData) + }) + return file_common_configuration_proto_rawDescData +} + +var file_common_configuration_proto_msgTypes = make([]protoimpl.MessageInfo, 9) +var file_common_configuration_proto_goTypes = []interface{}{ + (*HashingAlgorithm)(nil), // 0: common.HashingAlgorithm + (*BlockDataHashingStructure)(nil), // 1: common.BlockDataHashingStructure + (*OrdererAddresses)(nil), // 2: common.OrdererAddresses + (*Consenter)(nil), // 3: common.Consenter + (*Orderers)(nil), // 4: common.Orderers + (*Consortium)(nil), // 5: common.Consortium + (*Capabilities)(nil), // 6: common.Capabilities + (*Capability)(nil), // 7: common.Capability + nil, // 8: common.Capabilities.CapabilitiesEntry +} +var file_common_configuration_proto_depIdxs = []int32{ + 3, // 0: common.Orderers.consenter_mapping:type_name -> common.Consenter + 8, // 1: common.Capabilities.capabilities:type_name -> common.Capabilities.CapabilitiesEntry + 7, // 2: common.Capabilities.CapabilitiesEntry.value:type_name -> common.Capability + 3, // [3:3] is the sub-list for method output_type + 3, // [3:3] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name +} + +func init() { file_common_configuration_proto_init() } +func file_common_configuration_proto_init() { + if File_common_configuration_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_common_configuration_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*HashingAlgorithm); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_configuration_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BlockDataHashingStructure); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_configuration_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*OrdererAddresses); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_configuration_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Consenter); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_configuration_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Orderers); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_configuration_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Consortium); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_configuration_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Capabilities); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_configuration_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Capability); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_common_configuration_proto_rawDesc, + NumEnums: 0, + NumMessages: 9, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_common_configuration_proto_goTypes, + DependencyIndexes: file_common_configuration_proto_depIdxs, + MessageInfos: file_common_configuration_proto_msgTypes, + }.Build() + File_common_configuration_proto = out.File + file_common_configuration_proto_rawDesc = nil + file_common_configuration_proto_goTypes = nil + file_common_configuration_proto_depIdxs = nil +} diff --git a/vendor/github.com/hyperledger/fabric-protos-go-apiv2/common/ledger.pb.go b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/common/ledger.pb.go new file mode 100644 index 00000000000..e486f78dfa9 --- /dev/null +++ b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/common/ledger.pb.go @@ -0,0 +1,262 @@ +// Copyright the Hyperledger Fabric contributors. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: common/ledger.proto + +package common + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Contains information about the blockchain ledger such as height, current +// block hash, and previous block hash. +type BlockchainInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Height uint64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` + CurrentBlockHash []byte `protobuf:"bytes,2,opt,name=currentBlockHash,proto3" json:"currentBlockHash,omitempty"` + PreviousBlockHash []byte `protobuf:"bytes,3,opt,name=previousBlockHash,proto3" json:"previousBlockHash,omitempty"` + // Specifies bootstrapping snapshot info if the channel is bootstrapped from a snapshot. + // It is nil if the channel is not bootstrapped from a snapshot. + BootstrappingSnapshotInfo *BootstrappingSnapshotInfo `protobuf:"bytes,4,opt,name=bootstrappingSnapshotInfo,proto3" json:"bootstrappingSnapshotInfo,omitempty"` +} + +func (x *BlockchainInfo) Reset() { + *x = BlockchainInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_common_ledger_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BlockchainInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BlockchainInfo) ProtoMessage() {} + +func (x *BlockchainInfo) ProtoReflect() protoreflect.Message { + mi := &file_common_ledger_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BlockchainInfo.ProtoReflect.Descriptor instead. +func (*BlockchainInfo) Descriptor() ([]byte, []int) { + return file_common_ledger_proto_rawDescGZIP(), []int{0} +} + +func (x *BlockchainInfo) GetHeight() uint64 { + if x != nil { + return x.Height + } + return 0 +} + +func (x *BlockchainInfo) GetCurrentBlockHash() []byte { + if x != nil { + return x.CurrentBlockHash + } + return nil +} + +func (x *BlockchainInfo) GetPreviousBlockHash() []byte { + if x != nil { + return x.PreviousBlockHash + } + return nil +} + +func (x *BlockchainInfo) GetBootstrappingSnapshotInfo() *BootstrappingSnapshotInfo { + if x != nil { + return x.BootstrappingSnapshotInfo + } + return nil +} + +// Contains information for the bootstrapping snapshot. +type BootstrappingSnapshotInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + LastBlockInSnapshot uint64 `protobuf:"varint,1,opt,name=lastBlockInSnapshot,proto3" json:"lastBlockInSnapshot,omitempty"` +} + +func (x *BootstrappingSnapshotInfo) Reset() { + *x = BootstrappingSnapshotInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_common_ledger_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BootstrappingSnapshotInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BootstrappingSnapshotInfo) ProtoMessage() {} + +func (x *BootstrappingSnapshotInfo) ProtoReflect() protoreflect.Message { + mi := &file_common_ledger_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BootstrappingSnapshotInfo.ProtoReflect.Descriptor instead. +func (*BootstrappingSnapshotInfo) Descriptor() ([]byte, []int) { + return file_common_ledger_proto_rawDescGZIP(), []int{1} +} + +func (x *BootstrappingSnapshotInfo) GetLastBlockInSnapshot() uint64 { + if x != nil { + return x.LastBlockInSnapshot + } + return 0 +} + +var File_common_ledger_proto protoreflect.FileDescriptor + +var file_common_ledger_proto_rawDesc = []byte{ + 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x22, 0xe3, 0x01, + 0x0a, 0x0e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x6e, 0x66, 0x6f, + 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x2a, 0x0a, 0x10, 0x63, 0x75, 0x72, 0x72, + 0x65, 0x6e, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x10, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, + 0x48, 0x61, 0x73, 0x68, 0x12, 0x2c, 0x0a, 0x11, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, + 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x11, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, + 0x73, 0x68, 0x12, 0x5f, 0x0a, 0x19, 0x62, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x70, + 0x69, 0x6e, 0x67, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x42, + 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x53, 0x6e, 0x61, 0x70, + 0x73, 0x68, 0x6f, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x19, 0x62, 0x6f, 0x6f, 0x74, 0x73, 0x74, + 0x72, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x49, + 0x6e, 0x66, 0x6f, 0x22, 0x4d, 0x0a, 0x19, 0x42, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, + 0x70, 0x69, 0x6e, 0x67, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x49, 0x6e, 0x66, 0x6f, + 0x12, 0x30, 0x0a, 0x13, 0x6c, 0x61, 0x73, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x49, 0x6e, 0x53, + 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x13, 0x6c, + 0x61, 0x73, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x49, 0x6e, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, + 0x6f, 0x74, 0x42, 0xa1, 0x01, 0x0a, 0x24, 0x6f, 0x72, 0x67, 0x2e, 0x68, 0x79, 0x70, 0x65, 0x72, + 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2e, 0x66, 0x61, 0x62, 0x72, 0x69, 0x63, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x42, 0x0b, 0x4c, 0x65, 0x64, + 0x67, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x34, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x65, 0x64, 0x67, + 0x65, 0x72, 0x2f, 0x66, 0x61, 0x62, 0x72, 0x69, 0x63, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, + 0x2d, 0x67, 0x6f, 0x2d, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, + 0xa2, 0x02, 0x03, 0x43, 0x58, 0x58, 0xaa, 0x02, 0x06, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0xca, + 0x02, 0x06, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0xe2, 0x02, 0x12, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, + 0x6e, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x06, + 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_common_ledger_proto_rawDescOnce sync.Once + file_common_ledger_proto_rawDescData = file_common_ledger_proto_rawDesc +) + +func file_common_ledger_proto_rawDescGZIP() []byte { + file_common_ledger_proto_rawDescOnce.Do(func() { + file_common_ledger_proto_rawDescData = protoimpl.X.CompressGZIP(file_common_ledger_proto_rawDescData) + }) + return file_common_ledger_proto_rawDescData +} + +var file_common_ledger_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_common_ledger_proto_goTypes = []interface{}{ + (*BlockchainInfo)(nil), // 0: common.BlockchainInfo + (*BootstrappingSnapshotInfo)(nil), // 1: common.BootstrappingSnapshotInfo +} +var file_common_ledger_proto_depIdxs = []int32{ + 1, // 0: common.BlockchainInfo.bootstrappingSnapshotInfo:type_name -> common.BootstrappingSnapshotInfo + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_common_ledger_proto_init() } +func file_common_ledger_proto_init() { + if File_common_ledger_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_common_ledger_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BlockchainInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_ledger_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BootstrappingSnapshotInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_common_ledger_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_common_ledger_proto_goTypes, + DependencyIndexes: file_common_ledger_proto_depIdxs, + MessageInfos: file_common_ledger_proto_msgTypes, + }.Build() + File_common_ledger_proto = out.File + file_common_ledger_proto_rawDesc = nil + file_common_ledger_proto_goTypes = nil + file_common_ledger_proto_depIdxs = nil +} diff --git a/vendor/github.com/hyperledger/fabric-protos-go-apiv2/common/policies.pb.go b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/common/policies.pb.go new file mode 100644 index 00000000000..3f2b35b3c77 --- /dev/null +++ b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/common/policies.pb.go @@ -0,0 +1,761 @@ +// Copyright the Hyperledger Fabric contributors. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: common/policies.proto + +package common + +import ( + msp "github.com/hyperledger/fabric-protos-go-apiv2/msp" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type Policy_PolicyType int32 + +const ( + Policy_UNKNOWN Policy_PolicyType = 0 // Reserved to check for proper initialization + Policy_SIGNATURE Policy_PolicyType = 1 + Policy_MSP Policy_PolicyType = 2 + Policy_IMPLICIT_META Policy_PolicyType = 3 +) + +// Enum value maps for Policy_PolicyType. +var ( + Policy_PolicyType_name = map[int32]string{ + 0: "UNKNOWN", + 1: "SIGNATURE", + 2: "MSP", + 3: "IMPLICIT_META", + } + Policy_PolicyType_value = map[string]int32{ + "UNKNOWN": 0, + "SIGNATURE": 1, + "MSP": 2, + "IMPLICIT_META": 3, + } +) + +func (x Policy_PolicyType) Enum() *Policy_PolicyType { + p := new(Policy_PolicyType) + *p = x + return p +} + +func (x Policy_PolicyType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Policy_PolicyType) Descriptor() protoreflect.EnumDescriptor { + return file_common_policies_proto_enumTypes[0].Descriptor() +} + +func (Policy_PolicyType) Type() protoreflect.EnumType { + return &file_common_policies_proto_enumTypes[0] +} + +func (x Policy_PolicyType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Policy_PolicyType.Descriptor instead. +func (Policy_PolicyType) EnumDescriptor() ([]byte, []int) { + return file_common_policies_proto_rawDescGZIP(), []int{0, 0} +} + +type ImplicitMetaPolicy_Rule int32 + +const ( + ImplicitMetaPolicy_ANY ImplicitMetaPolicy_Rule = 0 // Requires any of the sub-policies be satisfied, if no sub-policies exist, always returns true + ImplicitMetaPolicy_ALL ImplicitMetaPolicy_Rule = 1 // Requires all of the sub-policies be satisfied + ImplicitMetaPolicy_MAJORITY ImplicitMetaPolicy_Rule = 2 // Requires a strict majority (greater than half) of the sub-policies be satisfied +) + +// Enum value maps for ImplicitMetaPolicy_Rule. +var ( + ImplicitMetaPolicy_Rule_name = map[int32]string{ + 0: "ANY", + 1: "ALL", + 2: "MAJORITY", + } + ImplicitMetaPolicy_Rule_value = map[string]int32{ + "ANY": 0, + "ALL": 1, + "MAJORITY": 2, + } +) + +func (x ImplicitMetaPolicy_Rule) Enum() *ImplicitMetaPolicy_Rule { + p := new(ImplicitMetaPolicy_Rule) + *p = x + return p +} + +func (x ImplicitMetaPolicy_Rule) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ImplicitMetaPolicy_Rule) Descriptor() protoreflect.EnumDescriptor { + return file_common_policies_proto_enumTypes[1].Descriptor() +} + +func (ImplicitMetaPolicy_Rule) Type() protoreflect.EnumType { + return &file_common_policies_proto_enumTypes[1] +} + +func (x ImplicitMetaPolicy_Rule) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ImplicitMetaPolicy_Rule.Descriptor instead. +func (ImplicitMetaPolicy_Rule) EnumDescriptor() ([]byte, []int) { + return file_common_policies_proto_rawDescGZIP(), []int{3, 0} +} + +// Policy expresses a policy which the orderer can evaluate, because there has been some desire expressed to support +// multiple policy engines, this is typed as a oneof for now +type Policy struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type int32 `protobuf:"varint,1,opt,name=type,proto3" json:"type,omitempty"` // For outside implementors, consider the first 1000 types reserved, otherwise one of PolicyType + Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *Policy) Reset() { + *x = Policy{} + if protoimpl.UnsafeEnabled { + mi := &file_common_policies_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Policy) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Policy) ProtoMessage() {} + +func (x *Policy) ProtoReflect() protoreflect.Message { + mi := &file_common_policies_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Policy.ProtoReflect.Descriptor instead. +func (*Policy) Descriptor() ([]byte, []int) { + return file_common_policies_proto_rawDescGZIP(), []int{0} +} + +func (x *Policy) GetType() int32 { + if x != nil { + return x.Type + } + return 0 +} + +func (x *Policy) GetValue() []byte { + if x != nil { + return x.Value + } + return nil +} + +// SignaturePolicyEnvelope wraps a SignaturePolicy and includes a version for future enhancements +type SignaturePolicyEnvelope struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Version int32 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` + Rule *SignaturePolicy `protobuf:"bytes,2,opt,name=rule,proto3" json:"rule,omitempty"` + Identities []*msp.MSPPrincipal `protobuf:"bytes,3,rep,name=identities,proto3" json:"identities,omitempty"` +} + +func (x *SignaturePolicyEnvelope) Reset() { + *x = SignaturePolicyEnvelope{} + if protoimpl.UnsafeEnabled { + mi := &file_common_policies_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SignaturePolicyEnvelope) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SignaturePolicyEnvelope) ProtoMessage() {} + +func (x *SignaturePolicyEnvelope) ProtoReflect() protoreflect.Message { + mi := &file_common_policies_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SignaturePolicyEnvelope.ProtoReflect.Descriptor instead. +func (*SignaturePolicyEnvelope) Descriptor() ([]byte, []int) { + return file_common_policies_proto_rawDescGZIP(), []int{1} +} + +func (x *SignaturePolicyEnvelope) GetVersion() int32 { + if x != nil { + return x.Version + } + return 0 +} + +func (x *SignaturePolicyEnvelope) GetRule() *SignaturePolicy { + if x != nil { + return x.Rule + } + return nil +} + +func (x *SignaturePolicyEnvelope) GetIdentities() []*msp.MSPPrincipal { + if x != nil { + return x.Identities + } + return nil +} + +// SignaturePolicy is a recursive message structure which defines a featherweight DSL for describing +// policies which are more complicated than 'exactly this signature'. The NOutOf operator is sufficent +// to express AND as well as OR, as well as of course N out of the following M policies +// SignedBy implies that the signature is from a valid certificate which is signed by the trusted +// authority specified in the bytes. This will be the certificate itself for a self-signed certificate +// and will be the CA for more traditional certificates +type SignaturePolicy struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Type: + // + // *SignaturePolicy_SignedBy + // *SignaturePolicy_NOutOf_ + Type isSignaturePolicy_Type `protobuf_oneof:"Type"` +} + +func (x *SignaturePolicy) Reset() { + *x = SignaturePolicy{} + if protoimpl.UnsafeEnabled { + mi := &file_common_policies_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SignaturePolicy) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SignaturePolicy) ProtoMessage() {} + +func (x *SignaturePolicy) ProtoReflect() protoreflect.Message { + mi := &file_common_policies_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SignaturePolicy.ProtoReflect.Descriptor instead. +func (*SignaturePolicy) Descriptor() ([]byte, []int) { + return file_common_policies_proto_rawDescGZIP(), []int{2} +} + +func (m *SignaturePolicy) GetType() isSignaturePolicy_Type { + if m != nil { + return m.Type + } + return nil +} + +func (x *SignaturePolicy) GetSignedBy() int32 { + if x, ok := x.GetType().(*SignaturePolicy_SignedBy); ok { + return x.SignedBy + } + return 0 +} + +func (x *SignaturePolicy) GetNOutOf() *SignaturePolicy_NOutOf { + if x, ok := x.GetType().(*SignaturePolicy_NOutOf_); ok { + return x.NOutOf + } + return nil +} + +type isSignaturePolicy_Type interface { + isSignaturePolicy_Type() +} + +type SignaturePolicy_SignedBy struct { + SignedBy int32 `protobuf:"varint,1,opt,name=signed_by,json=signedBy,proto3,oneof"` +} + +type SignaturePolicy_NOutOf_ struct { + NOutOf *SignaturePolicy_NOutOf `protobuf:"bytes,2,opt,name=n_out_of,json=nOutOf,proto3,oneof"` +} + +func (*SignaturePolicy_SignedBy) isSignaturePolicy_Type() {} + +func (*SignaturePolicy_NOutOf_) isSignaturePolicy_Type() {} + +// ImplicitMetaPolicy is a policy type which depends on the hierarchical nature of the configuration +// It is implicit because the rule is generate implicitly based on the number of sub policies +// It is meta because it depends only on the result of other policies +// When evaluated, this policy iterates over all immediate child sub-groups, retrieves the policy +// of name sub_policy, evaluates the collection and applies the rule. +// For example, with 4 sub-groups, and a policy name of "foo", ImplicitMetaPolicy retrieves +// each sub-group, retrieves policy "foo" for each subgroup, evaluates it, and, in the case of ANY +// 1 satisfied is sufficient, ALL would require 4 signatures, and MAJORITY would require 3 signatures. +type ImplicitMetaPolicy struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + SubPolicy string `protobuf:"bytes,1,opt,name=sub_policy,json=subPolicy,proto3" json:"sub_policy,omitempty"` + Rule ImplicitMetaPolicy_Rule `protobuf:"varint,2,opt,name=rule,proto3,enum=common.ImplicitMetaPolicy_Rule" json:"rule,omitempty"` +} + +func (x *ImplicitMetaPolicy) Reset() { + *x = ImplicitMetaPolicy{} + if protoimpl.UnsafeEnabled { + mi := &file_common_policies_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ImplicitMetaPolicy) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ImplicitMetaPolicy) ProtoMessage() {} + +func (x *ImplicitMetaPolicy) ProtoReflect() protoreflect.Message { + mi := &file_common_policies_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ImplicitMetaPolicy.ProtoReflect.Descriptor instead. +func (*ImplicitMetaPolicy) Descriptor() ([]byte, []int) { + return file_common_policies_proto_rawDescGZIP(), []int{3} +} + +func (x *ImplicitMetaPolicy) GetSubPolicy() string { + if x != nil { + return x.SubPolicy + } + return "" +} + +func (x *ImplicitMetaPolicy) GetRule() ImplicitMetaPolicy_Rule { + if x != nil { + return x.Rule + } + return ImplicitMetaPolicy_ANY +} + +// ApplicationPolicy captures the diffenrent policy types that +// are set and evaluted at the application level. +// +// Deprecated: Marked as deprecated in common/policies.proto. +type ApplicationPolicy struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Type: + // + // *ApplicationPolicy_SignaturePolicy + // *ApplicationPolicy_ChannelConfigPolicyReference + Type isApplicationPolicy_Type `protobuf_oneof:"Type"` +} + +func (x *ApplicationPolicy) Reset() { + *x = ApplicationPolicy{} + if protoimpl.UnsafeEnabled { + mi := &file_common_policies_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ApplicationPolicy) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ApplicationPolicy) ProtoMessage() {} + +func (x *ApplicationPolicy) ProtoReflect() protoreflect.Message { + mi := &file_common_policies_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ApplicationPolicy.ProtoReflect.Descriptor instead. +func (*ApplicationPolicy) Descriptor() ([]byte, []int) { + return file_common_policies_proto_rawDescGZIP(), []int{4} +} + +func (m *ApplicationPolicy) GetType() isApplicationPolicy_Type { + if m != nil { + return m.Type + } + return nil +} + +func (x *ApplicationPolicy) GetSignaturePolicy() *SignaturePolicyEnvelope { + if x, ok := x.GetType().(*ApplicationPolicy_SignaturePolicy); ok { + return x.SignaturePolicy + } + return nil +} + +func (x *ApplicationPolicy) GetChannelConfigPolicyReference() string { + if x, ok := x.GetType().(*ApplicationPolicy_ChannelConfigPolicyReference); ok { + return x.ChannelConfigPolicyReference + } + return "" +} + +type isApplicationPolicy_Type interface { + isApplicationPolicy_Type() +} + +type ApplicationPolicy_SignaturePolicy struct { + // SignaturePolicy type is used if the policy is specified as + // a combination (using threshold gates) of signatures from MSP + // principals + SignaturePolicy *SignaturePolicyEnvelope `protobuf:"bytes,1,opt,name=signature_policy,json=signaturePolicy,proto3,oneof"` +} + +type ApplicationPolicy_ChannelConfigPolicyReference struct { + // ChannelConfigPolicyReference is used when the policy is + // specified as a string that references a policy defined in + // the configuration of the channel + ChannelConfigPolicyReference string `protobuf:"bytes,2,opt,name=channel_config_policy_reference,json=channelConfigPolicyReference,proto3,oneof"` +} + +func (*ApplicationPolicy_SignaturePolicy) isApplicationPolicy_Type() {} + +func (*ApplicationPolicy_ChannelConfigPolicyReference) isApplicationPolicy_Type() {} + +type SignaturePolicy_NOutOf struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + N int32 `protobuf:"varint,1,opt,name=n,proto3" json:"n,omitempty"` + Rules []*SignaturePolicy `protobuf:"bytes,2,rep,name=rules,proto3" json:"rules,omitempty"` +} + +func (x *SignaturePolicy_NOutOf) Reset() { + *x = SignaturePolicy_NOutOf{} + if protoimpl.UnsafeEnabled { + mi := &file_common_policies_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SignaturePolicy_NOutOf) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SignaturePolicy_NOutOf) ProtoMessage() {} + +func (x *SignaturePolicy_NOutOf) ProtoReflect() protoreflect.Message { + mi := &file_common_policies_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SignaturePolicy_NOutOf.ProtoReflect.Descriptor instead. +func (*SignaturePolicy_NOutOf) Descriptor() ([]byte, []int) { + return file_common_policies_proto_rawDescGZIP(), []int{2, 0} +} + +func (x *SignaturePolicy_NOutOf) GetN() int32 { + if x != nil { + return x.N + } + return 0 +} + +func (x *SignaturePolicy_NOutOf) GetRules() []*SignaturePolicy { + if x != nil { + return x.Rules + } + return nil +} + +var File_common_policies_proto protoreflect.FileDescriptor + +var file_common_policies_proto_rawDesc = []byte{ + 0x0a, 0x15, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, + 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x1a, + 0x17, 0x6d, 0x73, 0x70, 0x2f, 0x6d, 0x73, 0x70, 0x5f, 0x70, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, + 0x61, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x78, 0x0a, 0x06, 0x50, 0x6f, 0x6c, 0x69, + 0x63, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x44, 0x0a, 0x0a, + 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, + 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x53, 0x49, 0x47, 0x4e, 0x41, + 0x54, 0x55, 0x52, 0x45, 0x10, 0x01, 0x12, 0x07, 0x0a, 0x03, 0x4d, 0x53, 0x50, 0x10, 0x02, 0x12, + 0x11, 0x0a, 0x0d, 0x49, 0x4d, 0x50, 0x4c, 0x49, 0x43, 0x49, 0x54, 0x5f, 0x4d, 0x45, 0x54, 0x41, + 0x10, 0x03, 0x22, 0x96, 0x01, 0x0a, 0x17, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, + 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x12, 0x18, + 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x2b, 0x0a, 0x04, 0x72, 0x75, 0x6c, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, + 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, + 0x04, 0x72, 0x75, 0x6c, 0x65, 0x12, 0x34, 0x0a, 0x0a, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, + 0x69, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, + 0x6f, 0x6e, 0x2e, 0x4d, 0x53, 0x50, 0x50, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x52, + 0x0a, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x69, 0x65, 0x73, 0x22, 0xbb, 0x01, 0x0a, 0x0f, + 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, + 0x1d, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x5f, 0x62, 0x79, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x05, 0x48, 0x00, 0x52, 0x08, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x79, 0x12, 0x3a, + 0x0a, 0x08, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x5f, 0x6f, 0x66, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1e, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, + 0x75, 0x72, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x4e, 0x4f, 0x75, 0x74, 0x4f, 0x66, + 0x48, 0x00, 0x52, 0x06, 0x6e, 0x4f, 0x75, 0x74, 0x4f, 0x66, 0x1a, 0x45, 0x0a, 0x06, 0x4e, 0x4f, + 0x75, 0x74, 0x4f, 0x66, 0x12, 0x0c, 0x0a, 0x01, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x01, 0x6e, 0x12, 0x2d, 0x0a, 0x05, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x17, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, + 0x74, 0x75, 0x72, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x05, 0x72, 0x75, 0x6c, 0x65, + 0x73, 0x42, 0x06, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x22, 0x90, 0x01, 0x0a, 0x12, 0x49, 0x6d, + 0x70, 0x6c, 0x69, 0x63, 0x69, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, + 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x75, 0x62, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x75, 0x62, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, + 0x33, 0x0a, 0x04, 0x72, 0x75, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1f, 0x2e, + 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x49, 0x6d, 0x70, 0x6c, 0x69, 0x63, 0x69, 0x74, 0x4d, + 0x65, 0x74, 0x61, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x04, + 0x72, 0x75, 0x6c, 0x65, 0x22, 0x26, 0x0a, 0x04, 0x52, 0x75, 0x6c, 0x65, 0x12, 0x07, 0x0a, 0x03, + 0x41, 0x4e, 0x59, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x41, 0x4c, 0x4c, 0x10, 0x01, 0x12, 0x0c, + 0x0a, 0x08, 0x4d, 0x41, 0x4a, 0x4f, 0x52, 0x49, 0x54, 0x59, 0x10, 0x02, 0x22, 0xb6, 0x01, 0x0a, + 0x11, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6f, 0x6c, 0x69, + 0x63, 0x79, 0x12, 0x4c, 0x0a, 0x10, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x5f, + 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x63, + 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x50, + 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x48, 0x00, 0x52, + 0x0f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, + 0x12, 0x47, 0x0a, 0x1f, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x5f, 0x63, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x5f, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, + 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x1c, 0x63, 0x68, 0x61, + 0x6e, 0x6e, 0x65, 0x6c, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, + 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x3a, 0x02, 0x18, 0x01, 0x42, 0x06, 0x0a, + 0x04, 0x54, 0x79, 0x70, 0x65, 0x42, 0xa3, 0x01, 0x0a, 0x24, 0x6f, 0x72, 0x67, 0x2e, 0x68, 0x79, + 0x70, 0x65, 0x72, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2e, 0x66, 0x61, 0x62, 0x72, 0x69, 0x63, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x42, 0x0d, + 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, + 0x34, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x79, 0x70, 0x65, + 0x72, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2f, 0x66, 0x61, 0x62, 0x72, 0x69, 0x63, 0x2d, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2d, 0x67, 0x6f, 0x2d, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x63, + 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0xa2, 0x02, 0x03, 0x43, 0x58, 0x58, 0xaa, 0x02, 0x06, 0x43, 0x6f, + 0x6d, 0x6d, 0x6f, 0x6e, 0xca, 0x02, 0x06, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0xe2, 0x02, 0x12, + 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0xea, 0x02, 0x06, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, +} + +var ( + file_common_policies_proto_rawDescOnce sync.Once + file_common_policies_proto_rawDescData = file_common_policies_proto_rawDesc +) + +func file_common_policies_proto_rawDescGZIP() []byte { + file_common_policies_proto_rawDescOnce.Do(func() { + file_common_policies_proto_rawDescData = protoimpl.X.CompressGZIP(file_common_policies_proto_rawDescData) + }) + return file_common_policies_proto_rawDescData +} + +var file_common_policies_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_common_policies_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_common_policies_proto_goTypes = []interface{}{ + (Policy_PolicyType)(0), // 0: common.Policy.PolicyType + (ImplicitMetaPolicy_Rule)(0), // 1: common.ImplicitMetaPolicy.Rule + (*Policy)(nil), // 2: common.Policy + (*SignaturePolicyEnvelope)(nil), // 3: common.SignaturePolicyEnvelope + (*SignaturePolicy)(nil), // 4: common.SignaturePolicy + (*ImplicitMetaPolicy)(nil), // 5: common.ImplicitMetaPolicy + (*ApplicationPolicy)(nil), // 6: common.ApplicationPolicy + (*SignaturePolicy_NOutOf)(nil), // 7: common.SignaturePolicy.NOutOf + (*msp.MSPPrincipal)(nil), // 8: common.MSPPrincipal +} +var file_common_policies_proto_depIdxs = []int32{ + 4, // 0: common.SignaturePolicyEnvelope.rule:type_name -> common.SignaturePolicy + 8, // 1: common.SignaturePolicyEnvelope.identities:type_name -> common.MSPPrincipal + 7, // 2: common.SignaturePolicy.n_out_of:type_name -> common.SignaturePolicy.NOutOf + 1, // 3: common.ImplicitMetaPolicy.rule:type_name -> common.ImplicitMetaPolicy.Rule + 3, // 4: common.ApplicationPolicy.signature_policy:type_name -> common.SignaturePolicyEnvelope + 4, // 5: common.SignaturePolicy.NOutOf.rules:type_name -> common.SignaturePolicy + 6, // [6:6] is the sub-list for method output_type + 6, // [6:6] is the sub-list for method input_type + 6, // [6:6] is the sub-list for extension type_name + 6, // [6:6] is the sub-list for extension extendee + 0, // [0:6] is the sub-list for field type_name +} + +func init() { file_common_policies_proto_init() } +func file_common_policies_proto_init() { + if File_common_policies_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_common_policies_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Policy); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_policies_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SignaturePolicyEnvelope); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_policies_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SignaturePolicy); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_policies_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ImplicitMetaPolicy); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_policies_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ApplicationPolicy); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_policies_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SignaturePolicy_NOutOf); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_common_policies_proto_msgTypes[2].OneofWrappers = []interface{}{ + (*SignaturePolicy_SignedBy)(nil), + (*SignaturePolicy_NOutOf_)(nil), + } + file_common_policies_proto_msgTypes[4].OneofWrappers = []interface{}{ + (*ApplicationPolicy_SignaturePolicy)(nil), + (*ApplicationPolicy_ChannelConfigPolicyReference)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_common_policies_proto_rawDesc, + NumEnums: 2, + NumMessages: 6, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_common_policies_proto_goTypes, + DependencyIndexes: file_common_policies_proto_depIdxs, + EnumInfos: file_common_policies_proto_enumTypes, + MessageInfos: file_common_policies_proto_msgTypes, + }.Build() + File_common_policies_proto = out.File + file_common_policies_proto_rawDesc = nil + file_common_policies_proto_goTypes = nil + file_common_policies_proto_depIdxs = nil +} diff --git a/vendor/github.com/hyperledger/fabric-protos-go-apiv2/discovery/protocol.pb.go b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/discovery/protocol.pb.go new file mode 100644 index 00000000000..99acaf7e06e --- /dev/null +++ b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/discovery/protocol.pb.go @@ -0,0 +1,1788 @@ +// Copyright the Hyperledger Fabric contributors. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: discovery/protocol.proto + +package discovery + +import ( + gossip "github.com/hyperledger/fabric-protos-go-apiv2/gossip" + msp "github.com/hyperledger/fabric-protos-go-apiv2/msp" + peer "github.com/hyperledger/fabric-protos-go-apiv2/peer" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// SignedRequest contains a serialized Request in the payload field +// and a signature. +// The identity that is used to verify the signature +// can be extracted from the authentication field of type AuthInfo +// in the Request itself after deserializing it. +type SignedRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Payload []byte `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"` + Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` +} + +func (x *SignedRequest) Reset() { + *x = SignedRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_discovery_protocol_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SignedRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SignedRequest) ProtoMessage() {} + +func (x *SignedRequest) ProtoReflect() protoreflect.Message { + mi := &file_discovery_protocol_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SignedRequest.ProtoReflect.Descriptor instead. +func (*SignedRequest) Descriptor() ([]byte, []int) { + return file_discovery_protocol_proto_rawDescGZIP(), []int{0} +} + +func (x *SignedRequest) GetPayload() []byte { + if x != nil { + return x.Payload + } + return nil +} + +func (x *SignedRequest) GetSignature() []byte { + if x != nil { + return x.Signature + } + return nil +} + +// Request contains authentication info about the client that sent the request +// and the queries it wishes to query the service +type Request struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // authentication contains information that the service uses to check + // the client's eligibility for the queries. + Authentication *AuthInfo `protobuf:"bytes,1,opt,name=authentication,proto3" json:"authentication,omitempty"` + // queries + Queries []*Query `protobuf:"bytes,2,rep,name=queries,proto3" json:"queries,omitempty"` +} + +func (x *Request) Reset() { + *x = Request{} + if protoimpl.UnsafeEnabled { + mi := &file_discovery_protocol_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Request) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Request) ProtoMessage() {} + +func (x *Request) ProtoReflect() protoreflect.Message { + mi := &file_discovery_protocol_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Request.ProtoReflect.Descriptor instead. +func (*Request) Descriptor() ([]byte, []int) { + return file_discovery_protocol_proto_rawDescGZIP(), []int{1} +} + +func (x *Request) GetAuthentication() *AuthInfo { + if x != nil { + return x.Authentication + } + return nil +} + +func (x *Request) GetQueries() []*Query { + if x != nil { + return x.Queries + } + return nil +} + +type Response struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The results are returned in the same order of the queries + Results []*QueryResult `protobuf:"bytes,1,rep,name=results,proto3" json:"results,omitempty"` +} + +func (x *Response) Reset() { + *x = Response{} + if protoimpl.UnsafeEnabled { + mi := &file_discovery_protocol_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Response) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Response) ProtoMessage() {} + +func (x *Response) ProtoReflect() protoreflect.Message { + mi := &file_discovery_protocol_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Response.ProtoReflect.Descriptor instead. +func (*Response) Descriptor() ([]byte, []int) { + return file_discovery_protocol_proto_rawDescGZIP(), []int{2} +} + +func (x *Response) GetResults() []*QueryResult { + if x != nil { + return x.Results + } + return nil +} + +// AuthInfo aggregates authentication information that the server uses +// to authenticate the client +type AuthInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // This is the identity of the client that is used to verify the signature + // on the SignedRequest's payload. + // It is a msp.SerializedIdentity in bytes form + ClientIdentity []byte `protobuf:"bytes,1,opt,name=client_identity,json=clientIdentity,proto3" json:"client_identity,omitempty"` + // This is the hash of the client's TLS cert. + // When the network is running with TLS, clients that don't include a certificate + // will be denied access to the service. + // Since the Request is encapsulated with a SignedRequest (which is signed), + // this binds the TLS session to the enrollement identity of the client and + // therefore both authenticates the client to the server, + // and also prevents the server from relaying the request message to another server. + ClientTlsCertHash []byte `protobuf:"bytes,2,opt,name=client_tls_cert_hash,json=clientTlsCertHash,proto3" json:"client_tls_cert_hash,omitempty"` +} + +func (x *AuthInfo) Reset() { + *x = AuthInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_discovery_protocol_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AuthInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AuthInfo) ProtoMessage() {} + +func (x *AuthInfo) ProtoReflect() protoreflect.Message { + mi := &file_discovery_protocol_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AuthInfo.ProtoReflect.Descriptor instead. +func (*AuthInfo) Descriptor() ([]byte, []int) { + return file_discovery_protocol_proto_rawDescGZIP(), []int{3} +} + +func (x *AuthInfo) GetClientIdentity() []byte { + if x != nil { + return x.ClientIdentity + } + return nil +} + +func (x *AuthInfo) GetClientTlsCertHash() []byte { + if x != nil { + return x.ClientTlsCertHash + } + return nil +} + +// Query asks for information in the context of a specific channel +type Query struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Channel string `protobuf:"bytes,1,opt,name=channel,proto3" json:"channel,omitempty"` + // Types that are assignable to Query: + // + // *Query_ConfigQuery + // *Query_PeerQuery + // *Query_CcQuery + // *Query_LocalPeers + Query isQuery_Query `protobuf_oneof:"query"` +} + +func (x *Query) Reset() { + *x = Query{} + if protoimpl.UnsafeEnabled { + mi := &file_discovery_protocol_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Query) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Query) ProtoMessage() {} + +func (x *Query) ProtoReflect() protoreflect.Message { + mi := &file_discovery_protocol_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Query.ProtoReflect.Descriptor instead. +func (*Query) Descriptor() ([]byte, []int) { + return file_discovery_protocol_proto_rawDescGZIP(), []int{4} +} + +func (x *Query) GetChannel() string { + if x != nil { + return x.Channel + } + return "" +} + +func (m *Query) GetQuery() isQuery_Query { + if m != nil { + return m.Query + } + return nil +} + +func (x *Query) GetConfigQuery() *ConfigQuery { + if x, ok := x.GetQuery().(*Query_ConfigQuery); ok { + return x.ConfigQuery + } + return nil +} + +func (x *Query) GetPeerQuery() *PeerMembershipQuery { + if x, ok := x.GetQuery().(*Query_PeerQuery); ok { + return x.PeerQuery + } + return nil +} + +func (x *Query) GetCcQuery() *ChaincodeQuery { + if x, ok := x.GetQuery().(*Query_CcQuery); ok { + return x.CcQuery + } + return nil +} + +func (x *Query) GetLocalPeers() *LocalPeerQuery { + if x, ok := x.GetQuery().(*Query_LocalPeers); ok { + return x.LocalPeers + } + return nil +} + +type isQuery_Query interface { + isQuery_Query() +} + +type Query_ConfigQuery struct { + // ConfigQuery is used to query for the configuration of the channel, + // such as FabricMSPConfig, and rorderer endpoints. + // The client has to query a peer it trusts as it doesn't have means to self-verify + // the authenticity of the returned result. + // The result is returned in the form of ConfigResult. + ConfigQuery *ConfigQuery `protobuf:"bytes,2,opt,name=config_query,json=configQuery,proto3,oneof"` +} + +type Query_PeerQuery struct { + // PeerMembershipQuery queries for peers in a channel context, + // and returns PeerMembershipResult + PeerQuery *PeerMembershipQuery `protobuf:"bytes,3,opt,name=peer_query,json=peerQuery,proto3,oneof"` +} + +type Query_CcQuery struct { + // ChaincodeQuery queries for chaincodes by their name and version. + // An empty version means any version can by returned. + CcQuery *ChaincodeQuery `protobuf:"bytes,4,opt,name=cc_query,json=ccQuery,proto3,oneof"` +} + +type Query_LocalPeers struct { + // LocalPeerQuery queries for peers in a non channel context, + // and returns PeerMembershipResult + LocalPeers *LocalPeerQuery `protobuf:"bytes,5,opt,name=local_peers,json=localPeers,proto3,oneof"` +} + +func (*Query_ConfigQuery) isQuery_Query() {} + +func (*Query_PeerQuery) isQuery_Query() {} + +func (*Query_CcQuery) isQuery_Query() {} + +func (*Query_LocalPeers) isQuery_Query() {} + +// QueryResult contains a result for a given Query. +// The corresponding Query can be inferred by the index of the QueryResult from +// its enclosing Response message. +// QueryResults are ordered in the same order as the Queries are ordered in their enclosing Request. +type QueryResult struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Result: + // + // *QueryResult_Error + // *QueryResult_ConfigResult + // *QueryResult_CcQueryRes + // *QueryResult_Members + Result isQueryResult_Result `protobuf_oneof:"result"` +} + +func (x *QueryResult) Reset() { + *x = QueryResult{} + if protoimpl.UnsafeEnabled { + mi := &file_discovery_protocol_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryResult) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryResult) ProtoMessage() {} + +func (x *QueryResult) ProtoReflect() protoreflect.Message { + mi := &file_discovery_protocol_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use QueryResult.ProtoReflect.Descriptor instead. +func (*QueryResult) Descriptor() ([]byte, []int) { + return file_discovery_protocol_proto_rawDescGZIP(), []int{5} +} + +func (m *QueryResult) GetResult() isQueryResult_Result { + if m != nil { + return m.Result + } + return nil +} + +func (x *QueryResult) GetError() *Error { + if x, ok := x.GetResult().(*QueryResult_Error); ok { + return x.Error + } + return nil +} + +func (x *QueryResult) GetConfigResult() *ConfigResult { + if x, ok := x.GetResult().(*QueryResult_ConfigResult); ok { + return x.ConfigResult + } + return nil +} + +func (x *QueryResult) GetCcQueryRes() *ChaincodeQueryResult { + if x, ok := x.GetResult().(*QueryResult_CcQueryRes); ok { + return x.CcQueryRes + } + return nil +} + +func (x *QueryResult) GetMembers() *PeerMembershipResult { + if x, ok := x.GetResult().(*QueryResult_Members); ok { + return x.Members + } + return nil +} + +type isQueryResult_Result interface { + isQueryResult_Result() +} + +type QueryResult_Error struct { + // Error indicates failure or refusal to process the query + Error *Error `protobuf:"bytes,1,opt,name=error,proto3,oneof"` +} + +type QueryResult_ConfigResult struct { + // ConfigResult contains the configuration of the channel, + // such as FabricMSPConfig and orderer endpoints + ConfigResult *ConfigResult `protobuf:"bytes,2,opt,name=config_result,json=configResult,proto3,oneof"` +} + +type QueryResult_CcQueryRes struct { + // ChaincodeQueryResult contains information about chaincodes, + // and their corresponding endorsers + CcQueryRes *ChaincodeQueryResult `protobuf:"bytes,3,opt,name=cc_query_res,json=ccQueryRes,proto3,oneof"` +} + +type QueryResult_Members struct { + // PeerMembershipResult contains information about peers, + // such as their identity, endpoints, and channel related state. + Members *PeerMembershipResult `protobuf:"bytes,4,opt,name=members,proto3,oneof"` +} + +func (*QueryResult_Error) isQueryResult_Result() {} + +func (*QueryResult_ConfigResult) isQueryResult_Result() {} + +func (*QueryResult_CcQueryRes) isQueryResult_Result() {} + +func (*QueryResult_Members) isQueryResult_Result() {} + +// ConfigQuery requests a ConfigResult +type ConfigQuery struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ConfigQuery) Reset() { + *x = ConfigQuery{} + if protoimpl.UnsafeEnabled { + mi := &file_discovery_protocol_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ConfigQuery) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ConfigQuery) ProtoMessage() {} + +func (x *ConfigQuery) ProtoReflect() protoreflect.Message { + mi := &file_discovery_protocol_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ConfigQuery.ProtoReflect.Descriptor instead. +func (*ConfigQuery) Descriptor() ([]byte, []int) { + return file_discovery_protocol_proto_rawDescGZIP(), []int{6} +} + +type ConfigResult struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // msps is a map from MSP_ID to FabricMSPConfig + Msps map[string]*msp.FabricMSPConfig `protobuf:"bytes,1,rep,name=msps,proto3" json:"msps,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // orderers is a map from MSP_ID to endpoint lists of orderers + Orderers map[string]*Endpoints `protobuf:"bytes,2,rep,name=orderers,proto3" json:"orderers,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *ConfigResult) Reset() { + *x = ConfigResult{} + if protoimpl.UnsafeEnabled { + mi := &file_discovery_protocol_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ConfigResult) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ConfigResult) ProtoMessage() {} + +func (x *ConfigResult) ProtoReflect() protoreflect.Message { + mi := &file_discovery_protocol_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ConfigResult.ProtoReflect.Descriptor instead. +func (*ConfigResult) Descriptor() ([]byte, []int) { + return file_discovery_protocol_proto_rawDescGZIP(), []int{7} +} + +func (x *ConfigResult) GetMsps() map[string]*msp.FabricMSPConfig { + if x != nil { + return x.Msps + } + return nil +} + +func (x *ConfigResult) GetOrderers() map[string]*Endpoints { + if x != nil { + return x.Orderers + } + return nil +} + +// PeerMembershipQuery requests PeerMembershipResult. +// The filter field may be optionally populated in order +// for the peer membership to be filtered according to +// chaincodes that are installed on peers and collection +// access control policies. +type PeerMembershipQuery struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Filter *peer.ChaincodeInterest `protobuf:"bytes,1,opt,name=filter,proto3" json:"filter,omitempty"` +} + +func (x *PeerMembershipQuery) Reset() { + *x = PeerMembershipQuery{} + if protoimpl.UnsafeEnabled { + mi := &file_discovery_protocol_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PeerMembershipQuery) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PeerMembershipQuery) ProtoMessage() {} + +func (x *PeerMembershipQuery) ProtoReflect() protoreflect.Message { + mi := &file_discovery_protocol_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PeerMembershipQuery.ProtoReflect.Descriptor instead. +func (*PeerMembershipQuery) Descriptor() ([]byte, []int) { + return file_discovery_protocol_proto_rawDescGZIP(), []int{8} +} + +func (x *PeerMembershipQuery) GetFilter() *peer.ChaincodeInterest { + if x != nil { + return x.Filter + } + return nil +} + +// PeerMembershipResult contains peers mapped by their organizations (MSP_ID) +type PeerMembershipResult struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PeersByOrg map[string]*Peers `protobuf:"bytes,1,rep,name=peers_by_org,json=peersByOrg,proto3" json:"peers_by_org,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *PeerMembershipResult) Reset() { + *x = PeerMembershipResult{} + if protoimpl.UnsafeEnabled { + mi := &file_discovery_protocol_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PeerMembershipResult) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PeerMembershipResult) ProtoMessage() {} + +func (x *PeerMembershipResult) ProtoReflect() protoreflect.Message { + mi := &file_discovery_protocol_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PeerMembershipResult.ProtoReflect.Descriptor instead. +func (*PeerMembershipResult) Descriptor() ([]byte, []int) { + return file_discovery_protocol_proto_rawDescGZIP(), []int{9} +} + +func (x *PeerMembershipResult) GetPeersByOrg() map[string]*Peers { + if x != nil { + return x.PeersByOrg + } + return nil +} + +// ChaincodeQuery requests ChaincodeQueryResults for a given +// list of chaincode invocations. +// Each invocation is a separate one, and the endorsement policy +// is evaluated independantly for each given interest. +type ChaincodeQuery struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Interests []*peer.ChaincodeInterest `protobuf:"bytes,1,rep,name=interests,proto3" json:"interests,omitempty"` +} + +func (x *ChaincodeQuery) Reset() { + *x = ChaincodeQuery{} + if protoimpl.UnsafeEnabled { + mi := &file_discovery_protocol_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChaincodeQuery) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChaincodeQuery) ProtoMessage() {} + +func (x *ChaincodeQuery) ProtoReflect() protoreflect.Message { + mi := &file_discovery_protocol_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ChaincodeQuery.ProtoReflect.Descriptor instead. +func (*ChaincodeQuery) Descriptor() ([]byte, []int) { + return file_discovery_protocol_proto_rawDescGZIP(), []int{10} +} + +func (x *ChaincodeQuery) GetInterests() []*peer.ChaincodeInterest { + if x != nil { + return x.Interests + } + return nil +} + +// ChaincodeQueryResult contains EndorsementDescriptors for +// chaincodes +type ChaincodeQueryResult struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Content []*EndorsementDescriptor `protobuf:"bytes,1,rep,name=content,proto3" json:"content,omitempty"` +} + +func (x *ChaincodeQueryResult) Reset() { + *x = ChaincodeQueryResult{} + if protoimpl.UnsafeEnabled { + mi := &file_discovery_protocol_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChaincodeQueryResult) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChaincodeQueryResult) ProtoMessage() {} + +func (x *ChaincodeQueryResult) ProtoReflect() protoreflect.Message { + mi := &file_discovery_protocol_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ChaincodeQueryResult.ProtoReflect.Descriptor instead. +func (*ChaincodeQueryResult) Descriptor() ([]byte, []int) { + return file_discovery_protocol_proto_rawDescGZIP(), []int{11} +} + +func (x *ChaincodeQueryResult) GetContent() []*EndorsementDescriptor { + if x != nil { + return x.Content + } + return nil +} + +// LocalPeerQuery queries for peers in a non channel context +type LocalPeerQuery struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *LocalPeerQuery) Reset() { + *x = LocalPeerQuery{} + if protoimpl.UnsafeEnabled { + mi := &file_discovery_protocol_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LocalPeerQuery) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LocalPeerQuery) ProtoMessage() {} + +func (x *LocalPeerQuery) ProtoReflect() protoreflect.Message { + mi := &file_discovery_protocol_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LocalPeerQuery.ProtoReflect.Descriptor instead. +func (*LocalPeerQuery) Descriptor() ([]byte, []int) { + return file_discovery_protocol_proto_rawDescGZIP(), []int{12} +} + +// EndorsementDescriptor contains information about which peers can be used +// to request endorsement from, such that the endorsement policy would be fulfilled. +// Here is how to compute a set of peers to ask an endorsement from, given an EndorsementDescriptor: +// Let e: G --> P be the endorsers_by_groups field that maps a group to a set of peers. +// Note that applying e on a group g yields a set of peers. +// 1. Select a layout l: G --> N out of the layouts given. +// l is the quantities_by_group field of a Layout, and it maps a group to an integer. +// 2. R = {} (an empty set of peers) +// 3. For each group g in the layout l, compute n = l(g) +// 3.1) Denote P_g as a set of n random peers {p0, p1, ... p_n} selected from e(g) +// 3.2) R = R U P_g (add P_g to R) +// 4. The set of peers R is the peers the client needs to request endorsements from +type EndorsementDescriptor struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Chaincode string `protobuf:"bytes,1,opt,name=chaincode,proto3" json:"chaincode,omitempty"` + // Specifies the endorsers, separated to groups. + EndorsersByGroups map[string]*Peers `protobuf:"bytes,2,rep,name=endorsers_by_groups,json=endorsersByGroups,proto3" json:"endorsers_by_groups,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // Specifies options of fulfulling the endorsement policy. + // Each option lists the group names, and the amount of signatures needed + // from each group. + Layouts []*Layout `protobuf:"bytes,3,rep,name=layouts,proto3" json:"layouts,omitempty"` +} + +func (x *EndorsementDescriptor) Reset() { + *x = EndorsementDescriptor{} + if protoimpl.UnsafeEnabled { + mi := &file_discovery_protocol_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EndorsementDescriptor) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EndorsementDescriptor) ProtoMessage() {} + +func (x *EndorsementDescriptor) ProtoReflect() protoreflect.Message { + mi := &file_discovery_protocol_proto_msgTypes[13] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EndorsementDescriptor.ProtoReflect.Descriptor instead. +func (*EndorsementDescriptor) Descriptor() ([]byte, []int) { + return file_discovery_protocol_proto_rawDescGZIP(), []int{13} +} + +func (x *EndorsementDescriptor) GetChaincode() string { + if x != nil { + return x.Chaincode + } + return "" +} + +func (x *EndorsementDescriptor) GetEndorsersByGroups() map[string]*Peers { + if x != nil { + return x.EndorsersByGroups + } + return nil +} + +func (x *EndorsementDescriptor) GetLayouts() []*Layout { + if x != nil { + return x.Layouts + } + return nil +} + +// Layout contains a mapping from a group name to number of peers +// that are needed for fulfilling an endorsement policy +type Layout struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Specifies how many non repeated signatures of each group + // are needed for endorsement + QuantitiesByGroup map[string]uint32 `protobuf:"bytes,1,rep,name=quantities_by_group,json=quantitiesByGroup,proto3" json:"quantities_by_group,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` +} + +func (x *Layout) Reset() { + *x = Layout{} + if protoimpl.UnsafeEnabled { + mi := &file_discovery_protocol_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Layout) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Layout) ProtoMessage() {} + +func (x *Layout) ProtoReflect() protoreflect.Message { + mi := &file_discovery_protocol_proto_msgTypes[14] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Layout.ProtoReflect.Descriptor instead. +func (*Layout) Descriptor() ([]byte, []int) { + return file_discovery_protocol_proto_rawDescGZIP(), []int{14} +} + +func (x *Layout) GetQuantitiesByGroup() map[string]uint32 { + if x != nil { + return x.QuantitiesByGroup + } + return nil +} + +// Peers contains a list of Peer(s) +type Peers struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Peers []*Peer `protobuf:"bytes,1,rep,name=peers,proto3" json:"peers,omitempty"` +} + +func (x *Peers) Reset() { + *x = Peers{} + if protoimpl.UnsafeEnabled { + mi := &file_discovery_protocol_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Peers) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Peers) ProtoMessage() {} + +func (x *Peers) ProtoReflect() protoreflect.Message { + mi := &file_discovery_protocol_proto_msgTypes[15] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Peers.ProtoReflect.Descriptor instead. +func (*Peers) Descriptor() ([]byte, []int) { + return file_discovery_protocol_proto_rawDescGZIP(), []int{15} +} + +func (x *Peers) GetPeers() []*Peer { + if x != nil { + return x.Peers + } + return nil +} + +// Peer contains information about the peer such as its channel specific +// state, and membership information. +type Peer struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // This is an Envelope of a GossipMessage with a gossip.StateInfo message + StateInfo *gossip.Envelope `protobuf:"bytes,1,opt,name=state_info,json=stateInfo,proto3" json:"state_info,omitempty"` + // This is an Envelope of a GossipMessage with a gossip.AliveMessage message + MembershipInfo *gossip.Envelope `protobuf:"bytes,2,opt,name=membership_info,json=membershipInfo,proto3" json:"membership_info,omitempty"` + // This is the msp.SerializedIdentity of the peer, represented in bytes. + Identity []byte `protobuf:"bytes,3,opt,name=identity,proto3" json:"identity,omitempty"` +} + +func (x *Peer) Reset() { + *x = Peer{} + if protoimpl.UnsafeEnabled { + mi := &file_discovery_protocol_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Peer) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Peer) ProtoMessage() {} + +func (x *Peer) ProtoReflect() protoreflect.Message { + mi := &file_discovery_protocol_proto_msgTypes[16] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Peer.ProtoReflect.Descriptor instead. +func (*Peer) Descriptor() ([]byte, []int) { + return file_discovery_protocol_proto_rawDescGZIP(), []int{16} +} + +func (x *Peer) GetStateInfo() *gossip.Envelope { + if x != nil { + return x.StateInfo + } + return nil +} + +func (x *Peer) GetMembershipInfo() *gossip.Envelope { + if x != nil { + return x.MembershipInfo + } + return nil +} + +func (x *Peer) GetIdentity() []byte { + if x != nil { + return x.Identity + } + return nil +} + +// Error denotes that something went wrong and contains the error message +type Error struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Content string `protobuf:"bytes,1,opt,name=content,proto3" json:"content,omitempty"` +} + +func (x *Error) Reset() { + *x = Error{} + if protoimpl.UnsafeEnabled { + mi := &file_discovery_protocol_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Error) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Error) ProtoMessage() {} + +func (x *Error) ProtoReflect() protoreflect.Message { + mi := &file_discovery_protocol_proto_msgTypes[17] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Error.ProtoReflect.Descriptor instead. +func (*Error) Descriptor() ([]byte, []int) { + return file_discovery_protocol_proto_rawDescGZIP(), []int{17} +} + +func (x *Error) GetContent() string { + if x != nil { + return x.Content + } + return "" +} + +// Endpoints is a list of Endpoint(s) +type Endpoints struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Endpoint []*Endpoint `protobuf:"bytes,1,rep,name=endpoint,proto3" json:"endpoint,omitempty"` +} + +func (x *Endpoints) Reset() { + *x = Endpoints{} + if protoimpl.UnsafeEnabled { + mi := &file_discovery_protocol_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Endpoints) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Endpoints) ProtoMessage() {} + +func (x *Endpoints) ProtoReflect() protoreflect.Message { + mi := &file_discovery_protocol_proto_msgTypes[18] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Endpoints.ProtoReflect.Descriptor instead. +func (*Endpoints) Descriptor() ([]byte, []int) { + return file_discovery_protocol_proto_rawDescGZIP(), []int{18} +} + +func (x *Endpoints) GetEndpoint() []*Endpoint { + if x != nil { + return x.Endpoint + } + return nil +} + +// Endpoint is a combination of a host and a port +type Endpoint struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Host string `protobuf:"bytes,1,opt,name=host,proto3" json:"host,omitempty"` + Port uint32 `protobuf:"varint,2,opt,name=port,proto3" json:"port,omitempty"` +} + +func (x *Endpoint) Reset() { + *x = Endpoint{} + if protoimpl.UnsafeEnabled { + mi := &file_discovery_protocol_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Endpoint) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Endpoint) ProtoMessage() {} + +func (x *Endpoint) ProtoReflect() protoreflect.Message { + mi := &file_discovery_protocol_proto_msgTypes[19] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Endpoint.ProtoReflect.Descriptor instead. +func (*Endpoint) Descriptor() ([]byte, []int) { + return file_discovery_protocol_proto_rawDescGZIP(), []int{19} +} + +func (x *Endpoint) GetHost() string { + if x != nil { + return x.Host + } + return "" +} + +func (x *Endpoint) GetPort() uint32 { + if x != nil { + return x.Port + } + return 0 +} + +var File_discovery_protocol_proto protoreflect.FileDescriptor + +var file_discovery_protocol_proto_rawDesc = []byte{ + 0x0a, 0x18, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2f, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x09, 0x64, 0x69, 0x73, 0x63, + 0x6f, 0x76, 0x65, 0x72, 0x79, 0x1a, 0x14, 0x67, 0x6f, 0x73, 0x73, 0x69, 0x70, 0x2f, 0x6d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x6d, 0x73, 0x70, + 0x2f, 0x6d, 0x73, 0x70, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x1a, 0x1c, 0x70, 0x65, 0x65, 0x72, 0x2f, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, + 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, + 0x47, 0x0a, 0x0d, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, + 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, + 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x72, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x3b, 0x0a, 0x0e, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x64, 0x69, + 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x49, 0x6e, 0x66, 0x6f, + 0x52, 0x0e, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x12, 0x2a, 0x0a, 0x07, 0x71, 0x75, 0x65, 0x72, 0x69, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x10, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x52, 0x07, 0x71, 0x75, 0x65, 0x72, 0x69, 0x65, 0x73, 0x22, 0x3c, 0x0a, 0x08, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x30, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75, + 0x6c, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x64, 0x69, 0x73, 0x63, + 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x75, 0x6c, + 0x74, 0x52, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x22, 0x64, 0x0a, 0x08, 0x41, 0x75, + 0x74, 0x68, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x27, 0x0a, 0x0f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, + 0x5f, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x0e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, + 0x2f, 0x0a, 0x14, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x6c, 0x73, 0x5f, 0x63, 0x65, + 0x72, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x11, 0x63, + 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x54, 0x6c, 0x73, 0x43, 0x65, 0x72, 0x74, 0x48, 0x61, 0x73, 0x68, + 0x22, 0x9e, 0x02, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x68, + 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x68, 0x61, + 0x6e, 0x6e, 0x65, 0x6c, 0x12, 0x3b, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x71, + 0x75, 0x65, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x64, 0x69, 0x73, + 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x48, 0x00, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x12, 0x3f, 0x0a, 0x0a, 0x70, 0x65, 0x65, 0x72, 0x5f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, + 0x79, 0x2e, 0x50, 0x65, 0x65, 0x72, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x48, 0x00, 0x52, 0x09, 0x70, 0x65, 0x65, 0x72, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x12, 0x36, 0x0a, 0x08, 0x63, 0x63, 0x5f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, + 0x2e, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x48, + 0x00, 0x52, 0x07, 0x63, 0x63, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x3c, 0x0a, 0x0b, 0x6c, 0x6f, + 0x63, 0x61, 0x6c, 0x5f, 0x70, 0x65, 0x65, 0x72, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x19, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x4c, 0x6f, 0x63, 0x61, + 0x6c, 0x50, 0x65, 0x65, 0x72, 0x51, 0x75, 0x65, 0x72, 0x79, 0x48, 0x00, 0x52, 0x0a, 0x6c, 0x6f, + 0x63, 0x61, 0x6c, 0x50, 0x65, 0x65, 0x72, 0x73, 0x42, 0x07, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, + 0x79, 0x22, 0x83, 0x02, 0x0a, 0x0b, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x75, 0x6c, + 0x74, 0x12, 0x28, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x10, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x45, 0x72, 0x72, + 0x6f, 0x72, 0x48, 0x00, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x3e, 0x0a, 0x0d, 0x63, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x43, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x48, 0x00, 0x52, 0x0c, 0x63, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x43, 0x0a, 0x0c, 0x63, + 0x63, 0x5f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x5f, 0x72, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1f, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x43, 0x68, + 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x75, + 0x6c, 0x74, 0x48, 0x00, 0x52, 0x0a, 0x63, 0x63, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, + 0x12, 0x3b, 0x0a, 0x07, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1f, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x50, 0x65, + 0x65, 0x72, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x52, 0x65, 0x73, 0x75, + 0x6c, 0x74, 0x48, 0x00, 0x52, 0x07, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x42, 0x08, 0x0a, + 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x0d, 0x0a, 0x0b, 0x43, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x51, 0x75, 0x65, 0x72, 0x79, 0x22, 0xaa, 0x02, 0x0a, 0x0c, 0x43, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x35, 0x0a, 0x04, 0x6d, 0x73, 0x70, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, + 0x79, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x4d, + 0x73, 0x70, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x04, 0x6d, 0x73, 0x70, 0x73, 0x12, 0x41, + 0x0a, 0x08, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x25, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x43, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x65, + 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x72, + 0x73, 0x1a, 0x4d, 0x0a, 0x09, 0x4d, 0x73, 0x70, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, + 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, + 0x12, 0x2a, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x14, 0x2e, 0x6d, 0x73, 0x70, 0x2e, 0x46, 0x61, 0x62, 0x72, 0x69, 0x63, 0x4d, 0x53, 0x50, 0x43, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, + 0x1a, 0x51, 0x0a, 0x0d, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, + 0x6b, 0x65, 0x79, 0x12, 0x2a, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x45, + 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, + 0x02, 0x38, 0x01, 0x22, 0x48, 0x0a, 0x13, 0x50, 0x65, 0x65, 0x72, 0x4d, 0x65, 0x6d, 0x62, 0x65, + 0x72, 0x73, 0x68, 0x69, 0x70, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x31, 0x0a, 0x06, 0x66, 0x69, + 0x6c, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x73, 0x2e, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x74, + 0x65, 0x72, 0x65, 0x73, 0x74, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, 0xba, 0x01, + 0x0a, 0x14, 0x50, 0x65, 0x65, 0x72, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, + 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x51, 0x0a, 0x0c, 0x70, 0x65, 0x65, 0x72, 0x73, 0x5f, + 0x62, 0x79, 0x5f, 0x6f, 0x72, 0x67, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x64, + 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x50, 0x65, 0x65, 0x72, 0x4d, 0x65, 0x6d, + 0x62, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x50, 0x65, + 0x65, 0x72, 0x73, 0x42, 0x79, 0x4f, 0x72, 0x67, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, 0x70, + 0x65, 0x65, 0x72, 0x73, 0x42, 0x79, 0x4f, 0x72, 0x67, 0x1a, 0x4f, 0x0a, 0x0f, 0x50, 0x65, 0x65, + 0x72, 0x73, 0x42, 0x79, 0x4f, 0x72, 0x67, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, + 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x26, + 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, + 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x50, 0x65, 0x65, 0x72, 0x73, 0x52, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x49, 0x0a, 0x0e, 0x43, 0x68, + 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x37, 0x0a, 0x09, + 0x69, 0x6e, 0x74, 0x65, 0x72, 0x65, 0x73, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x19, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, + 0x64, 0x65, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x65, 0x73, 0x74, 0x52, 0x09, 0x69, 0x6e, 0x74, 0x65, + 0x72, 0x65, 0x73, 0x74, 0x73, 0x22, 0x52, 0x0a, 0x14, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, + 0x64, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x3a, 0x0a, + 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, + 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x45, 0x6e, 0x64, 0x6f, 0x72, + 0x73, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, + 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x22, 0x10, 0x0a, 0x0e, 0x4c, 0x6f, 0x63, + 0x61, 0x6c, 0x50, 0x65, 0x65, 0x72, 0x51, 0x75, 0x65, 0x72, 0x79, 0x22, 0xa3, 0x02, 0x0a, 0x15, + 0x45, 0x6e, 0x64, 0x6f, 0x72, 0x73, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x44, 0x65, 0x73, 0x63, 0x72, + 0x69, 0x70, 0x74, 0x6f, 0x72, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, + 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x63, + 0x6f, 0x64, 0x65, 0x12, 0x67, 0x0a, 0x13, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x73, 0x65, 0x72, 0x73, + 0x5f, 0x62, 0x79, 0x5f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x37, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x45, 0x6e, 0x64, + 0x6f, 0x72, 0x73, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, + 0x6f, 0x72, 0x2e, 0x45, 0x6e, 0x64, 0x6f, 0x72, 0x73, 0x65, 0x72, 0x73, 0x42, 0x79, 0x47, 0x72, + 0x6f, 0x75, 0x70, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x11, 0x65, 0x6e, 0x64, 0x6f, 0x72, + 0x73, 0x65, 0x72, 0x73, 0x42, 0x79, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x12, 0x2b, 0x0a, 0x07, + 0x6c, 0x61, 0x79, 0x6f, 0x75, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, + 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x4c, 0x61, 0x79, 0x6f, 0x75, 0x74, + 0x52, 0x07, 0x6c, 0x61, 0x79, 0x6f, 0x75, 0x74, 0x73, 0x1a, 0x56, 0x0a, 0x16, 0x45, 0x6e, 0x64, + 0x6f, 0x72, 0x73, 0x65, 0x72, 0x73, 0x42, 0x79, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x45, 0x6e, + 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x26, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, + 0x2e, 0x50, 0x65, 0x65, 0x72, 0x73, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, + 0x01, 0x22, 0xa8, 0x01, 0x0a, 0x06, 0x4c, 0x61, 0x79, 0x6f, 0x75, 0x74, 0x12, 0x58, 0x0a, 0x13, + 0x71, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x69, 0x65, 0x73, 0x5f, 0x62, 0x79, 0x5f, 0x67, 0x72, + 0x6f, 0x75, 0x70, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x64, 0x69, 0x73, 0x63, + 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x4c, 0x61, 0x79, 0x6f, 0x75, 0x74, 0x2e, 0x51, 0x75, 0x61, + 0x6e, 0x74, 0x69, 0x74, 0x69, 0x65, 0x73, 0x42, 0x79, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x45, 0x6e, + 0x74, 0x72, 0x79, 0x52, 0x11, 0x71, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x69, 0x65, 0x73, 0x42, + 0x79, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x1a, 0x44, 0x0a, 0x16, 0x51, 0x75, 0x61, 0x6e, 0x74, 0x69, + 0x74, 0x69, 0x65, 0x73, 0x42, 0x79, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, + 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, + 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0d, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x2e, 0x0a, 0x05, + 0x50, 0x65, 0x65, 0x72, 0x73, 0x12, 0x25, 0x0a, 0x05, 0x70, 0x65, 0x65, 0x72, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, + 0x2e, 0x50, 0x65, 0x65, 0x72, 0x52, 0x05, 0x70, 0x65, 0x65, 0x72, 0x73, 0x22, 0x8e, 0x01, 0x0a, + 0x04, 0x50, 0x65, 0x65, 0x72, 0x12, 0x2f, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x69, + 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x67, 0x6f, 0x73, 0x73, + 0x69, 0x70, 0x2e, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x52, 0x09, 0x73, 0x74, 0x61, + 0x74, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x39, 0x0a, 0x0f, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, + 0x73, 0x68, 0x69, 0x70, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x10, 0x2e, 0x67, 0x6f, 0x73, 0x73, 0x69, 0x70, 0x2e, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, + 0x65, 0x52, 0x0e, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x49, 0x6e, 0x66, + 0x6f, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x08, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x22, 0x21, 0x0a, + 0x05, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, + 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, + 0x22, 0x3c, 0x0a, 0x09, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x12, 0x2f, 0x0a, + 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x13, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x45, 0x6e, 0x64, 0x70, + 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x22, 0x32, + 0x0a, 0x08, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x6f, + 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x12, 0x12, + 0x0a, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x70, 0x6f, + 0x72, 0x74, 0x32, 0x46, 0x0a, 0x09, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x12, + 0x39, 0x0a, 0x08, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x12, 0x18, 0x2e, 0x64, 0x69, + 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, + 0x79, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0xb5, 0x01, 0x0a, 0x27, 0x6f, + 0x72, 0x67, 0x2e, 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2e, 0x66, + 0x61, 0x62, 0x72, 0x69, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x64, 0x69, 0x73, + 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x42, 0x0d, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, + 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x37, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2f, + 0x66, 0x61, 0x62, 0x72, 0x69, 0x63, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2d, 0x67, 0x6f, + 0x2d, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, + 0xa2, 0x02, 0x03, 0x44, 0x58, 0x58, 0xaa, 0x02, 0x09, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, + 0x72, 0x79, 0xca, 0x02, 0x09, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0xe2, 0x02, + 0x15, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x09, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, + 0x72, 0x79, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_discovery_protocol_proto_rawDescOnce sync.Once + file_discovery_protocol_proto_rawDescData = file_discovery_protocol_proto_rawDesc +) + +func file_discovery_protocol_proto_rawDescGZIP() []byte { + file_discovery_protocol_proto_rawDescOnce.Do(func() { + file_discovery_protocol_proto_rawDescData = protoimpl.X.CompressGZIP(file_discovery_protocol_proto_rawDescData) + }) + return file_discovery_protocol_proto_rawDescData +} + +var file_discovery_protocol_proto_msgTypes = make([]protoimpl.MessageInfo, 25) +var file_discovery_protocol_proto_goTypes = []interface{}{ + (*SignedRequest)(nil), // 0: discovery.SignedRequest + (*Request)(nil), // 1: discovery.Request + (*Response)(nil), // 2: discovery.Response + (*AuthInfo)(nil), // 3: discovery.AuthInfo + (*Query)(nil), // 4: discovery.Query + (*QueryResult)(nil), // 5: discovery.QueryResult + (*ConfigQuery)(nil), // 6: discovery.ConfigQuery + (*ConfigResult)(nil), // 7: discovery.ConfigResult + (*PeerMembershipQuery)(nil), // 8: discovery.PeerMembershipQuery + (*PeerMembershipResult)(nil), // 9: discovery.PeerMembershipResult + (*ChaincodeQuery)(nil), // 10: discovery.ChaincodeQuery + (*ChaincodeQueryResult)(nil), // 11: discovery.ChaincodeQueryResult + (*LocalPeerQuery)(nil), // 12: discovery.LocalPeerQuery + (*EndorsementDescriptor)(nil), // 13: discovery.EndorsementDescriptor + (*Layout)(nil), // 14: discovery.Layout + (*Peers)(nil), // 15: discovery.Peers + (*Peer)(nil), // 16: discovery.Peer + (*Error)(nil), // 17: discovery.Error + (*Endpoints)(nil), // 18: discovery.Endpoints + (*Endpoint)(nil), // 19: discovery.Endpoint + nil, // 20: discovery.ConfigResult.MspsEntry + nil, // 21: discovery.ConfigResult.OrderersEntry + nil, // 22: discovery.PeerMembershipResult.PeersByOrgEntry + nil, // 23: discovery.EndorsementDescriptor.EndorsersByGroupsEntry + nil, // 24: discovery.Layout.QuantitiesByGroupEntry + (*peer.ChaincodeInterest)(nil), // 25: protos.ChaincodeInterest + (*gossip.Envelope)(nil), // 26: gossip.Envelope + (*msp.FabricMSPConfig)(nil), // 27: msp.FabricMSPConfig +} +var file_discovery_protocol_proto_depIdxs = []int32{ + 3, // 0: discovery.Request.authentication:type_name -> discovery.AuthInfo + 4, // 1: discovery.Request.queries:type_name -> discovery.Query + 5, // 2: discovery.Response.results:type_name -> discovery.QueryResult + 6, // 3: discovery.Query.config_query:type_name -> discovery.ConfigQuery + 8, // 4: discovery.Query.peer_query:type_name -> discovery.PeerMembershipQuery + 10, // 5: discovery.Query.cc_query:type_name -> discovery.ChaincodeQuery + 12, // 6: discovery.Query.local_peers:type_name -> discovery.LocalPeerQuery + 17, // 7: discovery.QueryResult.error:type_name -> discovery.Error + 7, // 8: discovery.QueryResult.config_result:type_name -> discovery.ConfigResult + 11, // 9: discovery.QueryResult.cc_query_res:type_name -> discovery.ChaincodeQueryResult + 9, // 10: discovery.QueryResult.members:type_name -> discovery.PeerMembershipResult + 20, // 11: discovery.ConfigResult.msps:type_name -> discovery.ConfigResult.MspsEntry + 21, // 12: discovery.ConfigResult.orderers:type_name -> discovery.ConfigResult.OrderersEntry + 25, // 13: discovery.PeerMembershipQuery.filter:type_name -> protos.ChaincodeInterest + 22, // 14: discovery.PeerMembershipResult.peers_by_org:type_name -> discovery.PeerMembershipResult.PeersByOrgEntry + 25, // 15: discovery.ChaincodeQuery.interests:type_name -> protos.ChaincodeInterest + 13, // 16: discovery.ChaincodeQueryResult.content:type_name -> discovery.EndorsementDescriptor + 23, // 17: discovery.EndorsementDescriptor.endorsers_by_groups:type_name -> discovery.EndorsementDescriptor.EndorsersByGroupsEntry + 14, // 18: discovery.EndorsementDescriptor.layouts:type_name -> discovery.Layout + 24, // 19: discovery.Layout.quantities_by_group:type_name -> discovery.Layout.QuantitiesByGroupEntry + 16, // 20: discovery.Peers.peers:type_name -> discovery.Peer + 26, // 21: discovery.Peer.state_info:type_name -> gossip.Envelope + 26, // 22: discovery.Peer.membership_info:type_name -> gossip.Envelope + 19, // 23: discovery.Endpoints.endpoint:type_name -> discovery.Endpoint + 27, // 24: discovery.ConfigResult.MspsEntry.value:type_name -> msp.FabricMSPConfig + 18, // 25: discovery.ConfigResult.OrderersEntry.value:type_name -> discovery.Endpoints + 15, // 26: discovery.PeerMembershipResult.PeersByOrgEntry.value:type_name -> discovery.Peers + 15, // 27: discovery.EndorsementDescriptor.EndorsersByGroupsEntry.value:type_name -> discovery.Peers + 0, // 28: discovery.Discovery.Discover:input_type -> discovery.SignedRequest + 2, // 29: discovery.Discovery.Discover:output_type -> discovery.Response + 29, // [29:30] is the sub-list for method output_type + 28, // [28:29] is the sub-list for method input_type + 28, // [28:28] is the sub-list for extension type_name + 28, // [28:28] is the sub-list for extension extendee + 0, // [0:28] is the sub-list for field type_name +} + +func init() { file_discovery_protocol_proto_init() } +func file_discovery_protocol_proto_init() { + if File_discovery_protocol_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_discovery_protocol_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SignedRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_discovery_protocol_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Request); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_discovery_protocol_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Response); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_discovery_protocol_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AuthInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_discovery_protocol_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Query); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_discovery_protocol_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryResult); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_discovery_protocol_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ConfigQuery); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_discovery_protocol_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ConfigResult); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_discovery_protocol_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PeerMembershipQuery); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_discovery_protocol_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PeerMembershipResult); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_discovery_protocol_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChaincodeQuery); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_discovery_protocol_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChaincodeQueryResult); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_discovery_protocol_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LocalPeerQuery); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_discovery_protocol_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EndorsementDescriptor); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_discovery_protocol_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Layout); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_discovery_protocol_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Peers); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_discovery_protocol_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Peer); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_discovery_protocol_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Error); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_discovery_protocol_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Endpoints); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_discovery_protocol_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Endpoint); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_discovery_protocol_proto_msgTypes[4].OneofWrappers = []interface{}{ + (*Query_ConfigQuery)(nil), + (*Query_PeerQuery)(nil), + (*Query_CcQuery)(nil), + (*Query_LocalPeers)(nil), + } + file_discovery_protocol_proto_msgTypes[5].OneofWrappers = []interface{}{ + (*QueryResult_Error)(nil), + (*QueryResult_ConfigResult)(nil), + (*QueryResult_CcQueryRes)(nil), + (*QueryResult_Members)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_discovery_protocol_proto_rawDesc, + NumEnums: 0, + NumMessages: 25, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_discovery_protocol_proto_goTypes, + DependencyIndexes: file_discovery_protocol_proto_depIdxs, + MessageInfos: file_discovery_protocol_proto_msgTypes, + }.Build() + File_discovery_protocol_proto = out.File + file_discovery_protocol_proto_rawDesc = nil + file_discovery_protocol_proto_goTypes = nil + file_discovery_protocol_proto_depIdxs = nil +} diff --git a/vendor/github.com/hyperledger/fabric-protos-go-apiv2/discovery/protocol_grpc.pb.go b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/discovery/protocol_grpc.pb.go new file mode 100644 index 00000000000..387942cd82c --- /dev/null +++ b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/discovery/protocol_grpc.pb.go @@ -0,0 +1,113 @@ +// Copyright the Hyperledger Fabric contributors. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: discovery/protocol.proto + +package discovery + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + Discovery_Discover_FullMethodName = "/discovery.Discovery/Discover" +) + +// DiscoveryClient is the client API for Discovery service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type DiscoveryClient interface { + // Discover receives a signed request, and returns a response. + Discover(ctx context.Context, in *SignedRequest, opts ...grpc.CallOption) (*Response, error) +} + +type discoveryClient struct { + cc grpc.ClientConnInterface +} + +func NewDiscoveryClient(cc grpc.ClientConnInterface) DiscoveryClient { + return &discoveryClient{cc} +} + +func (c *discoveryClient) Discover(ctx context.Context, in *SignedRequest, opts ...grpc.CallOption) (*Response, error) { + out := new(Response) + err := c.cc.Invoke(ctx, Discovery_Discover_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// DiscoveryServer is the server API for Discovery service. +// All implementations should embed UnimplementedDiscoveryServer +// for forward compatibility +type DiscoveryServer interface { + // Discover receives a signed request, and returns a response. + Discover(context.Context, *SignedRequest) (*Response, error) +} + +// UnimplementedDiscoveryServer should be embedded to have forward compatible implementations. +type UnimplementedDiscoveryServer struct { +} + +func (UnimplementedDiscoveryServer) Discover(context.Context, *SignedRequest) (*Response, error) { + return nil, status.Errorf(codes.Unimplemented, "method Discover not implemented") +} + +// UnsafeDiscoveryServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to DiscoveryServer will +// result in compilation errors. +type UnsafeDiscoveryServer interface { + mustEmbedUnimplementedDiscoveryServer() +} + +func RegisterDiscoveryServer(s grpc.ServiceRegistrar, srv DiscoveryServer) { + s.RegisterService(&Discovery_ServiceDesc, srv) +} + +func _Discovery_Discover_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SignedRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DiscoveryServer).Discover(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Discovery_Discover_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DiscoveryServer).Discover(ctx, req.(*SignedRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// Discovery_ServiceDesc is the grpc.ServiceDesc for Discovery service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Discovery_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "discovery.Discovery", + HandlerType: (*DiscoveryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Discover", + Handler: _Discovery_Discover_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "discovery/protocol.proto", +} diff --git a/vendor/github.com/hyperledger/fabric-protos-go-apiv2/gateway/gateway.pb.go b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/gateway/gateway.pb.go new file mode 100644 index 00000000000..63bf346f2b7 --- /dev/null +++ b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/gateway/gateway.pb.go @@ -0,0 +1,1416 @@ +// Copyright the Hyperledger Fabric contributors. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: gateway/gateway.proto + +package gateway + +import ( + common "github.com/hyperledger/fabric-protos-go-apiv2/common" + orderer "github.com/hyperledger/fabric-protos-go-apiv2/orderer" + peer "github.com/hyperledger/fabric-protos-go-apiv2/peer" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// EndorseRequest contains the details required to obtain sufficient endorsements for a +// transaction to be committed to the ledger. +type EndorseRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The unique identifier for the transaction. + TransactionId string `protobuf:"bytes,1,opt,name=transaction_id,json=transactionId,proto3" json:"transaction_id,omitempty"` + // Identifier of the channel this request is bound for. + ChannelId string `protobuf:"bytes,2,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` + // The signed proposal ready for endorsement. + ProposedTransaction *peer.SignedProposal `protobuf:"bytes,3,opt,name=proposed_transaction,json=proposedTransaction,proto3" json:"proposed_transaction,omitempty"` + // If targeting the peers of specific organizations (e.g. for private data scenarios), + // the list of organizations' MSPIDs should be supplied here. + EndorsingOrganizations []string `protobuf:"bytes,4,rep,name=endorsing_organizations,json=endorsingOrganizations,proto3" json:"endorsing_organizations,omitempty"` +} + +func (x *EndorseRequest) Reset() { + *x = EndorseRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_gateway_gateway_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EndorseRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EndorseRequest) ProtoMessage() {} + +func (x *EndorseRequest) ProtoReflect() protoreflect.Message { + mi := &file_gateway_gateway_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EndorseRequest.ProtoReflect.Descriptor instead. +func (*EndorseRequest) Descriptor() ([]byte, []int) { + return file_gateway_gateway_proto_rawDescGZIP(), []int{0} +} + +func (x *EndorseRequest) GetTransactionId() string { + if x != nil { + return x.TransactionId + } + return "" +} + +func (x *EndorseRequest) GetChannelId() string { + if x != nil { + return x.ChannelId + } + return "" +} + +func (x *EndorseRequest) GetProposedTransaction() *peer.SignedProposal { + if x != nil { + return x.ProposedTransaction + } + return nil +} + +func (x *EndorseRequest) GetEndorsingOrganizations() []string { + if x != nil { + return x.EndorsingOrganizations + } + return nil +} + +// EndorseResponse returns the result of endorsing a transaction. +type EndorseResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The unsigned set of transaction responses from the endorsing peers for signing by the client + // before submitting to ordering service (via gateway). + PreparedTransaction *common.Envelope `protobuf:"bytes,1,opt,name=prepared_transaction,json=preparedTransaction,proto3" json:"prepared_transaction,omitempty"` +} + +func (x *EndorseResponse) Reset() { + *x = EndorseResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_gateway_gateway_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EndorseResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EndorseResponse) ProtoMessage() {} + +func (x *EndorseResponse) ProtoReflect() protoreflect.Message { + mi := &file_gateway_gateway_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EndorseResponse.ProtoReflect.Descriptor instead. +func (*EndorseResponse) Descriptor() ([]byte, []int) { + return file_gateway_gateway_proto_rawDescGZIP(), []int{1} +} + +func (x *EndorseResponse) GetPreparedTransaction() *common.Envelope { + if x != nil { + return x.PreparedTransaction + } + return nil +} + +// SubmitRequest contains the details required to submit a transaction (update the ledger). +type SubmitRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Identifier of the transaction to submit. + TransactionId string `protobuf:"bytes,1,opt,name=transaction_id,json=transactionId,proto3" json:"transaction_id,omitempty"` + // Identifier of the channel this request is bound for. + ChannelId string `protobuf:"bytes,2,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` + // The signed set of endorsed transaction responses to submit. + PreparedTransaction *common.Envelope `protobuf:"bytes,3,opt,name=prepared_transaction,json=preparedTransaction,proto3" json:"prepared_transaction,omitempty"` +} + +func (x *SubmitRequest) Reset() { + *x = SubmitRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_gateway_gateway_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SubmitRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SubmitRequest) ProtoMessage() {} + +func (x *SubmitRequest) ProtoReflect() protoreflect.Message { + mi := &file_gateway_gateway_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SubmitRequest.ProtoReflect.Descriptor instead. +func (*SubmitRequest) Descriptor() ([]byte, []int) { + return file_gateway_gateway_proto_rawDescGZIP(), []int{2} +} + +func (x *SubmitRequest) GetTransactionId() string { + if x != nil { + return x.TransactionId + } + return "" +} + +func (x *SubmitRequest) GetChannelId() string { + if x != nil { + return x.ChannelId + } + return "" +} + +func (x *SubmitRequest) GetPreparedTransaction() *common.Envelope { + if x != nil { + return x.PreparedTransaction + } + return nil +} + +// SubmitResponse returns the result of submitting a transaction. +type SubmitResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *SubmitResponse) Reset() { + *x = SubmitResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_gateway_gateway_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SubmitResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SubmitResponse) ProtoMessage() {} + +func (x *SubmitResponse) ProtoReflect() protoreflect.Message { + mi := &file_gateway_gateway_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SubmitResponse.ProtoReflect.Descriptor instead. +func (*SubmitResponse) Descriptor() ([]byte, []int) { + return file_gateway_gateway_proto_rawDescGZIP(), []int{3} +} + +// SignedCommitStatusRequest contains a serialized CommitStatusRequest message, and a digital signature for the +// serialized request message. +type SignedCommitStatusRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Serialized CommitStatusRequest message. + Request []byte `protobuf:"bytes,1,opt,name=request,proto3" json:"request,omitempty"` + // Signature for request message. + Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` +} + +func (x *SignedCommitStatusRequest) Reset() { + *x = SignedCommitStatusRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_gateway_gateway_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SignedCommitStatusRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SignedCommitStatusRequest) ProtoMessage() {} + +func (x *SignedCommitStatusRequest) ProtoReflect() protoreflect.Message { + mi := &file_gateway_gateway_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SignedCommitStatusRequest.ProtoReflect.Descriptor instead. +func (*SignedCommitStatusRequest) Descriptor() ([]byte, []int) { + return file_gateway_gateway_proto_rawDescGZIP(), []int{4} +} + +func (x *SignedCommitStatusRequest) GetRequest() []byte { + if x != nil { + return x.Request + } + return nil +} + +func (x *SignedCommitStatusRequest) GetSignature() []byte { + if x != nil { + return x.Signature + } + return nil +} + +// CommitStatusRequest contains the details required to check whether a transaction has been +// successfully committed. +type CommitStatusRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Identifier of the transaction to check. + TransactionId string `protobuf:"bytes,1,opt,name=transaction_id,json=transactionId,proto3" json:"transaction_id,omitempty"` + // Identifier of the channel this request is bound for. + ChannelId string `protobuf:"bytes,2,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` + // Client requestor identity. + Identity []byte `protobuf:"bytes,3,opt,name=identity,proto3" json:"identity,omitempty"` +} + +func (x *CommitStatusRequest) Reset() { + *x = CommitStatusRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_gateway_gateway_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CommitStatusRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CommitStatusRequest) ProtoMessage() {} + +func (x *CommitStatusRequest) ProtoReflect() protoreflect.Message { + mi := &file_gateway_gateway_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CommitStatusRequest.ProtoReflect.Descriptor instead. +func (*CommitStatusRequest) Descriptor() ([]byte, []int) { + return file_gateway_gateway_proto_rawDescGZIP(), []int{5} +} + +func (x *CommitStatusRequest) GetTransactionId() string { + if x != nil { + return x.TransactionId + } + return "" +} + +func (x *CommitStatusRequest) GetChannelId() string { + if x != nil { + return x.ChannelId + } + return "" +} + +func (x *CommitStatusRequest) GetIdentity() []byte { + if x != nil { + return x.Identity + } + return nil +} + +// CommitStatusResponse returns the result of committing a transaction. +type CommitStatusResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The result of the transaction commit, as defined in peer/transaction.proto. + Result peer.TxValidationCode `protobuf:"varint,1,opt,name=result,proto3,enum=protos.TxValidationCode" json:"result,omitempty"` + // Block number that contains the transaction. + BlockNumber uint64 `protobuf:"varint,2,opt,name=block_number,json=blockNumber,proto3" json:"block_number,omitempty"` +} + +func (x *CommitStatusResponse) Reset() { + *x = CommitStatusResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_gateway_gateway_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CommitStatusResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CommitStatusResponse) ProtoMessage() {} + +func (x *CommitStatusResponse) ProtoReflect() protoreflect.Message { + mi := &file_gateway_gateway_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CommitStatusResponse.ProtoReflect.Descriptor instead. +func (*CommitStatusResponse) Descriptor() ([]byte, []int) { + return file_gateway_gateway_proto_rawDescGZIP(), []int{6} +} + +func (x *CommitStatusResponse) GetResult() peer.TxValidationCode { + if x != nil { + return x.Result + } + return peer.TxValidationCode(0) +} + +func (x *CommitStatusResponse) GetBlockNumber() uint64 { + if x != nil { + return x.BlockNumber + } + return 0 +} + +// EvaluateRequest contains the details required to evaluate a transaction (query the ledger). +type EvaluateRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Identifier of the transaction to evaluate. + TransactionId string `protobuf:"bytes,1,opt,name=transaction_id,json=transactionId,proto3" json:"transaction_id,omitempty"` + // Identifier of the channel this request is bound for. + ChannelId string `protobuf:"bytes,2,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` + // The signed proposal ready for evaluation. + ProposedTransaction *peer.SignedProposal `protobuf:"bytes,3,opt,name=proposed_transaction,json=proposedTransaction,proto3" json:"proposed_transaction,omitempty"` + // If targeting the peers of specific organizations (e.g. for private data scenarios), + // the list of organizations' MSPIDs should be supplied here. + TargetOrganizations []string `protobuf:"bytes,4,rep,name=target_organizations,json=targetOrganizations,proto3" json:"target_organizations,omitempty"` +} + +func (x *EvaluateRequest) Reset() { + *x = EvaluateRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_gateway_gateway_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EvaluateRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EvaluateRequest) ProtoMessage() {} + +func (x *EvaluateRequest) ProtoReflect() protoreflect.Message { + mi := &file_gateway_gateway_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EvaluateRequest.ProtoReflect.Descriptor instead. +func (*EvaluateRequest) Descriptor() ([]byte, []int) { + return file_gateway_gateway_proto_rawDescGZIP(), []int{7} +} + +func (x *EvaluateRequest) GetTransactionId() string { + if x != nil { + return x.TransactionId + } + return "" +} + +func (x *EvaluateRequest) GetChannelId() string { + if x != nil { + return x.ChannelId + } + return "" +} + +func (x *EvaluateRequest) GetProposedTransaction() *peer.SignedProposal { + if x != nil { + return x.ProposedTransaction + } + return nil +} + +func (x *EvaluateRequest) GetTargetOrganizations() []string { + if x != nil { + return x.TargetOrganizations + } + return nil +} + +// EvaluateResponse returns the result of evaluating a transaction. +type EvaluateResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The response that is returned by the transaction function, as defined + // in peer/proposal_response.proto. + Result *peer.Response `protobuf:"bytes,1,opt,name=result,proto3" json:"result,omitempty"` +} + +func (x *EvaluateResponse) Reset() { + *x = EvaluateResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_gateway_gateway_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EvaluateResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EvaluateResponse) ProtoMessage() {} + +func (x *EvaluateResponse) ProtoReflect() protoreflect.Message { + mi := &file_gateway_gateway_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EvaluateResponse.ProtoReflect.Descriptor instead. +func (*EvaluateResponse) Descriptor() ([]byte, []int) { + return file_gateway_gateway_proto_rawDescGZIP(), []int{8} +} + +func (x *EvaluateResponse) GetResult() *peer.Response { + if x != nil { + return x.Result + } + return nil +} + +// SignedChaincodeEventsRequest contains a serialized ChaincodeEventsRequest message, and a digital signature for the +// serialized request message. +type SignedChaincodeEventsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Serialized ChaincodeEventsRequest message. + Request []byte `protobuf:"bytes,1,opt,name=request,proto3" json:"request,omitempty"` + // Signature for request message. + Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` +} + +func (x *SignedChaincodeEventsRequest) Reset() { + *x = SignedChaincodeEventsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_gateway_gateway_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SignedChaincodeEventsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SignedChaincodeEventsRequest) ProtoMessage() {} + +func (x *SignedChaincodeEventsRequest) ProtoReflect() protoreflect.Message { + mi := &file_gateway_gateway_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SignedChaincodeEventsRequest.ProtoReflect.Descriptor instead. +func (*SignedChaincodeEventsRequest) Descriptor() ([]byte, []int) { + return file_gateway_gateway_proto_rawDescGZIP(), []int{9} +} + +func (x *SignedChaincodeEventsRequest) GetRequest() []byte { + if x != nil { + return x.Request + } + return nil +} + +func (x *SignedChaincodeEventsRequest) GetSignature() []byte { + if x != nil { + return x.Signature + } + return nil +} + +// ChaincodeEventsRequest contains details of the chaincode events that the caller wants to receive. +type ChaincodeEventsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Identifier of the channel this request is bound for. + ChannelId string `protobuf:"bytes,1,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` + // Name of the chaincode for which events are requested. + ChaincodeId string `protobuf:"bytes,2,opt,name=chaincode_id,json=chaincodeId,proto3" json:"chaincode_id,omitempty"` + // Client requestor identity. + Identity []byte `protobuf:"bytes,3,opt,name=identity,proto3" json:"identity,omitempty"` + // Position within the ledger at which to start reading events. + StartPosition *orderer.SeekPosition `protobuf:"bytes,4,opt,name=start_position,json=startPosition,proto3" json:"start_position,omitempty"` + // Only returns events after this transaction ID. Transactions up to and including this one should be ignored. This + // is used to allow resume of event listening from a certain position within a start block specified by + // start_position. + AfterTransactionId string `protobuf:"bytes,5,opt,name=after_transaction_id,json=afterTransactionId,proto3" json:"after_transaction_id,omitempty"` +} + +func (x *ChaincodeEventsRequest) Reset() { + *x = ChaincodeEventsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_gateway_gateway_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChaincodeEventsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChaincodeEventsRequest) ProtoMessage() {} + +func (x *ChaincodeEventsRequest) ProtoReflect() protoreflect.Message { + mi := &file_gateway_gateway_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ChaincodeEventsRequest.ProtoReflect.Descriptor instead. +func (*ChaincodeEventsRequest) Descriptor() ([]byte, []int) { + return file_gateway_gateway_proto_rawDescGZIP(), []int{10} +} + +func (x *ChaincodeEventsRequest) GetChannelId() string { + if x != nil { + return x.ChannelId + } + return "" +} + +func (x *ChaincodeEventsRequest) GetChaincodeId() string { + if x != nil { + return x.ChaincodeId + } + return "" +} + +func (x *ChaincodeEventsRequest) GetIdentity() []byte { + if x != nil { + return x.Identity + } + return nil +} + +func (x *ChaincodeEventsRequest) GetStartPosition() *orderer.SeekPosition { + if x != nil { + return x.StartPosition + } + return nil +} + +func (x *ChaincodeEventsRequest) GetAfterTransactionId() string { + if x != nil { + return x.AfterTransactionId + } + return "" +} + +// ChaincodeEventsResponse returns chaincode events emitted from a specific block. +type ChaincodeEventsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Chaincode events emitted by the requested chaincode. The events are presented in the same order that the + // transactions that emitted them appear within the block. + Events []*peer.ChaincodeEvent `protobuf:"bytes,1,rep,name=events,proto3" json:"events,omitempty"` + // Block number in which the chaincode events were emitted. + BlockNumber uint64 `protobuf:"varint,2,opt,name=block_number,json=blockNumber,proto3" json:"block_number,omitempty"` +} + +func (x *ChaincodeEventsResponse) Reset() { + *x = ChaincodeEventsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_gateway_gateway_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChaincodeEventsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChaincodeEventsResponse) ProtoMessage() {} + +func (x *ChaincodeEventsResponse) ProtoReflect() protoreflect.Message { + mi := &file_gateway_gateway_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ChaincodeEventsResponse.ProtoReflect.Descriptor instead. +func (*ChaincodeEventsResponse) Descriptor() ([]byte, []int) { + return file_gateway_gateway_proto_rawDescGZIP(), []int{11} +} + +func (x *ChaincodeEventsResponse) GetEvents() []*peer.ChaincodeEvent { + if x != nil { + return x.Events + } + return nil +} + +func (x *ChaincodeEventsResponse) GetBlockNumber() uint64 { + if x != nil { + return x.BlockNumber + } + return 0 +} + +// If any of the functions in the Gateway service returns an error, then it will be in the format of +// a google.rpc.Status message. The 'details' field of this message will be populated with extra +// information if the error is a result of one or more failed requests to remote peers or orderer nodes. +// ErrorDetail contains details of errors that are received by any of the endorsing peers +// as a result of processing the Evaluate or Endorse services, or from the ordering node(s) as a result of +// processing the Submit service. +type ErrorDetail struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The address of the endorsing peer or ordering node that returned an error. + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + // The MSP Identifier of this node. + MspId string `protobuf:"bytes,2,opt,name=msp_id,json=mspId,proto3" json:"msp_id,omitempty"` + // The error message returned by this node. + Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"` +} + +func (x *ErrorDetail) Reset() { + *x = ErrorDetail{} + if protoimpl.UnsafeEnabled { + mi := &file_gateway_gateway_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ErrorDetail) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ErrorDetail) ProtoMessage() {} + +func (x *ErrorDetail) ProtoReflect() protoreflect.Message { + mi := &file_gateway_gateway_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ErrorDetail.ProtoReflect.Descriptor instead. +func (*ErrorDetail) Descriptor() ([]byte, []int) { + return file_gateway_gateway_proto_rawDescGZIP(), []int{12} +} + +func (x *ErrorDetail) GetAddress() string { + if x != nil { + return x.Address + } + return "" +} + +func (x *ErrorDetail) GetMspId() string { + if x != nil { + return x.MspId + } + return "" +} + +func (x *ErrorDetail) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +// ProposedTransaction contains the details required for offline signing prior to evaluating or endorsing +// a transaction. +type ProposedTransaction struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Identifier of the proposed transaction. + TransactionId string `protobuf:"bytes,1,opt,name=transaction_id,json=transactionId,proto3" json:"transaction_id,omitempty"` + // The signed proposal. + Proposal *peer.SignedProposal `protobuf:"bytes,2,opt,name=proposal,proto3" json:"proposal,omitempty"` + // The list of endorsing organizations. + EndorsingOrganizations []string `protobuf:"bytes,3,rep,name=endorsing_organizations,json=endorsingOrganizations,proto3" json:"endorsing_organizations,omitempty"` +} + +func (x *ProposedTransaction) Reset() { + *x = ProposedTransaction{} + if protoimpl.UnsafeEnabled { + mi := &file_gateway_gateway_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ProposedTransaction) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ProposedTransaction) ProtoMessage() {} + +func (x *ProposedTransaction) ProtoReflect() protoreflect.Message { + mi := &file_gateway_gateway_proto_msgTypes[13] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ProposedTransaction.ProtoReflect.Descriptor instead. +func (*ProposedTransaction) Descriptor() ([]byte, []int) { + return file_gateway_gateway_proto_rawDescGZIP(), []int{13} +} + +func (x *ProposedTransaction) GetTransactionId() string { + if x != nil { + return x.TransactionId + } + return "" +} + +func (x *ProposedTransaction) GetProposal() *peer.SignedProposal { + if x != nil { + return x.Proposal + } + return nil +} + +func (x *ProposedTransaction) GetEndorsingOrganizations() []string { + if x != nil { + return x.EndorsingOrganizations + } + return nil +} + +// PreparedTransaction contains the details required for offline signing prior to submitting a transaction. +type PreparedTransaction struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Identifier of the prepared transaction. + TransactionId string `protobuf:"bytes,1,opt,name=transaction_id,json=transactionId,proto3" json:"transaction_id,omitempty"` + // The transaction envelope. + Envelope *common.Envelope `protobuf:"bytes,2,opt,name=envelope,proto3" json:"envelope,omitempty"` +} + +func (x *PreparedTransaction) Reset() { + *x = PreparedTransaction{} + if protoimpl.UnsafeEnabled { + mi := &file_gateway_gateway_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PreparedTransaction) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PreparedTransaction) ProtoMessage() {} + +func (x *PreparedTransaction) ProtoReflect() protoreflect.Message { + mi := &file_gateway_gateway_proto_msgTypes[14] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PreparedTransaction.ProtoReflect.Descriptor instead. +func (*PreparedTransaction) Descriptor() ([]byte, []int) { + return file_gateway_gateway_proto_rawDescGZIP(), []int{14} +} + +func (x *PreparedTransaction) GetTransactionId() string { + if x != nil { + return x.TransactionId + } + return "" +} + +func (x *PreparedTransaction) GetEnvelope() *common.Envelope { + if x != nil { + return x.Envelope + } + return nil +} + +var File_gateway_gateway_proto protoreflect.FileDescriptor + +var file_gateway_gateway_proto_rawDesc = []byte{ + 0x0a, 0x15, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2f, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, + 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x07, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, + 0x1a, 0x1a, 0x70, 0x65, 0x65, 0x72, 0x2f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, + 0x5f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x13, 0x70, 0x65, + 0x65, 0x72, 0x2f, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x1a, 0x1c, 0x70, 0x65, 0x65, 0x72, 0x2f, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, + 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x16, 0x70, 0x65, 0x65, 0x72, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x13, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, + 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x10, 0x6f, 0x72, + 0x64, 0x65, 0x72, 0x65, 0x72, 0x2f, 0x61, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xda, + 0x01, 0x0a, 0x0e, 0x45, 0x6e, 0x64, 0x6f, 0x72, 0x73, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x25, 0x0a, 0x0e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x74, 0x72, 0x61, 0x6e, 0x73, + 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x68, 0x61, 0x6e, + 0x6e, 0x65, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x68, + 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x49, 0x64, 0x12, 0x49, 0x0a, 0x14, 0x70, 0x72, 0x6f, 0x70, 0x6f, + 0x73, 0x65, 0x64, 0x5f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x53, + 0x69, 0x67, 0x6e, 0x65, 0x64, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x52, 0x13, 0x70, + 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x64, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x37, 0x0a, 0x17, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x73, 0x69, 0x6e, 0x67, 0x5f, + 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x04, 0x20, + 0x03, 0x28, 0x09, 0x52, 0x16, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x73, 0x69, 0x6e, 0x67, 0x4f, 0x72, + 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x56, 0x0a, 0x0f, 0x45, + 0x6e, 0x64, 0x6f, 0x72, 0x73, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x43, + 0x0a, 0x14, 0x70, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x64, 0x5f, 0x74, 0x72, 0x61, 0x6e, 0x73, + 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x63, + 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x52, 0x13, + 0x70, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x64, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x22, 0x9a, 0x01, 0x0a, 0x0d, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x25, 0x0a, 0x0e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x74, + 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, + 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x09, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x49, 0x64, 0x12, 0x43, 0x0a, 0x14, 0x70, + 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x64, 0x5f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, + 0x6f, 0x6e, 0x2e, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x52, 0x13, 0x70, 0x72, 0x65, + 0x70, 0x61, 0x72, 0x65, 0x64, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x22, 0x10, 0x0a, 0x0e, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x53, 0x0a, 0x19, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x43, 0x6f, 0x6d, 0x6d, + 0x69, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x18, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x67, + 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x69, + 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x77, 0x0a, 0x13, 0x43, 0x6f, 0x6d, 0x6d, 0x69, + 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x25, + 0x0a, 0x0e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, + 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x68, 0x61, 0x6e, 0x6e, + 0x65, 0x6c, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, + 0x22, 0x6b, 0x0a, 0x14, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x30, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, + 0x6c, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x73, 0x2e, 0x54, 0x78, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, + 0x64, 0x65, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x6c, + 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, 0xd5, 0x01, + 0x0a, 0x0f, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x25, 0x0a, 0x0e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x74, 0x72, 0x61, 0x6e, 0x73, + 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x68, 0x61, 0x6e, + 0x6e, 0x65, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x68, + 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x49, 0x64, 0x12, 0x49, 0x0a, 0x14, 0x70, 0x72, 0x6f, 0x70, 0x6f, + 0x73, 0x65, 0x64, 0x5f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x53, + 0x69, 0x67, 0x6e, 0x65, 0x64, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x52, 0x13, 0x70, + 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x64, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x31, 0x0a, 0x14, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x6f, 0x72, 0x67, + 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, + 0x52, 0x13, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x3c, 0x0a, 0x10, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, + 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x28, 0x0a, 0x06, 0x72, 0x65, 0x73, + 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x73, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x06, 0x72, 0x65, 0x73, + 0x75, 0x6c, 0x74, 0x22, 0x56, 0x0a, 0x1c, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x43, 0x68, 0x61, + 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, + 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0xe6, 0x01, 0x0a, 0x16, + 0x43, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, + 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x68, 0x61, 0x6e, + 0x6e, 0x65, 0x6c, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, + 0x64, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x68, 0x61, + 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x64, 0x65, 0x6e, + 0x74, 0x69, 0x74, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x69, 0x64, 0x65, 0x6e, + 0x74, 0x69, 0x74, 0x79, 0x12, 0x3c, 0x0a, 0x0e, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x70, 0x6f, + 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x6f, + 0x72, 0x64, 0x65, 0x72, 0x65, 0x72, 0x2e, 0x53, 0x65, 0x65, 0x6b, 0x50, 0x6f, 0x73, 0x69, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x0d, 0x73, 0x74, 0x61, 0x72, 0x74, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x30, 0x0a, 0x14, 0x61, 0x66, 0x74, 0x65, 0x72, 0x5f, 0x74, 0x72, 0x61, 0x6e, + 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x12, 0x61, 0x66, 0x74, 0x65, 0x72, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x49, 0x64, 0x22, 0x6c, 0x0a, 0x17, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, + 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x2e, 0x0a, 0x06, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x16, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, + 0x64, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x06, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x12, + 0x21, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, + 0x65, 0x72, 0x22, 0x58, 0x0a, 0x0b, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x44, 0x65, 0x74, 0x61, 0x69, + 0x6c, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x15, 0x0a, 0x06, 0x6d, + 0x73, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6d, 0x73, 0x70, + 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0xa9, 0x01, 0x0a, + 0x13, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x64, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x25, 0x0a, 0x0e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x74, 0x72, + 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x32, 0x0a, 0x08, 0x70, + 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x50, 0x72, 0x6f, + 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x12, + 0x37, 0x0a, 0x17, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x73, 0x69, 0x6e, 0x67, 0x5f, 0x6f, 0x72, 0x67, + 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, + 0x52, 0x16, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x73, 0x69, 0x6e, 0x67, 0x4f, 0x72, 0x67, 0x61, 0x6e, + 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x6a, 0x0a, 0x13, 0x50, 0x72, 0x65, 0x70, + 0x61, 0x72, 0x65, 0x64, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, + 0x25, 0x0a, 0x0e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x2c, 0x0a, 0x08, 0x65, 0x6e, 0x76, 0x65, 0x6c, 0x6f, + 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, + 0x6e, 0x2e, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x52, 0x08, 0x65, 0x6e, 0x76, 0x65, + 0x6c, 0x6f, 0x70, 0x65, 0x32, 0xf4, 0x02, 0x0a, 0x07, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, + 0x12, 0x3c, 0x0a, 0x07, 0x45, 0x6e, 0x64, 0x6f, 0x72, 0x73, 0x65, 0x12, 0x17, 0x2e, 0x67, 0x61, + 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x45, 0x6e, 0x64, 0x6f, 0x72, 0x73, 0x65, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x45, + 0x6e, 0x64, 0x6f, 0x72, 0x73, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x39, + 0x0a, 0x06, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x12, 0x16, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, + 0x61, 0x79, 0x2e, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x17, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x53, 0x75, 0x62, 0x6d, 0x69, + 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x51, 0x0a, 0x0c, 0x43, 0x6f, 0x6d, + 0x6d, 0x69, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x22, 0x2e, 0x67, 0x61, 0x74, 0x65, + 0x77, 0x61, 0x79, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, + 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, + 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x53, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3f, 0x0a, 0x08, + 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x65, 0x12, 0x18, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, + 0x61, 0x79, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x45, 0x76, 0x61, + 0x6c, 0x75, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5c, 0x0a, + 0x0f, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, + 0x12, 0x25, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, + 0x64, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, + 0x79, 0x2e, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x42, 0xa8, 0x01, 0x0a, 0x25, + 0x6f, 0x72, 0x67, 0x2e, 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2e, + 0x66, 0x61, 0x62, 0x72, 0x69, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x67, 0x61, + 0x74, 0x65, 0x77, 0x61, 0x79, 0x42, 0x0c, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x50, 0x72, + 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x35, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2f, 0x66, 0x61, + 0x62, 0x72, 0x69, 0x63, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2d, 0x67, 0x6f, 0x2d, 0x61, + 0x70, 0x69, 0x76, 0x32, 0x2f, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0xa2, 0x02, 0x03, 0x47, + 0x58, 0x58, 0xaa, 0x02, 0x07, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0xca, 0x02, 0x07, 0x47, + 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0xe2, 0x02, 0x13, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, + 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x07, 0x47, + 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_gateway_gateway_proto_rawDescOnce sync.Once + file_gateway_gateway_proto_rawDescData = file_gateway_gateway_proto_rawDesc +) + +func file_gateway_gateway_proto_rawDescGZIP() []byte { + file_gateway_gateway_proto_rawDescOnce.Do(func() { + file_gateway_gateway_proto_rawDescData = protoimpl.X.CompressGZIP(file_gateway_gateway_proto_rawDescData) + }) + return file_gateway_gateway_proto_rawDescData +} + +var file_gateway_gateway_proto_msgTypes = make([]protoimpl.MessageInfo, 15) +var file_gateway_gateway_proto_goTypes = []interface{}{ + (*EndorseRequest)(nil), // 0: gateway.EndorseRequest + (*EndorseResponse)(nil), // 1: gateway.EndorseResponse + (*SubmitRequest)(nil), // 2: gateway.SubmitRequest + (*SubmitResponse)(nil), // 3: gateway.SubmitResponse + (*SignedCommitStatusRequest)(nil), // 4: gateway.SignedCommitStatusRequest + (*CommitStatusRequest)(nil), // 5: gateway.CommitStatusRequest + (*CommitStatusResponse)(nil), // 6: gateway.CommitStatusResponse + (*EvaluateRequest)(nil), // 7: gateway.EvaluateRequest + (*EvaluateResponse)(nil), // 8: gateway.EvaluateResponse + (*SignedChaincodeEventsRequest)(nil), // 9: gateway.SignedChaincodeEventsRequest + (*ChaincodeEventsRequest)(nil), // 10: gateway.ChaincodeEventsRequest + (*ChaincodeEventsResponse)(nil), // 11: gateway.ChaincodeEventsResponse + (*ErrorDetail)(nil), // 12: gateway.ErrorDetail + (*ProposedTransaction)(nil), // 13: gateway.ProposedTransaction + (*PreparedTransaction)(nil), // 14: gateway.PreparedTransaction + (*peer.SignedProposal)(nil), // 15: protos.SignedProposal + (*common.Envelope)(nil), // 16: common.Envelope + (peer.TxValidationCode)(0), // 17: protos.TxValidationCode + (*peer.Response)(nil), // 18: protos.Response + (*orderer.SeekPosition)(nil), // 19: orderer.SeekPosition + (*peer.ChaincodeEvent)(nil), // 20: protos.ChaincodeEvent +} +var file_gateway_gateway_proto_depIdxs = []int32{ + 15, // 0: gateway.EndorseRequest.proposed_transaction:type_name -> protos.SignedProposal + 16, // 1: gateway.EndorseResponse.prepared_transaction:type_name -> common.Envelope + 16, // 2: gateway.SubmitRequest.prepared_transaction:type_name -> common.Envelope + 17, // 3: gateway.CommitStatusResponse.result:type_name -> protos.TxValidationCode + 15, // 4: gateway.EvaluateRequest.proposed_transaction:type_name -> protos.SignedProposal + 18, // 5: gateway.EvaluateResponse.result:type_name -> protos.Response + 19, // 6: gateway.ChaincodeEventsRequest.start_position:type_name -> orderer.SeekPosition + 20, // 7: gateway.ChaincodeEventsResponse.events:type_name -> protos.ChaincodeEvent + 15, // 8: gateway.ProposedTransaction.proposal:type_name -> protos.SignedProposal + 16, // 9: gateway.PreparedTransaction.envelope:type_name -> common.Envelope + 0, // 10: gateway.Gateway.Endorse:input_type -> gateway.EndorseRequest + 2, // 11: gateway.Gateway.Submit:input_type -> gateway.SubmitRequest + 4, // 12: gateway.Gateway.CommitStatus:input_type -> gateway.SignedCommitStatusRequest + 7, // 13: gateway.Gateway.Evaluate:input_type -> gateway.EvaluateRequest + 9, // 14: gateway.Gateway.ChaincodeEvents:input_type -> gateway.SignedChaincodeEventsRequest + 1, // 15: gateway.Gateway.Endorse:output_type -> gateway.EndorseResponse + 3, // 16: gateway.Gateway.Submit:output_type -> gateway.SubmitResponse + 6, // 17: gateway.Gateway.CommitStatus:output_type -> gateway.CommitStatusResponse + 8, // 18: gateway.Gateway.Evaluate:output_type -> gateway.EvaluateResponse + 11, // 19: gateway.Gateway.ChaincodeEvents:output_type -> gateway.ChaincodeEventsResponse + 15, // [15:20] is the sub-list for method output_type + 10, // [10:15] is the sub-list for method input_type + 10, // [10:10] is the sub-list for extension type_name + 10, // [10:10] is the sub-list for extension extendee + 0, // [0:10] is the sub-list for field type_name +} + +func init() { file_gateway_gateway_proto_init() } +func file_gateway_gateway_proto_init() { + if File_gateway_gateway_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_gateway_gateway_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EndorseRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gateway_gateway_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EndorseResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gateway_gateway_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SubmitRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gateway_gateway_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SubmitResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gateway_gateway_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SignedCommitStatusRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gateway_gateway_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CommitStatusRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gateway_gateway_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CommitStatusResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gateway_gateway_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EvaluateRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gateway_gateway_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EvaluateResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gateway_gateway_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SignedChaincodeEventsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gateway_gateway_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChaincodeEventsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gateway_gateway_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChaincodeEventsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gateway_gateway_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ErrorDetail); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gateway_gateway_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ProposedTransaction); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gateway_gateway_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PreparedTransaction); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_gateway_gateway_proto_rawDesc, + NumEnums: 0, + NumMessages: 15, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_gateway_gateway_proto_goTypes, + DependencyIndexes: file_gateway_gateway_proto_depIdxs, + MessageInfos: file_gateway_gateway_proto_msgTypes, + }.Build() + File_gateway_gateway_proto = out.File + file_gateway_gateway_proto_rawDesc = nil + file_gateway_gateway_proto_goTypes = nil + file_gateway_gateway_proto_depIdxs = nil +} diff --git a/vendor/github.com/hyperledger/fabric-protos-go-apiv2/gateway/gateway_grpc.pb.go b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/gateway/gateway_grpc.pb.go new file mode 100644 index 00000000000..102c58ee642 --- /dev/null +++ b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/gateway/gateway_grpc.pb.go @@ -0,0 +1,329 @@ +// Copyright the Hyperledger Fabric contributors. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: gateway/gateway.proto + +package gateway + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + Gateway_Endorse_FullMethodName = "/gateway.Gateway/Endorse" + Gateway_Submit_FullMethodName = "/gateway.Gateway/Submit" + Gateway_CommitStatus_FullMethodName = "/gateway.Gateway/CommitStatus" + Gateway_Evaluate_FullMethodName = "/gateway.Gateway/Evaluate" + Gateway_ChaincodeEvents_FullMethodName = "/gateway.Gateway/ChaincodeEvents" +) + +// GatewayClient is the client API for Gateway service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type GatewayClient interface { + // The Endorse service passes a proposed transaction to the gateway in order to + // obtain sufficient endorsement. + // The gateway will determine the endorsement plan for the requested chaincode and + // forward to the appropriate peers for endorsement. It will return to the client a + // prepared transaction in the form of an Envelope message as defined + // in common/common.proto. The client must sign the contents of this envelope + // before invoking the Submit service. + Endorse(ctx context.Context, in *EndorseRequest, opts ...grpc.CallOption) (*EndorseResponse, error) + // The Submit service will process the prepared transaction returned from Endorse service + // once it has been signed by the client. It will wait for the transaction to be submitted to the + // ordering service but the client must invoke the CommitStatus service to wait for the transaction + // to be committed. + Submit(ctx context.Context, in *SubmitRequest, opts ...grpc.CallOption) (*SubmitResponse, error) + // The CommitStatus service will indicate whether a prepared transaction previously submitted to + // the Submit service has been committed. It will wait for the commit to occur if it hasn’t already + // committed. + CommitStatus(ctx context.Context, in *SignedCommitStatusRequest, opts ...grpc.CallOption) (*CommitStatusResponse, error) + // The Evaluate service passes a proposed transaction to the gateway in order to invoke the + // transaction function and return the result to the client. No ledger updates are made. + // The gateway will select an appropriate peer to query based on block height and load. + Evaluate(ctx context.Context, in *EvaluateRequest, opts ...grpc.CallOption) (*EvaluateResponse, error) + // The ChaincodeEvents service supplies a stream of responses, each containing all the events emitted by the + // requested chaincode for a specific block. The streamed responses are ordered by ascending block number. Responses + // are only returned for blocks that contain the requested events, while blocks not containing any of the requested + // events are skipped. + ChaincodeEvents(ctx context.Context, in *SignedChaincodeEventsRequest, opts ...grpc.CallOption) (Gateway_ChaincodeEventsClient, error) +} + +type gatewayClient struct { + cc grpc.ClientConnInterface +} + +func NewGatewayClient(cc grpc.ClientConnInterface) GatewayClient { + return &gatewayClient{cc} +} + +func (c *gatewayClient) Endorse(ctx context.Context, in *EndorseRequest, opts ...grpc.CallOption) (*EndorseResponse, error) { + out := new(EndorseResponse) + err := c.cc.Invoke(ctx, Gateway_Endorse_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *gatewayClient) Submit(ctx context.Context, in *SubmitRequest, opts ...grpc.CallOption) (*SubmitResponse, error) { + out := new(SubmitResponse) + err := c.cc.Invoke(ctx, Gateway_Submit_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *gatewayClient) CommitStatus(ctx context.Context, in *SignedCommitStatusRequest, opts ...grpc.CallOption) (*CommitStatusResponse, error) { + out := new(CommitStatusResponse) + err := c.cc.Invoke(ctx, Gateway_CommitStatus_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *gatewayClient) Evaluate(ctx context.Context, in *EvaluateRequest, opts ...grpc.CallOption) (*EvaluateResponse, error) { + out := new(EvaluateResponse) + err := c.cc.Invoke(ctx, Gateway_Evaluate_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *gatewayClient) ChaincodeEvents(ctx context.Context, in *SignedChaincodeEventsRequest, opts ...grpc.CallOption) (Gateway_ChaincodeEventsClient, error) { + stream, err := c.cc.NewStream(ctx, &Gateway_ServiceDesc.Streams[0], Gateway_ChaincodeEvents_FullMethodName, opts...) + if err != nil { + return nil, err + } + x := &gatewayChaincodeEventsClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type Gateway_ChaincodeEventsClient interface { + Recv() (*ChaincodeEventsResponse, error) + grpc.ClientStream +} + +type gatewayChaincodeEventsClient struct { + grpc.ClientStream +} + +func (x *gatewayChaincodeEventsClient) Recv() (*ChaincodeEventsResponse, error) { + m := new(ChaincodeEventsResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// GatewayServer is the server API for Gateway service. +// All implementations should embed UnimplementedGatewayServer +// for forward compatibility +type GatewayServer interface { + // The Endorse service passes a proposed transaction to the gateway in order to + // obtain sufficient endorsement. + // The gateway will determine the endorsement plan for the requested chaincode and + // forward to the appropriate peers for endorsement. It will return to the client a + // prepared transaction in the form of an Envelope message as defined + // in common/common.proto. The client must sign the contents of this envelope + // before invoking the Submit service. + Endorse(context.Context, *EndorseRequest) (*EndorseResponse, error) + // The Submit service will process the prepared transaction returned from Endorse service + // once it has been signed by the client. It will wait for the transaction to be submitted to the + // ordering service but the client must invoke the CommitStatus service to wait for the transaction + // to be committed. + Submit(context.Context, *SubmitRequest) (*SubmitResponse, error) + // The CommitStatus service will indicate whether a prepared transaction previously submitted to + // the Submit service has been committed. It will wait for the commit to occur if it hasn’t already + // committed. + CommitStatus(context.Context, *SignedCommitStatusRequest) (*CommitStatusResponse, error) + // The Evaluate service passes a proposed transaction to the gateway in order to invoke the + // transaction function and return the result to the client. No ledger updates are made. + // The gateway will select an appropriate peer to query based on block height and load. + Evaluate(context.Context, *EvaluateRequest) (*EvaluateResponse, error) + // The ChaincodeEvents service supplies a stream of responses, each containing all the events emitted by the + // requested chaincode for a specific block. The streamed responses are ordered by ascending block number. Responses + // are only returned for blocks that contain the requested events, while blocks not containing any of the requested + // events are skipped. + ChaincodeEvents(*SignedChaincodeEventsRequest, Gateway_ChaincodeEventsServer) error +} + +// UnimplementedGatewayServer should be embedded to have forward compatible implementations. +type UnimplementedGatewayServer struct { +} + +func (UnimplementedGatewayServer) Endorse(context.Context, *EndorseRequest) (*EndorseResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Endorse not implemented") +} +func (UnimplementedGatewayServer) Submit(context.Context, *SubmitRequest) (*SubmitResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Submit not implemented") +} +func (UnimplementedGatewayServer) CommitStatus(context.Context, *SignedCommitStatusRequest) (*CommitStatusResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CommitStatus not implemented") +} +func (UnimplementedGatewayServer) Evaluate(context.Context, *EvaluateRequest) (*EvaluateResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Evaluate not implemented") +} +func (UnimplementedGatewayServer) ChaincodeEvents(*SignedChaincodeEventsRequest, Gateway_ChaincodeEventsServer) error { + return status.Errorf(codes.Unimplemented, "method ChaincodeEvents not implemented") +} + +// UnsafeGatewayServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to GatewayServer will +// result in compilation errors. +type UnsafeGatewayServer interface { + mustEmbedUnimplementedGatewayServer() +} + +func RegisterGatewayServer(s grpc.ServiceRegistrar, srv GatewayServer) { + s.RegisterService(&Gateway_ServiceDesc, srv) +} + +func _Gateway_Endorse_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(EndorseRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GatewayServer).Endorse(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Gateway_Endorse_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GatewayServer).Endorse(ctx, req.(*EndorseRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Gateway_Submit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SubmitRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GatewayServer).Submit(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Gateway_Submit_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GatewayServer).Submit(ctx, req.(*SubmitRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Gateway_CommitStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SignedCommitStatusRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GatewayServer).CommitStatus(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Gateway_CommitStatus_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GatewayServer).CommitStatus(ctx, req.(*SignedCommitStatusRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Gateway_Evaluate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(EvaluateRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GatewayServer).Evaluate(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Gateway_Evaluate_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GatewayServer).Evaluate(ctx, req.(*EvaluateRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Gateway_ChaincodeEvents_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(SignedChaincodeEventsRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(GatewayServer).ChaincodeEvents(m, &gatewayChaincodeEventsServer{stream}) +} + +type Gateway_ChaincodeEventsServer interface { + Send(*ChaincodeEventsResponse) error + grpc.ServerStream +} + +type gatewayChaincodeEventsServer struct { + grpc.ServerStream +} + +func (x *gatewayChaincodeEventsServer) Send(m *ChaincodeEventsResponse) error { + return x.ServerStream.SendMsg(m) +} + +// Gateway_ServiceDesc is the grpc.ServiceDesc for Gateway service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Gateway_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "gateway.Gateway", + HandlerType: (*GatewayServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Endorse", + Handler: _Gateway_Endorse_Handler, + }, + { + MethodName: "Submit", + Handler: _Gateway_Submit_Handler, + }, + { + MethodName: "CommitStatus", + Handler: _Gateway_CommitStatus_Handler, + }, + { + MethodName: "Evaluate", + Handler: _Gateway_Evaluate_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "ChaincodeEvents", + Handler: _Gateway_ChaincodeEvents_Handler, + ServerStreams: true, + }, + }, + Metadata: "gateway/gateway.proto", +} diff --git a/vendor/github.com/hyperledger/fabric-protos-go-apiv2/gossip/message.pb.go b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/gossip/message.pb.go new file mode 100644 index 00000000000..2b7fd6d4030 --- /dev/null +++ b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/gossip/message.pb.go @@ -0,0 +1,3427 @@ +// Copyright the Hyperledger Fabric contributors. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: gossip/message.proto + +package gossip + +import ( + peer "github.com/hyperledger/fabric-protos-go-apiv2/peer" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type PullMsgType int32 + +const ( + PullMsgType_UNDEFINED PullMsgType = 0 + PullMsgType_BLOCK_MSG PullMsgType = 1 + PullMsgType_IDENTITY_MSG PullMsgType = 2 +) + +// Enum value maps for PullMsgType. +var ( + PullMsgType_name = map[int32]string{ + 0: "UNDEFINED", + 1: "BLOCK_MSG", + 2: "IDENTITY_MSG", + } + PullMsgType_value = map[string]int32{ + "UNDEFINED": 0, + "BLOCK_MSG": 1, + "IDENTITY_MSG": 2, + } +) + +func (x PullMsgType) Enum() *PullMsgType { + p := new(PullMsgType) + *p = x + return p +} + +func (x PullMsgType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (PullMsgType) Descriptor() protoreflect.EnumDescriptor { + return file_gossip_message_proto_enumTypes[0].Descriptor() +} + +func (PullMsgType) Type() protoreflect.EnumType { + return &file_gossip_message_proto_enumTypes[0] +} + +func (x PullMsgType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use PullMsgType.Descriptor instead. +func (PullMsgType) EnumDescriptor() ([]byte, []int) { + return file_gossip_message_proto_rawDescGZIP(), []int{0} +} + +type GossipMessage_Tag int32 + +const ( + GossipMessage_UNDEFINED GossipMessage_Tag = 0 + GossipMessage_EMPTY GossipMessage_Tag = 1 + GossipMessage_ORG_ONLY GossipMessage_Tag = 2 + GossipMessage_CHAN_ONLY GossipMessage_Tag = 3 + GossipMessage_CHAN_AND_ORG GossipMessage_Tag = 4 + GossipMessage_CHAN_OR_ORG GossipMessage_Tag = 5 +) + +// Enum value maps for GossipMessage_Tag. +var ( + GossipMessage_Tag_name = map[int32]string{ + 0: "UNDEFINED", + 1: "EMPTY", + 2: "ORG_ONLY", + 3: "CHAN_ONLY", + 4: "CHAN_AND_ORG", + 5: "CHAN_OR_ORG", + } + GossipMessage_Tag_value = map[string]int32{ + "UNDEFINED": 0, + "EMPTY": 1, + "ORG_ONLY": 2, + "CHAN_ONLY": 3, + "CHAN_AND_ORG": 4, + "CHAN_OR_ORG": 5, + } +) + +func (x GossipMessage_Tag) Enum() *GossipMessage_Tag { + p := new(GossipMessage_Tag) + *p = x + return p +} + +func (x GossipMessage_Tag) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (GossipMessage_Tag) Descriptor() protoreflect.EnumDescriptor { + return file_gossip_message_proto_enumTypes[1].Descriptor() +} + +func (GossipMessage_Tag) Type() protoreflect.EnumType { + return &file_gossip_message_proto_enumTypes[1] +} + +func (x GossipMessage_Tag) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use GossipMessage_Tag.Descriptor instead. +func (GossipMessage_Tag) EnumDescriptor() ([]byte, []int) { + return file_gossip_message_proto_rawDescGZIP(), []int{3, 0} +} + +// Envelope contains a marshalled +// GossipMessage and a signature over it. +// It may also contain a SecretEnvelope +// which is a marshalled Secret +type Envelope struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Payload []byte `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"` + Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` + SecretEnvelope *SecretEnvelope `protobuf:"bytes,3,opt,name=secret_envelope,json=secretEnvelope,proto3" json:"secret_envelope,omitempty"` +} + +func (x *Envelope) Reset() { + *x = Envelope{} + if protoimpl.UnsafeEnabled { + mi := &file_gossip_message_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Envelope) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Envelope) ProtoMessage() {} + +func (x *Envelope) ProtoReflect() protoreflect.Message { + mi := &file_gossip_message_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Envelope.ProtoReflect.Descriptor instead. +func (*Envelope) Descriptor() ([]byte, []int) { + return file_gossip_message_proto_rawDescGZIP(), []int{0} +} + +func (x *Envelope) GetPayload() []byte { + if x != nil { + return x.Payload + } + return nil +} + +func (x *Envelope) GetSignature() []byte { + if x != nil { + return x.Signature + } + return nil +} + +func (x *Envelope) GetSecretEnvelope() *SecretEnvelope { + if x != nil { + return x.SecretEnvelope + } + return nil +} + +// SecretEnvelope is a marshalled Secret +// and a signature over it. +// The signature should be validated by the peer +// that signed the Envelope the SecretEnvelope +// came with +type SecretEnvelope struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Payload []byte `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"` + Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` +} + +func (x *SecretEnvelope) Reset() { + *x = SecretEnvelope{} + if protoimpl.UnsafeEnabled { + mi := &file_gossip_message_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SecretEnvelope) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SecretEnvelope) ProtoMessage() {} + +func (x *SecretEnvelope) ProtoReflect() protoreflect.Message { + mi := &file_gossip_message_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SecretEnvelope.ProtoReflect.Descriptor instead. +func (*SecretEnvelope) Descriptor() ([]byte, []int) { + return file_gossip_message_proto_rawDescGZIP(), []int{1} +} + +func (x *SecretEnvelope) GetPayload() []byte { + if x != nil { + return x.Payload + } + return nil +} + +func (x *SecretEnvelope) GetSignature() []byte { + if x != nil { + return x.Signature + } + return nil +} + +// Secret is an entity that might be omitted +// from an Envelope when the remote peer that is receiving +// the Envelope shouldn't know the secret's content. +type Secret struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Content: + // + // *Secret_InternalEndpoint + Content isSecret_Content `protobuf_oneof:"content"` +} + +func (x *Secret) Reset() { + *x = Secret{} + if protoimpl.UnsafeEnabled { + mi := &file_gossip_message_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Secret) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Secret) ProtoMessage() {} + +func (x *Secret) ProtoReflect() protoreflect.Message { + mi := &file_gossip_message_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Secret.ProtoReflect.Descriptor instead. +func (*Secret) Descriptor() ([]byte, []int) { + return file_gossip_message_proto_rawDescGZIP(), []int{2} +} + +func (m *Secret) GetContent() isSecret_Content { + if m != nil { + return m.Content + } + return nil +} + +func (x *Secret) GetInternalEndpoint() string { + if x, ok := x.GetContent().(*Secret_InternalEndpoint); ok { + return x.InternalEndpoint + } + return "" +} + +type isSecret_Content interface { + isSecret_Content() +} + +type Secret_InternalEndpoint struct { + InternalEndpoint string `protobuf:"bytes,1,opt,name=internalEndpoint,proto3,oneof"` +} + +func (*Secret_InternalEndpoint) isSecret_Content() {} + +// GossipMessage defines the message sent in a gossip network +type GossipMessage struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // used mainly for testing, but will might be used in the future + // for ensuring message delivery by acking + Nonce uint64 `protobuf:"varint,1,opt,name=nonce,proto3" json:"nonce,omitempty"` + // The channel of the message. + // Some GossipMessages may set this to nil, because + // they are cross-channels but some may not + Channel []byte `protobuf:"bytes,2,opt,name=channel,proto3" json:"channel,omitempty"` + // determines to which peers it is allowed + // to forward the message + Tag GossipMessage_Tag `protobuf:"varint,3,opt,name=tag,proto3,enum=gossip.GossipMessage_Tag" json:"tag,omitempty"` + // Types that are assignable to Content: + // + // *GossipMessage_AliveMsg + // *GossipMessage_MemReq + // *GossipMessage_MemRes + // *GossipMessage_DataMsg + // *GossipMessage_Hello + // *GossipMessage_DataDig + // *GossipMessage_DataReq + // *GossipMessage_DataUpdate + // *GossipMessage_Empty + // *GossipMessage_Conn + // *GossipMessage_StateInfo + // *GossipMessage_StateSnapshot + // *GossipMessage_StateInfoPullReq + // *GossipMessage_StateRequest + // *GossipMessage_StateResponse + // *GossipMessage_LeadershipMsg + // *GossipMessage_PeerIdentity + // *GossipMessage_Ack + // *GossipMessage_PrivateReq + // *GossipMessage_PrivateRes + // *GossipMessage_PrivateData + Content isGossipMessage_Content `protobuf_oneof:"content"` +} + +func (x *GossipMessage) Reset() { + *x = GossipMessage{} + if protoimpl.UnsafeEnabled { + mi := &file_gossip_message_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GossipMessage) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GossipMessage) ProtoMessage() {} + +func (x *GossipMessage) ProtoReflect() protoreflect.Message { + mi := &file_gossip_message_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GossipMessage.ProtoReflect.Descriptor instead. +func (*GossipMessage) Descriptor() ([]byte, []int) { + return file_gossip_message_proto_rawDescGZIP(), []int{3} +} + +func (x *GossipMessage) GetNonce() uint64 { + if x != nil { + return x.Nonce + } + return 0 +} + +func (x *GossipMessage) GetChannel() []byte { + if x != nil { + return x.Channel + } + return nil +} + +func (x *GossipMessage) GetTag() GossipMessage_Tag { + if x != nil { + return x.Tag + } + return GossipMessage_UNDEFINED +} + +func (m *GossipMessage) GetContent() isGossipMessage_Content { + if m != nil { + return m.Content + } + return nil +} + +func (x *GossipMessage) GetAliveMsg() *AliveMessage { + if x, ok := x.GetContent().(*GossipMessage_AliveMsg); ok { + return x.AliveMsg + } + return nil +} + +func (x *GossipMessage) GetMemReq() *MembershipRequest { + if x, ok := x.GetContent().(*GossipMessage_MemReq); ok { + return x.MemReq + } + return nil +} + +func (x *GossipMessage) GetMemRes() *MembershipResponse { + if x, ok := x.GetContent().(*GossipMessage_MemRes); ok { + return x.MemRes + } + return nil +} + +func (x *GossipMessage) GetDataMsg() *DataMessage { + if x, ok := x.GetContent().(*GossipMessage_DataMsg); ok { + return x.DataMsg + } + return nil +} + +func (x *GossipMessage) GetHello() *GossipHello { + if x, ok := x.GetContent().(*GossipMessage_Hello); ok { + return x.Hello + } + return nil +} + +func (x *GossipMessage) GetDataDig() *DataDigest { + if x, ok := x.GetContent().(*GossipMessage_DataDig); ok { + return x.DataDig + } + return nil +} + +func (x *GossipMessage) GetDataReq() *DataRequest { + if x, ok := x.GetContent().(*GossipMessage_DataReq); ok { + return x.DataReq + } + return nil +} + +func (x *GossipMessage) GetDataUpdate() *DataUpdate { + if x, ok := x.GetContent().(*GossipMessage_DataUpdate); ok { + return x.DataUpdate + } + return nil +} + +func (x *GossipMessage) GetEmpty() *Empty { + if x, ok := x.GetContent().(*GossipMessage_Empty); ok { + return x.Empty + } + return nil +} + +func (x *GossipMessage) GetConn() *ConnEstablish { + if x, ok := x.GetContent().(*GossipMessage_Conn); ok { + return x.Conn + } + return nil +} + +func (x *GossipMessage) GetStateInfo() *StateInfo { + if x, ok := x.GetContent().(*GossipMessage_StateInfo); ok { + return x.StateInfo + } + return nil +} + +func (x *GossipMessage) GetStateSnapshot() *StateInfoSnapshot { + if x, ok := x.GetContent().(*GossipMessage_StateSnapshot); ok { + return x.StateSnapshot + } + return nil +} + +func (x *GossipMessage) GetStateInfoPullReq() *StateInfoPullRequest { + if x, ok := x.GetContent().(*GossipMessage_StateInfoPullReq); ok { + return x.StateInfoPullReq + } + return nil +} + +func (x *GossipMessage) GetStateRequest() *RemoteStateRequest { + if x, ok := x.GetContent().(*GossipMessage_StateRequest); ok { + return x.StateRequest + } + return nil +} + +func (x *GossipMessage) GetStateResponse() *RemoteStateResponse { + if x, ok := x.GetContent().(*GossipMessage_StateResponse); ok { + return x.StateResponse + } + return nil +} + +func (x *GossipMessage) GetLeadershipMsg() *LeadershipMessage { + if x, ok := x.GetContent().(*GossipMessage_LeadershipMsg); ok { + return x.LeadershipMsg + } + return nil +} + +func (x *GossipMessage) GetPeerIdentity() *PeerIdentity { + if x, ok := x.GetContent().(*GossipMessage_PeerIdentity); ok { + return x.PeerIdentity + } + return nil +} + +func (x *GossipMessage) GetAck() *Acknowledgement { + if x, ok := x.GetContent().(*GossipMessage_Ack); ok { + return x.Ack + } + return nil +} + +func (x *GossipMessage) GetPrivateReq() *RemotePvtDataRequest { + if x, ok := x.GetContent().(*GossipMessage_PrivateReq); ok { + return x.PrivateReq + } + return nil +} + +func (x *GossipMessage) GetPrivateRes() *RemotePvtDataResponse { + if x, ok := x.GetContent().(*GossipMessage_PrivateRes); ok { + return x.PrivateRes + } + return nil +} + +func (x *GossipMessage) GetPrivateData() *PrivateDataMessage { + if x, ok := x.GetContent().(*GossipMessage_PrivateData); ok { + return x.PrivateData + } + return nil +} + +type isGossipMessage_Content interface { + isGossipMessage_Content() +} + +type GossipMessage_AliveMsg struct { + // Membership + AliveMsg *AliveMessage `protobuf:"bytes,5,opt,name=alive_msg,json=aliveMsg,proto3,oneof"` +} + +type GossipMessage_MemReq struct { + MemReq *MembershipRequest `protobuf:"bytes,6,opt,name=mem_req,json=memReq,proto3,oneof"` +} + +type GossipMessage_MemRes struct { + MemRes *MembershipResponse `protobuf:"bytes,7,opt,name=mem_res,json=memRes,proto3,oneof"` +} + +type GossipMessage_DataMsg struct { + // Contains a ledger block + DataMsg *DataMessage `protobuf:"bytes,8,opt,name=data_msg,json=dataMsg,proto3,oneof"` +} + +type GossipMessage_Hello struct { + // Used for push&pull + Hello *GossipHello `protobuf:"bytes,9,opt,name=hello,proto3,oneof"` +} + +type GossipMessage_DataDig struct { + DataDig *DataDigest `protobuf:"bytes,10,opt,name=data_dig,json=dataDig,proto3,oneof"` +} + +type GossipMessage_DataReq struct { + DataReq *DataRequest `protobuf:"bytes,11,opt,name=data_req,json=dataReq,proto3,oneof"` +} + +type GossipMessage_DataUpdate struct { + DataUpdate *DataUpdate `protobuf:"bytes,12,opt,name=data_update,json=dataUpdate,proto3,oneof"` +} + +type GossipMessage_Empty struct { + // Empty message, used for pinging + Empty *Empty `protobuf:"bytes,13,opt,name=empty,proto3,oneof"` +} + +type GossipMessage_Conn struct { + // ConnEstablish, used for establishing a connection + Conn *ConnEstablish `protobuf:"bytes,14,opt,name=conn,proto3,oneof"` +} + +type GossipMessage_StateInfo struct { + // Used for relaying information + // about state + StateInfo *StateInfo `protobuf:"bytes,15,opt,name=state_info,json=stateInfo,proto3,oneof"` +} + +type GossipMessage_StateSnapshot struct { + // Used for sending sets of StateInfo messages + StateSnapshot *StateInfoSnapshot `protobuf:"bytes,16,opt,name=state_snapshot,json=stateSnapshot,proto3,oneof"` +} + +type GossipMessage_StateInfoPullReq struct { + // Used for asking for StateInfoSnapshots + StateInfoPullReq *StateInfoPullRequest `protobuf:"bytes,17,opt,name=state_info_pull_req,json=stateInfoPullReq,proto3,oneof"` +} + +type GossipMessage_StateRequest struct { + // Used to ask from a remote peer a set of blocks + StateRequest *RemoteStateRequest `protobuf:"bytes,18,opt,name=state_request,json=stateRequest,proto3,oneof"` +} + +type GossipMessage_StateResponse struct { + // Used to send a set of blocks to a remote peer + StateResponse *RemoteStateResponse `protobuf:"bytes,19,opt,name=state_response,json=stateResponse,proto3,oneof"` +} + +type GossipMessage_LeadershipMsg struct { + // Used to indicate intent of peer to become leader + LeadershipMsg *LeadershipMessage `protobuf:"bytes,20,opt,name=leadership_msg,json=leadershipMsg,proto3,oneof"` +} + +type GossipMessage_PeerIdentity struct { + // Used to learn of a peer's certificate + PeerIdentity *PeerIdentity `protobuf:"bytes,21,opt,name=peer_identity,json=peerIdentity,proto3,oneof"` +} + +type GossipMessage_Ack struct { + Ack *Acknowledgement `protobuf:"bytes,22,opt,name=ack,proto3,oneof"` +} + +type GossipMessage_PrivateReq struct { + // Used to request private data + PrivateReq *RemotePvtDataRequest `protobuf:"bytes,23,opt,name=privateReq,proto3,oneof"` +} + +type GossipMessage_PrivateRes struct { + // Used to respond to private data requests + PrivateRes *RemotePvtDataResponse `protobuf:"bytes,24,opt,name=privateRes,proto3,oneof"` +} + +type GossipMessage_PrivateData struct { + // Encapsulates private data used to distribute + // private rwset after the endorsement + PrivateData *PrivateDataMessage `protobuf:"bytes,25,opt,name=private_data,json=privateData,proto3,oneof"` +} + +func (*GossipMessage_AliveMsg) isGossipMessage_Content() {} + +func (*GossipMessage_MemReq) isGossipMessage_Content() {} + +func (*GossipMessage_MemRes) isGossipMessage_Content() {} + +func (*GossipMessage_DataMsg) isGossipMessage_Content() {} + +func (*GossipMessage_Hello) isGossipMessage_Content() {} + +func (*GossipMessage_DataDig) isGossipMessage_Content() {} + +func (*GossipMessage_DataReq) isGossipMessage_Content() {} + +func (*GossipMessage_DataUpdate) isGossipMessage_Content() {} + +func (*GossipMessage_Empty) isGossipMessage_Content() {} + +func (*GossipMessage_Conn) isGossipMessage_Content() {} + +func (*GossipMessage_StateInfo) isGossipMessage_Content() {} + +func (*GossipMessage_StateSnapshot) isGossipMessage_Content() {} + +func (*GossipMessage_StateInfoPullReq) isGossipMessage_Content() {} + +func (*GossipMessage_StateRequest) isGossipMessage_Content() {} + +func (*GossipMessage_StateResponse) isGossipMessage_Content() {} + +func (*GossipMessage_LeadershipMsg) isGossipMessage_Content() {} + +func (*GossipMessage_PeerIdentity) isGossipMessage_Content() {} + +func (*GossipMessage_Ack) isGossipMessage_Content() {} + +func (*GossipMessage_PrivateReq) isGossipMessage_Content() {} + +func (*GossipMessage_PrivateRes) isGossipMessage_Content() {} + +func (*GossipMessage_PrivateData) isGossipMessage_Content() {} + +// StateInfo is used for a peer to relay its state information +// to other peers +type StateInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Timestamp *PeerTime `protobuf:"bytes,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + PkiId []byte `protobuf:"bytes,3,opt,name=pki_id,json=pkiId,proto3" json:"pki_id,omitempty"` + // channel_MAC is an authentication code that proves + // that the peer that sent this message knows + // the name of the channel. + Channel_MAC []byte `protobuf:"bytes,4,opt,name=channel_MAC,json=channelMAC,proto3" json:"channel_MAC,omitempty"` + Properties *Properties `protobuf:"bytes,5,opt,name=properties,proto3" json:"properties,omitempty"` +} + +func (x *StateInfo) Reset() { + *x = StateInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_gossip_message_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StateInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StateInfo) ProtoMessage() {} + +func (x *StateInfo) ProtoReflect() protoreflect.Message { + mi := &file_gossip_message_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StateInfo.ProtoReflect.Descriptor instead. +func (*StateInfo) Descriptor() ([]byte, []int) { + return file_gossip_message_proto_rawDescGZIP(), []int{4} +} + +func (x *StateInfo) GetTimestamp() *PeerTime { + if x != nil { + return x.Timestamp + } + return nil +} + +func (x *StateInfo) GetPkiId() []byte { + if x != nil { + return x.PkiId + } + return nil +} + +func (x *StateInfo) GetChannel_MAC() []byte { + if x != nil { + return x.Channel_MAC + } + return nil +} + +func (x *StateInfo) GetProperties() *Properties { + if x != nil { + return x.Properties + } + return nil +} + +type Properties struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + LedgerHeight uint64 `protobuf:"varint,1,opt,name=ledger_height,json=ledgerHeight,proto3" json:"ledger_height,omitempty"` + LeftChannel bool `protobuf:"varint,2,opt,name=left_channel,json=leftChannel,proto3" json:"left_channel,omitempty"` + Chaincodes []*Chaincode `protobuf:"bytes,3,rep,name=chaincodes,proto3" json:"chaincodes,omitempty"` +} + +func (x *Properties) Reset() { + *x = Properties{} + if protoimpl.UnsafeEnabled { + mi := &file_gossip_message_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Properties) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Properties) ProtoMessage() {} + +func (x *Properties) ProtoReflect() protoreflect.Message { + mi := &file_gossip_message_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Properties.ProtoReflect.Descriptor instead. +func (*Properties) Descriptor() ([]byte, []int) { + return file_gossip_message_proto_rawDescGZIP(), []int{5} +} + +func (x *Properties) GetLedgerHeight() uint64 { + if x != nil { + return x.LedgerHeight + } + return 0 +} + +func (x *Properties) GetLeftChannel() bool { + if x != nil { + return x.LeftChannel + } + return false +} + +func (x *Properties) GetChaincodes() []*Chaincode { + if x != nil { + return x.Chaincodes + } + return nil +} + +// StateInfoSnapshot is an aggregation of StateInfo messages +type StateInfoSnapshot struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Elements []*Envelope `protobuf:"bytes,1,rep,name=elements,proto3" json:"elements,omitempty"` +} + +func (x *StateInfoSnapshot) Reset() { + *x = StateInfoSnapshot{} + if protoimpl.UnsafeEnabled { + mi := &file_gossip_message_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StateInfoSnapshot) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StateInfoSnapshot) ProtoMessage() {} + +func (x *StateInfoSnapshot) ProtoReflect() protoreflect.Message { + mi := &file_gossip_message_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StateInfoSnapshot.ProtoReflect.Descriptor instead. +func (*StateInfoSnapshot) Descriptor() ([]byte, []int) { + return file_gossip_message_proto_rawDescGZIP(), []int{6} +} + +func (x *StateInfoSnapshot) GetElements() []*Envelope { + if x != nil { + return x.Elements + } + return nil +} + +// StateInfoPullRequest is used to fetch a StateInfoSnapshot +// from a remote peer +type StateInfoPullRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // channel_MAC is an authentication code that proves + // that the peer that sent this message knows + // the name of the channel. + Channel_MAC []byte `protobuf:"bytes,1,opt,name=channel_MAC,json=channelMAC,proto3" json:"channel_MAC,omitempty"` +} + +func (x *StateInfoPullRequest) Reset() { + *x = StateInfoPullRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_gossip_message_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StateInfoPullRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StateInfoPullRequest) ProtoMessage() {} + +func (x *StateInfoPullRequest) ProtoReflect() protoreflect.Message { + mi := &file_gossip_message_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StateInfoPullRequest.ProtoReflect.Descriptor instead. +func (*StateInfoPullRequest) Descriptor() ([]byte, []int) { + return file_gossip_message_proto_rawDescGZIP(), []int{7} +} + +func (x *StateInfoPullRequest) GetChannel_MAC() []byte { + if x != nil { + return x.Channel_MAC + } + return nil +} + +// ConnEstablish is the message used for the gossip handshake +// Whenever a peer connects to another peer, it handshakes +// with it by sending this message that proves its identity +type ConnEstablish struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PkiId []byte `protobuf:"bytes,1,opt,name=pki_id,json=pkiId,proto3" json:"pki_id,omitempty"` + Identity []byte `protobuf:"bytes,2,opt,name=identity,proto3" json:"identity,omitempty"` + TlsCertHash []byte `protobuf:"bytes,3,opt,name=tls_cert_hash,json=tlsCertHash,proto3" json:"tls_cert_hash,omitempty"` + Probe bool `protobuf:"varint,4,opt,name=probe,proto3" json:"probe,omitempty"` +} + +func (x *ConnEstablish) Reset() { + *x = ConnEstablish{} + if protoimpl.UnsafeEnabled { + mi := &file_gossip_message_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ConnEstablish) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ConnEstablish) ProtoMessage() {} + +func (x *ConnEstablish) ProtoReflect() protoreflect.Message { + mi := &file_gossip_message_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ConnEstablish.ProtoReflect.Descriptor instead. +func (*ConnEstablish) Descriptor() ([]byte, []int) { + return file_gossip_message_proto_rawDescGZIP(), []int{8} +} + +func (x *ConnEstablish) GetPkiId() []byte { + if x != nil { + return x.PkiId + } + return nil +} + +func (x *ConnEstablish) GetIdentity() []byte { + if x != nil { + return x.Identity + } + return nil +} + +func (x *ConnEstablish) GetTlsCertHash() []byte { + if x != nil { + return x.TlsCertHash + } + return nil +} + +func (x *ConnEstablish) GetProbe() bool { + if x != nil { + return x.Probe + } + return false +} + +// PeerIdentity defines the identity of the peer +// Used to make other peers learn of the identity +// of a certain peer +type PeerIdentity struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PkiId []byte `protobuf:"bytes,1,opt,name=pki_id,json=pkiId,proto3" json:"pki_id,omitempty"` + Cert []byte `protobuf:"bytes,2,opt,name=cert,proto3" json:"cert,omitempty"` + Metadata []byte `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"` +} + +func (x *PeerIdentity) Reset() { + *x = PeerIdentity{} + if protoimpl.UnsafeEnabled { + mi := &file_gossip_message_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PeerIdentity) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PeerIdentity) ProtoMessage() {} + +func (x *PeerIdentity) ProtoReflect() protoreflect.Message { + mi := &file_gossip_message_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PeerIdentity.ProtoReflect.Descriptor instead. +func (*PeerIdentity) Descriptor() ([]byte, []int) { + return file_gossip_message_proto_rawDescGZIP(), []int{9} +} + +func (x *PeerIdentity) GetPkiId() []byte { + if x != nil { + return x.PkiId + } + return nil +} + +func (x *PeerIdentity) GetCert() []byte { + if x != nil { + return x.Cert + } + return nil +} + +func (x *PeerIdentity) GetMetadata() []byte { + if x != nil { + return x.Metadata + } + return nil +} + +// DataRequest is a message used for a peer to request +// certain data blocks from a remote peer +type DataRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Nonce uint64 `protobuf:"varint,1,opt,name=nonce,proto3" json:"nonce,omitempty"` + Digests [][]byte `protobuf:"bytes,2,rep,name=digests,proto3" json:"digests,omitempty"` + MsgType PullMsgType `protobuf:"varint,3,opt,name=msg_type,json=msgType,proto3,enum=gossip.PullMsgType" json:"msg_type,omitempty"` +} + +func (x *DataRequest) Reset() { + *x = DataRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_gossip_message_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DataRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DataRequest) ProtoMessage() {} + +func (x *DataRequest) ProtoReflect() protoreflect.Message { + mi := &file_gossip_message_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DataRequest.ProtoReflect.Descriptor instead. +func (*DataRequest) Descriptor() ([]byte, []int) { + return file_gossip_message_proto_rawDescGZIP(), []int{10} +} + +func (x *DataRequest) GetNonce() uint64 { + if x != nil { + return x.Nonce + } + return 0 +} + +func (x *DataRequest) GetDigests() [][]byte { + if x != nil { + return x.Digests + } + return nil +} + +func (x *DataRequest) GetMsgType() PullMsgType { + if x != nil { + return x.MsgType + } + return PullMsgType_UNDEFINED +} + +// GossipHello is the message that is used for the peer to initiate +// a pull round with another peer +type GossipHello struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Nonce uint64 `protobuf:"varint,1,opt,name=nonce,proto3" json:"nonce,omitempty"` + Metadata []byte `protobuf:"bytes,2,opt,name=metadata,proto3" json:"metadata,omitempty"` + MsgType PullMsgType `protobuf:"varint,3,opt,name=msg_type,json=msgType,proto3,enum=gossip.PullMsgType" json:"msg_type,omitempty"` +} + +func (x *GossipHello) Reset() { + *x = GossipHello{} + if protoimpl.UnsafeEnabled { + mi := &file_gossip_message_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GossipHello) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GossipHello) ProtoMessage() {} + +func (x *GossipHello) ProtoReflect() protoreflect.Message { + mi := &file_gossip_message_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GossipHello.ProtoReflect.Descriptor instead. +func (*GossipHello) Descriptor() ([]byte, []int) { + return file_gossip_message_proto_rawDescGZIP(), []int{11} +} + +func (x *GossipHello) GetNonce() uint64 { + if x != nil { + return x.Nonce + } + return 0 +} + +func (x *GossipHello) GetMetadata() []byte { + if x != nil { + return x.Metadata + } + return nil +} + +func (x *GossipHello) GetMsgType() PullMsgType { + if x != nil { + return x.MsgType + } + return PullMsgType_UNDEFINED +} + +// DataUpdate is the final message in the pull phase +// sent from the receiver to the initiator +type DataUpdate struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Nonce uint64 `protobuf:"varint,1,opt,name=nonce,proto3" json:"nonce,omitempty"` + Data []*Envelope `protobuf:"bytes,2,rep,name=data,proto3" json:"data,omitempty"` + MsgType PullMsgType `protobuf:"varint,3,opt,name=msg_type,json=msgType,proto3,enum=gossip.PullMsgType" json:"msg_type,omitempty"` +} + +func (x *DataUpdate) Reset() { + *x = DataUpdate{} + if protoimpl.UnsafeEnabled { + mi := &file_gossip_message_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DataUpdate) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DataUpdate) ProtoMessage() {} + +func (x *DataUpdate) ProtoReflect() protoreflect.Message { + mi := &file_gossip_message_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DataUpdate.ProtoReflect.Descriptor instead. +func (*DataUpdate) Descriptor() ([]byte, []int) { + return file_gossip_message_proto_rawDescGZIP(), []int{12} +} + +func (x *DataUpdate) GetNonce() uint64 { + if x != nil { + return x.Nonce + } + return 0 +} + +func (x *DataUpdate) GetData() []*Envelope { + if x != nil { + return x.Data + } + return nil +} + +func (x *DataUpdate) GetMsgType() PullMsgType { + if x != nil { + return x.MsgType + } + return PullMsgType_UNDEFINED +} + +// DataDigest is the message sent from the receiver peer +// to the initator peer and contains the data items it has +type DataDigest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Nonce uint64 `protobuf:"varint,1,opt,name=nonce,proto3" json:"nonce,omitempty"` + Digests [][]byte `protobuf:"bytes,2,rep,name=digests,proto3" json:"digests,omitempty"` // Maybe change this to bitmap later on + MsgType PullMsgType `protobuf:"varint,3,opt,name=msg_type,json=msgType,proto3,enum=gossip.PullMsgType" json:"msg_type,omitempty"` +} + +func (x *DataDigest) Reset() { + *x = DataDigest{} + if protoimpl.UnsafeEnabled { + mi := &file_gossip_message_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DataDigest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DataDigest) ProtoMessage() {} + +func (x *DataDigest) ProtoReflect() protoreflect.Message { + mi := &file_gossip_message_proto_msgTypes[13] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DataDigest.ProtoReflect.Descriptor instead. +func (*DataDigest) Descriptor() ([]byte, []int) { + return file_gossip_message_proto_rawDescGZIP(), []int{13} +} + +func (x *DataDigest) GetNonce() uint64 { + if x != nil { + return x.Nonce + } + return 0 +} + +func (x *DataDigest) GetDigests() [][]byte { + if x != nil { + return x.Digests + } + return nil +} + +func (x *DataDigest) GetMsgType() PullMsgType { + if x != nil { + return x.MsgType + } + return PullMsgType_UNDEFINED +} + +// DataMessage is the message that contains a block +type DataMessage struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Payload *Payload `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"` +} + +func (x *DataMessage) Reset() { + *x = DataMessage{} + if protoimpl.UnsafeEnabled { + mi := &file_gossip_message_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DataMessage) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DataMessage) ProtoMessage() {} + +func (x *DataMessage) ProtoReflect() protoreflect.Message { + mi := &file_gossip_message_proto_msgTypes[14] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DataMessage.ProtoReflect.Descriptor instead. +func (*DataMessage) Descriptor() ([]byte, []int) { + return file_gossip_message_proto_rawDescGZIP(), []int{14} +} + +func (x *DataMessage) GetPayload() *Payload { + if x != nil { + return x.Payload + } + return nil +} + +// PrivateDataMessage message which includes private +// data information to distributed once transaction +// has been endorsed +type PrivateDataMessage struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Payload *PrivatePayload `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"` +} + +func (x *PrivateDataMessage) Reset() { + *x = PrivateDataMessage{} + if protoimpl.UnsafeEnabled { + mi := &file_gossip_message_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PrivateDataMessage) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PrivateDataMessage) ProtoMessage() {} + +func (x *PrivateDataMessage) ProtoReflect() protoreflect.Message { + mi := &file_gossip_message_proto_msgTypes[15] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PrivateDataMessage.ProtoReflect.Descriptor instead. +func (*PrivateDataMessage) Descriptor() ([]byte, []int) { + return file_gossip_message_proto_rawDescGZIP(), []int{15} +} + +func (x *PrivateDataMessage) GetPayload() *PrivatePayload { + if x != nil { + return x.Payload + } + return nil +} + +// Payload contains a block +type Payload struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + SeqNum uint64 `protobuf:"varint,1,opt,name=seq_num,json=seqNum,proto3" json:"seq_num,omitempty"` + Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` + PrivateData [][]byte `protobuf:"bytes,3,rep,name=private_data,json=privateData,proto3" json:"private_data,omitempty"` +} + +func (x *Payload) Reset() { + *x = Payload{} + if protoimpl.UnsafeEnabled { + mi := &file_gossip_message_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Payload) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Payload) ProtoMessage() {} + +func (x *Payload) ProtoReflect() protoreflect.Message { + mi := &file_gossip_message_proto_msgTypes[16] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Payload.ProtoReflect.Descriptor instead. +func (*Payload) Descriptor() ([]byte, []int) { + return file_gossip_message_proto_rawDescGZIP(), []int{16} +} + +func (x *Payload) GetSeqNum() uint64 { + if x != nil { + return x.SeqNum + } + return 0 +} + +func (x *Payload) GetData() []byte { + if x != nil { + return x.Data + } + return nil +} + +func (x *Payload) GetPrivateData() [][]byte { + if x != nil { + return x.PrivateData + } + return nil +} + +// PrivatePayload payload to encapsulate private +// data with collection name to enable routing +// based on collection partitioning +type PrivatePayload struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CollectionName string `protobuf:"bytes,1,opt,name=collection_name,json=collectionName,proto3" json:"collection_name,omitempty"` + Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"` + TxId string `protobuf:"bytes,3,opt,name=tx_id,json=txId,proto3" json:"tx_id,omitempty"` + PrivateRwset []byte `protobuf:"bytes,4,opt,name=private_rwset,json=privateRwset,proto3" json:"private_rwset,omitempty"` + PrivateSimHeight uint64 `protobuf:"varint,5,opt,name=private_sim_height,json=privateSimHeight,proto3" json:"private_sim_height,omitempty"` + CollectionConfigs *peer.CollectionConfigPackage `protobuf:"bytes,6,opt,name=collection_configs,json=collectionConfigs,proto3" json:"collection_configs,omitempty"` +} + +func (x *PrivatePayload) Reset() { + *x = PrivatePayload{} + if protoimpl.UnsafeEnabled { + mi := &file_gossip_message_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PrivatePayload) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PrivatePayload) ProtoMessage() {} + +func (x *PrivatePayload) ProtoReflect() protoreflect.Message { + mi := &file_gossip_message_proto_msgTypes[17] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PrivatePayload.ProtoReflect.Descriptor instead. +func (*PrivatePayload) Descriptor() ([]byte, []int) { + return file_gossip_message_proto_rawDescGZIP(), []int{17} +} + +func (x *PrivatePayload) GetCollectionName() string { + if x != nil { + return x.CollectionName + } + return "" +} + +func (x *PrivatePayload) GetNamespace() string { + if x != nil { + return x.Namespace + } + return "" +} + +func (x *PrivatePayload) GetTxId() string { + if x != nil { + return x.TxId + } + return "" +} + +func (x *PrivatePayload) GetPrivateRwset() []byte { + if x != nil { + return x.PrivateRwset + } + return nil +} + +func (x *PrivatePayload) GetPrivateSimHeight() uint64 { + if x != nil { + return x.PrivateSimHeight + } + return 0 +} + +func (x *PrivatePayload) GetCollectionConfigs() *peer.CollectionConfigPackage { + if x != nil { + return x.CollectionConfigs + } + return nil +} + +// AliveMessage is sent to inform remote peers +// of a peer's existence and activity +type AliveMessage struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Membership *Member `protobuf:"bytes,1,opt,name=membership,proto3" json:"membership,omitempty"` + Timestamp *PeerTime `protobuf:"bytes,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + Identity []byte `protobuf:"bytes,4,opt,name=identity,proto3" json:"identity,omitempty"` +} + +func (x *AliveMessage) Reset() { + *x = AliveMessage{} + if protoimpl.UnsafeEnabled { + mi := &file_gossip_message_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AliveMessage) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AliveMessage) ProtoMessage() {} + +func (x *AliveMessage) ProtoReflect() protoreflect.Message { + mi := &file_gossip_message_proto_msgTypes[18] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AliveMessage.ProtoReflect.Descriptor instead. +func (*AliveMessage) Descriptor() ([]byte, []int) { + return file_gossip_message_proto_rawDescGZIP(), []int{18} +} + +func (x *AliveMessage) GetMembership() *Member { + if x != nil { + return x.Membership + } + return nil +} + +func (x *AliveMessage) GetTimestamp() *PeerTime { + if x != nil { + return x.Timestamp + } + return nil +} + +func (x *AliveMessage) GetIdentity() []byte { + if x != nil { + return x.Identity + } + return nil +} + +// Leadership Message is sent during leader election to inform +// remote peers about intent of peer to proclaim itself as leader +type LeadershipMessage struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PkiId []byte `protobuf:"bytes,1,opt,name=pki_id,json=pkiId,proto3" json:"pki_id,omitempty"` + Timestamp *PeerTime `protobuf:"bytes,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + IsDeclaration bool `protobuf:"varint,3,opt,name=is_declaration,json=isDeclaration,proto3" json:"is_declaration,omitempty"` +} + +func (x *LeadershipMessage) Reset() { + *x = LeadershipMessage{} + if protoimpl.UnsafeEnabled { + mi := &file_gossip_message_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LeadershipMessage) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LeadershipMessage) ProtoMessage() {} + +func (x *LeadershipMessage) ProtoReflect() protoreflect.Message { + mi := &file_gossip_message_proto_msgTypes[19] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LeadershipMessage.ProtoReflect.Descriptor instead. +func (*LeadershipMessage) Descriptor() ([]byte, []int) { + return file_gossip_message_proto_rawDescGZIP(), []int{19} +} + +func (x *LeadershipMessage) GetPkiId() []byte { + if x != nil { + return x.PkiId + } + return nil +} + +func (x *LeadershipMessage) GetTimestamp() *PeerTime { + if x != nil { + return x.Timestamp + } + return nil +} + +func (x *LeadershipMessage) GetIsDeclaration() bool { + if x != nil { + return x.IsDeclaration + } + return false +} + +// PeerTime defines the logical time of a peer's life +type PeerTime struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + IncNum uint64 `protobuf:"varint,1,opt,name=inc_num,json=incNum,proto3" json:"inc_num,omitempty"` + SeqNum uint64 `protobuf:"varint,2,opt,name=seq_num,json=seqNum,proto3" json:"seq_num,omitempty"` +} + +func (x *PeerTime) Reset() { + *x = PeerTime{} + if protoimpl.UnsafeEnabled { + mi := &file_gossip_message_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PeerTime) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PeerTime) ProtoMessage() {} + +func (x *PeerTime) ProtoReflect() protoreflect.Message { + mi := &file_gossip_message_proto_msgTypes[20] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PeerTime.ProtoReflect.Descriptor instead. +func (*PeerTime) Descriptor() ([]byte, []int) { + return file_gossip_message_proto_rawDescGZIP(), []int{20} +} + +func (x *PeerTime) GetIncNum() uint64 { + if x != nil { + return x.IncNum + } + return 0 +} + +func (x *PeerTime) GetSeqNum() uint64 { + if x != nil { + return x.SeqNum + } + return 0 +} + +// MembershipRequest is used to ask membership information +// from a remote peer +type MembershipRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + SelfInformation *Envelope `protobuf:"bytes,1,opt,name=self_information,json=selfInformation,proto3" json:"self_information,omitempty"` + Known [][]byte `protobuf:"bytes,2,rep,name=known,proto3" json:"known,omitempty"` +} + +func (x *MembershipRequest) Reset() { + *x = MembershipRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_gossip_message_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MembershipRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MembershipRequest) ProtoMessage() {} + +func (x *MembershipRequest) ProtoReflect() protoreflect.Message { + mi := &file_gossip_message_proto_msgTypes[21] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MembershipRequest.ProtoReflect.Descriptor instead. +func (*MembershipRequest) Descriptor() ([]byte, []int) { + return file_gossip_message_proto_rawDescGZIP(), []int{21} +} + +func (x *MembershipRequest) GetSelfInformation() *Envelope { + if x != nil { + return x.SelfInformation + } + return nil +} + +func (x *MembershipRequest) GetKnown() [][]byte { + if x != nil { + return x.Known + } + return nil +} + +// MembershipResponse is used for replying to MembershipRequests +type MembershipResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Alive []*Envelope `protobuf:"bytes,1,rep,name=alive,proto3" json:"alive,omitempty"` + Dead []*Envelope `protobuf:"bytes,2,rep,name=dead,proto3" json:"dead,omitempty"` +} + +func (x *MembershipResponse) Reset() { + *x = MembershipResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_gossip_message_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MembershipResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MembershipResponse) ProtoMessage() {} + +func (x *MembershipResponse) ProtoReflect() protoreflect.Message { + mi := &file_gossip_message_proto_msgTypes[22] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MembershipResponse.ProtoReflect.Descriptor instead. +func (*MembershipResponse) Descriptor() ([]byte, []int) { + return file_gossip_message_proto_rawDescGZIP(), []int{22} +} + +func (x *MembershipResponse) GetAlive() []*Envelope { + if x != nil { + return x.Alive + } + return nil +} + +func (x *MembershipResponse) GetDead() []*Envelope { + if x != nil { + return x.Dead + } + return nil +} + +// Member holds membership-related information +// about a peer +type Member struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Endpoint string `protobuf:"bytes,1,opt,name=endpoint,proto3" json:"endpoint,omitempty"` + Metadata []byte `protobuf:"bytes,2,opt,name=metadata,proto3" json:"metadata,omitempty"` + PkiId []byte `protobuf:"bytes,3,opt,name=pki_id,json=pkiId,proto3" json:"pki_id,omitempty"` +} + +func (x *Member) Reset() { + *x = Member{} + if protoimpl.UnsafeEnabled { + mi := &file_gossip_message_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Member) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Member) ProtoMessage() {} + +func (x *Member) ProtoReflect() protoreflect.Message { + mi := &file_gossip_message_proto_msgTypes[23] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Member.ProtoReflect.Descriptor instead. +func (*Member) Descriptor() ([]byte, []int) { + return file_gossip_message_proto_rawDescGZIP(), []int{23} +} + +func (x *Member) GetEndpoint() string { + if x != nil { + return x.Endpoint + } + return "" +} + +func (x *Member) GetMetadata() []byte { + if x != nil { + return x.Metadata + } + return nil +} + +func (x *Member) GetPkiId() []byte { + if x != nil { + return x.PkiId + } + return nil +} + +// Empty is used for pinging and in tests +type Empty struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *Empty) Reset() { + *x = Empty{} + if protoimpl.UnsafeEnabled { + mi := &file_gossip_message_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Empty) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Empty) ProtoMessage() {} + +func (x *Empty) ProtoReflect() protoreflect.Message { + mi := &file_gossip_message_proto_msgTypes[24] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Empty.ProtoReflect.Descriptor instead. +func (*Empty) Descriptor() ([]byte, []int) { + return file_gossip_message_proto_rawDescGZIP(), []int{24} +} + +// RemoteStateRequest is used to ask a set of blocks +// from a remote peer +type RemoteStateRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + StartSeqNum uint64 `protobuf:"varint,1,opt,name=start_seq_num,json=startSeqNum,proto3" json:"start_seq_num,omitempty"` + EndSeqNum uint64 `protobuf:"varint,2,opt,name=end_seq_num,json=endSeqNum,proto3" json:"end_seq_num,omitempty"` +} + +func (x *RemoteStateRequest) Reset() { + *x = RemoteStateRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_gossip_message_proto_msgTypes[25] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RemoteStateRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RemoteStateRequest) ProtoMessage() {} + +func (x *RemoteStateRequest) ProtoReflect() protoreflect.Message { + mi := &file_gossip_message_proto_msgTypes[25] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RemoteStateRequest.ProtoReflect.Descriptor instead. +func (*RemoteStateRequest) Descriptor() ([]byte, []int) { + return file_gossip_message_proto_rawDescGZIP(), []int{25} +} + +func (x *RemoteStateRequest) GetStartSeqNum() uint64 { + if x != nil { + return x.StartSeqNum + } + return 0 +} + +func (x *RemoteStateRequest) GetEndSeqNum() uint64 { + if x != nil { + return x.EndSeqNum + } + return 0 +} + +// RemoteStateResponse is used to send a set of blocks +// to a remote peer +type RemoteStateResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Payloads []*Payload `protobuf:"bytes,1,rep,name=payloads,proto3" json:"payloads,omitempty"` +} + +func (x *RemoteStateResponse) Reset() { + *x = RemoteStateResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_gossip_message_proto_msgTypes[26] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RemoteStateResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RemoteStateResponse) ProtoMessage() {} + +func (x *RemoteStateResponse) ProtoReflect() protoreflect.Message { + mi := &file_gossip_message_proto_msgTypes[26] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RemoteStateResponse.ProtoReflect.Descriptor instead. +func (*RemoteStateResponse) Descriptor() ([]byte, []int) { + return file_gossip_message_proto_rawDescGZIP(), []int{26} +} + +func (x *RemoteStateResponse) GetPayloads() []*Payload { + if x != nil { + return x.Payloads + } + return nil +} + +// RemotePrivateDataRequest message used to request +// missing private rwset +type RemotePvtDataRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Digests []*PvtDataDigest `protobuf:"bytes,1,rep,name=digests,proto3" json:"digests,omitempty"` +} + +func (x *RemotePvtDataRequest) Reset() { + *x = RemotePvtDataRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_gossip_message_proto_msgTypes[27] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RemotePvtDataRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RemotePvtDataRequest) ProtoMessage() {} + +func (x *RemotePvtDataRequest) ProtoReflect() protoreflect.Message { + mi := &file_gossip_message_proto_msgTypes[27] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RemotePvtDataRequest.ProtoReflect.Descriptor instead. +func (*RemotePvtDataRequest) Descriptor() ([]byte, []int) { + return file_gossip_message_proto_rawDescGZIP(), []int{27} +} + +func (x *RemotePvtDataRequest) GetDigests() []*PvtDataDigest { + if x != nil { + return x.Digests + } + return nil +} + +// PvtDataDigest defines a digest of private data +type PvtDataDigest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TxId string `protobuf:"bytes,1,opt,name=tx_id,json=txId,proto3" json:"tx_id,omitempty"` + Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"` + Collection string `protobuf:"bytes,3,opt,name=collection,proto3" json:"collection,omitempty"` + BlockSeq uint64 `protobuf:"varint,4,opt,name=block_seq,json=blockSeq,proto3" json:"block_seq,omitempty"` + SeqInBlock uint64 `protobuf:"varint,5,opt,name=seq_in_block,json=seqInBlock,proto3" json:"seq_in_block,omitempty"` +} + +func (x *PvtDataDigest) Reset() { + *x = PvtDataDigest{} + if protoimpl.UnsafeEnabled { + mi := &file_gossip_message_proto_msgTypes[28] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PvtDataDigest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PvtDataDigest) ProtoMessage() {} + +func (x *PvtDataDigest) ProtoReflect() protoreflect.Message { + mi := &file_gossip_message_proto_msgTypes[28] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PvtDataDigest.ProtoReflect.Descriptor instead. +func (*PvtDataDigest) Descriptor() ([]byte, []int) { + return file_gossip_message_proto_rawDescGZIP(), []int{28} +} + +func (x *PvtDataDigest) GetTxId() string { + if x != nil { + return x.TxId + } + return "" +} + +func (x *PvtDataDigest) GetNamespace() string { + if x != nil { + return x.Namespace + } + return "" +} + +func (x *PvtDataDigest) GetCollection() string { + if x != nil { + return x.Collection + } + return "" +} + +func (x *PvtDataDigest) GetBlockSeq() uint64 { + if x != nil { + return x.BlockSeq + } + return 0 +} + +func (x *PvtDataDigest) GetSeqInBlock() uint64 { + if x != nil { + return x.SeqInBlock + } + return 0 +} + +// RemotePrivateData message to response on private +// data replication request +type RemotePvtDataResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Elements []*PvtDataElement `protobuf:"bytes,1,rep,name=elements,proto3" json:"elements,omitempty"` +} + +func (x *RemotePvtDataResponse) Reset() { + *x = RemotePvtDataResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_gossip_message_proto_msgTypes[29] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RemotePvtDataResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RemotePvtDataResponse) ProtoMessage() {} + +func (x *RemotePvtDataResponse) ProtoReflect() protoreflect.Message { + mi := &file_gossip_message_proto_msgTypes[29] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RemotePvtDataResponse.ProtoReflect.Descriptor instead. +func (*RemotePvtDataResponse) Descriptor() ([]byte, []int) { + return file_gossip_message_proto_rawDescGZIP(), []int{29} +} + +func (x *RemotePvtDataResponse) GetElements() []*PvtDataElement { + if x != nil { + return x.Elements + } + return nil +} + +type PvtDataElement struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Digest *PvtDataDigest `protobuf:"bytes,1,opt,name=digest,proto3" json:"digest,omitempty"` + // the payload is a marshaled kvrwset.KVRWSet + Payload [][]byte `protobuf:"bytes,2,rep,name=payload,proto3" json:"payload,omitempty"` +} + +func (x *PvtDataElement) Reset() { + *x = PvtDataElement{} + if protoimpl.UnsafeEnabled { + mi := &file_gossip_message_proto_msgTypes[30] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PvtDataElement) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PvtDataElement) ProtoMessage() {} + +func (x *PvtDataElement) ProtoReflect() protoreflect.Message { + mi := &file_gossip_message_proto_msgTypes[30] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PvtDataElement.ProtoReflect.Descriptor instead. +func (*PvtDataElement) Descriptor() ([]byte, []int) { + return file_gossip_message_proto_rawDescGZIP(), []int{30} +} + +func (x *PvtDataElement) GetDigest() *PvtDataDigest { + if x != nil { + return x.Digest + } + return nil +} + +func (x *PvtDataElement) GetPayload() [][]byte { + if x != nil { + return x.Payload + } + return nil +} + +// PvtPayload augments private rwset data and tx index +// inside the block +type PvtDataPayload struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TxSeqInBlock uint64 `protobuf:"varint,1,opt,name=tx_seq_in_block,json=txSeqInBlock,proto3" json:"tx_seq_in_block,omitempty"` + // Encodes marhslaed bytes of rwset.TxPvtReadWriteSet + // defined in rwset.proto + Payload []byte `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"` +} + +func (x *PvtDataPayload) Reset() { + *x = PvtDataPayload{} + if protoimpl.UnsafeEnabled { + mi := &file_gossip_message_proto_msgTypes[31] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PvtDataPayload) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PvtDataPayload) ProtoMessage() {} + +func (x *PvtDataPayload) ProtoReflect() protoreflect.Message { + mi := &file_gossip_message_proto_msgTypes[31] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PvtDataPayload.ProtoReflect.Descriptor instead. +func (*PvtDataPayload) Descriptor() ([]byte, []int) { + return file_gossip_message_proto_rawDescGZIP(), []int{31} +} + +func (x *PvtDataPayload) GetTxSeqInBlock() uint64 { + if x != nil { + return x.TxSeqInBlock + } + return 0 +} + +func (x *PvtDataPayload) GetPayload() []byte { + if x != nil { + return x.Payload + } + return nil +} + +type Acknowledgement struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Error string `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` +} + +func (x *Acknowledgement) Reset() { + *x = Acknowledgement{} + if protoimpl.UnsafeEnabled { + mi := &file_gossip_message_proto_msgTypes[32] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Acknowledgement) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Acknowledgement) ProtoMessage() {} + +func (x *Acknowledgement) ProtoReflect() protoreflect.Message { + mi := &file_gossip_message_proto_msgTypes[32] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Acknowledgement.ProtoReflect.Descriptor instead. +func (*Acknowledgement) Descriptor() ([]byte, []int) { + return file_gossip_message_proto_rawDescGZIP(), []int{32} +} + +func (x *Acknowledgement) GetError() string { + if x != nil { + return x.Error + } + return "" +} + +// Chaincode represents a Chaincode that is installed +// on a peer +type Chaincode struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` + Metadata []byte `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"` +} + +func (x *Chaincode) Reset() { + *x = Chaincode{} + if protoimpl.UnsafeEnabled { + mi := &file_gossip_message_proto_msgTypes[33] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Chaincode) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Chaincode) ProtoMessage() {} + +func (x *Chaincode) ProtoReflect() protoreflect.Message { + mi := &file_gossip_message_proto_msgTypes[33] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Chaincode.ProtoReflect.Descriptor instead. +func (*Chaincode) Descriptor() ([]byte, []int) { + return file_gossip_message_proto_rawDescGZIP(), []int{33} +} + +func (x *Chaincode) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Chaincode) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +func (x *Chaincode) GetMetadata() []byte { + if x != nil { + return x.Metadata + } + return nil +} + +var File_gossip_message_proto protoreflect.FileDescriptor + +var file_gossip_message_proto_rawDesc = []byte{ + 0x0a, 0x14, 0x67, 0x6f, 0x73, 0x73, 0x69, 0x70, 0x2f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x67, 0x6f, 0x73, 0x73, 0x69, 0x70, 0x1a, 0x15, + 0x70, 0x65, 0x65, 0x72, 0x2f, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x83, 0x01, 0x0a, 0x08, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, + 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x1c, 0x0a, 0x09, + 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x3f, 0x0a, 0x0f, 0x73, 0x65, + 0x63, 0x72, 0x65, 0x74, 0x5f, 0x65, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x73, 0x73, 0x69, 0x70, 0x2e, 0x53, 0x65, 0x63, + 0x72, 0x65, 0x74, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x52, 0x0e, 0x73, 0x65, 0x63, + 0x72, 0x65, 0x74, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x22, 0x48, 0x0a, 0x0e, 0x53, + 0x65, 0x63, 0x72, 0x65, 0x74, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x12, 0x18, 0x0a, + 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, + 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, + 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, + 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x41, 0x0a, 0x06, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x12, + 0x2c, 0x0a, 0x10, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x45, 0x6e, 0x64, 0x70, 0x6f, + 0x69, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x10, 0x69, 0x6e, 0x74, + 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x42, 0x09, 0x0a, + 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x22, 0x87, 0x0b, 0x0a, 0x0d, 0x47, 0x6f, 0x73, + 0x73, 0x69, 0x70, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6e, 0x6f, + 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, + 0x12, 0x18, 0x0a, 0x07, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x07, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x12, 0x2b, 0x0a, 0x03, 0x74, 0x61, + 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x73, 0x73, 0x69, 0x70, + 0x2e, 0x47, 0x6f, 0x73, 0x73, 0x69, 0x70, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x54, + 0x61, 0x67, 0x52, 0x03, 0x74, 0x61, 0x67, 0x12, 0x33, 0x0a, 0x09, 0x61, 0x6c, 0x69, 0x76, 0x65, + 0x5f, 0x6d, 0x73, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x73, + 0x73, 0x69, 0x70, 0x2e, 0x41, 0x6c, 0x69, 0x76, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x48, 0x00, 0x52, 0x08, 0x61, 0x6c, 0x69, 0x76, 0x65, 0x4d, 0x73, 0x67, 0x12, 0x34, 0x0a, 0x07, + 0x6d, 0x65, 0x6d, 0x5f, 0x72, 0x65, 0x71, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, + 0x67, 0x6f, 0x73, 0x73, 0x69, 0x70, 0x2e, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, 0x69, + 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x06, 0x6d, 0x65, 0x6d, 0x52, + 0x65, 0x71, 0x12, 0x35, 0x0a, 0x07, 0x6d, 0x65, 0x6d, 0x5f, 0x72, 0x65, 0x73, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x73, 0x73, 0x69, 0x70, 0x2e, 0x4d, 0x65, 0x6d, + 0x62, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, + 0x00, 0x52, 0x06, 0x6d, 0x65, 0x6d, 0x52, 0x65, 0x73, 0x12, 0x30, 0x0a, 0x08, 0x64, 0x61, 0x74, + 0x61, 0x5f, 0x6d, 0x73, 0x67, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x67, 0x6f, + 0x73, 0x73, 0x69, 0x70, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x48, 0x00, 0x52, 0x07, 0x64, 0x61, 0x74, 0x61, 0x4d, 0x73, 0x67, 0x12, 0x2b, 0x0a, 0x05, 0x68, + 0x65, 0x6c, 0x6c, 0x6f, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x67, 0x6f, 0x73, + 0x73, 0x69, 0x70, 0x2e, 0x47, 0x6f, 0x73, 0x73, 0x69, 0x70, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x48, + 0x00, 0x52, 0x05, 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x12, 0x2f, 0x0a, 0x08, 0x64, 0x61, 0x74, 0x61, + 0x5f, 0x64, 0x69, 0x67, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x67, 0x6f, 0x73, + 0x73, 0x69, 0x70, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x48, 0x00, + 0x52, 0x07, 0x64, 0x61, 0x74, 0x61, 0x44, 0x69, 0x67, 0x12, 0x30, 0x0a, 0x08, 0x64, 0x61, 0x74, + 0x61, 0x5f, 0x72, 0x65, 0x71, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x67, 0x6f, + 0x73, 0x73, 0x69, 0x70, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x48, 0x00, 0x52, 0x07, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x12, 0x35, 0x0a, 0x0b, 0x64, + 0x61, 0x74, 0x61, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x12, 0x2e, 0x67, 0x6f, 0x73, 0x73, 0x69, 0x70, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x48, 0x00, 0x52, 0x0a, 0x64, 0x61, 0x74, 0x61, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x12, 0x25, 0x0a, 0x05, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x18, 0x0d, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x0d, 0x2e, 0x67, 0x6f, 0x73, 0x73, 0x69, 0x70, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, + 0x48, 0x00, 0x52, 0x05, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x2b, 0x0a, 0x04, 0x63, 0x6f, 0x6e, + 0x6e, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x67, 0x6f, 0x73, 0x73, 0x69, 0x70, + 0x2e, 0x43, 0x6f, 0x6e, 0x6e, 0x45, 0x73, 0x74, 0x61, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x48, 0x00, + 0x52, 0x04, 0x63, 0x6f, 0x6e, 0x6e, 0x12, 0x32, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, + 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x67, 0x6f, 0x73, + 0x73, 0x69, 0x70, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x48, 0x00, 0x52, + 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x42, 0x0a, 0x0e, 0x73, 0x74, + 0x61, 0x74, 0x65, 0x5f, 0x73, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x18, 0x10, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x73, 0x73, 0x69, 0x70, 0x2e, 0x53, 0x74, 0x61, 0x74, + 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x48, 0x00, 0x52, + 0x0d, 0x73, 0x74, 0x61, 0x74, 0x65, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x12, 0x4d, + 0x0a, 0x13, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x5f, 0x70, 0x75, 0x6c, + 0x6c, 0x5f, 0x72, 0x65, 0x71, 0x18, 0x11, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, + 0x73, 0x73, 0x69, 0x70, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x50, 0x75, + 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x10, 0x73, 0x74, 0x61, + 0x74, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x50, 0x75, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x12, 0x41, 0x0a, + 0x0d, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x12, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x73, 0x73, 0x69, 0x70, 0x2e, 0x52, 0x65, + 0x6d, 0x6f, 0x74, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x48, 0x00, 0x52, 0x0c, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x44, 0x0a, 0x0e, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x18, 0x13, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x73, 0x73, 0x69, + 0x70, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x0d, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x42, 0x0a, 0x0e, 0x6c, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x73, 0x68, 0x69, 0x70, 0x5f, 0x6d, 0x73, 0x67, 0x18, 0x14, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, + 0x2e, 0x67, 0x6f, 0x73, 0x73, 0x69, 0x70, 0x2e, 0x4c, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x68, + 0x69, 0x70, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x0d, 0x6c, 0x65, 0x61, + 0x64, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x4d, 0x73, 0x67, 0x12, 0x3b, 0x0a, 0x0d, 0x70, 0x65, + 0x65, 0x72, 0x5f, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x15, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x73, 0x73, 0x69, 0x70, 0x2e, 0x50, 0x65, 0x65, 0x72, 0x49, + 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x48, 0x00, 0x52, 0x0c, 0x70, 0x65, 0x65, 0x72, 0x49, + 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x2b, 0x0a, 0x03, 0x61, 0x63, 0x6b, 0x18, 0x16, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x73, 0x73, 0x69, 0x70, 0x2e, 0x41, 0x63, + 0x6b, 0x6e, 0x6f, 0x77, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, + 0x03, 0x61, 0x63, 0x6b, 0x12, 0x3e, 0x0a, 0x0a, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x52, + 0x65, 0x71, 0x18, 0x17, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x73, 0x73, 0x69, + 0x70, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x50, 0x76, 0x74, 0x44, 0x61, 0x74, 0x61, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x0a, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, + 0x65, 0x52, 0x65, 0x71, 0x12, 0x3f, 0x0a, 0x0a, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x52, + 0x65, 0x73, 0x18, 0x18, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x67, 0x6f, 0x73, 0x73, 0x69, + 0x70, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x50, 0x76, 0x74, 0x44, 0x61, 0x74, 0x61, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x0a, 0x70, 0x72, 0x69, 0x76, 0x61, + 0x74, 0x65, 0x52, 0x65, 0x73, 0x12, 0x3f, 0x0a, 0x0c, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, + 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x19, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, + 0x73, 0x73, 0x69, 0x70, 0x2e, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x44, 0x61, 0x74, 0x61, + 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x0b, 0x70, 0x72, 0x69, 0x76, 0x61, + 0x74, 0x65, 0x44, 0x61, 0x74, 0x61, 0x22, 0x5f, 0x0a, 0x03, 0x54, 0x61, 0x67, 0x12, 0x0d, 0x0a, + 0x09, 0x55, 0x4e, 0x44, 0x45, 0x46, 0x49, 0x4e, 0x45, 0x44, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, + 0x45, 0x4d, 0x50, 0x54, 0x59, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x4f, 0x52, 0x47, 0x5f, 0x4f, + 0x4e, 0x4c, 0x59, 0x10, 0x02, 0x12, 0x0d, 0x0a, 0x09, 0x43, 0x48, 0x41, 0x4e, 0x5f, 0x4f, 0x4e, + 0x4c, 0x59, 0x10, 0x03, 0x12, 0x10, 0x0a, 0x0c, 0x43, 0x48, 0x41, 0x4e, 0x5f, 0x41, 0x4e, 0x44, + 0x5f, 0x4f, 0x52, 0x47, 0x10, 0x04, 0x12, 0x0f, 0x0a, 0x0b, 0x43, 0x48, 0x41, 0x4e, 0x5f, 0x4f, + 0x52, 0x5f, 0x4f, 0x52, 0x47, 0x10, 0x05, 0x42, 0x09, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, + 0x6e, 0x74, 0x22, 0xa7, 0x01, 0x0a, 0x09, 0x53, 0x74, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x66, 0x6f, + 0x12, 0x2e, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x67, 0x6f, 0x73, 0x73, 0x69, 0x70, 0x2e, 0x50, 0x65, 0x65, + 0x72, 0x54, 0x69, 0x6d, 0x65, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x12, 0x15, 0x0a, 0x06, 0x70, 0x6b, 0x69, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x05, 0x70, 0x6b, 0x69, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x68, 0x61, 0x6e, 0x6e, + 0x65, 0x6c, 0x5f, 0x4d, 0x41, 0x43, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x63, 0x68, + 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x4d, 0x41, 0x43, 0x12, 0x32, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x70, + 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x67, + 0x6f, 0x73, 0x73, 0x69, 0x70, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, + 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x22, 0x87, 0x01, 0x0a, + 0x0a, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x6c, + 0x65, 0x64, 0x67, 0x65, 0x72, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x04, 0x52, 0x0c, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, + 0x12, 0x21, 0x0a, 0x0c, 0x6c, 0x65, 0x66, 0x74, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x6c, 0x65, 0x66, 0x74, 0x43, 0x68, 0x61, 0x6e, + 0x6e, 0x65, 0x6c, 0x12, 0x31, 0x0a, 0x0a, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, + 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x67, 0x6f, 0x73, 0x73, 0x69, 0x70, + 0x2e, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x52, 0x0a, 0x63, 0x68, 0x61, 0x69, + 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x73, 0x22, 0x41, 0x0a, 0x11, 0x53, 0x74, 0x61, 0x74, 0x65, 0x49, + 0x6e, 0x66, 0x6f, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x12, 0x2c, 0x0a, 0x08, 0x65, + 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, + 0x67, 0x6f, 0x73, 0x73, 0x69, 0x70, 0x2e, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x52, + 0x08, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x22, 0x37, 0x0a, 0x14, 0x53, 0x74, 0x61, + 0x74, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x50, 0x75, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x5f, 0x4d, 0x41, 0x43, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x4d, + 0x41, 0x43, 0x22, 0x7c, 0x0a, 0x0d, 0x43, 0x6f, 0x6e, 0x6e, 0x45, 0x73, 0x74, 0x61, 0x62, 0x6c, + 0x69, 0x73, 0x68, 0x12, 0x15, 0x0a, 0x06, 0x70, 0x6b, 0x69, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x05, 0x70, 0x6b, 0x69, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x64, + 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x69, 0x64, + 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x22, 0x0a, 0x0d, 0x74, 0x6c, 0x73, 0x5f, 0x63, 0x65, + 0x72, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x74, + 0x6c, 0x73, 0x43, 0x65, 0x72, 0x74, 0x48, 0x61, 0x73, 0x68, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x72, + 0x6f, 0x62, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x70, 0x72, 0x6f, 0x62, 0x65, + 0x22, 0x55, 0x0a, 0x0c, 0x50, 0x65, 0x65, 0x72, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, + 0x12, 0x15, 0x0a, 0x06, 0x70, 0x6b, 0x69, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x05, 0x70, 0x6b, 0x69, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x65, 0x72, 0x74, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x63, 0x65, 0x72, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x6d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x6d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x22, 0x6d, 0x0a, 0x0b, 0x44, 0x61, 0x74, 0x61, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x12, 0x18, 0x0a, 0x07, + 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x07, 0x64, + 0x69, 0x67, 0x65, 0x73, 0x74, 0x73, 0x12, 0x2e, 0x0a, 0x08, 0x6d, 0x73, 0x67, 0x5f, 0x74, 0x79, + 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x13, 0x2e, 0x67, 0x6f, 0x73, 0x73, 0x69, + 0x70, 0x2e, 0x50, 0x75, 0x6c, 0x6c, 0x4d, 0x73, 0x67, 0x54, 0x79, 0x70, 0x65, 0x52, 0x07, 0x6d, + 0x73, 0x67, 0x54, 0x79, 0x70, 0x65, 0x22, 0x6f, 0x0a, 0x0b, 0x47, 0x6f, 0x73, 0x73, 0x69, 0x70, + 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x12, 0x14, 0x0a, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x6d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x6d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x2e, 0x0a, 0x08, 0x6d, 0x73, 0x67, 0x5f, 0x74, + 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x13, 0x2e, 0x67, 0x6f, 0x73, 0x73, + 0x69, 0x70, 0x2e, 0x50, 0x75, 0x6c, 0x6c, 0x4d, 0x73, 0x67, 0x54, 0x79, 0x70, 0x65, 0x52, 0x07, + 0x6d, 0x73, 0x67, 0x54, 0x79, 0x70, 0x65, 0x22, 0x78, 0x0a, 0x0a, 0x44, 0x61, 0x74, 0x61, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x12, 0x24, 0x0a, 0x04, 0x64, + 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x67, 0x6f, 0x73, 0x73, + 0x69, 0x70, 0x2e, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x52, 0x04, 0x64, 0x61, 0x74, + 0x61, 0x12, 0x2e, 0x0a, 0x08, 0x6d, 0x73, 0x67, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0e, 0x32, 0x13, 0x2e, 0x67, 0x6f, 0x73, 0x73, 0x69, 0x70, 0x2e, 0x50, 0x75, 0x6c, + 0x6c, 0x4d, 0x73, 0x67, 0x54, 0x79, 0x70, 0x65, 0x52, 0x07, 0x6d, 0x73, 0x67, 0x54, 0x79, 0x70, + 0x65, 0x22, 0x6c, 0x0a, 0x0a, 0x44, 0x61, 0x74, 0x61, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, + 0x14, 0x0a, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, + 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x73, + 0x18, 0x02, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x07, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x73, 0x12, + 0x2e, 0x0a, 0x08, 0x6d, 0x73, 0x67, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0e, 0x32, 0x13, 0x2e, 0x67, 0x6f, 0x73, 0x73, 0x69, 0x70, 0x2e, 0x50, 0x75, 0x6c, 0x6c, 0x4d, + 0x73, 0x67, 0x54, 0x79, 0x70, 0x65, 0x52, 0x07, 0x6d, 0x73, 0x67, 0x54, 0x79, 0x70, 0x65, 0x22, + 0x38, 0x0a, 0x0b, 0x44, 0x61, 0x74, 0x61, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x29, + 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x0f, 0x2e, 0x67, 0x6f, 0x73, 0x73, 0x69, 0x70, 0x2e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, + 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x46, 0x0a, 0x12, 0x50, 0x72, 0x69, + 0x76, 0x61, 0x74, 0x65, 0x44, 0x61, 0x74, 0x61, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, + 0x30, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x73, 0x73, 0x69, 0x70, 0x2e, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, + 0x65, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, + 0x64, 0x22, 0x59, 0x0a, 0x07, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x17, 0x0a, 0x07, + 0x73, 0x65, 0x71, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x73, + 0x65, 0x71, 0x4e, 0x75, 0x6d, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x69, + 0x76, 0x61, 0x74, 0x65, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, 0x52, + 0x0b, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x44, 0x61, 0x74, 0x61, 0x22, 0x8f, 0x02, 0x0a, + 0x0e, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, + 0x27, 0x0a, 0x0f, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, + 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, + 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x13, 0x0a, 0x05, 0x74, 0x78, 0x5f, 0x69, 0x64, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x78, 0x49, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x70, + 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x77, 0x73, 0x65, 0x74, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x0c, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x52, 0x77, 0x73, 0x65, 0x74, + 0x12, 0x2c, 0x0a, 0x12, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x5f, 0x73, 0x69, 0x6d, 0x5f, + 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x10, 0x70, 0x72, + 0x69, 0x76, 0x61, 0x74, 0x65, 0x53, 0x69, 0x6d, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x4e, + 0x0a, 0x12, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x73, 0x2e, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x52, 0x11, 0x63, 0x6f, 0x6c, + 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x22, 0x8a, + 0x01, 0x0a, 0x0c, 0x41, 0x6c, 0x69, 0x76, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, + 0x2e, 0x0a, 0x0a, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x67, 0x6f, 0x73, 0x73, 0x69, 0x70, 0x2e, 0x4d, 0x65, 0x6d, + 0x62, 0x65, 0x72, 0x52, 0x0a, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x12, + 0x2e, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x67, 0x6f, 0x73, 0x73, 0x69, 0x70, 0x2e, 0x50, 0x65, 0x65, 0x72, + 0x54, 0x69, 0x6d, 0x65, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, + 0x1a, 0x0a, 0x08, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x08, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x22, 0x81, 0x01, 0x0a, 0x11, + 0x4c, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x12, 0x15, 0x0a, 0x06, 0x70, 0x6b, 0x69, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x05, 0x70, 0x6b, 0x69, 0x49, 0x64, 0x12, 0x2e, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x67, 0x6f, + 0x73, 0x73, 0x69, 0x70, 0x2e, 0x50, 0x65, 0x65, 0x72, 0x54, 0x69, 0x6d, 0x65, 0x52, 0x09, 0x74, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x25, 0x0a, 0x0e, 0x69, 0x73, 0x5f, 0x64, + 0x65, 0x63, 0x6c, 0x61, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x0d, 0x69, 0x73, 0x44, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, + 0x3c, 0x0a, 0x08, 0x50, 0x65, 0x65, 0x72, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x69, + 0x6e, 0x63, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x69, 0x6e, + 0x63, 0x4e, 0x75, 0x6d, 0x12, 0x17, 0x0a, 0x07, 0x73, 0x65, 0x71, 0x5f, 0x6e, 0x75, 0x6d, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x73, 0x65, 0x71, 0x4e, 0x75, 0x6d, 0x22, 0x66, 0x0a, + 0x11, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x3b, 0x0a, 0x10, 0x73, 0x65, 0x6c, 0x66, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x72, + 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x67, + 0x6f, 0x73, 0x73, 0x69, 0x70, 0x2e, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x52, 0x0f, + 0x73, 0x65, 0x6c, 0x66, 0x49, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, + 0x14, 0x0a, 0x05, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x05, + 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x22, 0x62, 0x0a, 0x12, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, + 0x68, 0x69, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x26, 0x0a, 0x05, 0x61, + 0x6c, 0x69, 0x76, 0x65, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x67, 0x6f, 0x73, + 0x73, 0x69, 0x70, 0x2e, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x52, 0x05, 0x61, 0x6c, + 0x69, 0x76, 0x65, 0x12, 0x24, 0x0a, 0x04, 0x64, 0x65, 0x61, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x10, 0x2e, 0x67, 0x6f, 0x73, 0x73, 0x69, 0x70, 0x2e, 0x45, 0x6e, 0x76, 0x65, 0x6c, + 0x6f, 0x70, 0x65, 0x52, 0x04, 0x64, 0x65, 0x61, 0x64, 0x22, 0x57, 0x0a, 0x06, 0x4d, 0x65, 0x6d, + 0x62, 0x65, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, + 0x1a, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x15, 0x0a, 0x06, 0x70, + 0x6b, 0x69, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x70, 0x6b, 0x69, + 0x49, 0x64, 0x22, 0x07, 0x0a, 0x05, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x58, 0x0a, 0x12, 0x52, + 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x22, 0x0a, 0x0d, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x73, 0x65, 0x71, 0x5f, 0x6e, + 0x75, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x73, 0x74, 0x61, 0x72, 0x74, 0x53, + 0x65, 0x71, 0x4e, 0x75, 0x6d, 0x12, 0x1e, 0x0a, 0x0b, 0x65, 0x6e, 0x64, 0x5f, 0x73, 0x65, 0x71, + 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x65, 0x6e, 0x64, 0x53, + 0x65, 0x71, 0x4e, 0x75, 0x6d, 0x22, 0x42, 0x0a, 0x13, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x53, + 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2b, 0x0a, 0x08, + 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, + 0x2e, 0x67, 0x6f, 0x73, 0x73, 0x69, 0x70, 0x2e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x52, + 0x08, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x73, 0x22, 0x47, 0x0a, 0x14, 0x52, 0x65, 0x6d, + 0x6f, 0x74, 0x65, 0x50, 0x76, 0x74, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x2f, 0x0a, 0x07, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x67, 0x6f, 0x73, 0x73, 0x69, 0x70, 0x2e, 0x50, 0x76, 0x74, 0x44, + 0x61, 0x74, 0x61, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x52, 0x07, 0x64, 0x69, 0x67, 0x65, 0x73, + 0x74, 0x73, 0x22, 0xa1, 0x01, 0x0a, 0x0d, 0x50, 0x76, 0x74, 0x44, 0x61, 0x74, 0x61, 0x44, 0x69, + 0x67, 0x65, 0x73, 0x74, 0x12, 0x13, 0x0a, 0x05, 0x74, 0x78, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x78, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, + 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, + 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6c, 0x6c, 0x65, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6c, + 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1b, 0x0a, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, + 0x5f, 0x73, 0x65, 0x71, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x62, 0x6c, 0x6f, 0x63, + 0x6b, 0x53, 0x65, 0x71, 0x12, 0x20, 0x0a, 0x0c, 0x73, 0x65, 0x71, 0x5f, 0x69, 0x6e, 0x5f, 0x62, + 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x73, 0x65, 0x71, 0x49, + 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x22, 0x4b, 0x0a, 0x15, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, + 0x50, 0x76, 0x74, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x32, 0x0a, 0x08, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x73, 0x73, 0x69, 0x70, 0x2e, 0x50, 0x76, 0x74, 0x44, 0x61, + 0x74, 0x61, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x08, 0x65, 0x6c, 0x65, 0x6d, 0x65, + 0x6e, 0x74, 0x73, 0x22, 0x59, 0x0a, 0x0e, 0x50, 0x76, 0x74, 0x44, 0x61, 0x74, 0x61, 0x45, 0x6c, + 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x2d, 0x0a, 0x06, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x67, 0x6f, 0x73, 0x73, 0x69, 0x70, 0x2e, 0x50, + 0x76, 0x74, 0x44, 0x61, 0x74, 0x61, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x52, 0x06, 0x64, 0x69, + 0x67, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, + 0x02, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x51, + 0x0a, 0x0e, 0x50, 0x76, 0x74, 0x44, 0x61, 0x74, 0x61, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, + 0x12, 0x25, 0x0a, 0x0f, 0x74, 0x78, 0x5f, 0x73, 0x65, 0x71, 0x5f, 0x69, 0x6e, 0x5f, 0x62, 0x6c, + 0x6f, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0c, 0x74, 0x78, 0x53, 0x65, 0x71, + 0x49, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, + 0x61, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, + 0x64, 0x22, 0x27, 0x0a, 0x0f, 0x41, 0x63, 0x6b, 0x6e, 0x6f, 0x77, 0x6c, 0x65, 0x64, 0x67, 0x65, + 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x55, 0x0a, 0x09, 0x43, 0x68, + 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, + 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, + 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0x2a, 0x3d, 0x0a, 0x0b, 0x50, 0x75, 0x6c, 0x6c, 0x4d, 0x73, 0x67, 0x54, 0x79, 0x70, 0x65, + 0x12, 0x0d, 0x0a, 0x09, 0x55, 0x4e, 0x44, 0x45, 0x46, 0x49, 0x4e, 0x45, 0x44, 0x10, 0x00, 0x12, + 0x0d, 0x0a, 0x09, 0x42, 0x4c, 0x4f, 0x43, 0x4b, 0x5f, 0x4d, 0x53, 0x47, 0x10, 0x01, 0x12, 0x10, + 0x0a, 0x0c, 0x49, 0x44, 0x45, 0x4e, 0x54, 0x49, 0x54, 0x59, 0x5f, 0x4d, 0x53, 0x47, 0x10, 0x02, + 0x32, 0x66, 0x0a, 0x06, 0x47, 0x6f, 0x73, 0x73, 0x69, 0x70, 0x12, 0x36, 0x0a, 0x0c, 0x47, 0x6f, + 0x73, 0x73, 0x69, 0x70, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x10, 0x2e, 0x67, 0x6f, 0x73, + 0x73, 0x69, 0x70, 0x2e, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x1a, 0x10, 0x2e, 0x67, + 0x6f, 0x73, 0x73, 0x69, 0x70, 0x2e, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x28, 0x01, + 0x30, 0x01, 0x12, 0x24, 0x0a, 0x04, 0x50, 0x69, 0x6e, 0x67, 0x12, 0x0d, 0x2e, 0x67, 0x6f, 0x73, + 0x73, 0x69, 0x70, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x0d, 0x2e, 0x67, 0x6f, 0x73, 0x73, + 0x69, 0x70, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x42, 0xa2, 0x01, 0x0a, 0x24, 0x6f, 0x72, 0x67, + 0x2e, 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2e, 0x66, 0x61, 0x62, + 0x72, 0x69, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x73, 0x73, 0x69, + 0x70, 0x42, 0x0c, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, + 0x01, 0x5a, 0x34, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x79, + 0x70, 0x65, 0x72, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2f, 0x66, 0x61, 0x62, 0x72, 0x69, 0x63, + 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2d, 0x67, 0x6f, 0x2d, 0x61, 0x70, 0x69, 0x76, 0x32, + 0x2f, 0x67, 0x6f, 0x73, 0x73, 0x69, 0x70, 0xa2, 0x02, 0x03, 0x47, 0x58, 0x58, 0xaa, 0x02, 0x06, + 0x47, 0x6f, 0x73, 0x73, 0x69, 0x70, 0xca, 0x02, 0x06, 0x47, 0x6f, 0x73, 0x73, 0x69, 0x70, 0xe2, + 0x02, 0x12, 0x47, 0x6f, 0x73, 0x73, 0x69, 0x70, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x06, 0x47, 0x6f, 0x73, 0x73, 0x69, 0x70, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_gossip_message_proto_rawDescOnce sync.Once + file_gossip_message_proto_rawDescData = file_gossip_message_proto_rawDesc +) + +func file_gossip_message_proto_rawDescGZIP() []byte { + file_gossip_message_proto_rawDescOnce.Do(func() { + file_gossip_message_proto_rawDescData = protoimpl.X.CompressGZIP(file_gossip_message_proto_rawDescData) + }) + return file_gossip_message_proto_rawDescData +} + +var file_gossip_message_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_gossip_message_proto_msgTypes = make([]protoimpl.MessageInfo, 34) +var file_gossip_message_proto_goTypes = []interface{}{ + (PullMsgType)(0), // 0: gossip.PullMsgType + (GossipMessage_Tag)(0), // 1: gossip.GossipMessage.Tag + (*Envelope)(nil), // 2: gossip.Envelope + (*SecretEnvelope)(nil), // 3: gossip.SecretEnvelope + (*Secret)(nil), // 4: gossip.Secret + (*GossipMessage)(nil), // 5: gossip.GossipMessage + (*StateInfo)(nil), // 6: gossip.StateInfo + (*Properties)(nil), // 7: gossip.Properties + (*StateInfoSnapshot)(nil), // 8: gossip.StateInfoSnapshot + (*StateInfoPullRequest)(nil), // 9: gossip.StateInfoPullRequest + (*ConnEstablish)(nil), // 10: gossip.ConnEstablish + (*PeerIdentity)(nil), // 11: gossip.PeerIdentity + (*DataRequest)(nil), // 12: gossip.DataRequest + (*GossipHello)(nil), // 13: gossip.GossipHello + (*DataUpdate)(nil), // 14: gossip.DataUpdate + (*DataDigest)(nil), // 15: gossip.DataDigest + (*DataMessage)(nil), // 16: gossip.DataMessage + (*PrivateDataMessage)(nil), // 17: gossip.PrivateDataMessage + (*Payload)(nil), // 18: gossip.Payload + (*PrivatePayload)(nil), // 19: gossip.PrivatePayload + (*AliveMessage)(nil), // 20: gossip.AliveMessage + (*LeadershipMessage)(nil), // 21: gossip.LeadershipMessage + (*PeerTime)(nil), // 22: gossip.PeerTime + (*MembershipRequest)(nil), // 23: gossip.MembershipRequest + (*MembershipResponse)(nil), // 24: gossip.MembershipResponse + (*Member)(nil), // 25: gossip.Member + (*Empty)(nil), // 26: gossip.Empty + (*RemoteStateRequest)(nil), // 27: gossip.RemoteStateRequest + (*RemoteStateResponse)(nil), // 28: gossip.RemoteStateResponse + (*RemotePvtDataRequest)(nil), // 29: gossip.RemotePvtDataRequest + (*PvtDataDigest)(nil), // 30: gossip.PvtDataDigest + (*RemotePvtDataResponse)(nil), // 31: gossip.RemotePvtDataResponse + (*PvtDataElement)(nil), // 32: gossip.PvtDataElement + (*PvtDataPayload)(nil), // 33: gossip.PvtDataPayload + (*Acknowledgement)(nil), // 34: gossip.Acknowledgement + (*Chaincode)(nil), // 35: gossip.Chaincode + (*peer.CollectionConfigPackage)(nil), // 36: protos.CollectionConfigPackage +} +var file_gossip_message_proto_depIdxs = []int32{ + 3, // 0: gossip.Envelope.secret_envelope:type_name -> gossip.SecretEnvelope + 1, // 1: gossip.GossipMessage.tag:type_name -> gossip.GossipMessage.Tag + 20, // 2: gossip.GossipMessage.alive_msg:type_name -> gossip.AliveMessage + 23, // 3: gossip.GossipMessage.mem_req:type_name -> gossip.MembershipRequest + 24, // 4: gossip.GossipMessage.mem_res:type_name -> gossip.MembershipResponse + 16, // 5: gossip.GossipMessage.data_msg:type_name -> gossip.DataMessage + 13, // 6: gossip.GossipMessage.hello:type_name -> gossip.GossipHello + 15, // 7: gossip.GossipMessage.data_dig:type_name -> gossip.DataDigest + 12, // 8: gossip.GossipMessage.data_req:type_name -> gossip.DataRequest + 14, // 9: gossip.GossipMessage.data_update:type_name -> gossip.DataUpdate + 26, // 10: gossip.GossipMessage.empty:type_name -> gossip.Empty + 10, // 11: gossip.GossipMessage.conn:type_name -> gossip.ConnEstablish + 6, // 12: gossip.GossipMessage.state_info:type_name -> gossip.StateInfo + 8, // 13: gossip.GossipMessage.state_snapshot:type_name -> gossip.StateInfoSnapshot + 9, // 14: gossip.GossipMessage.state_info_pull_req:type_name -> gossip.StateInfoPullRequest + 27, // 15: gossip.GossipMessage.state_request:type_name -> gossip.RemoteStateRequest + 28, // 16: gossip.GossipMessage.state_response:type_name -> gossip.RemoteStateResponse + 21, // 17: gossip.GossipMessage.leadership_msg:type_name -> gossip.LeadershipMessage + 11, // 18: gossip.GossipMessage.peer_identity:type_name -> gossip.PeerIdentity + 34, // 19: gossip.GossipMessage.ack:type_name -> gossip.Acknowledgement + 29, // 20: gossip.GossipMessage.privateReq:type_name -> gossip.RemotePvtDataRequest + 31, // 21: gossip.GossipMessage.privateRes:type_name -> gossip.RemotePvtDataResponse + 17, // 22: gossip.GossipMessage.private_data:type_name -> gossip.PrivateDataMessage + 22, // 23: gossip.StateInfo.timestamp:type_name -> gossip.PeerTime + 7, // 24: gossip.StateInfo.properties:type_name -> gossip.Properties + 35, // 25: gossip.Properties.chaincodes:type_name -> gossip.Chaincode + 2, // 26: gossip.StateInfoSnapshot.elements:type_name -> gossip.Envelope + 0, // 27: gossip.DataRequest.msg_type:type_name -> gossip.PullMsgType + 0, // 28: gossip.GossipHello.msg_type:type_name -> gossip.PullMsgType + 2, // 29: gossip.DataUpdate.data:type_name -> gossip.Envelope + 0, // 30: gossip.DataUpdate.msg_type:type_name -> gossip.PullMsgType + 0, // 31: gossip.DataDigest.msg_type:type_name -> gossip.PullMsgType + 18, // 32: gossip.DataMessage.payload:type_name -> gossip.Payload + 19, // 33: gossip.PrivateDataMessage.payload:type_name -> gossip.PrivatePayload + 36, // 34: gossip.PrivatePayload.collection_configs:type_name -> protos.CollectionConfigPackage + 25, // 35: gossip.AliveMessage.membership:type_name -> gossip.Member + 22, // 36: gossip.AliveMessage.timestamp:type_name -> gossip.PeerTime + 22, // 37: gossip.LeadershipMessage.timestamp:type_name -> gossip.PeerTime + 2, // 38: gossip.MembershipRequest.self_information:type_name -> gossip.Envelope + 2, // 39: gossip.MembershipResponse.alive:type_name -> gossip.Envelope + 2, // 40: gossip.MembershipResponse.dead:type_name -> gossip.Envelope + 18, // 41: gossip.RemoteStateResponse.payloads:type_name -> gossip.Payload + 30, // 42: gossip.RemotePvtDataRequest.digests:type_name -> gossip.PvtDataDigest + 32, // 43: gossip.RemotePvtDataResponse.elements:type_name -> gossip.PvtDataElement + 30, // 44: gossip.PvtDataElement.digest:type_name -> gossip.PvtDataDigest + 2, // 45: gossip.Gossip.GossipStream:input_type -> gossip.Envelope + 26, // 46: gossip.Gossip.Ping:input_type -> gossip.Empty + 2, // 47: gossip.Gossip.GossipStream:output_type -> gossip.Envelope + 26, // 48: gossip.Gossip.Ping:output_type -> gossip.Empty + 47, // [47:49] is the sub-list for method output_type + 45, // [45:47] is the sub-list for method input_type + 45, // [45:45] is the sub-list for extension type_name + 45, // [45:45] is the sub-list for extension extendee + 0, // [0:45] is the sub-list for field type_name +} + +func init() { file_gossip_message_proto_init() } +func file_gossip_message_proto_init() { + if File_gossip_message_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_gossip_message_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Envelope); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gossip_message_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SecretEnvelope); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gossip_message_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Secret); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gossip_message_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GossipMessage); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gossip_message_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StateInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gossip_message_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Properties); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gossip_message_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StateInfoSnapshot); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gossip_message_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StateInfoPullRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gossip_message_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ConnEstablish); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gossip_message_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PeerIdentity); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gossip_message_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DataRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gossip_message_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GossipHello); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gossip_message_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DataUpdate); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gossip_message_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DataDigest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gossip_message_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DataMessage); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gossip_message_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PrivateDataMessage); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gossip_message_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Payload); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gossip_message_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PrivatePayload); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gossip_message_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AliveMessage); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gossip_message_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LeadershipMessage); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gossip_message_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PeerTime); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gossip_message_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MembershipRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gossip_message_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MembershipResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gossip_message_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Member); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gossip_message_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Empty); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gossip_message_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RemoteStateRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gossip_message_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RemoteStateResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gossip_message_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RemotePvtDataRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gossip_message_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PvtDataDigest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gossip_message_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RemotePvtDataResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gossip_message_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PvtDataElement); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gossip_message_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PvtDataPayload); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gossip_message_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Acknowledgement); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gossip_message_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Chaincode); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_gossip_message_proto_msgTypes[2].OneofWrappers = []interface{}{ + (*Secret_InternalEndpoint)(nil), + } + file_gossip_message_proto_msgTypes[3].OneofWrappers = []interface{}{ + (*GossipMessage_AliveMsg)(nil), + (*GossipMessage_MemReq)(nil), + (*GossipMessage_MemRes)(nil), + (*GossipMessage_DataMsg)(nil), + (*GossipMessage_Hello)(nil), + (*GossipMessage_DataDig)(nil), + (*GossipMessage_DataReq)(nil), + (*GossipMessage_DataUpdate)(nil), + (*GossipMessage_Empty)(nil), + (*GossipMessage_Conn)(nil), + (*GossipMessage_StateInfo)(nil), + (*GossipMessage_StateSnapshot)(nil), + (*GossipMessage_StateInfoPullReq)(nil), + (*GossipMessage_StateRequest)(nil), + (*GossipMessage_StateResponse)(nil), + (*GossipMessage_LeadershipMsg)(nil), + (*GossipMessage_PeerIdentity)(nil), + (*GossipMessage_Ack)(nil), + (*GossipMessage_PrivateReq)(nil), + (*GossipMessage_PrivateRes)(nil), + (*GossipMessage_PrivateData)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_gossip_message_proto_rawDesc, + NumEnums: 2, + NumMessages: 34, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_gossip_message_proto_goTypes, + DependencyIndexes: file_gossip_message_proto_depIdxs, + EnumInfos: file_gossip_message_proto_enumTypes, + MessageInfos: file_gossip_message_proto_msgTypes, + }.Build() + File_gossip_message_proto = out.File + file_gossip_message_proto_rawDesc = nil + file_gossip_message_proto_goTypes = nil + file_gossip_message_proto_depIdxs = nil +} diff --git a/vendor/github.com/hyperledger/fabric-protos-go-apiv2/gossip/message_grpc.pb.go b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/gossip/message_grpc.pb.go new file mode 100644 index 00000000000..9930cbdf5da --- /dev/null +++ b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/gossip/message_grpc.pb.go @@ -0,0 +1,185 @@ +// Copyright the Hyperledger Fabric contributors. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: gossip/message.proto + +package gossip + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + Gossip_GossipStream_FullMethodName = "/gossip.Gossip/GossipStream" + Gossip_Ping_FullMethodName = "/gossip.Gossip/Ping" +) + +// GossipClient is the client API for Gossip service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type GossipClient interface { + // GossipStream is the gRPC stream used for sending and receiving messages + GossipStream(ctx context.Context, opts ...grpc.CallOption) (Gossip_GossipStreamClient, error) + // Ping is used to probe a remote peer's aliveness + Ping(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error) +} + +type gossipClient struct { + cc grpc.ClientConnInterface +} + +func NewGossipClient(cc grpc.ClientConnInterface) GossipClient { + return &gossipClient{cc} +} + +func (c *gossipClient) GossipStream(ctx context.Context, opts ...grpc.CallOption) (Gossip_GossipStreamClient, error) { + stream, err := c.cc.NewStream(ctx, &Gossip_ServiceDesc.Streams[0], Gossip_GossipStream_FullMethodName, opts...) + if err != nil { + return nil, err + } + x := &gossipGossipStreamClient{stream} + return x, nil +} + +type Gossip_GossipStreamClient interface { + Send(*Envelope) error + Recv() (*Envelope, error) + grpc.ClientStream +} + +type gossipGossipStreamClient struct { + grpc.ClientStream +} + +func (x *gossipGossipStreamClient) Send(m *Envelope) error { + return x.ClientStream.SendMsg(m) +} + +func (x *gossipGossipStreamClient) Recv() (*Envelope, error) { + m := new(Envelope) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *gossipClient) Ping(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error) { + out := new(Empty) + err := c.cc.Invoke(ctx, Gossip_Ping_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// GossipServer is the server API for Gossip service. +// All implementations should embed UnimplementedGossipServer +// for forward compatibility +type GossipServer interface { + // GossipStream is the gRPC stream used for sending and receiving messages + GossipStream(Gossip_GossipStreamServer) error + // Ping is used to probe a remote peer's aliveness + Ping(context.Context, *Empty) (*Empty, error) +} + +// UnimplementedGossipServer should be embedded to have forward compatible implementations. +type UnimplementedGossipServer struct { +} + +func (UnimplementedGossipServer) GossipStream(Gossip_GossipStreamServer) error { + return status.Errorf(codes.Unimplemented, "method GossipStream not implemented") +} +func (UnimplementedGossipServer) Ping(context.Context, *Empty) (*Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method Ping not implemented") +} + +// UnsafeGossipServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to GossipServer will +// result in compilation errors. +type UnsafeGossipServer interface { + mustEmbedUnimplementedGossipServer() +} + +func RegisterGossipServer(s grpc.ServiceRegistrar, srv GossipServer) { + s.RegisterService(&Gossip_ServiceDesc, srv) +} + +func _Gossip_GossipStream_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(GossipServer).GossipStream(&gossipGossipStreamServer{stream}) +} + +type Gossip_GossipStreamServer interface { + Send(*Envelope) error + Recv() (*Envelope, error) + grpc.ServerStream +} + +type gossipGossipStreamServer struct { + grpc.ServerStream +} + +func (x *gossipGossipStreamServer) Send(m *Envelope) error { + return x.ServerStream.SendMsg(m) +} + +func (x *gossipGossipStreamServer) Recv() (*Envelope, error) { + m := new(Envelope) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func _Gossip_Ping_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GossipServer).Ping(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Gossip_Ping_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GossipServer).Ping(ctx, req.(*Empty)) + } + return interceptor(ctx, in, info, handler) +} + +// Gossip_ServiceDesc is the grpc.ServiceDesc for Gossip service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Gossip_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "gossip.Gossip", + HandlerType: (*GossipServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Ping", + Handler: _Gossip_Ping_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "GossipStream", + Handler: _Gossip_GossipStream_Handler, + ServerStreams: true, + ClientStreams: true, + }, + }, + Metadata: "gossip/message.proto", +} diff --git a/vendor/github.com/hyperledger/fabric-protos-go-apiv2/ledger/queryresult/kv_query_result.pb.go b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/ledger/queryresult/kv_query_result.pb.go new file mode 100644 index 00000000000..24bebaa6142 --- /dev/null +++ b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/ledger/queryresult/kv_query_result.pb.go @@ -0,0 +1,280 @@ +// Copyright the Hyperledger Fabric contributors. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: ledger/queryresult/kv_query_result.proto + +package queryresult + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// KV -- QueryResult for range/execute query. Holds a key and corresponding value. +type KV struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"` + Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` + Value []byte `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *KV) Reset() { + *x = KV{} + if protoimpl.UnsafeEnabled { + mi := &file_ledger_queryresult_kv_query_result_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *KV) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*KV) ProtoMessage() {} + +func (x *KV) ProtoReflect() protoreflect.Message { + mi := &file_ledger_queryresult_kv_query_result_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use KV.ProtoReflect.Descriptor instead. +func (*KV) Descriptor() ([]byte, []int) { + return file_ledger_queryresult_kv_query_result_proto_rawDescGZIP(), []int{0} +} + +func (x *KV) GetNamespace() string { + if x != nil { + return x.Namespace + } + return "" +} + +func (x *KV) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *KV) GetValue() []byte { + if x != nil { + return x.Value + } + return nil +} + +// KeyModification -- QueryResult for history query. Holds a transaction ID, value, +// timestamp, and delete marker which resulted from a history query. +type KeyModification struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TxId string `protobuf:"bytes,1,opt,name=tx_id,json=txId,proto3" json:"tx_id,omitempty"` + Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` + Timestamp *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + IsDelete bool `protobuf:"varint,4,opt,name=is_delete,json=isDelete,proto3" json:"is_delete,omitempty"` +} + +func (x *KeyModification) Reset() { + *x = KeyModification{} + if protoimpl.UnsafeEnabled { + mi := &file_ledger_queryresult_kv_query_result_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *KeyModification) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*KeyModification) ProtoMessage() {} + +func (x *KeyModification) ProtoReflect() protoreflect.Message { + mi := &file_ledger_queryresult_kv_query_result_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use KeyModification.ProtoReflect.Descriptor instead. +func (*KeyModification) Descriptor() ([]byte, []int) { + return file_ledger_queryresult_kv_query_result_proto_rawDescGZIP(), []int{1} +} + +func (x *KeyModification) GetTxId() string { + if x != nil { + return x.TxId + } + return "" +} + +func (x *KeyModification) GetValue() []byte { + if x != nil { + return x.Value + } + return nil +} + +func (x *KeyModification) GetTimestamp() *timestamppb.Timestamp { + if x != nil { + return x.Timestamp + } + return nil +} + +func (x *KeyModification) GetIsDelete() bool { + if x != nil { + return x.IsDelete + } + return false +} + +var File_ledger_queryresult_kv_query_result_proto protoreflect.FileDescriptor + +var file_ledger_queryresult_kv_query_result_proto_rawDesc = []byte{ + 0x0a, 0x28, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x72, 0x65, + 0x73, 0x75, 0x6c, 0x74, 0x2f, 0x6b, 0x76, 0x5f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x5f, 0x72, 0x65, + 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x71, 0x75, 0x65, 0x72, + 0x79, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x4a, 0x0a, 0x02, 0x4b, 0x56, 0x12, 0x1c, + 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x10, 0x0a, 0x03, + 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, + 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x22, 0x93, 0x01, 0x0a, 0x0f, 0x4b, 0x65, 0x79, 0x4d, 0x6f, 0x64, 0x69, + 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x13, 0x0a, 0x05, 0x74, 0x78, 0x5f, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x78, 0x49, 0x64, 0x12, 0x14, 0x0a, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x12, 0x38, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x1b, 0x0a, + 0x09, 0x69, 0x73, 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x08, 0x69, 0x73, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0xd4, 0x01, 0x0a, 0x30, 0x6f, + 0x72, 0x67, 0x2e, 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2e, 0x66, + 0x61, 0x62, 0x72, 0x69, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x6c, 0x65, 0x64, + 0x67, 0x65, 0x72, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x42, + 0x12, 0x4b, 0x56, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x50, 0x72, + 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x40, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2f, 0x66, 0x61, + 0x62, 0x72, 0x69, 0x63, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2d, 0x67, 0x6f, 0x2d, 0x61, + 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2f, 0x71, 0x75, 0x65, 0x72, + 0x79, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0xa2, 0x02, 0x03, 0x51, 0x58, 0x58, 0xaa, 0x02, 0x0b, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0xca, 0x02, 0x0b, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0xe2, 0x02, 0x17, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0xea, 0x02, 0x0b, 0x51, 0x75, 0x65, 0x72, 0x79, 0x72, 0x65, 0x73, 0x75, 0x6c, + 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_ledger_queryresult_kv_query_result_proto_rawDescOnce sync.Once + file_ledger_queryresult_kv_query_result_proto_rawDescData = file_ledger_queryresult_kv_query_result_proto_rawDesc +) + +func file_ledger_queryresult_kv_query_result_proto_rawDescGZIP() []byte { + file_ledger_queryresult_kv_query_result_proto_rawDescOnce.Do(func() { + file_ledger_queryresult_kv_query_result_proto_rawDescData = protoimpl.X.CompressGZIP(file_ledger_queryresult_kv_query_result_proto_rawDescData) + }) + return file_ledger_queryresult_kv_query_result_proto_rawDescData +} + +var file_ledger_queryresult_kv_query_result_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_ledger_queryresult_kv_query_result_proto_goTypes = []interface{}{ + (*KV)(nil), // 0: queryresult.KV + (*KeyModification)(nil), // 1: queryresult.KeyModification + (*timestamppb.Timestamp)(nil), // 2: google.protobuf.Timestamp +} +var file_ledger_queryresult_kv_query_result_proto_depIdxs = []int32{ + 2, // 0: queryresult.KeyModification.timestamp:type_name -> google.protobuf.Timestamp + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_ledger_queryresult_kv_query_result_proto_init() } +func file_ledger_queryresult_kv_query_result_proto_init() { + if File_ledger_queryresult_kv_query_result_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_ledger_queryresult_kv_query_result_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*KV); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ledger_queryresult_kv_query_result_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*KeyModification); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_ledger_queryresult_kv_query_result_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_ledger_queryresult_kv_query_result_proto_goTypes, + DependencyIndexes: file_ledger_queryresult_kv_query_result_proto_depIdxs, + MessageInfos: file_ledger_queryresult_kv_query_result_proto_msgTypes, + }.Build() + File_ledger_queryresult_kv_query_result_proto = out.File + file_ledger_queryresult_kv_query_result_proto_rawDesc = nil + file_ledger_queryresult_kv_query_result_proto_goTypes = nil + file_ledger_queryresult_kv_query_result_proto_depIdxs = nil +} diff --git a/vendor/github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset/kvrwset/kv_rwset.pb.go b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset/kvrwset/kv_rwset.pb.go new file mode 100644 index 00000000000..bee28b46a5e --- /dev/null +++ b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset/kvrwset/kv_rwset.pb.go @@ -0,0 +1,1223 @@ +// Copyright the Hyperledger Fabric contributors. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: ledger/rwset/kvrwset/kv_rwset.proto + +package kvrwset + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// KVRWSet encapsulates the read-write set for a chaincode that operates upon a KV or Document data model +// This structure is used for both the public data and the private data +type KVRWSet struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Reads []*KVRead `protobuf:"bytes,1,rep,name=reads,proto3" json:"reads,omitempty"` + RangeQueriesInfo []*RangeQueryInfo `protobuf:"bytes,2,rep,name=range_queries_info,json=rangeQueriesInfo,proto3" json:"range_queries_info,omitempty"` + Writes []*KVWrite `protobuf:"bytes,3,rep,name=writes,proto3" json:"writes,omitempty"` + MetadataWrites []*KVMetadataWrite `protobuf:"bytes,4,rep,name=metadata_writes,json=metadataWrites,proto3" json:"metadata_writes,omitempty"` +} + +func (x *KVRWSet) Reset() { + *x = KVRWSet{} + if protoimpl.UnsafeEnabled { + mi := &file_ledger_rwset_kvrwset_kv_rwset_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *KVRWSet) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*KVRWSet) ProtoMessage() {} + +func (x *KVRWSet) ProtoReflect() protoreflect.Message { + mi := &file_ledger_rwset_kvrwset_kv_rwset_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use KVRWSet.ProtoReflect.Descriptor instead. +func (*KVRWSet) Descriptor() ([]byte, []int) { + return file_ledger_rwset_kvrwset_kv_rwset_proto_rawDescGZIP(), []int{0} +} + +func (x *KVRWSet) GetReads() []*KVRead { + if x != nil { + return x.Reads + } + return nil +} + +func (x *KVRWSet) GetRangeQueriesInfo() []*RangeQueryInfo { + if x != nil { + return x.RangeQueriesInfo + } + return nil +} + +func (x *KVRWSet) GetWrites() []*KVWrite { + if x != nil { + return x.Writes + } + return nil +} + +func (x *KVRWSet) GetMetadataWrites() []*KVMetadataWrite { + if x != nil { + return x.MetadataWrites + } + return nil +} + +// HashedRWSet encapsulates hashed representation of a private read-write set for KV or Document data model +type HashedRWSet struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + HashedReads []*KVReadHash `protobuf:"bytes,1,rep,name=hashed_reads,json=hashedReads,proto3" json:"hashed_reads,omitempty"` + HashedWrites []*KVWriteHash `protobuf:"bytes,2,rep,name=hashed_writes,json=hashedWrites,proto3" json:"hashed_writes,omitempty"` + MetadataWrites []*KVMetadataWriteHash `protobuf:"bytes,3,rep,name=metadata_writes,json=metadataWrites,proto3" json:"metadata_writes,omitempty"` +} + +func (x *HashedRWSet) Reset() { + *x = HashedRWSet{} + if protoimpl.UnsafeEnabled { + mi := &file_ledger_rwset_kvrwset_kv_rwset_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HashedRWSet) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HashedRWSet) ProtoMessage() {} + +func (x *HashedRWSet) ProtoReflect() protoreflect.Message { + mi := &file_ledger_rwset_kvrwset_kv_rwset_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use HashedRWSet.ProtoReflect.Descriptor instead. +func (*HashedRWSet) Descriptor() ([]byte, []int) { + return file_ledger_rwset_kvrwset_kv_rwset_proto_rawDescGZIP(), []int{1} +} + +func (x *HashedRWSet) GetHashedReads() []*KVReadHash { + if x != nil { + return x.HashedReads + } + return nil +} + +func (x *HashedRWSet) GetHashedWrites() []*KVWriteHash { + if x != nil { + return x.HashedWrites + } + return nil +} + +func (x *HashedRWSet) GetMetadataWrites() []*KVMetadataWriteHash { + if x != nil { + return x.MetadataWrites + } + return nil +} + +// KVRead captures a read operation performed during transaction simulation +// A 'nil' version indicates a non-existing key read by the transaction +type KVRead struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Version *Version `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` +} + +func (x *KVRead) Reset() { + *x = KVRead{} + if protoimpl.UnsafeEnabled { + mi := &file_ledger_rwset_kvrwset_kv_rwset_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *KVRead) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*KVRead) ProtoMessage() {} + +func (x *KVRead) ProtoReflect() protoreflect.Message { + mi := &file_ledger_rwset_kvrwset_kv_rwset_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use KVRead.ProtoReflect.Descriptor instead. +func (*KVRead) Descriptor() ([]byte, []int) { + return file_ledger_rwset_kvrwset_kv_rwset_proto_rawDescGZIP(), []int{2} +} + +func (x *KVRead) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *KVRead) GetVersion() *Version { + if x != nil { + return x.Version + } + return nil +} + +// KVWrite captures a write (update/delete) operation performed during transaction simulation +type KVWrite struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + IsDelete bool `protobuf:"varint,2,opt,name=is_delete,json=isDelete,proto3" json:"is_delete,omitempty"` + Value []byte `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *KVWrite) Reset() { + *x = KVWrite{} + if protoimpl.UnsafeEnabled { + mi := &file_ledger_rwset_kvrwset_kv_rwset_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *KVWrite) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*KVWrite) ProtoMessage() {} + +func (x *KVWrite) ProtoReflect() protoreflect.Message { + mi := &file_ledger_rwset_kvrwset_kv_rwset_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use KVWrite.ProtoReflect.Descriptor instead. +func (*KVWrite) Descriptor() ([]byte, []int) { + return file_ledger_rwset_kvrwset_kv_rwset_proto_rawDescGZIP(), []int{3} +} + +func (x *KVWrite) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *KVWrite) GetIsDelete() bool { + if x != nil { + return x.IsDelete + } + return false +} + +func (x *KVWrite) GetValue() []byte { + if x != nil { + return x.Value + } + return nil +} + +// KVMetadataWrite captures all the entries in the metadata associated with a key +type KVMetadataWrite struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Entries []*KVMetadataEntry `protobuf:"bytes,2,rep,name=entries,proto3" json:"entries,omitempty"` +} + +func (x *KVMetadataWrite) Reset() { + *x = KVMetadataWrite{} + if protoimpl.UnsafeEnabled { + mi := &file_ledger_rwset_kvrwset_kv_rwset_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *KVMetadataWrite) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*KVMetadataWrite) ProtoMessage() {} + +func (x *KVMetadataWrite) ProtoReflect() protoreflect.Message { + mi := &file_ledger_rwset_kvrwset_kv_rwset_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use KVMetadataWrite.ProtoReflect.Descriptor instead. +func (*KVMetadataWrite) Descriptor() ([]byte, []int) { + return file_ledger_rwset_kvrwset_kv_rwset_proto_rawDescGZIP(), []int{4} +} + +func (x *KVMetadataWrite) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *KVMetadataWrite) GetEntries() []*KVMetadataEntry { + if x != nil { + return x.Entries + } + return nil +} + +// KVReadHash is similar to the KVRead in spirit. However, it captures the hash of the key instead of the key itself +// version is kept as is for now. However, if the version also needs to be privacy-protected, it would need to be the +// hash of the version and hence of 'bytes' type +type KVReadHash struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + KeyHash []byte `protobuf:"bytes,1,opt,name=key_hash,json=keyHash,proto3" json:"key_hash,omitempty"` + Version *Version `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` +} + +func (x *KVReadHash) Reset() { + *x = KVReadHash{} + if protoimpl.UnsafeEnabled { + mi := &file_ledger_rwset_kvrwset_kv_rwset_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *KVReadHash) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*KVReadHash) ProtoMessage() {} + +func (x *KVReadHash) ProtoReflect() protoreflect.Message { + mi := &file_ledger_rwset_kvrwset_kv_rwset_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use KVReadHash.ProtoReflect.Descriptor instead. +func (*KVReadHash) Descriptor() ([]byte, []int) { + return file_ledger_rwset_kvrwset_kv_rwset_proto_rawDescGZIP(), []int{5} +} + +func (x *KVReadHash) GetKeyHash() []byte { + if x != nil { + return x.KeyHash + } + return nil +} + +func (x *KVReadHash) GetVersion() *Version { + if x != nil { + return x.Version + } + return nil +} + +// KVWriteHash is similar to the KVWrite. It captures a write (update/delete) operation performed during transaction simulation +type KVWriteHash struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + KeyHash []byte `protobuf:"bytes,1,opt,name=key_hash,json=keyHash,proto3" json:"key_hash,omitempty"` + IsDelete bool `protobuf:"varint,2,opt,name=is_delete,json=isDelete,proto3" json:"is_delete,omitempty"` + ValueHash []byte `protobuf:"bytes,3,opt,name=value_hash,json=valueHash,proto3" json:"value_hash,omitempty"` + IsPurge bool `protobuf:"varint,4,opt,name=is_purge,json=isPurge,proto3" json:"is_purge,omitempty"` +} + +func (x *KVWriteHash) Reset() { + *x = KVWriteHash{} + if protoimpl.UnsafeEnabled { + mi := &file_ledger_rwset_kvrwset_kv_rwset_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *KVWriteHash) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*KVWriteHash) ProtoMessage() {} + +func (x *KVWriteHash) ProtoReflect() protoreflect.Message { + mi := &file_ledger_rwset_kvrwset_kv_rwset_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use KVWriteHash.ProtoReflect.Descriptor instead. +func (*KVWriteHash) Descriptor() ([]byte, []int) { + return file_ledger_rwset_kvrwset_kv_rwset_proto_rawDescGZIP(), []int{6} +} + +func (x *KVWriteHash) GetKeyHash() []byte { + if x != nil { + return x.KeyHash + } + return nil +} + +func (x *KVWriteHash) GetIsDelete() bool { + if x != nil { + return x.IsDelete + } + return false +} + +func (x *KVWriteHash) GetValueHash() []byte { + if x != nil { + return x.ValueHash + } + return nil +} + +func (x *KVWriteHash) GetIsPurge() bool { + if x != nil { + return x.IsPurge + } + return false +} + +// KVMetadataWriteHash captures all the upserts to the metadata associated with a key hash +type KVMetadataWriteHash struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + KeyHash []byte `protobuf:"bytes,1,opt,name=key_hash,json=keyHash,proto3" json:"key_hash,omitempty"` + Entries []*KVMetadataEntry `protobuf:"bytes,2,rep,name=entries,proto3" json:"entries,omitempty"` +} + +func (x *KVMetadataWriteHash) Reset() { + *x = KVMetadataWriteHash{} + if protoimpl.UnsafeEnabled { + mi := &file_ledger_rwset_kvrwset_kv_rwset_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *KVMetadataWriteHash) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*KVMetadataWriteHash) ProtoMessage() {} + +func (x *KVMetadataWriteHash) ProtoReflect() protoreflect.Message { + mi := &file_ledger_rwset_kvrwset_kv_rwset_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use KVMetadataWriteHash.ProtoReflect.Descriptor instead. +func (*KVMetadataWriteHash) Descriptor() ([]byte, []int) { + return file_ledger_rwset_kvrwset_kv_rwset_proto_rawDescGZIP(), []int{7} +} + +func (x *KVMetadataWriteHash) GetKeyHash() []byte { + if x != nil { + return x.KeyHash + } + return nil +} + +func (x *KVMetadataWriteHash) GetEntries() []*KVMetadataEntry { + if x != nil { + return x.Entries + } + return nil +} + +// KVMetadataEntry captures a 'name'ed entry in the metadata of a key/key-hash. +type KVMetadataEntry struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *KVMetadataEntry) Reset() { + *x = KVMetadataEntry{} + if protoimpl.UnsafeEnabled { + mi := &file_ledger_rwset_kvrwset_kv_rwset_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *KVMetadataEntry) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*KVMetadataEntry) ProtoMessage() {} + +func (x *KVMetadataEntry) ProtoReflect() protoreflect.Message { + mi := &file_ledger_rwset_kvrwset_kv_rwset_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use KVMetadataEntry.ProtoReflect.Descriptor instead. +func (*KVMetadataEntry) Descriptor() ([]byte, []int) { + return file_ledger_rwset_kvrwset_kv_rwset_proto_rawDescGZIP(), []int{8} +} + +func (x *KVMetadataEntry) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *KVMetadataEntry) GetValue() []byte { + if x != nil { + return x.Value + } + return nil +} + +// Version encapsulates the version of a Key +// A version of a committed key is maintained as the height of the transaction that committed the key. +// The height is represenetd as a tuple where the txNum is the position of the transaction +// (starting with 0) within block +type Version struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + BlockNum uint64 `protobuf:"varint,1,opt,name=block_num,json=blockNum,proto3" json:"block_num,omitempty"` + TxNum uint64 `protobuf:"varint,2,opt,name=tx_num,json=txNum,proto3" json:"tx_num,omitempty"` +} + +func (x *Version) Reset() { + *x = Version{} + if protoimpl.UnsafeEnabled { + mi := &file_ledger_rwset_kvrwset_kv_rwset_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Version) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Version) ProtoMessage() {} + +func (x *Version) ProtoReflect() protoreflect.Message { + mi := &file_ledger_rwset_kvrwset_kv_rwset_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Version.ProtoReflect.Descriptor instead. +func (*Version) Descriptor() ([]byte, []int) { + return file_ledger_rwset_kvrwset_kv_rwset_proto_rawDescGZIP(), []int{9} +} + +func (x *Version) GetBlockNum() uint64 { + if x != nil { + return x.BlockNum + } + return 0 +} + +func (x *Version) GetTxNum() uint64 { + if x != nil { + return x.TxNum + } + return 0 +} + +// RangeQueryInfo encapsulates the details of a range query performed by a transaction during simulation. +// This helps protect transactions from phantom reads by varifying during validation whether any new items +// got committed within the given range between transaction simuation and validation +// (in addition to regular checks for updates/deletes of the existing items). +// readInfo field contains either the KVReads (for the items read by the range query) or a merkle-tree hash +// if the KVReads exceeds a pre-configured numbers +type RangeQueryInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + StartKey string `protobuf:"bytes,1,opt,name=start_key,json=startKey,proto3" json:"start_key,omitempty"` + EndKey string `protobuf:"bytes,2,opt,name=end_key,json=endKey,proto3" json:"end_key,omitempty"` + ItrExhausted bool `protobuf:"varint,3,opt,name=itr_exhausted,json=itrExhausted,proto3" json:"itr_exhausted,omitempty"` + // Types that are assignable to ReadsInfo: + // + // *RangeQueryInfo_RawReads + // *RangeQueryInfo_ReadsMerkleHashes + ReadsInfo isRangeQueryInfo_ReadsInfo `protobuf_oneof:"reads_info"` +} + +func (x *RangeQueryInfo) Reset() { + *x = RangeQueryInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_ledger_rwset_kvrwset_kv_rwset_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RangeQueryInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RangeQueryInfo) ProtoMessage() {} + +func (x *RangeQueryInfo) ProtoReflect() protoreflect.Message { + mi := &file_ledger_rwset_kvrwset_kv_rwset_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RangeQueryInfo.ProtoReflect.Descriptor instead. +func (*RangeQueryInfo) Descriptor() ([]byte, []int) { + return file_ledger_rwset_kvrwset_kv_rwset_proto_rawDescGZIP(), []int{10} +} + +func (x *RangeQueryInfo) GetStartKey() string { + if x != nil { + return x.StartKey + } + return "" +} + +func (x *RangeQueryInfo) GetEndKey() string { + if x != nil { + return x.EndKey + } + return "" +} + +func (x *RangeQueryInfo) GetItrExhausted() bool { + if x != nil { + return x.ItrExhausted + } + return false +} + +func (m *RangeQueryInfo) GetReadsInfo() isRangeQueryInfo_ReadsInfo { + if m != nil { + return m.ReadsInfo + } + return nil +} + +func (x *RangeQueryInfo) GetRawReads() *QueryReads { + if x, ok := x.GetReadsInfo().(*RangeQueryInfo_RawReads); ok { + return x.RawReads + } + return nil +} + +func (x *RangeQueryInfo) GetReadsMerkleHashes() *QueryReadsMerkleSummary { + if x, ok := x.GetReadsInfo().(*RangeQueryInfo_ReadsMerkleHashes); ok { + return x.ReadsMerkleHashes + } + return nil +} + +type isRangeQueryInfo_ReadsInfo interface { + isRangeQueryInfo_ReadsInfo() +} + +type RangeQueryInfo_RawReads struct { + RawReads *QueryReads `protobuf:"bytes,4,opt,name=raw_reads,json=rawReads,proto3,oneof"` +} + +type RangeQueryInfo_ReadsMerkleHashes struct { + ReadsMerkleHashes *QueryReadsMerkleSummary `protobuf:"bytes,5,opt,name=reads_merkle_hashes,json=readsMerkleHashes,proto3,oneof"` +} + +func (*RangeQueryInfo_RawReads) isRangeQueryInfo_ReadsInfo() {} + +func (*RangeQueryInfo_ReadsMerkleHashes) isRangeQueryInfo_ReadsInfo() {} + +// QueryReads encapsulates the KVReads for the items read by a transaction as a result of a query execution +type QueryReads struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + KvReads []*KVRead `protobuf:"bytes,1,rep,name=kv_reads,json=kvReads,proto3" json:"kv_reads,omitempty"` +} + +func (x *QueryReads) Reset() { + *x = QueryReads{} + if protoimpl.UnsafeEnabled { + mi := &file_ledger_rwset_kvrwset_kv_rwset_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryReads) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryReads) ProtoMessage() {} + +func (x *QueryReads) ProtoReflect() protoreflect.Message { + mi := &file_ledger_rwset_kvrwset_kv_rwset_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use QueryReads.ProtoReflect.Descriptor instead. +func (*QueryReads) Descriptor() ([]byte, []int) { + return file_ledger_rwset_kvrwset_kv_rwset_proto_rawDescGZIP(), []int{11} +} + +func (x *QueryReads) GetKvReads() []*KVRead { + if x != nil { + return x.KvReads + } + return nil +} + +// QueryReadsMerkleSummary encapsulates the Merkle-tree hashes for the QueryReads +// This allows to reduce the size of RWSet in the presence of query results +// by storing certain hashes instead of actual results. +// maxDegree field refers to the maximum number of children in the tree at any level +// maxLevel field contains the lowest level which has lesser nodes than maxDegree (starting from leaf level) +type QueryReadsMerkleSummary struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + MaxDegree uint32 `protobuf:"varint,1,opt,name=max_degree,json=maxDegree,proto3" json:"max_degree,omitempty"` + MaxLevel uint32 `protobuf:"varint,2,opt,name=max_level,json=maxLevel,proto3" json:"max_level,omitempty"` + MaxLevelHashes [][]byte `protobuf:"bytes,3,rep,name=max_level_hashes,json=maxLevelHashes,proto3" json:"max_level_hashes,omitempty"` +} + +func (x *QueryReadsMerkleSummary) Reset() { + *x = QueryReadsMerkleSummary{} + if protoimpl.UnsafeEnabled { + mi := &file_ledger_rwset_kvrwset_kv_rwset_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryReadsMerkleSummary) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryReadsMerkleSummary) ProtoMessage() {} + +func (x *QueryReadsMerkleSummary) ProtoReflect() protoreflect.Message { + mi := &file_ledger_rwset_kvrwset_kv_rwset_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use QueryReadsMerkleSummary.ProtoReflect.Descriptor instead. +func (*QueryReadsMerkleSummary) Descriptor() ([]byte, []int) { + return file_ledger_rwset_kvrwset_kv_rwset_proto_rawDescGZIP(), []int{12} +} + +func (x *QueryReadsMerkleSummary) GetMaxDegree() uint32 { + if x != nil { + return x.MaxDegree + } + return 0 +} + +func (x *QueryReadsMerkleSummary) GetMaxLevel() uint32 { + if x != nil { + return x.MaxLevel + } + return 0 +} + +func (x *QueryReadsMerkleSummary) GetMaxLevelHashes() [][]byte { + if x != nil { + return x.MaxLevelHashes + } + return nil +} + +var File_ledger_rwset_kvrwset_kv_rwset_proto protoreflect.FileDescriptor + +var file_ledger_rwset_kvrwset_kv_rwset_proto_rawDesc = []byte{ + 0x0a, 0x23, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2f, 0x72, 0x77, 0x73, 0x65, 0x74, 0x2f, 0x6b, + 0x76, 0x72, 0x77, 0x73, 0x65, 0x74, 0x2f, 0x6b, 0x76, 0x5f, 0x72, 0x77, 0x73, 0x65, 0x74, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x07, 0x6b, 0x76, 0x72, 0x77, 0x73, 0x65, 0x74, 0x22, 0xe4, + 0x01, 0x0a, 0x07, 0x4b, 0x56, 0x52, 0x57, 0x53, 0x65, 0x74, 0x12, 0x25, 0x0a, 0x05, 0x72, 0x65, + 0x61, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x6b, 0x76, 0x72, 0x77, + 0x73, 0x65, 0x74, 0x2e, 0x4b, 0x56, 0x52, 0x65, 0x61, 0x64, 0x52, 0x05, 0x72, 0x65, 0x61, 0x64, + 0x73, 0x12, 0x45, 0x0a, 0x12, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x71, 0x75, 0x65, 0x72, 0x69, + 0x65, 0x73, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, + 0x6b, 0x76, 0x72, 0x77, 0x73, 0x65, 0x74, 0x2e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x10, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x51, 0x75, 0x65, + 0x72, 0x69, 0x65, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x28, 0x0a, 0x06, 0x77, 0x72, 0x69, 0x74, + 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x6b, 0x76, 0x72, 0x77, 0x73, + 0x65, 0x74, 0x2e, 0x4b, 0x56, 0x57, 0x72, 0x69, 0x74, 0x65, 0x52, 0x06, 0x77, 0x72, 0x69, 0x74, + 0x65, 0x73, 0x12, 0x41, 0x0a, 0x0f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x77, + 0x72, 0x69, 0x74, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6b, 0x76, + 0x72, 0x77, 0x73, 0x65, 0x74, 0x2e, 0x4b, 0x56, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0x57, 0x72, 0x69, 0x74, 0x65, 0x52, 0x0e, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x57, + 0x72, 0x69, 0x74, 0x65, 0x73, 0x22, 0xc7, 0x01, 0x0a, 0x0b, 0x48, 0x61, 0x73, 0x68, 0x65, 0x64, + 0x52, 0x57, 0x53, 0x65, 0x74, 0x12, 0x36, 0x0a, 0x0c, 0x68, 0x61, 0x73, 0x68, 0x65, 0x64, 0x5f, + 0x72, 0x65, 0x61, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x6b, 0x76, + 0x72, 0x77, 0x73, 0x65, 0x74, 0x2e, 0x4b, 0x56, 0x52, 0x65, 0x61, 0x64, 0x48, 0x61, 0x73, 0x68, + 0x52, 0x0b, 0x68, 0x61, 0x73, 0x68, 0x65, 0x64, 0x52, 0x65, 0x61, 0x64, 0x73, 0x12, 0x39, 0x0a, + 0x0d, 0x68, 0x61, 0x73, 0x68, 0x65, 0x64, 0x5f, 0x77, 0x72, 0x69, 0x74, 0x65, 0x73, 0x18, 0x02, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6b, 0x76, 0x72, 0x77, 0x73, 0x65, 0x74, 0x2e, 0x4b, + 0x56, 0x57, 0x72, 0x69, 0x74, 0x65, 0x48, 0x61, 0x73, 0x68, 0x52, 0x0c, 0x68, 0x61, 0x73, 0x68, + 0x65, 0x64, 0x57, 0x72, 0x69, 0x74, 0x65, 0x73, 0x12, 0x45, 0x0a, 0x0f, 0x6d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0x5f, 0x77, 0x72, 0x69, 0x74, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x1c, 0x2e, 0x6b, 0x76, 0x72, 0x77, 0x73, 0x65, 0x74, 0x2e, 0x4b, 0x56, 0x4d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x57, 0x72, 0x69, 0x74, 0x65, 0x48, 0x61, 0x73, 0x68, 0x52, + 0x0e, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x57, 0x72, 0x69, 0x74, 0x65, 0x73, 0x22, + 0x46, 0x0a, 0x06, 0x4b, 0x56, 0x52, 0x65, 0x61, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2a, 0x0a, 0x07, 0x76, + 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x6b, + 0x76, 0x72, 0x77, 0x73, 0x65, 0x74, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x07, + 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x4e, 0x0a, 0x07, 0x4b, 0x56, 0x57, 0x72, 0x69, + 0x74, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x03, 0x6b, 0x65, 0x79, 0x12, 0x1b, 0x0a, 0x09, 0x69, 0x73, 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x69, 0x73, 0x44, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x57, 0x0a, 0x0f, 0x4b, 0x56, 0x4d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0x57, 0x72, 0x69, 0x74, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, + 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x32, 0x0a, 0x07, + 0x65, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, + 0x6b, 0x76, 0x72, 0x77, 0x73, 0x65, 0x74, 0x2e, 0x4b, 0x56, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x07, 0x65, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, + 0x22, 0x53, 0x0a, 0x0a, 0x4b, 0x56, 0x52, 0x65, 0x61, 0x64, 0x48, 0x61, 0x73, 0x68, 0x12, 0x19, + 0x0a, 0x08, 0x6b, 0x65, 0x79, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x07, 0x6b, 0x65, 0x79, 0x48, 0x61, 0x73, 0x68, 0x12, 0x2a, 0x0a, 0x07, 0x76, 0x65, 0x72, + 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x6b, 0x76, 0x72, + 0x77, 0x73, 0x65, 0x74, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x76, 0x65, + 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x7f, 0x0a, 0x0b, 0x4b, 0x56, 0x57, 0x72, 0x69, 0x74, 0x65, + 0x48, 0x61, 0x73, 0x68, 0x12, 0x19, 0x0a, 0x08, 0x6b, 0x65, 0x79, 0x5f, 0x68, 0x61, 0x73, 0x68, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x6b, 0x65, 0x79, 0x48, 0x61, 0x73, 0x68, 0x12, + 0x1b, 0x0a, 0x09, 0x69, 0x73, 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x08, 0x69, 0x73, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x1d, 0x0a, 0x0a, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x09, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x61, 0x73, 0x68, 0x12, 0x19, 0x0a, 0x08, 0x69, + 0x73, 0x5f, 0x70, 0x75, 0x72, 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x69, + 0x73, 0x50, 0x75, 0x72, 0x67, 0x65, 0x22, 0x64, 0x0a, 0x13, 0x4b, 0x56, 0x4d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0x57, 0x72, 0x69, 0x74, 0x65, 0x48, 0x61, 0x73, 0x68, 0x12, 0x19, 0x0a, + 0x08, 0x6b, 0x65, 0x79, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x07, 0x6b, 0x65, 0x79, 0x48, 0x61, 0x73, 0x68, 0x12, 0x32, 0x0a, 0x07, 0x65, 0x6e, 0x74, 0x72, + 0x69, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6b, 0x76, 0x72, 0x77, + 0x73, 0x65, 0x74, 0x2e, 0x4b, 0x56, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x45, 0x6e, + 0x74, 0x72, 0x79, 0x52, 0x07, 0x65, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x22, 0x3b, 0x0a, 0x0f, + 0x4b, 0x56, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, + 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x3d, 0x0a, 0x07, 0x56, 0x65, 0x72, + 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1b, 0x0a, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, + 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, + 0x6d, 0x12, 0x15, 0x0a, 0x06, 0x74, 0x78, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x05, 0x74, 0x78, 0x4e, 0x75, 0x6d, 0x22, 0x81, 0x02, 0x0a, 0x0e, 0x52, 0x61, 0x6e, + 0x67, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1b, 0x0a, 0x09, 0x73, + 0x74, 0x61, 0x72, 0x74, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, + 0x73, 0x74, 0x61, 0x72, 0x74, 0x4b, 0x65, 0x79, 0x12, 0x17, 0x0a, 0x07, 0x65, 0x6e, 0x64, 0x5f, + 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x65, 0x6e, 0x64, 0x4b, 0x65, + 0x79, 0x12, 0x23, 0x0a, 0x0d, 0x69, 0x74, 0x72, 0x5f, 0x65, 0x78, 0x68, 0x61, 0x75, 0x73, 0x74, + 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x69, 0x74, 0x72, 0x45, 0x78, 0x68, + 0x61, 0x75, 0x73, 0x74, 0x65, 0x64, 0x12, 0x32, 0x0a, 0x09, 0x72, 0x61, 0x77, 0x5f, 0x72, 0x65, + 0x61, 0x64, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x6b, 0x76, 0x72, 0x77, + 0x73, 0x65, 0x74, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x61, 0x64, 0x73, 0x48, 0x00, + 0x52, 0x08, 0x72, 0x61, 0x77, 0x52, 0x65, 0x61, 0x64, 0x73, 0x12, 0x52, 0x0a, 0x13, 0x72, 0x65, + 0x61, 0x64, 0x73, 0x5f, 0x6d, 0x65, 0x72, 0x6b, 0x6c, 0x65, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x65, + 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x6b, 0x76, 0x72, 0x77, 0x73, 0x65, + 0x74, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x61, 0x64, 0x73, 0x4d, 0x65, 0x72, 0x6b, + 0x6c, 0x65, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x48, 0x00, 0x52, 0x11, 0x72, 0x65, 0x61, + 0x64, 0x73, 0x4d, 0x65, 0x72, 0x6b, 0x6c, 0x65, 0x48, 0x61, 0x73, 0x68, 0x65, 0x73, 0x42, 0x0c, + 0x0a, 0x0a, 0x72, 0x65, 0x61, 0x64, 0x73, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x22, 0x38, 0x0a, 0x0a, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x61, 0x64, 0x73, 0x12, 0x2a, 0x0a, 0x08, 0x6b, 0x76, + 0x5f, 0x72, 0x65, 0x61, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x6b, + 0x76, 0x72, 0x77, 0x73, 0x65, 0x74, 0x2e, 0x4b, 0x56, 0x52, 0x65, 0x61, 0x64, 0x52, 0x07, 0x6b, + 0x76, 0x52, 0x65, 0x61, 0x64, 0x73, 0x22, 0x7f, 0x0a, 0x17, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, + 0x65, 0x61, 0x64, 0x73, 0x4d, 0x65, 0x72, 0x6b, 0x6c, 0x65, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, + 0x79, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x61, 0x78, 0x5f, 0x64, 0x65, 0x67, 0x72, 0x65, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x6d, 0x61, 0x78, 0x44, 0x65, 0x67, 0x72, 0x65, 0x65, + 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x61, 0x78, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0d, 0x52, 0x08, 0x6d, 0x61, 0x78, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x28, 0x0a, + 0x10, 0x6d, 0x61, 0x78, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x65, + 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x0e, 0x6d, 0x61, 0x78, 0x4c, 0x65, 0x76, 0x65, + 0x6c, 0x48, 0x61, 0x73, 0x68, 0x65, 0x73, 0x42, 0xc2, 0x01, 0x0a, 0x32, 0x6f, 0x72, 0x67, 0x2e, + 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2e, 0x66, 0x61, 0x62, 0x72, + 0x69, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, + 0x2e, 0x72, 0x77, 0x73, 0x65, 0x74, 0x2e, 0x6b, 0x76, 0x72, 0x77, 0x73, 0x65, 0x74, 0x42, 0x0c, + 0x4b, 0x56, 0x52, 0x57, 0x53, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x42, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x79, 0x70, 0x65, 0x72, + 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2f, 0x66, 0x61, 0x62, 0x72, 0x69, 0x63, 0x2d, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x73, 0x2d, 0x67, 0x6f, 0x2d, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6c, 0x65, + 0x64, 0x67, 0x65, 0x72, 0x2f, 0x72, 0x77, 0x73, 0x65, 0x74, 0x2f, 0x6b, 0x76, 0x72, 0x77, 0x73, + 0x65, 0x74, 0xa2, 0x02, 0x03, 0x4b, 0x58, 0x58, 0xaa, 0x02, 0x07, 0x4b, 0x76, 0x72, 0x77, 0x73, + 0x65, 0x74, 0xca, 0x02, 0x07, 0x4b, 0x76, 0x72, 0x77, 0x73, 0x65, 0x74, 0xe2, 0x02, 0x13, 0x4b, + 0x76, 0x72, 0x77, 0x73, 0x65, 0x74, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0xea, 0x02, 0x07, 0x4b, 0x76, 0x72, 0x77, 0x73, 0x65, 0x74, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_ledger_rwset_kvrwset_kv_rwset_proto_rawDescOnce sync.Once + file_ledger_rwset_kvrwset_kv_rwset_proto_rawDescData = file_ledger_rwset_kvrwset_kv_rwset_proto_rawDesc +) + +func file_ledger_rwset_kvrwset_kv_rwset_proto_rawDescGZIP() []byte { + file_ledger_rwset_kvrwset_kv_rwset_proto_rawDescOnce.Do(func() { + file_ledger_rwset_kvrwset_kv_rwset_proto_rawDescData = protoimpl.X.CompressGZIP(file_ledger_rwset_kvrwset_kv_rwset_proto_rawDescData) + }) + return file_ledger_rwset_kvrwset_kv_rwset_proto_rawDescData +} + +var file_ledger_rwset_kvrwset_kv_rwset_proto_msgTypes = make([]protoimpl.MessageInfo, 13) +var file_ledger_rwset_kvrwset_kv_rwset_proto_goTypes = []interface{}{ + (*KVRWSet)(nil), // 0: kvrwset.KVRWSet + (*HashedRWSet)(nil), // 1: kvrwset.HashedRWSet + (*KVRead)(nil), // 2: kvrwset.KVRead + (*KVWrite)(nil), // 3: kvrwset.KVWrite + (*KVMetadataWrite)(nil), // 4: kvrwset.KVMetadataWrite + (*KVReadHash)(nil), // 5: kvrwset.KVReadHash + (*KVWriteHash)(nil), // 6: kvrwset.KVWriteHash + (*KVMetadataWriteHash)(nil), // 7: kvrwset.KVMetadataWriteHash + (*KVMetadataEntry)(nil), // 8: kvrwset.KVMetadataEntry + (*Version)(nil), // 9: kvrwset.Version + (*RangeQueryInfo)(nil), // 10: kvrwset.RangeQueryInfo + (*QueryReads)(nil), // 11: kvrwset.QueryReads + (*QueryReadsMerkleSummary)(nil), // 12: kvrwset.QueryReadsMerkleSummary +} +var file_ledger_rwset_kvrwset_kv_rwset_proto_depIdxs = []int32{ + 2, // 0: kvrwset.KVRWSet.reads:type_name -> kvrwset.KVRead + 10, // 1: kvrwset.KVRWSet.range_queries_info:type_name -> kvrwset.RangeQueryInfo + 3, // 2: kvrwset.KVRWSet.writes:type_name -> kvrwset.KVWrite + 4, // 3: kvrwset.KVRWSet.metadata_writes:type_name -> kvrwset.KVMetadataWrite + 5, // 4: kvrwset.HashedRWSet.hashed_reads:type_name -> kvrwset.KVReadHash + 6, // 5: kvrwset.HashedRWSet.hashed_writes:type_name -> kvrwset.KVWriteHash + 7, // 6: kvrwset.HashedRWSet.metadata_writes:type_name -> kvrwset.KVMetadataWriteHash + 9, // 7: kvrwset.KVRead.version:type_name -> kvrwset.Version + 8, // 8: kvrwset.KVMetadataWrite.entries:type_name -> kvrwset.KVMetadataEntry + 9, // 9: kvrwset.KVReadHash.version:type_name -> kvrwset.Version + 8, // 10: kvrwset.KVMetadataWriteHash.entries:type_name -> kvrwset.KVMetadataEntry + 11, // 11: kvrwset.RangeQueryInfo.raw_reads:type_name -> kvrwset.QueryReads + 12, // 12: kvrwset.RangeQueryInfo.reads_merkle_hashes:type_name -> kvrwset.QueryReadsMerkleSummary + 2, // 13: kvrwset.QueryReads.kv_reads:type_name -> kvrwset.KVRead + 14, // [14:14] is the sub-list for method output_type + 14, // [14:14] is the sub-list for method input_type + 14, // [14:14] is the sub-list for extension type_name + 14, // [14:14] is the sub-list for extension extendee + 0, // [0:14] is the sub-list for field type_name +} + +func init() { file_ledger_rwset_kvrwset_kv_rwset_proto_init() } +func file_ledger_rwset_kvrwset_kv_rwset_proto_init() { + if File_ledger_rwset_kvrwset_kv_rwset_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_ledger_rwset_kvrwset_kv_rwset_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*KVRWSet); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ledger_rwset_kvrwset_kv_rwset_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*HashedRWSet); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ledger_rwset_kvrwset_kv_rwset_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*KVRead); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ledger_rwset_kvrwset_kv_rwset_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*KVWrite); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ledger_rwset_kvrwset_kv_rwset_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*KVMetadataWrite); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ledger_rwset_kvrwset_kv_rwset_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*KVReadHash); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ledger_rwset_kvrwset_kv_rwset_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*KVWriteHash); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ledger_rwset_kvrwset_kv_rwset_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*KVMetadataWriteHash); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ledger_rwset_kvrwset_kv_rwset_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*KVMetadataEntry); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ledger_rwset_kvrwset_kv_rwset_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Version); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ledger_rwset_kvrwset_kv_rwset_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RangeQueryInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ledger_rwset_kvrwset_kv_rwset_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryReads); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ledger_rwset_kvrwset_kv_rwset_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryReadsMerkleSummary); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_ledger_rwset_kvrwset_kv_rwset_proto_msgTypes[10].OneofWrappers = []interface{}{ + (*RangeQueryInfo_RawReads)(nil), + (*RangeQueryInfo_ReadsMerkleHashes)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_ledger_rwset_kvrwset_kv_rwset_proto_rawDesc, + NumEnums: 0, + NumMessages: 13, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_ledger_rwset_kvrwset_kv_rwset_proto_goTypes, + DependencyIndexes: file_ledger_rwset_kvrwset_kv_rwset_proto_depIdxs, + MessageInfos: file_ledger_rwset_kvrwset_kv_rwset_proto_msgTypes, + }.Build() + File_ledger_rwset_kvrwset_kv_rwset_proto = out.File + file_ledger_rwset_kvrwset_kv_rwset_proto_rawDesc = nil + file_ledger_rwset_kvrwset_kv_rwset_proto_goTypes = nil + file_ledger_rwset_kvrwset_kv_rwset_proto_depIdxs = nil +} diff --git a/vendor/github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset/rwset.pb.go b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset/rwset.pb.go new file mode 100644 index 00000000000..5f13260adf8 --- /dev/null +++ b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset/rwset.pb.go @@ -0,0 +1,630 @@ +// Copyright the Hyperledger Fabric contributors. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: ledger/rwset/rwset.proto + +package rwset + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type TxReadWriteSet_DataModel int32 + +const ( + TxReadWriteSet_KV TxReadWriteSet_DataModel = 0 +) + +// Enum value maps for TxReadWriteSet_DataModel. +var ( + TxReadWriteSet_DataModel_name = map[int32]string{ + 0: "KV", + } + TxReadWriteSet_DataModel_value = map[string]int32{ + "KV": 0, + } +) + +func (x TxReadWriteSet_DataModel) Enum() *TxReadWriteSet_DataModel { + p := new(TxReadWriteSet_DataModel) + *p = x + return p +} + +func (x TxReadWriteSet_DataModel) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (TxReadWriteSet_DataModel) Descriptor() protoreflect.EnumDescriptor { + return file_ledger_rwset_rwset_proto_enumTypes[0].Descriptor() +} + +func (TxReadWriteSet_DataModel) Type() protoreflect.EnumType { + return &file_ledger_rwset_rwset_proto_enumTypes[0] +} + +func (x TxReadWriteSet_DataModel) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use TxReadWriteSet_DataModel.Descriptor instead. +func (TxReadWriteSet_DataModel) EnumDescriptor() ([]byte, []int) { + return file_ledger_rwset_rwset_proto_rawDescGZIP(), []int{0, 0} +} + +// TxReadWriteSet encapsulates a read-write set for a transaction +// DataModel specifies the enum value of the data model +// ns_rwset field specifies a list of chaincode specific read-write set (one for each chaincode) +type TxReadWriteSet struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + DataModel TxReadWriteSet_DataModel `protobuf:"varint,1,opt,name=data_model,json=dataModel,proto3,enum=rwset.TxReadWriteSet_DataModel" json:"data_model,omitempty"` + NsRwset []*NsReadWriteSet `protobuf:"bytes,2,rep,name=ns_rwset,json=nsRwset,proto3" json:"ns_rwset,omitempty"` +} + +func (x *TxReadWriteSet) Reset() { + *x = TxReadWriteSet{} + if protoimpl.UnsafeEnabled { + mi := &file_ledger_rwset_rwset_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TxReadWriteSet) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TxReadWriteSet) ProtoMessage() {} + +func (x *TxReadWriteSet) ProtoReflect() protoreflect.Message { + mi := &file_ledger_rwset_rwset_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TxReadWriteSet.ProtoReflect.Descriptor instead. +func (*TxReadWriteSet) Descriptor() ([]byte, []int) { + return file_ledger_rwset_rwset_proto_rawDescGZIP(), []int{0} +} + +func (x *TxReadWriteSet) GetDataModel() TxReadWriteSet_DataModel { + if x != nil { + return x.DataModel + } + return TxReadWriteSet_KV +} + +func (x *TxReadWriteSet) GetNsRwset() []*NsReadWriteSet { + if x != nil { + return x.NsRwset + } + return nil +} + +// NsReadWriteSet encapsulates the read-write set for a chaincode +type NsReadWriteSet struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"` + Rwset []byte `protobuf:"bytes,2,opt,name=rwset,proto3" json:"rwset,omitempty"` // Data model specific serialized proto message (e.g., kvrwset.KVRWSet for KV and Document data models) + CollectionHashedRwset []*CollectionHashedReadWriteSet `protobuf:"bytes,3,rep,name=collection_hashed_rwset,json=collectionHashedRwset,proto3" json:"collection_hashed_rwset,omitempty"` +} + +func (x *NsReadWriteSet) Reset() { + *x = NsReadWriteSet{} + if protoimpl.UnsafeEnabled { + mi := &file_ledger_rwset_rwset_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NsReadWriteSet) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NsReadWriteSet) ProtoMessage() {} + +func (x *NsReadWriteSet) ProtoReflect() protoreflect.Message { + mi := &file_ledger_rwset_rwset_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use NsReadWriteSet.ProtoReflect.Descriptor instead. +func (*NsReadWriteSet) Descriptor() ([]byte, []int) { + return file_ledger_rwset_rwset_proto_rawDescGZIP(), []int{1} +} + +func (x *NsReadWriteSet) GetNamespace() string { + if x != nil { + return x.Namespace + } + return "" +} + +func (x *NsReadWriteSet) GetRwset() []byte { + if x != nil { + return x.Rwset + } + return nil +} + +func (x *NsReadWriteSet) GetCollectionHashedRwset() []*CollectionHashedReadWriteSet { + if x != nil { + return x.CollectionHashedRwset + } + return nil +} + +// CollectionHashedReadWriteSet encapsulate the hashed representation for the private read-write set for a collection +type CollectionHashedReadWriteSet struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CollectionName string `protobuf:"bytes,1,opt,name=collection_name,json=collectionName,proto3" json:"collection_name,omitempty"` + HashedRwset []byte `protobuf:"bytes,2,opt,name=hashed_rwset,json=hashedRwset,proto3" json:"hashed_rwset,omitempty"` // Data model specific serialized proto message (e.g., kvrwset.HashedRWSet for KV and Document data models) + PvtRwsetHash []byte `protobuf:"bytes,3,opt,name=pvt_rwset_hash,json=pvtRwsetHash,proto3" json:"pvt_rwset_hash,omitempty"` // Hash of entire private read-write set for a specific collection. This helps in authenticating the private read-write set efficiently +} + +func (x *CollectionHashedReadWriteSet) Reset() { + *x = CollectionHashedReadWriteSet{} + if protoimpl.UnsafeEnabled { + mi := &file_ledger_rwset_rwset_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CollectionHashedReadWriteSet) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CollectionHashedReadWriteSet) ProtoMessage() {} + +func (x *CollectionHashedReadWriteSet) ProtoReflect() protoreflect.Message { + mi := &file_ledger_rwset_rwset_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CollectionHashedReadWriteSet.ProtoReflect.Descriptor instead. +func (*CollectionHashedReadWriteSet) Descriptor() ([]byte, []int) { + return file_ledger_rwset_rwset_proto_rawDescGZIP(), []int{2} +} + +func (x *CollectionHashedReadWriteSet) GetCollectionName() string { + if x != nil { + return x.CollectionName + } + return "" +} + +func (x *CollectionHashedReadWriteSet) GetHashedRwset() []byte { + if x != nil { + return x.HashedRwset + } + return nil +} + +func (x *CollectionHashedReadWriteSet) GetPvtRwsetHash() []byte { + if x != nil { + return x.PvtRwsetHash + } + return nil +} + +// TxPvtReadWriteSet encapsulate the private read-write set for a transaction +type TxPvtReadWriteSet struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + DataModel TxReadWriteSet_DataModel `protobuf:"varint,1,opt,name=data_model,json=dataModel,proto3,enum=rwset.TxReadWriteSet_DataModel" json:"data_model,omitempty"` + NsPvtRwset []*NsPvtReadWriteSet `protobuf:"bytes,2,rep,name=ns_pvt_rwset,json=nsPvtRwset,proto3" json:"ns_pvt_rwset,omitempty"` +} + +func (x *TxPvtReadWriteSet) Reset() { + *x = TxPvtReadWriteSet{} + if protoimpl.UnsafeEnabled { + mi := &file_ledger_rwset_rwset_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TxPvtReadWriteSet) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TxPvtReadWriteSet) ProtoMessage() {} + +func (x *TxPvtReadWriteSet) ProtoReflect() protoreflect.Message { + mi := &file_ledger_rwset_rwset_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TxPvtReadWriteSet.ProtoReflect.Descriptor instead. +func (*TxPvtReadWriteSet) Descriptor() ([]byte, []int) { + return file_ledger_rwset_rwset_proto_rawDescGZIP(), []int{3} +} + +func (x *TxPvtReadWriteSet) GetDataModel() TxReadWriteSet_DataModel { + if x != nil { + return x.DataModel + } + return TxReadWriteSet_KV +} + +func (x *TxPvtReadWriteSet) GetNsPvtRwset() []*NsPvtReadWriteSet { + if x != nil { + return x.NsPvtRwset + } + return nil +} + +// NsPvtReadWriteSet encapsulates the private read-write set for a chaincode +type NsPvtReadWriteSet struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"` + CollectionPvtRwset []*CollectionPvtReadWriteSet `protobuf:"bytes,2,rep,name=collection_pvt_rwset,json=collectionPvtRwset,proto3" json:"collection_pvt_rwset,omitempty"` +} + +func (x *NsPvtReadWriteSet) Reset() { + *x = NsPvtReadWriteSet{} + if protoimpl.UnsafeEnabled { + mi := &file_ledger_rwset_rwset_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NsPvtReadWriteSet) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NsPvtReadWriteSet) ProtoMessage() {} + +func (x *NsPvtReadWriteSet) ProtoReflect() protoreflect.Message { + mi := &file_ledger_rwset_rwset_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use NsPvtReadWriteSet.ProtoReflect.Descriptor instead. +func (*NsPvtReadWriteSet) Descriptor() ([]byte, []int) { + return file_ledger_rwset_rwset_proto_rawDescGZIP(), []int{4} +} + +func (x *NsPvtReadWriteSet) GetNamespace() string { + if x != nil { + return x.Namespace + } + return "" +} + +func (x *NsPvtReadWriteSet) GetCollectionPvtRwset() []*CollectionPvtReadWriteSet { + if x != nil { + return x.CollectionPvtRwset + } + return nil +} + +// CollectionPvtReadWriteSet encapsulates the private read-write set for a collection +type CollectionPvtReadWriteSet struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CollectionName string `protobuf:"bytes,1,opt,name=collection_name,json=collectionName,proto3" json:"collection_name,omitempty"` + Rwset []byte `protobuf:"bytes,2,opt,name=rwset,proto3" json:"rwset,omitempty"` // Data model specific serialized proto message (e.g., kvrwset.KVRWSet for KV and Document data models) +} + +func (x *CollectionPvtReadWriteSet) Reset() { + *x = CollectionPvtReadWriteSet{} + if protoimpl.UnsafeEnabled { + mi := &file_ledger_rwset_rwset_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CollectionPvtReadWriteSet) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CollectionPvtReadWriteSet) ProtoMessage() {} + +func (x *CollectionPvtReadWriteSet) ProtoReflect() protoreflect.Message { + mi := &file_ledger_rwset_rwset_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CollectionPvtReadWriteSet.ProtoReflect.Descriptor instead. +func (*CollectionPvtReadWriteSet) Descriptor() ([]byte, []int) { + return file_ledger_rwset_rwset_proto_rawDescGZIP(), []int{5} +} + +func (x *CollectionPvtReadWriteSet) GetCollectionName() string { + if x != nil { + return x.CollectionName + } + return "" +} + +func (x *CollectionPvtReadWriteSet) GetRwset() []byte { + if x != nil { + return x.Rwset + } + return nil +} + +var File_ledger_rwset_rwset_proto protoreflect.FileDescriptor + +var file_ledger_rwset_rwset_proto_rawDesc = []byte{ + 0x0a, 0x18, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2f, 0x72, 0x77, 0x73, 0x65, 0x74, 0x2f, 0x72, + 0x77, 0x73, 0x65, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x05, 0x72, 0x77, 0x73, 0x65, + 0x74, 0x22, 0x97, 0x01, 0x0a, 0x0e, 0x54, 0x78, 0x52, 0x65, 0x61, 0x64, 0x57, 0x72, 0x69, 0x74, + 0x65, 0x53, 0x65, 0x74, 0x12, 0x3e, 0x0a, 0x0a, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x6d, 0x6f, 0x64, + 0x65, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1f, 0x2e, 0x72, 0x77, 0x73, 0x65, 0x74, + 0x2e, 0x54, 0x78, 0x52, 0x65, 0x61, 0x64, 0x57, 0x72, 0x69, 0x74, 0x65, 0x53, 0x65, 0x74, 0x2e, + 0x44, 0x61, 0x74, 0x61, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, 0x09, 0x64, 0x61, 0x74, 0x61, 0x4d, + 0x6f, 0x64, 0x65, 0x6c, 0x12, 0x30, 0x0a, 0x08, 0x6e, 0x73, 0x5f, 0x72, 0x77, 0x73, 0x65, 0x74, + 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x72, 0x77, 0x73, 0x65, 0x74, 0x2e, 0x4e, + 0x73, 0x52, 0x65, 0x61, 0x64, 0x57, 0x72, 0x69, 0x74, 0x65, 0x53, 0x65, 0x74, 0x52, 0x07, 0x6e, + 0x73, 0x52, 0x77, 0x73, 0x65, 0x74, 0x22, 0x13, 0x0a, 0x09, 0x44, 0x61, 0x74, 0x61, 0x4d, 0x6f, + 0x64, 0x65, 0x6c, 0x12, 0x06, 0x0a, 0x02, 0x4b, 0x56, 0x10, 0x00, 0x22, 0xa1, 0x01, 0x0a, 0x0e, + 0x4e, 0x73, 0x52, 0x65, 0x61, 0x64, 0x57, 0x72, 0x69, 0x74, 0x65, 0x53, 0x65, 0x74, 0x12, 0x1c, + 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x14, 0x0a, 0x05, + 0x72, 0x77, 0x73, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x72, 0x77, 0x73, + 0x65, 0x74, 0x12, 0x5b, 0x0a, 0x17, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x68, 0x61, 0x73, 0x68, 0x65, 0x64, 0x5f, 0x72, 0x77, 0x73, 0x65, 0x74, 0x18, 0x03, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x72, 0x77, 0x73, 0x65, 0x74, 0x2e, 0x43, 0x6f, 0x6c, 0x6c, + 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x61, 0x73, 0x68, 0x65, 0x64, 0x52, 0x65, 0x61, 0x64, + 0x57, 0x72, 0x69, 0x74, 0x65, 0x53, 0x65, 0x74, 0x52, 0x15, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x61, 0x73, 0x68, 0x65, 0x64, 0x52, 0x77, 0x73, 0x65, 0x74, 0x22, + 0x90, 0x01, 0x0a, 0x1c, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x61, + 0x73, 0x68, 0x65, 0x64, 0x52, 0x65, 0x61, 0x64, 0x57, 0x72, 0x69, 0x74, 0x65, 0x53, 0x65, 0x74, + 0x12, 0x27, 0x0a, 0x0f, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x6f, 0x6c, 0x6c, 0x65, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x68, 0x61, 0x73, + 0x68, 0x65, 0x64, 0x5f, 0x72, 0x77, 0x73, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x0b, 0x68, 0x61, 0x73, 0x68, 0x65, 0x64, 0x52, 0x77, 0x73, 0x65, 0x74, 0x12, 0x24, 0x0a, 0x0e, + 0x70, 0x76, 0x74, 0x5f, 0x72, 0x77, 0x73, 0x65, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x70, 0x76, 0x74, 0x52, 0x77, 0x73, 0x65, 0x74, 0x48, 0x61, + 0x73, 0x68, 0x22, 0x8f, 0x01, 0x0a, 0x11, 0x54, 0x78, 0x50, 0x76, 0x74, 0x52, 0x65, 0x61, 0x64, + 0x57, 0x72, 0x69, 0x74, 0x65, 0x53, 0x65, 0x74, 0x12, 0x3e, 0x0a, 0x0a, 0x64, 0x61, 0x74, 0x61, + 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1f, 0x2e, 0x72, + 0x77, 0x73, 0x65, 0x74, 0x2e, 0x54, 0x78, 0x52, 0x65, 0x61, 0x64, 0x57, 0x72, 0x69, 0x74, 0x65, + 0x53, 0x65, 0x74, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x52, 0x09, 0x64, + 0x61, 0x74, 0x61, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x12, 0x3a, 0x0a, 0x0c, 0x6e, 0x73, 0x5f, 0x70, + 0x76, 0x74, 0x5f, 0x72, 0x77, 0x73, 0x65, 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, + 0x2e, 0x72, 0x77, 0x73, 0x65, 0x74, 0x2e, 0x4e, 0x73, 0x50, 0x76, 0x74, 0x52, 0x65, 0x61, 0x64, + 0x57, 0x72, 0x69, 0x74, 0x65, 0x53, 0x65, 0x74, 0x52, 0x0a, 0x6e, 0x73, 0x50, 0x76, 0x74, 0x52, + 0x77, 0x73, 0x65, 0x74, 0x22, 0x85, 0x01, 0x0a, 0x11, 0x4e, 0x73, 0x50, 0x76, 0x74, 0x52, 0x65, + 0x61, 0x64, 0x57, 0x72, 0x69, 0x74, 0x65, 0x53, 0x65, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, + 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, + 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x52, 0x0a, 0x14, 0x63, 0x6f, 0x6c, 0x6c, + 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x76, 0x74, 0x5f, 0x72, 0x77, 0x73, 0x65, 0x74, + 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x72, 0x77, 0x73, 0x65, 0x74, 0x2e, 0x43, + 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x76, 0x74, 0x52, 0x65, 0x61, 0x64, + 0x57, 0x72, 0x69, 0x74, 0x65, 0x53, 0x65, 0x74, 0x52, 0x12, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x76, 0x74, 0x52, 0x77, 0x73, 0x65, 0x74, 0x22, 0x5a, 0x0a, 0x19, + 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x76, 0x74, 0x52, 0x65, 0x61, + 0x64, 0x57, 0x72, 0x69, 0x74, 0x65, 0x53, 0x65, 0x74, 0x12, 0x27, 0x0a, 0x0f, 0x63, 0x6f, 0x6c, + 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0e, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x61, + 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x77, 0x73, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x05, 0x72, 0x77, 0x73, 0x65, 0x74, 0x42, 0xa8, 0x01, 0x0a, 0x2a, 0x6f, 0x72, 0x67, + 0x2e, 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2e, 0x66, 0x61, 0x62, + 0x72, 0x69, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x6c, 0x65, 0x64, 0x67, 0x65, + 0x72, 0x2e, 0x72, 0x77, 0x73, 0x65, 0x74, 0x42, 0x0a, 0x52, 0x57, 0x53, 0x65, 0x74, 0x50, 0x72, + 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2f, 0x66, 0x61, + 0x62, 0x72, 0x69, 0x63, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2d, 0x67, 0x6f, 0x2d, 0x61, + 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2f, 0x72, 0x77, 0x73, 0x65, + 0x74, 0xa2, 0x02, 0x03, 0x52, 0x58, 0x58, 0xaa, 0x02, 0x05, 0x52, 0x77, 0x73, 0x65, 0x74, 0xca, + 0x02, 0x05, 0x52, 0x77, 0x73, 0x65, 0x74, 0xe2, 0x02, 0x11, 0x52, 0x77, 0x73, 0x65, 0x74, 0x5c, + 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x05, 0x52, 0x77, + 0x73, 0x65, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_ledger_rwset_rwset_proto_rawDescOnce sync.Once + file_ledger_rwset_rwset_proto_rawDescData = file_ledger_rwset_rwset_proto_rawDesc +) + +func file_ledger_rwset_rwset_proto_rawDescGZIP() []byte { + file_ledger_rwset_rwset_proto_rawDescOnce.Do(func() { + file_ledger_rwset_rwset_proto_rawDescData = protoimpl.X.CompressGZIP(file_ledger_rwset_rwset_proto_rawDescData) + }) + return file_ledger_rwset_rwset_proto_rawDescData +} + +var file_ledger_rwset_rwset_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_ledger_rwset_rwset_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_ledger_rwset_rwset_proto_goTypes = []interface{}{ + (TxReadWriteSet_DataModel)(0), // 0: rwset.TxReadWriteSet.DataModel + (*TxReadWriteSet)(nil), // 1: rwset.TxReadWriteSet + (*NsReadWriteSet)(nil), // 2: rwset.NsReadWriteSet + (*CollectionHashedReadWriteSet)(nil), // 3: rwset.CollectionHashedReadWriteSet + (*TxPvtReadWriteSet)(nil), // 4: rwset.TxPvtReadWriteSet + (*NsPvtReadWriteSet)(nil), // 5: rwset.NsPvtReadWriteSet + (*CollectionPvtReadWriteSet)(nil), // 6: rwset.CollectionPvtReadWriteSet +} +var file_ledger_rwset_rwset_proto_depIdxs = []int32{ + 0, // 0: rwset.TxReadWriteSet.data_model:type_name -> rwset.TxReadWriteSet.DataModel + 2, // 1: rwset.TxReadWriteSet.ns_rwset:type_name -> rwset.NsReadWriteSet + 3, // 2: rwset.NsReadWriteSet.collection_hashed_rwset:type_name -> rwset.CollectionHashedReadWriteSet + 0, // 3: rwset.TxPvtReadWriteSet.data_model:type_name -> rwset.TxReadWriteSet.DataModel + 5, // 4: rwset.TxPvtReadWriteSet.ns_pvt_rwset:type_name -> rwset.NsPvtReadWriteSet + 6, // 5: rwset.NsPvtReadWriteSet.collection_pvt_rwset:type_name -> rwset.CollectionPvtReadWriteSet + 6, // [6:6] is the sub-list for method output_type + 6, // [6:6] is the sub-list for method input_type + 6, // [6:6] is the sub-list for extension type_name + 6, // [6:6] is the sub-list for extension extendee + 0, // [0:6] is the sub-list for field type_name +} + +func init() { file_ledger_rwset_rwset_proto_init() } +func file_ledger_rwset_rwset_proto_init() { + if File_ledger_rwset_rwset_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_ledger_rwset_rwset_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TxReadWriteSet); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ledger_rwset_rwset_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NsReadWriteSet); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ledger_rwset_rwset_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CollectionHashedReadWriteSet); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ledger_rwset_rwset_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TxPvtReadWriteSet); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ledger_rwset_rwset_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NsPvtReadWriteSet); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ledger_rwset_rwset_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CollectionPvtReadWriteSet); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_ledger_rwset_rwset_proto_rawDesc, + NumEnums: 1, + NumMessages: 6, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_ledger_rwset_rwset_proto_goTypes, + DependencyIndexes: file_ledger_rwset_rwset_proto_depIdxs, + EnumInfos: file_ledger_rwset_rwset_proto_enumTypes, + MessageInfos: file_ledger_rwset_rwset_proto_msgTypes, + }.Build() + File_ledger_rwset_rwset_proto = out.File + file_ledger_rwset_rwset_proto_rawDesc = nil + file_ledger_rwset_rwset_proto_goTypes = nil + file_ledger_rwset_rwset_proto_depIdxs = nil +} diff --git a/vendor/github.com/hyperledger/fabric-protos-go-apiv2/msp/identities.pb.go b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/msp/identities.pb.go new file mode 100644 index 00000000000..7b906b36637 --- /dev/null +++ b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/msp/identities.pb.go @@ -0,0 +1,282 @@ +// Copyright the Hyperledger Fabric contributors. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: msp/identities.proto + +package msp + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// This struct represents an Identity +// (with its MSP identifier) to be used +// to serialize it and deserialize it +type SerializedIdentity struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The identifier of the associated membership service provider + Mspid string `protobuf:"bytes,1,opt,name=mspid,proto3" json:"mspid,omitempty"` + // the Identity, serialized according to the rules of its MPS + IdBytes []byte `protobuf:"bytes,2,opt,name=id_bytes,json=idBytes,proto3" json:"id_bytes,omitempty"` +} + +func (x *SerializedIdentity) Reset() { + *x = SerializedIdentity{} + if protoimpl.UnsafeEnabled { + mi := &file_msp_identities_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SerializedIdentity) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SerializedIdentity) ProtoMessage() {} + +func (x *SerializedIdentity) ProtoReflect() protoreflect.Message { + mi := &file_msp_identities_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SerializedIdentity.ProtoReflect.Descriptor instead. +func (*SerializedIdentity) Descriptor() ([]byte, []int) { + return file_msp_identities_proto_rawDescGZIP(), []int{0} +} + +func (x *SerializedIdentity) GetMspid() string { + if x != nil { + return x.Mspid + } + return "" +} + +func (x *SerializedIdentity) GetIdBytes() []byte { + if x != nil { + return x.IdBytes + } + return nil +} + +// This struct represents an Idemix Identity +// to be used to serialize it and deserialize it. +// The IdemixMSP will first serialize an idemix identity to bytes using +// this proto, and then uses these bytes as id_bytes in SerializedIdentity +type SerializedIdemixIdentity struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // nym_x is the X-component of the pseudonym elliptic curve point. + // It is a []byte representation of an amcl.BIG + // The pseudonym can be seen as a public key of the identity, it is used to verify signatures. + NymX []byte `protobuf:"bytes,1,opt,name=nym_x,json=nymX,proto3" json:"nym_x,omitempty"` + // nym_y is the Y-component of the pseudonym elliptic curve point. + // It is a []byte representation of an amcl.BIG + // The pseudonym can be seen as a public key of the identity, it is used to verify signatures. + NymY []byte `protobuf:"bytes,2,opt,name=nym_y,json=nymY,proto3" json:"nym_y,omitempty"` + // ou contains the organizational unit of the idemix identity + Ou []byte `protobuf:"bytes,3,opt,name=ou,proto3" json:"ou,omitempty"` + // role contains the role of this identity (e.g., ADMIN or MEMBER) + Role []byte `protobuf:"bytes,4,opt,name=role,proto3" json:"role,omitempty"` + // proof contains the cryptographic evidence that this identity is valid + Proof []byte `protobuf:"bytes,5,opt,name=proof,proto3" json:"proof,omitempty"` +} + +func (x *SerializedIdemixIdentity) Reset() { + *x = SerializedIdemixIdentity{} + if protoimpl.UnsafeEnabled { + mi := &file_msp_identities_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SerializedIdemixIdentity) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SerializedIdemixIdentity) ProtoMessage() {} + +func (x *SerializedIdemixIdentity) ProtoReflect() protoreflect.Message { + mi := &file_msp_identities_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SerializedIdemixIdentity.ProtoReflect.Descriptor instead. +func (*SerializedIdemixIdentity) Descriptor() ([]byte, []int) { + return file_msp_identities_proto_rawDescGZIP(), []int{1} +} + +func (x *SerializedIdemixIdentity) GetNymX() []byte { + if x != nil { + return x.NymX + } + return nil +} + +func (x *SerializedIdemixIdentity) GetNymY() []byte { + if x != nil { + return x.NymY + } + return nil +} + +func (x *SerializedIdemixIdentity) GetOu() []byte { + if x != nil { + return x.Ou + } + return nil +} + +func (x *SerializedIdemixIdentity) GetRole() []byte { + if x != nil { + return x.Role + } + return nil +} + +func (x *SerializedIdemixIdentity) GetProof() []byte { + if x != nil { + return x.Proof + } + return nil +} + +var File_msp_identities_proto protoreflect.FileDescriptor + +var file_msp_identities_proto_rawDesc = []byte{ + 0x0a, 0x14, 0x6d, 0x73, 0x70, 0x2f, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x69, 0x65, 0x73, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x03, 0x6d, 0x73, 0x70, 0x22, 0x45, 0x0a, 0x12, 0x53, + 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, + 0x79, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x73, 0x70, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x6d, 0x73, 0x70, 0x69, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x69, 0x64, 0x5f, 0x62, 0x79, + 0x74, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x69, 0x64, 0x42, 0x79, 0x74, + 0x65, 0x73, 0x22, 0x7e, 0x0a, 0x18, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, + 0x49, 0x64, 0x65, 0x6d, 0x69, 0x78, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x13, + 0x0a, 0x05, 0x6e, 0x79, 0x6d, 0x5f, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x6e, + 0x79, 0x6d, 0x58, 0x12, 0x13, 0x0a, 0x05, 0x6e, 0x79, 0x6d, 0x5f, 0x79, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x04, 0x6e, 0x79, 0x6d, 0x59, 0x12, 0x0e, 0x0a, 0x02, 0x6f, 0x75, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x02, 0x6f, 0x75, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x12, 0x14, 0x0a, 0x05, + 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x70, 0x72, 0x6f, + 0x6f, 0x66, 0x42, 0x93, 0x01, 0x0a, 0x21, 0x6f, 0x72, 0x67, 0x2e, 0x68, 0x79, 0x70, 0x65, 0x72, + 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2e, 0x66, 0x61, 0x62, 0x72, 0x69, 0x63, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x6d, 0x73, 0x70, 0x42, 0x0f, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, + 0x74, 0x69, 0x65, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x31, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x65, 0x64, + 0x67, 0x65, 0x72, 0x2f, 0x66, 0x61, 0x62, 0x72, 0x69, 0x63, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x73, 0x2d, 0x67, 0x6f, 0x2d, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6d, 0x73, 0x70, 0xa2, 0x02, + 0x03, 0x4d, 0x58, 0x58, 0xaa, 0x02, 0x03, 0x4d, 0x73, 0x70, 0xca, 0x02, 0x03, 0x4d, 0x73, 0x70, + 0xe2, 0x02, 0x0f, 0x4d, 0x73, 0x70, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0xea, 0x02, 0x03, 0x4d, 0x73, 0x70, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_msp_identities_proto_rawDescOnce sync.Once + file_msp_identities_proto_rawDescData = file_msp_identities_proto_rawDesc +) + +func file_msp_identities_proto_rawDescGZIP() []byte { + file_msp_identities_proto_rawDescOnce.Do(func() { + file_msp_identities_proto_rawDescData = protoimpl.X.CompressGZIP(file_msp_identities_proto_rawDescData) + }) + return file_msp_identities_proto_rawDescData +} + +var file_msp_identities_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_msp_identities_proto_goTypes = []interface{}{ + (*SerializedIdentity)(nil), // 0: msp.SerializedIdentity + (*SerializedIdemixIdentity)(nil), // 1: msp.SerializedIdemixIdentity +} +var file_msp_identities_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_msp_identities_proto_init() } +func file_msp_identities_proto_init() { + if File_msp_identities_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_msp_identities_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SerializedIdentity); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_msp_identities_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SerializedIdemixIdentity); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_msp_identities_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_msp_identities_proto_goTypes, + DependencyIndexes: file_msp_identities_proto_depIdxs, + MessageInfos: file_msp_identities_proto_msgTypes, + }.Build() + File_msp_identities_proto = out.File + file_msp_identities_proto_rawDesc = nil + file_msp_identities_proto_goTypes = nil + file_msp_identities_proto_depIdxs = nil +} diff --git a/vendor/github.com/hyperledger/fabric-protos-go-apiv2/msp/msp_config.pb.go b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/msp/msp_config.pb.go new file mode 100644 index 00000000000..1001ae9f6e1 --- /dev/null +++ b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/msp/msp_config.pb.go @@ -0,0 +1,1088 @@ +// Copyright the Hyperledger Fabric contributors. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: msp/msp_config.proto + +package msp + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// MSPConfig collects all the configuration information for +// an MSP. The Config field should be unmarshalled in a way +// that depends on the Type +type MSPConfig struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Type holds the type of the MSP; the default one would + // be of type FABRIC implementing an X.509 based provider + Type int32 `protobuf:"varint,1,opt,name=type,proto3" json:"type,omitempty"` + // Config is MSP dependent configuration info + Config []byte `protobuf:"bytes,2,opt,name=config,proto3" json:"config,omitempty"` +} + +func (x *MSPConfig) Reset() { + *x = MSPConfig{} + if protoimpl.UnsafeEnabled { + mi := &file_msp_msp_config_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MSPConfig) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MSPConfig) ProtoMessage() {} + +func (x *MSPConfig) ProtoReflect() protoreflect.Message { + mi := &file_msp_msp_config_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MSPConfig.ProtoReflect.Descriptor instead. +func (*MSPConfig) Descriptor() ([]byte, []int) { + return file_msp_msp_config_proto_rawDescGZIP(), []int{0} +} + +func (x *MSPConfig) GetType() int32 { + if x != nil { + return x.Type + } + return 0 +} + +func (x *MSPConfig) GetConfig() []byte { + if x != nil { + return x.Config + } + return nil +} + +// FabricMSPConfig collects all the configuration information for +// a Fabric MSP. +// Here we assume a default certificate validation policy, where +// any certificate signed by any of the listed rootCA certs would +// be considered as valid under this MSP. +// This MSP may or may not come with a signing identity. If it does, +// it can also issue signing identities. If it does not, it can only +// be used to validate and verify certificates. +type FabricMSPConfig struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Name holds the identifier of the MSP; MSP identifier + // is chosen by the application that governs this MSP. + // For example, and assuming the default implementation of MSP, + // that is X.509-based and considers a single Issuer, + // this can refer to the Subject OU field or the Issuer OU field. + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // List of root certificates trusted by this MSP + // they are used upon certificate validation (see + // comment for IntermediateCerts below) + RootCerts [][]byte `protobuf:"bytes,2,rep,name=root_certs,json=rootCerts,proto3" json:"root_certs,omitempty"` + // List of intermediate certificates trusted by this MSP; + // they are used upon certificate validation as follows: + // validation attempts to build a path from the certificate + // to be validated (which is at one end of the path) and + // one of the certs in the RootCerts field (which is at + // the other end of the path). If the path is longer than + // 2, certificates in the middle are searched within the + // IntermediateCerts pool + IntermediateCerts [][]byte `protobuf:"bytes,3,rep,name=intermediate_certs,json=intermediateCerts,proto3" json:"intermediate_certs,omitempty"` + // Identity denoting the administrator of this MSP + Admins [][]byte `protobuf:"bytes,4,rep,name=admins,proto3" json:"admins,omitempty"` + // Identity revocation list + RevocationList [][]byte `protobuf:"bytes,5,rep,name=revocation_list,json=revocationList,proto3" json:"revocation_list,omitempty"` + // SigningIdentity holds information on the signing identity + // this peer is to use, and which is to be imported by the + // MSP defined before + SigningIdentity *SigningIdentityInfo `protobuf:"bytes,6,opt,name=signing_identity,json=signingIdentity,proto3" json:"signing_identity,omitempty"` + // OrganizationalUnitIdentifiers holds one or more + // fabric organizational unit identifiers that belong to + // this MSP configuration + OrganizationalUnitIdentifiers []*FabricOUIdentifier `protobuf:"bytes,7,rep,name=organizational_unit_identifiers,json=organizationalUnitIdentifiers,proto3" json:"organizational_unit_identifiers,omitempty"` + // FabricCryptoConfig contains the configuration parameters + // for the cryptographic algorithms used by this MSP + CryptoConfig *FabricCryptoConfig `protobuf:"bytes,8,opt,name=crypto_config,json=cryptoConfig,proto3" json:"crypto_config,omitempty"` + // List of TLS root certificates trusted by this MSP. + // They are returned by GetTLSRootCerts. + TlsRootCerts [][]byte `protobuf:"bytes,9,rep,name=tls_root_certs,json=tlsRootCerts,proto3" json:"tls_root_certs,omitempty"` + // List of TLS intermediate certificates trusted by this MSP; + // They are returned by GetTLSIntermediateCerts. + TlsIntermediateCerts [][]byte `protobuf:"bytes,10,rep,name=tls_intermediate_certs,json=tlsIntermediateCerts,proto3" json:"tls_intermediate_certs,omitempty"` + // fabric_node_ous contains the configuration to distinguish clients from peers from orderers + // based on the OUs. + FabricNodeOus *FabricNodeOUs `protobuf:"bytes,11,opt,name=fabric_node_ous,json=fabricNodeOus,proto3" json:"fabric_node_ous,omitempty"` +} + +func (x *FabricMSPConfig) Reset() { + *x = FabricMSPConfig{} + if protoimpl.UnsafeEnabled { + mi := &file_msp_msp_config_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FabricMSPConfig) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FabricMSPConfig) ProtoMessage() {} + +func (x *FabricMSPConfig) ProtoReflect() protoreflect.Message { + mi := &file_msp_msp_config_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FabricMSPConfig.ProtoReflect.Descriptor instead. +func (*FabricMSPConfig) Descriptor() ([]byte, []int) { + return file_msp_msp_config_proto_rawDescGZIP(), []int{1} +} + +func (x *FabricMSPConfig) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *FabricMSPConfig) GetRootCerts() [][]byte { + if x != nil { + return x.RootCerts + } + return nil +} + +func (x *FabricMSPConfig) GetIntermediateCerts() [][]byte { + if x != nil { + return x.IntermediateCerts + } + return nil +} + +func (x *FabricMSPConfig) GetAdmins() [][]byte { + if x != nil { + return x.Admins + } + return nil +} + +func (x *FabricMSPConfig) GetRevocationList() [][]byte { + if x != nil { + return x.RevocationList + } + return nil +} + +func (x *FabricMSPConfig) GetSigningIdentity() *SigningIdentityInfo { + if x != nil { + return x.SigningIdentity + } + return nil +} + +func (x *FabricMSPConfig) GetOrganizationalUnitIdentifiers() []*FabricOUIdentifier { + if x != nil { + return x.OrganizationalUnitIdentifiers + } + return nil +} + +func (x *FabricMSPConfig) GetCryptoConfig() *FabricCryptoConfig { + if x != nil { + return x.CryptoConfig + } + return nil +} + +func (x *FabricMSPConfig) GetTlsRootCerts() [][]byte { + if x != nil { + return x.TlsRootCerts + } + return nil +} + +func (x *FabricMSPConfig) GetTlsIntermediateCerts() [][]byte { + if x != nil { + return x.TlsIntermediateCerts + } + return nil +} + +func (x *FabricMSPConfig) GetFabricNodeOus() *FabricNodeOUs { + if x != nil { + return x.FabricNodeOus + } + return nil +} + +// FabricCryptoConfig contains configuration parameters +// for the cryptographic algorithms used by the MSP +// this configuration refers to +type FabricCryptoConfig struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // SignatureHashFamily is a string representing the hash family to be used + // during sign and verify operations. + // Allowed values are "SHA2" and "SHA3". + SignatureHashFamily string `protobuf:"bytes,1,opt,name=signature_hash_family,json=signatureHashFamily,proto3" json:"signature_hash_family,omitempty"` + // IdentityIdentifierHashFunction is a string representing the hash function + // to be used during the computation of the identity identifier of an MSP identity. + // Allowed values are "SHA256", "SHA384" and "SHA3_256", "SHA3_384". + IdentityIdentifierHashFunction string `protobuf:"bytes,2,opt,name=identity_identifier_hash_function,json=identityIdentifierHashFunction,proto3" json:"identity_identifier_hash_function,omitempty"` +} + +func (x *FabricCryptoConfig) Reset() { + *x = FabricCryptoConfig{} + if protoimpl.UnsafeEnabled { + mi := &file_msp_msp_config_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FabricCryptoConfig) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FabricCryptoConfig) ProtoMessage() {} + +func (x *FabricCryptoConfig) ProtoReflect() protoreflect.Message { + mi := &file_msp_msp_config_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FabricCryptoConfig.ProtoReflect.Descriptor instead. +func (*FabricCryptoConfig) Descriptor() ([]byte, []int) { + return file_msp_msp_config_proto_rawDescGZIP(), []int{2} +} + +func (x *FabricCryptoConfig) GetSignatureHashFamily() string { + if x != nil { + return x.SignatureHashFamily + } + return "" +} + +func (x *FabricCryptoConfig) GetIdentityIdentifierHashFunction() string { + if x != nil { + return x.IdentityIdentifierHashFunction + } + return "" +} + +// IdemixMSPConfig collects all the configuration information for +// an Idemix MSP. +type IdemixMSPConfig struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Name holds the identifier of the MSP + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // ipk represents the (serialized) issuer public key + Ipk []byte `protobuf:"bytes,2,opt,name=ipk,proto3" json:"ipk,omitempty"` + // signer may contain crypto material to configure a default signer + Signer *IdemixMSPSignerConfig `protobuf:"bytes,3,opt,name=signer,proto3" json:"signer,omitempty"` + // revocation_pk is the public key used for revocation of credentials + RevocationPk []byte `protobuf:"bytes,4,opt,name=revocation_pk,json=revocationPk,proto3" json:"revocation_pk,omitempty"` + // epoch represents the current epoch (time interval) used for revocation + Epoch int64 `protobuf:"varint,5,opt,name=epoch,proto3" json:"epoch,omitempty"` +} + +func (x *IdemixMSPConfig) Reset() { + *x = IdemixMSPConfig{} + if protoimpl.UnsafeEnabled { + mi := &file_msp_msp_config_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *IdemixMSPConfig) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*IdemixMSPConfig) ProtoMessage() {} + +func (x *IdemixMSPConfig) ProtoReflect() protoreflect.Message { + mi := &file_msp_msp_config_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use IdemixMSPConfig.ProtoReflect.Descriptor instead. +func (*IdemixMSPConfig) Descriptor() ([]byte, []int) { + return file_msp_msp_config_proto_rawDescGZIP(), []int{3} +} + +func (x *IdemixMSPConfig) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *IdemixMSPConfig) GetIpk() []byte { + if x != nil { + return x.Ipk + } + return nil +} + +func (x *IdemixMSPConfig) GetSigner() *IdemixMSPSignerConfig { + if x != nil { + return x.Signer + } + return nil +} + +func (x *IdemixMSPConfig) GetRevocationPk() []byte { + if x != nil { + return x.RevocationPk + } + return nil +} + +func (x *IdemixMSPConfig) GetEpoch() int64 { + if x != nil { + return x.Epoch + } + return 0 +} + +// IdemixMSPSIgnerConfig contains the crypto material to set up an idemix signing identity +type IdemixMSPSignerConfig struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // cred represents the serialized idemix credential of the default signer + Cred []byte `protobuf:"bytes,1,opt,name=cred,proto3" json:"cred,omitempty"` + // sk is the secret key of the default signer, corresponding to credential Cred + Sk []byte `protobuf:"bytes,2,opt,name=sk,proto3" json:"sk,omitempty"` + // organizational_unit_identifier defines the organizational unit the default signer is in + OrganizationalUnitIdentifier string `protobuf:"bytes,3,opt,name=organizational_unit_identifier,json=organizationalUnitIdentifier,proto3" json:"organizational_unit_identifier,omitempty"` + // role defines whether the default signer is admin, peer, member or client + Role int32 `protobuf:"varint,4,opt,name=role,proto3" json:"role,omitempty"` + // enrollment_id contains the enrollment id of this signer + EnrollmentId string `protobuf:"bytes,5,opt,name=enrollment_id,json=enrollmentId,proto3" json:"enrollment_id,omitempty"` + // credential_revocation_information contains a serialized CredentialRevocationInformation + CredentialRevocationInformation []byte `protobuf:"bytes,6,opt,name=credential_revocation_information,json=credentialRevocationInformation,proto3" json:"credential_revocation_information,omitempty"` +} + +func (x *IdemixMSPSignerConfig) Reset() { + *x = IdemixMSPSignerConfig{} + if protoimpl.UnsafeEnabled { + mi := &file_msp_msp_config_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *IdemixMSPSignerConfig) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*IdemixMSPSignerConfig) ProtoMessage() {} + +func (x *IdemixMSPSignerConfig) ProtoReflect() protoreflect.Message { + mi := &file_msp_msp_config_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use IdemixMSPSignerConfig.ProtoReflect.Descriptor instead. +func (*IdemixMSPSignerConfig) Descriptor() ([]byte, []int) { + return file_msp_msp_config_proto_rawDescGZIP(), []int{4} +} + +func (x *IdemixMSPSignerConfig) GetCred() []byte { + if x != nil { + return x.Cred + } + return nil +} + +func (x *IdemixMSPSignerConfig) GetSk() []byte { + if x != nil { + return x.Sk + } + return nil +} + +func (x *IdemixMSPSignerConfig) GetOrganizationalUnitIdentifier() string { + if x != nil { + return x.OrganizationalUnitIdentifier + } + return "" +} + +func (x *IdemixMSPSignerConfig) GetRole() int32 { + if x != nil { + return x.Role + } + return 0 +} + +func (x *IdemixMSPSignerConfig) GetEnrollmentId() string { + if x != nil { + return x.EnrollmentId + } + return "" +} + +func (x *IdemixMSPSignerConfig) GetCredentialRevocationInformation() []byte { + if x != nil { + return x.CredentialRevocationInformation + } + return nil +} + +// SigningIdentityInfo represents the configuration information +// related to the signing identity the peer is to use for generating +// endorsements +type SigningIdentityInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // PublicSigner carries the public information of the signing + // identity. For an X.509 provider this would be represented by + // an X.509 certificate + PublicSigner []byte `protobuf:"bytes,1,opt,name=public_signer,json=publicSigner,proto3" json:"public_signer,omitempty"` + // PrivateSigner denotes a reference to the private key of the + // peer's signing identity + PrivateSigner *KeyInfo `protobuf:"bytes,2,opt,name=private_signer,json=privateSigner,proto3" json:"private_signer,omitempty"` +} + +func (x *SigningIdentityInfo) Reset() { + *x = SigningIdentityInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_msp_msp_config_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SigningIdentityInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SigningIdentityInfo) ProtoMessage() {} + +func (x *SigningIdentityInfo) ProtoReflect() protoreflect.Message { + mi := &file_msp_msp_config_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SigningIdentityInfo.ProtoReflect.Descriptor instead. +func (*SigningIdentityInfo) Descriptor() ([]byte, []int) { + return file_msp_msp_config_proto_rawDescGZIP(), []int{5} +} + +func (x *SigningIdentityInfo) GetPublicSigner() []byte { + if x != nil { + return x.PublicSigner + } + return nil +} + +func (x *SigningIdentityInfo) GetPrivateSigner() *KeyInfo { + if x != nil { + return x.PrivateSigner + } + return nil +} + +// KeyInfo represents a (secret) key that is either already stored +// in the bccsp/keystore or key material to be imported to the +// bccsp key-store. In later versions it may contain also a +// keystore identifier +type KeyInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Identifier of the key inside the default keystore; this for + // the case of Software BCCSP as well as the HSM BCCSP would be + // the SKI of the key + KeyIdentifier string `protobuf:"bytes,1,opt,name=key_identifier,json=keyIdentifier,proto3" json:"key_identifier,omitempty"` + // KeyMaterial (optional) for the key to be imported; this is + // properly encoded key bytes, prefixed by the type of the key + KeyMaterial []byte `protobuf:"bytes,2,opt,name=key_material,json=keyMaterial,proto3" json:"key_material,omitempty"` +} + +func (x *KeyInfo) Reset() { + *x = KeyInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_msp_msp_config_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *KeyInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*KeyInfo) ProtoMessage() {} + +func (x *KeyInfo) ProtoReflect() protoreflect.Message { + mi := &file_msp_msp_config_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use KeyInfo.ProtoReflect.Descriptor instead. +func (*KeyInfo) Descriptor() ([]byte, []int) { + return file_msp_msp_config_proto_rawDescGZIP(), []int{6} +} + +func (x *KeyInfo) GetKeyIdentifier() string { + if x != nil { + return x.KeyIdentifier + } + return "" +} + +func (x *KeyInfo) GetKeyMaterial() []byte { + if x != nil { + return x.KeyMaterial + } + return nil +} + +// FabricOUIdentifier represents an organizational unit and +// its related chain of trust identifier. +type FabricOUIdentifier struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Certificate represents the second certificate in a certification chain. + // (Notice that the first certificate in a certification chain is supposed + // to be the certificate of an identity). + // It must correspond to the certificate of root or intermediate CA + // recognized by the MSP this message belongs to. + // Starting from this certificate, a certification chain is computed + // and bound to the OrganizationUnitIdentifier specified + Certificate []byte `protobuf:"bytes,1,opt,name=certificate,proto3" json:"certificate,omitempty"` + // OrganizationUnitIdentifier defines the organizational unit under the + // MSP identified with MSPIdentifier + OrganizationalUnitIdentifier string `protobuf:"bytes,2,opt,name=organizational_unit_identifier,json=organizationalUnitIdentifier,proto3" json:"organizational_unit_identifier,omitempty"` +} + +func (x *FabricOUIdentifier) Reset() { + *x = FabricOUIdentifier{} + if protoimpl.UnsafeEnabled { + mi := &file_msp_msp_config_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FabricOUIdentifier) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FabricOUIdentifier) ProtoMessage() {} + +func (x *FabricOUIdentifier) ProtoReflect() protoreflect.Message { + mi := &file_msp_msp_config_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FabricOUIdentifier.ProtoReflect.Descriptor instead. +func (*FabricOUIdentifier) Descriptor() ([]byte, []int) { + return file_msp_msp_config_proto_rawDescGZIP(), []int{7} +} + +func (x *FabricOUIdentifier) GetCertificate() []byte { + if x != nil { + return x.Certificate + } + return nil +} + +func (x *FabricOUIdentifier) GetOrganizationalUnitIdentifier() string { + if x != nil { + return x.OrganizationalUnitIdentifier + } + return "" +} + +// FabricNodeOUs contains configuration to tell apart clients from peers from orderers +// based on OUs. If NodeOUs recognition is enabled then an msp identity +// that does not contain any of the specified OU will be considered invalid. +type FabricNodeOUs struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // If true then an msp identity that does not contain any of the specified OU will be considered invalid. + Enable bool `protobuf:"varint,1,opt,name=enable,proto3" json:"enable,omitempty"` + // OU Identifier of the clients + ClientOuIdentifier *FabricOUIdentifier `protobuf:"bytes,2,opt,name=client_ou_identifier,json=clientOuIdentifier,proto3" json:"client_ou_identifier,omitempty"` + // OU Identifier of the peers + PeerOuIdentifier *FabricOUIdentifier `protobuf:"bytes,3,opt,name=peer_ou_identifier,json=peerOuIdentifier,proto3" json:"peer_ou_identifier,omitempty"` + // OU Identifier of the admins + AdminOuIdentifier *FabricOUIdentifier `protobuf:"bytes,4,opt,name=admin_ou_identifier,json=adminOuIdentifier,proto3" json:"admin_ou_identifier,omitempty"` + // OU Identifier of the orderers + OrdererOuIdentifier *FabricOUIdentifier `protobuf:"bytes,5,opt,name=orderer_ou_identifier,json=ordererOuIdentifier,proto3" json:"orderer_ou_identifier,omitempty"` +} + +func (x *FabricNodeOUs) Reset() { + *x = FabricNodeOUs{} + if protoimpl.UnsafeEnabled { + mi := &file_msp_msp_config_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FabricNodeOUs) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FabricNodeOUs) ProtoMessage() {} + +func (x *FabricNodeOUs) ProtoReflect() protoreflect.Message { + mi := &file_msp_msp_config_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FabricNodeOUs.ProtoReflect.Descriptor instead. +func (*FabricNodeOUs) Descriptor() ([]byte, []int) { + return file_msp_msp_config_proto_rawDescGZIP(), []int{8} +} + +func (x *FabricNodeOUs) GetEnable() bool { + if x != nil { + return x.Enable + } + return false +} + +func (x *FabricNodeOUs) GetClientOuIdentifier() *FabricOUIdentifier { + if x != nil { + return x.ClientOuIdentifier + } + return nil +} + +func (x *FabricNodeOUs) GetPeerOuIdentifier() *FabricOUIdentifier { + if x != nil { + return x.PeerOuIdentifier + } + return nil +} + +func (x *FabricNodeOUs) GetAdminOuIdentifier() *FabricOUIdentifier { + if x != nil { + return x.AdminOuIdentifier + } + return nil +} + +func (x *FabricNodeOUs) GetOrdererOuIdentifier() *FabricOUIdentifier { + if x != nil { + return x.OrdererOuIdentifier + } + return nil +} + +var File_msp_msp_config_proto protoreflect.FileDescriptor + +var file_msp_msp_config_proto_rawDesc = []byte{ + 0x0a, 0x14, 0x6d, 0x73, 0x70, 0x2f, 0x6d, 0x73, 0x70, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x03, 0x6d, 0x73, 0x70, 0x22, 0x37, 0x0a, 0x09, 0x4d, + 0x53, 0x50, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, + 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x63, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x22, 0xb0, 0x04, 0x0a, 0x0f, 0x46, 0x61, 0x62, 0x72, 0x69, 0x63, 0x4d, + 0x53, 0x50, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, + 0x72, 0x6f, 0x6f, 0x74, 0x5f, 0x63, 0x65, 0x72, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0c, + 0x52, 0x09, 0x72, 0x6f, 0x6f, 0x74, 0x43, 0x65, 0x72, 0x74, 0x73, 0x12, 0x2d, 0x0a, 0x12, 0x69, + 0x6e, 0x74, 0x65, 0x72, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x74, 0x65, 0x5f, 0x63, 0x65, 0x72, 0x74, + 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x11, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6d, 0x65, + 0x64, 0x69, 0x61, 0x74, 0x65, 0x43, 0x65, 0x72, 0x74, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x64, + 0x6d, 0x69, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x06, 0x61, 0x64, 0x6d, 0x69, + 0x6e, 0x73, 0x12, 0x27, 0x0a, 0x0f, 0x72, 0x65, 0x76, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x0e, 0x72, 0x65, 0x76, + 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x43, 0x0a, 0x10, 0x73, + 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6d, 0x73, 0x70, 0x2e, 0x53, 0x69, 0x67, 0x6e, + 0x69, 0x6e, 0x67, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x52, + 0x0f, 0x73, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, + 0x12, 0x5f, 0x0a, 0x1f, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x61, 0x6c, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x5f, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, + 0x65, 0x72, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6d, 0x73, 0x70, 0x2e, + 0x46, 0x61, 0x62, 0x72, 0x69, 0x63, 0x4f, 0x55, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, + 0x65, 0x72, 0x52, 0x1d, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x61, 0x6c, 0x55, 0x6e, 0x69, 0x74, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, + 0x73, 0x12, 0x3c, 0x0a, 0x0d, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x5f, 0x63, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6d, 0x73, 0x70, 0x2e, 0x46, + 0x61, 0x62, 0x72, 0x69, 0x63, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x43, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x52, 0x0c, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, + 0x24, 0x0a, 0x0e, 0x74, 0x6c, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x5f, 0x63, 0x65, 0x72, 0x74, + 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x0c, 0x74, 0x6c, 0x73, 0x52, 0x6f, 0x6f, 0x74, + 0x43, 0x65, 0x72, 0x74, 0x73, 0x12, 0x34, 0x0a, 0x16, 0x74, 0x6c, 0x73, 0x5f, 0x69, 0x6e, 0x74, + 0x65, 0x72, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x74, 0x65, 0x5f, 0x63, 0x65, 0x72, 0x74, 0x73, 0x18, + 0x0a, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x14, 0x74, 0x6c, 0x73, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6d, + 0x65, 0x64, 0x69, 0x61, 0x74, 0x65, 0x43, 0x65, 0x72, 0x74, 0x73, 0x12, 0x3a, 0x0a, 0x0f, 0x66, + 0x61, 0x62, 0x72, 0x69, 0x63, 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x6f, 0x75, 0x73, 0x18, 0x0b, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x73, 0x70, 0x2e, 0x46, 0x61, 0x62, 0x72, 0x69, + 0x63, 0x4e, 0x6f, 0x64, 0x65, 0x4f, 0x55, 0x73, 0x52, 0x0d, 0x66, 0x61, 0x62, 0x72, 0x69, 0x63, + 0x4e, 0x6f, 0x64, 0x65, 0x4f, 0x75, 0x73, 0x22, 0x93, 0x01, 0x0a, 0x12, 0x46, 0x61, 0x62, 0x72, + 0x69, 0x63, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x32, + 0x0a, 0x15, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x5f, 0x68, 0x61, 0x73, 0x68, + 0x5f, 0x66, 0x61, 0x6d, 0x69, 0x6c, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x13, 0x73, + 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x48, 0x61, 0x73, 0x68, 0x46, 0x61, 0x6d, 0x69, + 0x6c, 0x79, 0x12, 0x49, 0x0a, 0x21, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x5f, 0x69, + 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x66, + 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x1e, 0x69, + 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, + 0x72, 0x48, 0x61, 0x73, 0x68, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xa6, 0x01, + 0x0a, 0x0f, 0x49, 0x64, 0x65, 0x6d, 0x69, 0x78, 0x4d, 0x53, 0x50, 0x43, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x69, 0x70, 0x6b, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x03, 0x69, 0x70, 0x6b, 0x12, 0x32, 0x0a, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, + 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6d, 0x73, 0x70, 0x2e, 0x49, 0x64, + 0x65, 0x6d, 0x69, 0x78, 0x4d, 0x53, 0x50, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x43, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x52, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x12, 0x23, 0x0a, 0x0d, 0x72, + 0x65, 0x76, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x6b, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x0c, 0x72, 0x65, 0x76, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6b, + 0x12, 0x14, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x22, 0x86, 0x02, 0x0a, 0x15, 0x49, 0x64, 0x65, 0x6d, 0x69, + 0x78, 0x4d, 0x53, 0x50, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x12, 0x12, 0x0a, 0x04, 0x63, 0x72, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, + 0x63, 0x72, 0x65, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x73, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x02, 0x73, 0x6b, 0x12, 0x44, 0x0a, 0x1e, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x5f, 0x69, 0x64, 0x65, 0x6e, + 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x1c, 0x6f, 0x72, + 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x55, 0x6e, 0x69, 0x74, + 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x6f, + 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x12, 0x23, + 0x0a, 0x0d, 0x65, 0x6e, 0x72, 0x6f, 0x6c, 0x6c, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x65, 0x6e, 0x72, 0x6f, 0x6c, 0x6c, 0x6d, 0x65, 0x6e, + 0x74, 0x49, 0x64, 0x12, 0x4a, 0x0a, 0x21, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, + 0x6c, 0x5f, 0x72, 0x65, 0x76, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x6e, 0x66, + 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x1f, + 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x52, 0x65, 0x76, 0x6f, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, + 0x6f, 0x0a, 0x13, 0x53, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, + 0x74, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x23, 0x0a, 0x0d, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, + 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x70, + 0x75, 0x62, 0x6c, 0x69, 0x63, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x12, 0x33, 0x0a, 0x0e, 0x70, + 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x6d, 0x73, 0x70, 0x2e, 0x4b, 0x65, 0x79, 0x49, 0x6e, 0x66, + 0x6f, 0x52, 0x0d, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x72, + 0x22, 0x53, 0x0a, 0x07, 0x4b, 0x65, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x25, 0x0a, 0x0e, 0x6b, + 0x65, 0x79, 0x5f, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6b, 0x65, 0x79, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, + 0x65, 0x72, 0x12, 0x21, 0x0a, 0x0c, 0x6b, 0x65, 0x79, 0x5f, 0x6d, 0x61, 0x74, 0x65, 0x72, 0x69, + 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x6b, 0x65, 0x79, 0x4d, 0x61, 0x74, + 0x65, 0x72, 0x69, 0x61, 0x6c, 0x22, 0x7c, 0x0a, 0x12, 0x46, 0x61, 0x62, 0x72, 0x69, 0x63, 0x4f, + 0x55, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x12, 0x20, 0x0a, 0x0b, 0x63, + 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x0b, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x12, 0x44, 0x0a, + 0x1e, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, + 0x75, 0x6e, 0x69, 0x74, 0x5f, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x1c, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x55, 0x6e, 0x69, 0x74, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, + 0x69, 0x65, 0x72, 0x22, 0xcf, 0x02, 0x0a, 0x0d, 0x46, 0x61, 0x62, 0x72, 0x69, 0x63, 0x4e, 0x6f, + 0x64, 0x65, 0x4f, 0x55, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x49, 0x0a, + 0x14, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x6f, 0x75, 0x5f, 0x69, 0x64, 0x65, 0x6e, 0x74, + 0x69, 0x66, 0x69, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6d, 0x73, + 0x70, 0x2e, 0x46, 0x61, 0x62, 0x72, 0x69, 0x63, 0x4f, 0x55, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, + 0x66, 0x69, 0x65, 0x72, 0x52, 0x12, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4f, 0x75, 0x49, 0x64, + 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x12, 0x45, 0x0a, 0x12, 0x70, 0x65, 0x65, 0x72, + 0x5f, 0x6f, 0x75, 0x5f, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6d, 0x73, 0x70, 0x2e, 0x46, 0x61, 0x62, 0x72, 0x69, + 0x63, 0x4f, 0x55, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x52, 0x10, 0x70, + 0x65, 0x65, 0x72, 0x4f, 0x75, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x12, + 0x47, 0x0a, 0x13, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x5f, 0x6f, 0x75, 0x5f, 0x69, 0x64, 0x65, 0x6e, + 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6d, + 0x73, 0x70, 0x2e, 0x46, 0x61, 0x62, 0x72, 0x69, 0x63, 0x4f, 0x55, 0x49, 0x64, 0x65, 0x6e, 0x74, + 0x69, 0x66, 0x69, 0x65, 0x72, 0x52, 0x11, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x4f, 0x75, 0x49, 0x64, + 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x12, 0x4b, 0x0a, 0x15, 0x6f, 0x72, 0x64, 0x65, + 0x72, 0x65, 0x72, 0x5f, 0x6f, 0x75, 0x5f, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, + 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6d, 0x73, 0x70, 0x2e, 0x46, 0x61, + 0x62, 0x72, 0x69, 0x63, 0x4f, 0x55, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, + 0x52, 0x13, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x72, 0x4f, 0x75, 0x49, 0x64, 0x65, 0x6e, 0x74, + 0x69, 0x66, 0x69, 0x65, 0x72, 0x42, 0x92, 0x01, 0x0a, 0x21, 0x6f, 0x72, 0x67, 0x2e, 0x68, 0x79, + 0x70, 0x65, 0x72, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2e, 0x66, 0x61, 0x62, 0x72, 0x69, 0x63, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x6d, 0x73, 0x70, 0x42, 0x0e, 0x4d, 0x53, 0x50, + 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x31, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, + 0x65, 0x64, 0x67, 0x65, 0x72, 0x2f, 0x66, 0x61, 0x62, 0x72, 0x69, 0x63, 0x2d, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x73, 0x2d, 0x67, 0x6f, 0x2d, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6d, 0x73, 0x70, + 0xa2, 0x02, 0x03, 0x4d, 0x58, 0x58, 0xaa, 0x02, 0x03, 0x4d, 0x73, 0x70, 0xca, 0x02, 0x03, 0x4d, + 0x73, 0x70, 0xe2, 0x02, 0x0f, 0x4d, 0x73, 0x70, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x03, 0x4d, 0x73, 0x70, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, +} + +var ( + file_msp_msp_config_proto_rawDescOnce sync.Once + file_msp_msp_config_proto_rawDescData = file_msp_msp_config_proto_rawDesc +) + +func file_msp_msp_config_proto_rawDescGZIP() []byte { + file_msp_msp_config_proto_rawDescOnce.Do(func() { + file_msp_msp_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_msp_msp_config_proto_rawDescData) + }) + return file_msp_msp_config_proto_rawDescData +} + +var file_msp_msp_config_proto_msgTypes = make([]protoimpl.MessageInfo, 9) +var file_msp_msp_config_proto_goTypes = []interface{}{ + (*MSPConfig)(nil), // 0: msp.MSPConfig + (*FabricMSPConfig)(nil), // 1: msp.FabricMSPConfig + (*FabricCryptoConfig)(nil), // 2: msp.FabricCryptoConfig + (*IdemixMSPConfig)(nil), // 3: msp.IdemixMSPConfig + (*IdemixMSPSignerConfig)(nil), // 4: msp.IdemixMSPSignerConfig + (*SigningIdentityInfo)(nil), // 5: msp.SigningIdentityInfo + (*KeyInfo)(nil), // 6: msp.KeyInfo + (*FabricOUIdentifier)(nil), // 7: msp.FabricOUIdentifier + (*FabricNodeOUs)(nil), // 8: msp.FabricNodeOUs +} +var file_msp_msp_config_proto_depIdxs = []int32{ + 5, // 0: msp.FabricMSPConfig.signing_identity:type_name -> msp.SigningIdentityInfo + 7, // 1: msp.FabricMSPConfig.organizational_unit_identifiers:type_name -> msp.FabricOUIdentifier + 2, // 2: msp.FabricMSPConfig.crypto_config:type_name -> msp.FabricCryptoConfig + 8, // 3: msp.FabricMSPConfig.fabric_node_ous:type_name -> msp.FabricNodeOUs + 4, // 4: msp.IdemixMSPConfig.signer:type_name -> msp.IdemixMSPSignerConfig + 6, // 5: msp.SigningIdentityInfo.private_signer:type_name -> msp.KeyInfo + 7, // 6: msp.FabricNodeOUs.client_ou_identifier:type_name -> msp.FabricOUIdentifier + 7, // 7: msp.FabricNodeOUs.peer_ou_identifier:type_name -> msp.FabricOUIdentifier + 7, // 8: msp.FabricNodeOUs.admin_ou_identifier:type_name -> msp.FabricOUIdentifier + 7, // 9: msp.FabricNodeOUs.orderer_ou_identifier:type_name -> msp.FabricOUIdentifier + 10, // [10:10] is the sub-list for method output_type + 10, // [10:10] is the sub-list for method input_type + 10, // [10:10] is the sub-list for extension type_name + 10, // [10:10] is the sub-list for extension extendee + 0, // [0:10] is the sub-list for field type_name +} + +func init() { file_msp_msp_config_proto_init() } +func file_msp_msp_config_proto_init() { + if File_msp_msp_config_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_msp_msp_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MSPConfig); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_msp_msp_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FabricMSPConfig); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_msp_msp_config_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FabricCryptoConfig); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_msp_msp_config_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*IdemixMSPConfig); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_msp_msp_config_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*IdemixMSPSignerConfig); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_msp_msp_config_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SigningIdentityInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_msp_msp_config_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*KeyInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_msp_msp_config_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FabricOUIdentifier); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_msp_msp_config_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FabricNodeOUs); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_msp_msp_config_proto_rawDesc, + NumEnums: 0, + NumMessages: 9, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_msp_msp_config_proto_goTypes, + DependencyIndexes: file_msp_msp_config_proto_depIdxs, + MessageInfos: file_msp_msp_config_proto_msgTypes, + }.Build() + File_msp_msp_config_proto = out.File + file_msp_msp_config_proto_rawDesc = nil + file_msp_msp_config_proto_goTypes = nil + file_msp_msp_config_proto_depIdxs = nil +} diff --git a/vendor/github.com/hyperledger/fabric-protos-go-apiv2/msp/msp_principal.pb.go b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/msp/msp_principal.pb.go new file mode 100644 index 00000000000..1dd13289099 --- /dev/null +++ b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/msp/msp_principal.pb.go @@ -0,0 +1,704 @@ +// Copyright the Hyperledger Fabric contributors. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: msp/msp_principal.proto + +package msp + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type MSPPrincipal_Classification int32 + +const ( + MSPPrincipal_ROLE MSPPrincipal_Classification = 0 // Represents the one of the dedicated MSP roles, the + // one of a member of MSP network, and the one of an + // administrator of an MSP network + MSPPrincipal_ORGANIZATION_UNIT MSPPrincipal_Classification = 1 // Denotes a finer grained (affiliation-based) + // groupping of entities, per MSP affiliation + // E.g., this can well be represented by an MSP's + // Organization unit + MSPPrincipal_IDENTITY MSPPrincipal_Classification = 2 // Denotes a principal that consists of a single + // identity + MSPPrincipal_ANONYMITY MSPPrincipal_Classification = 3 // Denotes a principal that can be used to enforce + // an identity to be anonymous or nominal. + MSPPrincipal_COMBINED MSPPrincipal_Classification = 4 // Denotes a combined principal +) + +// Enum value maps for MSPPrincipal_Classification. +var ( + MSPPrincipal_Classification_name = map[int32]string{ + 0: "ROLE", + 1: "ORGANIZATION_UNIT", + 2: "IDENTITY", + 3: "ANONYMITY", + 4: "COMBINED", + } + MSPPrincipal_Classification_value = map[string]int32{ + "ROLE": 0, + "ORGANIZATION_UNIT": 1, + "IDENTITY": 2, + "ANONYMITY": 3, + "COMBINED": 4, + } +) + +func (x MSPPrincipal_Classification) Enum() *MSPPrincipal_Classification { + p := new(MSPPrincipal_Classification) + *p = x + return p +} + +func (x MSPPrincipal_Classification) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (MSPPrincipal_Classification) Descriptor() protoreflect.EnumDescriptor { + return file_msp_msp_principal_proto_enumTypes[0].Descriptor() +} + +func (MSPPrincipal_Classification) Type() protoreflect.EnumType { + return &file_msp_msp_principal_proto_enumTypes[0] +} + +func (x MSPPrincipal_Classification) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use MSPPrincipal_Classification.Descriptor instead. +func (MSPPrincipal_Classification) EnumDescriptor() ([]byte, []int) { + return file_msp_msp_principal_proto_rawDescGZIP(), []int{0, 0} +} + +type MSPRole_MSPRoleType int32 + +const ( + MSPRole_MEMBER MSPRole_MSPRoleType = 0 // Represents an MSP Member + MSPRole_ADMIN MSPRole_MSPRoleType = 1 // Represents an MSP Admin + MSPRole_CLIENT MSPRole_MSPRoleType = 2 // Represents an MSP Client + MSPRole_PEER MSPRole_MSPRoleType = 3 // Represents an MSP Peer + MSPRole_ORDERER MSPRole_MSPRoleType = 4 // Represents an MSP Orderer +) + +// Enum value maps for MSPRole_MSPRoleType. +var ( + MSPRole_MSPRoleType_name = map[int32]string{ + 0: "MEMBER", + 1: "ADMIN", + 2: "CLIENT", + 3: "PEER", + 4: "ORDERER", + } + MSPRole_MSPRoleType_value = map[string]int32{ + "MEMBER": 0, + "ADMIN": 1, + "CLIENT": 2, + "PEER": 3, + "ORDERER": 4, + } +) + +func (x MSPRole_MSPRoleType) Enum() *MSPRole_MSPRoleType { + p := new(MSPRole_MSPRoleType) + *p = x + return p +} + +func (x MSPRole_MSPRoleType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (MSPRole_MSPRoleType) Descriptor() protoreflect.EnumDescriptor { + return file_msp_msp_principal_proto_enumTypes[1].Descriptor() +} + +func (MSPRole_MSPRoleType) Type() protoreflect.EnumType { + return &file_msp_msp_principal_proto_enumTypes[1] +} + +func (x MSPRole_MSPRoleType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use MSPRole_MSPRoleType.Descriptor instead. +func (MSPRole_MSPRoleType) EnumDescriptor() ([]byte, []int) { + return file_msp_msp_principal_proto_rawDescGZIP(), []int{2, 0} +} + +type MSPIdentityAnonymity_MSPIdentityAnonymityType int32 + +const ( + MSPIdentityAnonymity_NOMINAL MSPIdentityAnonymity_MSPIdentityAnonymityType = 0 // Represents a nominal MSP Identity + MSPIdentityAnonymity_ANONYMOUS MSPIdentityAnonymity_MSPIdentityAnonymityType = 1 // Represents an anonymous MSP Identity +) + +// Enum value maps for MSPIdentityAnonymity_MSPIdentityAnonymityType. +var ( + MSPIdentityAnonymity_MSPIdentityAnonymityType_name = map[int32]string{ + 0: "NOMINAL", + 1: "ANONYMOUS", + } + MSPIdentityAnonymity_MSPIdentityAnonymityType_value = map[string]int32{ + "NOMINAL": 0, + "ANONYMOUS": 1, + } +) + +func (x MSPIdentityAnonymity_MSPIdentityAnonymityType) Enum() *MSPIdentityAnonymity_MSPIdentityAnonymityType { + p := new(MSPIdentityAnonymity_MSPIdentityAnonymityType) + *p = x + return p +} + +func (x MSPIdentityAnonymity_MSPIdentityAnonymityType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (MSPIdentityAnonymity_MSPIdentityAnonymityType) Descriptor() protoreflect.EnumDescriptor { + return file_msp_msp_principal_proto_enumTypes[2].Descriptor() +} + +func (MSPIdentityAnonymity_MSPIdentityAnonymityType) Type() protoreflect.EnumType { + return &file_msp_msp_principal_proto_enumTypes[2] +} + +func (x MSPIdentityAnonymity_MSPIdentityAnonymityType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use MSPIdentityAnonymity_MSPIdentityAnonymityType.Descriptor instead. +func (MSPIdentityAnonymity_MSPIdentityAnonymityType) EnumDescriptor() ([]byte, []int) { + return file_msp_msp_principal_proto_rawDescGZIP(), []int{3, 0} +} + +// MSPPrincipal aims to represent an MSP-centric set of identities. +// In particular, this structure allows for definition of +// - a group of identities that are member of the same MSP +// - a group of identities that are member of the same organization unit +// in the same MSP +// - a group of identities that are administering a specific MSP +// - a specific identity +// +// Expressing these groups is done given two fields of the fields below +// - Classification, that defines the type of classification of identities +// in an MSP this principal would be defined on; Classification can take +// three values: +// (i) ByMSPRole: that represents a classification of identities within +// MSP based on one of the two pre-defined MSP rules, "member" and "admin" +// (ii) ByOrganizationUnit: that represents a classification of identities +// within MSP based on the organization unit an identity belongs to +// (iii)ByIdentity that denotes that MSPPrincipal is mapped to a single +// identity/certificate; this would mean that the Principal bytes +// message +type MSPPrincipal struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Classification describes the way that one should process + // Principal. An Classification value of "ByOrganizationUnit" reflects + // that "Principal" contains the name of an organization this MSP + // handles. A Classification value "ByIdentity" means that + // "Principal" contains a specific identity. Default value + // denotes that Principal contains one of the groups by + // default supported by all MSPs ("admin" or "member"). + PrincipalClassification MSPPrincipal_Classification `protobuf:"varint,1,opt,name=principal_classification,json=principalClassification,proto3,enum=common.MSPPrincipal_Classification" json:"principal_classification,omitempty"` + // Principal completes the policy principal definition. For the default + // principal types, Principal can be either "Admin" or "Member". + // For the ByOrganizationUnit/ByIdentity values of Classification, + // PolicyPrincipal acquires its value from an organization unit or + // identity, respectively. + // For the Combined Classification type, the Principal is a marshalled + // CombinedPrincipal. + Principal []byte `protobuf:"bytes,2,opt,name=principal,proto3" json:"principal,omitempty"` +} + +func (x *MSPPrincipal) Reset() { + *x = MSPPrincipal{} + if protoimpl.UnsafeEnabled { + mi := &file_msp_msp_principal_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MSPPrincipal) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MSPPrincipal) ProtoMessage() {} + +func (x *MSPPrincipal) ProtoReflect() protoreflect.Message { + mi := &file_msp_msp_principal_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MSPPrincipal.ProtoReflect.Descriptor instead. +func (*MSPPrincipal) Descriptor() ([]byte, []int) { + return file_msp_msp_principal_proto_rawDescGZIP(), []int{0} +} + +func (x *MSPPrincipal) GetPrincipalClassification() MSPPrincipal_Classification { + if x != nil { + return x.PrincipalClassification + } + return MSPPrincipal_ROLE +} + +func (x *MSPPrincipal) GetPrincipal() []byte { + if x != nil { + return x.Principal + } + return nil +} + +// OrganizationUnit governs the organization of the Principal +// field of a policy principal when a specific organization unity members +// are to be defined within a policy principal. +type OrganizationUnit struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // MSPIdentifier represents the identifier of the MSP this organization unit + // refers to + MspIdentifier string `protobuf:"bytes,1,opt,name=msp_identifier,json=mspIdentifier,proto3" json:"msp_identifier,omitempty"` + // OrganizationUnitIdentifier defines the organizational unit under the + // MSP identified with MSPIdentifier + OrganizationalUnitIdentifier string `protobuf:"bytes,2,opt,name=organizational_unit_identifier,json=organizationalUnitIdentifier,proto3" json:"organizational_unit_identifier,omitempty"` + // CertifiersIdentifier is the hash of certificates chain of trust + // related to this organizational unit + CertifiersIdentifier []byte `protobuf:"bytes,3,opt,name=certifiers_identifier,json=certifiersIdentifier,proto3" json:"certifiers_identifier,omitempty"` +} + +func (x *OrganizationUnit) Reset() { + *x = OrganizationUnit{} + if protoimpl.UnsafeEnabled { + mi := &file_msp_msp_principal_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *OrganizationUnit) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OrganizationUnit) ProtoMessage() {} + +func (x *OrganizationUnit) ProtoReflect() protoreflect.Message { + mi := &file_msp_msp_principal_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use OrganizationUnit.ProtoReflect.Descriptor instead. +func (*OrganizationUnit) Descriptor() ([]byte, []int) { + return file_msp_msp_principal_proto_rawDescGZIP(), []int{1} +} + +func (x *OrganizationUnit) GetMspIdentifier() string { + if x != nil { + return x.MspIdentifier + } + return "" +} + +func (x *OrganizationUnit) GetOrganizationalUnitIdentifier() string { + if x != nil { + return x.OrganizationalUnitIdentifier + } + return "" +} + +func (x *OrganizationUnit) GetCertifiersIdentifier() []byte { + if x != nil { + return x.CertifiersIdentifier + } + return nil +} + +// MSPRole governs the organization of the Principal +// field of an MSPPrincipal when it aims to define one of the +// two dedicated roles within an MSP: Admin and Members. +type MSPRole struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // MSPIdentifier represents the identifier of the MSP this principal + // refers to + MspIdentifier string `protobuf:"bytes,1,opt,name=msp_identifier,json=mspIdentifier,proto3" json:"msp_identifier,omitempty"` + // MSPRoleType defines which of the available, pre-defined MSP-roles + // an identiy should posess inside the MSP with identifier MSPidentifier + Role MSPRole_MSPRoleType `protobuf:"varint,2,opt,name=role,proto3,enum=common.MSPRole_MSPRoleType" json:"role,omitempty"` +} + +func (x *MSPRole) Reset() { + *x = MSPRole{} + if protoimpl.UnsafeEnabled { + mi := &file_msp_msp_principal_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MSPRole) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MSPRole) ProtoMessage() {} + +func (x *MSPRole) ProtoReflect() protoreflect.Message { + mi := &file_msp_msp_principal_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MSPRole.ProtoReflect.Descriptor instead. +func (*MSPRole) Descriptor() ([]byte, []int) { + return file_msp_msp_principal_proto_rawDescGZIP(), []int{2} +} + +func (x *MSPRole) GetMspIdentifier() string { + if x != nil { + return x.MspIdentifier + } + return "" +} + +func (x *MSPRole) GetRole() MSPRole_MSPRoleType { + if x != nil { + return x.Role + } + return MSPRole_MEMBER +} + +// MSPIdentityAnonymity can be used to enforce an identity to be anonymous or nominal. +type MSPIdentityAnonymity struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AnonymityType MSPIdentityAnonymity_MSPIdentityAnonymityType `protobuf:"varint,1,opt,name=anonymity_type,json=anonymityType,proto3,enum=common.MSPIdentityAnonymity_MSPIdentityAnonymityType" json:"anonymity_type,omitempty"` +} + +func (x *MSPIdentityAnonymity) Reset() { + *x = MSPIdentityAnonymity{} + if protoimpl.UnsafeEnabled { + mi := &file_msp_msp_principal_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MSPIdentityAnonymity) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MSPIdentityAnonymity) ProtoMessage() {} + +func (x *MSPIdentityAnonymity) ProtoReflect() protoreflect.Message { + mi := &file_msp_msp_principal_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MSPIdentityAnonymity.ProtoReflect.Descriptor instead. +func (*MSPIdentityAnonymity) Descriptor() ([]byte, []int) { + return file_msp_msp_principal_proto_rawDescGZIP(), []int{3} +} + +func (x *MSPIdentityAnonymity) GetAnonymityType() MSPIdentityAnonymity_MSPIdentityAnonymityType { + if x != nil { + return x.AnonymityType + } + return MSPIdentityAnonymity_NOMINAL +} + +// CombinedPrincipal governs the organization of the Principal +// field of a policy principal when principal_classification has +// indicated that a combined form of principals is required +type CombinedPrincipal struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Principals refer to combined principals + Principals []*MSPPrincipal `protobuf:"bytes,1,rep,name=principals,proto3" json:"principals,omitempty"` +} + +func (x *CombinedPrincipal) Reset() { + *x = CombinedPrincipal{} + if protoimpl.UnsafeEnabled { + mi := &file_msp_msp_principal_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CombinedPrincipal) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CombinedPrincipal) ProtoMessage() {} + +func (x *CombinedPrincipal) ProtoReflect() protoreflect.Message { + mi := &file_msp_msp_principal_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CombinedPrincipal.ProtoReflect.Descriptor instead. +func (*CombinedPrincipal) Descriptor() ([]byte, []int) { + return file_msp_msp_principal_proto_rawDescGZIP(), []int{4} +} + +func (x *CombinedPrincipal) GetPrincipals() []*MSPPrincipal { + if x != nil { + return x.Principals + } + return nil +} + +var File_msp_msp_principal_proto protoreflect.FileDescriptor + +var file_msp_msp_principal_proto_rawDesc = []byte{ + 0x0a, 0x17, 0x6d, 0x73, 0x70, 0x2f, 0x6d, 0x73, 0x70, 0x5f, 0x70, 0x72, 0x69, 0x6e, 0x63, 0x69, + 0x70, 0x61, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, + 0x6e, 0x22, 0xea, 0x01, 0x0a, 0x0c, 0x4d, 0x53, 0x50, 0x50, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, + 0x61, 0x6c, 0x12, 0x5e, 0x0a, 0x18, 0x70, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x5f, + 0x63, 0x6c, 0x61, 0x73, 0x73, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0e, 0x32, 0x23, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x4d, 0x53, + 0x50, 0x50, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x2e, 0x43, 0x6c, 0x61, 0x73, 0x73, + 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x17, 0x70, 0x72, 0x69, 0x6e, 0x63, + 0x69, 0x70, 0x61, 0x6c, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x70, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, + 0x22, 0x5c, 0x0a, 0x0e, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x08, 0x0a, 0x04, 0x52, 0x4f, 0x4c, 0x45, 0x10, 0x00, 0x12, 0x15, 0x0a, 0x11, + 0x4f, 0x52, 0x47, 0x41, 0x4e, 0x49, 0x5a, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x49, + 0x54, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x49, 0x44, 0x45, 0x4e, 0x54, 0x49, 0x54, 0x59, 0x10, + 0x02, 0x12, 0x0d, 0x0a, 0x09, 0x41, 0x4e, 0x4f, 0x4e, 0x59, 0x4d, 0x49, 0x54, 0x59, 0x10, 0x03, + 0x12, 0x0c, 0x0a, 0x08, 0x43, 0x4f, 0x4d, 0x42, 0x49, 0x4e, 0x45, 0x44, 0x10, 0x04, 0x22, 0xb4, + 0x01, 0x0a, 0x10, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, + 0x6e, 0x69, 0x74, 0x12, 0x25, 0x0a, 0x0e, 0x6d, 0x73, 0x70, 0x5f, 0x69, 0x64, 0x65, 0x6e, 0x74, + 0x69, 0x66, 0x69, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6d, 0x73, 0x70, + 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x12, 0x44, 0x0a, 0x1e, 0x6f, 0x72, + 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x75, 0x6e, 0x69, + 0x74, 0x5f, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x1c, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x61, 0x6c, 0x55, 0x6e, 0x69, 0x74, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, + 0x12, 0x33, 0x0a, 0x15, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x73, 0x5f, 0x69, + 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x14, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x73, 0x49, 0x64, 0x65, 0x6e, 0x74, + 0x69, 0x66, 0x69, 0x65, 0x72, 0x22, 0xaa, 0x01, 0x0a, 0x07, 0x4d, 0x53, 0x50, 0x52, 0x6f, 0x6c, + 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x6d, 0x73, 0x70, 0x5f, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, + 0x69, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6d, 0x73, 0x70, 0x49, 0x64, + 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x12, 0x2f, 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1b, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, + 0x4d, 0x53, 0x50, 0x52, 0x6f, 0x6c, 0x65, 0x2e, 0x4d, 0x53, 0x50, 0x52, 0x6f, 0x6c, 0x65, 0x54, + 0x79, 0x70, 0x65, 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x22, 0x47, 0x0a, 0x0b, 0x4d, 0x53, 0x50, + 0x52, 0x6f, 0x6c, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0a, 0x0a, 0x06, 0x4d, 0x45, 0x4d, 0x42, + 0x45, 0x52, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x41, 0x44, 0x4d, 0x49, 0x4e, 0x10, 0x01, 0x12, + 0x0a, 0x0a, 0x06, 0x43, 0x4c, 0x49, 0x45, 0x4e, 0x54, 0x10, 0x02, 0x12, 0x08, 0x0a, 0x04, 0x50, + 0x45, 0x45, 0x52, 0x10, 0x03, 0x12, 0x0b, 0x0a, 0x07, 0x4f, 0x52, 0x44, 0x45, 0x52, 0x45, 0x52, + 0x10, 0x04, 0x22, 0xac, 0x01, 0x0a, 0x14, 0x4d, 0x53, 0x50, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, + 0x74, 0x79, 0x41, 0x6e, 0x6f, 0x6e, 0x79, 0x6d, 0x69, 0x74, 0x79, 0x12, 0x5c, 0x0a, 0x0e, 0x61, + 0x6e, 0x6f, 0x6e, 0x79, 0x6d, 0x69, 0x74, 0x79, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0e, 0x32, 0x35, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x4d, 0x53, 0x50, + 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x41, 0x6e, 0x6f, 0x6e, 0x79, 0x6d, 0x69, 0x74, + 0x79, 0x2e, 0x4d, 0x53, 0x50, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x41, 0x6e, 0x6f, + 0x6e, 0x79, 0x6d, 0x69, 0x74, 0x79, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0d, 0x61, 0x6e, 0x6f, 0x6e, + 0x79, 0x6d, 0x69, 0x74, 0x79, 0x54, 0x79, 0x70, 0x65, 0x22, 0x36, 0x0a, 0x18, 0x4d, 0x53, 0x50, + 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x41, 0x6e, 0x6f, 0x6e, 0x79, 0x6d, 0x69, 0x74, + 0x79, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x4e, 0x4f, 0x4d, 0x49, 0x4e, 0x41, 0x4c, + 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x41, 0x4e, 0x4f, 0x4e, 0x59, 0x4d, 0x4f, 0x55, 0x53, 0x10, + 0x01, 0x22, 0x49, 0x0a, 0x11, 0x43, 0x6f, 0x6d, 0x62, 0x69, 0x6e, 0x65, 0x64, 0x50, 0x72, 0x69, + 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x12, 0x34, 0x0a, 0x0a, 0x70, 0x72, 0x69, 0x6e, 0x63, 0x69, + 0x70, 0x61, 0x6c, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x63, 0x6f, 0x6d, + 0x6d, 0x6f, 0x6e, 0x2e, 0x4d, 0x53, 0x50, 0x50, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, + 0x52, 0x0a, 0x70, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x73, 0x42, 0xa4, 0x01, 0x0a, + 0x24, 0x6f, 0x72, 0x67, 0x2e, 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, + 0x2e, 0x66, 0x61, 0x62, 0x72, 0x69, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x63, + 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x42, 0x11, 0x4d, 0x53, 0x50, 0x50, 0x72, 0x69, 0x6e, 0x63, 0x69, + 0x70, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x31, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x65, 0x64, 0x67, + 0x65, 0x72, 0x2f, 0x66, 0x61, 0x62, 0x72, 0x69, 0x63, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, + 0x2d, 0x67, 0x6f, 0x2d, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6d, 0x73, 0x70, 0xa2, 0x02, 0x03, + 0x43, 0x58, 0x58, 0xaa, 0x02, 0x06, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0xca, 0x02, 0x06, 0x43, + 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0xe2, 0x02, 0x12, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x5c, 0x47, + 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x06, 0x43, 0x6f, 0x6d, + 0x6d, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_msp_msp_principal_proto_rawDescOnce sync.Once + file_msp_msp_principal_proto_rawDescData = file_msp_msp_principal_proto_rawDesc +) + +func file_msp_msp_principal_proto_rawDescGZIP() []byte { + file_msp_msp_principal_proto_rawDescOnce.Do(func() { + file_msp_msp_principal_proto_rawDescData = protoimpl.X.CompressGZIP(file_msp_msp_principal_proto_rawDescData) + }) + return file_msp_msp_principal_proto_rawDescData +} + +var file_msp_msp_principal_proto_enumTypes = make([]protoimpl.EnumInfo, 3) +var file_msp_msp_principal_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +var file_msp_msp_principal_proto_goTypes = []interface{}{ + (MSPPrincipal_Classification)(0), // 0: common.MSPPrincipal.Classification + (MSPRole_MSPRoleType)(0), // 1: common.MSPRole.MSPRoleType + (MSPIdentityAnonymity_MSPIdentityAnonymityType)(0), // 2: common.MSPIdentityAnonymity.MSPIdentityAnonymityType + (*MSPPrincipal)(nil), // 3: common.MSPPrincipal + (*OrganizationUnit)(nil), // 4: common.OrganizationUnit + (*MSPRole)(nil), // 5: common.MSPRole + (*MSPIdentityAnonymity)(nil), // 6: common.MSPIdentityAnonymity + (*CombinedPrincipal)(nil), // 7: common.CombinedPrincipal +} +var file_msp_msp_principal_proto_depIdxs = []int32{ + 0, // 0: common.MSPPrincipal.principal_classification:type_name -> common.MSPPrincipal.Classification + 1, // 1: common.MSPRole.role:type_name -> common.MSPRole.MSPRoleType + 2, // 2: common.MSPIdentityAnonymity.anonymity_type:type_name -> common.MSPIdentityAnonymity.MSPIdentityAnonymityType + 3, // 3: common.CombinedPrincipal.principals:type_name -> common.MSPPrincipal + 4, // [4:4] is the sub-list for method output_type + 4, // [4:4] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name +} + +func init() { file_msp_msp_principal_proto_init() } +func file_msp_msp_principal_proto_init() { + if File_msp_msp_principal_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_msp_msp_principal_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MSPPrincipal); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_msp_msp_principal_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*OrganizationUnit); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_msp_msp_principal_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MSPRole); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_msp_msp_principal_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MSPIdentityAnonymity); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_msp_msp_principal_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CombinedPrincipal); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_msp_msp_principal_proto_rawDesc, + NumEnums: 3, + NumMessages: 5, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_msp_msp_principal_proto_goTypes, + DependencyIndexes: file_msp_msp_principal_proto_depIdxs, + EnumInfos: file_msp_msp_principal_proto_enumTypes, + MessageInfos: file_msp_msp_principal_proto_msgTypes, + }.Build() + File_msp_msp_principal_proto = out.File + file_msp_msp_principal_proto_rawDesc = nil + file_msp_msp_principal_proto_goTypes = nil + file_msp_msp_principal_proto_depIdxs = nil +} diff --git a/vendor/github.com/hyperledger/fabric-protos-go-apiv2/orderer/ab.pb.go b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/orderer/ab.pb.go new file mode 100644 index 00000000000..efbd5a1f7b4 --- /dev/null +++ b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/orderer/ab.pb.go @@ -0,0 +1,950 @@ +// Copyright the Hyperledger Fabric contributors. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: orderer/ab.proto + +package orderer + +import ( + common "github.com/hyperledger/fabric-protos-go-apiv2/common" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// If BLOCK_UNTIL_READY is specified, the reply will block until the requested blocks are available, +// if FAIL_IF_NOT_READY is specified, the reply will return an error indicating that the block is not +// found. To request that all blocks be returned indefinitely as they are created, behavior should be +// set to BLOCK_UNTIL_READY and the stop should be set to specified with a number of MAX_UINT64 +type SeekInfo_SeekBehavior int32 + +const ( + SeekInfo_BLOCK_UNTIL_READY SeekInfo_SeekBehavior = 0 + SeekInfo_FAIL_IF_NOT_READY SeekInfo_SeekBehavior = 1 +) + +// Enum value maps for SeekInfo_SeekBehavior. +var ( + SeekInfo_SeekBehavior_name = map[int32]string{ + 0: "BLOCK_UNTIL_READY", + 1: "FAIL_IF_NOT_READY", + } + SeekInfo_SeekBehavior_value = map[string]int32{ + "BLOCK_UNTIL_READY": 0, + "FAIL_IF_NOT_READY": 1, + } +) + +func (x SeekInfo_SeekBehavior) Enum() *SeekInfo_SeekBehavior { + p := new(SeekInfo_SeekBehavior) + *p = x + return p +} + +func (x SeekInfo_SeekBehavior) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (SeekInfo_SeekBehavior) Descriptor() protoreflect.EnumDescriptor { + return file_orderer_ab_proto_enumTypes[0].Descriptor() +} + +func (SeekInfo_SeekBehavior) Type() protoreflect.EnumType { + return &file_orderer_ab_proto_enumTypes[0] +} + +func (x SeekInfo_SeekBehavior) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use SeekInfo_SeekBehavior.Descriptor instead. +func (SeekInfo_SeekBehavior) EnumDescriptor() ([]byte, []int) { + return file_orderer_ab_proto_rawDescGZIP(), []int{6, 0} +} + +// SeekErrorTolerance indicates to the server how block provider errors should be tolerated. By default, +// if the deliver service detects a problem in the underlying block source (typically, in the orderer, +// a consenter error), it will begin to reject deliver requests. This is to prevent a client from waiting +// for blocks from an orderer which is stuck in an errored state. This is almost always the desired behavior +// and clients should stick with the default STRICT checking behavior. However, in some scenarios, particularly +// when attempting to recover from a crash or other corruption, it's desirable to force an orderer to respond +// with blocks on a best effort basis, even if the backing consensus implementation is in an errored state. +// In this case, set the SeekErrorResponse to BEST_EFFORT to ignore the consenter errors. +type SeekInfo_SeekErrorResponse int32 + +const ( + SeekInfo_STRICT SeekInfo_SeekErrorResponse = 0 + SeekInfo_BEST_EFFORT SeekInfo_SeekErrorResponse = 1 +) + +// Enum value maps for SeekInfo_SeekErrorResponse. +var ( + SeekInfo_SeekErrorResponse_name = map[int32]string{ + 0: "STRICT", + 1: "BEST_EFFORT", + } + SeekInfo_SeekErrorResponse_value = map[string]int32{ + "STRICT": 0, + "BEST_EFFORT": 1, + } +) + +func (x SeekInfo_SeekErrorResponse) Enum() *SeekInfo_SeekErrorResponse { + p := new(SeekInfo_SeekErrorResponse) + *p = x + return p +} + +func (x SeekInfo_SeekErrorResponse) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (SeekInfo_SeekErrorResponse) Descriptor() protoreflect.EnumDescriptor { + return file_orderer_ab_proto_enumTypes[1].Descriptor() +} + +func (SeekInfo_SeekErrorResponse) Type() protoreflect.EnumType { + return &file_orderer_ab_proto_enumTypes[1] +} + +func (x SeekInfo_SeekErrorResponse) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use SeekInfo_SeekErrorResponse.Descriptor instead. +func (SeekInfo_SeekErrorResponse) EnumDescriptor() ([]byte, []int) { + return file_orderer_ab_proto_rawDescGZIP(), []int{6, 1} +} + +// SeekContentType indicates what type of content to deliver in response to a request. If BLOCK is specified, +// the orderer will stream blocks back to the peer. This is the default behavior. If HEADER_WITH_SIG is specified, the +// orderer will stream only a the header and the signature, and the payload field will be set to nil. This allows +// the requester to ascertain that the respective signed block exists in the orderer (or cluster of orderers). +type SeekInfo_SeekContentType int32 + +const ( + SeekInfo_BLOCK SeekInfo_SeekContentType = 0 + SeekInfo_HEADER_WITH_SIG SeekInfo_SeekContentType = 1 +) + +// Enum value maps for SeekInfo_SeekContentType. +var ( + SeekInfo_SeekContentType_name = map[int32]string{ + 0: "BLOCK", + 1: "HEADER_WITH_SIG", + } + SeekInfo_SeekContentType_value = map[string]int32{ + "BLOCK": 0, + "HEADER_WITH_SIG": 1, + } +) + +func (x SeekInfo_SeekContentType) Enum() *SeekInfo_SeekContentType { + p := new(SeekInfo_SeekContentType) + *p = x + return p +} + +func (x SeekInfo_SeekContentType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (SeekInfo_SeekContentType) Descriptor() protoreflect.EnumDescriptor { + return file_orderer_ab_proto_enumTypes[2].Descriptor() +} + +func (SeekInfo_SeekContentType) Type() protoreflect.EnumType { + return &file_orderer_ab_proto_enumTypes[2] +} + +func (x SeekInfo_SeekContentType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use SeekInfo_SeekContentType.Descriptor instead. +func (SeekInfo_SeekContentType) EnumDescriptor() ([]byte, []int) { + return file_orderer_ab_proto_rawDescGZIP(), []int{6, 2} +} + +type BroadcastResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Status code, which may be used to programatically respond to success/failure + Status common.Status `protobuf:"varint,1,opt,name=status,proto3,enum=common.Status" json:"status,omitempty"` + // Info string which may contain additional information about the status returned + Info string `protobuf:"bytes,2,opt,name=info,proto3" json:"info,omitempty"` +} + +func (x *BroadcastResponse) Reset() { + *x = BroadcastResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_orderer_ab_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BroadcastResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BroadcastResponse) ProtoMessage() {} + +func (x *BroadcastResponse) ProtoReflect() protoreflect.Message { + mi := &file_orderer_ab_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BroadcastResponse.ProtoReflect.Descriptor instead. +func (*BroadcastResponse) Descriptor() ([]byte, []int) { + return file_orderer_ab_proto_rawDescGZIP(), []int{0} +} + +func (x *BroadcastResponse) GetStatus() common.Status { + if x != nil { + return x.Status + } + return common.Status(0) +} + +func (x *BroadcastResponse) GetInfo() string { + if x != nil { + return x.Info + } + return "" +} + +type SeekNewest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *SeekNewest) Reset() { + *x = SeekNewest{} + if protoimpl.UnsafeEnabled { + mi := &file_orderer_ab_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SeekNewest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SeekNewest) ProtoMessage() {} + +func (x *SeekNewest) ProtoReflect() protoreflect.Message { + mi := &file_orderer_ab_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SeekNewest.ProtoReflect.Descriptor instead. +func (*SeekNewest) Descriptor() ([]byte, []int) { + return file_orderer_ab_proto_rawDescGZIP(), []int{1} +} + +type SeekOldest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *SeekOldest) Reset() { + *x = SeekOldest{} + if protoimpl.UnsafeEnabled { + mi := &file_orderer_ab_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SeekOldest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SeekOldest) ProtoMessage() {} + +func (x *SeekOldest) ProtoReflect() protoreflect.Message { + mi := &file_orderer_ab_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SeekOldest.ProtoReflect.Descriptor instead. +func (*SeekOldest) Descriptor() ([]byte, []int) { + return file_orderer_ab_proto_rawDescGZIP(), []int{2} +} + +type SeekSpecified struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Number uint64 `protobuf:"varint,1,opt,name=number,proto3" json:"number,omitempty"` +} + +func (x *SeekSpecified) Reset() { + *x = SeekSpecified{} + if protoimpl.UnsafeEnabled { + mi := &file_orderer_ab_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SeekSpecified) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SeekSpecified) ProtoMessage() {} + +func (x *SeekSpecified) ProtoReflect() protoreflect.Message { + mi := &file_orderer_ab_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SeekSpecified.ProtoReflect.Descriptor instead. +func (*SeekSpecified) Descriptor() ([]byte, []int) { + return file_orderer_ab_proto_rawDescGZIP(), []int{3} +} + +func (x *SeekSpecified) GetNumber() uint64 { + if x != nil { + return x.Number + } + return 0 +} + +// SeekNextCommit refers to the next block that will be committed +type SeekNextCommit struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *SeekNextCommit) Reset() { + *x = SeekNextCommit{} + if protoimpl.UnsafeEnabled { + mi := &file_orderer_ab_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SeekNextCommit) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SeekNextCommit) ProtoMessage() {} + +func (x *SeekNextCommit) ProtoReflect() protoreflect.Message { + mi := &file_orderer_ab_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SeekNextCommit.ProtoReflect.Descriptor instead. +func (*SeekNextCommit) Descriptor() ([]byte, []int) { + return file_orderer_ab_proto_rawDescGZIP(), []int{4} +} + +type SeekPosition struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Type: + // + // *SeekPosition_Newest + // *SeekPosition_Oldest + // *SeekPosition_Specified + // *SeekPosition_NextCommit + Type isSeekPosition_Type `protobuf_oneof:"Type"` +} + +func (x *SeekPosition) Reset() { + *x = SeekPosition{} + if protoimpl.UnsafeEnabled { + mi := &file_orderer_ab_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SeekPosition) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SeekPosition) ProtoMessage() {} + +func (x *SeekPosition) ProtoReflect() protoreflect.Message { + mi := &file_orderer_ab_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SeekPosition.ProtoReflect.Descriptor instead. +func (*SeekPosition) Descriptor() ([]byte, []int) { + return file_orderer_ab_proto_rawDescGZIP(), []int{5} +} + +func (m *SeekPosition) GetType() isSeekPosition_Type { + if m != nil { + return m.Type + } + return nil +} + +func (x *SeekPosition) GetNewest() *SeekNewest { + if x, ok := x.GetType().(*SeekPosition_Newest); ok { + return x.Newest + } + return nil +} + +func (x *SeekPosition) GetOldest() *SeekOldest { + if x, ok := x.GetType().(*SeekPosition_Oldest); ok { + return x.Oldest + } + return nil +} + +func (x *SeekPosition) GetSpecified() *SeekSpecified { + if x, ok := x.GetType().(*SeekPosition_Specified); ok { + return x.Specified + } + return nil +} + +func (x *SeekPosition) GetNextCommit() *SeekNextCommit { + if x, ok := x.GetType().(*SeekPosition_NextCommit); ok { + return x.NextCommit + } + return nil +} + +type isSeekPosition_Type interface { + isSeekPosition_Type() +} + +type SeekPosition_Newest struct { + Newest *SeekNewest `protobuf:"bytes,1,opt,name=newest,proto3,oneof"` +} + +type SeekPosition_Oldest struct { + Oldest *SeekOldest `protobuf:"bytes,2,opt,name=oldest,proto3,oneof"` +} + +type SeekPosition_Specified struct { + Specified *SeekSpecified `protobuf:"bytes,3,opt,name=specified,proto3,oneof"` +} + +type SeekPosition_NextCommit struct { + NextCommit *SeekNextCommit `protobuf:"bytes,4,opt,name=next_commit,json=nextCommit,proto3,oneof"` +} + +func (*SeekPosition_Newest) isSeekPosition_Type() {} + +func (*SeekPosition_Oldest) isSeekPosition_Type() {} + +func (*SeekPosition_Specified) isSeekPosition_Type() {} + +func (*SeekPosition_NextCommit) isSeekPosition_Type() {} + +// SeekInfo specifies the range of requested blocks to return +// If the start position is not found, an error is immediately returned +// Otherwise, blocks are returned until a missing block is encountered, then behavior is dictated +// by the SeekBehavior specified. +type SeekInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Start *SeekPosition `protobuf:"bytes,1,opt,name=start,proto3" json:"start,omitempty"` // The position to start the deliver from + Stop *SeekPosition `protobuf:"bytes,2,opt,name=stop,proto3" json:"stop,omitempty"` // The position to stop the deliver + Behavior SeekInfo_SeekBehavior `protobuf:"varint,3,opt,name=behavior,proto3,enum=orderer.SeekInfo_SeekBehavior" json:"behavior,omitempty"` // The behavior when a missing block is encountered + ErrorResponse SeekInfo_SeekErrorResponse `protobuf:"varint,4,opt,name=error_response,json=errorResponse,proto3,enum=orderer.SeekInfo_SeekErrorResponse" json:"error_response,omitempty"` // How to respond to errors reported to the deliver service + ContentType SeekInfo_SeekContentType `protobuf:"varint,5,opt,name=content_type,json=contentType,proto3,enum=orderer.SeekInfo_SeekContentType" json:"content_type,omitempty"` // Defines what type of content to deliver in response to a request +} + +func (x *SeekInfo) Reset() { + *x = SeekInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_orderer_ab_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SeekInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SeekInfo) ProtoMessage() {} + +func (x *SeekInfo) ProtoReflect() protoreflect.Message { + mi := &file_orderer_ab_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SeekInfo.ProtoReflect.Descriptor instead. +func (*SeekInfo) Descriptor() ([]byte, []int) { + return file_orderer_ab_proto_rawDescGZIP(), []int{6} +} + +func (x *SeekInfo) GetStart() *SeekPosition { + if x != nil { + return x.Start + } + return nil +} + +func (x *SeekInfo) GetStop() *SeekPosition { + if x != nil { + return x.Stop + } + return nil +} + +func (x *SeekInfo) GetBehavior() SeekInfo_SeekBehavior { + if x != nil { + return x.Behavior + } + return SeekInfo_BLOCK_UNTIL_READY +} + +func (x *SeekInfo) GetErrorResponse() SeekInfo_SeekErrorResponse { + if x != nil { + return x.ErrorResponse + } + return SeekInfo_STRICT +} + +func (x *SeekInfo) GetContentType() SeekInfo_SeekContentType { + if x != nil { + return x.ContentType + } + return SeekInfo_BLOCK +} + +type DeliverResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Type: + // + // *DeliverResponse_Status + // *DeliverResponse_Block + Type isDeliverResponse_Type `protobuf_oneof:"Type"` +} + +func (x *DeliverResponse) Reset() { + *x = DeliverResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_orderer_ab_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeliverResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeliverResponse) ProtoMessage() {} + +func (x *DeliverResponse) ProtoReflect() protoreflect.Message { + mi := &file_orderer_ab_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeliverResponse.ProtoReflect.Descriptor instead. +func (*DeliverResponse) Descriptor() ([]byte, []int) { + return file_orderer_ab_proto_rawDescGZIP(), []int{7} +} + +func (m *DeliverResponse) GetType() isDeliverResponse_Type { + if m != nil { + return m.Type + } + return nil +} + +func (x *DeliverResponse) GetStatus() common.Status { + if x, ok := x.GetType().(*DeliverResponse_Status); ok { + return x.Status + } + return common.Status(0) +} + +func (x *DeliverResponse) GetBlock() *common.Block { + if x, ok := x.GetType().(*DeliverResponse_Block); ok { + return x.Block + } + return nil +} + +type isDeliverResponse_Type interface { + isDeliverResponse_Type() +} + +type DeliverResponse_Status struct { + Status common.Status `protobuf:"varint,1,opt,name=status,proto3,enum=common.Status,oneof"` +} + +type DeliverResponse_Block struct { + Block *common.Block `protobuf:"bytes,2,opt,name=block,proto3,oneof"` +} + +func (*DeliverResponse_Status) isDeliverResponse_Type() {} + +func (*DeliverResponse_Block) isDeliverResponse_Type() {} + +var File_orderer_ab_proto protoreflect.FileDescriptor + +var file_orderer_ab_proto_rawDesc = []byte{ + 0x0a, 0x10, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x72, 0x2f, 0x61, 0x62, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x12, 0x07, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x72, 0x1a, 0x13, 0x63, 0x6f, 0x6d, + 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x22, 0x4f, 0x0a, 0x11, 0x42, 0x72, 0x6f, 0x61, 0x64, 0x63, 0x61, 0x73, 0x74, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x26, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0e, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x53, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x12, 0x0a, + 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x69, 0x6e, 0x66, + 0x6f, 0x22, 0x0c, 0x0a, 0x0a, 0x53, 0x65, 0x65, 0x6b, 0x4e, 0x65, 0x77, 0x65, 0x73, 0x74, 0x22, + 0x0c, 0x0a, 0x0a, 0x53, 0x65, 0x65, 0x6b, 0x4f, 0x6c, 0x64, 0x65, 0x73, 0x74, 0x22, 0x27, 0x0a, + 0x0d, 0x53, 0x65, 0x65, 0x6b, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x65, 0x64, 0x12, 0x16, + 0x0a, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, + 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, 0x10, 0x0a, 0x0e, 0x53, 0x65, 0x65, 0x6b, 0x4e, 0x65, + 0x78, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x22, 0xe8, 0x01, 0x0a, 0x0c, 0x53, 0x65, 0x65, + 0x6b, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2d, 0x0a, 0x06, 0x6e, 0x65, 0x77, + 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x6f, 0x72, 0x64, 0x65, + 0x72, 0x65, 0x72, 0x2e, 0x53, 0x65, 0x65, 0x6b, 0x4e, 0x65, 0x77, 0x65, 0x73, 0x74, 0x48, 0x00, + 0x52, 0x06, 0x6e, 0x65, 0x77, 0x65, 0x73, 0x74, 0x12, 0x2d, 0x0a, 0x06, 0x6f, 0x6c, 0x64, 0x65, + 0x73, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x6f, 0x72, 0x64, 0x65, 0x72, + 0x65, 0x72, 0x2e, 0x53, 0x65, 0x65, 0x6b, 0x4f, 0x6c, 0x64, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, + 0x06, 0x6f, 0x6c, 0x64, 0x65, 0x73, 0x74, 0x12, 0x36, 0x0a, 0x09, 0x73, 0x70, 0x65, 0x63, 0x69, + 0x66, 0x69, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6f, 0x72, 0x64, + 0x65, 0x72, 0x65, 0x72, 0x2e, 0x53, 0x65, 0x65, 0x6b, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, + 0x65, 0x64, 0x48, 0x00, 0x52, 0x09, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x65, 0x64, 0x12, + 0x3a, 0x0a, 0x0b, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x72, 0x2e, 0x53, + 0x65, 0x65, 0x6b, 0x4e, 0x65, 0x78, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x48, 0x00, 0x52, + 0x0a, 0x6e, 0x65, 0x78, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x42, 0x06, 0x0a, 0x04, 0x54, + 0x79, 0x70, 0x65, 0x22, 0xd3, 0x03, 0x0a, 0x08, 0x53, 0x65, 0x65, 0x6b, 0x49, 0x6e, 0x66, 0x6f, + 0x12, 0x2b, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x15, 0x2e, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x72, 0x2e, 0x53, 0x65, 0x65, 0x6b, 0x50, 0x6f, + 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x29, 0x0a, + 0x04, 0x73, 0x74, 0x6f, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x6f, 0x72, + 0x64, 0x65, 0x72, 0x65, 0x72, 0x2e, 0x53, 0x65, 0x65, 0x6b, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x04, 0x73, 0x74, 0x6f, 0x70, 0x12, 0x3a, 0x0a, 0x08, 0x62, 0x65, 0x68, 0x61, + 0x76, 0x69, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1e, 0x2e, 0x6f, 0x72, 0x64, + 0x65, 0x72, 0x65, 0x72, 0x2e, 0x53, 0x65, 0x65, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x53, 0x65, + 0x65, 0x6b, 0x42, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x52, 0x08, 0x62, 0x65, 0x68, 0x61, + 0x76, 0x69, 0x6f, 0x72, 0x12, 0x4a, 0x0a, 0x0e, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x72, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x23, 0x2e, 0x6f, + 0x72, 0x64, 0x65, 0x72, 0x65, 0x72, 0x2e, 0x53, 0x65, 0x65, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x2e, + 0x53, 0x65, 0x65, 0x6b, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x52, 0x0d, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x44, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x21, 0x2e, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x72, + 0x2e, 0x53, 0x65, 0x65, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x53, 0x65, 0x65, 0x6b, 0x43, 0x6f, + 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x65, + 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x22, 0x3c, 0x0a, 0x0c, 0x53, 0x65, 0x65, 0x6b, 0x42, 0x65, + 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x12, 0x15, 0x0a, 0x11, 0x42, 0x4c, 0x4f, 0x43, 0x4b, 0x5f, + 0x55, 0x4e, 0x54, 0x49, 0x4c, 0x5f, 0x52, 0x45, 0x41, 0x44, 0x59, 0x10, 0x00, 0x12, 0x15, 0x0a, + 0x11, 0x46, 0x41, 0x49, 0x4c, 0x5f, 0x49, 0x46, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x52, 0x45, 0x41, + 0x44, 0x59, 0x10, 0x01, 0x22, 0x30, 0x0a, 0x11, 0x53, 0x65, 0x65, 0x6b, 0x45, 0x72, 0x72, 0x6f, + 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0a, 0x0a, 0x06, 0x53, 0x54, 0x52, + 0x49, 0x43, 0x54, 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x42, 0x45, 0x53, 0x54, 0x5f, 0x45, 0x46, + 0x46, 0x4f, 0x52, 0x54, 0x10, 0x01, 0x22, 0x31, 0x0a, 0x0f, 0x53, 0x65, 0x65, 0x6b, 0x43, 0x6f, + 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x09, 0x0a, 0x05, 0x42, 0x4c, 0x4f, + 0x43, 0x4b, 0x10, 0x00, 0x12, 0x13, 0x0a, 0x0f, 0x48, 0x45, 0x41, 0x44, 0x45, 0x52, 0x5f, 0x57, + 0x49, 0x54, 0x48, 0x5f, 0x53, 0x49, 0x47, 0x10, 0x01, 0x22, 0x6a, 0x0a, 0x0f, 0x44, 0x65, 0x6c, + 0x69, 0x76, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x28, 0x0a, 0x06, + 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0e, 0x2e, 0x63, + 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x48, 0x00, 0x52, 0x06, + 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x25, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x42, + 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x00, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x06, 0x0a, + 0x04, 0x54, 0x79, 0x70, 0x65, 0x32, 0x8b, 0x01, 0x0a, 0x0f, 0x41, 0x74, 0x6f, 0x6d, 0x69, 0x63, + 0x42, 0x72, 0x6f, 0x61, 0x64, 0x63, 0x61, 0x73, 0x74, 0x12, 0x3d, 0x0a, 0x09, 0x42, 0x72, 0x6f, + 0x61, 0x64, 0x63, 0x61, 0x73, 0x74, 0x12, 0x10, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, + 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x1a, 0x1a, 0x2e, 0x6f, 0x72, 0x64, 0x65, 0x72, + 0x65, 0x72, 0x2e, 0x42, 0x72, 0x6f, 0x61, 0x64, 0x63, 0x61, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x28, 0x01, 0x30, 0x01, 0x12, 0x39, 0x0a, 0x07, 0x44, 0x65, 0x6c, 0x69, + 0x76, 0x65, 0x72, 0x12, 0x10, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x45, 0x6e, 0x76, + 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x1a, 0x18, 0x2e, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x72, 0x2e, + 0x44, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x28, + 0x01, 0x30, 0x01, 0x42, 0xa3, 0x01, 0x0a, 0x25, 0x6f, 0x72, 0x67, 0x2e, 0x68, 0x79, 0x70, 0x65, + 0x72, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2e, 0x66, 0x61, 0x62, 0x72, 0x69, 0x63, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x72, 0x42, 0x07, 0x41, + 0x62, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x35, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, + 0x2f, 0x66, 0x61, 0x62, 0x72, 0x69, 0x63, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2d, 0x67, + 0x6f, 0x2d, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x72, 0xa2, + 0x02, 0x03, 0x4f, 0x58, 0x58, 0xaa, 0x02, 0x07, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x72, 0xca, + 0x02, 0x07, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x72, 0xe2, 0x02, 0x13, 0x4f, 0x72, 0x64, 0x65, + 0x72, 0x65, 0x72, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, + 0x02, 0x07, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, +} + +var ( + file_orderer_ab_proto_rawDescOnce sync.Once + file_orderer_ab_proto_rawDescData = file_orderer_ab_proto_rawDesc +) + +func file_orderer_ab_proto_rawDescGZIP() []byte { + file_orderer_ab_proto_rawDescOnce.Do(func() { + file_orderer_ab_proto_rawDescData = protoimpl.X.CompressGZIP(file_orderer_ab_proto_rawDescData) + }) + return file_orderer_ab_proto_rawDescData +} + +var file_orderer_ab_proto_enumTypes = make([]protoimpl.EnumInfo, 3) +var file_orderer_ab_proto_msgTypes = make([]protoimpl.MessageInfo, 8) +var file_orderer_ab_proto_goTypes = []interface{}{ + (SeekInfo_SeekBehavior)(0), // 0: orderer.SeekInfo.SeekBehavior + (SeekInfo_SeekErrorResponse)(0), // 1: orderer.SeekInfo.SeekErrorResponse + (SeekInfo_SeekContentType)(0), // 2: orderer.SeekInfo.SeekContentType + (*BroadcastResponse)(nil), // 3: orderer.BroadcastResponse + (*SeekNewest)(nil), // 4: orderer.SeekNewest + (*SeekOldest)(nil), // 5: orderer.SeekOldest + (*SeekSpecified)(nil), // 6: orderer.SeekSpecified + (*SeekNextCommit)(nil), // 7: orderer.SeekNextCommit + (*SeekPosition)(nil), // 8: orderer.SeekPosition + (*SeekInfo)(nil), // 9: orderer.SeekInfo + (*DeliverResponse)(nil), // 10: orderer.DeliverResponse + (common.Status)(0), // 11: common.Status + (*common.Block)(nil), // 12: common.Block + (*common.Envelope)(nil), // 13: common.Envelope +} +var file_orderer_ab_proto_depIdxs = []int32{ + 11, // 0: orderer.BroadcastResponse.status:type_name -> common.Status + 4, // 1: orderer.SeekPosition.newest:type_name -> orderer.SeekNewest + 5, // 2: orderer.SeekPosition.oldest:type_name -> orderer.SeekOldest + 6, // 3: orderer.SeekPosition.specified:type_name -> orderer.SeekSpecified + 7, // 4: orderer.SeekPosition.next_commit:type_name -> orderer.SeekNextCommit + 8, // 5: orderer.SeekInfo.start:type_name -> orderer.SeekPosition + 8, // 6: orderer.SeekInfo.stop:type_name -> orderer.SeekPosition + 0, // 7: orderer.SeekInfo.behavior:type_name -> orderer.SeekInfo.SeekBehavior + 1, // 8: orderer.SeekInfo.error_response:type_name -> orderer.SeekInfo.SeekErrorResponse + 2, // 9: orderer.SeekInfo.content_type:type_name -> orderer.SeekInfo.SeekContentType + 11, // 10: orderer.DeliverResponse.status:type_name -> common.Status + 12, // 11: orderer.DeliverResponse.block:type_name -> common.Block + 13, // 12: orderer.AtomicBroadcast.Broadcast:input_type -> common.Envelope + 13, // 13: orderer.AtomicBroadcast.Deliver:input_type -> common.Envelope + 3, // 14: orderer.AtomicBroadcast.Broadcast:output_type -> orderer.BroadcastResponse + 10, // 15: orderer.AtomicBroadcast.Deliver:output_type -> orderer.DeliverResponse + 14, // [14:16] is the sub-list for method output_type + 12, // [12:14] is the sub-list for method input_type + 12, // [12:12] is the sub-list for extension type_name + 12, // [12:12] is the sub-list for extension extendee + 0, // [0:12] is the sub-list for field type_name +} + +func init() { file_orderer_ab_proto_init() } +func file_orderer_ab_proto_init() { + if File_orderer_ab_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_orderer_ab_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BroadcastResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_orderer_ab_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SeekNewest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_orderer_ab_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SeekOldest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_orderer_ab_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SeekSpecified); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_orderer_ab_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SeekNextCommit); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_orderer_ab_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SeekPosition); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_orderer_ab_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SeekInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_orderer_ab_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeliverResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_orderer_ab_proto_msgTypes[5].OneofWrappers = []interface{}{ + (*SeekPosition_Newest)(nil), + (*SeekPosition_Oldest)(nil), + (*SeekPosition_Specified)(nil), + (*SeekPosition_NextCommit)(nil), + } + file_orderer_ab_proto_msgTypes[7].OneofWrappers = []interface{}{ + (*DeliverResponse_Status)(nil), + (*DeliverResponse_Block)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_orderer_ab_proto_rawDesc, + NumEnums: 3, + NumMessages: 8, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_orderer_ab_proto_goTypes, + DependencyIndexes: file_orderer_ab_proto_depIdxs, + EnumInfos: file_orderer_ab_proto_enumTypes, + MessageInfos: file_orderer_ab_proto_msgTypes, + }.Build() + File_orderer_ab_proto = out.File + file_orderer_ab_proto_rawDesc = nil + file_orderer_ab_proto_goTypes = nil + file_orderer_ab_proto_depIdxs = nil +} diff --git a/vendor/github.com/hyperledger/fabric-protos-go-apiv2/orderer/ab_grpc.pb.go b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/orderer/ab_grpc.pb.go new file mode 100644 index 00000000000..6ceea60b175 --- /dev/null +++ b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/orderer/ab_grpc.pb.go @@ -0,0 +1,217 @@ +// Copyright the Hyperledger Fabric contributors. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: orderer/ab.proto + +package orderer + +import ( + context "context" + common "github.com/hyperledger/fabric-protos-go-apiv2/common" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + AtomicBroadcast_Broadcast_FullMethodName = "/orderer.AtomicBroadcast/Broadcast" + AtomicBroadcast_Deliver_FullMethodName = "/orderer.AtomicBroadcast/Deliver" +) + +// AtomicBroadcastClient is the client API for AtomicBroadcast service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type AtomicBroadcastClient interface { + // broadcast receives a reply of Acknowledgement for each common.Envelope in order, indicating success or type of failure + Broadcast(ctx context.Context, opts ...grpc.CallOption) (AtomicBroadcast_BroadcastClient, error) + // deliver first requires an Envelope of type DELIVER_SEEK_INFO with Payload data as a mashaled SeekInfo message, then a stream of block replies is received. + Deliver(ctx context.Context, opts ...grpc.CallOption) (AtomicBroadcast_DeliverClient, error) +} + +type atomicBroadcastClient struct { + cc grpc.ClientConnInterface +} + +func NewAtomicBroadcastClient(cc grpc.ClientConnInterface) AtomicBroadcastClient { + return &atomicBroadcastClient{cc} +} + +func (c *atomicBroadcastClient) Broadcast(ctx context.Context, opts ...grpc.CallOption) (AtomicBroadcast_BroadcastClient, error) { + stream, err := c.cc.NewStream(ctx, &AtomicBroadcast_ServiceDesc.Streams[0], AtomicBroadcast_Broadcast_FullMethodName, opts...) + if err != nil { + return nil, err + } + x := &atomicBroadcastBroadcastClient{stream} + return x, nil +} + +type AtomicBroadcast_BroadcastClient interface { + Send(*common.Envelope) error + Recv() (*BroadcastResponse, error) + grpc.ClientStream +} + +type atomicBroadcastBroadcastClient struct { + grpc.ClientStream +} + +func (x *atomicBroadcastBroadcastClient) Send(m *common.Envelope) error { + return x.ClientStream.SendMsg(m) +} + +func (x *atomicBroadcastBroadcastClient) Recv() (*BroadcastResponse, error) { + m := new(BroadcastResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *atomicBroadcastClient) Deliver(ctx context.Context, opts ...grpc.CallOption) (AtomicBroadcast_DeliverClient, error) { + stream, err := c.cc.NewStream(ctx, &AtomicBroadcast_ServiceDesc.Streams[1], AtomicBroadcast_Deliver_FullMethodName, opts...) + if err != nil { + return nil, err + } + x := &atomicBroadcastDeliverClient{stream} + return x, nil +} + +type AtomicBroadcast_DeliverClient interface { + Send(*common.Envelope) error + Recv() (*DeliverResponse, error) + grpc.ClientStream +} + +type atomicBroadcastDeliverClient struct { + grpc.ClientStream +} + +func (x *atomicBroadcastDeliverClient) Send(m *common.Envelope) error { + return x.ClientStream.SendMsg(m) +} + +func (x *atomicBroadcastDeliverClient) Recv() (*DeliverResponse, error) { + m := new(DeliverResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// AtomicBroadcastServer is the server API for AtomicBroadcast service. +// All implementations should embed UnimplementedAtomicBroadcastServer +// for forward compatibility +type AtomicBroadcastServer interface { + // broadcast receives a reply of Acknowledgement for each common.Envelope in order, indicating success or type of failure + Broadcast(AtomicBroadcast_BroadcastServer) error + // deliver first requires an Envelope of type DELIVER_SEEK_INFO with Payload data as a mashaled SeekInfo message, then a stream of block replies is received. + Deliver(AtomicBroadcast_DeliverServer) error +} + +// UnimplementedAtomicBroadcastServer should be embedded to have forward compatible implementations. +type UnimplementedAtomicBroadcastServer struct { +} + +func (UnimplementedAtomicBroadcastServer) Broadcast(AtomicBroadcast_BroadcastServer) error { + return status.Errorf(codes.Unimplemented, "method Broadcast not implemented") +} +func (UnimplementedAtomicBroadcastServer) Deliver(AtomicBroadcast_DeliverServer) error { + return status.Errorf(codes.Unimplemented, "method Deliver not implemented") +} + +// UnsafeAtomicBroadcastServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to AtomicBroadcastServer will +// result in compilation errors. +type UnsafeAtomicBroadcastServer interface { + mustEmbedUnimplementedAtomicBroadcastServer() +} + +func RegisterAtomicBroadcastServer(s grpc.ServiceRegistrar, srv AtomicBroadcastServer) { + s.RegisterService(&AtomicBroadcast_ServiceDesc, srv) +} + +func _AtomicBroadcast_Broadcast_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(AtomicBroadcastServer).Broadcast(&atomicBroadcastBroadcastServer{stream}) +} + +type AtomicBroadcast_BroadcastServer interface { + Send(*BroadcastResponse) error + Recv() (*common.Envelope, error) + grpc.ServerStream +} + +type atomicBroadcastBroadcastServer struct { + grpc.ServerStream +} + +func (x *atomicBroadcastBroadcastServer) Send(m *BroadcastResponse) error { + return x.ServerStream.SendMsg(m) +} + +func (x *atomicBroadcastBroadcastServer) Recv() (*common.Envelope, error) { + m := new(common.Envelope) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func _AtomicBroadcast_Deliver_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(AtomicBroadcastServer).Deliver(&atomicBroadcastDeliverServer{stream}) +} + +type AtomicBroadcast_DeliverServer interface { + Send(*DeliverResponse) error + Recv() (*common.Envelope, error) + grpc.ServerStream +} + +type atomicBroadcastDeliverServer struct { + grpc.ServerStream +} + +func (x *atomicBroadcastDeliverServer) Send(m *DeliverResponse) error { + return x.ServerStream.SendMsg(m) +} + +func (x *atomicBroadcastDeliverServer) Recv() (*common.Envelope, error) { + m := new(common.Envelope) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// AtomicBroadcast_ServiceDesc is the grpc.ServiceDesc for AtomicBroadcast service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var AtomicBroadcast_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "orderer.AtomicBroadcast", + HandlerType: (*AtomicBroadcastServer)(nil), + Methods: []grpc.MethodDesc{}, + Streams: []grpc.StreamDesc{ + { + StreamName: "Broadcast", + Handler: _AtomicBroadcast_Broadcast_Handler, + ServerStreams: true, + ClientStreams: true, + }, + { + StreamName: "Deliver", + Handler: _AtomicBroadcast_Deliver_Handler, + ServerStreams: true, + ClientStreams: true, + }, + }, + Metadata: "orderer/ab.proto", +} diff --git a/vendor/github.com/hyperledger/fabric-protos-go-apiv2/orderer/blockattestation.pb.go b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/orderer/blockattestation.pb.go new file mode 100644 index 00000000000..c286ddbd160 --- /dev/null +++ b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/orderer/blockattestation.pb.go @@ -0,0 +1,296 @@ +// Copyright the Hyperledger Fabric contributors. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: orderer/blockattestation.proto + +package orderer + +import ( + common "github.com/hyperledger/fabric-protos-go-apiv2/common" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type BlockAttestation struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Header *common.BlockHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + Metadata *common.BlockMetadata `protobuf:"bytes,2,opt,name=metadata,proto3" json:"metadata,omitempty"` +} + +func (x *BlockAttestation) Reset() { + *x = BlockAttestation{} + if protoimpl.UnsafeEnabled { + mi := &file_orderer_blockattestation_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BlockAttestation) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BlockAttestation) ProtoMessage() {} + +func (x *BlockAttestation) ProtoReflect() protoreflect.Message { + mi := &file_orderer_blockattestation_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BlockAttestation.ProtoReflect.Descriptor instead. +func (*BlockAttestation) Descriptor() ([]byte, []int) { + return file_orderer_blockattestation_proto_rawDescGZIP(), []int{0} +} + +func (x *BlockAttestation) GetHeader() *common.BlockHeader { + if x != nil { + return x.Header + } + return nil +} + +func (x *BlockAttestation) GetMetadata() *common.BlockMetadata { + if x != nil { + return x.Metadata + } + return nil +} + +type BlockAttestationResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Type: + // + // *BlockAttestationResponse_Status + // *BlockAttestationResponse_BlockAttestation + Type isBlockAttestationResponse_Type `protobuf_oneof:"Type"` +} + +func (x *BlockAttestationResponse) Reset() { + *x = BlockAttestationResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_orderer_blockattestation_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BlockAttestationResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BlockAttestationResponse) ProtoMessage() {} + +func (x *BlockAttestationResponse) ProtoReflect() protoreflect.Message { + mi := &file_orderer_blockattestation_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BlockAttestationResponse.ProtoReflect.Descriptor instead. +func (*BlockAttestationResponse) Descriptor() ([]byte, []int) { + return file_orderer_blockattestation_proto_rawDescGZIP(), []int{1} +} + +func (m *BlockAttestationResponse) GetType() isBlockAttestationResponse_Type { + if m != nil { + return m.Type + } + return nil +} + +func (x *BlockAttestationResponse) GetStatus() common.Status { + if x, ok := x.GetType().(*BlockAttestationResponse_Status); ok { + return x.Status + } + return common.Status(0) +} + +func (x *BlockAttestationResponse) GetBlockAttestation() *BlockAttestation { + if x, ok := x.GetType().(*BlockAttestationResponse_BlockAttestation); ok { + return x.BlockAttestation + } + return nil +} + +type isBlockAttestationResponse_Type interface { + isBlockAttestationResponse_Type() +} + +type BlockAttestationResponse_Status struct { + Status common.Status `protobuf:"varint,1,opt,name=status,proto3,enum=common.Status,oneof"` +} + +type BlockAttestationResponse_BlockAttestation struct { + BlockAttestation *BlockAttestation `protobuf:"bytes,2,opt,name=block_attestation,json=blockAttestation,proto3,oneof"` +} + +func (*BlockAttestationResponse_Status) isBlockAttestationResponse_Type() {} + +func (*BlockAttestationResponse_BlockAttestation) isBlockAttestationResponse_Type() {} + +var File_orderer_blockattestation_proto protoreflect.FileDescriptor + +var file_orderer_blockattestation_proto_rawDesc = []byte{ + 0x0a, 0x1e, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x72, 0x2f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x61, + 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x12, 0x07, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x72, 0x1a, 0x13, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, + 0x6e, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x72, + 0x0a, 0x10, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x2b, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x42, 0x6c, 0x6f, 0x63, + 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, + 0x31, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x15, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, + 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0x22, 0x96, 0x01, 0x0a, 0x18, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x41, 0x74, 0x74, 0x65, + 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x28, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, + 0x0e, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x48, + 0x00, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x48, 0x0a, 0x11, 0x62, 0x6c, 0x6f, + 0x63, 0x6b, 0x5f, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x72, 0x2e, 0x42, + 0x6c, 0x6f, 0x63, 0x6b, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, + 0x00, 0x52, 0x10, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x42, 0x06, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x32, 0x5f, 0x0a, 0x11, 0x42, + 0x6c, 0x6f, 0x63, 0x6b, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x12, 0x4a, 0x0a, 0x11, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x10, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x45, + 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x1a, 0x21, 0x2e, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x65, + 0x72, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x42, 0xb1, 0x01, 0x0a, + 0x25, 0x6f, 0x72, 0x67, 0x2e, 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, + 0x2e, 0x66, 0x61, 0x62, 0x72, 0x69, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x6f, + 0x72, 0x64, 0x65, 0x72, 0x65, 0x72, 0x42, 0x15, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x61, 0x74, 0x74, + 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, + 0x35, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x79, 0x70, 0x65, + 0x72, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2f, 0x66, 0x61, 0x62, 0x72, 0x69, 0x63, 0x2d, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2d, 0x67, 0x6f, 0x2d, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, + 0x72, 0x64, 0x65, 0x72, 0x65, 0x72, 0xa2, 0x02, 0x03, 0x4f, 0x58, 0x58, 0xaa, 0x02, 0x07, 0x4f, + 0x72, 0x64, 0x65, 0x72, 0x65, 0x72, 0xca, 0x02, 0x07, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x72, + 0xe2, 0x02, 0x13, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x72, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x07, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x72, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_orderer_blockattestation_proto_rawDescOnce sync.Once + file_orderer_blockattestation_proto_rawDescData = file_orderer_blockattestation_proto_rawDesc +) + +func file_orderer_blockattestation_proto_rawDescGZIP() []byte { + file_orderer_blockattestation_proto_rawDescOnce.Do(func() { + file_orderer_blockattestation_proto_rawDescData = protoimpl.X.CompressGZIP(file_orderer_blockattestation_proto_rawDescData) + }) + return file_orderer_blockattestation_proto_rawDescData +} + +var file_orderer_blockattestation_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_orderer_blockattestation_proto_goTypes = []interface{}{ + (*BlockAttestation)(nil), // 0: orderer.BlockAttestation + (*BlockAttestationResponse)(nil), // 1: orderer.BlockAttestationResponse + (*common.BlockHeader)(nil), // 2: common.BlockHeader + (*common.BlockMetadata)(nil), // 3: common.BlockMetadata + (common.Status)(0), // 4: common.Status + (*common.Envelope)(nil), // 5: common.Envelope +} +var file_orderer_blockattestation_proto_depIdxs = []int32{ + 2, // 0: orderer.BlockAttestation.header:type_name -> common.BlockHeader + 3, // 1: orderer.BlockAttestation.metadata:type_name -> common.BlockMetadata + 4, // 2: orderer.BlockAttestationResponse.status:type_name -> common.Status + 0, // 3: orderer.BlockAttestationResponse.block_attestation:type_name -> orderer.BlockAttestation + 5, // 4: orderer.BlockAttestations.BlockAttestations:input_type -> common.Envelope + 1, // 5: orderer.BlockAttestations.BlockAttestations:output_type -> orderer.BlockAttestationResponse + 5, // [5:6] is the sub-list for method output_type + 4, // [4:5] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name +} + +func init() { file_orderer_blockattestation_proto_init() } +func file_orderer_blockattestation_proto_init() { + if File_orderer_blockattestation_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_orderer_blockattestation_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BlockAttestation); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_orderer_blockattestation_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BlockAttestationResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_orderer_blockattestation_proto_msgTypes[1].OneofWrappers = []interface{}{ + (*BlockAttestationResponse_Status)(nil), + (*BlockAttestationResponse_BlockAttestation)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_orderer_blockattestation_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_orderer_blockattestation_proto_goTypes, + DependencyIndexes: file_orderer_blockattestation_proto_depIdxs, + MessageInfos: file_orderer_blockattestation_proto_msgTypes, + }.Build() + File_orderer_blockattestation_proto = out.File + file_orderer_blockattestation_proto_rawDesc = nil + file_orderer_blockattestation_proto_goTypes = nil + file_orderer_blockattestation_proto_depIdxs = nil +} diff --git a/vendor/github.com/hyperledger/fabric-protos-go-apiv2/orderer/blockattestation_grpc.pb.go b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/orderer/blockattestation_grpc.pb.go new file mode 100644 index 00000000000..f79406a70bc --- /dev/null +++ b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/orderer/blockattestation_grpc.pb.go @@ -0,0 +1,141 @@ +// Copyright the Hyperledger Fabric contributors. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: orderer/blockattestation.proto + +package orderer + +import ( + context "context" + common "github.com/hyperledger/fabric-protos-go-apiv2/common" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + BlockAttestations_BlockAttestations_FullMethodName = "/orderer.BlockAttestations/BlockAttestations" +) + +// BlockAttestationsClient is the client API for BlockAttestations service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type BlockAttestationsClient interface { + // BlockAttestations receives an Envelope of type DELIVER_SEEK_INFO , then sends back a stream of BlockAttestations. + BlockAttestations(ctx context.Context, in *common.Envelope, opts ...grpc.CallOption) (BlockAttestations_BlockAttestationsClient, error) +} + +type blockAttestationsClient struct { + cc grpc.ClientConnInterface +} + +func NewBlockAttestationsClient(cc grpc.ClientConnInterface) BlockAttestationsClient { + return &blockAttestationsClient{cc} +} + +func (c *blockAttestationsClient) BlockAttestations(ctx context.Context, in *common.Envelope, opts ...grpc.CallOption) (BlockAttestations_BlockAttestationsClient, error) { + stream, err := c.cc.NewStream(ctx, &BlockAttestations_ServiceDesc.Streams[0], BlockAttestations_BlockAttestations_FullMethodName, opts...) + if err != nil { + return nil, err + } + x := &blockAttestationsBlockAttestationsClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type BlockAttestations_BlockAttestationsClient interface { + Recv() (*BlockAttestationResponse, error) + grpc.ClientStream +} + +type blockAttestationsBlockAttestationsClient struct { + grpc.ClientStream +} + +func (x *blockAttestationsBlockAttestationsClient) Recv() (*BlockAttestationResponse, error) { + m := new(BlockAttestationResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// BlockAttestationsServer is the server API for BlockAttestations service. +// All implementations should embed UnimplementedBlockAttestationsServer +// for forward compatibility +type BlockAttestationsServer interface { + // BlockAttestations receives an Envelope of type DELIVER_SEEK_INFO , then sends back a stream of BlockAttestations. + BlockAttestations(*common.Envelope, BlockAttestations_BlockAttestationsServer) error +} + +// UnimplementedBlockAttestationsServer should be embedded to have forward compatible implementations. +type UnimplementedBlockAttestationsServer struct { +} + +func (UnimplementedBlockAttestationsServer) BlockAttestations(*common.Envelope, BlockAttestations_BlockAttestationsServer) error { + return status.Errorf(codes.Unimplemented, "method BlockAttestations not implemented") +} + +// UnsafeBlockAttestationsServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to BlockAttestationsServer will +// result in compilation errors. +type UnsafeBlockAttestationsServer interface { + mustEmbedUnimplementedBlockAttestationsServer() +} + +func RegisterBlockAttestationsServer(s grpc.ServiceRegistrar, srv BlockAttestationsServer) { + s.RegisterService(&BlockAttestations_ServiceDesc, srv) +} + +func _BlockAttestations_BlockAttestations_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(common.Envelope) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(BlockAttestationsServer).BlockAttestations(m, &blockAttestationsBlockAttestationsServer{stream}) +} + +type BlockAttestations_BlockAttestationsServer interface { + Send(*BlockAttestationResponse) error + grpc.ServerStream +} + +type blockAttestationsBlockAttestationsServer struct { + grpc.ServerStream +} + +func (x *blockAttestationsBlockAttestationsServer) Send(m *BlockAttestationResponse) error { + return x.ServerStream.SendMsg(m) +} + +// BlockAttestations_ServiceDesc is the grpc.ServiceDesc for BlockAttestations service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var BlockAttestations_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "orderer.BlockAttestations", + HandlerType: (*BlockAttestationsServer)(nil), + Methods: []grpc.MethodDesc{}, + Streams: []grpc.StreamDesc{ + { + StreamName: "BlockAttestations", + Handler: _BlockAttestations_BlockAttestations_Handler, + ServerStreams: true, + }, + }, + Metadata: "orderer/blockattestation.proto", +} diff --git a/vendor/github.com/hyperledger/fabric-protos-go-apiv2/orderer/cluster.pb.go b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/orderer/cluster.pb.go new file mode 100644 index 00000000000..52ce69365a5 --- /dev/null +++ b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/orderer/cluster.pb.go @@ -0,0 +1,570 @@ +// Copyright the Hyperledger Fabric contributors. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: orderer/cluster.proto + +package orderer + +import ( + common "github.com/hyperledger/fabric-protos-go-apiv2/common" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// StepRequest wraps a message that is sent to a cluster member. +type StepRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Payload: + // + // *StepRequest_ConsensusRequest + // *StepRequest_SubmitRequest + Payload isStepRequest_Payload `protobuf_oneof:"payload"` +} + +func (x *StepRequest) Reset() { + *x = StepRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_orderer_cluster_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StepRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StepRequest) ProtoMessage() {} + +func (x *StepRequest) ProtoReflect() protoreflect.Message { + mi := &file_orderer_cluster_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StepRequest.ProtoReflect.Descriptor instead. +func (*StepRequest) Descriptor() ([]byte, []int) { + return file_orderer_cluster_proto_rawDescGZIP(), []int{0} +} + +func (m *StepRequest) GetPayload() isStepRequest_Payload { + if m != nil { + return m.Payload + } + return nil +} + +func (x *StepRequest) GetConsensusRequest() *ConsensusRequest { + if x, ok := x.GetPayload().(*StepRequest_ConsensusRequest); ok { + return x.ConsensusRequest + } + return nil +} + +func (x *StepRequest) GetSubmitRequest() *SubmitRequest { + if x, ok := x.GetPayload().(*StepRequest_SubmitRequest); ok { + return x.SubmitRequest + } + return nil +} + +type isStepRequest_Payload interface { + isStepRequest_Payload() +} + +type StepRequest_ConsensusRequest struct { + // consensus_request is a consensus specific message. + ConsensusRequest *ConsensusRequest `protobuf:"bytes,1,opt,name=consensus_request,json=consensusRequest,proto3,oneof"` +} + +type StepRequest_SubmitRequest struct { + // submit_request is a relay of a transaction. + SubmitRequest *SubmitRequest `protobuf:"bytes,2,opt,name=submit_request,json=submitRequest,proto3,oneof"` +} + +func (*StepRequest_ConsensusRequest) isStepRequest_Payload() {} + +func (*StepRequest_SubmitRequest) isStepRequest_Payload() {} + +// StepResponse is a message received from a cluster member. +type StepResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Payload: + // + // *StepResponse_SubmitRes + Payload isStepResponse_Payload `protobuf_oneof:"payload"` +} + +func (x *StepResponse) Reset() { + *x = StepResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_orderer_cluster_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StepResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StepResponse) ProtoMessage() {} + +func (x *StepResponse) ProtoReflect() protoreflect.Message { + mi := &file_orderer_cluster_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StepResponse.ProtoReflect.Descriptor instead. +func (*StepResponse) Descriptor() ([]byte, []int) { + return file_orderer_cluster_proto_rawDescGZIP(), []int{1} +} + +func (m *StepResponse) GetPayload() isStepResponse_Payload { + if m != nil { + return m.Payload + } + return nil +} + +func (x *StepResponse) GetSubmitRes() *SubmitResponse { + if x, ok := x.GetPayload().(*StepResponse_SubmitRes); ok { + return x.SubmitRes + } + return nil +} + +type isStepResponse_Payload interface { + isStepResponse_Payload() +} + +type StepResponse_SubmitRes struct { + SubmitRes *SubmitResponse `protobuf:"bytes,1,opt,name=submit_res,json=submitRes,proto3,oneof"` +} + +func (*StepResponse_SubmitRes) isStepResponse_Payload() {} + +// ConsensusRequest is a consensus specific message sent to a cluster member. +type ConsensusRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Channel string `protobuf:"bytes,1,opt,name=channel,proto3" json:"channel,omitempty"` + Payload []byte `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"` + Metadata []byte `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"` +} + +func (x *ConsensusRequest) Reset() { + *x = ConsensusRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_orderer_cluster_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ConsensusRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ConsensusRequest) ProtoMessage() {} + +func (x *ConsensusRequest) ProtoReflect() protoreflect.Message { + mi := &file_orderer_cluster_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ConsensusRequest.ProtoReflect.Descriptor instead. +func (*ConsensusRequest) Descriptor() ([]byte, []int) { + return file_orderer_cluster_proto_rawDescGZIP(), []int{2} +} + +func (x *ConsensusRequest) GetChannel() string { + if x != nil { + return x.Channel + } + return "" +} + +func (x *ConsensusRequest) GetPayload() []byte { + if x != nil { + return x.Payload + } + return nil +} + +func (x *ConsensusRequest) GetMetadata() []byte { + if x != nil { + return x.Metadata + } + return nil +} + +// SubmitRequest wraps a transaction to be sent for ordering. +type SubmitRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Channel string `protobuf:"bytes,1,opt,name=channel,proto3" json:"channel,omitempty"` + // last_validation_seq denotes the last + // configuration sequence at which the + // sender validated this message. + LastValidationSeq uint64 `protobuf:"varint,2,opt,name=last_validation_seq,json=lastValidationSeq,proto3" json:"last_validation_seq,omitempty"` + // content is the fabric transaction + // that is forwarded to the cluster member. + Payload *common.Envelope `protobuf:"bytes,3,opt,name=payload,proto3" json:"payload,omitempty"` +} + +func (x *SubmitRequest) Reset() { + *x = SubmitRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_orderer_cluster_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SubmitRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SubmitRequest) ProtoMessage() {} + +func (x *SubmitRequest) ProtoReflect() protoreflect.Message { + mi := &file_orderer_cluster_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SubmitRequest.ProtoReflect.Descriptor instead. +func (*SubmitRequest) Descriptor() ([]byte, []int) { + return file_orderer_cluster_proto_rawDescGZIP(), []int{3} +} + +func (x *SubmitRequest) GetChannel() string { + if x != nil { + return x.Channel + } + return "" +} + +func (x *SubmitRequest) GetLastValidationSeq() uint64 { + if x != nil { + return x.LastValidationSeq + } + return 0 +} + +func (x *SubmitRequest) GetPayload() *common.Envelope { + if x != nil { + return x.Payload + } + return nil +} + +// SubmitResponse returns a success +// or failure status to the sender. +type SubmitResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Channel string `protobuf:"bytes,1,opt,name=channel,proto3" json:"channel,omitempty"` + // Status code, which may be used to programatically respond to success/failure. + Status common.Status `protobuf:"varint,2,opt,name=status,proto3,enum=common.Status" json:"status,omitempty"` + // Info string which may contain additional information about the returned status. + Info string `protobuf:"bytes,3,opt,name=info,proto3" json:"info,omitempty"` +} + +func (x *SubmitResponse) Reset() { + *x = SubmitResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_orderer_cluster_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SubmitResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SubmitResponse) ProtoMessage() {} + +func (x *SubmitResponse) ProtoReflect() protoreflect.Message { + mi := &file_orderer_cluster_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SubmitResponse.ProtoReflect.Descriptor instead. +func (*SubmitResponse) Descriptor() ([]byte, []int) { + return file_orderer_cluster_proto_rawDescGZIP(), []int{4} +} + +func (x *SubmitResponse) GetChannel() string { + if x != nil { + return x.Channel + } + return "" +} + +func (x *SubmitResponse) GetStatus() common.Status { + if x != nil { + return x.Status + } + return common.Status(0) +} + +func (x *SubmitResponse) GetInfo() string { + if x != nil { + return x.Info + } + return "" +} + +var File_orderer_cluster_proto protoreflect.FileDescriptor + +var file_orderer_cluster_proto_rawDesc = []byte{ + 0x0a, 0x15, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x72, 0x2f, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, + 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x07, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x72, + 0x1a, 0x13, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa3, 0x01, 0x0a, 0x0b, 0x53, 0x74, 0x65, 0x70, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x48, 0x0a, 0x11, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, + 0x75, 0x73, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x19, 0x2e, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x72, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x65, + 0x6e, 0x73, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x10, 0x63, + 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x3f, 0x0a, 0x0e, 0x73, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x65, + 0x72, 0x2e, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, + 0x00, 0x52, 0x0d, 0x73, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x42, 0x09, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x53, 0x0a, 0x0c, 0x53, + 0x74, 0x65, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x38, 0x0a, 0x0a, 0x73, + 0x75, 0x62, 0x6d, 0x69, 0x74, 0x5f, 0x72, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x17, 0x2e, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x72, 0x2e, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x09, 0x73, 0x75, 0x62, 0x6d, + 0x69, 0x74, 0x52, 0x65, 0x73, 0x42, 0x09, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, + 0x22, 0x62, 0x0a, 0x10, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x12, 0x18, + 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0x22, 0x85, 0x01, 0x0a, 0x0d, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, + 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, + 0x12, 0x2e, 0x0a, 0x13, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x65, 0x71, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x11, 0x6c, + 0x61, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x71, + 0x12, 0x2a, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x10, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x45, 0x6e, 0x76, 0x65, 0x6c, + 0x6f, 0x70, 0x65, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x66, 0x0a, 0x0e, + 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, + 0x0a, 0x07, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x12, 0x26, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0e, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, + 0x6e, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x12, 0x12, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x69, 0x6e, 0x66, 0x6f, 0x32, 0x42, 0x0a, 0x07, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x12, + 0x37, 0x0a, 0x04, 0x53, 0x74, 0x65, 0x70, 0x12, 0x14, 0x2e, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x65, + 0x72, 0x2e, 0x53, 0x74, 0x65, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, + 0x6f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x72, 0x2e, 0x53, 0x74, 0x65, 0x70, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x28, 0x01, 0x30, 0x01, 0x42, 0xa8, 0x01, 0x0a, 0x25, 0x6f, 0x72, 0x67, + 0x2e, 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2e, 0x66, 0x61, 0x62, + 0x72, 0x69, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x6f, 0x72, 0x64, 0x65, 0x72, + 0x65, 0x72, 0x42, 0x0c, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, + 0x50, 0x01, 0x5a, 0x35, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, + 0x79, 0x70, 0x65, 0x72, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2f, 0x66, 0x61, 0x62, 0x72, 0x69, + 0x63, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2d, 0x67, 0x6f, 0x2d, 0x61, 0x70, 0x69, 0x76, + 0x32, 0x2f, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x72, 0xa2, 0x02, 0x03, 0x4f, 0x58, 0x58, 0xaa, + 0x02, 0x07, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x72, 0xca, 0x02, 0x07, 0x4f, 0x72, 0x64, 0x65, + 0x72, 0x65, 0x72, 0xe2, 0x02, 0x13, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x72, 0x5c, 0x47, 0x50, + 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x07, 0x4f, 0x72, 0x64, 0x65, + 0x72, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_orderer_cluster_proto_rawDescOnce sync.Once + file_orderer_cluster_proto_rawDescData = file_orderer_cluster_proto_rawDesc +) + +func file_orderer_cluster_proto_rawDescGZIP() []byte { + file_orderer_cluster_proto_rawDescOnce.Do(func() { + file_orderer_cluster_proto_rawDescData = protoimpl.X.CompressGZIP(file_orderer_cluster_proto_rawDescData) + }) + return file_orderer_cluster_proto_rawDescData +} + +var file_orderer_cluster_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +var file_orderer_cluster_proto_goTypes = []interface{}{ + (*StepRequest)(nil), // 0: orderer.StepRequest + (*StepResponse)(nil), // 1: orderer.StepResponse + (*ConsensusRequest)(nil), // 2: orderer.ConsensusRequest + (*SubmitRequest)(nil), // 3: orderer.SubmitRequest + (*SubmitResponse)(nil), // 4: orderer.SubmitResponse + (*common.Envelope)(nil), // 5: common.Envelope + (common.Status)(0), // 6: common.Status +} +var file_orderer_cluster_proto_depIdxs = []int32{ + 2, // 0: orderer.StepRequest.consensus_request:type_name -> orderer.ConsensusRequest + 3, // 1: orderer.StepRequest.submit_request:type_name -> orderer.SubmitRequest + 4, // 2: orderer.StepResponse.submit_res:type_name -> orderer.SubmitResponse + 5, // 3: orderer.SubmitRequest.payload:type_name -> common.Envelope + 6, // 4: orderer.SubmitResponse.status:type_name -> common.Status + 0, // 5: orderer.Cluster.Step:input_type -> orderer.StepRequest + 1, // 6: orderer.Cluster.Step:output_type -> orderer.StepResponse + 6, // [6:7] is the sub-list for method output_type + 5, // [5:6] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name +} + +func init() { file_orderer_cluster_proto_init() } +func file_orderer_cluster_proto_init() { + if File_orderer_cluster_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_orderer_cluster_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StepRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_orderer_cluster_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StepResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_orderer_cluster_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ConsensusRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_orderer_cluster_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SubmitRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_orderer_cluster_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SubmitResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_orderer_cluster_proto_msgTypes[0].OneofWrappers = []interface{}{ + (*StepRequest_ConsensusRequest)(nil), + (*StepRequest_SubmitRequest)(nil), + } + file_orderer_cluster_proto_msgTypes[1].OneofWrappers = []interface{}{ + (*StepResponse_SubmitRes)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_orderer_cluster_proto_rawDesc, + NumEnums: 0, + NumMessages: 5, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_orderer_cluster_proto_goTypes, + DependencyIndexes: file_orderer_cluster_proto_depIdxs, + MessageInfos: file_orderer_cluster_proto_msgTypes, + }.Build() + File_orderer_cluster_proto = out.File + file_orderer_cluster_proto_rawDesc = nil + file_orderer_cluster_proto_goTypes = nil + file_orderer_cluster_proto_depIdxs = nil +} diff --git a/vendor/github.com/hyperledger/fabric-protos-go-apiv2/orderer/cluster_grpc.pb.go b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/orderer/cluster_grpc.pb.go new file mode 100644 index 00000000000..1b62225dfe6 --- /dev/null +++ b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/orderer/cluster_grpc.pb.go @@ -0,0 +1,145 @@ +// Copyright the Hyperledger Fabric contributors. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: orderer/cluster.proto + +package orderer + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + Cluster_Step_FullMethodName = "/orderer.Cluster/Step" +) + +// ClusterClient is the client API for Cluster service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type ClusterClient interface { + // Step passes an implementation-specific message to another cluster member. + Step(ctx context.Context, opts ...grpc.CallOption) (Cluster_StepClient, error) +} + +type clusterClient struct { + cc grpc.ClientConnInterface +} + +func NewClusterClient(cc grpc.ClientConnInterface) ClusterClient { + return &clusterClient{cc} +} + +func (c *clusterClient) Step(ctx context.Context, opts ...grpc.CallOption) (Cluster_StepClient, error) { + stream, err := c.cc.NewStream(ctx, &Cluster_ServiceDesc.Streams[0], Cluster_Step_FullMethodName, opts...) + if err != nil { + return nil, err + } + x := &clusterStepClient{stream} + return x, nil +} + +type Cluster_StepClient interface { + Send(*StepRequest) error + Recv() (*StepResponse, error) + grpc.ClientStream +} + +type clusterStepClient struct { + grpc.ClientStream +} + +func (x *clusterStepClient) Send(m *StepRequest) error { + return x.ClientStream.SendMsg(m) +} + +func (x *clusterStepClient) Recv() (*StepResponse, error) { + m := new(StepResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// ClusterServer is the server API for Cluster service. +// All implementations should embed UnimplementedClusterServer +// for forward compatibility +type ClusterServer interface { + // Step passes an implementation-specific message to another cluster member. + Step(Cluster_StepServer) error +} + +// UnimplementedClusterServer should be embedded to have forward compatible implementations. +type UnimplementedClusterServer struct { +} + +func (UnimplementedClusterServer) Step(Cluster_StepServer) error { + return status.Errorf(codes.Unimplemented, "method Step not implemented") +} + +// UnsafeClusterServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to ClusterServer will +// result in compilation errors. +type UnsafeClusterServer interface { + mustEmbedUnimplementedClusterServer() +} + +func RegisterClusterServer(s grpc.ServiceRegistrar, srv ClusterServer) { + s.RegisterService(&Cluster_ServiceDesc, srv) +} + +func _Cluster_Step_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(ClusterServer).Step(&clusterStepServer{stream}) +} + +type Cluster_StepServer interface { + Send(*StepResponse) error + Recv() (*StepRequest, error) + grpc.ServerStream +} + +type clusterStepServer struct { + grpc.ServerStream +} + +func (x *clusterStepServer) Send(m *StepResponse) error { + return x.ServerStream.SendMsg(m) +} + +func (x *clusterStepServer) Recv() (*StepRequest, error) { + m := new(StepRequest) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// Cluster_ServiceDesc is the grpc.ServiceDesc for Cluster service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Cluster_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "orderer.Cluster", + HandlerType: (*ClusterServer)(nil), + Methods: []grpc.MethodDesc{}, + Streams: []grpc.StreamDesc{ + { + StreamName: "Step", + Handler: _Cluster_Step_Handler, + ServerStreams: true, + ClientStreams: true, + }, + }, + Metadata: "orderer/cluster.proto", +} diff --git a/vendor/github.com/hyperledger/fabric-protos-go-apiv2/orderer/clusterserver.pb.go b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/orderer/clusterserver.pb.go new file mode 100644 index 00000000000..6012de414e1 --- /dev/null +++ b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/orderer/clusterserver.pb.go @@ -0,0 +1,728 @@ +// Copyright the Hyperledger Fabric contributors. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: orderer/clusterserver.proto + +package orderer + +import ( + common "github.com/hyperledger/fabric-protos-go-apiv2/common" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// ClusterNodeServiceStepRequest wraps a message that is sent to a cluster member. +type ClusterNodeServiceStepRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Payload: + // + // *ClusterNodeServiceStepRequest_NodeConrequest + // *ClusterNodeServiceStepRequest_NodeTranrequest + // *ClusterNodeServiceStepRequest_NodeAuthrequest + Payload isClusterNodeServiceStepRequest_Payload `protobuf_oneof:"payload"` +} + +func (x *ClusterNodeServiceStepRequest) Reset() { + *x = ClusterNodeServiceStepRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_orderer_clusterserver_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ClusterNodeServiceStepRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ClusterNodeServiceStepRequest) ProtoMessage() {} + +func (x *ClusterNodeServiceStepRequest) ProtoReflect() protoreflect.Message { + mi := &file_orderer_clusterserver_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ClusterNodeServiceStepRequest.ProtoReflect.Descriptor instead. +func (*ClusterNodeServiceStepRequest) Descriptor() ([]byte, []int) { + return file_orderer_clusterserver_proto_rawDescGZIP(), []int{0} +} + +func (m *ClusterNodeServiceStepRequest) GetPayload() isClusterNodeServiceStepRequest_Payload { + if m != nil { + return m.Payload + } + return nil +} + +func (x *ClusterNodeServiceStepRequest) GetNodeConrequest() *NodeConsensusRequest { + if x, ok := x.GetPayload().(*ClusterNodeServiceStepRequest_NodeConrequest); ok { + return x.NodeConrequest + } + return nil +} + +func (x *ClusterNodeServiceStepRequest) GetNodeTranrequest() *NodeTransactionOrderRequest { + if x, ok := x.GetPayload().(*ClusterNodeServiceStepRequest_NodeTranrequest); ok { + return x.NodeTranrequest + } + return nil +} + +func (x *ClusterNodeServiceStepRequest) GetNodeAuthrequest() *NodeAuthRequest { + if x, ok := x.GetPayload().(*ClusterNodeServiceStepRequest_NodeAuthrequest); ok { + return x.NodeAuthrequest + } + return nil +} + +type isClusterNodeServiceStepRequest_Payload interface { + isClusterNodeServiceStepRequest_Payload() +} + +type ClusterNodeServiceStepRequest_NodeConrequest struct { + // node_conrequest is a consensus specific message between the cluster memebers. + NodeConrequest *NodeConsensusRequest `protobuf:"bytes,1,opt,name=node_conrequest,json=nodeConrequest,proto3,oneof"` +} + +type ClusterNodeServiceStepRequest_NodeTranrequest struct { + // node_tranrequest is a relay of a transaction. + NodeTranrequest *NodeTransactionOrderRequest `protobuf:"bytes,2,opt,name=node_tranrequest,json=nodeTranrequest,proto3,oneof"` +} + +type ClusterNodeServiceStepRequest_NodeAuthrequest struct { + // Auth authentiates the member that initiated the stream + NodeAuthrequest *NodeAuthRequest `protobuf:"bytes,3,opt,name=node_authrequest,json=nodeAuthrequest,proto3,oneof"` +} + +func (*ClusterNodeServiceStepRequest_NodeConrequest) isClusterNodeServiceStepRequest_Payload() {} + +func (*ClusterNodeServiceStepRequest_NodeTranrequest) isClusterNodeServiceStepRequest_Payload() {} + +func (*ClusterNodeServiceStepRequest_NodeAuthrequest) isClusterNodeServiceStepRequest_Payload() {} + +// ClusterNodeServiceStepResponse is a message received from a cluster member. +type ClusterNodeServiceStepResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Payload: + // + // *ClusterNodeServiceStepResponse_TranorderRes + Payload isClusterNodeServiceStepResponse_Payload `protobuf_oneof:"payload"` +} + +func (x *ClusterNodeServiceStepResponse) Reset() { + *x = ClusterNodeServiceStepResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_orderer_clusterserver_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ClusterNodeServiceStepResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ClusterNodeServiceStepResponse) ProtoMessage() {} + +func (x *ClusterNodeServiceStepResponse) ProtoReflect() protoreflect.Message { + mi := &file_orderer_clusterserver_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ClusterNodeServiceStepResponse.ProtoReflect.Descriptor instead. +func (*ClusterNodeServiceStepResponse) Descriptor() ([]byte, []int) { + return file_orderer_clusterserver_proto_rawDescGZIP(), []int{1} +} + +func (m *ClusterNodeServiceStepResponse) GetPayload() isClusterNodeServiceStepResponse_Payload { + if m != nil { + return m.Payload + } + return nil +} + +func (x *ClusterNodeServiceStepResponse) GetTranorderRes() *TransactionOrderResponse { + if x, ok := x.GetPayload().(*ClusterNodeServiceStepResponse_TranorderRes); ok { + return x.TranorderRes + } + return nil +} + +type isClusterNodeServiceStepResponse_Payload interface { + isClusterNodeServiceStepResponse_Payload() +} + +type ClusterNodeServiceStepResponse_TranorderRes struct { + TranorderRes *TransactionOrderResponse `protobuf:"bytes,1,opt,name=tranorder_res,json=tranorderRes,proto3,oneof"` +} + +func (*ClusterNodeServiceStepResponse_TranorderRes) isClusterNodeServiceStepResponse_Payload() {} + +// NodeConsensusRequest is a consensus specific message sent to a cluster member. +type NodeConsensusRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Payload []byte `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"` + Metadata []byte `protobuf:"bytes,2,opt,name=metadata,proto3" json:"metadata,omitempty"` +} + +func (x *NodeConsensusRequest) Reset() { + *x = NodeConsensusRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_orderer_clusterserver_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NodeConsensusRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NodeConsensusRequest) ProtoMessage() {} + +func (x *NodeConsensusRequest) ProtoReflect() protoreflect.Message { + mi := &file_orderer_clusterserver_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use NodeConsensusRequest.ProtoReflect.Descriptor instead. +func (*NodeConsensusRequest) Descriptor() ([]byte, []int) { + return file_orderer_clusterserver_proto_rawDescGZIP(), []int{2} +} + +func (x *NodeConsensusRequest) GetPayload() []byte { + if x != nil { + return x.Payload + } + return nil +} + +func (x *NodeConsensusRequest) GetMetadata() []byte { + if x != nil { + return x.Metadata + } + return nil +} + +// NodeTransactionOrderRequest wraps a transaction to be sent for ordering. +type NodeTransactionOrderRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // last_validation_seq denotes the last configuration sequence at which the + // sender validated this message. + LastValidationSeq uint64 `protobuf:"varint,1,opt,name=last_validation_seq,json=lastValidationSeq,proto3" json:"last_validation_seq,omitempty"` + // content is the fabric transaction + // that is forwarded to the cluster member. + Payload *common.Envelope `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"` +} + +func (x *NodeTransactionOrderRequest) Reset() { + *x = NodeTransactionOrderRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_orderer_clusterserver_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NodeTransactionOrderRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NodeTransactionOrderRequest) ProtoMessage() {} + +func (x *NodeTransactionOrderRequest) ProtoReflect() protoreflect.Message { + mi := &file_orderer_clusterserver_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use NodeTransactionOrderRequest.ProtoReflect.Descriptor instead. +func (*NodeTransactionOrderRequest) Descriptor() ([]byte, []int) { + return file_orderer_clusterserver_proto_rawDescGZIP(), []int{3} +} + +func (x *NodeTransactionOrderRequest) GetLastValidationSeq() uint64 { + if x != nil { + return x.LastValidationSeq + } + return 0 +} + +func (x *NodeTransactionOrderRequest) GetPayload() *common.Envelope { + if x != nil { + return x.Payload + } + return nil +} + +// TransactionOrderResponse returns a success +// or failure status to the sender. +type TransactionOrderResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Channel string `protobuf:"bytes,1,opt,name=channel,proto3" json:"channel,omitempty"` + TxId string `protobuf:"bytes,2,opt,name=tx_id,json=txId,proto3" json:"tx_id,omitempty"` + // Status code, which may be used to programatically respond to success/failure. + Status common.Status `protobuf:"varint,3,opt,name=status,proto3,enum=common.Status" json:"status,omitempty"` + // Info string which may contain additional information about the returned status. + Info string `protobuf:"bytes,4,opt,name=info,proto3" json:"info,omitempty"` +} + +func (x *TransactionOrderResponse) Reset() { + *x = TransactionOrderResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_orderer_clusterserver_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TransactionOrderResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TransactionOrderResponse) ProtoMessage() {} + +func (x *TransactionOrderResponse) ProtoReflect() protoreflect.Message { + mi := &file_orderer_clusterserver_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TransactionOrderResponse.ProtoReflect.Descriptor instead. +func (*TransactionOrderResponse) Descriptor() ([]byte, []int) { + return file_orderer_clusterserver_proto_rawDescGZIP(), []int{4} +} + +func (x *TransactionOrderResponse) GetChannel() string { + if x != nil { + return x.Channel + } + return "" +} + +func (x *TransactionOrderResponse) GetTxId() string { + if x != nil { + return x.TxId + } + return "" +} + +func (x *TransactionOrderResponse) GetStatus() common.Status { + if x != nil { + return x.Status + } + return common.Status(0) +} + +func (x *TransactionOrderResponse) GetInfo() string { + if x != nil { + return x.Info + } + return "" +} + +// NodeAuthRequest for authenticate the stream +// between the cluster members +type NodeAuthRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // version represents the fields on which the signature is computed + Version uint32 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` + // signature is verifiable using the initiator's public key + Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` + // timestamp indicates the freshness of the request; expected to be within the margin + // of the responsder's local time + Timestamp *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + // from_id is the numerical identifier of the initiator of the connection + FromId uint64 `protobuf:"varint,4,opt,name=from_id,json=fromId,proto3" json:"from_id,omitempty"` + // to_id is the numerical identifier of the node that is being connected to + ToId uint64 `protobuf:"varint,5,opt,name=to_id,json=toId,proto3" json:"to_id,omitempty"` + // session_binding is verifiable using application level protocol + SessionBinding []byte `protobuf:"bytes,6,opt,name=session_binding,json=sessionBinding,proto3" json:"session_binding,omitempty"` + Channel string `protobuf:"bytes,7,opt,name=channel,proto3" json:"channel,omitempty"` +} + +func (x *NodeAuthRequest) Reset() { + *x = NodeAuthRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_orderer_clusterserver_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NodeAuthRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NodeAuthRequest) ProtoMessage() {} + +func (x *NodeAuthRequest) ProtoReflect() protoreflect.Message { + mi := &file_orderer_clusterserver_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use NodeAuthRequest.ProtoReflect.Descriptor instead. +func (*NodeAuthRequest) Descriptor() ([]byte, []int) { + return file_orderer_clusterserver_proto_rawDescGZIP(), []int{5} +} + +func (x *NodeAuthRequest) GetVersion() uint32 { + if x != nil { + return x.Version + } + return 0 +} + +func (x *NodeAuthRequest) GetSignature() []byte { + if x != nil { + return x.Signature + } + return nil +} + +func (x *NodeAuthRequest) GetTimestamp() *timestamppb.Timestamp { + if x != nil { + return x.Timestamp + } + return nil +} + +func (x *NodeAuthRequest) GetFromId() uint64 { + if x != nil { + return x.FromId + } + return 0 +} + +func (x *NodeAuthRequest) GetToId() uint64 { + if x != nil { + return x.ToId + } + return 0 +} + +func (x *NodeAuthRequest) GetSessionBinding() []byte { + if x != nil { + return x.SessionBinding + } + return nil +} + +func (x *NodeAuthRequest) GetChannel() string { + if x != nil { + return x.Channel + } + return "" +} + +var File_orderer_clusterserver_proto protoreflect.FileDescriptor + +var file_orderer_clusterserver_proto_rawDesc = []byte{ + 0x0a, 0x1b, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x72, 0x2f, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, + 0x72, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x07, 0x6f, + 0x72, 0x64, 0x65, 0x72, 0x65, 0x72, 0x1a, 0x13, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, + 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x8e, 0x02, 0x0a, + 0x1d, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x53, 0x74, 0x65, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x48, + 0x0a, 0x0f, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x65, + 0x72, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x0e, 0x6e, 0x6f, 0x64, 0x65, 0x43, 0x6f, + 0x6e, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x51, 0x0a, 0x10, 0x6e, 0x6f, 0x64, 0x65, + 0x5f, 0x74, 0x72, 0x61, 0x6e, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x72, 0x2e, 0x4e, 0x6f, 0x64, + 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x72, 0x64, 0x65, + 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x0f, 0x6e, 0x6f, 0x64, 0x65, + 0x54, 0x72, 0x61, 0x6e, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x45, 0x0a, 0x10, 0x6e, + 0x6f, 0x64, 0x65, 0x5f, 0x61, 0x75, 0x74, 0x68, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x72, 0x2e, + 0x4e, 0x6f, 0x64, 0x65, 0x41, 0x75, 0x74, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, + 0x00, 0x52, 0x0f, 0x6e, 0x6f, 0x64, 0x65, 0x41, 0x75, 0x74, 0x68, 0x72, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x42, 0x09, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x75, 0x0a, + 0x1e, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x53, 0x74, 0x65, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x48, 0x0a, 0x0d, 0x74, 0x72, 0x61, 0x6e, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x72, 0x65, 0x73, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x72, + 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x72, 0x64, 0x65, + 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x0c, 0x74, 0x72, 0x61, + 0x6e, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x42, 0x09, 0x0a, 0x07, 0x70, 0x61, 0x79, + 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x4c, 0x0a, 0x14, 0x4e, 0x6f, 0x64, 0x65, 0x43, 0x6f, 0x6e, 0x73, + 0x65, 0x6e, 0x73, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, + 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x70, + 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0x22, 0x79, 0x0a, 0x1b, 0x4e, 0x6f, 0x64, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x2e, 0x0a, 0x13, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x65, 0x71, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x11, + 0x6c, 0x61, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, + 0x71, 0x12, 0x2a, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x45, 0x6e, 0x76, 0x65, + 0x6c, 0x6f, 0x70, 0x65, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x85, 0x01, + 0x0a, 0x18, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x72, 0x64, + 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x68, + 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x68, 0x61, + 0x6e, 0x6e, 0x65, 0x6c, 0x12, 0x13, 0x0a, 0x05, 0x74, 0x78, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x78, 0x49, 0x64, 0x12, 0x26, 0x0a, 0x06, 0x73, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0e, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, + 0x6f, 0x6e, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x22, 0xf4, 0x01, 0x0a, 0x0f, 0x4e, 0x6f, 0x64, 0x65, 0x41, 0x75, + 0x74, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, + 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, + 0x69, 0x6f, 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, + 0x65, 0x12, 0x38, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x17, 0x0a, 0x07, 0x66, + 0x72, 0x6f, 0x6d, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x66, 0x72, + 0x6f, 0x6d, 0x49, 0x64, 0x12, 0x13, 0x0a, 0x05, 0x74, 0x6f, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x04, 0x74, 0x6f, 0x49, 0x64, 0x12, 0x27, 0x0a, 0x0f, 0x73, 0x65, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x62, 0x69, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x0e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x42, 0x69, 0x6e, 0x64, 0x69, + 0x6e, 0x67, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x32, 0x71, 0x0a, 0x12, + 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x12, 0x5b, 0x0a, 0x04, 0x53, 0x74, 0x65, 0x70, 0x12, 0x26, 0x2e, 0x6f, 0x72, 0x64, + 0x65, 0x72, 0x65, 0x72, 0x2e, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x6f, 0x64, 0x65, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x53, 0x74, 0x65, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x72, 0x2e, 0x43, 0x6c, 0x75, + 0x73, 0x74, 0x65, 0x72, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x53, + 0x74, 0x65, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x28, 0x01, 0x30, 0x01, 0x42, + 0xae, 0x01, 0x0a, 0x25, 0x6f, 0x72, 0x67, 0x2e, 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x65, 0x64, + 0x67, 0x65, 0x72, 0x2e, 0x66, 0x61, 0x62, 0x72, 0x69, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x73, 0x2e, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x72, 0x42, 0x12, 0x43, 0x6c, 0x75, 0x73, 0x74, + 0x65, 0x72, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, + 0x35, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x79, 0x70, 0x65, + 0x72, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2f, 0x66, 0x61, 0x62, 0x72, 0x69, 0x63, 0x2d, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2d, 0x67, 0x6f, 0x2d, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, + 0x72, 0x64, 0x65, 0x72, 0x65, 0x72, 0xa2, 0x02, 0x03, 0x4f, 0x58, 0x58, 0xaa, 0x02, 0x07, 0x4f, + 0x72, 0x64, 0x65, 0x72, 0x65, 0x72, 0xca, 0x02, 0x07, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x72, + 0xe2, 0x02, 0x13, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x72, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x07, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x72, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_orderer_clusterserver_proto_rawDescOnce sync.Once + file_orderer_clusterserver_proto_rawDescData = file_orderer_clusterserver_proto_rawDesc +) + +func file_orderer_clusterserver_proto_rawDescGZIP() []byte { + file_orderer_clusterserver_proto_rawDescOnce.Do(func() { + file_orderer_clusterserver_proto_rawDescData = protoimpl.X.CompressGZIP(file_orderer_clusterserver_proto_rawDescData) + }) + return file_orderer_clusterserver_proto_rawDescData +} + +var file_orderer_clusterserver_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_orderer_clusterserver_proto_goTypes = []interface{}{ + (*ClusterNodeServiceStepRequest)(nil), // 0: orderer.ClusterNodeServiceStepRequest + (*ClusterNodeServiceStepResponse)(nil), // 1: orderer.ClusterNodeServiceStepResponse + (*NodeConsensusRequest)(nil), // 2: orderer.NodeConsensusRequest + (*NodeTransactionOrderRequest)(nil), // 3: orderer.NodeTransactionOrderRequest + (*TransactionOrderResponse)(nil), // 4: orderer.TransactionOrderResponse + (*NodeAuthRequest)(nil), // 5: orderer.NodeAuthRequest + (*common.Envelope)(nil), // 6: common.Envelope + (common.Status)(0), // 7: common.Status + (*timestamppb.Timestamp)(nil), // 8: google.protobuf.Timestamp +} +var file_orderer_clusterserver_proto_depIdxs = []int32{ + 2, // 0: orderer.ClusterNodeServiceStepRequest.node_conrequest:type_name -> orderer.NodeConsensusRequest + 3, // 1: orderer.ClusterNodeServiceStepRequest.node_tranrequest:type_name -> orderer.NodeTransactionOrderRequest + 5, // 2: orderer.ClusterNodeServiceStepRequest.node_authrequest:type_name -> orderer.NodeAuthRequest + 4, // 3: orderer.ClusterNodeServiceStepResponse.tranorder_res:type_name -> orderer.TransactionOrderResponse + 6, // 4: orderer.NodeTransactionOrderRequest.payload:type_name -> common.Envelope + 7, // 5: orderer.TransactionOrderResponse.status:type_name -> common.Status + 8, // 6: orderer.NodeAuthRequest.timestamp:type_name -> google.protobuf.Timestamp + 0, // 7: orderer.ClusterNodeService.Step:input_type -> orderer.ClusterNodeServiceStepRequest + 1, // 8: orderer.ClusterNodeService.Step:output_type -> orderer.ClusterNodeServiceStepResponse + 8, // [8:9] is the sub-list for method output_type + 7, // [7:8] is the sub-list for method input_type + 7, // [7:7] is the sub-list for extension type_name + 7, // [7:7] is the sub-list for extension extendee + 0, // [0:7] is the sub-list for field type_name +} + +func init() { file_orderer_clusterserver_proto_init() } +func file_orderer_clusterserver_proto_init() { + if File_orderer_clusterserver_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_orderer_clusterserver_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ClusterNodeServiceStepRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_orderer_clusterserver_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ClusterNodeServiceStepResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_orderer_clusterserver_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NodeConsensusRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_orderer_clusterserver_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NodeTransactionOrderRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_orderer_clusterserver_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TransactionOrderResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_orderer_clusterserver_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NodeAuthRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_orderer_clusterserver_proto_msgTypes[0].OneofWrappers = []interface{}{ + (*ClusterNodeServiceStepRequest_NodeConrequest)(nil), + (*ClusterNodeServiceStepRequest_NodeTranrequest)(nil), + (*ClusterNodeServiceStepRequest_NodeAuthrequest)(nil), + } + file_orderer_clusterserver_proto_msgTypes[1].OneofWrappers = []interface{}{ + (*ClusterNodeServiceStepResponse_TranorderRes)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_orderer_clusterserver_proto_rawDesc, + NumEnums: 0, + NumMessages: 6, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_orderer_clusterserver_proto_goTypes, + DependencyIndexes: file_orderer_clusterserver_proto_depIdxs, + MessageInfos: file_orderer_clusterserver_proto_msgTypes, + }.Build() + File_orderer_clusterserver_proto = out.File + file_orderer_clusterserver_proto_rawDesc = nil + file_orderer_clusterserver_proto_goTypes = nil + file_orderer_clusterserver_proto_depIdxs = nil +} diff --git a/vendor/github.com/hyperledger/fabric-protos-go-apiv2/orderer/clusterserver_grpc.pb.go b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/orderer/clusterserver_grpc.pb.go new file mode 100644 index 00000000000..d4c8fa58644 --- /dev/null +++ b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/orderer/clusterserver_grpc.pb.go @@ -0,0 +1,145 @@ +// Copyright the Hyperledger Fabric contributors. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: orderer/clusterserver.proto + +package orderer + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + ClusterNodeService_Step_FullMethodName = "/orderer.ClusterNodeService/Step" +) + +// ClusterNodeServiceClient is the client API for ClusterNodeService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type ClusterNodeServiceClient interface { + // Step passes an implementation-specific message to another cluster member. + Step(ctx context.Context, opts ...grpc.CallOption) (ClusterNodeService_StepClient, error) +} + +type clusterNodeServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewClusterNodeServiceClient(cc grpc.ClientConnInterface) ClusterNodeServiceClient { + return &clusterNodeServiceClient{cc} +} + +func (c *clusterNodeServiceClient) Step(ctx context.Context, opts ...grpc.CallOption) (ClusterNodeService_StepClient, error) { + stream, err := c.cc.NewStream(ctx, &ClusterNodeService_ServiceDesc.Streams[0], ClusterNodeService_Step_FullMethodName, opts...) + if err != nil { + return nil, err + } + x := &clusterNodeServiceStepClient{stream} + return x, nil +} + +type ClusterNodeService_StepClient interface { + Send(*ClusterNodeServiceStepRequest) error + Recv() (*ClusterNodeServiceStepResponse, error) + grpc.ClientStream +} + +type clusterNodeServiceStepClient struct { + grpc.ClientStream +} + +func (x *clusterNodeServiceStepClient) Send(m *ClusterNodeServiceStepRequest) error { + return x.ClientStream.SendMsg(m) +} + +func (x *clusterNodeServiceStepClient) Recv() (*ClusterNodeServiceStepResponse, error) { + m := new(ClusterNodeServiceStepResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// ClusterNodeServiceServer is the server API for ClusterNodeService service. +// All implementations should embed UnimplementedClusterNodeServiceServer +// for forward compatibility +type ClusterNodeServiceServer interface { + // Step passes an implementation-specific message to another cluster member. + Step(ClusterNodeService_StepServer) error +} + +// UnimplementedClusterNodeServiceServer should be embedded to have forward compatible implementations. +type UnimplementedClusterNodeServiceServer struct { +} + +func (UnimplementedClusterNodeServiceServer) Step(ClusterNodeService_StepServer) error { + return status.Errorf(codes.Unimplemented, "method Step not implemented") +} + +// UnsafeClusterNodeServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to ClusterNodeServiceServer will +// result in compilation errors. +type UnsafeClusterNodeServiceServer interface { + mustEmbedUnimplementedClusterNodeServiceServer() +} + +func RegisterClusterNodeServiceServer(s grpc.ServiceRegistrar, srv ClusterNodeServiceServer) { + s.RegisterService(&ClusterNodeService_ServiceDesc, srv) +} + +func _ClusterNodeService_Step_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(ClusterNodeServiceServer).Step(&clusterNodeServiceStepServer{stream}) +} + +type ClusterNodeService_StepServer interface { + Send(*ClusterNodeServiceStepResponse) error + Recv() (*ClusterNodeServiceStepRequest, error) + grpc.ServerStream +} + +type clusterNodeServiceStepServer struct { + grpc.ServerStream +} + +func (x *clusterNodeServiceStepServer) Send(m *ClusterNodeServiceStepResponse) error { + return x.ServerStream.SendMsg(m) +} + +func (x *clusterNodeServiceStepServer) Recv() (*ClusterNodeServiceStepRequest, error) { + m := new(ClusterNodeServiceStepRequest) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// ClusterNodeService_ServiceDesc is the grpc.ServiceDesc for ClusterNodeService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var ClusterNodeService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "orderer.ClusterNodeService", + HandlerType: (*ClusterNodeServiceServer)(nil), + Methods: []grpc.MethodDesc{}, + Streams: []grpc.StreamDesc{ + { + StreamName: "Step", + Handler: _ClusterNodeService_Step_Handler, + ServerStreams: true, + ClientStreams: true, + }, + }, + Metadata: "orderer/clusterserver.proto", +} diff --git a/vendor/github.com/hyperledger/fabric-protos-go-apiv2/orderer/configuration.pb.go b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/orderer/configuration.pb.go new file mode 100644 index 00000000000..58f2f6a5e49 --- /dev/null +++ b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/orderer/configuration.pb.go @@ -0,0 +1,526 @@ +// Copyright the Hyperledger Fabric contributors. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: orderer/configuration.proto + +package orderer + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// State defines the orderer mode of operation, typically for consensus-type migration. +// NORMAL is during normal operation, when consensus-type migration is not, and can not, take place. +// MAINTENANCE is when the consensus-type can be changed. +type ConsensusType_State int32 + +const ( + ConsensusType_STATE_NORMAL ConsensusType_State = 0 + ConsensusType_STATE_MAINTENANCE ConsensusType_State = 1 +) + +// Enum value maps for ConsensusType_State. +var ( + ConsensusType_State_name = map[int32]string{ + 0: "STATE_NORMAL", + 1: "STATE_MAINTENANCE", + } + ConsensusType_State_value = map[string]int32{ + "STATE_NORMAL": 0, + "STATE_MAINTENANCE": 1, + } +) + +func (x ConsensusType_State) Enum() *ConsensusType_State { + p := new(ConsensusType_State) + *p = x + return p +} + +func (x ConsensusType_State) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ConsensusType_State) Descriptor() protoreflect.EnumDescriptor { + return file_orderer_configuration_proto_enumTypes[0].Descriptor() +} + +func (ConsensusType_State) Type() protoreflect.EnumType { + return &file_orderer_configuration_proto_enumTypes[0] +} + +func (x ConsensusType_State) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ConsensusType_State.Descriptor instead. +func (ConsensusType_State) EnumDescriptor() ([]byte, []int) { + return file_orderer_configuration_proto_rawDescGZIP(), []int{0, 0} +} + +type ConsensusType struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The consensus type: "solo" or "etcdraft". + Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` + // Opaque metadata, dependent on the consensus type. + Metadata []byte `protobuf:"bytes,2,opt,name=metadata,proto3" json:"metadata,omitempty"` + // The state signals the ordering service to go into maintenance mode, typically for consensus-type migration. + State ConsensusType_State `protobuf:"varint,3,opt,name=state,proto3,enum=orderer.ConsensusType_State" json:"state,omitempty"` +} + +func (x *ConsensusType) Reset() { + *x = ConsensusType{} + if protoimpl.UnsafeEnabled { + mi := &file_orderer_configuration_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ConsensusType) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ConsensusType) ProtoMessage() {} + +func (x *ConsensusType) ProtoReflect() protoreflect.Message { + mi := &file_orderer_configuration_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ConsensusType.ProtoReflect.Descriptor instead. +func (*ConsensusType) Descriptor() ([]byte, []int) { + return file_orderer_configuration_proto_rawDescGZIP(), []int{0} +} + +func (x *ConsensusType) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *ConsensusType) GetMetadata() []byte { + if x != nil { + return x.Metadata + } + return nil +} + +func (x *ConsensusType) GetState() ConsensusType_State { + if x != nil { + return x.State + } + return ConsensusType_STATE_NORMAL +} + +type BatchSize struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Simply specified as number of messages for now, in the future + // we may want to allow this to be specified by size in bytes + MaxMessageCount uint32 `protobuf:"varint,1,opt,name=max_message_count,json=maxMessageCount,proto3" json:"max_message_count,omitempty"` + // The byte count of the serialized messages in a batch cannot + // exceed this value. + AbsoluteMaxBytes uint32 `protobuf:"varint,2,opt,name=absolute_max_bytes,json=absoluteMaxBytes,proto3" json:"absolute_max_bytes,omitempty"` + // The byte count of the serialized messages in a batch should not + // exceed this value. + PreferredMaxBytes uint32 `protobuf:"varint,3,opt,name=preferred_max_bytes,json=preferredMaxBytes,proto3" json:"preferred_max_bytes,omitempty"` +} + +func (x *BatchSize) Reset() { + *x = BatchSize{} + if protoimpl.UnsafeEnabled { + mi := &file_orderer_configuration_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BatchSize) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BatchSize) ProtoMessage() {} + +func (x *BatchSize) ProtoReflect() protoreflect.Message { + mi := &file_orderer_configuration_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BatchSize.ProtoReflect.Descriptor instead. +func (*BatchSize) Descriptor() ([]byte, []int) { + return file_orderer_configuration_proto_rawDescGZIP(), []int{1} +} + +func (x *BatchSize) GetMaxMessageCount() uint32 { + if x != nil { + return x.MaxMessageCount + } + return 0 +} + +func (x *BatchSize) GetAbsoluteMaxBytes() uint32 { + if x != nil { + return x.AbsoluteMaxBytes + } + return 0 +} + +func (x *BatchSize) GetPreferredMaxBytes() uint32 { + if x != nil { + return x.PreferredMaxBytes + } + return 0 +} + +type BatchTimeout struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Any duration string parseable by ParseDuration(): + // https://golang.org/pkg/time/#ParseDuration + Timeout string `protobuf:"bytes,1,opt,name=timeout,proto3" json:"timeout,omitempty"` +} + +func (x *BatchTimeout) Reset() { + *x = BatchTimeout{} + if protoimpl.UnsafeEnabled { + mi := &file_orderer_configuration_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BatchTimeout) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BatchTimeout) ProtoMessage() {} + +func (x *BatchTimeout) ProtoReflect() protoreflect.Message { + mi := &file_orderer_configuration_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BatchTimeout.ProtoReflect.Descriptor instead. +func (*BatchTimeout) Descriptor() ([]byte, []int) { + return file_orderer_configuration_proto_rawDescGZIP(), []int{2} +} + +func (x *BatchTimeout) GetTimeout() string { + if x != nil { + return x.Timeout + } + return "" +} + +// Carries a list of bootstrap brokers, i.e. this is not the exclusive set of +// brokers an ordering service +// +// Deprecated: Marked as deprecated in orderer/configuration.proto. +type KafkaBrokers struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Each broker here should be identified using the (IP|host):port notation, + // e.g. 127.0.0.1:7050, or localhost:7050 are valid entries + Brokers []string `protobuf:"bytes,1,rep,name=brokers,proto3" json:"brokers,omitempty"` +} + +func (x *KafkaBrokers) Reset() { + *x = KafkaBrokers{} + if protoimpl.UnsafeEnabled { + mi := &file_orderer_configuration_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *KafkaBrokers) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*KafkaBrokers) ProtoMessage() {} + +func (x *KafkaBrokers) ProtoReflect() protoreflect.Message { + mi := &file_orderer_configuration_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use KafkaBrokers.ProtoReflect.Descriptor instead. +func (*KafkaBrokers) Descriptor() ([]byte, []int) { + return file_orderer_configuration_proto_rawDescGZIP(), []int{3} +} + +func (x *KafkaBrokers) GetBrokers() []string { + if x != nil { + return x.Brokers + } + return nil +} + +// ChannelRestrictions is the mssage which conveys restrictions on channel creation for an orderer +type ChannelRestrictions struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + MaxCount uint64 `protobuf:"varint,1,opt,name=max_count,json=maxCount,proto3" json:"max_count,omitempty"` // The max count of channels to allow to be created, a value of 0 indicates no limit +} + +func (x *ChannelRestrictions) Reset() { + *x = ChannelRestrictions{} + if protoimpl.UnsafeEnabled { + mi := &file_orderer_configuration_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChannelRestrictions) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChannelRestrictions) ProtoMessage() {} + +func (x *ChannelRestrictions) ProtoReflect() protoreflect.Message { + mi := &file_orderer_configuration_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ChannelRestrictions.ProtoReflect.Descriptor instead. +func (*ChannelRestrictions) Descriptor() ([]byte, []int) { + return file_orderer_configuration_proto_rawDescGZIP(), []int{4} +} + +func (x *ChannelRestrictions) GetMaxCount() uint64 { + if x != nil { + return x.MaxCount + } + return 0 +} + +var File_orderer_configuration_proto protoreflect.FileDescriptor + +var file_orderer_configuration_proto_rawDesc = []byte{ + 0x0a, 0x1b, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x72, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x07, 0x6f, + 0x72, 0x64, 0x65, 0x72, 0x65, 0x72, 0x22, 0xa5, 0x01, 0x0a, 0x0d, 0x43, 0x6f, 0x6e, 0x73, 0x65, + 0x6e, 0x73, 0x75, 0x73, 0x54, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x08, + 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, + 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x32, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, + 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1c, 0x2e, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x65, + 0x72, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x54, 0x79, 0x70, 0x65, 0x2e, + 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x22, 0x30, 0x0a, 0x05, + 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x10, 0x0a, 0x0c, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x4e, + 0x4f, 0x52, 0x4d, 0x41, 0x4c, 0x10, 0x00, 0x12, 0x15, 0x0a, 0x11, 0x53, 0x54, 0x41, 0x54, 0x45, + 0x5f, 0x4d, 0x41, 0x49, 0x4e, 0x54, 0x45, 0x4e, 0x41, 0x4e, 0x43, 0x45, 0x10, 0x01, 0x22, 0x95, + 0x01, 0x0a, 0x09, 0x42, 0x61, 0x74, 0x63, 0x68, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x2a, 0x0a, 0x11, + 0x6d, 0x61, 0x78, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0f, 0x6d, 0x61, 0x78, 0x4d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x2c, 0x0a, 0x12, 0x61, 0x62, 0x73, 0x6f, + 0x6c, 0x75, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x78, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0d, 0x52, 0x10, 0x61, 0x62, 0x73, 0x6f, 0x6c, 0x75, 0x74, 0x65, 0x4d, 0x61, + 0x78, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x2e, 0x0a, 0x13, 0x70, 0x72, 0x65, 0x66, 0x65, 0x72, + 0x72, 0x65, 0x64, 0x5f, 0x6d, 0x61, 0x78, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0d, 0x52, 0x11, 0x70, 0x72, 0x65, 0x66, 0x65, 0x72, 0x72, 0x65, 0x64, 0x4d, 0x61, + 0x78, 0x42, 0x79, 0x74, 0x65, 0x73, 0x22, 0x28, 0x0a, 0x0c, 0x42, 0x61, 0x74, 0x63, 0x68, 0x54, + 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, + 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, + 0x22, 0x2c, 0x0a, 0x0c, 0x4b, 0x61, 0x66, 0x6b, 0x61, 0x42, 0x72, 0x6f, 0x6b, 0x65, 0x72, 0x73, + 0x12, 0x18, 0x0a, 0x07, 0x62, 0x72, 0x6f, 0x6b, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x09, 0x52, 0x07, 0x62, 0x72, 0x6f, 0x6b, 0x65, 0x72, 0x73, 0x3a, 0x02, 0x18, 0x01, 0x22, 0x32, + 0x0a, 0x13, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x52, 0x65, 0x73, 0x74, 0x72, 0x69, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x61, 0x78, 0x5f, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x6d, 0x61, 0x78, 0x43, 0x6f, 0x75, + 0x6e, 0x74, 0x42, 0xae, 0x01, 0x0a, 0x25, 0x6f, 0x72, 0x67, 0x2e, 0x68, 0x79, 0x70, 0x65, 0x72, + 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2e, 0x66, 0x61, 0x62, 0x72, 0x69, 0x63, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x72, 0x42, 0x12, 0x43, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, + 0x50, 0x01, 0x5a, 0x35, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, + 0x79, 0x70, 0x65, 0x72, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2f, 0x66, 0x61, 0x62, 0x72, 0x69, + 0x63, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2d, 0x67, 0x6f, 0x2d, 0x61, 0x70, 0x69, 0x76, + 0x32, 0x2f, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x72, 0xa2, 0x02, 0x03, 0x4f, 0x58, 0x58, 0xaa, + 0x02, 0x07, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x72, 0xca, 0x02, 0x07, 0x4f, 0x72, 0x64, 0x65, + 0x72, 0x65, 0x72, 0xe2, 0x02, 0x13, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x72, 0x5c, 0x47, 0x50, + 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x07, 0x4f, 0x72, 0x64, 0x65, + 0x72, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_orderer_configuration_proto_rawDescOnce sync.Once + file_orderer_configuration_proto_rawDescData = file_orderer_configuration_proto_rawDesc +) + +func file_orderer_configuration_proto_rawDescGZIP() []byte { + file_orderer_configuration_proto_rawDescOnce.Do(func() { + file_orderer_configuration_proto_rawDescData = protoimpl.X.CompressGZIP(file_orderer_configuration_proto_rawDescData) + }) + return file_orderer_configuration_proto_rawDescData +} + +var file_orderer_configuration_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_orderer_configuration_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +var file_orderer_configuration_proto_goTypes = []interface{}{ + (ConsensusType_State)(0), // 0: orderer.ConsensusType.State + (*ConsensusType)(nil), // 1: orderer.ConsensusType + (*BatchSize)(nil), // 2: orderer.BatchSize + (*BatchTimeout)(nil), // 3: orderer.BatchTimeout + (*KafkaBrokers)(nil), // 4: orderer.KafkaBrokers + (*ChannelRestrictions)(nil), // 5: orderer.ChannelRestrictions +} +var file_orderer_configuration_proto_depIdxs = []int32{ + 0, // 0: orderer.ConsensusType.state:type_name -> orderer.ConsensusType.State + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_orderer_configuration_proto_init() } +func file_orderer_configuration_proto_init() { + if File_orderer_configuration_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_orderer_configuration_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ConsensusType); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_orderer_configuration_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BatchSize); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_orderer_configuration_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BatchTimeout); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_orderer_configuration_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*KafkaBrokers); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_orderer_configuration_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChannelRestrictions); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_orderer_configuration_proto_rawDesc, + NumEnums: 1, + NumMessages: 5, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_orderer_configuration_proto_goTypes, + DependencyIndexes: file_orderer_configuration_proto_depIdxs, + EnumInfos: file_orderer_configuration_proto_enumTypes, + MessageInfos: file_orderer_configuration_proto_msgTypes, + }.Build() + File_orderer_configuration_proto = out.File + file_orderer_configuration_proto_rawDesc = nil + file_orderer_configuration_proto_goTypes = nil + file_orderer_configuration_proto_depIdxs = nil +} diff --git a/vendor/github.com/hyperledger/fabric-protos-go-apiv2/orderer/etcdraft/configuration.pb.go b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/orderer/etcdraft/configuration.pb.go new file mode 100644 index 00000000000..e0b0b857e0b --- /dev/null +++ b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/orderer/etcdraft/configuration.pb.go @@ -0,0 +1,378 @@ +// Copyright the Hyperledger Fabric contributors. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: orderer/etcdraft/configuration.proto + +package etcdraft + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// ConfigMetadata is serialized and set as the value of ConsensusType.Metadata in +// a channel configuration when the ConsensusType.Type is set "etcdraft". +type ConfigMetadata struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Consenters []*Consenter `protobuf:"bytes,1,rep,name=consenters,proto3" json:"consenters,omitempty"` + Options *Options `protobuf:"bytes,2,opt,name=options,proto3" json:"options,omitempty"` +} + +func (x *ConfigMetadata) Reset() { + *x = ConfigMetadata{} + if protoimpl.UnsafeEnabled { + mi := &file_orderer_etcdraft_configuration_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ConfigMetadata) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ConfigMetadata) ProtoMessage() {} + +func (x *ConfigMetadata) ProtoReflect() protoreflect.Message { + mi := &file_orderer_etcdraft_configuration_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ConfigMetadata.ProtoReflect.Descriptor instead. +func (*ConfigMetadata) Descriptor() ([]byte, []int) { + return file_orderer_etcdraft_configuration_proto_rawDescGZIP(), []int{0} +} + +func (x *ConfigMetadata) GetConsenters() []*Consenter { + if x != nil { + return x.Consenters + } + return nil +} + +func (x *ConfigMetadata) GetOptions() *Options { + if x != nil { + return x.Options + } + return nil +} + +// Consenter represents a consenting node (i.e. replica). +type Consenter struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Host string `protobuf:"bytes,1,opt,name=host,proto3" json:"host,omitempty"` + Port uint32 `protobuf:"varint,2,opt,name=port,proto3" json:"port,omitempty"` + ClientTlsCert []byte `protobuf:"bytes,3,opt,name=client_tls_cert,json=clientTlsCert,proto3" json:"client_tls_cert,omitempty"` + ServerTlsCert []byte `protobuf:"bytes,4,opt,name=server_tls_cert,json=serverTlsCert,proto3" json:"server_tls_cert,omitempty"` +} + +func (x *Consenter) Reset() { + *x = Consenter{} + if protoimpl.UnsafeEnabled { + mi := &file_orderer_etcdraft_configuration_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Consenter) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Consenter) ProtoMessage() {} + +func (x *Consenter) ProtoReflect() protoreflect.Message { + mi := &file_orderer_etcdraft_configuration_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Consenter.ProtoReflect.Descriptor instead. +func (*Consenter) Descriptor() ([]byte, []int) { + return file_orderer_etcdraft_configuration_proto_rawDescGZIP(), []int{1} +} + +func (x *Consenter) GetHost() string { + if x != nil { + return x.Host + } + return "" +} + +func (x *Consenter) GetPort() uint32 { + if x != nil { + return x.Port + } + return 0 +} + +func (x *Consenter) GetClientTlsCert() []byte { + if x != nil { + return x.ClientTlsCert + } + return nil +} + +func (x *Consenter) GetServerTlsCert() []byte { + if x != nil { + return x.ServerTlsCert + } + return nil +} + +// Options to be specified for all the etcd/raft nodes. These can be modified on a +// per-channel basis. +type Options struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TickInterval string `protobuf:"bytes,1,opt,name=tick_interval,json=tickInterval,proto3" json:"tick_interval,omitempty"` // time duration format, e.g. 500ms + ElectionTick uint32 `protobuf:"varint,2,opt,name=election_tick,json=electionTick,proto3" json:"election_tick,omitempty"` + HeartbeatTick uint32 `protobuf:"varint,3,opt,name=heartbeat_tick,json=heartbeatTick,proto3" json:"heartbeat_tick,omitempty"` + MaxInflightBlocks uint32 `protobuf:"varint,4,opt,name=max_inflight_blocks,json=maxInflightBlocks,proto3" json:"max_inflight_blocks,omitempty"` + // Take snapshot when cumulative data exceeds certain size in bytes. + SnapshotIntervalSize uint32 `protobuf:"varint,5,opt,name=snapshot_interval_size,json=snapshotIntervalSize,proto3" json:"snapshot_interval_size,omitempty"` +} + +func (x *Options) Reset() { + *x = Options{} + if protoimpl.UnsafeEnabled { + mi := &file_orderer_etcdraft_configuration_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Options) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Options) ProtoMessage() {} + +func (x *Options) ProtoReflect() protoreflect.Message { + mi := &file_orderer_etcdraft_configuration_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Options.ProtoReflect.Descriptor instead. +func (*Options) Descriptor() ([]byte, []int) { + return file_orderer_etcdraft_configuration_proto_rawDescGZIP(), []int{2} +} + +func (x *Options) GetTickInterval() string { + if x != nil { + return x.TickInterval + } + return "" +} + +func (x *Options) GetElectionTick() uint32 { + if x != nil { + return x.ElectionTick + } + return 0 +} + +func (x *Options) GetHeartbeatTick() uint32 { + if x != nil { + return x.HeartbeatTick + } + return 0 +} + +func (x *Options) GetMaxInflightBlocks() uint32 { + if x != nil { + return x.MaxInflightBlocks + } + return 0 +} + +func (x *Options) GetSnapshotIntervalSize() uint32 { + if x != nil { + return x.SnapshotIntervalSize + } + return 0 +} + +var File_orderer_etcdraft_configuration_proto protoreflect.FileDescriptor + +var file_orderer_etcdraft_configuration_proto_rawDesc = []byte{ + 0x0a, 0x24, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x72, 0x2f, 0x65, 0x74, 0x63, 0x64, 0x72, 0x61, + 0x66, 0x74, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x08, 0x65, 0x74, 0x63, 0x64, 0x72, 0x61, 0x66, 0x74, + 0x22, 0x72, 0x0a, 0x0e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0x12, 0x33, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x65, 0x74, 0x63, 0x64, 0x72, 0x61, 0x66, + 0x74, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x52, 0x0a, 0x63, 0x6f, 0x6e, + 0x73, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x73, 0x12, 0x2b, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x65, 0x74, 0x63, 0x64, 0x72, + 0x61, 0x66, 0x74, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6f, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x83, 0x01, 0x0a, 0x09, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x74, + 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x26, 0x0a, 0x0f, 0x63, 0x6c, + 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x6c, 0x73, 0x5f, 0x63, 0x65, 0x72, 0x74, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x0d, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x54, 0x6c, 0x73, 0x43, 0x65, + 0x72, 0x74, 0x12, 0x26, 0x0a, 0x0f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x74, 0x6c, 0x73, + 0x5f, 0x63, 0x65, 0x72, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0d, 0x73, 0x65, 0x72, + 0x76, 0x65, 0x72, 0x54, 0x6c, 0x73, 0x43, 0x65, 0x72, 0x74, 0x22, 0xe0, 0x01, 0x0a, 0x07, 0x4f, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x74, 0x69, 0x63, 0x6b, 0x5f, 0x69, + 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x74, + 0x69, 0x63, 0x6b, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x12, 0x23, 0x0a, 0x0d, 0x65, + 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x69, 0x63, 0x6b, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0d, 0x52, 0x0c, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x63, 0x6b, + 0x12, 0x25, 0x0a, 0x0e, 0x68, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x5f, 0x74, 0x69, + 0x63, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0d, 0x68, 0x65, 0x61, 0x72, 0x74, 0x62, + 0x65, 0x61, 0x74, 0x54, 0x69, 0x63, 0x6b, 0x12, 0x2e, 0x0a, 0x13, 0x6d, 0x61, 0x78, 0x5f, 0x69, + 0x6e, 0x66, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x0d, 0x52, 0x11, 0x6d, 0x61, 0x78, 0x49, 0x6e, 0x66, 0x6c, 0x69, 0x67, 0x68, + 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x12, 0x34, 0x0a, 0x16, 0x73, 0x6e, 0x61, 0x70, 0x73, + 0x68, 0x6f, 0x74, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x5f, 0x73, 0x69, 0x7a, + 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x14, 0x73, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, + 0x74, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x53, 0x69, 0x7a, 0x65, 0x42, 0xc4, 0x01, + 0x0a, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x65, 0x64, 0x67, 0x65, + 0x72, 0x2e, 0x66, 0x61, 0x62, 0x72, 0x69, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, + 0x6f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x72, 0x2e, 0x65, 0x74, 0x63, 0x64, 0x72, 0x61, 0x66, 0x74, + 0x42, 0x12, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, + 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2f, 0x66, + 0x61, 0x62, 0x72, 0x69, 0x63, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2d, 0x67, 0x6f, 0x2d, + 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x72, 0x2f, 0x65, 0x74, + 0x63, 0x64, 0x72, 0x61, 0x66, 0x74, 0xa2, 0x02, 0x03, 0x45, 0x58, 0x58, 0xaa, 0x02, 0x08, 0x45, + 0x74, 0x63, 0x64, 0x72, 0x61, 0x66, 0x74, 0xca, 0x02, 0x08, 0x45, 0x74, 0x63, 0x64, 0x72, 0x61, + 0x66, 0x74, 0xe2, 0x02, 0x14, 0x45, 0x74, 0x63, 0x64, 0x72, 0x61, 0x66, 0x74, 0x5c, 0x47, 0x50, + 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x08, 0x45, 0x74, 0x63, 0x64, + 0x72, 0x61, 0x66, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_orderer_etcdraft_configuration_proto_rawDescOnce sync.Once + file_orderer_etcdraft_configuration_proto_rawDescData = file_orderer_etcdraft_configuration_proto_rawDesc +) + +func file_orderer_etcdraft_configuration_proto_rawDescGZIP() []byte { + file_orderer_etcdraft_configuration_proto_rawDescOnce.Do(func() { + file_orderer_etcdraft_configuration_proto_rawDescData = protoimpl.X.CompressGZIP(file_orderer_etcdraft_configuration_proto_rawDescData) + }) + return file_orderer_etcdraft_configuration_proto_rawDescData +} + +var file_orderer_etcdraft_configuration_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_orderer_etcdraft_configuration_proto_goTypes = []interface{}{ + (*ConfigMetadata)(nil), // 0: etcdraft.ConfigMetadata + (*Consenter)(nil), // 1: etcdraft.Consenter + (*Options)(nil), // 2: etcdraft.Options +} +var file_orderer_etcdraft_configuration_proto_depIdxs = []int32{ + 1, // 0: etcdraft.ConfigMetadata.consenters:type_name -> etcdraft.Consenter + 2, // 1: etcdraft.ConfigMetadata.options:type_name -> etcdraft.Options + 2, // [2:2] is the sub-list for method output_type + 2, // [2:2] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_orderer_etcdraft_configuration_proto_init() } +func file_orderer_etcdraft_configuration_proto_init() { + if File_orderer_etcdraft_configuration_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_orderer_etcdraft_configuration_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ConfigMetadata); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_orderer_etcdraft_configuration_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Consenter); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_orderer_etcdraft_configuration_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Options); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_orderer_etcdraft_configuration_proto_rawDesc, + NumEnums: 0, + NumMessages: 3, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_orderer_etcdraft_configuration_proto_goTypes, + DependencyIndexes: file_orderer_etcdraft_configuration_proto_depIdxs, + MessageInfos: file_orderer_etcdraft_configuration_proto_msgTypes, + }.Build() + File_orderer_etcdraft_configuration_proto = out.File + file_orderer_etcdraft_configuration_proto_rawDesc = nil + file_orderer_etcdraft_configuration_proto_goTypes = nil + file_orderer_etcdraft_configuration_proto_depIdxs = nil +} diff --git a/vendor/github.com/hyperledger/fabric-protos-go-apiv2/orderer/etcdraft/metadata.pb.go b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/orderer/etcdraft/metadata.pb.go new file mode 100644 index 00000000000..821265cba9c --- /dev/null +++ b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/orderer/etcdraft/metadata.pb.go @@ -0,0 +1,253 @@ +// Copyright the Hyperledger Fabric contributors. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: orderer/etcdraft/metadata.proto + +package etcdraft + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// BlockMetadata stores data used by the Raft OSNs when +// coordinating with each other, to be serialized into +// block meta dta field and used after failres and restarts. +type BlockMetadata struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Maintains a mapping between the cluster's OSNs + // and their Raft IDs. + ConsenterIds []uint64 `protobuf:"varint,1,rep,packed,name=consenter_ids,json=consenterIds,proto3" json:"consenter_ids,omitempty"` + // Carries the Raft ID value that will be assigned + // to the next OSN that will join this cluster. + NextConsenterId uint64 `protobuf:"varint,2,opt,name=next_consenter_id,json=nextConsenterId,proto3" json:"next_consenter_id,omitempty"` + // Index of etcd/raft entry for current block. + RaftIndex uint64 `protobuf:"varint,3,opt,name=raft_index,json=raftIndex,proto3" json:"raft_index,omitempty"` +} + +func (x *BlockMetadata) Reset() { + *x = BlockMetadata{} + if protoimpl.UnsafeEnabled { + mi := &file_orderer_etcdraft_metadata_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BlockMetadata) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BlockMetadata) ProtoMessage() {} + +func (x *BlockMetadata) ProtoReflect() protoreflect.Message { + mi := &file_orderer_etcdraft_metadata_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BlockMetadata.ProtoReflect.Descriptor instead. +func (*BlockMetadata) Descriptor() ([]byte, []int) { + return file_orderer_etcdraft_metadata_proto_rawDescGZIP(), []int{0} +} + +func (x *BlockMetadata) GetConsenterIds() []uint64 { + if x != nil { + return x.ConsenterIds + } + return nil +} + +func (x *BlockMetadata) GetNextConsenterId() uint64 { + if x != nil { + return x.NextConsenterId + } + return 0 +} + +func (x *BlockMetadata) GetRaftIndex() uint64 { + if x != nil { + return x.RaftIndex + } + return 0 +} + +// ClusterMetadata encapsulates metadata that is exchanged among cluster nodes +type ClusterMetadata struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Indicates active nodes in cluster that are reacheable by Raft leader + ActiveNodes []uint64 `protobuf:"varint,1,rep,packed,name=active_nodes,json=activeNodes,proto3" json:"active_nodes,omitempty"` +} + +func (x *ClusterMetadata) Reset() { + *x = ClusterMetadata{} + if protoimpl.UnsafeEnabled { + mi := &file_orderer_etcdraft_metadata_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ClusterMetadata) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ClusterMetadata) ProtoMessage() {} + +func (x *ClusterMetadata) ProtoReflect() protoreflect.Message { + mi := &file_orderer_etcdraft_metadata_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ClusterMetadata.ProtoReflect.Descriptor instead. +func (*ClusterMetadata) Descriptor() ([]byte, []int) { + return file_orderer_etcdraft_metadata_proto_rawDescGZIP(), []int{1} +} + +func (x *ClusterMetadata) GetActiveNodes() []uint64 { + if x != nil { + return x.ActiveNodes + } + return nil +} + +var File_orderer_etcdraft_metadata_proto protoreflect.FileDescriptor + +var file_orderer_etcdraft_metadata_proto_rawDesc = []byte{ + 0x0a, 0x1f, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x72, 0x2f, 0x65, 0x74, 0x63, 0x64, 0x72, 0x61, + 0x66, 0x74, 0x2f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x08, 0x65, 0x74, 0x63, 0x64, 0x72, 0x61, 0x66, 0x74, 0x22, 0x7f, 0x0a, 0x0d, 0x42, + 0x6c, 0x6f, 0x63, 0x6b, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x23, 0x0a, 0x0d, + 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x04, 0x52, 0x0c, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x49, 0x64, + 0x73, 0x12, 0x2a, 0x0a, 0x11, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, + 0x74, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0f, 0x6e, 0x65, + 0x78, 0x74, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1d, 0x0a, + 0x0a, 0x72, 0x61, 0x66, 0x74, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x09, 0x72, 0x61, 0x66, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x22, 0x34, 0x0a, 0x0f, + 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, + 0x21, 0x0a, 0x0c, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x04, 0x52, 0x0b, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x4e, 0x6f, 0x64, + 0x65, 0x73, 0x42, 0xbf, 0x01, 0x0a, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x68, 0x79, 0x70, 0x65, 0x72, + 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2e, 0x66, 0x61, 0x62, 0x72, 0x69, 0x63, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x72, 0x2e, 0x65, 0x74, 0x63, + 0x64, 0x72, 0x61, 0x66, 0x74, 0x42, 0x0d, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x50, + 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2f, 0x66, + 0x61, 0x62, 0x72, 0x69, 0x63, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2d, 0x67, 0x6f, 0x2d, + 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x72, 0x2f, 0x65, 0x74, + 0x63, 0x64, 0x72, 0x61, 0x66, 0x74, 0xa2, 0x02, 0x03, 0x45, 0x58, 0x58, 0xaa, 0x02, 0x08, 0x45, + 0x74, 0x63, 0x64, 0x72, 0x61, 0x66, 0x74, 0xca, 0x02, 0x08, 0x45, 0x74, 0x63, 0x64, 0x72, 0x61, + 0x66, 0x74, 0xe2, 0x02, 0x14, 0x45, 0x74, 0x63, 0x64, 0x72, 0x61, 0x66, 0x74, 0x5c, 0x47, 0x50, + 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x08, 0x45, 0x74, 0x63, 0x64, + 0x72, 0x61, 0x66, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_orderer_etcdraft_metadata_proto_rawDescOnce sync.Once + file_orderer_etcdraft_metadata_proto_rawDescData = file_orderer_etcdraft_metadata_proto_rawDesc +) + +func file_orderer_etcdraft_metadata_proto_rawDescGZIP() []byte { + file_orderer_etcdraft_metadata_proto_rawDescOnce.Do(func() { + file_orderer_etcdraft_metadata_proto_rawDescData = protoimpl.X.CompressGZIP(file_orderer_etcdraft_metadata_proto_rawDescData) + }) + return file_orderer_etcdraft_metadata_proto_rawDescData +} + +var file_orderer_etcdraft_metadata_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_orderer_etcdraft_metadata_proto_goTypes = []interface{}{ + (*BlockMetadata)(nil), // 0: etcdraft.BlockMetadata + (*ClusterMetadata)(nil), // 1: etcdraft.ClusterMetadata +} +var file_orderer_etcdraft_metadata_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_orderer_etcdraft_metadata_proto_init() } +func file_orderer_etcdraft_metadata_proto_init() { + if File_orderer_etcdraft_metadata_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_orderer_etcdraft_metadata_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BlockMetadata); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_orderer_etcdraft_metadata_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ClusterMetadata); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_orderer_etcdraft_metadata_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_orderer_etcdraft_metadata_proto_goTypes, + DependencyIndexes: file_orderer_etcdraft_metadata_proto_depIdxs, + MessageInfos: file_orderer_etcdraft_metadata_proto_msgTypes, + }.Build() + File_orderer_etcdraft_metadata_proto = out.File + file_orderer_etcdraft_metadata_proto_rawDesc = nil + file_orderer_etcdraft_metadata_proto_goTypes = nil + file_orderer_etcdraft_metadata_proto_depIdxs = nil +} diff --git a/vendor/github.com/hyperledger/fabric-protos-go-apiv2/orderer/smartbft/configuration.pb.go b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/orderer/smartbft/configuration.pb.go new file mode 100644 index 00000000000..9660b0b1e14 --- /dev/null +++ b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/orderer/smartbft/configuration.pb.go @@ -0,0 +1,416 @@ +// Copyright the Hyperledger Fabric contributors. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: orderer/smartbft/configuration.proto + +package smartbft + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type Options_Rotation int32 + +const ( + Options_ROTATION_UNSPECIFIED Options_Rotation = 0 + Options_ROTATION_OFF Options_Rotation = 1 + Options_ROTATION_ON Options_Rotation = 2 +) + +// Enum value maps for Options_Rotation. +var ( + Options_Rotation_name = map[int32]string{ + 0: "ROTATION_UNSPECIFIED", + 1: "ROTATION_OFF", + 2: "ROTATION_ON", + } + Options_Rotation_value = map[string]int32{ + "ROTATION_UNSPECIFIED": 0, + "ROTATION_OFF": 1, + "ROTATION_ON": 2, + } +) + +func (x Options_Rotation) Enum() *Options_Rotation { + p := new(Options_Rotation) + *p = x + return p +} + +func (x Options_Rotation) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Options_Rotation) Descriptor() protoreflect.EnumDescriptor { + return file_orderer_smartbft_configuration_proto_enumTypes[0].Descriptor() +} + +func (Options_Rotation) Type() protoreflect.EnumType { + return &file_orderer_smartbft_configuration_proto_enumTypes[0] +} + +func (x Options_Rotation) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Options_Rotation.Descriptor instead. +func (Options_Rotation) EnumDescriptor() ([]byte, []int) { + return file_orderer_smartbft_configuration_proto_rawDescGZIP(), []int{0, 0} +} + +// Options to be specified for all the smartbft nodes. These can be modified on a +// per-channel basis. +type Options struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + RequestBatchMaxCount uint64 `protobuf:"varint,1,opt,name=request_batch_max_count,json=requestBatchMaxCount,proto3" json:"request_batch_max_count,omitempty"` + RequestBatchMaxBytes uint64 `protobuf:"varint,2,opt,name=request_batch_max_bytes,json=requestBatchMaxBytes,proto3" json:"request_batch_max_bytes,omitempty"` + RequestBatchMaxInterval string `protobuf:"bytes,3,opt,name=request_batch_max_interval,json=requestBatchMaxInterval,proto3" json:"request_batch_max_interval,omitempty"` + IncomingMessageBufferSize uint64 `protobuf:"varint,4,opt,name=incoming_message_buffer_size,json=incomingMessageBufferSize,proto3" json:"incoming_message_buffer_size,omitempty"` + RequestPoolSize uint64 `protobuf:"varint,5,opt,name=request_pool_size,json=requestPoolSize,proto3" json:"request_pool_size,omitempty"` + RequestForwardTimeout string `protobuf:"bytes,6,opt,name=request_forward_timeout,json=requestForwardTimeout,proto3" json:"request_forward_timeout,omitempty"` + RequestComplainTimeout string `protobuf:"bytes,7,opt,name=request_complain_timeout,json=requestComplainTimeout,proto3" json:"request_complain_timeout,omitempty"` + RequestAutoRemoveTimeout string `protobuf:"bytes,8,opt,name=request_auto_remove_timeout,json=requestAutoRemoveTimeout,proto3" json:"request_auto_remove_timeout,omitempty"` + RequestMaxBytes uint64 `protobuf:"varint,9,opt,name=request_max_bytes,json=requestMaxBytes,proto3" json:"request_max_bytes,omitempty"` + ViewChangeResendInterval string `protobuf:"bytes,10,opt,name=view_change_resend_interval,json=viewChangeResendInterval,proto3" json:"view_change_resend_interval,omitempty"` + ViewChangeTimeout string `protobuf:"bytes,11,opt,name=view_change_timeout,json=viewChangeTimeout,proto3" json:"view_change_timeout,omitempty"` + LeaderHeartbeatTimeout string `protobuf:"bytes,12,opt,name=leader_heartbeat_timeout,json=leaderHeartbeatTimeout,proto3" json:"leader_heartbeat_timeout,omitempty"` + LeaderHeartbeatCount uint64 `protobuf:"varint,13,opt,name=leader_heartbeat_count,json=leaderHeartbeatCount,proto3" json:"leader_heartbeat_count,omitempty"` + CollectTimeout string `protobuf:"bytes,14,opt,name=collect_timeout,json=collectTimeout,proto3" json:"collect_timeout,omitempty"` + SyncOnStart bool `protobuf:"varint,15,opt,name=sync_on_start,json=syncOnStart,proto3" json:"sync_on_start,omitempty"` + SpeedUpViewChange bool `protobuf:"varint,16,opt,name=speed_up_view_change,json=speedUpViewChange,proto3" json:"speed_up_view_change,omitempty"` + LeaderRotation Options_Rotation `protobuf:"varint,17,opt,name=leader_rotation,json=leaderRotation,proto3,enum=orderer.smartbft.Options_Rotation" json:"leader_rotation,omitempty"` + DecisionsPerLeader uint64 `protobuf:"varint,18,opt,name=decisions_per_leader,json=decisionsPerLeader,proto3" json:"decisions_per_leader,omitempty"` +} + +func (x *Options) Reset() { + *x = Options{} + if protoimpl.UnsafeEnabled { + mi := &file_orderer_smartbft_configuration_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Options) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Options) ProtoMessage() {} + +func (x *Options) ProtoReflect() protoreflect.Message { + mi := &file_orderer_smartbft_configuration_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Options.ProtoReflect.Descriptor instead. +func (*Options) Descriptor() ([]byte, []int) { + return file_orderer_smartbft_configuration_proto_rawDescGZIP(), []int{0} +} + +func (x *Options) GetRequestBatchMaxCount() uint64 { + if x != nil { + return x.RequestBatchMaxCount + } + return 0 +} + +func (x *Options) GetRequestBatchMaxBytes() uint64 { + if x != nil { + return x.RequestBatchMaxBytes + } + return 0 +} + +func (x *Options) GetRequestBatchMaxInterval() string { + if x != nil { + return x.RequestBatchMaxInterval + } + return "" +} + +func (x *Options) GetIncomingMessageBufferSize() uint64 { + if x != nil { + return x.IncomingMessageBufferSize + } + return 0 +} + +func (x *Options) GetRequestPoolSize() uint64 { + if x != nil { + return x.RequestPoolSize + } + return 0 +} + +func (x *Options) GetRequestForwardTimeout() string { + if x != nil { + return x.RequestForwardTimeout + } + return "" +} + +func (x *Options) GetRequestComplainTimeout() string { + if x != nil { + return x.RequestComplainTimeout + } + return "" +} + +func (x *Options) GetRequestAutoRemoveTimeout() string { + if x != nil { + return x.RequestAutoRemoveTimeout + } + return "" +} + +func (x *Options) GetRequestMaxBytes() uint64 { + if x != nil { + return x.RequestMaxBytes + } + return 0 +} + +func (x *Options) GetViewChangeResendInterval() string { + if x != nil { + return x.ViewChangeResendInterval + } + return "" +} + +func (x *Options) GetViewChangeTimeout() string { + if x != nil { + return x.ViewChangeTimeout + } + return "" +} + +func (x *Options) GetLeaderHeartbeatTimeout() string { + if x != nil { + return x.LeaderHeartbeatTimeout + } + return "" +} + +func (x *Options) GetLeaderHeartbeatCount() uint64 { + if x != nil { + return x.LeaderHeartbeatCount + } + return 0 +} + +func (x *Options) GetCollectTimeout() string { + if x != nil { + return x.CollectTimeout + } + return "" +} + +func (x *Options) GetSyncOnStart() bool { + if x != nil { + return x.SyncOnStart + } + return false +} + +func (x *Options) GetSpeedUpViewChange() bool { + if x != nil { + return x.SpeedUpViewChange + } + return false +} + +func (x *Options) GetLeaderRotation() Options_Rotation { + if x != nil { + return x.LeaderRotation + } + return Options_ROTATION_UNSPECIFIED +} + +func (x *Options) GetDecisionsPerLeader() uint64 { + if x != nil { + return x.DecisionsPerLeader + } + return 0 +} + +var File_orderer_smartbft_configuration_proto protoreflect.FileDescriptor + +var file_orderer_smartbft_configuration_proto_rawDesc = []byte{ + 0x0a, 0x24, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x72, 0x2f, 0x73, 0x6d, 0x61, 0x72, 0x74, 0x62, + 0x66, 0x74, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x10, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x72, 0x2e, + 0x73, 0x6d, 0x61, 0x72, 0x74, 0x62, 0x66, 0x74, 0x22, 0xa3, 0x08, 0x0a, 0x07, 0x4f, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x35, 0x0a, 0x17, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, + 0x62, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x6d, 0x61, 0x78, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x14, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x42, 0x61, + 0x74, 0x63, 0x68, 0x4d, 0x61, 0x78, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x35, 0x0a, 0x17, 0x72, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x62, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x6d, 0x61, 0x78, + 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x14, 0x72, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x42, 0x61, 0x74, 0x63, 0x68, 0x4d, 0x61, 0x78, 0x42, 0x79, 0x74, + 0x65, 0x73, 0x12, 0x3b, 0x0a, 0x1a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x62, 0x61, + 0x74, 0x63, 0x68, 0x5f, 0x6d, 0x61, 0x78, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x17, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x42, + 0x61, 0x74, 0x63, 0x68, 0x4d, 0x61, 0x78, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x12, + 0x3f, 0x0a, 0x1c, 0x69, 0x6e, 0x63, 0x6f, 0x6d, 0x69, 0x6e, 0x67, 0x5f, 0x6d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x5f, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x19, 0x69, 0x6e, 0x63, 0x6f, 0x6d, 0x69, 0x6e, 0x67, 0x4d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x42, 0x75, 0x66, 0x66, 0x65, 0x72, 0x53, 0x69, 0x7a, 0x65, + 0x12, 0x2a, 0x0a, 0x11, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x70, 0x6f, 0x6f, 0x6c, + 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0f, 0x72, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x50, 0x6f, 0x6f, 0x6c, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x36, 0x0a, 0x17, + 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x66, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x5f, + 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x15, 0x72, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x54, 0x69, 0x6d, + 0x65, 0x6f, 0x75, 0x74, 0x12, 0x38, 0x0a, 0x18, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, + 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, + 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x16, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x43, + 0x6f, 0x6d, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x3d, + 0x0a, 0x1b, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x61, 0x75, 0x74, 0x6f, 0x5f, 0x72, + 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x08, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x18, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x41, 0x75, 0x74, 0x6f, + 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x2a, 0x0a, + 0x11, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x6d, 0x61, 0x78, 0x5f, 0x62, 0x79, 0x74, + 0x65, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x4d, 0x61, 0x78, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x3d, 0x0a, 0x1b, 0x76, 0x69, 0x65, + 0x77, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x64, 0x5f, + 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x18, + 0x76, 0x69, 0x65, 0x77, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x73, 0x65, 0x6e, 0x64, + 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x12, 0x2e, 0x0a, 0x13, 0x76, 0x69, 0x65, 0x77, + 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, + 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x76, 0x69, 0x65, 0x77, 0x43, 0x68, 0x61, 0x6e, 0x67, + 0x65, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x38, 0x0a, 0x18, 0x6c, 0x65, 0x61, 0x64, + 0x65, 0x72, 0x5f, 0x68, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x5f, 0x74, 0x69, 0x6d, + 0x65, 0x6f, 0x75, 0x74, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x16, 0x6c, 0x65, 0x61, 0x64, + 0x65, 0x72, 0x48, 0x65, 0x61, 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x6f, + 0x75, 0x74, 0x12, 0x34, 0x0a, 0x16, 0x6c, 0x65, 0x61, 0x64, 0x65, 0x72, 0x5f, 0x68, 0x65, 0x61, + 0x72, 0x74, 0x62, 0x65, 0x61, 0x74, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x0d, 0x20, 0x01, + 0x28, 0x04, 0x52, 0x14, 0x6c, 0x65, 0x61, 0x64, 0x65, 0x72, 0x48, 0x65, 0x61, 0x72, 0x74, 0x62, + 0x65, 0x61, 0x74, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x27, 0x0a, 0x0f, 0x63, 0x6f, 0x6c, 0x6c, + 0x65, 0x63, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0e, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, + 0x74, 0x12, 0x22, 0x0a, 0x0d, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x6f, 0x6e, 0x5f, 0x73, 0x74, 0x61, + 0x72, 0x74, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x73, 0x79, 0x6e, 0x63, 0x4f, 0x6e, + 0x53, 0x74, 0x61, 0x72, 0x74, 0x12, 0x2f, 0x0a, 0x14, 0x73, 0x70, 0x65, 0x65, 0x64, 0x5f, 0x75, + 0x70, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x10, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x11, 0x73, 0x70, 0x65, 0x65, 0x64, 0x55, 0x70, 0x56, 0x69, 0x65, 0x77, + 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x4b, 0x0a, 0x0f, 0x6c, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x5f, 0x72, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x11, 0x20, 0x01, 0x28, 0x0e, 0x32, + 0x22, 0x2e, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x72, 0x2e, 0x73, 0x6d, 0x61, 0x72, 0x74, 0x62, + 0x66, 0x74, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x52, 0x6f, 0x74, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x0e, 0x6c, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x6f, 0x74, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x30, 0x0a, 0x14, 0x64, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x73, + 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x6c, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x12, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x12, 0x64, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x50, 0x65, 0x72, 0x4c, + 0x65, 0x61, 0x64, 0x65, 0x72, 0x22, 0x47, 0x0a, 0x08, 0x52, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x18, 0x0a, 0x14, 0x52, 0x4f, 0x54, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, + 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x10, 0x0a, 0x0c, 0x52, + 0x4f, 0x54, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4f, 0x46, 0x46, 0x10, 0x01, 0x12, 0x0f, 0x0a, + 0x0b, 0x52, 0x4f, 0x54, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4f, 0x4e, 0x10, 0x02, 0x42, 0xe5, + 0x01, 0x0a, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x65, 0x64, 0x67, + 0x65, 0x72, 0x2e, 0x66, 0x61, 0x62, 0x72, 0x69, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, + 0x2e, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x72, 0x2e, 0x73, 0x6d, 0x61, 0x72, 0x74, 0x62, 0x66, + 0x74, 0x42, 0x12, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2f, + 0x66, 0x61, 0x62, 0x72, 0x69, 0x63, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2d, 0x67, 0x6f, + 0x2d, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x72, 0x2f, 0x73, + 0x6d, 0x61, 0x72, 0x74, 0x62, 0x66, 0x74, 0xa2, 0x02, 0x03, 0x4f, 0x53, 0x58, 0xaa, 0x02, 0x10, + 0x4f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x72, 0x2e, 0x53, 0x6d, 0x61, 0x72, 0x74, 0x62, 0x66, 0x74, + 0xca, 0x02, 0x10, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x72, 0x5c, 0x53, 0x6d, 0x61, 0x72, 0x74, + 0x62, 0x66, 0x74, 0xe2, 0x02, 0x1c, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x72, 0x5c, 0x53, 0x6d, + 0x61, 0x72, 0x74, 0x62, 0x66, 0x74, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0xea, 0x02, 0x11, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x72, 0x3a, 0x3a, 0x53, 0x6d, + 0x61, 0x72, 0x74, 0x62, 0x66, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_orderer_smartbft_configuration_proto_rawDescOnce sync.Once + file_orderer_smartbft_configuration_proto_rawDescData = file_orderer_smartbft_configuration_proto_rawDesc +) + +func file_orderer_smartbft_configuration_proto_rawDescGZIP() []byte { + file_orderer_smartbft_configuration_proto_rawDescOnce.Do(func() { + file_orderer_smartbft_configuration_proto_rawDescData = protoimpl.X.CompressGZIP(file_orderer_smartbft_configuration_proto_rawDescData) + }) + return file_orderer_smartbft_configuration_proto_rawDescData +} + +var file_orderer_smartbft_configuration_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_orderer_smartbft_configuration_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_orderer_smartbft_configuration_proto_goTypes = []interface{}{ + (Options_Rotation)(0), // 0: orderer.smartbft.Options.Rotation + (*Options)(nil), // 1: orderer.smartbft.Options +} +var file_orderer_smartbft_configuration_proto_depIdxs = []int32{ + 0, // 0: orderer.smartbft.Options.leader_rotation:type_name -> orderer.smartbft.Options.Rotation + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_orderer_smartbft_configuration_proto_init() } +func file_orderer_smartbft_configuration_proto_init() { + if File_orderer_smartbft_configuration_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_orderer_smartbft_configuration_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Options); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_orderer_smartbft_configuration_proto_rawDesc, + NumEnums: 1, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_orderer_smartbft_configuration_proto_goTypes, + DependencyIndexes: file_orderer_smartbft_configuration_proto_depIdxs, + EnumInfos: file_orderer_smartbft_configuration_proto_enumTypes, + MessageInfos: file_orderer_smartbft_configuration_proto_msgTypes, + }.Build() + File_orderer_smartbft_configuration_proto = out.File + file_orderer_smartbft_configuration_proto_rawDesc = nil + file_orderer_smartbft_configuration_proto_goTypes = nil + file_orderer_smartbft_configuration_proto_depIdxs = nil +} diff --git a/vendor/github.com/hyperledger/fabric-protos-go-apiv2/peer/chaincode.pb.go b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/peer/chaincode.pb.go new file mode 100644 index 00000000000..6e0c2724594 --- /dev/null +++ b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/peer/chaincode.pb.go @@ -0,0 +1,887 @@ +// Copyright the Hyperledger Fabric contributors. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: peer/chaincode.proto + +package peer + +import ( + common "github.com/hyperledger/fabric-protos-go-apiv2/common" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type ChaincodeSpec_Type int32 + +const ( + ChaincodeSpec_UNDEFINED ChaincodeSpec_Type = 0 + ChaincodeSpec_GOLANG ChaincodeSpec_Type = 1 + ChaincodeSpec_NODE ChaincodeSpec_Type = 2 + ChaincodeSpec_CAR ChaincodeSpec_Type = 3 + ChaincodeSpec_JAVA ChaincodeSpec_Type = 4 +) + +// Enum value maps for ChaincodeSpec_Type. +var ( + ChaincodeSpec_Type_name = map[int32]string{ + 0: "UNDEFINED", + 1: "GOLANG", + 2: "NODE", + 3: "CAR", + 4: "JAVA", + } + ChaincodeSpec_Type_value = map[string]int32{ + "UNDEFINED": 0, + "GOLANG": 1, + "NODE": 2, + "CAR": 3, + "JAVA": 4, + } +) + +func (x ChaincodeSpec_Type) Enum() *ChaincodeSpec_Type { + p := new(ChaincodeSpec_Type) + *p = x + return p +} + +func (x ChaincodeSpec_Type) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ChaincodeSpec_Type) Descriptor() protoreflect.EnumDescriptor { + return file_peer_chaincode_proto_enumTypes[0].Descriptor() +} + +func (ChaincodeSpec_Type) Type() protoreflect.EnumType { + return &file_peer_chaincode_proto_enumTypes[0] +} + +func (x ChaincodeSpec_Type) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ChaincodeSpec_Type.Descriptor instead. +func (ChaincodeSpec_Type) EnumDescriptor() ([]byte, []int) { + return file_peer_chaincode_proto_rawDescGZIP(), []int{2, 0} +} + +// ChaincodeID contains the path as specified by the deploy transaction +// that created it as well as the hashCode that is generated by the +// system for the path. From the user level (ie, CLI, REST API and so on) +// deploy transaction is expected to provide the path and other requests +// are expected to provide the hashCode. The other value will be ignored. +// Internally, the structure could contain both values. For instance, the +// hashCode will be set when first generated using the path +type ChaincodeID struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // deploy transaction will use the path + Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` + // all other requests will use the name (really a hashcode) generated by + // the deploy transaction + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + // user friendly version name for the chaincode + Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"` +} + +func (x *ChaincodeID) Reset() { + *x = ChaincodeID{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_chaincode_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChaincodeID) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChaincodeID) ProtoMessage() {} + +func (x *ChaincodeID) ProtoReflect() protoreflect.Message { + mi := &file_peer_chaincode_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ChaincodeID.ProtoReflect.Descriptor instead. +func (*ChaincodeID) Descriptor() ([]byte, []int) { + return file_peer_chaincode_proto_rawDescGZIP(), []int{0} +} + +func (x *ChaincodeID) GetPath() string { + if x != nil { + return x.Path + } + return "" +} + +func (x *ChaincodeID) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *ChaincodeID) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +// Carries the chaincode function and its arguments. +// UnmarshalJSON in transaction.go converts the string-based REST/JSON input to +// the []byte-based current ChaincodeInput structure. +type ChaincodeInput struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Args [][]byte `protobuf:"bytes,1,rep,name=args,proto3" json:"args,omitempty"` + Decorations map[string][]byte `protobuf:"bytes,2,rep,name=decorations,proto3" json:"decorations,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // is_init is used for the application to signal that an invocation is to be routed + // to the legacy 'Init' function for compatibility with chaincodes which handled + // Init in the old way. New applications should manage their initialized state + // themselves. + IsInit bool `protobuf:"varint,3,opt,name=is_init,json=isInit,proto3" json:"is_init,omitempty"` +} + +func (x *ChaincodeInput) Reset() { + *x = ChaincodeInput{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_chaincode_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChaincodeInput) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChaincodeInput) ProtoMessage() {} + +func (x *ChaincodeInput) ProtoReflect() protoreflect.Message { + mi := &file_peer_chaincode_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ChaincodeInput.ProtoReflect.Descriptor instead. +func (*ChaincodeInput) Descriptor() ([]byte, []int) { + return file_peer_chaincode_proto_rawDescGZIP(), []int{1} +} + +func (x *ChaincodeInput) GetArgs() [][]byte { + if x != nil { + return x.Args + } + return nil +} + +func (x *ChaincodeInput) GetDecorations() map[string][]byte { + if x != nil { + return x.Decorations + } + return nil +} + +func (x *ChaincodeInput) GetIsInit() bool { + if x != nil { + return x.IsInit + } + return false +} + +// Carries the chaincode specification. This is the actual metadata required for +// defining a chaincode. +type ChaincodeSpec struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type ChaincodeSpec_Type `protobuf:"varint,1,opt,name=type,proto3,enum=protos.ChaincodeSpec_Type" json:"type,omitempty"` + ChaincodeId *ChaincodeID `protobuf:"bytes,2,opt,name=chaincode_id,json=chaincodeId,proto3" json:"chaincode_id,omitempty"` + Input *ChaincodeInput `protobuf:"bytes,3,opt,name=input,proto3" json:"input,omitempty"` + Timeout int32 `protobuf:"varint,4,opt,name=timeout,proto3" json:"timeout,omitempty"` +} + +func (x *ChaincodeSpec) Reset() { + *x = ChaincodeSpec{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_chaincode_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChaincodeSpec) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChaincodeSpec) ProtoMessage() {} + +func (x *ChaincodeSpec) ProtoReflect() protoreflect.Message { + mi := &file_peer_chaincode_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ChaincodeSpec.ProtoReflect.Descriptor instead. +func (*ChaincodeSpec) Descriptor() ([]byte, []int) { + return file_peer_chaincode_proto_rawDescGZIP(), []int{2} +} + +func (x *ChaincodeSpec) GetType() ChaincodeSpec_Type { + if x != nil { + return x.Type + } + return ChaincodeSpec_UNDEFINED +} + +func (x *ChaincodeSpec) GetChaincodeId() *ChaincodeID { + if x != nil { + return x.ChaincodeId + } + return nil +} + +func (x *ChaincodeSpec) GetInput() *ChaincodeInput { + if x != nil { + return x.Input + } + return nil +} + +func (x *ChaincodeSpec) GetTimeout() int32 { + if x != nil { + return x.Timeout + } + return 0 +} + +// Specify the deployment of a chaincode. +// TODO: Define `codePackage`. +type ChaincodeDeploymentSpec struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ChaincodeSpec *ChaincodeSpec `protobuf:"bytes,1,opt,name=chaincode_spec,json=chaincodeSpec,proto3" json:"chaincode_spec,omitempty"` + CodePackage []byte `protobuf:"bytes,3,opt,name=code_package,json=codePackage,proto3" json:"code_package,omitempty"` +} + +func (x *ChaincodeDeploymentSpec) Reset() { + *x = ChaincodeDeploymentSpec{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_chaincode_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChaincodeDeploymentSpec) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChaincodeDeploymentSpec) ProtoMessage() {} + +func (x *ChaincodeDeploymentSpec) ProtoReflect() protoreflect.Message { + mi := &file_peer_chaincode_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ChaincodeDeploymentSpec.ProtoReflect.Descriptor instead. +func (*ChaincodeDeploymentSpec) Descriptor() ([]byte, []int) { + return file_peer_chaincode_proto_rawDescGZIP(), []int{3} +} + +func (x *ChaincodeDeploymentSpec) GetChaincodeSpec() *ChaincodeSpec { + if x != nil { + return x.ChaincodeSpec + } + return nil +} + +func (x *ChaincodeDeploymentSpec) GetCodePackage() []byte { + if x != nil { + return x.CodePackage + } + return nil +} + +// Carries the chaincode function and its arguments. +type ChaincodeInvocationSpec struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ChaincodeSpec *ChaincodeSpec `protobuf:"bytes,1,opt,name=chaincode_spec,json=chaincodeSpec,proto3" json:"chaincode_spec,omitempty"` +} + +func (x *ChaincodeInvocationSpec) Reset() { + *x = ChaincodeInvocationSpec{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_chaincode_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChaincodeInvocationSpec) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChaincodeInvocationSpec) ProtoMessage() {} + +func (x *ChaincodeInvocationSpec) ProtoReflect() protoreflect.Message { + mi := &file_peer_chaincode_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ChaincodeInvocationSpec.ProtoReflect.Descriptor instead. +func (*ChaincodeInvocationSpec) Descriptor() ([]byte, []int) { + return file_peer_chaincode_proto_rawDescGZIP(), []int{4} +} + +func (x *ChaincodeInvocationSpec) GetChaincodeSpec() *ChaincodeSpec { + if x != nil { + return x.ChaincodeSpec + } + return nil +} + +// LifecycleEvent is used as the payload of the chaincode event emitted by LSCC +type LifecycleEvent struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ChaincodeName string `protobuf:"bytes,1,opt,name=chaincode_name,json=chaincodeName,proto3" json:"chaincode_name,omitempty"` +} + +func (x *LifecycleEvent) Reset() { + *x = LifecycleEvent{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_chaincode_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LifecycleEvent) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LifecycleEvent) ProtoMessage() {} + +func (x *LifecycleEvent) ProtoReflect() protoreflect.Message { + mi := &file_peer_chaincode_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LifecycleEvent.ProtoReflect.Descriptor instead. +func (*LifecycleEvent) Descriptor() ([]byte, []int) { + return file_peer_chaincode_proto_rawDescGZIP(), []int{5} +} + +func (x *LifecycleEvent) GetChaincodeName() string { + if x != nil { + return x.ChaincodeName + } + return "" +} + +// CDSData is data stored in the LSCC on instantiation of a CC +// for CDSPackage. This needs to be serialized for ChaincodeData +// hence the protobuf format +type CDSData struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` // hash of ChaincodeDeploymentSpec.code_package + Metadatahash []byte `protobuf:"bytes,2,opt,name=metadatahash,proto3" json:"metadatahash,omitempty"` // hash of ChaincodeID.name + ChaincodeID.version +} + +func (x *CDSData) Reset() { + *x = CDSData{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_chaincode_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CDSData) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CDSData) ProtoMessage() {} + +func (x *CDSData) ProtoReflect() protoreflect.Message { + mi := &file_peer_chaincode_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CDSData.ProtoReflect.Descriptor instead. +func (*CDSData) Descriptor() ([]byte, []int) { + return file_peer_chaincode_proto_rawDescGZIP(), []int{6} +} + +func (x *CDSData) GetHash() []byte { + if x != nil { + return x.Hash + } + return nil +} + +func (x *CDSData) GetMetadatahash() []byte { + if x != nil { + return x.Metadatahash + } + return nil +} + +// ChaincodeData defines the datastructure for chaincodes to be serialized by proto +// Type provides an additional check by directing to use a specific package after instantiation +// Data is Type specific (see CDSPackage and SignedCDSPackage) +type ChaincodeData struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Name of the chaincode + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // Version of the chaincode + Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` + // Escc for the chaincode instance + Escc string `protobuf:"bytes,3,opt,name=escc,proto3" json:"escc,omitempty"` + // Vscc for the chaincode instance + Vscc string `protobuf:"bytes,4,opt,name=vscc,proto3" json:"vscc,omitempty"` + // Policy endorsement policy for the chaincode instance + Policy *common.SignaturePolicyEnvelope `protobuf:"bytes,5,opt,name=policy,proto3" json:"policy,omitempty"` + // Data data specific to the package + Data []byte `protobuf:"bytes,6,opt,name=data,proto3" json:"data,omitempty"` + // Id of the chaincode that's the unique fingerprint for the CC This is not + // currently used anywhere but serves as a good eyecatcher + Id []byte `protobuf:"bytes,7,opt,name=id,proto3" json:"id,omitempty"` + // InstantiationPolicy for the chaincode + InstantiationPolicy *common.SignaturePolicyEnvelope `protobuf:"bytes,8,opt,name=instantiation_policy,json=instantiationPolicy,proto3" json:"instantiation_policy,omitempty"` +} + +func (x *ChaincodeData) Reset() { + *x = ChaincodeData{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_chaincode_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChaincodeData) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChaincodeData) ProtoMessage() {} + +func (x *ChaincodeData) ProtoReflect() protoreflect.Message { + mi := &file_peer_chaincode_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ChaincodeData.ProtoReflect.Descriptor instead. +func (*ChaincodeData) Descriptor() ([]byte, []int) { + return file_peer_chaincode_proto_rawDescGZIP(), []int{7} +} + +func (x *ChaincodeData) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *ChaincodeData) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +func (x *ChaincodeData) GetEscc() string { + if x != nil { + return x.Escc + } + return "" +} + +func (x *ChaincodeData) GetVscc() string { + if x != nil { + return x.Vscc + } + return "" +} + +func (x *ChaincodeData) GetPolicy() *common.SignaturePolicyEnvelope { + if x != nil { + return x.Policy + } + return nil +} + +func (x *ChaincodeData) GetData() []byte { + if x != nil { + return x.Data + } + return nil +} + +func (x *ChaincodeData) GetId() []byte { + if x != nil { + return x.Id + } + return nil +} + +func (x *ChaincodeData) GetInstantiationPolicy() *common.SignaturePolicyEnvelope { + if x != nil { + return x.InstantiationPolicy + } + return nil +} + +var File_peer_chaincode_proto protoreflect.FileDescriptor + +var file_peer_chaincode_proto_rawDesc = []byte{ + 0x0a, 0x14, 0x70, 0x65, 0x65, 0x72, 0x2f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x1a, 0x15, + 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x4f, 0x0a, 0x0b, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, + 0x64, 0x65, 0x49, 0x44, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, + 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, + 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0xc8, 0x01, 0x0a, 0x0e, 0x43, 0x68, 0x61, 0x69, 0x6e, + 0x63, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x72, 0x67, + 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x04, 0x61, 0x72, 0x67, 0x73, 0x12, 0x49, 0x0a, + 0x0b, 0x64, 0x65, 0x63, 0x6f, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x43, 0x68, 0x61, 0x69, + 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x2e, 0x44, 0x65, 0x63, 0x6f, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0b, 0x64, 0x65, 0x63, + 0x6f, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x73, 0x5f, 0x69, + 0x6e, 0x69, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x69, 0x73, 0x49, 0x6e, 0x69, + 0x74, 0x1a, 0x3e, 0x0a, 0x10, 0x44, 0x65, 0x63, 0x6f, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, + 0x01, 0x22, 0xff, 0x01, 0x0a, 0x0d, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x53, + 0x70, 0x65, 0x63, 0x12, 0x2e, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0e, 0x32, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x43, 0x68, 0x61, 0x69, 0x6e, + 0x63, 0x6f, 0x64, 0x65, 0x53, 0x70, 0x65, 0x63, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, + 0x79, 0x70, 0x65, 0x12, 0x36, 0x0a, 0x0c, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, + 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x73, 0x2e, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x49, 0x44, 0x52, 0x0b, + 0x63, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x12, 0x2c, 0x0a, 0x05, 0x69, + 0x6e, 0x70, 0x75, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x73, 0x2e, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x70, + 0x75, 0x74, 0x52, 0x05, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x74, 0x69, 0x6d, + 0x65, 0x6f, 0x75, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x74, 0x69, 0x6d, 0x65, + 0x6f, 0x75, 0x74, 0x22, 0x3e, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0d, 0x0a, 0x09, 0x55, + 0x4e, 0x44, 0x45, 0x46, 0x49, 0x4e, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x47, 0x4f, + 0x4c, 0x41, 0x4e, 0x47, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x4e, 0x4f, 0x44, 0x45, 0x10, 0x02, + 0x12, 0x07, 0x0a, 0x03, 0x43, 0x41, 0x52, 0x10, 0x03, 0x12, 0x08, 0x0a, 0x04, 0x4a, 0x41, 0x56, + 0x41, 0x10, 0x04, 0x22, 0xa0, 0x01, 0x0a, 0x17, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, + 0x65, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x53, 0x70, 0x65, 0x63, 0x12, + 0x3c, 0x0a, 0x0e, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x5f, 0x73, 0x70, 0x65, + 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, + 0x2e, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x53, 0x70, 0x65, 0x63, 0x52, 0x0d, + 0x63, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x53, 0x70, 0x65, 0x63, 0x12, 0x21, 0x0a, + 0x0c, 0x63, 0x6f, 0x64, 0x65, 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x63, 0x6f, 0x64, 0x65, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, + 0x4a, 0x04, 0x08, 0x02, 0x10, 0x03, 0x4a, 0x04, 0x08, 0x04, 0x10, 0x05, 0x52, 0x0e, 0x65, 0x66, + 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x64, 0x61, 0x74, 0x65, 0x52, 0x08, 0x65, 0x78, + 0x65, 0x63, 0x5f, 0x65, 0x6e, 0x76, 0x22, 0x70, 0x0a, 0x17, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x63, + 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x76, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x70, 0x65, + 0x63, 0x12, 0x3c, 0x0a, 0x0e, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x5f, 0x73, + 0x70, 0x65, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x73, 0x2e, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x53, 0x70, 0x65, 0x63, + 0x52, 0x0d, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x53, 0x70, 0x65, 0x63, 0x4a, + 0x04, 0x08, 0x02, 0x10, 0x03, 0x52, 0x11, 0x69, 0x64, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x61, 0x6c, 0x67, 0x22, 0x37, 0x0a, 0x0e, 0x4c, 0x69, 0x66, 0x65, + 0x63, 0x79, 0x63, 0x6c, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x68, + 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0d, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x4e, 0x61, 0x6d, + 0x65, 0x22, 0x41, 0x0a, 0x07, 0x43, 0x44, 0x53, 0x44, 0x61, 0x74, 0x61, 0x12, 0x12, 0x0a, 0x04, + 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x68, 0x61, 0x73, 0x68, + 0x12, 0x22, 0x0a, 0x0c, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x68, 0x61, 0x73, 0x68, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0x68, 0x61, 0x73, 0x68, 0x22, 0x96, 0x02, 0x0a, 0x0d, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, + 0x64, 0x65, 0x44, 0x61, 0x74, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, + 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, + 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x65, 0x73, 0x63, 0x63, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x65, 0x73, 0x63, 0x63, 0x12, 0x12, 0x0a, 0x04, 0x76, 0x73, 0x63, 0x63, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x76, 0x73, 0x63, 0x63, 0x12, 0x37, 0x0a, 0x06, + 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x63, + 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x50, + 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x52, 0x06, 0x70, + 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, + 0x07, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x02, 0x69, 0x64, 0x12, 0x52, 0x0a, 0x14, 0x69, 0x6e, 0x73, + 0x74, 0x61, 0x6e, 0x74, 0x69, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, + 0x79, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, + 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, + 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x52, 0x13, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, + 0x74, 0x69, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x42, 0xa0, 0x01, + 0x0a, 0x22, 0x6f, 0x72, 0x67, 0x2e, 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x65, 0x64, 0x67, 0x65, + 0x72, 0x2e, 0x66, 0x61, 0x62, 0x72, 0x69, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, + 0x70, 0x65, 0x65, 0x72, 0x42, 0x0e, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x50, + 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x32, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2f, 0x66, + 0x61, 0x62, 0x72, 0x69, 0x63, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2d, 0x67, 0x6f, 0x2d, + 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x70, 0x65, 0x65, 0x72, 0xa2, 0x02, 0x03, 0x50, 0x58, 0x58, + 0xaa, 0x02, 0x06, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0xca, 0x02, 0x06, 0x50, 0x72, 0x6f, 0x74, + 0x6f, 0x73, 0xe2, 0x02, 0x12, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x5c, 0x47, 0x50, 0x42, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x06, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x73, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_peer_chaincode_proto_rawDescOnce sync.Once + file_peer_chaincode_proto_rawDescData = file_peer_chaincode_proto_rawDesc +) + +func file_peer_chaincode_proto_rawDescGZIP() []byte { + file_peer_chaincode_proto_rawDescOnce.Do(func() { + file_peer_chaincode_proto_rawDescData = protoimpl.X.CompressGZIP(file_peer_chaincode_proto_rawDescData) + }) + return file_peer_chaincode_proto_rawDescData +} + +var file_peer_chaincode_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_peer_chaincode_proto_msgTypes = make([]protoimpl.MessageInfo, 9) +var file_peer_chaincode_proto_goTypes = []interface{}{ + (ChaincodeSpec_Type)(0), // 0: protos.ChaincodeSpec.Type + (*ChaincodeID)(nil), // 1: protos.ChaincodeID + (*ChaincodeInput)(nil), // 2: protos.ChaincodeInput + (*ChaincodeSpec)(nil), // 3: protos.ChaincodeSpec + (*ChaincodeDeploymentSpec)(nil), // 4: protos.ChaincodeDeploymentSpec + (*ChaincodeInvocationSpec)(nil), // 5: protos.ChaincodeInvocationSpec + (*LifecycleEvent)(nil), // 6: protos.LifecycleEvent + (*CDSData)(nil), // 7: protos.CDSData + (*ChaincodeData)(nil), // 8: protos.ChaincodeData + nil, // 9: protos.ChaincodeInput.DecorationsEntry + (*common.SignaturePolicyEnvelope)(nil), // 10: common.SignaturePolicyEnvelope +} +var file_peer_chaincode_proto_depIdxs = []int32{ + 9, // 0: protos.ChaincodeInput.decorations:type_name -> protos.ChaincodeInput.DecorationsEntry + 0, // 1: protos.ChaincodeSpec.type:type_name -> protos.ChaincodeSpec.Type + 1, // 2: protos.ChaincodeSpec.chaincode_id:type_name -> protos.ChaincodeID + 2, // 3: protos.ChaincodeSpec.input:type_name -> protos.ChaincodeInput + 3, // 4: protos.ChaincodeDeploymentSpec.chaincode_spec:type_name -> protos.ChaincodeSpec + 3, // 5: protos.ChaincodeInvocationSpec.chaincode_spec:type_name -> protos.ChaincodeSpec + 10, // 6: protos.ChaincodeData.policy:type_name -> common.SignaturePolicyEnvelope + 10, // 7: protos.ChaincodeData.instantiation_policy:type_name -> common.SignaturePolicyEnvelope + 8, // [8:8] is the sub-list for method output_type + 8, // [8:8] is the sub-list for method input_type + 8, // [8:8] is the sub-list for extension type_name + 8, // [8:8] is the sub-list for extension extendee + 0, // [0:8] is the sub-list for field type_name +} + +func init() { file_peer_chaincode_proto_init() } +func file_peer_chaincode_proto_init() { + if File_peer_chaincode_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_peer_chaincode_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChaincodeID); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peer_chaincode_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChaincodeInput); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peer_chaincode_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChaincodeSpec); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peer_chaincode_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChaincodeDeploymentSpec); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peer_chaincode_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChaincodeInvocationSpec); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peer_chaincode_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LifecycleEvent); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peer_chaincode_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CDSData); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peer_chaincode_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChaincodeData); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_peer_chaincode_proto_rawDesc, + NumEnums: 1, + NumMessages: 9, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_peer_chaincode_proto_goTypes, + DependencyIndexes: file_peer_chaincode_proto_depIdxs, + EnumInfos: file_peer_chaincode_proto_enumTypes, + MessageInfos: file_peer_chaincode_proto_msgTypes, + }.Build() + File_peer_chaincode_proto = out.File + file_peer_chaincode_proto_rawDesc = nil + file_peer_chaincode_proto_goTypes = nil + file_peer_chaincode_proto_depIdxs = nil +} diff --git a/vendor/github.com/hyperledger/fabric-protos-go-apiv2/peer/chaincode_event.pb.go b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/peer/chaincode_event.pb.go new file mode 100644 index 00000000000..ab856c7a3d1 --- /dev/null +++ b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/peer/chaincode_event.pb.go @@ -0,0 +1,188 @@ +// Copyright the Hyperledger Fabric contributors. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: peer/chaincode_event.proto + +package peer + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// ChaincodeEvent is used for events and registrations that are specific to chaincode +// string type - "chaincode" +type ChaincodeEvent struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ChaincodeId string `protobuf:"bytes,1,opt,name=chaincode_id,json=chaincodeId,proto3" json:"chaincode_id,omitempty"` + TxId string `protobuf:"bytes,2,opt,name=tx_id,json=txId,proto3" json:"tx_id,omitempty"` + EventName string `protobuf:"bytes,3,opt,name=event_name,json=eventName,proto3" json:"event_name,omitempty"` + Payload []byte `protobuf:"bytes,4,opt,name=payload,proto3" json:"payload,omitempty"` +} + +func (x *ChaincodeEvent) Reset() { + *x = ChaincodeEvent{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_chaincode_event_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChaincodeEvent) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChaincodeEvent) ProtoMessage() {} + +func (x *ChaincodeEvent) ProtoReflect() protoreflect.Message { + mi := &file_peer_chaincode_event_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ChaincodeEvent.ProtoReflect.Descriptor instead. +func (*ChaincodeEvent) Descriptor() ([]byte, []int) { + return file_peer_chaincode_event_proto_rawDescGZIP(), []int{0} +} + +func (x *ChaincodeEvent) GetChaincodeId() string { + if x != nil { + return x.ChaincodeId + } + return "" +} + +func (x *ChaincodeEvent) GetTxId() string { + if x != nil { + return x.TxId + } + return "" +} + +func (x *ChaincodeEvent) GetEventName() string { + if x != nil { + return x.EventName + } + return "" +} + +func (x *ChaincodeEvent) GetPayload() []byte { + if x != nil { + return x.Payload + } + return nil +} + +var File_peer_chaincode_event_proto protoreflect.FileDescriptor + +var file_peer_chaincode_event_proto_rawDesc = []byte{ + 0x0a, 0x1a, 0x70, 0x65, 0x65, 0x72, 0x2f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, + 0x5f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x73, 0x22, 0x81, 0x01, 0x0a, 0x0e, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, + 0x64, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x68, 0x61, 0x69, 0x6e, + 0x63, 0x6f, 0x64, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, + 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x12, 0x13, 0x0a, 0x05, 0x74, 0x78, + 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x78, 0x49, 0x64, 0x12, + 0x1d, 0x0a, 0x0a, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x09, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x18, + 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x42, 0xa5, 0x01, 0x0a, 0x22, 0x6f, 0x72, 0x67, + 0x2e, 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2e, 0x66, 0x61, 0x62, + 0x72, 0x69, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x70, 0x65, 0x65, 0x72, 0x42, + 0x13, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x50, + 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x32, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2f, 0x66, + 0x61, 0x62, 0x72, 0x69, 0x63, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2d, 0x67, 0x6f, 0x2d, + 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x70, 0x65, 0x65, 0x72, 0xa2, 0x02, 0x03, 0x50, 0x58, 0x58, + 0xaa, 0x02, 0x06, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0xca, 0x02, 0x06, 0x50, 0x72, 0x6f, 0x74, + 0x6f, 0x73, 0xe2, 0x02, 0x12, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x5c, 0x47, 0x50, 0x42, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x06, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x73, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_peer_chaincode_event_proto_rawDescOnce sync.Once + file_peer_chaincode_event_proto_rawDescData = file_peer_chaincode_event_proto_rawDesc +) + +func file_peer_chaincode_event_proto_rawDescGZIP() []byte { + file_peer_chaincode_event_proto_rawDescOnce.Do(func() { + file_peer_chaincode_event_proto_rawDescData = protoimpl.X.CompressGZIP(file_peer_chaincode_event_proto_rawDescData) + }) + return file_peer_chaincode_event_proto_rawDescData +} + +var file_peer_chaincode_event_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_peer_chaincode_event_proto_goTypes = []interface{}{ + (*ChaincodeEvent)(nil), // 0: protos.ChaincodeEvent +} +var file_peer_chaincode_event_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_peer_chaincode_event_proto_init() } +func file_peer_chaincode_event_proto_init() { + if File_peer_chaincode_event_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_peer_chaincode_event_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChaincodeEvent); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_peer_chaincode_event_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_peer_chaincode_event_proto_goTypes, + DependencyIndexes: file_peer_chaincode_event_proto_depIdxs, + MessageInfos: file_peer_chaincode_event_proto_msgTypes, + }.Build() + File_peer_chaincode_event_proto = out.File + file_peer_chaincode_event_proto_rawDesc = nil + file_peer_chaincode_event_proto_goTypes = nil + file_peer_chaincode_event_proto_depIdxs = nil +} diff --git a/vendor/github.com/hyperledger/fabric-protos-go-apiv2/peer/chaincode_shim.pb.go b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/peer/chaincode_shim.pb.go new file mode 100644 index 00000000000..695668712d9 --- /dev/null +++ b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/peer/chaincode_shim.pb.go @@ -0,0 +1,1684 @@ +// Copyright the Hyperledger Fabric contributors. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: peer/chaincode_shim.proto + +package peer + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type ChaincodeMessage_Type int32 + +const ( + ChaincodeMessage_UNDEFINED ChaincodeMessage_Type = 0 + ChaincodeMessage_REGISTER ChaincodeMessage_Type = 1 + ChaincodeMessage_REGISTERED ChaincodeMessage_Type = 2 + ChaincodeMessage_INIT ChaincodeMessage_Type = 3 + ChaincodeMessage_READY ChaincodeMessage_Type = 4 + ChaincodeMessage_TRANSACTION ChaincodeMessage_Type = 5 + ChaincodeMessage_COMPLETED ChaincodeMessage_Type = 6 + ChaincodeMessage_ERROR ChaincodeMessage_Type = 7 + ChaincodeMessage_GET_STATE ChaincodeMessage_Type = 8 + ChaincodeMessage_PUT_STATE ChaincodeMessage_Type = 9 + ChaincodeMessage_DEL_STATE ChaincodeMessage_Type = 10 + ChaincodeMessage_INVOKE_CHAINCODE ChaincodeMessage_Type = 11 + ChaincodeMessage_RESPONSE ChaincodeMessage_Type = 13 + ChaincodeMessage_GET_STATE_BY_RANGE ChaincodeMessage_Type = 14 + ChaincodeMessage_GET_QUERY_RESULT ChaincodeMessage_Type = 15 + ChaincodeMessage_QUERY_STATE_NEXT ChaincodeMessage_Type = 16 + ChaincodeMessage_QUERY_STATE_CLOSE ChaincodeMessage_Type = 17 + ChaincodeMessage_KEEPALIVE ChaincodeMessage_Type = 18 + ChaincodeMessage_GET_HISTORY_FOR_KEY ChaincodeMessage_Type = 19 + ChaincodeMessage_GET_STATE_METADATA ChaincodeMessage_Type = 20 + ChaincodeMessage_PUT_STATE_METADATA ChaincodeMessage_Type = 21 + ChaincodeMessage_GET_PRIVATE_DATA_HASH ChaincodeMessage_Type = 22 + ChaincodeMessage_PURGE_PRIVATE_DATA ChaincodeMessage_Type = 23 +) + +// Enum value maps for ChaincodeMessage_Type. +var ( + ChaincodeMessage_Type_name = map[int32]string{ + 0: "UNDEFINED", + 1: "REGISTER", + 2: "REGISTERED", + 3: "INIT", + 4: "READY", + 5: "TRANSACTION", + 6: "COMPLETED", + 7: "ERROR", + 8: "GET_STATE", + 9: "PUT_STATE", + 10: "DEL_STATE", + 11: "INVOKE_CHAINCODE", + 13: "RESPONSE", + 14: "GET_STATE_BY_RANGE", + 15: "GET_QUERY_RESULT", + 16: "QUERY_STATE_NEXT", + 17: "QUERY_STATE_CLOSE", + 18: "KEEPALIVE", + 19: "GET_HISTORY_FOR_KEY", + 20: "GET_STATE_METADATA", + 21: "PUT_STATE_METADATA", + 22: "GET_PRIVATE_DATA_HASH", + 23: "PURGE_PRIVATE_DATA", + } + ChaincodeMessage_Type_value = map[string]int32{ + "UNDEFINED": 0, + "REGISTER": 1, + "REGISTERED": 2, + "INIT": 3, + "READY": 4, + "TRANSACTION": 5, + "COMPLETED": 6, + "ERROR": 7, + "GET_STATE": 8, + "PUT_STATE": 9, + "DEL_STATE": 10, + "INVOKE_CHAINCODE": 11, + "RESPONSE": 13, + "GET_STATE_BY_RANGE": 14, + "GET_QUERY_RESULT": 15, + "QUERY_STATE_NEXT": 16, + "QUERY_STATE_CLOSE": 17, + "KEEPALIVE": 18, + "GET_HISTORY_FOR_KEY": 19, + "GET_STATE_METADATA": 20, + "PUT_STATE_METADATA": 21, + "GET_PRIVATE_DATA_HASH": 22, + "PURGE_PRIVATE_DATA": 23, + } +) + +func (x ChaincodeMessage_Type) Enum() *ChaincodeMessage_Type { + p := new(ChaincodeMessage_Type) + *p = x + return p +} + +func (x ChaincodeMessage_Type) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ChaincodeMessage_Type) Descriptor() protoreflect.EnumDescriptor { + return file_peer_chaincode_shim_proto_enumTypes[0].Descriptor() +} + +func (ChaincodeMessage_Type) Type() protoreflect.EnumType { + return &file_peer_chaincode_shim_proto_enumTypes[0] +} + +func (x ChaincodeMessage_Type) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ChaincodeMessage_Type.Descriptor instead. +func (ChaincodeMessage_Type) EnumDescriptor() ([]byte, []int) { + return file_peer_chaincode_shim_proto_rawDescGZIP(), []int{0, 0} +} + +type ChaincodeMessage struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type ChaincodeMessage_Type `protobuf:"varint,1,opt,name=type,proto3,enum=protos.ChaincodeMessage_Type" json:"type,omitempty"` + Timestamp *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + Payload []byte `protobuf:"bytes,3,opt,name=payload,proto3" json:"payload,omitempty"` + Txid string `protobuf:"bytes,4,opt,name=txid,proto3" json:"txid,omitempty"` + Proposal *SignedProposal `protobuf:"bytes,5,opt,name=proposal,proto3" json:"proposal,omitempty"` + // event emitted by chaincode. Used only with Init or Invoke. + // This event is then stored (currently) + // with Block.NonHashData.TransactionResult + ChaincodeEvent *ChaincodeEvent `protobuf:"bytes,6,opt,name=chaincode_event,json=chaincodeEvent,proto3" json:"chaincode_event,omitempty"` + // channel id + ChannelId string `protobuf:"bytes,7,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` +} + +func (x *ChaincodeMessage) Reset() { + *x = ChaincodeMessage{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_chaincode_shim_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChaincodeMessage) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChaincodeMessage) ProtoMessage() {} + +func (x *ChaincodeMessage) ProtoReflect() protoreflect.Message { + mi := &file_peer_chaincode_shim_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ChaincodeMessage.ProtoReflect.Descriptor instead. +func (*ChaincodeMessage) Descriptor() ([]byte, []int) { + return file_peer_chaincode_shim_proto_rawDescGZIP(), []int{0} +} + +func (x *ChaincodeMessage) GetType() ChaincodeMessage_Type { + if x != nil { + return x.Type + } + return ChaincodeMessage_UNDEFINED +} + +func (x *ChaincodeMessage) GetTimestamp() *timestamppb.Timestamp { + if x != nil { + return x.Timestamp + } + return nil +} + +func (x *ChaincodeMessage) GetPayload() []byte { + if x != nil { + return x.Payload + } + return nil +} + +func (x *ChaincodeMessage) GetTxid() string { + if x != nil { + return x.Txid + } + return "" +} + +func (x *ChaincodeMessage) GetProposal() *SignedProposal { + if x != nil { + return x.Proposal + } + return nil +} + +func (x *ChaincodeMessage) GetChaincodeEvent() *ChaincodeEvent { + if x != nil { + return x.ChaincodeEvent + } + return nil +} + +func (x *ChaincodeMessage) GetChannelId() string { + if x != nil { + return x.ChannelId + } + return "" +} + +// GetState is the payload of a ChaincodeMessage. It contains a key which +// is to be fetched from the ledger. If the collection is specified, the key +// would be fetched from the collection (i.e., private state) +type GetState struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Collection string `protobuf:"bytes,2,opt,name=collection,proto3" json:"collection,omitempty"` +} + +func (x *GetState) Reset() { + *x = GetState{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_chaincode_shim_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetState) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetState) ProtoMessage() {} + +func (x *GetState) ProtoReflect() protoreflect.Message { + mi := &file_peer_chaincode_shim_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetState.ProtoReflect.Descriptor instead. +func (*GetState) Descriptor() ([]byte, []int) { + return file_peer_chaincode_shim_proto_rawDescGZIP(), []int{1} +} + +func (x *GetState) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *GetState) GetCollection() string { + if x != nil { + return x.Collection + } + return "" +} + +type GetStateMetadata struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Collection string `protobuf:"bytes,2,opt,name=collection,proto3" json:"collection,omitempty"` +} + +func (x *GetStateMetadata) Reset() { + *x = GetStateMetadata{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_chaincode_shim_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetStateMetadata) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetStateMetadata) ProtoMessage() {} + +func (x *GetStateMetadata) ProtoReflect() protoreflect.Message { + mi := &file_peer_chaincode_shim_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetStateMetadata.ProtoReflect.Descriptor instead. +func (*GetStateMetadata) Descriptor() ([]byte, []int) { + return file_peer_chaincode_shim_proto_rawDescGZIP(), []int{2} +} + +func (x *GetStateMetadata) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *GetStateMetadata) GetCollection() string { + if x != nil { + return x.Collection + } + return "" +} + +// PutState is the payload of a ChaincodeMessage. It contains a key and value +// which needs to be written to the transaction's write set. If the collection is +// specified, the key and value would be written to the transaction's private +// write set. +type PutState struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` + Collection string `protobuf:"bytes,3,opt,name=collection,proto3" json:"collection,omitempty"` +} + +func (x *PutState) Reset() { + *x = PutState{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_chaincode_shim_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PutState) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PutState) ProtoMessage() {} + +func (x *PutState) ProtoReflect() protoreflect.Message { + mi := &file_peer_chaincode_shim_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PutState.ProtoReflect.Descriptor instead. +func (*PutState) Descriptor() ([]byte, []int) { + return file_peer_chaincode_shim_proto_rawDescGZIP(), []int{3} +} + +func (x *PutState) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *PutState) GetValue() []byte { + if x != nil { + return x.Value + } + return nil +} + +func (x *PutState) GetCollection() string { + if x != nil { + return x.Collection + } + return "" +} + +type PutStateMetadata struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Collection string `protobuf:"bytes,3,opt,name=collection,proto3" json:"collection,omitempty"` + Metadata *StateMetadata `protobuf:"bytes,4,opt,name=metadata,proto3" json:"metadata,omitempty"` +} + +func (x *PutStateMetadata) Reset() { + *x = PutStateMetadata{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_chaincode_shim_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PutStateMetadata) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PutStateMetadata) ProtoMessage() {} + +func (x *PutStateMetadata) ProtoReflect() protoreflect.Message { + mi := &file_peer_chaincode_shim_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PutStateMetadata.ProtoReflect.Descriptor instead. +func (*PutStateMetadata) Descriptor() ([]byte, []int) { + return file_peer_chaincode_shim_proto_rawDescGZIP(), []int{4} +} + +func (x *PutStateMetadata) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *PutStateMetadata) GetCollection() string { + if x != nil { + return x.Collection + } + return "" +} + +func (x *PutStateMetadata) GetMetadata() *StateMetadata { + if x != nil { + return x.Metadata + } + return nil +} + +// DelState is the payload of a ChaincodeMessage. It contains a key which +// needs to be recorded in the transaction's write set as a delete operation. +// If the collection is specified, the key needs to be recorded in the +// transaction's private write set as a delete operation. +type DelState struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Collection string `protobuf:"bytes,2,opt,name=collection,proto3" json:"collection,omitempty"` +} + +func (x *DelState) Reset() { + *x = DelState{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_chaincode_shim_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DelState) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DelState) ProtoMessage() {} + +func (x *DelState) ProtoReflect() protoreflect.Message { + mi := &file_peer_chaincode_shim_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DelState.ProtoReflect.Descriptor instead. +func (*DelState) Descriptor() ([]byte, []int) { + return file_peer_chaincode_shim_proto_rawDescGZIP(), []int{5} +} + +func (x *DelState) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *DelState) GetCollection() string { + if x != nil { + return x.Collection + } + return "" +} + +type PurgePrivateState struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Collection string `protobuf:"bytes,2,opt,name=collection,proto3" json:"collection,omitempty"` +} + +func (x *PurgePrivateState) Reset() { + *x = PurgePrivateState{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_chaincode_shim_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PurgePrivateState) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PurgePrivateState) ProtoMessage() {} + +func (x *PurgePrivateState) ProtoReflect() protoreflect.Message { + mi := &file_peer_chaincode_shim_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PurgePrivateState.ProtoReflect.Descriptor instead. +func (*PurgePrivateState) Descriptor() ([]byte, []int) { + return file_peer_chaincode_shim_proto_rawDescGZIP(), []int{6} +} + +func (x *PurgePrivateState) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *PurgePrivateState) GetCollection() string { + if x != nil { + return x.Collection + } + return "" +} + +// GetStateByRange is the payload of a ChaincodeMessage. It contains a start key and +// a end key required to execute range query. If the collection is specified, +// the range query needs to be executed on the private data. The metadata hold +// the byte representation of QueryMetadata. +type GetStateByRange struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + StartKey string `protobuf:"bytes,1,opt,name=startKey,proto3" json:"startKey,omitempty"` + EndKey string `protobuf:"bytes,2,opt,name=endKey,proto3" json:"endKey,omitempty"` + Collection string `protobuf:"bytes,3,opt,name=collection,proto3" json:"collection,omitempty"` + Metadata []byte `protobuf:"bytes,4,opt,name=metadata,proto3" json:"metadata,omitempty"` +} + +func (x *GetStateByRange) Reset() { + *x = GetStateByRange{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_chaincode_shim_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetStateByRange) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetStateByRange) ProtoMessage() {} + +func (x *GetStateByRange) ProtoReflect() protoreflect.Message { + mi := &file_peer_chaincode_shim_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetStateByRange.ProtoReflect.Descriptor instead. +func (*GetStateByRange) Descriptor() ([]byte, []int) { + return file_peer_chaincode_shim_proto_rawDescGZIP(), []int{7} +} + +func (x *GetStateByRange) GetStartKey() string { + if x != nil { + return x.StartKey + } + return "" +} + +func (x *GetStateByRange) GetEndKey() string { + if x != nil { + return x.EndKey + } + return "" +} + +func (x *GetStateByRange) GetCollection() string { + if x != nil { + return x.Collection + } + return "" +} + +func (x *GetStateByRange) GetMetadata() []byte { + if x != nil { + return x.Metadata + } + return nil +} + +// GetQueryResult is the payload of a ChaincodeMessage. It contains a query +// string in the form that is supported by the underlying state database. +// If the collection is specified, the query needs to be executed on the +// private data. The metadata hold the byte representation of QueryMetadata. +type GetQueryResult struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Query string `protobuf:"bytes,1,opt,name=query,proto3" json:"query,omitempty"` + Collection string `protobuf:"bytes,2,opt,name=collection,proto3" json:"collection,omitempty"` + Metadata []byte `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"` +} + +func (x *GetQueryResult) Reset() { + *x = GetQueryResult{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_chaincode_shim_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetQueryResult) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetQueryResult) ProtoMessage() {} + +func (x *GetQueryResult) ProtoReflect() protoreflect.Message { + mi := &file_peer_chaincode_shim_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetQueryResult.ProtoReflect.Descriptor instead. +func (*GetQueryResult) Descriptor() ([]byte, []int) { + return file_peer_chaincode_shim_proto_rawDescGZIP(), []int{8} +} + +func (x *GetQueryResult) GetQuery() string { + if x != nil { + return x.Query + } + return "" +} + +func (x *GetQueryResult) GetCollection() string { + if x != nil { + return x.Collection + } + return "" +} + +func (x *GetQueryResult) GetMetadata() []byte { + if x != nil { + return x.Metadata + } + return nil +} + +// QueryMetadata is the metadata of a GetStateByRange and GetQueryResult. +// It contains a pageSize which denotes the number of records to be fetched +// and a bookmark. +type QueryMetadata struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PageSize int32 `protobuf:"varint,1,opt,name=pageSize,proto3" json:"pageSize,omitempty"` + Bookmark string `protobuf:"bytes,2,opt,name=bookmark,proto3" json:"bookmark,omitempty"` +} + +func (x *QueryMetadata) Reset() { + *x = QueryMetadata{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_chaincode_shim_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryMetadata) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryMetadata) ProtoMessage() {} + +func (x *QueryMetadata) ProtoReflect() protoreflect.Message { + mi := &file_peer_chaincode_shim_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use QueryMetadata.ProtoReflect.Descriptor instead. +func (*QueryMetadata) Descriptor() ([]byte, []int) { + return file_peer_chaincode_shim_proto_rawDescGZIP(), []int{9} +} + +func (x *QueryMetadata) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +func (x *QueryMetadata) GetBookmark() string { + if x != nil { + return x.Bookmark + } + return "" +} + +// GetHistoryForKey is the payload of a ChaincodeMessage. It contains a key +// for which the historical values need to be retrieved. +type GetHistoryForKey struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` +} + +func (x *GetHistoryForKey) Reset() { + *x = GetHistoryForKey{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_chaincode_shim_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetHistoryForKey) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetHistoryForKey) ProtoMessage() {} + +func (x *GetHistoryForKey) ProtoReflect() protoreflect.Message { + mi := &file_peer_chaincode_shim_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetHistoryForKey.ProtoReflect.Descriptor instead. +func (*GetHistoryForKey) Descriptor() ([]byte, []int) { + return file_peer_chaincode_shim_proto_rawDescGZIP(), []int{10} +} + +func (x *GetHistoryForKey) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +type QueryStateNext struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (x *QueryStateNext) Reset() { + *x = QueryStateNext{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_chaincode_shim_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryStateNext) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryStateNext) ProtoMessage() {} + +func (x *QueryStateNext) ProtoReflect() protoreflect.Message { + mi := &file_peer_chaincode_shim_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use QueryStateNext.ProtoReflect.Descriptor instead. +func (*QueryStateNext) Descriptor() ([]byte, []int) { + return file_peer_chaincode_shim_proto_rawDescGZIP(), []int{11} +} + +func (x *QueryStateNext) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +type QueryStateClose struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (x *QueryStateClose) Reset() { + *x = QueryStateClose{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_chaincode_shim_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryStateClose) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryStateClose) ProtoMessage() {} + +func (x *QueryStateClose) ProtoReflect() protoreflect.Message { + mi := &file_peer_chaincode_shim_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use QueryStateClose.ProtoReflect.Descriptor instead. +func (*QueryStateClose) Descriptor() ([]byte, []int) { + return file_peer_chaincode_shim_proto_rawDescGZIP(), []int{12} +} + +func (x *QueryStateClose) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +// QueryResultBytes hold the byte representation of a record returned by the peer. +type QueryResultBytes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ResultBytes []byte `protobuf:"bytes,1,opt,name=resultBytes,proto3" json:"resultBytes,omitempty"` +} + +func (x *QueryResultBytes) Reset() { + *x = QueryResultBytes{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_chaincode_shim_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryResultBytes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryResultBytes) ProtoMessage() {} + +func (x *QueryResultBytes) ProtoReflect() protoreflect.Message { + mi := &file_peer_chaincode_shim_proto_msgTypes[13] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use QueryResultBytes.ProtoReflect.Descriptor instead. +func (*QueryResultBytes) Descriptor() ([]byte, []int) { + return file_peer_chaincode_shim_proto_rawDescGZIP(), []int{13} +} + +func (x *QueryResultBytes) GetResultBytes() []byte { + if x != nil { + return x.ResultBytes + } + return nil +} + +// QueryResponse is returned by the peer as a result of a GetStateByRange, +// GetQueryResult, and GetHistoryForKey. It holds a bunch of records in +// results field, a flag to denote whether more results need to be fetched from +// the peer in has_more field, transaction id in id field, and a QueryResponseMetadata +// in metadata field. +type QueryResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Results []*QueryResultBytes `protobuf:"bytes,1,rep,name=results,proto3" json:"results,omitempty"` + HasMore bool `protobuf:"varint,2,opt,name=has_more,json=hasMore,proto3" json:"has_more,omitempty"` + Id string `protobuf:"bytes,3,opt,name=id,proto3" json:"id,omitempty"` + Metadata []byte `protobuf:"bytes,4,opt,name=metadata,proto3" json:"metadata,omitempty"` +} + +func (x *QueryResponse) Reset() { + *x = QueryResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_chaincode_shim_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryResponse) ProtoMessage() {} + +func (x *QueryResponse) ProtoReflect() protoreflect.Message { + mi := &file_peer_chaincode_shim_proto_msgTypes[14] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use QueryResponse.ProtoReflect.Descriptor instead. +func (*QueryResponse) Descriptor() ([]byte, []int) { + return file_peer_chaincode_shim_proto_rawDescGZIP(), []int{14} +} + +func (x *QueryResponse) GetResults() []*QueryResultBytes { + if x != nil { + return x.Results + } + return nil +} + +func (x *QueryResponse) GetHasMore() bool { + if x != nil { + return x.HasMore + } + return false +} + +func (x *QueryResponse) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *QueryResponse) GetMetadata() []byte { + if x != nil { + return x.Metadata + } + return nil +} + +// QueryResponseMetadata is the metadata of a QueryResponse. It contains a count +// which denotes the number of records fetched from the ledger and a bookmark. +type QueryResponseMetadata struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + FetchedRecordsCount int32 `protobuf:"varint,1,opt,name=fetched_records_count,json=fetchedRecordsCount,proto3" json:"fetched_records_count,omitempty"` + Bookmark string `protobuf:"bytes,2,opt,name=bookmark,proto3" json:"bookmark,omitempty"` +} + +func (x *QueryResponseMetadata) Reset() { + *x = QueryResponseMetadata{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_chaincode_shim_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryResponseMetadata) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryResponseMetadata) ProtoMessage() {} + +func (x *QueryResponseMetadata) ProtoReflect() protoreflect.Message { + mi := &file_peer_chaincode_shim_proto_msgTypes[15] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use QueryResponseMetadata.ProtoReflect.Descriptor instead. +func (*QueryResponseMetadata) Descriptor() ([]byte, []int) { + return file_peer_chaincode_shim_proto_rawDescGZIP(), []int{15} +} + +func (x *QueryResponseMetadata) GetFetchedRecordsCount() int32 { + if x != nil { + return x.FetchedRecordsCount + } + return 0 +} + +func (x *QueryResponseMetadata) GetBookmark() string { + if x != nil { + return x.Bookmark + } + return "" +} + +type StateMetadata struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Metakey string `protobuf:"bytes,1,opt,name=metakey,proto3" json:"metakey,omitempty"` + Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *StateMetadata) Reset() { + *x = StateMetadata{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_chaincode_shim_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StateMetadata) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StateMetadata) ProtoMessage() {} + +func (x *StateMetadata) ProtoReflect() protoreflect.Message { + mi := &file_peer_chaincode_shim_proto_msgTypes[16] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StateMetadata.ProtoReflect.Descriptor instead. +func (*StateMetadata) Descriptor() ([]byte, []int) { + return file_peer_chaincode_shim_proto_rawDescGZIP(), []int{16} +} + +func (x *StateMetadata) GetMetakey() string { + if x != nil { + return x.Metakey + } + return "" +} + +func (x *StateMetadata) GetValue() []byte { + if x != nil { + return x.Value + } + return nil +} + +type StateMetadataResult struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Entries []*StateMetadata `protobuf:"bytes,1,rep,name=entries,proto3" json:"entries,omitempty"` +} + +func (x *StateMetadataResult) Reset() { + *x = StateMetadataResult{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_chaincode_shim_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StateMetadataResult) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StateMetadataResult) ProtoMessage() {} + +func (x *StateMetadataResult) ProtoReflect() protoreflect.Message { + mi := &file_peer_chaincode_shim_proto_msgTypes[17] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StateMetadataResult.ProtoReflect.Descriptor instead. +func (*StateMetadataResult) Descriptor() ([]byte, []int) { + return file_peer_chaincode_shim_proto_rawDescGZIP(), []int{17} +} + +func (x *StateMetadataResult) GetEntries() []*StateMetadata { + if x != nil { + return x.Entries + } + return nil +} + +var File_peer_chaincode_shim_proto protoreflect.FileDescriptor + +var file_peer_chaincode_shim_proto_rawDesc = []byte{ + 0x0a, 0x19, 0x70, 0x65, 0x65, 0x72, 0x2f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, + 0x5f, 0x73, 0x68, 0x69, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x73, 0x1a, 0x1a, 0x70, 0x65, 0x65, 0x72, 0x2f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x63, + 0x6f, 0x64, 0x65, 0x5f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x13, 0x70, 0x65, 0x65, 0x72, 0x2f, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xee, 0x05, 0x0a, 0x10, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x63, + 0x6f, 0x64, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x31, 0x0a, 0x04, 0x74, 0x79, + 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x73, 0x2e, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x38, 0x0a, + 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x74, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, + 0x61, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, + 0x64, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x78, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x74, 0x78, 0x69, 0x64, 0x12, 0x32, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, + 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, + 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x52, + 0x08, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x12, 0x3f, 0x0a, 0x0f, 0x63, 0x68, 0x61, + 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x5f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x43, 0x68, 0x61, 0x69, + 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x0e, 0x63, 0x68, 0x61, 0x69, + 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x68, + 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, + 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x49, 0x64, 0x22, 0xaa, 0x03, 0x0a, 0x04, 0x54, 0x79, + 0x70, 0x65, 0x12, 0x0d, 0x0a, 0x09, 0x55, 0x4e, 0x44, 0x45, 0x46, 0x49, 0x4e, 0x45, 0x44, 0x10, + 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x52, 0x45, 0x47, 0x49, 0x53, 0x54, 0x45, 0x52, 0x10, 0x01, 0x12, + 0x0e, 0x0a, 0x0a, 0x52, 0x45, 0x47, 0x49, 0x53, 0x54, 0x45, 0x52, 0x45, 0x44, 0x10, 0x02, 0x12, + 0x08, 0x0a, 0x04, 0x49, 0x4e, 0x49, 0x54, 0x10, 0x03, 0x12, 0x09, 0x0a, 0x05, 0x52, 0x45, 0x41, + 0x44, 0x59, 0x10, 0x04, 0x12, 0x0f, 0x0a, 0x0b, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x41, 0x43, 0x54, + 0x49, 0x4f, 0x4e, 0x10, 0x05, 0x12, 0x0d, 0x0a, 0x09, 0x43, 0x4f, 0x4d, 0x50, 0x4c, 0x45, 0x54, + 0x45, 0x44, 0x10, 0x06, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x07, 0x12, + 0x0d, 0x0a, 0x09, 0x47, 0x45, 0x54, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x45, 0x10, 0x08, 0x12, 0x0d, + 0x0a, 0x09, 0x50, 0x55, 0x54, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x45, 0x10, 0x09, 0x12, 0x0d, 0x0a, + 0x09, 0x44, 0x45, 0x4c, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x45, 0x10, 0x0a, 0x12, 0x14, 0x0a, 0x10, + 0x49, 0x4e, 0x56, 0x4f, 0x4b, 0x45, 0x5f, 0x43, 0x48, 0x41, 0x49, 0x4e, 0x43, 0x4f, 0x44, 0x45, + 0x10, 0x0b, 0x12, 0x0c, 0x0a, 0x08, 0x52, 0x45, 0x53, 0x50, 0x4f, 0x4e, 0x53, 0x45, 0x10, 0x0d, + 0x12, 0x16, 0x0a, 0x12, 0x47, 0x45, 0x54, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x42, 0x59, + 0x5f, 0x52, 0x41, 0x4e, 0x47, 0x45, 0x10, 0x0e, 0x12, 0x14, 0x0a, 0x10, 0x47, 0x45, 0x54, 0x5f, + 0x51, 0x55, 0x45, 0x52, 0x59, 0x5f, 0x52, 0x45, 0x53, 0x55, 0x4c, 0x54, 0x10, 0x0f, 0x12, 0x14, + 0x0a, 0x10, 0x51, 0x55, 0x45, 0x52, 0x59, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x4e, 0x45, + 0x58, 0x54, 0x10, 0x10, 0x12, 0x15, 0x0a, 0x11, 0x51, 0x55, 0x45, 0x52, 0x59, 0x5f, 0x53, 0x54, + 0x41, 0x54, 0x45, 0x5f, 0x43, 0x4c, 0x4f, 0x53, 0x45, 0x10, 0x11, 0x12, 0x0d, 0x0a, 0x09, 0x4b, + 0x45, 0x45, 0x50, 0x41, 0x4c, 0x49, 0x56, 0x45, 0x10, 0x12, 0x12, 0x17, 0x0a, 0x13, 0x47, 0x45, + 0x54, 0x5f, 0x48, 0x49, 0x53, 0x54, 0x4f, 0x52, 0x59, 0x5f, 0x46, 0x4f, 0x52, 0x5f, 0x4b, 0x45, + 0x59, 0x10, 0x13, 0x12, 0x16, 0x0a, 0x12, 0x47, 0x45, 0x54, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x45, + 0x5f, 0x4d, 0x45, 0x54, 0x41, 0x44, 0x41, 0x54, 0x41, 0x10, 0x14, 0x12, 0x16, 0x0a, 0x12, 0x50, + 0x55, 0x54, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x4d, 0x45, 0x54, 0x41, 0x44, 0x41, 0x54, + 0x41, 0x10, 0x15, 0x12, 0x19, 0x0a, 0x15, 0x47, 0x45, 0x54, 0x5f, 0x50, 0x52, 0x49, 0x56, 0x41, + 0x54, 0x45, 0x5f, 0x44, 0x41, 0x54, 0x41, 0x5f, 0x48, 0x41, 0x53, 0x48, 0x10, 0x16, 0x12, 0x16, + 0x0a, 0x12, 0x50, 0x55, 0x52, 0x47, 0x45, 0x5f, 0x50, 0x52, 0x49, 0x56, 0x41, 0x54, 0x45, 0x5f, + 0x44, 0x41, 0x54, 0x41, 0x10, 0x17, 0x22, 0x3c, 0x0a, 0x08, 0x47, 0x65, 0x74, 0x53, 0x74, 0x61, + 0x74, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x03, 0x6b, 0x65, 0x79, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x44, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, + 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, + 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, + 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x52, 0x0a, 0x08, 0x50, 0x75, + 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1e, + 0x0a, 0x0a, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x77, + 0x0a, 0x10, 0x50, 0x75, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x03, 0x6b, 0x65, 0x79, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x31, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, + 0x53, 0x74, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x08, 0x6d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x22, 0x3c, 0x0a, 0x08, 0x44, 0x65, 0x6c, 0x53, 0x74, + 0x61, 0x74, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6c, 0x6c, 0x65, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x45, 0x0a, 0x11, 0x50, 0x75, 0x72, 0x67, 0x65, 0x50, 0x72, + 0x69, 0x76, 0x61, 0x74, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, + 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x1e, 0x0a, 0x0a, + 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0a, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x81, 0x01, 0x0a, + 0x0f, 0x47, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x42, 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, + 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x74, 0x61, 0x72, 0x74, 0x4b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x08, 0x73, 0x74, 0x61, 0x72, 0x74, 0x4b, 0x65, 0x79, 0x12, 0x16, 0x0a, 0x06, + 0x65, 0x6e, 0x64, 0x4b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x65, 0x6e, + 0x64, 0x4b, 0x65, 0x79, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0x22, 0x62, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x75, + 0x6c, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6c, 0x6c, + 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, + 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0x22, 0x47, 0x0a, 0x0d, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, + 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x6f, 0x6f, 0x6b, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x62, 0x6f, 0x6f, 0x6b, 0x6d, 0x61, 0x72, 0x6b, 0x22, 0x24, 0x0a, + 0x10, 0x47, 0x65, 0x74, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x46, 0x6f, 0x72, 0x4b, 0x65, + 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, + 0x6b, 0x65, 0x79, 0x22, 0x20, 0x0a, 0x0e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x74, 0x61, 0x74, + 0x65, 0x4e, 0x65, 0x78, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x21, 0x0a, 0x0f, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x74, + 0x61, 0x74, 0x65, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x34, 0x0a, 0x10, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x20, 0x0a, 0x0b, + 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x42, 0x79, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x0b, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x42, 0x79, 0x74, 0x65, 0x73, 0x22, 0x8a, + 0x01, 0x0a, 0x0d, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x32, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x18, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x42, 0x79, 0x74, 0x65, 0x73, 0x52, 0x07, 0x72, 0x65, 0x73, + 0x75, 0x6c, 0x74, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x68, 0x61, 0x73, 0x5f, 0x6d, 0x6f, 0x72, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x68, 0x61, 0x73, 0x4d, 0x6f, 0x72, 0x65, 0x12, + 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, + 0x1a, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x22, 0x67, 0x0a, 0x15, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0x12, 0x32, 0x0a, 0x15, 0x66, 0x65, 0x74, 0x63, 0x68, 0x65, 0x64, 0x5f, + 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x73, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x13, 0x66, 0x65, 0x74, 0x63, 0x68, 0x65, 0x64, 0x52, 0x65, 0x63, 0x6f, + 0x72, 0x64, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x6f, 0x6f, 0x6b, + 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x62, 0x6f, 0x6f, 0x6b, + 0x6d, 0x61, 0x72, 0x6b, 0x22, 0x3f, 0x0a, 0x0d, 0x53, 0x74, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x74, 0x61, 0x6b, 0x65, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x74, 0x61, 0x6b, 0x65, 0x79, 0x12, + 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x46, 0x0a, 0x13, 0x53, 0x74, 0x61, 0x74, 0x65, 0x4d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x2f, 0x0a, 0x07, + 0x65, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0x52, 0x07, 0x65, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x32, 0x56, 0x0a, + 0x10, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x53, 0x75, 0x70, 0x70, 0x6f, 0x72, + 0x74, 0x12, 0x42, 0x0a, 0x08, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x12, 0x18, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, + 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x18, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, + 0x2e, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x28, 0x01, 0x30, 0x01, 0x32, 0x4e, 0x0a, 0x09, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, + 0x64, 0x65, 0x12, 0x41, 0x0a, 0x07, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x12, 0x18, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, + 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x18, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, + 0x2e, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x28, 0x01, 0x30, 0x01, 0x42, 0xa4, 0x01, 0x0a, 0x22, 0x6f, 0x72, 0x67, 0x2e, 0x68, 0x79, + 0x70, 0x65, 0x72, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2e, 0x66, 0x61, 0x62, 0x72, 0x69, 0x63, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x70, 0x65, 0x65, 0x72, 0x42, 0x12, 0x43, 0x68, + 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x53, 0x68, 0x69, 0x6d, 0x50, 0x72, 0x6f, 0x74, 0x6f, + 0x50, 0x01, 0x5a, 0x32, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, + 0x79, 0x70, 0x65, 0x72, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2f, 0x66, 0x61, 0x62, 0x72, 0x69, + 0x63, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2d, 0x67, 0x6f, 0x2d, 0x61, 0x70, 0x69, 0x76, + 0x32, 0x2f, 0x70, 0x65, 0x65, 0x72, 0xa2, 0x02, 0x03, 0x50, 0x58, 0x58, 0xaa, 0x02, 0x06, 0x50, + 0x72, 0x6f, 0x74, 0x6f, 0x73, 0xca, 0x02, 0x06, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0xe2, 0x02, + 0x12, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0xea, 0x02, 0x06, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_peer_chaincode_shim_proto_rawDescOnce sync.Once + file_peer_chaincode_shim_proto_rawDescData = file_peer_chaincode_shim_proto_rawDesc +) + +func file_peer_chaincode_shim_proto_rawDescGZIP() []byte { + file_peer_chaincode_shim_proto_rawDescOnce.Do(func() { + file_peer_chaincode_shim_proto_rawDescData = protoimpl.X.CompressGZIP(file_peer_chaincode_shim_proto_rawDescData) + }) + return file_peer_chaincode_shim_proto_rawDescData +} + +var file_peer_chaincode_shim_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_peer_chaincode_shim_proto_msgTypes = make([]protoimpl.MessageInfo, 18) +var file_peer_chaincode_shim_proto_goTypes = []interface{}{ + (ChaincodeMessage_Type)(0), // 0: protos.ChaincodeMessage.Type + (*ChaincodeMessage)(nil), // 1: protos.ChaincodeMessage + (*GetState)(nil), // 2: protos.GetState + (*GetStateMetadata)(nil), // 3: protos.GetStateMetadata + (*PutState)(nil), // 4: protos.PutState + (*PutStateMetadata)(nil), // 5: protos.PutStateMetadata + (*DelState)(nil), // 6: protos.DelState + (*PurgePrivateState)(nil), // 7: protos.PurgePrivateState + (*GetStateByRange)(nil), // 8: protos.GetStateByRange + (*GetQueryResult)(nil), // 9: protos.GetQueryResult + (*QueryMetadata)(nil), // 10: protos.QueryMetadata + (*GetHistoryForKey)(nil), // 11: protos.GetHistoryForKey + (*QueryStateNext)(nil), // 12: protos.QueryStateNext + (*QueryStateClose)(nil), // 13: protos.QueryStateClose + (*QueryResultBytes)(nil), // 14: protos.QueryResultBytes + (*QueryResponse)(nil), // 15: protos.QueryResponse + (*QueryResponseMetadata)(nil), // 16: protos.QueryResponseMetadata + (*StateMetadata)(nil), // 17: protos.StateMetadata + (*StateMetadataResult)(nil), // 18: protos.StateMetadataResult + (*timestamppb.Timestamp)(nil), // 19: google.protobuf.Timestamp + (*SignedProposal)(nil), // 20: protos.SignedProposal + (*ChaincodeEvent)(nil), // 21: protos.ChaincodeEvent +} +var file_peer_chaincode_shim_proto_depIdxs = []int32{ + 0, // 0: protos.ChaincodeMessage.type:type_name -> protos.ChaincodeMessage.Type + 19, // 1: protos.ChaincodeMessage.timestamp:type_name -> google.protobuf.Timestamp + 20, // 2: protos.ChaincodeMessage.proposal:type_name -> protos.SignedProposal + 21, // 3: protos.ChaincodeMessage.chaincode_event:type_name -> protos.ChaincodeEvent + 17, // 4: protos.PutStateMetadata.metadata:type_name -> protos.StateMetadata + 14, // 5: protos.QueryResponse.results:type_name -> protos.QueryResultBytes + 17, // 6: protos.StateMetadataResult.entries:type_name -> protos.StateMetadata + 1, // 7: protos.ChaincodeSupport.Register:input_type -> protos.ChaincodeMessage + 1, // 8: protos.Chaincode.Connect:input_type -> protos.ChaincodeMessage + 1, // 9: protos.ChaincodeSupport.Register:output_type -> protos.ChaincodeMessage + 1, // 10: protos.Chaincode.Connect:output_type -> protos.ChaincodeMessage + 9, // [9:11] is the sub-list for method output_type + 7, // [7:9] is the sub-list for method input_type + 7, // [7:7] is the sub-list for extension type_name + 7, // [7:7] is the sub-list for extension extendee + 0, // [0:7] is the sub-list for field type_name +} + +func init() { file_peer_chaincode_shim_proto_init() } +func file_peer_chaincode_shim_proto_init() { + if File_peer_chaincode_shim_proto != nil { + return + } + file_peer_chaincode_event_proto_init() + file_peer_proposal_proto_init() + if !protoimpl.UnsafeEnabled { + file_peer_chaincode_shim_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChaincodeMessage); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peer_chaincode_shim_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetState); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peer_chaincode_shim_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetStateMetadata); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peer_chaincode_shim_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PutState); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peer_chaincode_shim_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PutStateMetadata); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peer_chaincode_shim_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DelState); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peer_chaincode_shim_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PurgePrivateState); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peer_chaincode_shim_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetStateByRange); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peer_chaincode_shim_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetQueryResult); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peer_chaincode_shim_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryMetadata); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peer_chaincode_shim_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetHistoryForKey); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peer_chaincode_shim_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryStateNext); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peer_chaincode_shim_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryStateClose); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peer_chaincode_shim_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryResultBytes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peer_chaincode_shim_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peer_chaincode_shim_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryResponseMetadata); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peer_chaincode_shim_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StateMetadata); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peer_chaincode_shim_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StateMetadataResult); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_peer_chaincode_shim_proto_rawDesc, + NumEnums: 1, + NumMessages: 18, + NumExtensions: 0, + NumServices: 2, + }, + GoTypes: file_peer_chaincode_shim_proto_goTypes, + DependencyIndexes: file_peer_chaincode_shim_proto_depIdxs, + EnumInfos: file_peer_chaincode_shim_proto_enumTypes, + MessageInfos: file_peer_chaincode_shim_proto_msgTypes, + }.Build() + File_peer_chaincode_shim_proto = out.File + file_peer_chaincode_shim_proto_rawDesc = nil + file_peer_chaincode_shim_proto_goTypes = nil + file_peer_chaincode_shim_proto_depIdxs = nil +} diff --git a/vendor/github.com/hyperledger/fabric-protos-go-apiv2/peer/chaincode_shim_grpc.pb.go b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/peer/chaincode_shim_grpc.pb.go new file mode 100644 index 00000000000..c7baf0503d2 --- /dev/null +++ b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/peer/chaincode_shim_grpc.pb.go @@ -0,0 +1,263 @@ +// Copyright the Hyperledger Fabric contributors. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: peer/chaincode_shim.proto + +package peer + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + ChaincodeSupport_Register_FullMethodName = "/protos.ChaincodeSupport/Register" +) + +// ChaincodeSupportClient is the client API for ChaincodeSupport service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type ChaincodeSupportClient interface { + Register(ctx context.Context, opts ...grpc.CallOption) (ChaincodeSupport_RegisterClient, error) +} + +type chaincodeSupportClient struct { + cc grpc.ClientConnInterface +} + +func NewChaincodeSupportClient(cc grpc.ClientConnInterface) ChaincodeSupportClient { + return &chaincodeSupportClient{cc} +} + +func (c *chaincodeSupportClient) Register(ctx context.Context, opts ...grpc.CallOption) (ChaincodeSupport_RegisterClient, error) { + stream, err := c.cc.NewStream(ctx, &ChaincodeSupport_ServiceDesc.Streams[0], ChaincodeSupport_Register_FullMethodName, opts...) + if err != nil { + return nil, err + } + x := &chaincodeSupportRegisterClient{stream} + return x, nil +} + +type ChaincodeSupport_RegisterClient interface { + Send(*ChaincodeMessage) error + Recv() (*ChaincodeMessage, error) + grpc.ClientStream +} + +type chaincodeSupportRegisterClient struct { + grpc.ClientStream +} + +func (x *chaincodeSupportRegisterClient) Send(m *ChaincodeMessage) error { + return x.ClientStream.SendMsg(m) +} + +func (x *chaincodeSupportRegisterClient) Recv() (*ChaincodeMessage, error) { + m := new(ChaincodeMessage) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// ChaincodeSupportServer is the server API for ChaincodeSupport service. +// All implementations should embed UnimplementedChaincodeSupportServer +// for forward compatibility +type ChaincodeSupportServer interface { + Register(ChaincodeSupport_RegisterServer) error +} + +// UnimplementedChaincodeSupportServer should be embedded to have forward compatible implementations. +type UnimplementedChaincodeSupportServer struct { +} + +func (UnimplementedChaincodeSupportServer) Register(ChaincodeSupport_RegisterServer) error { + return status.Errorf(codes.Unimplemented, "method Register not implemented") +} + +// UnsafeChaincodeSupportServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to ChaincodeSupportServer will +// result in compilation errors. +type UnsafeChaincodeSupportServer interface { + mustEmbedUnimplementedChaincodeSupportServer() +} + +func RegisterChaincodeSupportServer(s grpc.ServiceRegistrar, srv ChaincodeSupportServer) { + s.RegisterService(&ChaincodeSupport_ServiceDesc, srv) +} + +func _ChaincodeSupport_Register_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(ChaincodeSupportServer).Register(&chaincodeSupportRegisterServer{stream}) +} + +type ChaincodeSupport_RegisterServer interface { + Send(*ChaincodeMessage) error + Recv() (*ChaincodeMessage, error) + grpc.ServerStream +} + +type chaincodeSupportRegisterServer struct { + grpc.ServerStream +} + +func (x *chaincodeSupportRegisterServer) Send(m *ChaincodeMessage) error { + return x.ServerStream.SendMsg(m) +} + +func (x *chaincodeSupportRegisterServer) Recv() (*ChaincodeMessage, error) { + m := new(ChaincodeMessage) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// ChaincodeSupport_ServiceDesc is the grpc.ServiceDesc for ChaincodeSupport service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var ChaincodeSupport_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "protos.ChaincodeSupport", + HandlerType: (*ChaincodeSupportServer)(nil), + Methods: []grpc.MethodDesc{}, + Streams: []grpc.StreamDesc{ + { + StreamName: "Register", + Handler: _ChaincodeSupport_Register_Handler, + ServerStreams: true, + ClientStreams: true, + }, + }, + Metadata: "peer/chaincode_shim.proto", +} + +const ( + Chaincode_Connect_FullMethodName = "/protos.Chaincode/Connect" +) + +// ChaincodeClient is the client API for Chaincode service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type ChaincodeClient interface { + Connect(ctx context.Context, opts ...grpc.CallOption) (Chaincode_ConnectClient, error) +} + +type chaincodeClient struct { + cc grpc.ClientConnInterface +} + +func NewChaincodeClient(cc grpc.ClientConnInterface) ChaincodeClient { + return &chaincodeClient{cc} +} + +func (c *chaincodeClient) Connect(ctx context.Context, opts ...grpc.CallOption) (Chaincode_ConnectClient, error) { + stream, err := c.cc.NewStream(ctx, &Chaincode_ServiceDesc.Streams[0], Chaincode_Connect_FullMethodName, opts...) + if err != nil { + return nil, err + } + x := &chaincodeConnectClient{stream} + return x, nil +} + +type Chaincode_ConnectClient interface { + Send(*ChaincodeMessage) error + Recv() (*ChaincodeMessage, error) + grpc.ClientStream +} + +type chaincodeConnectClient struct { + grpc.ClientStream +} + +func (x *chaincodeConnectClient) Send(m *ChaincodeMessage) error { + return x.ClientStream.SendMsg(m) +} + +func (x *chaincodeConnectClient) Recv() (*ChaincodeMessage, error) { + m := new(ChaincodeMessage) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// ChaincodeServer is the server API for Chaincode service. +// All implementations should embed UnimplementedChaincodeServer +// for forward compatibility +type ChaincodeServer interface { + Connect(Chaincode_ConnectServer) error +} + +// UnimplementedChaincodeServer should be embedded to have forward compatible implementations. +type UnimplementedChaincodeServer struct { +} + +func (UnimplementedChaincodeServer) Connect(Chaincode_ConnectServer) error { + return status.Errorf(codes.Unimplemented, "method Connect not implemented") +} + +// UnsafeChaincodeServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to ChaincodeServer will +// result in compilation errors. +type UnsafeChaincodeServer interface { + mustEmbedUnimplementedChaincodeServer() +} + +func RegisterChaincodeServer(s grpc.ServiceRegistrar, srv ChaincodeServer) { + s.RegisterService(&Chaincode_ServiceDesc, srv) +} + +func _Chaincode_Connect_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(ChaincodeServer).Connect(&chaincodeConnectServer{stream}) +} + +type Chaincode_ConnectServer interface { + Send(*ChaincodeMessage) error + Recv() (*ChaincodeMessage, error) + grpc.ServerStream +} + +type chaincodeConnectServer struct { + grpc.ServerStream +} + +func (x *chaincodeConnectServer) Send(m *ChaincodeMessage) error { + return x.ServerStream.SendMsg(m) +} + +func (x *chaincodeConnectServer) Recv() (*ChaincodeMessage, error) { + m := new(ChaincodeMessage) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// Chaincode_ServiceDesc is the grpc.ServiceDesc for Chaincode service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Chaincode_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "protos.Chaincode", + HandlerType: (*ChaincodeServer)(nil), + Methods: []grpc.MethodDesc{}, + Streams: []grpc.StreamDesc{ + { + StreamName: "Connect", + Handler: _Chaincode_Connect_Handler, + ServerStreams: true, + ClientStreams: true, + }, + }, + Metadata: "peer/chaincode_shim.proto", +} diff --git a/vendor/github.com/hyperledger/fabric-protos-go-apiv2/peer/collection.pb.go b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/peer/collection.pb.go new file mode 100644 index 00000000000..c55fa1a2a9e --- /dev/null +++ b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/peer/collection.pb.go @@ -0,0 +1,528 @@ +// Copyright the Hyperledger Fabric contributors. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: peer/collection.proto + +package peer + +import ( + common "github.com/hyperledger/fabric-protos-go-apiv2/common" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// CollectionConfigPackage represents an array of CollectionConfig +// messages; the extra struct is required because repeated oneof is +// forbidden by the protobuf syntax +type CollectionConfigPackage struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Config []*CollectionConfig `protobuf:"bytes,1,rep,name=config,proto3" json:"config,omitempty"` +} + +func (x *CollectionConfigPackage) Reset() { + *x = CollectionConfigPackage{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_collection_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CollectionConfigPackage) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CollectionConfigPackage) ProtoMessage() {} + +func (x *CollectionConfigPackage) ProtoReflect() protoreflect.Message { + mi := &file_peer_collection_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CollectionConfigPackage.ProtoReflect.Descriptor instead. +func (*CollectionConfigPackage) Descriptor() ([]byte, []int) { + return file_peer_collection_proto_rawDescGZIP(), []int{0} +} + +func (x *CollectionConfigPackage) GetConfig() []*CollectionConfig { + if x != nil { + return x.Config + } + return nil +} + +// CollectionConfig defines the configuration of a collection object; +// it currently contains a single, static type. +// Dynamic collections are deferred. +type CollectionConfig struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Payload: + // + // *CollectionConfig_StaticCollectionConfig + Payload isCollectionConfig_Payload `protobuf_oneof:"payload"` +} + +func (x *CollectionConfig) Reset() { + *x = CollectionConfig{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_collection_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CollectionConfig) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CollectionConfig) ProtoMessage() {} + +func (x *CollectionConfig) ProtoReflect() protoreflect.Message { + mi := &file_peer_collection_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CollectionConfig.ProtoReflect.Descriptor instead. +func (*CollectionConfig) Descriptor() ([]byte, []int) { + return file_peer_collection_proto_rawDescGZIP(), []int{1} +} + +func (m *CollectionConfig) GetPayload() isCollectionConfig_Payload { + if m != nil { + return m.Payload + } + return nil +} + +func (x *CollectionConfig) GetStaticCollectionConfig() *StaticCollectionConfig { + if x, ok := x.GetPayload().(*CollectionConfig_StaticCollectionConfig); ok { + return x.StaticCollectionConfig + } + return nil +} + +type isCollectionConfig_Payload interface { + isCollectionConfig_Payload() +} + +type CollectionConfig_StaticCollectionConfig struct { + StaticCollectionConfig *StaticCollectionConfig `protobuf:"bytes,1,opt,name=static_collection_config,json=staticCollectionConfig,proto3,oneof"` +} + +func (*CollectionConfig_StaticCollectionConfig) isCollectionConfig_Payload() {} + +// StaticCollectionConfig constitutes the configuration parameters of a +// static collection object. Static collections are collections that are +// known at chaincode instantiation time, and that cannot be changed. +// Dynamic collections are deferred. +type StaticCollectionConfig struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // the name of the collection inside the denoted chaincode + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // a reference to a policy residing / managed in the config block + // to define which orgs have access to this collection’s private data + MemberOrgsPolicy *CollectionPolicyConfig `protobuf:"bytes,2,opt,name=member_orgs_policy,json=memberOrgsPolicy,proto3" json:"member_orgs_policy,omitempty"` + // The minimum number of peers private data will be sent to upon + // endorsement. The endorsement would fail if dissemination to at least + // this number of peers is not achieved. + RequiredPeerCount int32 `protobuf:"varint,3,opt,name=required_peer_count,json=requiredPeerCount,proto3" json:"required_peer_count,omitempty"` + // The maximum number of peers that private data will be sent to + // upon endorsement. This number has to be bigger than required_peer_count. + MaximumPeerCount int32 `protobuf:"varint,4,opt,name=maximum_peer_count,json=maximumPeerCount,proto3" json:"maximum_peer_count,omitempty"` + // The number of blocks after which the collection data expires. + // For instance if the value is set to 10, a key last modified by block number 100 + // will be purged at block number 111. A zero value is treated same as MaxUint64 + BlockToLive uint64 `protobuf:"varint,5,opt,name=block_to_live,json=blockToLive,proto3" json:"block_to_live,omitempty"` + // The member only read access denotes whether only collection member clients + // can read the private data (if set to true), or even non members can + // read the data (if set to false, for example if you want to implement more granular + // access logic in the chaincode) + MemberOnlyRead bool `protobuf:"varint,6,opt,name=member_only_read,json=memberOnlyRead,proto3" json:"member_only_read,omitempty"` + // The member only write access denotes whether only collection member clients + // can write the private data (if set to true), or even non members can + // write the data (if set to false, for example if you want to implement more granular + // access logic in the chaincode) + MemberOnlyWrite bool `protobuf:"varint,7,opt,name=member_only_write,json=memberOnlyWrite,proto3" json:"member_only_write,omitempty"` + // a reference to a policy residing / managed in the config block + // to define the endorsement policy for this collection + EndorsementPolicy *ApplicationPolicy `protobuf:"bytes,8,opt,name=endorsement_policy,json=endorsementPolicy,proto3" json:"endorsement_policy,omitempty"` +} + +func (x *StaticCollectionConfig) Reset() { + *x = StaticCollectionConfig{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_collection_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StaticCollectionConfig) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StaticCollectionConfig) ProtoMessage() {} + +func (x *StaticCollectionConfig) ProtoReflect() protoreflect.Message { + mi := &file_peer_collection_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StaticCollectionConfig.ProtoReflect.Descriptor instead. +func (*StaticCollectionConfig) Descriptor() ([]byte, []int) { + return file_peer_collection_proto_rawDescGZIP(), []int{2} +} + +func (x *StaticCollectionConfig) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *StaticCollectionConfig) GetMemberOrgsPolicy() *CollectionPolicyConfig { + if x != nil { + return x.MemberOrgsPolicy + } + return nil +} + +func (x *StaticCollectionConfig) GetRequiredPeerCount() int32 { + if x != nil { + return x.RequiredPeerCount + } + return 0 +} + +func (x *StaticCollectionConfig) GetMaximumPeerCount() int32 { + if x != nil { + return x.MaximumPeerCount + } + return 0 +} + +func (x *StaticCollectionConfig) GetBlockToLive() uint64 { + if x != nil { + return x.BlockToLive + } + return 0 +} + +func (x *StaticCollectionConfig) GetMemberOnlyRead() bool { + if x != nil { + return x.MemberOnlyRead + } + return false +} + +func (x *StaticCollectionConfig) GetMemberOnlyWrite() bool { + if x != nil { + return x.MemberOnlyWrite + } + return false +} + +func (x *StaticCollectionConfig) GetEndorsementPolicy() *ApplicationPolicy { + if x != nil { + return x.EndorsementPolicy + } + return nil +} + +// Collection policy configuration. Initially, the configuration can only +// contain a SignaturePolicy. In the future, the SignaturePolicy may be a +// more general Policy. Instead of containing the actual policy, the +// configuration may in the future contain a string reference to a policy. +type CollectionPolicyConfig struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Payload: + // + // *CollectionPolicyConfig_SignaturePolicy + Payload isCollectionPolicyConfig_Payload `protobuf_oneof:"payload"` +} + +func (x *CollectionPolicyConfig) Reset() { + *x = CollectionPolicyConfig{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_collection_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CollectionPolicyConfig) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CollectionPolicyConfig) ProtoMessage() {} + +func (x *CollectionPolicyConfig) ProtoReflect() protoreflect.Message { + mi := &file_peer_collection_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CollectionPolicyConfig.ProtoReflect.Descriptor instead. +func (*CollectionPolicyConfig) Descriptor() ([]byte, []int) { + return file_peer_collection_proto_rawDescGZIP(), []int{3} +} + +func (m *CollectionPolicyConfig) GetPayload() isCollectionPolicyConfig_Payload { + if m != nil { + return m.Payload + } + return nil +} + +func (x *CollectionPolicyConfig) GetSignaturePolicy() *common.SignaturePolicyEnvelope { + if x, ok := x.GetPayload().(*CollectionPolicyConfig_SignaturePolicy); ok { + return x.SignaturePolicy + } + return nil +} + +type isCollectionPolicyConfig_Payload interface { + isCollectionPolicyConfig_Payload() +} + +type CollectionPolicyConfig_SignaturePolicy struct { + // Initially, only a signature policy is supported. + SignaturePolicy *common.SignaturePolicyEnvelope `protobuf:"bytes,1,opt,name=signature_policy,json=signaturePolicy,proto3,oneof"` +} + +func (*CollectionPolicyConfig_SignaturePolicy) isCollectionPolicyConfig_Payload() {} + +var File_peer_collection_proto protoreflect.FileDescriptor + +var file_peer_collection_proto_rawDesc = []byte{ + 0x0a, 0x15, 0x70, 0x65, 0x65, 0x72, 0x2f, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x1a, + 0x15, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x11, 0x70, 0x65, 0x65, 0x72, 0x2f, 0x70, 0x6f, 0x6c, + 0x69, 0x63, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x4b, 0x0a, 0x17, 0x43, 0x6f, 0x6c, + 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x50, 0x61, 0x63, + 0x6b, 0x61, 0x67, 0x65, 0x12, 0x30, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x43, 0x6f, + 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x06, + 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x22, 0x79, 0x0a, 0x10, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x5a, 0x0a, 0x18, 0x73, 0x74, + 0x61, 0x74, 0x69, 0x63, 0x5f, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, + 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x69, 0x63, 0x43, 0x6f, 0x6c, 0x6c, + 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x48, 0x00, 0x52, 0x16, + 0x73, 0x74, 0x61, 0x74, 0x69, 0x63, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x42, 0x09, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, + 0x64, 0x22, 0x9c, 0x03, 0x0a, 0x16, 0x53, 0x74, 0x61, 0x74, 0x69, 0x63, 0x43, 0x6f, 0x6c, 0x6c, + 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x12, 0x0a, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x12, 0x4c, 0x0a, 0x12, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x5f, 0x6f, 0x72, 0x67, 0x73, 0x5f, + 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x10, 0x6d, 0x65, + 0x6d, 0x62, 0x65, 0x72, 0x4f, 0x72, 0x67, 0x73, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x2e, + 0x0a, 0x13, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x5f, 0x70, 0x65, 0x65, 0x72, 0x5f, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x11, 0x72, 0x65, 0x71, + 0x75, 0x69, 0x72, 0x65, 0x64, 0x50, 0x65, 0x65, 0x72, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x2c, + 0x0a, 0x12, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x5f, 0x70, 0x65, 0x65, 0x72, 0x5f, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x10, 0x6d, 0x61, 0x78, 0x69, + 0x6d, 0x75, 0x6d, 0x50, 0x65, 0x65, 0x72, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x22, 0x0a, 0x0d, + 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x74, 0x6f, 0x5f, 0x6c, 0x69, 0x76, 0x65, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x54, 0x6f, 0x4c, 0x69, 0x76, 0x65, + 0x12, 0x28, 0x0a, 0x10, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x5f, 0x6f, 0x6e, 0x6c, 0x79, 0x5f, + 0x72, 0x65, 0x61, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x6d, 0x65, 0x6d, 0x62, + 0x65, 0x72, 0x4f, 0x6e, 0x6c, 0x79, 0x52, 0x65, 0x61, 0x64, 0x12, 0x2a, 0x0a, 0x11, 0x6d, 0x65, + 0x6d, 0x62, 0x65, 0x72, 0x5f, 0x6f, 0x6e, 0x6c, 0x79, 0x5f, 0x77, 0x72, 0x69, 0x74, 0x65, 0x18, + 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x4f, 0x6e, 0x6c, + 0x79, 0x57, 0x72, 0x69, 0x74, 0x65, 0x12, 0x48, 0x0a, 0x12, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x73, + 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, 0x08, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x41, 0x70, 0x70, 0x6c, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x11, 0x65, + 0x6e, 0x64, 0x6f, 0x72, 0x73, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, + 0x22, 0x71, 0x0a, 0x16, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6f, + 0x6c, 0x69, 0x63, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x4c, 0x0a, 0x10, 0x73, 0x69, + 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x53, 0x69, + 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x45, 0x6e, 0x76, + 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x48, 0x00, 0x52, 0x0f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, + 0x72, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x42, 0x09, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, + 0x6f, 0x61, 0x64, 0x42, 0xa1, 0x01, 0x0a, 0x22, 0x6f, 0x72, 0x67, 0x2e, 0x68, 0x79, 0x70, 0x65, + 0x72, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2e, 0x66, 0x61, 0x62, 0x72, 0x69, 0x63, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x70, 0x65, 0x65, 0x72, 0x42, 0x0f, 0x43, 0x6f, 0x6c, 0x6c, + 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x32, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, + 0x65, 0x64, 0x67, 0x65, 0x72, 0x2f, 0x66, 0x61, 0x62, 0x72, 0x69, 0x63, 0x2d, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x73, 0x2d, 0x67, 0x6f, 0x2d, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x70, 0x65, 0x65, + 0x72, 0xa2, 0x02, 0x03, 0x50, 0x58, 0x58, 0xaa, 0x02, 0x06, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x73, + 0xca, 0x02, 0x06, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0xe2, 0x02, 0x12, 0x50, 0x72, 0x6f, 0x74, + 0x6f, 0x73, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, + 0x06, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_peer_collection_proto_rawDescOnce sync.Once + file_peer_collection_proto_rawDescData = file_peer_collection_proto_rawDesc +) + +func file_peer_collection_proto_rawDescGZIP() []byte { + file_peer_collection_proto_rawDescOnce.Do(func() { + file_peer_collection_proto_rawDescData = protoimpl.X.CompressGZIP(file_peer_collection_proto_rawDescData) + }) + return file_peer_collection_proto_rawDescData +} + +var file_peer_collection_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_peer_collection_proto_goTypes = []interface{}{ + (*CollectionConfigPackage)(nil), // 0: protos.CollectionConfigPackage + (*CollectionConfig)(nil), // 1: protos.CollectionConfig + (*StaticCollectionConfig)(nil), // 2: protos.StaticCollectionConfig + (*CollectionPolicyConfig)(nil), // 3: protos.CollectionPolicyConfig + (*ApplicationPolicy)(nil), // 4: protos.ApplicationPolicy + (*common.SignaturePolicyEnvelope)(nil), // 5: common.SignaturePolicyEnvelope +} +var file_peer_collection_proto_depIdxs = []int32{ + 1, // 0: protos.CollectionConfigPackage.config:type_name -> protos.CollectionConfig + 2, // 1: protos.CollectionConfig.static_collection_config:type_name -> protos.StaticCollectionConfig + 3, // 2: protos.StaticCollectionConfig.member_orgs_policy:type_name -> protos.CollectionPolicyConfig + 4, // 3: protos.StaticCollectionConfig.endorsement_policy:type_name -> protos.ApplicationPolicy + 5, // 4: protos.CollectionPolicyConfig.signature_policy:type_name -> common.SignaturePolicyEnvelope + 5, // [5:5] is the sub-list for method output_type + 5, // [5:5] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name +} + +func init() { file_peer_collection_proto_init() } +func file_peer_collection_proto_init() { + if File_peer_collection_proto != nil { + return + } + file_peer_policy_proto_init() + if !protoimpl.UnsafeEnabled { + file_peer_collection_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CollectionConfigPackage); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peer_collection_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CollectionConfig); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peer_collection_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StaticCollectionConfig); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peer_collection_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CollectionPolicyConfig); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_peer_collection_proto_msgTypes[1].OneofWrappers = []interface{}{ + (*CollectionConfig_StaticCollectionConfig)(nil), + } + file_peer_collection_proto_msgTypes[3].OneofWrappers = []interface{}{ + (*CollectionPolicyConfig_SignaturePolicy)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_peer_collection_proto_rawDesc, + NumEnums: 0, + NumMessages: 4, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_peer_collection_proto_goTypes, + DependencyIndexes: file_peer_collection_proto_depIdxs, + MessageInfos: file_peer_collection_proto_msgTypes, + }.Build() + File_peer_collection_proto = out.File + file_peer_collection_proto_rawDesc = nil + file_peer_collection_proto_goTypes = nil + file_peer_collection_proto_depIdxs = nil +} diff --git a/vendor/github.com/hyperledger/fabric-protos-go-apiv2/peer/configuration.pb.go b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/peer/configuration.pb.go new file mode 100644 index 00000000000..238b3e4835e --- /dev/null +++ b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/peer/configuration.pb.go @@ -0,0 +1,371 @@ +// Copyright the Hyperledger Fabric contributors. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: peer/configuration.proto + +package peer + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// AnchorPeers simply represents list of anchor peers which is used in ConfigurationItem +type AnchorPeers struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AnchorPeers []*AnchorPeer `protobuf:"bytes,1,rep,name=anchor_peers,json=anchorPeers,proto3" json:"anchor_peers,omitempty"` +} + +func (x *AnchorPeers) Reset() { + *x = AnchorPeers{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_configuration_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AnchorPeers) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AnchorPeers) ProtoMessage() {} + +func (x *AnchorPeers) ProtoReflect() protoreflect.Message { + mi := &file_peer_configuration_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AnchorPeers.ProtoReflect.Descriptor instead. +func (*AnchorPeers) Descriptor() ([]byte, []int) { + return file_peer_configuration_proto_rawDescGZIP(), []int{0} +} + +func (x *AnchorPeers) GetAnchorPeers() []*AnchorPeer { + if x != nil { + return x.AnchorPeers + } + return nil +} + +// AnchorPeer message structure which provides information about anchor peer, it includes host name, +// port number and peer certificate. +type AnchorPeer struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Host string `protobuf:"bytes,1,opt,name=host,proto3" json:"host,omitempty"` // DNS host name of the anchor peer + Port int32 `protobuf:"varint,2,opt,name=port,proto3" json:"port,omitempty"` // The port number +} + +func (x *AnchorPeer) Reset() { + *x = AnchorPeer{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_configuration_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AnchorPeer) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AnchorPeer) ProtoMessage() {} + +func (x *AnchorPeer) ProtoReflect() protoreflect.Message { + mi := &file_peer_configuration_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AnchorPeer.ProtoReflect.Descriptor instead. +func (*AnchorPeer) Descriptor() ([]byte, []int) { + return file_peer_configuration_proto_rawDescGZIP(), []int{1} +} + +func (x *AnchorPeer) GetHost() string { + if x != nil { + return x.Host + } + return "" +} + +func (x *AnchorPeer) GetPort() int32 { + if x != nil { + return x.Port + } + return 0 +} + +// APIResource represents an API resource in the peer whose ACL +// is determined by the policy_ref field +type APIResource struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PolicyRef string `protobuf:"bytes,1,opt,name=policy_ref,json=policyRef,proto3" json:"policy_ref,omitempty"` // The policy name to use for this API +} + +func (x *APIResource) Reset() { + *x = APIResource{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_configuration_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *APIResource) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*APIResource) ProtoMessage() {} + +func (x *APIResource) ProtoReflect() protoreflect.Message { + mi := &file_peer_configuration_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use APIResource.ProtoReflect.Descriptor instead. +func (*APIResource) Descriptor() ([]byte, []int) { + return file_peer_configuration_proto_rawDescGZIP(), []int{2} +} + +func (x *APIResource) GetPolicyRef() string { + if x != nil { + return x.PolicyRef + } + return "" +} + +// ACLs provides mappings for resources in a channel. APIResource encapsulates +// reference to a policy used to determine ACL for the resource +type ACLs struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Acls map[string]*APIResource `protobuf:"bytes,1,rep,name=acls,proto3" json:"acls,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *ACLs) Reset() { + *x = ACLs{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_configuration_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ACLs) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ACLs) ProtoMessage() {} + +func (x *ACLs) ProtoReflect() protoreflect.Message { + mi := &file_peer_configuration_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ACLs.ProtoReflect.Descriptor instead. +func (*ACLs) Descriptor() ([]byte, []int) { + return file_peer_configuration_proto_rawDescGZIP(), []int{3} +} + +func (x *ACLs) GetAcls() map[string]*APIResource { + if x != nil { + return x.Acls + } + return nil +} + +var File_peer_configuration_proto protoreflect.FileDescriptor + +var file_peer_configuration_proto_rawDesc = []byte{ + 0x0a, 0x18, 0x70, 0x65, 0x65, 0x72, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x73, 0x22, 0x44, 0x0a, 0x0b, 0x41, 0x6e, 0x63, 0x68, 0x6f, 0x72, 0x50, 0x65, 0x65, 0x72, + 0x73, 0x12, 0x35, 0x0a, 0x0c, 0x61, 0x6e, 0x63, 0x68, 0x6f, 0x72, 0x5f, 0x70, 0x65, 0x65, 0x72, + 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, + 0x2e, 0x41, 0x6e, 0x63, 0x68, 0x6f, 0x72, 0x50, 0x65, 0x65, 0x72, 0x52, 0x0b, 0x61, 0x6e, 0x63, + 0x68, 0x6f, 0x72, 0x50, 0x65, 0x65, 0x72, 0x73, 0x22, 0x34, 0x0a, 0x0a, 0x41, 0x6e, 0x63, 0x68, + 0x6f, 0x72, 0x50, 0x65, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x6f, + 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x22, 0x2c, + 0x0a, 0x0b, 0x41, 0x50, 0x49, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x1d, 0x0a, + 0x0a, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x5f, 0x72, 0x65, 0x66, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x09, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, 0x66, 0x22, 0x80, 0x01, 0x0a, + 0x04, 0x41, 0x43, 0x4c, 0x73, 0x12, 0x2a, 0x0a, 0x04, 0x61, 0x63, 0x6c, 0x73, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x41, 0x43, 0x4c, + 0x73, 0x2e, 0x41, 0x63, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x04, 0x61, 0x63, 0x6c, + 0x73, 0x1a, 0x4c, 0x0a, 0x09, 0x41, 0x63, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, + 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, + 0x12, 0x29, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x13, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x41, 0x50, 0x49, 0x52, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, + 0xa4, 0x01, 0x0a, 0x22, 0x6f, 0x72, 0x67, 0x2e, 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x65, 0x64, + 0x67, 0x65, 0x72, 0x2e, 0x66, 0x61, 0x62, 0x72, 0x69, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x73, 0x2e, 0x70, 0x65, 0x65, 0x72, 0x42, 0x12, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x32, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x65, + 0x64, 0x67, 0x65, 0x72, 0x2f, 0x66, 0x61, 0x62, 0x72, 0x69, 0x63, 0x2d, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x73, 0x2d, 0x67, 0x6f, 0x2d, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x70, 0x65, 0x65, 0x72, + 0xa2, 0x02, 0x03, 0x50, 0x58, 0x58, 0xaa, 0x02, 0x06, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0xca, + 0x02, 0x06, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0xe2, 0x02, 0x12, 0x50, 0x72, 0x6f, 0x74, 0x6f, + 0x73, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x06, + 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_peer_configuration_proto_rawDescOnce sync.Once + file_peer_configuration_proto_rawDescData = file_peer_configuration_proto_rawDesc +) + +func file_peer_configuration_proto_rawDescGZIP() []byte { + file_peer_configuration_proto_rawDescOnce.Do(func() { + file_peer_configuration_proto_rawDescData = protoimpl.X.CompressGZIP(file_peer_configuration_proto_rawDescData) + }) + return file_peer_configuration_proto_rawDescData +} + +var file_peer_configuration_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +var file_peer_configuration_proto_goTypes = []interface{}{ + (*AnchorPeers)(nil), // 0: protos.AnchorPeers + (*AnchorPeer)(nil), // 1: protos.AnchorPeer + (*APIResource)(nil), // 2: protos.APIResource + (*ACLs)(nil), // 3: protos.ACLs + nil, // 4: protos.ACLs.AclsEntry +} +var file_peer_configuration_proto_depIdxs = []int32{ + 1, // 0: protos.AnchorPeers.anchor_peers:type_name -> protos.AnchorPeer + 4, // 1: protos.ACLs.acls:type_name -> protos.ACLs.AclsEntry + 2, // 2: protos.ACLs.AclsEntry.value:type_name -> protos.APIResource + 3, // [3:3] is the sub-list for method output_type + 3, // [3:3] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name +} + +func init() { file_peer_configuration_proto_init() } +func file_peer_configuration_proto_init() { + if File_peer_configuration_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_peer_configuration_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AnchorPeers); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peer_configuration_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AnchorPeer); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peer_configuration_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*APIResource); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peer_configuration_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ACLs); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_peer_configuration_proto_rawDesc, + NumEnums: 0, + NumMessages: 5, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_peer_configuration_proto_goTypes, + DependencyIndexes: file_peer_configuration_proto_depIdxs, + MessageInfos: file_peer_configuration_proto_msgTypes, + }.Build() + File_peer_configuration_proto = out.File + file_peer_configuration_proto_rawDesc = nil + file_peer_configuration_proto_goTypes = nil + file_peer_configuration_proto_depIdxs = nil +} diff --git a/vendor/github.com/hyperledger/fabric-protos-go-apiv2/peer/events.pb.go b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/peer/events.pb.go new file mode 100644 index 00000000000..27c810d4b75 --- /dev/null +++ b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/peer/events.pb.go @@ -0,0 +1,722 @@ +// Copyright the Hyperledger Fabric contributors. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: peer/events.proto + +package peer + +import ( + common "github.com/hyperledger/fabric-protos-go-apiv2/common" + rwset "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// FilteredBlock is a minimal set of information about a block +type FilteredBlock struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ChannelId string `protobuf:"bytes,1,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` + Number uint64 `protobuf:"varint,2,opt,name=number,proto3" json:"number,omitempty"` // The position in the blockchain + FilteredTransactions []*FilteredTransaction `protobuf:"bytes,4,rep,name=filtered_transactions,json=filteredTransactions,proto3" json:"filtered_transactions,omitempty"` +} + +func (x *FilteredBlock) Reset() { + *x = FilteredBlock{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_events_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FilteredBlock) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FilteredBlock) ProtoMessage() {} + +func (x *FilteredBlock) ProtoReflect() protoreflect.Message { + mi := &file_peer_events_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FilteredBlock.ProtoReflect.Descriptor instead. +func (*FilteredBlock) Descriptor() ([]byte, []int) { + return file_peer_events_proto_rawDescGZIP(), []int{0} +} + +func (x *FilteredBlock) GetChannelId() string { + if x != nil { + return x.ChannelId + } + return "" +} + +func (x *FilteredBlock) GetNumber() uint64 { + if x != nil { + return x.Number + } + return 0 +} + +func (x *FilteredBlock) GetFilteredTransactions() []*FilteredTransaction { + if x != nil { + return x.FilteredTransactions + } + return nil +} + +// FilteredTransaction is a minimal set of information about a transaction +// within a block +type FilteredTransaction struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Txid string `protobuf:"bytes,1,opt,name=txid,proto3" json:"txid,omitempty"` + Type common.HeaderType `protobuf:"varint,2,opt,name=type,proto3,enum=common.HeaderType" json:"type,omitempty"` + TxValidationCode TxValidationCode `protobuf:"varint,3,opt,name=tx_validation_code,json=txValidationCode,proto3,enum=protos.TxValidationCode" json:"tx_validation_code,omitempty"` + // Types that are assignable to Data: + // + // *FilteredTransaction_TransactionActions + Data isFilteredTransaction_Data `protobuf_oneof:"Data"` +} + +func (x *FilteredTransaction) Reset() { + *x = FilteredTransaction{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_events_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FilteredTransaction) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FilteredTransaction) ProtoMessage() {} + +func (x *FilteredTransaction) ProtoReflect() protoreflect.Message { + mi := &file_peer_events_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FilteredTransaction.ProtoReflect.Descriptor instead. +func (*FilteredTransaction) Descriptor() ([]byte, []int) { + return file_peer_events_proto_rawDescGZIP(), []int{1} +} + +func (x *FilteredTransaction) GetTxid() string { + if x != nil { + return x.Txid + } + return "" +} + +func (x *FilteredTransaction) GetType() common.HeaderType { + if x != nil { + return x.Type + } + return common.HeaderType(0) +} + +func (x *FilteredTransaction) GetTxValidationCode() TxValidationCode { + if x != nil { + return x.TxValidationCode + } + return TxValidationCode_VALID +} + +func (m *FilteredTransaction) GetData() isFilteredTransaction_Data { + if m != nil { + return m.Data + } + return nil +} + +func (x *FilteredTransaction) GetTransactionActions() *FilteredTransactionActions { + if x, ok := x.GetData().(*FilteredTransaction_TransactionActions); ok { + return x.TransactionActions + } + return nil +} + +type isFilteredTransaction_Data interface { + isFilteredTransaction_Data() +} + +type FilteredTransaction_TransactionActions struct { + TransactionActions *FilteredTransactionActions `protobuf:"bytes,4,opt,name=transaction_actions,json=transactionActions,proto3,oneof"` +} + +func (*FilteredTransaction_TransactionActions) isFilteredTransaction_Data() {} + +// FilteredTransactionActions is a wrapper for array of TransactionAction +// message from regular block +type FilteredTransactionActions struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ChaincodeActions []*FilteredChaincodeAction `protobuf:"bytes,1,rep,name=chaincode_actions,json=chaincodeActions,proto3" json:"chaincode_actions,omitempty"` +} + +func (x *FilteredTransactionActions) Reset() { + *x = FilteredTransactionActions{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_events_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FilteredTransactionActions) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FilteredTransactionActions) ProtoMessage() {} + +func (x *FilteredTransactionActions) ProtoReflect() protoreflect.Message { + mi := &file_peer_events_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FilteredTransactionActions.ProtoReflect.Descriptor instead. +func (*FilteredTransactionActions) Descriptor() ([]byte, []int) { + return file_peer_events_proto_rawDescGZIP(), []int{2} +} + +func (x *FilteredTransactionActions) GetChaincodeActions() []*FilteredChaincodeAction { + if x != nil { + return x.ChaincodeActions + } + return nil +} + +// FilteredChaincodeAction is a minimal set of information about an action +// within a transaction +type FilteredChaincodeAction struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ChaincodeEvent *ChaincodeEvent `protobuf:"bytes,1,opt,name=chaincode_event,json=chaincodeEvent,proto3" json:"chaincode_event,omitempty"` +} + +func (x *FilteredChaincodeAction) Reset() { + *x = FilteredChaincodeAction{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_events_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FilteredChaincodeAction) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FilteredChaincodeAction) ProtoMessage() {} + +func (x *FilteredChaincodeAction) ProtoReflect() protoreflect.Message { + mi := &file_peer_events_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FilteredChaincodeAction.ProtoReflect.Descriptor instead. +func (*FilteredChaincodeAction) Descriptor() ([]byte, []int) { + return file_peer_events_proto_rawDescGZIP(), []int{3} +} + +func (x *FilteredChaincodeAction) GetChaincodeEvent() *ChaincodeEvent { + if x != nil { + return x.ChaincodeEvent + } + return nil +} + +// BlockAndPrivateData contains Block and a map from tx_seq_in_block to rwset.TxPvtReadWriteSet +type BlockAndPrivateData struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Block *common.Block `protobuf:"bytes,1,opt,name=block,proto3" json:"block,omitempty"` + // map from tx_seq_in_block to rwset.TxPvtReadWriteSet + PrivateDataMap map[uint64]*rwset.TxPvtReadWriteSet `protobuf:"bytes,2,rep,name=private_data_map,json=privateDataMap,proto3" json:"private_data_map,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *BlockAndPrivateData) Reset() { + *x = BlockAndPrivateData{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_events_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BlockAndPrivateData) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BlockAndPrivateData) ProtoMessage() {} + +func (x *BlockAndPrivateData) ProtoReflect() protoreflect.Message { + mi := &file_peer_events_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BlockAndPrivateData.ProtoReflect.Descriptor instead. +func (*BlockAndPrivateData) Descriptor() ([]byte, []int) { + return file_peer_events_proto_rawDescGZIP(), []int{4} +} + +func (x *BlockAndPrivateData) GetBlock() *common.Block { + if x != nil { + return x.Block + } + return nil +} + +func (x *BlockAndPrivateData) GetPrivateDataMap() map[uint64]*rwset.TxPvtReadWriteSet { + if x != nil { + return x.PrivateDataMap + } + return nil +} + +// DeliverResponse +type DeliverResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Type: + // + // *DeliverResponse_Status + // *DeliverResponse_Block + // *DeliverResponse_FilteredBlock + // *DeliverResponse_BlockAndPrivateData + Type isDeliverResponse_Type `protobuf_oneof:"Type"` +} + +func (x *DeliverResponse) Reset() { + *x = DeliverResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_events_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeliverResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeliverResponse) ProtoMessage() {} + +func (x *DeliverResponse) ProtoReflect() protoreflect.Message { + mi := &file_peer_events_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeliverResponse.ProtoReflect.Descriptor instead. +func (*DeliverResponse) Descriptor() ([]byte, []int) { + return file_peer_events_proto_rawDescGZIP(), []int{5} +} + +func (m *DeliverResponse) GetType() isDeliverResponse_Type { + if m != nil { + return m.Type + } + return nil +} + +func (x *DeliverResponse) GetStatus() common.Status { + if x, ok := x.GetType().(*DeliverResponse_Status); ok { + return x.Status + } + return common.Status(0) +} + +func (x *DeliverResponse) GetBlock() *common.Block { + if x, ok := x.GetType().(*DeliverResponse_Block); ok { + return x.Block + } + return nil +} + +func (x *DeliverResponse) GetFilteredBlock() *FilteredBlock { + if x, ok := x.GetType().(*DeliverResponse_FilteredBlock); ok { + return x.FilteredBlock + } + return nil +} + +func (x *DeliverResponse) GetBlockAndPrivateData() *BlockAndPrivateData { + if x, ok := x.GetType().(*DeliverResponse_BlockAndPrivateData); ok { + return x.BlockAndPrivateData + } + return nil +} + +type isDeliverResponse_Type interface { + isDeliverResponse_Type() +} + +type DeliverResponse_Status struct { + Status common.Status `protobuf:"varint,1,opt,name=status,proto3,enum=common.Status,oneof"` +} + +type DeliverResponse_Block struct { + Block *common.Block `protobuf:"bytes,2,opt,name=block,proto3,oneof"` +} + +type DeliverResponse_FilteredBlock struct { + FilteredBlock *FilteredBlock `protobuf:"bytes,3,opt,name=filtered_block,json=filteredBlock,proto3,oneof"` +} + +type DeliverResponse_BlockAndPrivateData struct { + BlockAndPrivateData *BlockAndPrivateData `protobuf:"bytes,4,opt,name=block_and_private_data,json=blockAndPrivateData,proto3,oneof"` +} + +func (*DeliverResponse_Status) isDeliverResponse_Type() {} + +func (*DeliverResponse_Block) isDeliverResponse_Type() {} + +func (*DeliverResponse_FilteredBlock) isDeliverResponse_Type() {} + +func (*DeliverResponse_BlockAndPrivateData) isDeliverResponse_Type() {} + +var File_peer_events_proto protoreflect.FileDescriptor + +var file_peer_events_proto_rawDesc = []byte{ + 0x0a, 0x11, 0x70, 0x65, 0x65, 0x72, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x1a, 0x13, 0x63, 0x6f, 0x6d, + 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x1a, 0x18, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2f, 0x72, 0x77, 0x73, 0x65, 0x74, 0x2f, 0x72, + 0x77, 0x73, 0x65, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1a, 0x70, 0x65, 0x65, 0x72, + 0x2f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x5f, 0x65, 0x76, 0x65, 0x6e, 0x74, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x16, 0x70, 0x65, 0x65, 0x72, 0x2f, 0x74, 0x72, 0x61, + 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x98, + 0x01, 0x0a, 0x0d, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x65, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, + 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x49, 0x64, 0x12, + 0x16, 0x0a, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x50, 0x0a, 0x15, 0x66, 0x69, 0x6c, 0x74, 0x65, + 0x72, 0x65, 0x64, 0x5f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, + 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x65, 0x64, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x14, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x65, 0x64, 0x54, 0x72, 0x61, + 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0xf8, 0x01, 0x0a, 0x13, 0x46, 0x69, + 0x6c, 0x74, 0x65, 0x72, 0x65, 0x64, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x78, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x74, 0x78, 0x69, 0x64, 0x12, 0x26, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0e, 0x32, 0x12, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x48, 0x65, 0x61, + 0x64, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x46, 0x0a, + 0x12, 0x74, 0x78, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x63, + 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x73, 0x2e, 0x54, 0x78, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, + 0x6f, 0x64, 0x65, 0x52, 0x10, 0x74, 0x78, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x55, 0x0a, 0x13, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x46, 0x69, 0x6c, 0x74, + 0x65, 0x72, 0x65, 0x64, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x41, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x48, 0x00, 0x52, 0x12, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x42, 0x06, 0x0a, 0x04, + 0x44, 0x61, 0x74, 0x61, 0x22, 0x6a, 0x0a, 0x1a, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x65, 0x64, + 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x12, 0x4c, 0x0a, 0x11, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x5f, + 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x65, 0x64, 0x43, + 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x10, + 0x63, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x22, 0x5a, 0x0a, 0x17, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x65, 0x64, 0x43, 0x68, 0x61, 0x69, + 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3f, 0x0a, 0x0f, 0x63, + 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x5f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x43, 0x68, + 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x0e, 0x63, 0x68, + 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x22, 0xf2, 0x01, 0x0a, + 0x13, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x41, 0x6e, 0x64, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, + 0x44, 0x61, 0x74, 0x61, 0x12, 0x23, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x42, 0x6c, 0x6f, + 0x63, 0x6b, 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x59, 0x0a, 0x10, 0x70, 0x72, 0x69, + 0x76, 0x61, 0x74, 0x65, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x02, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x42, 0x6c, 0x6f, + 0x63, 0x6b, 0x41, 0x6e, 0x64, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x44, 0x61, 0x74, 0x61, + 0x2e, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x44, 0x61, 0x74, 0x61, 0x4d, 0x61, 0x70, 0x45, + 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0e, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x44, 0x61, 0x74, + 0x61, 0x4d, 0x61, 0x70, 0x1a, 0x5b, 0x0a, 0x13, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x44, + 0x61, 0x74, 0x61, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, + 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2e, 0x0a, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x72, + 0x77, 0x73, 0x65, 0x74, 0x2e, 0x54, 0x78, 0x50, 0x76, 0x74, 0x52, 0x65, 0x61, 0x64, 0x57, 0x72, + 0x69, 0x74, 0x65, 0x53, 0x65, 0x74, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, + 0x01, 0x22, 0xfe, 0x01, 0x0a, 0x0f, 0x44, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x28, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0e, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x53, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x48, 0x00, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, + 0x25, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, + 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x00, 0x52, + 0x05, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x3e, 0x0a, 0x0e, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, + 0x65, 0x64, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x65, 0x64, + 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x00, 0x52, 0x0d, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x65, + 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x52, 0x0a, 0x16, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, + 0x61, 0x6e, 0x64, 0x5f, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x5f, 0x64, 0x61, 0x74, 0x61, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, + 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x41, 0x6e, 0x64, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x44, + 0x61, 0x74, 0x61, 0x48, 0x00, 0x52, 0x13, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x41, 0x6e, 0x64, 0x50, + 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x44, 0x61, 0x74, 0x61, 0x42, 0x06, 0x0a, 0x04, 0x54, 0x79, + 0x70, 0x65, 0x32, 0xd4, 0x01, 0x0a, 0x07, 0x44, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x12, 0x3a, + 0x0a, 0x07, 0x44, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x12, 0x10, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, + 0x6f, 0x6e, 0x2e, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x1a, 0x17, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x12, 0x42, 0x0a, 0x0f, 0x44, 0x65, + 0x6c, 0x69, 0x76, 0x65, 0x72, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x65, 0x64, 0x12, 0x10, 0x2e, + 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x1a, + 0x17, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x12, 0x49, + 0x0a, 0x16, 0x44, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x57, 0x69, 0x74, 0x68, 0x50, 0x72, 0x69, + 0x76, 0x61, 0x74, 0x65, 0x44, 0x61, 0x74, 0x61, 0x12, 0x10, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, + 0x6e, 0x2e, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x1a, 0x17, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x42, 0x9d, 0x01, 0x0a, 0x22, 0x6f, 0x72, + 0x67, 0x2e, 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2e, 0x66, 0x61, + 0x62, 0x72, 0x69, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x70, 0x65, 0x65, 0x72, + 0x42, 0x0b, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, + 0x32, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x79, 0x70, 0x65, + 0x72, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2f, 0x66, 0x61, 0x62, 0x72, 0x69, 0x63, 0x2d, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2d, 0x67, 0x6f, 0x2d, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x70, + 0x65, 0x65, 0x72, 0xa2, 0x02, 0x03, 0x50, 0x58, 0x58, 0xaa, 0x02, 0x06, 0x50, 0x72, 0x6f, 0x74, + 0x6f, 0x73, 0xca, 0x02, 0x06, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0xe2, 0x02, 0x12, 0x50, 0x72, + 0x6f, 0x74, 0x6f, 0x73, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0xea, 0x02, 0x06, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, +} + +var ( + file_peer_events_proto_rawDescOnce sync.Once + file_peer_events_proto_rawDescData = file_peer_events_proto_rawDesc +) + +func file_peer_events_proto_rawDescGZIP() []byte { + file_peer_events_proto_rawDescOnce.Do(func() { + file_peer_events_proto_rawDescData = protoimpl.X.CompressGZIP(file_peer_events_proto_rawDescData) + }) + return file_peer_events_proto_rawDescData +} + +var file_peer_events_proto_msgTypes = make([]protoimpl.MessageInfo, 7) +var file_peer_events_proto_goTypes = []interface{}{ + (*FilteredBlock)(nil), // 0: protos.FilteredBlock + (*FilteredTransaction)(nil), // 1: protos.FilteredTransaction + (*FilteredTransactionActions)(nil), // 2: protos.FilteredTransactionActions + (*FilteredChaincodeAction)(nil), // 3: protos.FilteredChaincodeAction + (*BlockAndPrivateData)(nil), // 4: protos.BlockAndPrivateData + (*DeliverResponse)(nil), // 5: protos.DeliverResponse + nil, // 6: protos.BlockAndPrivateData.PrivateDataMapEntry + (common.HeaderType)(0), // 7: common.HeaderType + (TxValidationCode)(0), // 8: protos.TxValidationCode + (*ChaincodeEvent)(nil), // 9: protos.ChaincodeEvent + (*common.Block)(nil), // 10: common.Block + (common.Status)(0), // 11: common.Status + (*rwset.TxPvtReadWriteSet)(nil), // 12: rwset.TxPvtReadWriteSet + (*common.Envelope)(nil), // 13: common.Envelope +} +var file_peer_events_proto_depIdxs = []int32{ + 1, // 0: protos.FilteredBlock.filtered_transactions:type_name -> protos.FilteredTransaction + 7, // 1: protos.FilteredTransaction.type:type_name -> common.HeaderType + 8, // 2: protos.FilteredTransaction.tx_validation_code:type_name -> protos.TxValidationCode + 2, // 3: protos.FilteredTransaction.transaction_actions:type_name -> protos.FilteredTransactionActions + 3, // 4: protos.FilteredTransactionActions.chaincode_actions:type_name -> protos.FilteredChaincodeAction + 9, // 5: protos.FilteredChaincodeAction.chaincode_event:type_name -> protos.ChaincodeEvent + 10, // 6: protos.BlockAndPrivateData.block:type_name -> common.Block + 6, // 7: protos.BlockAndPrivateData.private_data_map:type_name -> protos.BlockAndPrivateData.PrivateDataMapEntry + 11, // 8: protos.DeliverResponse.status:type_name -> common.Status + 10, // 9: protos.DeliverResponse.block:type_name -> common.Block + 0, // 10: protos.DeliverResponse.filtered_block:type_name -> protos.FilteredBlock + 4, // 11: protos.DeliverResponse.block_and_private_data:type_name -> protos.BlockAndPrivateData + 12, // 12: protos.BlockAndPrivateData.PrivateDataMapEntry.value:type_name -> rwset.TxPvtReadWriteSet + 13, // 13: protos.Deliver.Deliver:input_type -> common.Envelope + 13, // 14: protos.Deliver.DeliverFiltered:input_type -> common.Envelope + 13, // 15: protos.Deliver.DeliverWithPrivateData:input_type -> common.Envelope + 5, // 16: protos.Deliver.Deliver:output_type -> protos.DeliverResponse + 5, // 17: protos.Deliver.DeliverFiltered:output_type -> protos.DeliverResponse + 5, // 18: protos.Deliver.DeliverWithPrivateData:output_type -> protos.DeliverResponse + 16, // [16:19] is the sub-list for method output_type + 13, // [13:16] is the sub-list for method input_type + 13, // [13:13] is the sub-list for extension type_name + 13, // [13:13] is the sub-list for extension extendee + 0, // [0:13] is the sub-list for field type_name +} + +func init() { file_peer_events_proto_init() } +func file_peer_events_proto_init() { + if File_peer_events_proto != nil { + return + } + file_peer_chaincode_event_proto_init() + file_peer_transaction_proto_init() + if !protoimpl.UnsafeEnabled { + file_peer_events_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FilteredBlock); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peer_events_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FilteredTransaction); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peer_events_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FilteredTransactionActions); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peer_events_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FilteredChaincodeAction); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peer_events_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BlockAndPrivateData); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peer_events_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeliverResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_peer_events_proto_msgTypes[1].OneofWrappers = []interface{}{ + (*FilteredTransaction_TransactionActions)(nil), + } + file_peer_events_proto_msgTypes[5].OneofWrappers = []interface{}{ + (*DeliverResponse_Status)(nil), + (*DeliverResponse_Block)(nil), + (*DeliverResponse_FilteredBlock)(nil), + (*DeliverResponse_BlockAndPrivateData)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_peer_events_proto_rawDesc, + NumEnums: 0, + NumMessages: 7, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_peer_events_proto_goTypes, + DependencyIndexes: file_peer_events_proto_depIdxs, + MessageInfos: file_peer_events_proto_msgTypes, + }.Build() + File_peer_events_proto = out.File + file_peer_events_proto_rawDesc = nil + file_peer_events_proto_goTypes = nil + file_peer_events_proto_depIdxs = nil +} diff --git a/vendor/github.com/hyperledger/fabric-protos-go-apiv2/peer/events_grpc.pb.go b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/peer/events_grpc.pb.go new file mode 100644 index 00000000000..4b4b09ce9fb --- /dev/null +++ b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/peer/events_grpc.pb.go @@ -0,0 +1,300 @@ +// Copyright the Hyperledger Fabric contributors. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: peer/events.proto + +package peer + +import ( + context "context" + common "github.com/hyperledger/fabric-protos-go-apiv2/common" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + Deliver_Deliver_FullMethodName = "/protos.Deliver/Deliver" + Deliver_DeliverFiltered_FullMethodName = "/protos.Deliver/DeliverFiltered" + Deliver_DeliverWithPrivateData_FullMethodName = "/protos.Deliver/DeliverWithPrivateData" +) + +// DeliverClient is the client API for Deliver service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type DeliverClient interface { + // Deliver first requires an Envelope of type ab.DELIVER_SEEK_INFO with + // Payload data as a marshaled orderer.SeekInfo message, + // then a stream of block replies is received + Deliver(ctx context.Context, opts ...grpc.CallOption) (Deliver_DeliverClient, error) + // DeliverFiltered first requires an Envelope of type ab.DELIVER_SEEK_INFO with + // Payload data as a marshaled orderer.SeekInfo message, + // then a stream of **filtered** block replies is received + DeliverFiltered(ctx context.Context, opts ...grpc.CallOption) (Deliver_DeliverFilteredClient, error) + // DeliverWithPrivateData first requires an Envelope of type ab.DELIVER_SEEK_INFO with + // Payload data as a marshaled orderer.SeekInfo message, + // then a stream of block and private data replies is received + DeliverWithPrivateData(ctx context.Context, opts ...grpc.CallOption) (Deliver_DeliverWithPrivateDataClient, error) +} + +type deliverClient struct { + cc grpc.ClientConnInterface +} + +func NewDeliverClient(cc grpc.ClientConnInterface) DeliverClient { + return &deliverClient{cc} +} + +func (c *deliverClient) Deliver(ctx context.Context, opts ...grpc.CallOption) (Deliver_DeliverClient, error) { + stream, err := c.cc.NewStream(ctx, &Deliver_ServiceDesc.Streams[0], Deliver_Deliver_FullMethodName, opts...) + if err != nil { + return nil, err + } + x := &deliverDeliverClient{stream} + return x, nil +} + +type Deliver_DeliverClient interface { + Send(*common.Envelope) error + Recv() (*DeliverResponse, error) + grpc.ClientStream +} + +type deliverDeliverClient struct { + grpc.ClientStream +} + +func (x *deliverDeliverClient) Send(m *common.Envelope) error { + return x.ClientStream.SendMsg(m) +} + +func (x *deliverDeliverClient) Recv() (*DeliverResponse, error) { + m := new(DeliverResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *deliverClient) DeliverFiltered(ctx context.Context, opts ...grpc.CallOption) (Deliver_DeliverFilteredClient, error) { + stream, err := c.cc.NewStream(ctx, &Deliver_ServiceDesc.Streams[1], Deliver_DeliverFiltered_FullMethodName, opts...) + if err != nil { + return nil, err + } + x := &deliverDeliverFilteredClient{stream} + return x, nil +} + +type Deliver_DeliverFilteredClient interface { + Send(*common.Envelope) error + Recv() (*DeliverResponse, error) + grpc.ClientStream +} + +type deliverDeliverFilteredClient struct { + grpc.ClientStream +} + +func (x *deliverDeliverFilteredClient) Send(m *common.Envelope) error { + return x.ClientStream.SendMsg(m) +} + +func (x *deliverDeliverFilteredClient) Recv() (*DeliverResponse, error) { + m := new(DeliverResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *deliverClient) DeliverWithPrivateData(ctx context.Context, opts ...grpc.CallOption) (Deliver_DeliverWithPrivateDataClient, error) { + stream, err := c.cc.NewStream(ctx, &Deliver_ServiceDesc.Streams[2], Deliver_DeliverWithPrivateData_FullMethodName, opts...) + if err != nil { + return nil, err + } + x := &deliverDeliverWithPrivateDataClient{stream} + return x, nil +} + +type Deliver_DeliverWithPrivateDataClient interface { + Send(*common.Envelope) error + Recv() (*DeliverResponse, error) + grpc.ClientStream +} + +type deliverDeliverWithPrivateDataClient struct { + grpc.ClientStream +} + +func (x *deliverDeliverWithPrivateDataClient) Send(m *common.Envelope) error { + return x.ClientStream.SendMsg(m) +} + +func (x *deliverDeliverWithPrivateDataClient) Recv() (*DeliverResponse, error) { + m := new(DeliverResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// DeliverServer is the server API for Deliver service. +// All implementations should embed UnimplementedDeliverServer +// for forward compatibility +type DeliverServer interface { + // Deliver first requires an Envelope of type ab.DELIVER_SEEK_INFO with + // Payload data as a marshaled orderer.SeekInfo message, + // then a stream of block replies is received + Deliver(Deliver_DeliverServer) error + // DeliverFiltered first requires an Envelope of type ab.DELIVER_SEEK_INFO with + // Payload data as a marshaled orderer.SeekInfo message, + // then a stream of **filtered** block replies is received + DeliverFiltered(Deliver_DeliverFilteredServer) error + // DeliverWithPrivateData first requires an Envelope of type ab.DELIVER_SEEK_INFO with + // Payload data as a marshaled orderer.SeekInfo message, + // then a stream of block and private data replies is received + DeliverWithPrivateData(Deliver_DeliverWithPrivateDataServer) error +} + +// UnimplementedDeliverServer should be embedded to have forward compatible implementations. +type UnimplementedDeliverServer struct { +} + +func (UnimplementedDeliverServer) Deliver(Deliver_DeliverServer) error { + return status.Errorf(codes.Unimplemented, "method Deliver not implemented") +} +func (UnimplementedDeliverServer) DeliverFiltered(Deliver_DeliverFilteredServer) error { + return status.Errorf(codes.Unimplemented, "method DeliverFiltered not implemented") +} +func (UnimplementedDeliverServer) DeliverWithPrivateData(Deliver_DeliverWithPrivateDataServer) error { + return status.Errorf(codes.Unimplemented, "method DeliverWithPrivateData not implemented") +} + +// UnsafeDeliverServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to DeliverServer will +// result in compilation errors. +type UnsafeDeliverServer interface { + mustEmbedUnimplementedDeliverServer() +} + +func RegisterDeliverServer(s grpc.ServiceRegistrar, srv DeliverServer) { + s.RegisterService(&Deliver_ServiceDesc, srv) +} + +func _Deliver_Deliver_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(DeliverServer).Deliver(&deliverDeliverServer{stream}) +} + +type Deliver_DeliverServer interface { + Send(*DeliverResponse) error + Recv() (*common.Envelope, error) + grpc.ServerStream +} + +type deliverDeliverServer struct { + grpc.ServerStream +} + +func (x *deliverDeliverServer) Send(m *DeliverResponse) error { + return x.ServerStream.SendMsg(m) +} + +func (x *deliverDeliverServer) Recv() (*common.Envelope, error) { + m := new(common.Envelope) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func _Deliver_DeliverFiltered_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(DeliverServer).DeliverFiltered(&deliverDeliverFilteredServer{stream}) +} + +type Deliver_DeliverFilteredServer interface { + Send(*DeliverResponse) error + Recv() (*common.Envelope, error) + grpc.ServerStream +} + +type deliverDeliverFilteredServer struct { + grpc.ServerStream +} + +func (x *deliverDeliverFilteredServer) Send(m *DeliverResponse) error { + return x.ServerStream.SendMsg(m) +} + +func (x *deliverDeliverFilteredServer) Recv() (*common.Envelope, error) { + m := new(common.Envelope) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func _Deliver_DeliverWithPrivateData_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(DeliverServer).DeliverWithPrivateData(&deliverDeliverWithPrivateDataServer{stream}) +} + +type Deliver_DeliverWithPrivateDataServer interface { + Send(*DeliverResponse) error + Recv() (*common.Envelope, error) + grpc.ServerStream +} + +type deliverDeliverWithPrivateDataServer struct { + grpc.ServerStream +} + +func (x *deliverDeliverWithPrivateDataServer) Send(m *DeliverResponse) error { + return x.ServerStream.SendMsg(m) +} + +func (x *deliverDeliverWithPrivateDataServer) Recv() (*common.Envelope, error) { + m := new(common.Envelope) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// Deliver_ServiceDesc is the grpc.ServiceDesc for Deliver service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Deliver_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "protos.Deliver", + HandlerType: (*DeliverServer)(nil), + Methods: []grpc.MethodDesc{}, + Streams: []grpc.StreamDesc{ + { + StreamName: "Deliver", + Handler: _Deliver_Deliver_Handler, + ServerStreams: true, + ClientStreams: true, + }, + { + StreamName: "DeliverFiltered", + Handler: _Deliver_DeliverFiltered_Handler, + ServerStreams: true, + ClientStreams: true, + }, + { + StreamName: "DeliverWithPrivateData", + Handler: _Deliver_DeliverWithPrivateData_Handler, + ServerStreams: true, + ClientStreams: true, + }, + }, + Metadata: "peer/events.proto", +} diff --git a/vendor/github.com/hyperledger/fabric-protos-go-apiv2/peer/lifecycle/chaincode_definition.pb.go b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/peer/lifecycle/chaincode_definition.pb.go new file mode 100644 index 00000000000..dc14e8fface --- /dev/null +++ b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/peer/lifecycle/chaincode_definition.pb.go @@ -0,0 +1,262 @@ +// Copyright the Hyperledger Fabric contributors. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: peer/lifecycle/chaincode_definition.proto + +package lifecycle + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// ChaincodeEndorsementInfo is (most) everything the peer needs to know in order +// to execute a chaincode +type ChaincodeEndorsementInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` + InitRequired bool `protobuf:"varint,2,opt,name=init_required,json=initRequired,proto3" json:"init_required,omitempty"` + EndorsementPlugin string `protobuf:"bytes,3,opt,name=endorsement_plugin,json=endorsementPlugin,proto3" json:"endorsement_plugin,omitempty"` +} + +func (x *ChaincodeEndorsementInfo) Reset() { + *x = ChaincodeEndorsementInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_lifecycle_chaincode_definition_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChaincodeEndorsementInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChaincodeEndorsementInfo) ProtoMessage() {} + +func (x *ChaincodeEndorsementInfo) ProtoReflect() protoreflect.Message { + mi := &file_peer_lifecycle_chaincode_definition_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ChaincodeEndorsementInfo.ProtoReflect.Descriptor instead. +func (*ChaincodeEndorsementInfo) Descriptor() ([]byte, []int) { + return file_peer_lifecycle_chaincode_definition_proto_rawDescGZIP(), []int{0} +} + +func (x *ChaincodeEndorsementInfo) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +func (x *ChaincodeEndorsementInfo) GetInitRequired() bool { + if x != nil { + return x.InitRequired + } + return false +} + +func (x *ChaincodeEndorsementInfo) GetEndorsementPlugin() string { + if x != nil { + return x.EndorsementPlugin + } + return "" +} + +// ValidationInfo is (most) everything the peer needs to know in order +// to validate a transaction +type ChaincodeValidationInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ValidationPlugin string `protobuf:"bytes,1,opt,name=validation_plugin,json=validationPlugin,proto3" json:"validation_plugin,omitempty"` + ValidationParameter []byte `protobuf:"bytes,2,opt,name=validation_parameter,json=validationParameter,proto3" json:"validation_parameter,omitempty"` +} + +func (x *ChaincodeValidationInfo) Reset() { + *x = ChaincodeValidationInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_lifecycle_chaincode_definition_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChaincodeValidationInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChaincodeValidationInfo) ProtoMessage() {} + +func (x *ChaincodeValidationInfo) ProtoReflect() protoreflect.Message { + mi := &file_peer_lifecycle_chaincode_definition_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ChaincodeValidationInfo.ProtoReflect.Descriptor instead. +func (*ChaincodeValidationInfo) Descriptor() ([]byte, []int) { + return file_peer_lifecycle_chaincode_definition_proto_rawDescGZIP(), []int{1} +} + +func (x *ChaincodeValidationInfo) GetValidationPlugin() string { + if x != nil { + return x.ValidationPlugin + } + return "" +} + +func (x *ChaincodeValidationInfo) GetValidationParameter() []byte { + if x != nil { + return x.ValidationParameter + } + return nil +} + +var File_peer_lifecycle_chaincode_definition_proto protoreflect.FileDescriptor + +var file_peer_lifecycle_chaincode_definition_proto_rawDesc = []byte{ + 0x0a, 0x29, 0x70, 0x65, 0x65, 0x72, 0x2f, 0x6c, 0x69, 0x66, 0x65, 0x63, 0x79, 0x63, 0x6c, 0x65, + 0x2f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x5f, 0x64, 0x65, 0x66, 0x69, 0x6e, + 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x09, 0x6c, 0x69, 0x66, + 0x65, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x22, 0x88, 0x01, 0x0a, 0x18, 0x43, 0x68, 0x61, 0x69, 0x6e, + 0x63, 0x6f, 0x64, 0x65, 0x45, 0x6e, 0x64, 0x6f, 0x72, 0x73, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x49, + 0x6e, 0x66, 0x6f, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x23, 0x0a, + 0x0d, 0x69, 0x6e, 0x69, 0x74, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x69, 0x6e, 0x69, 0x74, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, + 0x65, 0x64, 0x12, 0x2d, 0x0a, 0x12, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x73, 0x65, 0x6d, 0x65, 0x6e, + 0x74, 0x5f, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, + 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x73, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x50, 0x6c, 0x75, 0x67, 0x69, + 0x6e, 0x22, 0x79, 0x0a, 0x17, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x56, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x2b, 0x0a, 0x11, + 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x6c, 0x75, 0x67, 0x69, + 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x12, 0x31, 0x0a, 0x14, 0x76, 0x61, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, + 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x13, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x42, 0xca, 0x01, 0x0a, + 0x2c, 0x6f, 0x72, 0x67, 0x2e, 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, + 0x2e, 0x66, 0x61, 0x62, 0x72, 0x69, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x70, + 0x65, 0x65, 0x72, 0x2e, 0x6c, 0x69, 0x66, 0x65, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x42, 0x18, 0x43, + 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, + 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3c, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x65, 0x64, 0x67, 0x65, + 0x72, 0x2f, 0x66, 0x61, 0x62, 0x72, 0x69, 0x63, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2d, + 0x67, 0x6f, 0x2d, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x70, 0x65, 0x65, 0x72, 0x2f, 0x6c, 0x69, + 0x66, 0x65, 0x63, 0x79, 0x63, 0x6c, 0x65, 0xa2, 0x02, 0x03, 0x4c, 0x58, 0x58, 0xaa, 0x02, 0x09, + 0x4c, 0x69, 0x66, 0x65, 0x63, 0x79, 0x63, 0x6c, 0x65, 0xca, 0x02, 0x09, 0x4c, 0x69, 0x66, 0x65, + 0x63, 0x79, 0x63, 0x6c, 0x65, 0xe2, 0x02, 0x15, 0x4c, 0x69, 0x66, 0x65, 0x63, 0x79, 0x63, 0x6c, + 0x65, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x09, + 0x4c, 0x69, 0x66, 0x65, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, +} + +var ( + file_peer_lifecycle_chaincode_definition_proto_rawDescOnce sync.Once + file_peer_lifecycle_chaincode_definition_proto_rawDescData = file_peer_lifecycle_chaincode_definition_proto_rawDesc +) + +func file_peer_lifecycle_chaincode_definition_proto_rawDescGZIP() []byte { + file_peer_lifecycle_chaincode_definition_proto_rawDescOnce.Do(func() { + file_peer_lifecycle_chaincode_definition_proto_rawDescData = protoimpl.X.CompressGZIP(file_peer_lifecycle_chaincode_definition_proto_rawDescData) + }) + return file_peer_lifecycle_chaincode_definition_proto_rawDescData +} + +var file_peer_lifecycle_chaincode_definition_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_peer_lifecycle_chaincode_definition_proto_goTypes = []interface{}{ + (*ChaincodeEndorsementInfo)(nil), // 0: lifecycle.ChaincodeEndorsementInfo + (*ChaincodeValidationInfo)(nil), // 1: lifecycle.ChaincodeValidationInfo +} +var file_peer_lifecycle_chaincode_definition_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_peer_lifecycle_chaincode_definition_proto_init() } +func file_peer_lifecycle_chaincode_definition_proto_init() { + if File_peer_lifecycle_chaincode_definition_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_peer_lifecycle_chaincode_definition_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChaincodeEndorsementInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peer_lifecycle_chaincode_definition_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChaincodeValidationInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_peer_lifecycle_chaincode_definition_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_peer_lifecycle_chaincode_definition_proto_goTypes, + DependencyIndexes: file_peer_lifecycle_chaincode_definition_proto_depIdxs, + MessageInfos: file_peer_lifecycle_chaincode_definition_proto_msgTypes, + }.Build() + File_peer_lifecycle_chaincode_definition_proto = out.File + file_peer_lifecycle_chaincode_definition_proto_rawDesc = nil + file_peer_lifecycle_chaincode_definition_proto_goTypes = nil + file_peer_lifecycle_chaincode_definition_proto_depIdxs = nil +} diff --git a/vendor/github.com/hyperledger/fabric-protos-go-apiv2/peer/lifecycle/db.pb.go b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/peer/lifecycle/db.pb.go new file mode 100644 index 00000000000..bbe1a748449 --- /dev/null +++ b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/peer/lifecycle/db.pb.go @@ -0,0 +1,290 @@ +// Copyright the Hyperledger Fabric contributors. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: peer/lifecycle/db.proto + +package lifecycle + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// StateMetadata describes the keys in a namespace. It is necessary because +// in collections, range scans are not possible during transactions which +// write. Therefore we must track the keys in our namespace ourselves. +type StateMetadata struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Datatype string `protobuf:"bytes,1,opt,name=datatype,proto3" json:"datatype,omitempty"` + Fields []string `protobuf:"bytes,2,rep,name=fields,proto3" json:"fields,omitempty"` +} + +func (x *StateMetadata) Reset() { + *x = StateMetadata{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_lifecycle_db_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StateMetadata) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StateMetadata) ProtoMessage() {} + +func (x *StateMetadata) ProtoReflect() protoreflect.Message { + mi := &file_peer_lifecycle_db_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StateMetadata.ProtoReflect.Descriptor instead. +func (*StateMetadata) Descriptor() ([]byte, []int) { + return file_peer_lifecycle_db_proto_rawDescGZIP(), []int{0} +} + +func (x *StateMetadata) GetDatatype() string { + if x != nil { + return x.Datatype + } + return "" +} + +func (x *StateMetadata) GetFields() []string { + if x != nil { + return x.Fields + } + return nil +} + +// StateData encodes a particular field of a datatype +type StateData struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Type: + // + // *StateData_Int64 + // *StateData_Bytes + // *StateData_String_ + Type isStateData_Type `protobuf_oneof:"Type"` +} + +func (x *StateData) Reset() { + *x = StateData{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_lifecycle_db_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StateData) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StateData) ProtoMessage() {} + +func (x *StateData) ProtoReflect() protoreflect.Message { + mi := &file_peer_lifecycle_db_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StateData.ProtoReflect.Descriptor instead. +func (*StateData) Descriptor() ([]byte, []int) { + return file_peer_lifecycle_db_proto_rawDescGZIP(), []int{1} +} + +func (m *StateData) GetType() isStateData_Type { + if m != nil { + return m.Type + } + return nil +} + +func (x *StateData) GetInt64() int64 { + if x, ok := x.GetType().(*StateData_Int64); ok { + return x.Int64 + } + return 0 +} + +func (x *StateData) GetBytes() []byte { + if x, ok := x.GetType().(*StateData_Bytes); ok { + return x.Bytes + } + return nil +} + +func (x *StateData) GetString_() string { + if x, ok := x.GetType().(*StateData_String_); ok { + return x.String_ + } + return "" +} + +type isStateData_Type interface { + isStateData_Type() +} + +type StateData_Int64 struct { + Int64 int64 `protobuf:"varint,1,opt,name=Int64,proto3,oneof"` +} + +type StateData_Bytes struct { + Bytes []byte `protobuf:"bytes,2,opt,name=Bytes,proto3,oneof"` +} + +type StateData_String_ struct { + String_ string `protobuf:"bytes,3,opt,name=String,proto3,oneof"` +} + +func (*StateData_Int64) isStateData_Type() {} + +func (*StateData_Bytes) isStateData_Type() {} + +func (*StateData_String_) isStateData_Type() {} + +var File_peer_lifecycle_db_proto protoreflect.FileDescriptor + +var file_peer_lifecycle_db_proto_rawDesc = []byte{ + 0x0a, 0x17, 0x70, 0x65, 0x65, 0x72, 0x2f, 0x6c, 0x69, 0x66, 0x65, 0x63, 0x79, 0x63, 0x6c, 0x65, + 0x2f, 0x64, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x09, 0x6c, 0x69, 0x66, 0x65, 0x63, + 0x79, 0x63, 0x6c, 0x65, 0x22, 0x43, 0x0a, 0x0d, 0x53, 0x74, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x61, 0x74, 0x61, 0x74, 0x79, 0x70, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x64, 0x61, 0x74, 0x61, 0x74, 0x79, 0x70, + 0x65, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, + 0x09, 0x52, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x22, 0x5d, 0x0a, 0x09, 0x53, 0x74, 0x61, + 0x74, 0x65, 0x44, 0x61, 0x74, 0x61, 0x12, 0x16, 0x0a, 0x05, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, 0x05, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x12, 0x16, + 0x0a, 0x05, 0x42, 0x79, 0x74, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, + 0x05, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x18, 0x0a, 0x06, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x06, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x42, 0x06, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x42, 0xb9, 0x01, 0x0a, 0x2c, 0x6f, 0x72, 0x67, + 0x2e, 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2e, 0x66, 0x61, 0x62, + 0x72, 0x69, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x70, 0x65, 0x65, 0x72, 0x2e, + 0x6c, 0x69, 0x66, 0x65, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x42, 0x07, 0x44, 0x62, 0x50, 0x72, 0x6f, + 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2f, 0x66, 0x61, 0x62, + 0x72, 0x69, 0x63, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2d, 0x67, 0x6f, 0x2d, 0x61, 0x70, + 0x69, 0x76, 0x32, 0x2f, 0x70, 0x65, 0x65, 0x72, 0x2f, 0x6c, 0x69, 0x66, 0x65, 0x63, 0x79, 0x63, + 0x6c, 0x65, 0xa2, 0x02, 0x03, 0x4c, 0x58, 0x58, 0xaa, 0x02, 0x09, 0x4c, 0x69, 0x66, 0x65, 0x63, + 0x79, 0x63, 0x6c, 0x65, 0xca, 0x02, 0x09, 0x4c, 0x69, 0x66, 0x65, 0x63, 0x79, 0x63, 0x6c, 0x65, + 0xe2, 0x02, 0x15, 0x4c, 0x69, 0x66, 0x65, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x5c, 0x47, 0x50, 0x42, + 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x09, 0x4c, 0x69, 0x66, 0x65, 0x63, + 0x79, 0x63, 0x6c, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_peer_lifecycle_db_proto_rawDescOnce sync.Once + file_peer_lifecycle_db_proto_rawDescData = file_peer_lifecycle_db_proto_rawDesc +) + +func file_peer_lifecycle_db_proto_rawDescGZIP() []byte { + file_peer_lifecycle_db_proto_rawDescOnce.Do(func() { + file_peer_lifecycle_db_proto_rawDescData = protoimpl.X.CompressGZIP(file_peer_lifecycle_db_proto_rawDescData) + }) + return file_peer_lifecycle_db_proto_rawDescData +} + +var file_peer_lifecycle_db_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_peer_lifecycle_db_proto_goTypes = []interface{}{ + (*StateMetadata)(nil), // 0: lifecycle.StateMetadata + (*StateData)(nil), // 1: lifecycle.StateData +} +var file_peer_lifecycle_db_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_peer_lifecycle_db_proto_init() } +func file_peer_lifecycle_db_proto_init() { + if File_peer_lifecycle_db_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_peer_lifecycle_db_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StateMetadata); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peer_lifecycle_db_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StateData); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_peer_lifecycle_db_proto_msgTypes[1].OneofWrappers = []interface{}{ + (*StateData_Int64)(nil), + (*StateData_Bytes)(nil), + (*StateData_String_)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_peer_lifecycle_db_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_peer_lifecycle_db_proto_goTypes, + DependencyIndexes: file_peer_lifecycle_db_proto_depIdxs, + MessageInfos: file_peer_lifecycle_db_proto_msgTypes, + }.Build() + File_peer_lifecycle_db_proto = out.File + file_peer_lifecycle_db_proto_rawDesc = nil + file_peer_lifecycle_db_proto_goTypes = nil + file_peer_lifecycle_db_proto_depIdxs = nil +} diff --git a/vendor/github.com/hyperledger/fabric-protos-go-apiv2/peer/lifecycle/lifecycle.pb.go b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/peer/lifecycle/lifecycle.pb.go new file mode 100644 index 00000000000..af83baacd38 --- /dev/null +++ b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/peer/lifecycle/lifecycle.pb.go @@ -0,0 +1,2971 @@ +// Copyright the Hyperledger Fabric contributors. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: peer/lifecycle/lifecycle.proto + +package lifecycle + +import ( + peer "github.com/hyperledger/fabric-protos-go-apiv2/peer" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// InstallChaincodeArgs is the message used as the argument to +// '_lifecycle.InstallChaincode'. +type InstallChaincodeArgs struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ChaincodeInstallPackage []byte `protobuf:"bytes,1,opt,name=chaincode_install_package,json=chaincodeInstallPackage,proto3" json:"chaincode_install_package,omitempty"` // This should be a marshaled lifecycle.ChaincodePackage +} + +func (x *InstallChaincodeArgs) Reset() { + *x = InstallChaincodeArgs{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_lifecycle_lifecycle_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *InstallChaincodeArgs) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InstallChaincodeArgs) ProtoMessage() {} + +func (x *InstallChaincodeArgs) ProtoReflect() protoreflect.Message { + mi := &file_peer_lifecycle_lifecycle_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use InstallChaincodeArgs.ProtoReflect.Descriptor instead. +func (*InstallChaincodeArgs) Descriptor() ([]byte, []int) { + return file_peer_lifecycle_lifecycle_proto_rawDescGZIP(), []int{0} +} + +func (x *InstallChaincodeArgs) GetChaincodeInstallPackage() []byte { + if x != nil { + return x.ChaincodeInstallPackage + } + return nil +} + +// InstallChaincodeArgs is the message returned by +// '_lifecycle.InstallChaincode'. +type InstallChaincodeResult struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PackageId string `protobuf:"bytes,1,opt,name=package_id,json=packageId,proto3" json:"package_id,omitempty"` + Label string `protobuf:"bytes,2,opt,name=label,proto3" json:"label,omitempty"` +} + +func (x *InstallChaincodeResult) Reset() { + *x = InstallChaincodeResult{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_lifecycle_lifecycle_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *InstallChaincodeResult) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InstallChaincodeResult) ProtoMessage() {} + +func (x *InstallChaincodeResult) ProtoReflect() protoreflect.Message { + mi := &file_peer_lifecycle_lifecycle_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use InstallChaincodeResult.ProtoReflect.Descriptor instead. +func (*InstallChaincodeResult) Descriptor() ([]byte, []int) { + return file_peer_lifecycle_lifecycle_proto_rawDescGZIP(), []int{1} +} + +func (x *InstallChaincodeResult) GetPackageId() string { + if x != nil { + return x.PackageId + } + return "" +} + +func (x *InstallChaincodeResult) GetLabel() string { + if x != nil { + return x.Label + } + return "" +} + +// QueryInstalledChaincodeArgs is the message used as arguments +// '_lifecycle.QueryInstalledChaincode' +type QueryInstalledChaincodeArgs struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PackageId string `protobuf:"bytes,1,opt,name=package_id,json=packageId,proto3" json:"package_id,omitempty"` +} + +func (x *QueryInstalledChaincodeArgs) Reset() { + *x = QueryInstalledChaincodeArgs{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_lifecycle_lifecycle_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryInstalledChaincodeArgs) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryInstalledChaincodeArgs) ProtoMessage() {} + +func (x *QueryInstalledChaincodeArgs) ProtoReflect() protoreflect.Message { + mi := &file_peer_lifecycle_lifecycle_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use QueryInstalledChaincodeArgs.ProtoReflect.Descriptor instead. +func (*QueryInstalledChaincodeArgs) Descriptor() ([]byte, []int) { + return file_peer_lifecycle_lifecycle_proto_rawDescGZIP(), []int{2} +} + +func (x *QueryInstalledChaincodeArgs) GetPackageId() string { + if x != nil { + return x.PackageId + } + return "" +} + +// QueryInstalledChaincodeResult is the message returned by +// '_lifecycle.QueryInstalledChaincode' +type QueryInstalledChaincodeResult struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PackageId string `protobuf:"bytes,1,opt,name=package_id,json=packageId,proto3" json:"package_id,omitempty"` + Label string `protobuf:"bytes,2,opt,name=label,proto3" json:"label,omitempty"` + References map[string]*QueryInstalledChaincodeResult_References `protobuf:"bytes,3,rep,name=references,proto3" json:"references,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *QueryInstalledChaincodeResult) Reset() { + *x = QueryInstalledChaincodeResult{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_lifecycle_lifecycle_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryInstalledChaincodeResult) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryInstalledChaincodeResult) ProtoMessage() {} + +func (x *QueryInstalledChaincodeResult) ProtoReflect() protoreflect.Message { + mi := &file_peer_lifecycle_lifecycle_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use QueryInstalledChaincodeResult.ProtoReflect.Descriptor instead. +func (*QueryInstalledChaincodeResult) Descriptor() ([]byte, []int) { + return file_peer_lifecycle_lifecycle_proto_rawDescGZIP(), []int{3} +} + +func (x *QueryInstalledChaincodeResult) GetPackageId() string { + if x != nil { + return x.PackageId + } + return "" +} + +func (x *QueryInstalledChaincodeResult) GetLabel() string { + if x != nil { + return x.Label + } + return "" +} + +func (x *QueryInstalledChaincodeResult) GetReferences() map[string]*QueryInstalledChaincodeResult_References { + if x != nil { + return x.References + } + return nil +} + +// GetInstalledChaincodePackageArgs is the message used as the argument to +// '_lifecycle.GetInstalledChaincodePackage'. +type GetInstalledChaincodePackageArgs struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PackageId string `protobuf:"bytes,1,opt,name=package_id,json=packageId,proto3" json:"package_id,omitempty"` +} + +func (x *GetInstalledChaincodePackageArgs) Reset() { + *x = GetInstalledChaincodePackageArgs{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_lifecycle_lifecycle_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetInstalledChaincodePackageArgs) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetInstalledChaincodePackageArgs) ProtoMessage() {} + +func (x *GetInstalledChaincodePackageArgs) ProtoReflect() protoreflect.Message { + mi := &file_peer_lifecycle_lifecycle_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetInstalledChaincodePackageArgs.ProtoReflect.Descriptor instead. +func (*GetInstalledChaincodePackageArgs) Descriptor() ([]byte, []int) { + return file_peer_lifecycle_lifecycle_proto_rawDescGZIP(), []int{4} +} + +func (x *GetInstalledChaincodePackageArgs) GetPackageId() string { + if x != nil { + return x.PackageId + } + return "" +} + +// GetInstalledChaincodePackageResult is the message returned by +// '_lifecycle.GetInstalledChaincodePackage'. +type GetInstalledChaincodePackageResult struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ChaincodeInstallPackage []byte `protobuf:"bytes,1,opt,name=chaincode_install_package,json=chaincodeInstallPackage,proto3" json:"chaincode_install_package,omitempty"` +} + +func (x *GetInstalledChaincodePackageResult) Reset() { + *x = GetInstalledChaincodePackageResult{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_lifecycle_lifecycle_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetInstalledChaincodePackageResult) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetInstalledChaincodePackageResult) ProtoMessage() {} + +func (x *GetInstalledChaincodePackageResult) ProtoReflect() protoreflect.Message { + mi := &file_peer_lifecycle_lifecycle_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetInstalledChaincodePackageResult.ProtoReflect.Descriptor instead. +func (*GetInstalledChaincodePackageResult) Descriptor() ([]byte, []int) { + return file_peer_lifecycle_lifecycle_proto_rawDescGZIP(), []int{5} +} + +func (x *GetInstalledChaincodePackageResult) GetChaincodeInstallPackage() []byte { + if x != nil { + return x.ChaincodeInstallPackage + } + return nil +} + +// QueryInstalledChaincodesArgs currently is an empty argument to +// '_lifecycle.QueryInstalledChaincodes'. In the future, it may be +// extended to have parameters. +type QueryInstalledChaincodesArgs struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *QueryInstalledChaincodesArgs) Reset() { + *x = QueryInstalledChaincodesArgs{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_lifecycle_lifecycle_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryInstalledChaincodesArgs) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryInstalledChaincodesArgs) ProtoMessage() {} + +func (x *QueryInstalledChaincodesArgs) ProtoReflect() protoreflect.Message { + mi := &file_peer_lifecycle_lifecycle_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use QueryInstalledChaincodesArgs.ProtoReflect.Descriptor instead. +func (*QueryInstalledChaincodesArgs) Descriptor() ([]byte, []int) { + return file_peer_lifecycle_lifecycle_proto_rawDescGZIP(), []int{6} +} + +// QueryInstalledChaincodesResult is the message returned by +// '_lifecycle.QueryInstalledChaincodes'. It returns a list of installed +// chaincodes, including a map of channel name to chaincode name and version +// pairs of chaincode definitions that reference this chaincode package. +type QueryInstalledChaincodesResult struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + InstalledChaincodes []*QueryInstalledChaincodesResult_InstalledChaincode `protobuf:"bytes,1,rep,name=installed_chaincodes,json=installedChaincodes,proto3" json:"installed_chaincodes,omitempty"` +} + +func (x *QueryInstalledChaincodesResult) Reset() { + *x = QueryInstalledChaincodesResult{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_lifecycle_lifecycle_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryInstalledChaincodesResult) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryInstalledChaincodesResult) ProtoMessage() {} + +func (x *QueryInstalledChaincodesResult) ProtoReflect() protoreflect.Message { + mi := &file_peer_lifecycle_lifecycle_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use QueryInstalledChaincodesResult.ProtoReflect.Descriptor instead. +func (*QueryInstalledChaincodesResult) Descriptor() ([]byte, []int) { + return file_peer_lifecycle_lifecycle_proto_rawDescGZIP(), []int{7} +} + +func (x *QueryInstalledChaincodesResult) GetInstalledChaincodes() []*QueryInstalledChaincodesResult_InstalledChaincode { + if x != nil { + return x.InstalledChaincodes + } + return nil +} + +// ApproveChaincodeDefinitionForMyOrgArgs is the message used as arguments to +// `_lifecycle.ApproveChaincodeDefinitionForMyOrg`. +type ApproveChaincodeDefinitionForMyOrgArgs struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Sequence int64 `protobuf:"varint,1,opt,name=sequence,proto3" json:"sequence,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"` + EndorsementPlugin string `protobuf:"bytes,4,opt,name=endorsement_plugin,json=endorsementPlugin,proto3" json:"endorsement_plugin,omitempty"` + ValidationPlugin string `protobuf:"bytes,5,opt,name=validation_plugin,json=validationPlugin,proto3" json:"validation_plugin,omitempty"` + ValidationParameter []byte `protobuf:"bytes,6,opt,name=validation_parameter,json=validationParameter,proto3" json:"validation_parameter,omitempty"` + Collections *peer.CollectionConfigPackage `protobuf:"bytes,7,opt,name=collections,proto3" json:"collections,omitempty"` + InitRequired bool `protobuf:"varint,8,opt,name=init_required,json=initRequired,proto3" json:"init_required,omitempty"` + Source *ChaincodeSource `protobuf:"bytes,9,opt,name=source,proto3" json:"source,omitempty"` +} + +func (x *ApproveChaincodeDefinitionForMyOrgArgs) Reset() { + *x = ApproveChaincodeDefinitionForMyOrgArgs{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_lifecycle_lifecycle_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ApproveChaincodeDefinitionForMyOrgArgs) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ApproveChaincodeDefinitionForMyOrgArgs) ProtoMessage() {} + +func (x *ApproveChaincodeDefinitionForMyOrgArgs) ProtoReflect() protoreflect.Message { + mi := &file_peer_lifecycle_lifecycle_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ApproveChaincodeDefinitionForMyOrgArgs.ProtoReflect.Descriptor instead. +func (*ApproveChaincodeDefinitionForMyOrgArgs) Descriptor() ([]byte, []int) { + return file_peer_lifecycle_lifecycle_proto_rawDescGZIP(), []int{8} +} + +func (x *ApproveChaincodeDefinitionForMyOrgArgs) GetSequence() int64 { + if x != nil { + return x.Sequence + } + return 0 +} + +func (x *ApproveChaincodeDefinitionForMyOrgArgs) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *ApproveChaincodeDefinitionForMyOrgArgs) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +func (x *ApproveChaincodeDefinitionForMyOrgArgs) GetEndorsementPlugin() string { + if x != nil { + return x.EndorsementPlugin + } + return "" +} + +func (x *ApproveChaincodeDefinitionForMyOrgArgs) GetValidationPlugin() string { + if x != nil { + return x.ValidationPlugin + } + return "" +} + +func (x *ApproveChaincodeDefinitionForMyOrgArgs) GetValidationParameter() []byte { + if x != nil { + return x.ValidationParameter + } + return nil +} + +func (x *ApproveChaincodeDefinitionForMyOrgArgs) GetCollections() *peer.CollectionConfigPackage { + if x != nil { + return x.Collections + } + return nil +} + +func (x *ApproveChaincodeDefinitionForMyOrgArgs) GetInitRequired() bool { + if x != nil { + return x.InitRequired + } + return false +} + +func (x *ApproveChaincodeDefinitionForMyOrgArgs) GetSource() *ChaincodeSource { + if x != nil { + return x.Source + } + return nil +} + +type ChaincodeSource struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Type: + // + // *ChaincodeSource_Unavailable_ + // *ChaincodeSource_LocalPackage + Type isChaincodeSource_Type `protobuf_oneof:"Type"` +} + +func (x *ChaincodeSource) Reset() { + *x = ChaincodeSource{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_lifecycle_lifecycle_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChaincodeSource) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChaincodeSource) ProtoMessage() {} + +func (x *ChaincodeSource) ProtoReflect() protoreflect.Message { + mi := &file_peer_lifecycle_lifecycle_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ChaincodeSource.ProtoReflect.Descriptor instead. +func (*ChaincodeSource) Descriptor() ([]byte, []int) { + return file_peer_lifecycle_lifecycle_proto_rawDescGZIP(), []int{9} +} + +func (m *ChaincodeSource) GetType() isChaincodeSource_Type { + if m != nil { + return m.Type + } + return nil +} + +func (x *ChaincodeSource) GetUnavailable() *ChaincodeSource_Unavailable { + if x, ok := x.GetType().(*ChaincodeSource_Unavailable_); ok { + return x.Unavailable + } + return nil +} + +func (x *ChaincodeSource) GetLocalPackage() *ChaincodeSource_Local { + if x, ok := x.GetType().(*ChaincodeSource_LocalPackage); ok { + return x.LocalPackage + } + return nil +} + +type isChaincodeSource_Type interface { + isChaincodeSource_Type() +} + +type ChaincodeSource_Unavailable_ struct { + Unavailable *ChaincodeSource_Unavailable `protobuf:"bytes,1,opt,name=unavailable,proto3,oneof"` +} + +type ChaincodeSource_LocalPackage struct { + LocalPackage *ChaincodeSource_Local `protobuf:"bytes,2,opt,name=local_package,json=localPackage,proto3,oneof"` +} + +func (*ChaincodeSource_Unavailable_) isChaincodeSource_Type() {} + +func (*ChaincodeSource_LocalPackage) isChaincodeSource_Type() {} + +// ApproveChaincodeDefinitionForMyOrgResult is the message returned by +// `_lifecycle.ApproveChaincodeDefinitionForMyOrg`. Currently it returns +// nothing, but may be extended in the future. +type ApproveChaincodeDefinitionForMyOrgResult struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ApproveChaincodeDefinitionForMyOrgResult) Reset() { + *x = ApproveChaincodeDefinitionForMyOrgResult{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_lifecycle_lifecycle_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ApproveChaincodeDefinitionForMyOrgResult) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ApproveChaincodeDefinitionForMyOrgResult) ProtoMessage() {} + +func (x *ApproveChaincodeDefinitionForMyOrgResult) ProtoReflect() protoreflect.Message { + mi := &file_peer_lifecycle_lifecycle_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ApproveChaincodeDefinitionForMyOrgResult.ProtoReflect.Descriptor instead. +func (*ApproveChaincodeDefinitionForMyOrgResult) Descriptor() ([]byte, []int) { + return file_peer_lifecycle_lifecycle_proto_rawDescGZIP(), []int{10} +} + +// CommitChaincodeDefinitionArgs is the message used as arguments to +// `_lifecycle.CommitChaincodeDefinition`. +type CommitChaincodeDefinitionArgs struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Sequence int64 `protobuf:"varint,1,opt,name=sequence,proto3" json:"sequence,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"` + EndorsementPlugin string `protobuf:"bytes,4,opt,name=endorsement_plugin,json=endorsementPlugin,proto3" json:"endorsement_plugin,omitempty"` + ValidationPlugin string `protobuf:"bytes,5,opt,name=validation_plugin,json=validationPlugin,proto3" json:"validation_plugin,omitempty"` + ValidationParameter []byte `protobuf:"bytes,6,opt,name=validation_parameter,json=validationParameter,proto3" json:"validation_parameter,omitempty"` + Collections *peer.CollectionConfigPackage `protobuf:"bytes,7,opt,name=collections,proto3" json:"collections,omitempty"` + InitRequired bool `protobuf:"varint,8,opt,name=init_required,json=initRequired,proto3" json:"init_required,omitempty"` +} + +func (x *CommitChaincodeDefinitionArgs) Reset() { + *x = CommitChaincodeDefinitionArgs{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_lifecycle_lifecycle_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CommitChaincodeDefinitionArgs) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CommitChaincodeDefinitionArgs) ProtoMessage() {} + +func (x *CommitChaincodeDefinitionArgs) ProtoReflect() protoreflect.Message { + mi := &file_peer_lifecycle_lifecycle_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CommitChaincodeDefinitionArgs.ProtoReflect.Descriptor instead. +func (*CommitChaincodeDefinitionArgs) Descriptor() ([]byte, []int) { + return file_peer_lifecycle_lifecycle_proto_rawDescGZIP(), []int{11} +} + +func (x *CommitChaincodeDefinitionArgs) GetSequence() int64 { + if x != nil { + return x.Sequence + } + return 0 +} + +func (x *CommitChaincodeDefinitionArgs) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *CommitChaincodeDefinitionArgs) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +func (x *CommitChaincodeDefinitionArgs) GetEndorsementPlugin() string { + if x != nil { + return x.EndorsementPlugin + } + return "" +} + +func (x *CommitChaincodeDefinitionArgs) GetValidationPlugin() string { + if x != nil { + return x.ValidationPlugin + } + return "" +} + +func (x *CommitChaincodeDefinitionArgs) GetValidationParameter() []byte { + if x != nil { + return x.ValidationParameter + } + return nil +} + +func (x *CommitChaincodeDefinitionArgs) GetCollections() *peer.CollectionConfigPackage { + if x != nil { + return x.Collections + } + return nil +} + +func (x *CommitChaincodeDefinitionArgs) GetInitRequired() bool { + if x != nil { + return x.InitRequired + } + return false +} + +// CommitChaincodeDefinitionResult is the message returned by +// `_lifecycle.CommitChaincodeDefinition`. Currently it returns +// nothing, but may be extended in the future. +type CommitChaincodeDefinitionResult struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *CommitChaincodeDefinitionResult) Reset() { + *x = CommitChaincodeDefinitionResult{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_lifecycle_lifecycle_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CommitChaincodeDefinitionResult) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CommitChaincodeDefinitionResult) ProtoMessage() {} + +func (x *CommitChaincodeDefinitionResult) ProtoReflect() protoreflect.Message { + mi := &file_peer_lifecycle_lifecycle_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CommitChaincodeDefinitionResult.ProtoReflect.Descriptor instead. +func (*CommitChaincodeDefinitionResult) Descriptor() ([]byte, []int) { + return file_peer_lifecycle_lifecycle_proto_rawDescGZIP(), []int{12} +} + +// CheckCommitReadinessArgs is the message used as arguments to +// `_lifecycle.CheckCommitReadiness`. +type CheckCommitReadinessArgs struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Sequence int64 `protobuf:"varint,1,opt,name=sequence,proto3" json:"sequence,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"` + EndorsementPlugin string `protobuf:"bytes,4,opt,name=endorsement_plugin,json=endorsementPlugin,proto3" json:"endorsement_plugin,omitempty"` + ValidationPlugin string `protobuf:"bytes,5,opt,name=validation_plugin,json=validationPlugin,proto3" json:"validation_plugin,omitempty"` + ValidationParameter []byte `protobuf:"bytes,6,opt,name=validation_parameter,json=validationParameter,proto3" json:"validation_parameter,omitempty"` + Collections *peer.CollectionConfigPackage `protobuf:"bytes,7,opt,name=collections,proto3" json:"collections,omitempty"` + InitRequired bool `protobuf:"varint,8,opt,name=init_required,json=initRequired,proto3" json:"init_required,omitempty"` +} + +func (x *CheckCommitReadinessArgs) Reset() { + *x = CheckCommitReadinessArgs{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_lifecycle_lifecycle_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CheckCommitReadinessArgs) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CheckCommitReadinessArgs) ProtoMessage() {} + +func (x *CheckCommitReadinessArgs) ProtoReflect() protoreflect.Message { + mi := &file_peer_lifecycle_lifecycle_proto_msgTypes[13] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CheckCommitReadinessArgs.ProtoReflect.Descriptor instead. +func (*CheckCommitReadinessArgs) Descriptor() ([]byte, []int) { + return file_peer_lifecycle_lifecycle_proto_rawDescGZIP(), []int{13} +} + +func (x *CheckCommitReadinessArgs) GetSequence() int64 { + if x != nil { + return x.Sequence + } + return 0 +} + +func (x *CheckCommitReadinessArgs) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *CheckCommitReadinessArgs) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +func (x *CheckCommitReadinessArgs) GetEndorsementPlugin() string { + if x != nil { + return x.EndorsementPlugin + } + return "" +} + +func (x *CheckCommitReadinessArgs) GetValidationPlugin() string { + if x != nil { + return x.ValidationPlugin + } + return "" +} + +func (x *CheckCommitReadinessArgs) GetValidationParameter() []byte { + if x != nil { + return x.ValidationParameter + } + return nil +} + +func (x *CheckCommitReadinessArgs) GetCollections() *peer.CollectionConfigPackage { + if x != nil { + return x.Collections + } + return nil +} + +func (x *CheckCommitReadinessArgs) GetInitRequired() bool { + if x != nil { + return x.InitRequired + } + return false +} + +// CheckCommitReadinessResult is the message returned by +// `_lifecycle.CheckCommitReadiness`. It returns a map of +// orgs to their approval (true/false) for the definition +// supplied as args. Additionally, it returns a map of +// parameter mismatches between each organization's +// approved definition and the definition supplied as args. +type CheckCommitReadinessResult struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Approvals map[string]bool `protobuf:"bytes,1,rep,name=approvals,proto3" json:"approvals,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` + Mismatches map[string]*CheckCommitReadinessResult_Mismatches `protobuf:"bytes,2,rep,name=mismatches,proto3" json:"mismatches,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *CheckCommitReadinessResult) Reset() { + *x = CheckCommitReadinessResult{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_lifecycle_lifecycle_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CheckCommitReadinessResult) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CheckCommitReadinessResult) ProtoMessage() {} + +func (x *CheckCommitReadinessResult) ProtoReflect() protoreflect.Message { + mi := &file_peer_lifecycle_lifecycle_proto_msgTypes[14] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CheckCommitReadinessResult.ProtoReflect.Descriptor instead. +func (*CheckCommitReadinessResult) Descriptor() ([]byte, []int) { + return file_peer_lifecycle_lifecycle_proto_rawDescGZIP(), []int{14} +} + +func (x *CheckCommitReadinessResult) GetApprovals() map[string]bool { + if x != nil { + return x.Approvals + } + return nil +} + +func (x *CheckCommitReadinessResult) GetMismatches() map[string]*CheckCommitReadinessResult_Mismatches { + if x != nil { + return x.Mismatches + } + return nil +} + +// QueryApprovedChaincodeDefinitionArgs is the message used as arguments to +// `_lifecycle.QueryApprovedChaincodeDefinition`. +type QueryApprovedChaincodeDefinitionArgs struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Sequence int64 `protobuf:"varint,2,opt,name=sequence,proto3" json:"sequence,omitempty"` +} + +func (x *QueryApprovedChaincodeDefinitionArgs) Reset() { + *x = QueryApprovedChaincodeDefinitionArgs{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_lifecycle_lifecycle_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryApprovedChaincodeDefinitionArgs) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryApprovedChaincodeDefinitionArgs) ProtoMessage() {} + +func (x *QueryApprovedChaincodeDefinitionArgs) ProtoReflect() protoreflect.Message { + mi := &file_peer_lifecycle_lifecycle_proto_msgTypes[15] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use QueryApprovedChaincodeDefinitionArgs.ProtoReflect.Descriptor instead. +func (*QueryApprovedChaincodeDefinitionArgs) Descriptor() ([]byte, []int) { + return file_peer_lifecycle_lifecycle_proto_rawDescGZIP(), []int{15} +} + +func (x *QueryApprovedChaincodeDefinitionArgs) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *QueryApprovedChaincodeDefinitionArgs) GetSequence() int64 { + if x != nil { + return x.Sequence + } + return 0 +} + +// QueryApprovedChaincodeDefinitionResult is the message returned by +// `_lifecycle.QueryApprovedChaincodeDefinition`. +type QueryApprovedChaincodeDefinitionResult struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Sequence int64 `protobuf:"varint,1,opt,name=sequence,proto3" json:"sequence,omitempty"` + Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` + EndorsementPlugin string `protobuf:"bytes,3,opt,name=endorsement_plugin,json=endorsementPlugin,proto3" json:"endorsement_plugin,omitempty"` + ValidationPlugin string `protobuf:"bytes,4,opt,name=validation_plugin,json=validationPlugin,proto3" json:"validation_plugin,omitempty"` + ValidationParameter []byte `protobuf:"bytes,5,opt,name=validation_parameter,json=validationParameter,proto3" json:"validation_parameter,omitempty"` + Collections *peer.CollectionConfigPackage `protobuf:"bytes,6,opt,name=collections,proto3" json:"collections,omitempty"` + InitRequired bool `protobuf:"varint,7,opt,name=init_required,json=initRequired,proto3" json:"init_required,omitempty"` + Source *ChaincodeSource `protobuf:"bytes,8,opt,name=source,proto3" json:"source,omitempty"` +} + +func (x *QueryApprovedChaincodeDefinitionResult) Reset() { + *x = QueryApprovedChaincodeDefinitionResult{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_lifecycle_lifecycle_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryApprovedChaincodeDefinitionResult) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryApprovedChaincodeDefinitionResult) ProtoMessage() {} + +func (x *QueryApprovedChaincodeDefinitionResult) ProtoReflect() protoreflect.Message { + mi := &file_peer_lifecycle_lifecycle_proto_msgTypes[16] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use QueryApprovedChaincodeDefinitionResult.ProtoReflect.Descriptor instead. +func (*QueryApprovedChaincodeDefinitionResult) Descriptor() ([]byte, []int) { + return file_peer_lifecycle_lifecycle_proto_rawDescGZIP(), []int{16} +} + +func (x *QueryApprovedChaincodeDefinitionResult) GetSequence() int64 { + if x != nil { + return x.Sequence + } + return 0 +} + +func (x *QueryApprovedChaincodeDefinitionResult) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +func (x *QueryApprovedChaincodeDefinitionResult) GetEndorsementPlugin() string { + if x != nil { + return x.EndorsementPlugin + } + return "" +} + +func (x *QueryApprovedChaincodeDefinitionResult) GetValidationPlugin() string { + if x != nil { + return x.ValidationPlugin + } + return "" +} + +func (x *QueryApprovedChaincodeDefinitionResult) GetValidationParameter() []byte { + if x != nil { + return x.ValidationParameter + } + return nil +} + +func (x *QueryApprovedChaincodeDefinitionResult) GetCollections() *peer.CollectionConfigPackage { + if x != nil { + return x.Collections + } + return nil +} + +func (x *QueryApprovedChaincodeDefinitionResult) GetInitRequired() bool { + if x != nil { + return x.InitRequired + } + return false +} + +func (x *QueryApprovedChaincodeDefinitionResult) GetSource() *ChaincodeSource { + if x != nil { + return x.Source + } + return nil +} + +// QueryApprovedChaincodeDefinitionsArgs is the message used as arguments to +// `_lifecycle.QueryApprovedChaincodeDefinitions`. +type QueryApprovedChaincodeDefinitionsArgs struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *QueryApprovedChaincodeDefinitionsArgs) Reset() { + *x = QueryApprovedChaincodeDefinitionsArgs{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_lifecycle_lifecycle_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryApprovedChaincodeDefinitionsArgs) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryApprovedChaincodeDefinitionsArgs) ProtoMessage() {} + +func (x *QueryApprovedChaincodeDefinitionsArgs) ProtoReflect() protoreflect.Message { + mi := &file_peer_lifecycle_lifecycle_proto_msgTypes[17] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use QueryApprovedChaincodeDefinitionsArgs.ProtoReflect.Descriptor instead. +func (*QueryApprovedChaincodeDefinitionsArgs) Descriptor() ([]byte, []int) { + return file_peer_lifecycle_lifecycle_proto_rawDescGZIP(), []int{17} +} + +// QueryApprovedChaincodeDefinitionsResult is the message returned by +// `_lifecycle.QueryApprovedChaincodeDefinitions`. +type QueryApprovedChaincodeDefinitionsResult struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ApprovedChaincodeDefinitions []*QueryApprovedChaincodeDefinitionsResult_ApprovedChaincodeDefinition `protobuf:"bytes,1,rep,name=approved_chaincode_definitions,json=approvedChaincodeDefinitions,proto3" json:"approved_chaincode_definitions,omitempty"` +} + +func (x *QueryApprovedChaincodeDefinitionsResult) Reset() { + *x = QueryApprovedChaincodeDefinitionsResult{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_lifecycle_lifecycle_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryApprovedChaincodeDefinitionsResult) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryApprovedChaincodeDefinitionsResult) ProtoMessage() {} + +func (x *QueryApprovedChaincodeDefinitionsResult) ProtoReflect() protoreflect.Message { + mi := &file_peer_lifecycle_lifecycle_proto_msgTypes[18] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use QueryApprovedChaincodeDefinitionsResult.ProtoReflect.Descriptor instead. +func (*QueryApprovedChaincodeDefinitionsResult) Descriptor() ([]byte, []int) { + return file_peer_lifecycle_lifecycle_proto_rawDescGZIP(), []int{18} +} + +func (x *QueryApprovedChaincodeDefinitionsResult) GetApprovedChaincodeDefinitions() []*QueryApprovedChaincodeDefinitionsResult_ApprovedChaincodeDefinition { + if x != nil { + return x.ApprovedChaincodeDefinitions + } + return nil +} + +// QueryChaincodeDefinitionArgs is the message used as arguments to +// `_lifecycle.QueryChaincodeDefinition`. +type QueryChaincodeDefinitionArgs struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` +} + +func (x *QueryChaincodeDefinitionArgs) Reset() { + *x = QueryChaincodeDefinitionArgs{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_lifecycle_lifecycle_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryChaincodeDefinitionArgs) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryChaincodeDefinitionArgs) ProtoMessage() {} + +func (x *QueryChaincodeDefinitionArgs) ProtoReflect() protoreflect.Message { + mi := &file_peer_lifecycle_lifecycle_proto_msgTypes[19] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use QueryChaincodeDefinitionArgs.ProtoReflect.Descriptor instead. +func (*QueryChaincodeDefinitionArgs) Descriptor() ([]byte, []int) { + return file_peer_lifecycle_lifecycle_proto_rawDescGZIP(), []int{19} +} + +func (x *QueryChaincodeDefinitionArgs) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +// QueryChaincodeDefinitionResult is the message returned by +// `_lifecycle.QueryChaincodeDefinition`. +type QueryChaincodeDefinitionResult struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Sequence int64 `protobuf:"varint,1,opt,name=sequence,proto3" json:"sequence,omitempty"` + Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` + EndorsementPlugin string `protobuf:"bytes,3,opt,name=endorsement_plugin,json=endorsementPlugin,proto3" json:"endorsement_plugin,omitempty"` + ValidationPlugin string `protobuf:"bytes,4,opt,name=validation_plugin,json=validationPlugin,proto3" json:"validation_plugin,omitempty"` + ValidationParameter []byte `protobuf:"bytes,5,opt,name=validation_parameter,json=validationParameter,proto3" json:"validation_parameter,omitempty"` + Collections *peer.CollectionConfigPackage `protobuf:"bytes,6,opt,name=collections,proto3" json:"collections,omitempty"` + InitRequired bool `protobuf:"varint,7,opt,name=init_required,json=initRequired,proto3" json:"init_required,omitempty"` + Approvals map[string]bool `protobuf:"bytes,8,rep,name=approvals,proto3" json:"approvals,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` +} + +func (x *QueryChaincodeDefinitionResult) Reset() { + *x = QueryChaincodeDefinitionResult{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_lifecycle_lifecycle_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryChaincodeDefinitionResult) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryChaincodeDefinitionResult) ProtoMessage() {} + +func (x *QueryChaincodeDefinitionResult) ProtoReflect() protoreflect.Message { + mi := &file_peer_lifecycle_lifecycle_proto_msgTypes[20] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use QueryChaincodeDefinitionResult.ProtoReflect.Descriptor instead. +func (*QueryChaincodeDefinitionResult) Descriptor() ([]byte, []int) { + return file_peer_lifecycle_lifecycle_proto_rawDescGZIP(), []int{20} +} + +func (x *QueryChaincodeDefinitionResult) GetSequence() int64 { + if x != nil { + return x.Sequence + } + return 0 +} + +func (x *QueryChaincodeDefinitionResult) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +func (x *QueryChaincodeDefinitionResult) GetEndorsementPlugin() string { + if x != nil { + return x.EndorsementPlugin + } + return "" +} + +func (x *QueryChaincodeDefinitionResult) GetValidationPlugin() string { + if x != nil { + return x.ValidationPlugin + } + return "" +} + +func (x *QueryChaincodeDefinitionResult) GetValidationParameter() []byte { + if x != nil { + return x.ValidationParameter + } + return nil +} + +func (x *QueryChaincodeDefinitionResult) GetCollections() *peer.CollectionConfigPackage { + if x != nil { + return x.Collections + } + return nil +} + +func (x *QueryChaincodeDefinitionResult) GetInitRequired() bool { + if x != nil { + return x.InitRequired + } + return false +} + +func (x *QueryChaincodeDefinitionResult) GetApprovals() map[string]bool { + if x != nil { + return x.Approvals + } + return nil +} + +// QueryChaincodeDefinitionsArgs is the message used as arguments to +// `_lifecycle.QueryChaincodeDefinitions`. +type QueryChaincodeDefinitionsArgs struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *QueryChaincodeDefinitionsArgs) Reset() { + *x = QueryChaincodeDefinitionsArgs{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_lifecycle_lifecycle_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryChaincodeDefinitionsArgs) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryChaincodeDefinitionsArgs) ProtoMessage() {} + +func (x *QueryChaincodeDefinitionsArgs) ProtoReflect() protoreflect.Message { + mi := &file_peer_lifecycle_lifecycle_proto_msgTypes[21] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use QueryChaincodeDefinitionsArgs.ProtoReflect.Descriptor instead. +func (*QueryChaincodeDefinitionsArgs) Descriptor() ([]byte, []int) { + return file_peer_lifecycle_lifecycle_proto_rawDescGZIP(), []int{21} +} + +// QueryChaincodeDefinitionsResult is the message returned by +// `_lifecycle.QueryChaincodeDefinitions`. +type QueryChaincodeDefinitionsResult struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ChaincodeDefinitions []*QueryChaincodeDefinitionsResult_ChaincodeDefinition `protobuf:"bytes,1,rep,name=chaincode_definitions,json=chaincodeDefinitions,proto3" json:"chaincode_definitions,omitempty"` +} + +func (x *QueryChaincodeDefinitionsResult) Reset() { + *x = QueryChaincodeDefinitionsResult{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_lifecycle_lifecycle_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryChaincodeDefinitionsResult) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryChaincodeDefinitionsResult) ProtoMessage() {} + +func (x *QueryChaincodeDefinitionsResult) ProtoReflect() protoreflect.Message { + mi := &file_peer_lifecycle_lifecycle_proto_msgTypes[22] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use QueryChaincodeDefinitionsResult.ProtoReflect.Descriptor instead. +func (*QueryChaincodeDefinitionsResult) Descriptor() ([]byte, []int) { + return file_peer_lifecycle_lifecycle_proto_rawDescGZIP(), []int{22} +} + +func (x *QueryChaincodeDefinitionsResult) GetChaincodeDefinitions() []*QueryChaincodeDefinitionsResult_ChaincodeDefinition { + if x != nil { + return x.ChaincodeDefinitions + } + return nil +} + +type QueryInstalledChaincodeResult_References struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Chaincodes []*QueryInstalledChaincodeResult_Chaincode `protobuf:"bytes,1,rep,name=chaincodes,proto3" json:"chaincodes,omitempty"` +} + +func (x *QueryInstalledChaincodeResult_References) Reset() { + *x = QueryInstalledChaincodeResult_References{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_lifecycle_lifecycle_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryInstalledChaincodeResult_References) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryInstalledChaincodeResult_References) ProtoMessage() {} + +func (x *QueryInstalledChaincodeResult_References) ProtoReflect() protoreflect.Message { + mi := &file_peer_lifecycle_lifecycle_proto_msgTypes[24] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use QueryInstalledChaincodeResult_References.ProtoReflect.Descriptor instead. +func (*QueryInstalledChaincodeResult_References) Descriptor() ([]byte, []int) { + return file_peer_lifecycle_lifecycle_proto_rawDescGZIP(), []int{3, 1} +} + +func (x *QueryInstalledChaincodeResult_References) GetChaincodes() []*QueryInstalledChaincodeResult_Chaincode { + if x != nil { + return x.Chaincodes + } + return nil +} + +type QueryInstalledChaincodeResult_Chaincode struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` +} + +func (x *QueryInstalledChaincodeResult_Chaincode) Reset() { + *x = QueryInstalledChaincodeResult_Chaincode{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_lifecycle_lifecycle_proto_msgTypes[25] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryInstalledChaincodeResult_Chaincode) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryInstalledChaincodeResult_Chaincode) ProtoMessage() {} + +func (x *QueryInstalledChaincodeResult_Chaincode) ProtoReflect() protoreflect.Message { + mi := &file_peer_lifecycle_lifecycle_proto_msgTypes[25] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use QueryInstalledChaincodeResult_Chaincode.ProtoReflect.Descriptor instead. +func (*QueryInstalledChaincodeResult_Chaincode) Descriptor() ([]byte, []int) { + return file_peer_lifecycle_lifecycle_proto_rawDescGZIP(), []int{3, 2} +} + +func (x *QueryInstalledChaincodeResult_Chaincode) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *QueryInstalledChaincodeResult_Chaincode) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +type QueryInstalledChaincodesResult_InstalledChaincode struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PackageId string `protobuf:"bytes,1,opt,name=package_id,json=packageId,proto3" json:"package_id,omitempty"` + Label string `protobuf:"bytes,2,opt,name=label,proto3" json:"label,omitempty"` + References map[string]*QueryInstalledChaincodesResult_References `protobuf:"bytes,3,rep,name=references,proto3" json:"references,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *QueryInstalledChaincodesResult_InstalledChaincode) Reset() { + *x = QueryInstalledChaincodesResult_InstalledChaincode{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_lifecycle_lifecycle_proto_msgTypes[26] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryInstalledChaincodesResult_InstalledChaincode) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryInstalledChaincodesResult_InstalledChaincode) ProtoMessage() {} + +func (x *QueryInstalledChaincodesResult_InstalledChaincode) ProtoReflect() protoreflect.Message { + mi := &file_peer_lifecycle_lifecycle_proto_msgTypes[26] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use QueryInstalledChaincodesResult_InstalledChaincode.ProtoReflect.Descriptor instead. +func (*QueryInstalledChaincodesResult_InstalledChaincode) Descriptor() ([]byte, []int) { + return file_peer_lifecycle_lifecycle_proto_rawDescGZIP(), []int{7, 0} +} + +func (x *QueryInstalledChaincodesResult_InstalledChaincode) GetPackageId() string { + if x != nil { + return x.PackageId + } + return "" +} + +func (x *QueryInstalledChaincodesResult_InstalledChaincode) GetLabel() string { + if x != nil { + return x.Label + } + return "" +} + +func (x *QueryInstalledChaincodesResult_InstalledChaincode) GetReferences() map[string]*QueryInstalledChaincodesResult_References { + if x != nil { + return x.References + } + return nil +} + +type QueryInstalledChaincodesResult_References struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Chaincodes []*QueryInstalledChaincodesResult_Chaincode `protobuf:"bytes,1,rep,name=chaincodes,proto3" json:"chaincodes,omitempty"` +} + +func (x *QueryInstalledChaincodesResult_References) Reset() { + *x = QueryInstalledChaincodesResult_References{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_lifecycle_lifecycle_proto_msgTypes[27] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryInstalledChaincodesResult_References) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryInstalledChaincodesResult_References) ProtoMessage() {} + +func (x *QueryInstalledChaincodesResult_References) ProtoReflect() protoreflect.Message { + mi := &file_peer_lifecycle_lifecycle_proto_msgTypes[27] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use QueryInstalledChaincodesResult_References.ProtoReflect.Descriptor instead. +func (*QueryInstalledChaincodesResult_References) Descriptor() ([]byte, []int) { + return file_peer_lifecycle_lifecycle_proto_rawDescGZIP(), []int{7, 1} +} + +func (x *QueryInstalledChaincodesResult_References) GetChaincodes() []*QueryInstalledChaincodesResult_Chaincode { + if x != nil { + return x.Chaincodes + } + return nil +} + +type QueryInstalledChaincodesResult_Chaincode struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` +} + +func (x *QueryInstalledChaincodesResult_Chaincode) Reset() { + *x = QueryInstalledChaincodesResult_Chaincode{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_lifecycle_lifecycle_proto_msgTypes[28] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryInstalledChaincodesResult_Chaincode) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryInstalledChaincodesResult_Chaincode) ProtoMessage() {} + +func (x *QueryInstalledChaincodesResult_Chaincode) ProtoReflect() protoreflect.Message { + mi := &file_peer_lifecycle_lifecycle_proto_msgTypes[28] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use QueryInstalledChaincodesResult_Chaincode.ProtoReflect.Descriptor instead. +func (*QueryInstalledChaincodesResult_Chaincode) Descriptor() ([]byte, []int) { + return file_peer_lifecycle_lifecycle_proto_rawDescGZIP(), []int{7, 2} +} + +func (x *QueryInstalledChaincodesResult_Chaincode) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *QueryInstalledChaincodesResult_Chaincode) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +type ChaincodeSource_Unavailable struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ChaincodeSource_Unavailable) Reset() { + *x = ChaincodeSource_Unavailable{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_lifecycle_lifecycle_proto_msgTypes[30] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChaincodeSource_Unavailable) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChaincodeSource_Unavailable) ProtoMessage() {} + +func (x *ChaincodeSource_Unavailable) ProtoReflect() protoreflect.Message { + mi := &file_peer_lifecycle_lifecycle_proto_msgTypes[30] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ChaincodeSource_Unavailable.ProtoReflect.Descriptor instead. +func (*ChaincodeSource_Unavailable) Descriptor() ([]byte, []int) { + return file_peer_lifecycle_lifecycle_proto_rawDescGZIP(), []int{9, 0} +} + +type ChaincodeSource_Local struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PackageId string `protobuf:"bytes,1,opt,name=package_id,json=packageId,proto3" json:"package_id,omitempty"` +} + +func (x *ChaincodeSource_Local) Reset() { + *x = ChaincodeSource_Local{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_lifecycle_lifecycle_proto_msgTypes[31] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChaincodeSource_Local) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChaincodeSource_Local) ProtoMessage() {} + +func (x *ChaincodeSource_Local) ProtoReflect() protoreflect.Message { + mi := &file_peer_lifecycle_lifecycle_proto_msgTypes[31] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ChaincodeSource_Local.ProtoReflect.Descriptor instead. +func (*ChaincodeSource_Local) Descriptor() ([]byte, []int) { + return file_peer_lifecycle_lifecycle_proto_rawDescGZIP(), []int{9, 1} +} + +func (x *ChaincodeSource_Local) GetPackageId() string { + if x != nil { + return x.PackageId + } + return "" +} + +type CheckCommitReadinessResult_Mismatches struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Items []string `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"` +} + +func (x *CheckCommitReadinessResult_Mismatches) Reset() { + *x = CheckCommitReadinessResult_Mismatches{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_lifecycle_lifecycle_proto_msgTypes[33] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CheckCommitReadinessResult_Mismatches) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CheckCommitReadinessResult_Mismatches) ProtoMessage() {} + +func (x *CheckCommitReadinessResult_Mismatches) ProtoReflect() protoreflect.Message { + mi := &file_peer_lifecycle_lifecycle_proto_msgTypes[33] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CheckCommitReadinessResult_Mismatches.ProtoReflect.Descriptor instead. +func (*CheckCommitReadinessResult_Mismatches) Descriptor() ([]byte, []int) { + return file_peer_lifecycle_lifecycle_proto_rawDescGZIP(), []int{14, 1} +} + +func (x *CheckCommitReadinessResult_Mismatches) GetItems() []string { + if x != nil { + return x.Items + } + return nil +} + +type QueryApprovedChaincodeDefinitionsResult_ApprovedChaincodeDefinition struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Sequence int64 `protobuf:"varint,2,opt,name=sequence,proto3" json:"sequence,omitempty"` + Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"` + EndorsementPlugin string `protobuf:"bytes,4,opt,name=endorsement_plugin,json=endorsementPlugin,proto3" json:"endorsement_plugin,omitempty"` + ValidationPlugin string `protobuf:"bytes,5,opt,name=validation_plugin,json=validationPlugin,proto3" json:"validation_plugin,omitempty"` + ValidationParameter []byte `protobuf:"bytes,6,opt,name=validation_parameter,json=validationParameter,proto3" json:"validation_parameter,omitempty"` + Collections *peer.CollectionConfigPackage `protobuf:"bytes,7,opt,name=collections,proto3" json:"collections,omitempty"` + InitRequired bool `protobuf:"varint,8,opt,name=init_required,json=initRequired,proto3" json:"init_required,omitempty"` + Source *ChaincodeSource `protobuf:"bytes,9,opt,name=source,proto3" json:"source,omitempty"` +} + +func (x *QueryApprovedChaincodeDefinitionsResult_ApprovedChaincodeDefinition) Reset() { + *x = QueryApprovedChaincodeDefinitionsResult_ApprovedChaincodeDefinition{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_lifecycle_lifecycle_proto_msgTypes[35] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryApprovedChaincodeDefinitionsResult_ApprovedChaincodeDefinition) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryApprovedChaincodeDefinitionsResult_ApprovedChaincodeDefinition) ProtoMessage() {} + +func (x *QueryApprovedChaincodeDefinitionsResult_ApprovedChaincodeDefinition) ProtoReflect() protoreflect.Message { + mi := &file_peer_lifecycle_lifecycle_proto_msgTypes[35] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use QueryApprovedChaincodeDefinitionsResult_ApprovedChaincodeDefinition.ProtoReflect.Descriptor instead. +func (*QueryApprovedChaincodeDefinitionsResult_ApprovedChaincodeDefinition) Descriptor() ([]byte, []int) { + return file_peer_lifecycle_lifecycle_proto_rawDescGZIP(), []int{18, 0} +} + +func (x *QueryApprovedChaincodeDefinitionsResult_ApprovedChaincodeDefinition) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *QueryApprovedChaincodeDefinitionsResult_ApprovedChaincodeDefinition) GetSequence() int64 { + if x != nil { + return x.Sequence + } + return 0 +} + +func (x *QueryApprovedChaincodeDefinitionsResult_ApprovedChaincodeDefinition) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +func (x *QueryApprovedChaincodeDefinitionsResult_ApprovedChaincodeDefinition) GetEndorsementPlugin() string { + if x != nil { + return x.EndorsementPlugin + } + return "" +} + +func (x *QueryApprovedChaincodeDefinitionsResult_ApprovedChaincodeDefinition) GetValidationPlugin() string { + if x != nil { + return x.ValidationPlugin + } + return "" +} + +func (x *QueryApprovedChaincodeDefinitionsResult_ApprovedChaincodeDefinition) GetValidationParameter() []byte { + if x != nil { + return x.ValidationParameter + } + return nil +} + +func (x *QueryApprovedChaincodeDefinitionsResult_ApprovedChaincodeDefinition) GetCollections() *peer.CollectionConfigPackage { + if x != nil { + return x.Collections + } + return nil +} + +func (x *QueryApprovedChaincodeDefinitionsResult_ApprovedChaincodeDefinition) GetInitRequired() bool { + if x != nil { + return x.InitRequired + } + return false +} + +func (x *QueryApprovedChaincodeDefinitionsResult_ApprovedChaincodeDefinition) GetSource() *ChaincodeSource { + if x != nil { + return x.Source + } + return nil +} + +type QueryChaincodeDefinitionsResult_ChaincodeDefinition struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Sequence int64 `protobuf:"varint,2,opt,name=sequence,proto3" json:"sequence,omitempty"` + Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"` + EndorsementPlugin string `protobuf:"bytes,4,opt,name=endorsement_plugin,json=endorsementPlugin,proto3" json:"endorsement_plugin,omitempty"` + ValidationPlugin string `protobuf:"bytes,5,opt,name=validation_plugin,json=validationPlugin,proto3" json:"validation_plugin,omitempty"` + ValidationParameter []byte `protobuf:"bytes,6,opt,name=validation_parameter,json=validationParameter,proto3" json:"validation_parameter,omitempty"` + Collections *peer.CollectionConfigPackage `protobuf:"bytes,7,opt,name=collections,proto3" json:"collections,omitempty"` + InitRequired bool `protobuf:"varint,8,opt,name=init_required,json=initRequired,proto3" json:"init_required,omitempty"` +} + +func (x *QueryChaincodeDefinitionsResult_ChaincodeDefinition) Reset() { + *x = QueryChaincodeDefinitionsResult_ChaincodeDefinition{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_lifecycle_lifecycle_proto_msgTypes[37] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryChaincodeDefinitionsResult_ChaincodeDefinition) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryChaincodeDefinitionsResult_ChaincodeDefinition) ProtoMessage() {} + +func (x *QueryChaincodeDefinitionsResult_ChaincodeDefinition) ProtoReflect() protoreflect.Message { + mi := &file_peer_lifecycle_lifecycle_proto_msgTypes[37] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use QueryChaincodeDefinitionsResult_ChaincodeDefinition.ProtoReflect.Descriptor instead. +func (*QueryChaincodeDefinitionsResult_ChaincodeDefinition) Descriptor() ([]byte, []int) { + return file_peer_lifecycle_lifecycle_proto_rawDescGZIP(), []int{22, 0} +} + +func (x *QueryChaincodeDefinitionsResult_ChaincodeDefinition) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *QueryChaincodeDefinitionsResult_ChaincodeDefinition) GetSequence() int64 { + if x != nil { + return x.Sequence + } + return 0 +} + +func (x *QueryChaincodeDefinitionsResult_ChaincodeDefinition) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +func (x *QueryChaincodeDefinitionsResult_ChaincodeDefinition) GetEndorsementPlugin() string { + if x != nil { + return x.EndorsementPlugin + } + return "" +} + +func (x *QueryChaincodeDefinitionsResult_ChaincodeDefinition) GetValidationPlugin() string { + if x != nil { + return x.ValidationPlugin + } + return "" +} + +func (x *QueryChaincodeDefinitionsResult_ChaincodeDefinition) GetValidationParameter() []byte { + if x != nil { + return x.ValidationParameter + } + return nil +} + +func (x *QueryChaincodeDefinitionsResult_ChaincodeDefinition) GetCollections() *peer.CollectionConfigPackage { + if x != nil { + return x.Collections + } + return nil +} + +func (x *QueryChaincodeDefinitionsResult_ChaincodeDefinition) GetInitRequired() bool { + if x != nil { + return x.InitRequired + } + return false +} + +var File_peer_lifecycle_lifecycle_proto protoreflect.FileDescriptor + +var file_peer_lifecycle_lifecycle_proto_rawDesc = []byte{ + 0x0a, 0x1e, 0x70, 0x65, 0x65, 0x72, 0x2f, 0x6c, 0x69, 0x66, 0x65, 0x63, 0x79, 0x63, 0x6c, 0x65, + 0x2f, 0x6c, 0x69, 0x66, 0x65, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x12, 0x09, 0x6c, 0x69, 0x66, 0x65, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x1a, 0x15, 0x70, 0x65, 0x65, + 0x72, 0x2f, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x22, 0x52, 0x0a, 0x14, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x43, 0x68, 0x61, + 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x41, 0x72, 0x67, 0x73, 0x12, 0x3a, 0x0a, 0x19, 0x63, 0x68, + 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x5f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x5f, + 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x17, 0x63, + 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x50, + 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x22, 0x4d, 0x0a, 0x16, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, + 0x6c, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, + 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x49, 0x64, 0x12, + 0x14, 0x0a, 0x05, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x22, 0x3c, 0x0a, 0x1b, 0x51, 0x75, 0x65, 0x72, 0x79, 0x49, 0x6e, + 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, + 0x41, 0x72, 0x67, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, + 0x65, 0x49, 0x64, 0x22, 0xbf, 0x03, 0x0a, 0x1d, 0x51, 0x75, 0x65, 0x72, 0x79, 0x49, 0x6e, 0x73, + 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x52, + 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, + 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x63, 0x6b, 0x61, + 0x67, 0x65, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x12, 0x58, 0x0a, 0x0a, 0x72, 0x65, + 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x38, + 0x2e, 0x6c, 0x69, 0x66, 0x65, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, + 0x64, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, + 0x63, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, + 0x6e, 0x63, 0x65, 0x73, 0x1a, 0x72, 0x0a, 0x0f, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, + 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x49, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x6c, 0x69, 0x66, 0x65, 0x63, + 0x79, 0x63, 0x6c, 0x65, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, + 0x6c, 0x65, 0x64, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x75, + 0x6c, 0x74, 0x2e, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x60, 0x0a, 0x0a, 0x52, 0x65, 0x66, 0x65, + 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x52, 0x0a, 0x0a, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x63, + 0x6f, 0x64, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x6c, 0x69, 0x66, + 0x65, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x49, 0x6e, 0x73, 0x74, + 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x52, 0x65, + 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x52, 0x0a, + 0x63, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x73, 0x1a, 0x39, 0x0a, 0x09, 0x43, 0x68, + 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, + 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, + 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x41, 0x0a, 0x20, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x73, 0x74, + 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x50, 0x61, + 0x63, 0x6b, 0x61, 0x67, 0x65, 0x41, 0x72, 0x67, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x63, + 0x6b, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, + 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x49, 0x64, 0x22, 0x60, 0x0a, 0x22, 0x47, 0x65, 0x74, 0x49, + 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, + 0x65, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x3a, + 0x0a, 0x19, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x5f, 0x69, 0x6e, 0x73, 0x74, + 0x61, 0x6c, 0x6c, 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x17, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x73, 0x74, + 0x61, 0x6c, 0x6c, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x22, 0x1e, 0x0a, 0x1c, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x43, 0x68, 0x61, 0x69, + 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x73, 0x41, 0x72, 0x67, 0x73, 0x22, 0xde, 0x04, 0x0a, 0x1e, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x43, 0x68, 0x61, + 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x73, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x6f, 0x0a, + 0x14, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x5f, 0x63, 0x68, 0x61, 0x69, 0x6e, + 0x63, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3c, 0x2e, 0x6c, 0x69, + 0x66, 0x65, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x49, 0x6e, 0x73, + 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x73, + 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, + 0x43, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x52, 0x13, 0x69, 0x6e, 0x73, 0x74, 0x61, + 0x6c, 0x6c, 0x65, 0x64, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x73, 0x1a, 0xac, + 0x02, 0x0a, 0x12, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x43, 0x68, 0x61, 0x69, + 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, + 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x63, 0x6b, 0x61, + 0x67, 0x65, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x12, 0x6c, 0x0a, 0x0a, 0x72, 0x65, + 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x4c, + 0x2e, 0x6c, 0x69, 0x66, 0x65, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, + 0x64, 0x65, 0x73, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, + 0x6c, 0x65, 0x64, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x2e, 0x52, 0x65, 0x66, + 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, 0x72, 0x65, + 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x1a, 0x73, 0x0a, 0x0f, 0x52, 0x65, 0x66, 0x65, + 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, + 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x4a, 0x0a, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x6c, + 0x69, 0x66, 0x65, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x49, 0x6e, + 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, + 0x73, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, + 0x65, 0x73, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x61, 0x0a, + 0x0a, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x53, 0x0a, 0x0a, 0x63, + 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x33, 0x2e, 0x6c, 0x69, 0x66, 0x65, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x2e, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x63, + 0x6f, 0x64, 0x65, 0x73, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x43, 0x68, 0x61, 0x69, 0x6e, + 0x63, 0x6f, 0x64, 0x65, 0x52, 0x0a, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x73, + 0x1a, 0x39, 0x0a, 0x09, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x12, 0x0a, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x9d, 0x03, 0x0a, 0x26, + 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, + 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x6f, 0x72, 0x4d, 0x79, 0x4f, + 0x72, 0x67, 0x41, 0x72, 0x67, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, + 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, + 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, + 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, + 0x12, 0x2d, 0x0a, 0x12, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x73, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x5f, + 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x65, 0x6e, + 0x64, 0x6f, 0x72, 0x73, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x12, + 0x2b, 0x0a, 0x11, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x6c, + 0x75, 0x67, 0x69, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x76, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x12, 0x31, 0x0a, 0x14, + 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, + 0x65, 0x74, 0x65, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x13, 0x76, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x12, + 0x41, 0x0a, 0x0b, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x07, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x43, 0x6f, + 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x50, 0x61, + 0x63, 0x6b, 0x61, 0x67, 0x65, 0x52, 0x0b, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x69, 0x6e, 0x69, 0x74, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x69, + 0x72, 0x65, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x69, 0x6e, 0x69, 0x74, 0x52, + 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x12, 0x32, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6c, 0x69, 0x66, 0x65, 0x63, 0x79, + 0x63, 0x6c, 0x65, 0x2e, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x53, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x52, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x22, 0xe5, 0x01, 0x0a, 0x0f, + 0x43, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, + 0x4a, 0x0a, 0x0b, 0x75, 0x6e, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x6c, 0x69, 0x66, 0x65, 0x63, 0x79, 0x63, 0x6c, 0x65, + 0x2e, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x2e, 0x55, 0x6e, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x48, 0x00, 0x52, 0x0b, + 0x75, 0x6e, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x47, 0x0a, 0x0d, 0x6c, + 0x6f, 0x63, 0x61, 0x6c, 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x6c, 0x69, 0x66, 0x65, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x2e, 0x43, + 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x4c, + 0x6f, 0x63, 0x61, 0x6c, 0x48, 0x00, 0x52, 0x0c, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x50, 0x61, 0x63, + 0x6b, 0x61, 0x67, 0x65, 0x1a, 0x0d, 0x0a, 0x0b, 0x55, 0x6e, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, + 0x62, 0x6c, 0x65, 0x1a, 0x26, 0x0a, 0x05, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x12, 0x1d, 0x0a, 0x0a, + 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x09, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x49, 0x64, 0x42, 0x06, 0x0a, 0x04, 0x54, + 0x79, 0x70, 0x65, 0x22, 0x2a, 0x0a, 0x28, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x43, 0x68, + 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, + 0x6e, 0x46, 0x6f, 0x72, 0x4d, 0x79, 0x4f, 0x72, 0x67, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, + 0xe0, 0x02, 0x0a, 0x1d, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x63, + 0x6f, 0x64, 0x65, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x72, 0x67, + 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x12, 0x0a, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x2d, 0x0a, 0x12, 0x65, + 0x6e, 0x64, 0x6f, 0x72, 0x73, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x70, 0x6c, 0x75, 0x67, 0x69, + 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x73, 0x65, + 0x6d, 0x65, 0x6e, 0x74, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x12, 0x2b, 0x0a, 0x11, 0x76, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x12, 0x31, 0x0a, 0x14, 0x76, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x13, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x12, 0x41, 0x0a, 0x0b, 0x63, 0x6f, + 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, + 0x52, 0x0b, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x23, 0x0a, + 0x0d, 0x69, 0x6e, 0x69, 0x74, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x18, 0x08, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x69, 0x6e, 0x69, 0x74, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, + 0x65, 0x64, 0x22, 0x21, 0x0a, 0x1f, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x43, 0x68, 0x61, 0x69, + 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0xdb, 0x02, 0x0a, 0x18, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x43, + 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x61, 0x64, 0x69, 0x6e, 0x65, 0x73, 0x73, 0x41, 0x72, + 0x67, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x12, + 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x2d, 0x0a, 0x12, + 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x73, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x70, 0x6c, 0x75, 0x67, + 0x69, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x73, + 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x12, 0x2b, 0x0a, 0x11, 0x76, + 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x12, 0x31, 0x0a, 0x14, 0x76, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x13, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x12, 0x41, 0x0a, 0x0b, 0x63, + 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, + 0x65, 0x52, 0x0b, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x23, + 0x0a, 0x0d, 0x69, 0x6e, 0x69, 0x74, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x18, + 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x69, 0x6e, 0x69, 0x74, 0x52, 0x65, 0x71, 0x75, 0x69, + 0x72, 0x65, 0x64, 0x22, 0x9a, 0x03, 0x0a, 0x1a, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x43, 0x6f, 0x6d, + 0x6d, 0x69, 0x74, 0x52, 0x65, 0x61, 0x64, 0x69, 0x6e, 0x65, 0x73, 0x73, 0x52, 0x65, 0x73, 0x75, + 0x6c, 0x74, 0x12, 0x52, 0x0a, 0x09, 0x61, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x61, 0x6c, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x6c, 0x69, 0x66, 0x65, 0x63, 0x79, 0x63, 0x6c, + 0x65, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x61, + 0x64, 0x69, 0x6e, 0x65, 0x73, 0x73, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x41, 0x70, 0x70, + 0x72, 0x6f, 0x76, 0x61, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x09, 0x61, 0x70, 0x70, + 0x72, 0x6f, 0x76, 0x61, 0x6c, 0x73, 0x12, 0x55, 0x0a, 0x0a, 0x6d, 0x69, 0x73, 0x6d, 0x61, 0x74, + 0x63, 0x68, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x6c, 0x69, 0x66, + 0x65, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x43, 0x6f, 0x6d, 0x6d, + 0x69, 0x74, 0x52, 0x65, 0x61, 0x64, 0x69, 0x6e, 0x65, 0x73, 0x73, 0x52, 0x65, 0x73, 0x75, 0x6c, + 0x74, 0x2e, 0x4d, 0x69, 0x73, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x52, 0x0a, 0x6d, 0x69, 0x73, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x1a, 0x3c, 0x0a, + 0x0e, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x61, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, + 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, + 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x22, 0x0a, 0x0a, 0x4d, + 0x69, 0x73, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x74, 0x65, + 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x1a, + 0x6f, 0x0a, 0x0f, 0x4d, 0x69, 0x73, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x03, 0x6b, 0x65, 0x79, 0x12, 0x46, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x6c, 0x69, 0x66, 0x65, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x2e, + 0x43, 0x68, 0x65, 0x63, 0x6b, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x61, 0x64, 0x69, + 0x6e, 0x65, 0x73, 0x73, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x4d, 0x69, 0x73, 0x6d, 0x61, + 0x74, 0x63, 0x68, 0x65, 0x73, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, + 0x22, 0x56, 0x0a, 0x24, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, + 0x64, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, + 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x72, 0x67, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, + 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, + 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x22, 0x89, 0x03, 0x0a, 0x26, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x64, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x63, + 0x6f, 0x64, 0x65, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, + 0x75, 0x6c, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x12, + 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x2d, 0x0a, 0x12, 0x65, 0x6e, 0x64, + 0x6f, 0x72, 0x73, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x73, 0x65, 0x6d, 0x65, + 0x6e, 0x74, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x12, 0x2b, 0x0a, 0x11, 0x76, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x10, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, + 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x12, 0x31, 0x0a, 0x14, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x13, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x12, 0x41, 0x0a, 0x0b, 0x63, 0x6f, 0x6c, 0x6c, + 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x52, 0x0b, + 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x69, + 0x6e, 0x69, 0x74, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x18, 0x07, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x0c, 0x69, 0x6e, 0x69, 0x74, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, + 0x12, 0x32, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1a, 0x2e, 0x6c, 0x69, 0x66, 0x65, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x2e, 0x43, 0x68, 0x61, + 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x06, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x22, 0x27, 0x0a, 0x25, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x70, 0x70, + 0x72, 0x6f, 0x76, 0x65, 0x64, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x44, 0x65, + 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x41, 0x72, 0x67, 0x73, 0x22, 0xd5, 0x04, + 0x0a, 0x27, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x64, 0x43, + 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x94, 0x01, 0x0a, 0x1e, 0x61, 0x70, + 0x70, 0x72, 0x6f, 0x76, 0x65, 0x64, 0x5f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, + 0x5f, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x4e, 0x2e, 0x6c, 0x69, 0x66, 0x65, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x2e, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x64, 0x43, 0x68, 0x61, 0x69, + 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x64, 0x43, + 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x1c, 0x61, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x64, 0x43, 0x68, 0x61, 0x69, + 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x1a, 0x92, 0x03, 0x0a, 0x1b, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x64, 0x43, 0x68, 0x61, + 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, + 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, + 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x2d, 0x0a, 0x12, 0x65, 0x6e, + 0x64, 0x6f, 0x72, 0x73, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x73, 0x65, 0x6d, + 0x65, 0x6e, 0x74, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x12, 0x2b, 0x0a, 0x11, 0x76, 0x61, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x12, 0x31, 0x0a, 0x14, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x13, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x12, 0x41, 0x0a, 0x0b, 0x63, 0x6f, 0x6c, + 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x52, + 0x0b, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x23, 0x0a, 0x0d, + 0x69, 0x6e, 0x69, 0x74, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x18, 0x08, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x0c, 0x69, 0x6e, 0x69, 0x74, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, + 0x64, 0x12, 0x32, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1a, 0x2e, 0x6c, 0x69, 0x66, 0x65, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x2e, 0x43, 0x68, + 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x06, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x22, 0x32, 0x0a, 0x1c, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x68, + 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, + 0x6e, 0x41, 0x72, 0x67, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0xe3, 0x03, 0x0a, 0x1e, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x44, 0x65, 0x66, 0x69, + 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x1a, 0x0a, 0x08, + 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, + 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, + 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, + 0x6f, 0x6e, 0x12, 0x2d, 0x0a, 0x12, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x73, 0x65, 0x6d, 0x65, 0x6e, + 0x74, 0x5f, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, + 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x73, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x50, 0x6c, 0x75, 0x67, 0x69, + 0x6e, 0x12, 0x2b, 0x0a, 0x11, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, + 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x76, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x12, 0x31, + 0x0a, 0x14, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x61, 0x72, + 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x13, 0x76, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, + 0x72, 0x12, 0x41, 0x0a, 0x0b, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, + 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x52, 0x0b, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x69, 0x6e, 0x69, 0x74, 0x5f, 0x72, 0x65, 0x71, + 0x75, 0x69, 0x72, 0x65, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x69, 0x6e, 0x69, + 0x74, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x12, 0x56, 0x0a, 0x09, 0x61, 0x70, 0x70, + 0x72, 0x6f, 0x76, 0x61, 0x6c, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x6c, + 0x69, 0x66, 0x65, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x68, + 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x61, 0x6c, + 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x09, 0x61, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x61, 0x6c, + 0x73, 0x1a, 0x3c, 0x0a, 0x0e, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x61, 0x6c, 0x73, 0x45, 0x6e, + 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, + 0x1f, 0x0a, 0x1d, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, + 0x65, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x41, 0x72, 0x67, 0x73, + 0x22, 0xef, 0x03, 0x0a, 0x1f, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x63, + 0x6f, 0x64, 0x65, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, + 0x73, 0x75, 0x6c, 0x74, 0x12, 0x73, 0x0a, 0x15, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, + 0x65, 0x5f, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x3e, 0x2e, 0x6c, 0x69, 0x66, 0x65, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x2e, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x44, 0x65, + 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, + 0x43, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x14, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x44, 0x65, + 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0xd6, 0x02, 0x0a, 0x13, 0x43, 0x68, + 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, + 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x2d, 0x0a, 0x12, 0x65, + 0x6e, 0x64, 0x6f, 0x72, 0x73, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x70, 0x6c, 0x75, 0x67, 0x69, + 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x73, 0x65, + 0x6d, 0x65, 0x6e, 0x74, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x12, 0x2b, 0x0a, 0x11, 0x76, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x12, 0x31, 0x0a, 0x14, 0x76, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x13, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x12, 0x41, 0x0a, 0x0b, 0x63, 0x6f, + 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, + 0x52, 0x0b, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x23, 0x0a, + 0x0d, 0x69, 0x6e, 0x69, 0x74, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x18, 0x08, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x69, 0x6e, 0x69, 0x74, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, + 0x65, 0x64, 0x42, 0xc0, 0x01, 0x0a, 0x2c, 0x6f, 0x72, 0x67, 0x2e, 0x68, 0x79, 0x70, 0x65, 0x72, + 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2e, 0x66, 0x61, 0x62, 0x72, 0x69, 0x63, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x70, 0x65, 0x65, 0x72, 0x2e, 0x6c, 0x69, 0x66, 0x65, 0x63, 0x79, + 0x63, 0x6c, 0x65, 0x42, 0x0e, 0x4c, 0x69, 0x66, 0x65, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x50, 0x72, + 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2f, 0x66, 0x61, + 0x62, 0x72, 0x69, 0x63, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2d, 0x67, 0x6f, 0x2d, 0x61, + 0x70, 0x69, 0x76, 0x32, 0x2f, 0x70, 0x65, 0x65, 0x72, 0x2f, 0x6c, 0x69, 0x66, 0x65, 0x63, 0x79, + 0x63, 0x6c, 0x65, 0xa2, 0x02, 0x03, 0x4c, 0x58, 0x58, 0xaa, 0x02, 0x09, 0x4c, 0x69, 0x66, 0x65, + 0x63, 0x79, 0x63, 0x6c, 0x65, 0xca, 0x02, 0x09, 0x4c, 0x69, 0x66, 0x65, 0x63, 0x79, 0x63, 0x6c, + 0x65, 0xe2, 0x02, 0x15, 0x4c, 0x69, 0x66, 0x65, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x5c, 0x47, 0x50, + 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x09, 0x4c, 0x69, 0x66, 0x65, + 0x63, 0x79, 0x63, 0x6c, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_peer_lifecycle_lifecycle_proto_rawDescOnce sync.Once + file_peer_lifecycle_lifecycle_proto_rawDescData = file_peer_lifecycle_lifecycle_proto_rawDesc +) + +func file_peer_lifecycle_lifecycle_proto_rawDescGZIP() []byte { + file_peer_lifecycle_lifecycle_proto_rawDescOnce.Do(func() { + file_peer_lifecycle_lifecycle_proto_rawDescData = protoimpl.X.CompressGZIP(file_peer_lifecycle_lifecycle_proto_rawDescData) + }) + return file_peer_lifecycle_lifecycle_proto_rawDescData +} + +var file_peer_lifecycle_lifecycle_proto_msgTypes = make([]protoimpl.MessageInfo, 38) +var file_peer_lifecycle_lifecycle_proto_goTypes = []interface{}{ + (*InstallChaincodeArgs)(nil), // 0: lifecycle.InstallChaincodeArgs + (*InstallChaincodeResult)(nil), // 1: lifecycle.InstallChaincodeResult + (*QueryInstalledChaincodeArgs)(nil), // 2: lifecycle.QueryInstalledChaincodeArgs + (*QueryInstalledChaincodeResult)(nil), // 3: lifecycle.QueryInstalledChaincodeResult + (*GetInstalledChaincodePackageArgs)(nil), // 4: lifecycle.GetInstalledChaincodePackageArgs + (*GetInstalledChaincodePackageResult)(nil), // 5: lifecycle.GetInstalledChaincodePackageResult + (*QueryInstalledChaincodesArgs)(nil), // 6: lifecycle.QueryInstalledChaincodesArgs + (*QueryInstalledChaincodesResult)(nil), // 7: lifecycle.QueryInstalledChaincodesResult + (*ApproveChaincodeDefinitionForMyOrgArgs)(nil), // 8: lifecycle.ApproveChaincodeDefinitionForMyOrgArgs + (*ChaincodeSource)(nil), // 9: lifecycle.ChaincodeSource + (*ApproveChaincodeDefinitionForMyOrgResult)(nil), // 10: lifecycle.ApproveChaincodeDefinitionForMyOrgResult + (*CommitChaincodeDefinitionArgs)(nil), // 11: lifecycle.CommitChaincodeDefinitionArgs + (*CommitChaincodeDefinitionResult)(nil), // 12: lifecycle.CommitChaincodeDefinitionResult + (*CheckCommitReadinessArgs)(nil), // 13: lifecycle.CheckCommitReadinessArgs + (*CheckCommitReadinessResult)(nil), // 14: lifecycle.CheckCommitReadinessResult + (*QueryApprovedChaincodeDefinitionArgs)(nil), // 15: lifecycle.QueryApprovedChaincodeDefinitionArgs + (*QueryApprovedChaincodeDefinitionResult)(nil), // 16: lifecycle.QueryApprovedChaincodeDefinitionResult + (*QueryApprovedChaincodeDefinitionsArgs)(nil), // 17: lifecycle.QueryApprovedChaincodeDefinitionsArgs + (*QueryApprovedChaincodeDefinitionsResult)(nil), // 18: lifecycle.QueryApprovedChaincodeDefinitionsResult + (*QueryChaincodeDefinitionArgs)(nil), // 19: lifecycle.QueryChaincodeDefinitionArgs + (*QueryChaincodeDefinitionResult)(nil), // 20: lifecycle.QueryChaincodeDefinitionResult + (*QueryChaincodeDefinitionsArgs)(nil), // 21: lifecycle.QueryChaincodeDefinitionsArgs + (*QueryChaincodeDefinitionsResult)(nil), // 22: lifecycle.QueryChaincodeDefinitionsResult + nil, // 23: lifecycle.QueryInstalledChaincodeResult.ReferencesEntry + (*QueryInstalledChaincodeResult_References)(nil), // 24: lifecycle.QueryInstalledChaincodeResult.References + (*QueryInstalledChaincodeResult_Chaincode)(nil), // 25: lifecycle.QueryInstalledChaincodeResult.Chaincode + (*QueryInstalledChaincodesResult_InstalledChaincode)(nil), // 26: lifecycle.QueryInstalledChaincodesResult.InstalledChaincode + (*QueryInstalledChaincodesResult_References)(nil), // 27: lifecycle.QueryInstalledChaincodesResult.References + (*QueryInstalledChaincodesResult_Chaincode)(nil), // 28: lifecycle.QueryInstalledChaincodesResult.Chaincode + nil, // 29: lifecycle.QueryInstalledChaincodesResult.InstalledChaincode.ReferencesEntry + (*ChaincodeSource_Unavailable)(nil), // 30: lifecycle.ChaincodeSource.Unavailable + (*ChaincodeSource_Local)(nil), // 31: lifecycle.ChaincodeSource.Local + nil, // 32: lifecycle.CheckCommitReadinessResult.ApprovalsEntry + (*CheckCommitReadinessResult_Mismatches)(nil), // 33: lifecycle.CheckCommitReadinessResult.Mismatches + nil, // 34: lifecycle.CheckCommitReadinessResult.MismatchesEntry + (*QueryApprovedChaincodeDefinitionsResult_ApprovedChaincodeDefinition)(nil), // 35: lifecycle.QueryApprovedChaincodeDefinitionsResult.ApprovedChaincodeDefinition + nil, // 36: lifecycle.QueryChaincodeDefinitionResult.ApprovalsEntry + (*QueryChaincodeDefinitionsResult_ChaincodeDefinition)(nil), // 37: lifecycle.QueryChaincodeDefinitionsResult.ChaincodeDefinition + (*peer.CollectionConfigPackage)(nil), // 38: protos.CollectionConfigPackage +} +var file_peer_lifecycle_lifecycle_proto_depIdxs = []int32{ + 23, // 0: lifecycle.QueryInstalledChaincodeResult.references:type_name -> lifecycle.QueryInstalledChaincodeResult.ReferencesEntry + 26, // 1: lifecycle.QueryInstalledChaincodesResult.installed_chaincodes:type_name -> lifecycle.QueryInstalledChaincodesResult.InstalledChaincode + 38, // 2: lifecycle.ApproveChaincodeDefinitionForMyOrgArgs.collections:type_name -> protos.CollectionConfigPackage + 9, // 3: lifecycle.ApproveChaincodeDefinitionForMyOrgArgs.source:type_name -> lifecycle.ChaincodeSource + 30, // 4: lifecycle.ChaincodeSource.unavailable:type_name -> lifecycle.ChaincodeSource.Unavailable + 31, // 5: lifecycle.ChaincodeSource.local_package:type_name -> lifecycle.ChaincodeSource.Local + 38, // 6: lifecycle.CommitChaincodeDefinitionArgs.collections:type_name -> protos.CollectionConfigPackage + 38, // 7: lifecycle.CheckCommitReadinessArgs.collections:type_name -> protos.CollectionConfigPackage + 32, // 8: lifecycle.CheckCommitReadinessResult.approvals:type_name -> lifecycle.CheckCommitReadinessResult.ApprovalsEntry + 34, // 9: lifecycle.CheckCommitReadinessResult.mismatches:type_name -> lifecycle.CheckCommitReadinessResult.MismatchesEntry + 38, // 10: lifecycle.QueryApprovedChaincodeDefinitionResult.collections:type_name -> protos.CollectionConfigPackage + 9, // 11: lifecycle.QueryApprovedChaincodeDefinitionResult.source:type_name -> lifecycle.ChaincodeSource + 35, // 12: lifecycle.QueryApprovedChaincodeDefinitionsResult.approved_chaincode_definitions:type_name -> lifecycle.QueryApprovedChaincodeDefinitionsResult.ApprovedChaincodeDefinition + 38, // 13: lifecycle.QueryChaincodeDefinitionResult.collections:type_name -> protos.CollectionConfigPackage + 36, // 14: lifecycle.QueryChaincodeDefinitionResult.approvals:type_name -> lifecycle.QueryChaincodeDefinitionResult.ApprovalsEntry + 37, // 15: lifecycle.QueryChaincodeDefinitionsResult.chaincode_definitions:type_name -> lifecycle.QueryChaincodeDefinitionsResult.ChaincodeDefinition + 24, // 16: lifecycle.QueryInstalledChaincodeResult.ReferencesEntry.value:type_name -> lifecycle.QueryInstalledChaincodeResult.References + 25, // 17: lifecycle.QueryInstalledChaincodeResult.References.chaincodes:type_name -> lifecycle.QueryInstalledChaincodeResult.Chaincode + 29, // 18: lifecycle.QueryInstalledChaincodesResult.InstalledChaincode.references:type_name -> lifecycle.QueryInstalledChaincodesResult.InstalledChaincode.ReferencesEntry + 28, // 19: lifecycle.QueryInstalledChaincodesResult.References.chaincodes:type_name -> lifecycle.QueryInstalledChaincodesResult.Chaincode + 27, // 20: lifecycle.QueryInstalledChaincodesResult.InstalledChaincode.ReferencesEntry.value:type_name -> lifecycle.QueryInstalledChaincodesResult.References + 33, // 21: lifecycle.CheckCommitReadinessResult.MismatchesEntry.value:type_name -> lifecycle.CheckCommitReadinessResult.Mismatches + 38, // 22: lifecycle.QueryApprovedChaincodeDefinitionsResult.ApprovedChaincodeDefinition.collections:type_name -> protos.CollectionConfigPackage + 9, // 23: lifecycle.QueryApprovedChaincodeDefinitionsResult.ApprovedChaincodeDefinition.source:type_name -> lifecycle.ChaincodeSource + 38, // 24: lifecycle.QueryChaincodeDefinitionsResult.ChaincodeDefinition.collections:type_name -> protos.CollectionConfigPackage + 25, // [25:25] is the sub-list for method output_type + 25, // [25:25] is the sub-list for method input_type + 25, // [25:25] is the sub-list for extension type_name + 25, // [25:25] is the sub-list for extension extendee + 0, // [0:25] is the sub-list for field type_name +} + +func init() { file_peer_lifecycle_lifecycle_proto_init() } +func file_peer_lifecycle_lifecycle_proto_init() { + if File_peer_lifecycle_lifecycle_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_peer_lifecycle_lifecycle_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*InstallChaincodeArgs); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peer_lifecycle_lifecycle_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*InstallChaincodeResult); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peer_lifecycle_lifecycle_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryInstalledChaincodeArgs); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peer_lifecycle_lifecycle_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryInstalledChaincodeResult); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peer_lifecycle_lifecycle_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetInstalledChaincodePackageArgs); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peer_lifecycle_lifecycle_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetInstalledChaincodePackageResult); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peer_lifecycle_lifecycle_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryInstalledChaincodesArgs); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peer_lifecycle_lifecycle_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryInstalledChaincodesResult); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peer_lifecycle_lifecycle_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ApproveChaincodeDefinitionForMyOrgArgs); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peer_lifecycle_lifecycle_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChaincodeSource); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peer_lifecycle_lifecycle_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ApproveChaincodeDefinitionForMyOrgResult); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peer_lifecycle_lifecycle_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CommitChaincodeDefinitionArgs); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peer_lifecycle_lifecycle_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CommitChaincodeDefinitionResult); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peer_lifecycle_lifecycle_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CheckCommitReadinessArgs); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peer_lifecycle_lifecycle_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CheckCommitReadinessResult); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peer_lifecycle_lifecycle_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryApprovedChaincodeDefinitionArgs); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peer_lifecycle_lifecycle_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryApprovedChaincodeDefinitionResult); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peer_lifecycle_lifecycle_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryApprovedChaincodeDefinitionsArgs); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peer_lifecycle_lifecycle_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryApprovedChaincodeDefinitionsResult); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peer_lifecycle_lifecycle_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryChaincodeDefinitionArgs); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peer_lifecycle_lifecycle_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryChaincodeDefinitionResult); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peer_lifecycle_lifecycle_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryChaincodeDefinitionsArgs); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peer_lifecycle_lifecycle_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryChaincodeDefinitionsResult); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peer_lifecycle_lifecycle_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryInstalledChaincodeResult_References); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peer_lifecycle_lifecycle_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryInstalledChaincodeResult_Chaincode); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peer_lifecycle_lifecycle_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryInstalledChaincodesResult_InstalledChaincode); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peer_lifecycle_lifecycle_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryInstalledChaincodesResult_References); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peer_lifecycle_lifecycle_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryInstalledChaincodesResult_Chaincode); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peer_lifecycle_lifecycle_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChaincodeSource_Unavailable); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peer_lifecycle_lifecycle_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChaincodeSource_Local); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peer_lifecycle_lifecycle_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CheckCommitReadinessResult_Mismatches); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peer_lifecycle_lifecycle_proto_msgTypes[35].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryApprovedChaincodeDefinitionsResult_ApprovedChaincodeDefinition); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peer_lifecycle_lifecycle_proto_msgTypes[37].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryChaincodeDefinitionsResult_ChaincodeDefinition); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_peer_lifecycle_lifecycle_proto_msgTypes[9].OneofWrappers = []interface{}{ + (*ChaincodeSource_Unavailable_)(nil), + (*ChaincodeSource_LocalPackage)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_peer_lifecycle_lifecycle_proto_rawDesc, + NumEnums: 0, + NumMessages: 38, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_peer_lifecycle_lifecycle_proto_goTypes, + DependencyIndexes: file_peer_lifecycle_lifecycle_proto_depIdxs, + MessageInfos: file_peer_lifecycle_lifecycle_proto_msgTypes, + }.Build() + File_peer_lifecycle_lifecycle_proto = out.File + file_peer_lifecycle_lifecycle_proto_rawDesc = nil + file_peer_lifecycle_lifecycle_proto_goTypes = nil + file_peer_lifecycle_lifecycle_proto_depIdxs = nil +} diff --git a/vendor/github.com/hyperledger/fabric-protos-go-apiv2/peer/peer.pb.go b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/peer/peer.pb.go new file mode 100644 index 00000000000..b8172e6586f --- /dev/null +++ b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/peer/peer.pb.go @@ -0,0 +1,90 @@ +// Copyright the Hyperledger Fabric contributors. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: peer/peer.proto + +package peer + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +var File_peer_peer_proto protoreflect.FileDescriptor + +var file_peer_peer_proto_rawDesc = []byte{ + 0x0a, 0x0f, 0x70, 0x65, 0x65, 0x72, 0x2f, 0x70, 0x65, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x1a, 0x13, 0x70, 0x65, 0x65, 0x72, 0x2f, + 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, + 0x70, 0x65, 0x65, 0x72, 0x2f, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x72, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0x4f, 0x0a, 0x08, + 0x45, 0x6e, 0x64, 0x6f, 0x72, 0x73, 0x65, 0x72, 0x12, 0x43, 0x0a, 0x0f, 0x50, 0x72, 0x6f, 0x63, + 0x65, 0x73, 0x73, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x12, 0x16, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x50, 0x72, 0x6f, 0x70, 0x6f, + 0x73, 0x61, 0x6c, 0x1a, 0x18, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x50, 0x72, 0x6f, + 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x9b, 0x01, + 0x0a, 0x22, 0x6f, 0x72, 0x67, 0x2e, 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x65, 0x64, 0x67, 0x65, + 0x72, 0x2e, 0x66, 0x61, 0x62, 0x72, 0x69, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, + 0x70, 0x65, 0x65, 0x72, 0x42, 0x09, 0x50, 0x65, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, + 0x01, 0x5a, 0x32, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x79, + 0x70, 0x65, 0x72, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2f, 0x66, 0x61, 0x62, 0x72, 0x69, 0x63, + 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2d, 0x67, 0x6f, 0x2d, 0x61, 0x70, 0x69, 0x76, 0x32, + 0x2f, 0x70, 0x65, 0x65, 0x72, 0xa2, 0x02, 0x03, 0x50, 0x58, 0x58, 0xaa, 0x02, 0x06, 0x50, 0x72, + 0x6f, 0x74, 0x6f, 0x73, 0xca, 0x02, 0x06, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0xe2, 0x02, 0x12, + 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0xea, 0x02, 0x06, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, +} + +var file_peer_peer_proto_goTypes = []interface{}{ + (*SignedProposal)(nil), // 0: protos.SignedProposal + (*ProposalResponse)(nil), // 1: protos.ProposalResponse +} +var file_peer_peer_proto_depIdxs = []int32{ + 0, // 0: protos.Endorser.ProcessProposal:input_type -> protos.SignedProposal + 1, // 1: protos.Endorser.ProcessProposal:output_type -> protos.ProposalResponse + 1, // [1:2] is the sub-list for method output_type + 0, // [0:1] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_peer_peer_proto_init() } +func file_peer_peer_proto_init() { + if File_peer_peer_proto != nil { + return + } + file_peer_proposal_proto_init() + file_peer_proposal_response_proto_init() + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_peer_peer_proto_rawDesc, + NumEnums: 0, + NumMessages: 0, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_peer_peer_proto_goTypes, + DependencyIndexes: file_peer_peer_proto_depIdxs, + }.Build() + File_peer_peer_proto = out.File + file_peer_peer_proto_rawDesc = nil + file_peer_peer_proto_goTypes = nil + file_peer_peer_proto_depIdxs = nil +} diff --git a/vendor/github.com/hyperledger/fabric-protos-go-apiv2/peer/peer_grpc.pb.go b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/peer/peer_grpc.pb.go new file mode 100644 index 00000000000..f3fd5657084 --- /dev/null +++ b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/peer/peer_grpc.pb.go @@ -0,0 +1,111 @@ +// Copyright the Hyperledger Fabric contributors. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: peer/peer.proto + +package peer + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + Endorser_ProcessProposal_FullMethodName = "/protos.Endorser/ProcessProposal" +) + +// EndorserClient is the client API for Endorser service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type EndorserClient interface { + ProcessProposal(ctx context.Context, in *SignedProposal, opts ...grpc.CallOption) (*ProposalResponse, error) +} + +type endorserClient struct { + cc grpc.ClientConnInterface +} + +func NewEndorserClient(cc grpc.ClientConnInterface) EndorserClient { + return &endorserClient{cc} +} + +func (c *endorserClient) ProcessProposal(ctx context.Context, in *SignedProposal, opts ...grpc.CallOption) (*ProposalResponse, error) { + out := new(ProposalResponse) + err := c.cc.Invoke(ctx, Endorser_ProcessProposal_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// EndorserServer is the server API for Endorser service. +// All implementations should embed UnimplementedEndorserServer +// for forward compatibility +type EndorserServer interface { + ProcessProposal(context.Context, *SignedProposal) (*ProposalResponse, error) +} + +// UnimplementedEndorserServer should be embedded to have forward compatible implementations. +type UnimplementedEndorserServer struct { +} + +func (UnimplementedEndorserServer) ProcessProposal(context.Context, *SignedProposal) (*ProposalResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ProcessProposal not implemented") +} + +// UnsafeEndorserServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to EndorserServer will +// result in compilation errors. +type UnsafeEndorserServer interface { + mustEmbedUnimplementedEndorserServer() +} + +func RegisterEndorserServer(s grpc.ServiceRegistrar, srv EndorserServer) { + s.RegisterService(&Endorser_ServiceDesc, srv) +} + +func _Endorser_ProcessProposal_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SignedProposal) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(EndorserServer).ProcessProposal(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Endorser_ProcessProposal_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(EndorserServer).ProcessProposal(ctx, req.(*SignedProposal)) + } + return interceptor(ctx, in, info, handler) +} + +// Endorser_ServiceDesc is the grpc.ServiceDesc for Endorser service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Endorser_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "protos.Endorser", + HandlerType: (*EndorserServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ProcessProposal", + Handler: _Endorser_ProcessProposal_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "peer/peer.proto", +} diff --git a/vendor/github.com/hyperledger/fabric-protos-go-apiv2/peer/policy.pb.go b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/peer/policy.pb.go new file mode 100644 index 00000000000..38a220f5550 --- /dev/null +++ b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/peer/policy.pb.go @@ -0,0 +1,214 @@ +// Copyright the Hyperledger Fabric contributors. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: peer/policy.proto + +package peer + +import ( + common "github.com/hyperledger/fabric-protos-go-apiv2/common" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// ApplicationPolicy captures the diffenrent policy types that +// are set and evaluted at the application level. +type ApplicationPolicy struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Type: + // + // *ApplicationPolicy_SignaturePolicy + // *ApplicationPolicy_ChannelConfigPolicyReference + Type isApplicationPolicy_Type `protobuf_oneof:"Type"` +} + +func (x *ApplicationPolicy) Reset() { + *x = ApplicationPolicy{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_policy_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ApplicationPolicy) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ApplicationPolicy) ProtoMessage() {} + +func (x *ApplicationPolicy) ProtoReflect() protoreflect.Message { + mi := &file_peer_policy_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ApplicationPolicy.ProtoReflect.Descriptor instead. +func (*ApplicationPolicy) Descriptor() ([]byte, []int) { + return file_peer_policy_proto_rawDescGZIP(), []int{0} +} + +func (m *ApplicationPolicy) GetType() isApplicationPolicy_Type { + if m != nil { + return m.Type + } + return nil +} + +func (x *ApplicationPolicy) GetSignaturePolicy() *common.SignaturePolicyEnvelope { + if x, ok := x.GetType().(*ApplicationPolicy_SignaturePolicy); ok { + return x.SignaturePolicy + } + return nil +} + +func (x *ApplicationPolicy) GetChannelConfigPolicyReference() string { + if x, ok := x.GetType().(*ApplicationPolicy_ChannelConfigPolicyReference); ok { + return x.ChannelConfigPolicyReference + } + return "" +} + +type isApplicationPolicy_Type interface { + isApplicationPolicy_Type() +} + +type ApplicationPolicy_SignaturePolicy struct { + // SignaturePolicy type is used if the policy is specified as + // a combination (using threshold gates) of signatures from MSP + // principals + SignaturePolicy *common.SignaturePolicyEnvelope `protobuf:"bytes,1,opt,name=signature_policy,json=signaturePolicy,proto3,oneof"` +} + +type ApplicationPolicy_ChannelConfigPolicyReference struct { + // ChannelConfigPolicyReference is used when the policy is + // specified as a string that references a policy defined in + // the configuration of the channel + ChannelConfigPolicyReference string `protobuf:"bytes,2,opt,name=channel_config_policy_reference,json=channelConfigPolicyReference,proto3,oneof"` +} + +func (*ApplicationPolicy_SignaturePolicy) isApplicationPolicy_Type() {} + +func (*ApplicationPolicy_ChannelConfigPolicyReference) isApplicationPolicy_Type() {} + +var File_peer_policy_proto protoreflect.FileDescriptor + +var file_peer_policy_proto_rawDesc = []byte{ + 0x0a, 0x11, 0x70, 0x65, 0x65, 0x72, 0x2f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x1a, 0x15, 0x63, 0x6f, 0x6d, + 0x6d, 0x6f, 0x6e, 0x2f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x22, 0xb2, 0x01, 0x0a, 0x11, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x4c, 0x0a, 0x10, 0x73, 0x69, 0x67, 0x6e, + 0x61, 0x74, 0x75, 0x72, 0x65, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x53, 0x69, 0x67, 0x6e, + 0x61, 0x74, 0x75, 0x72, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x45, 0x6e, 0x76, 0x65, 0x6c, + 0x6f, 0x70, 0x65, 0x48, 0x00, 0x52, 0x0f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, + 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x47, 0x0a, 0x1f, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, + 0x6c, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x5f, + 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, + 0x00, 0x52, 0x1c, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x42, + 0x06, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x42, 0x9d, 0x01, 0x0a, 0x22, 0x6f, 0x72, 0x67, 0x2e, + 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2e, 0x66, 0x61, 0x62, 0x72, + 0x69, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x70, 0x65, 0x65, 0x72, 0x42, 0x0b, + 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x32, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, + 0x65, 0x64, 0x67, 0x65, 0x72, 0x2f, 0x66, 0x61, 0x62, 0x72, 0x69, 0x63, 0x2d, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x73, 0x2d, 0x67, 0x6f, 0x2d, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x70, 0x65, 0x65, + 0x72, 0xa2, 0x02, 0x03, 0x50, 0x58, 0x58, 0xaa, 0x02, 0x06, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x73, + 0xca, 0x02, 0x06, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0xe2, 0x02, 0x12, 0x50, 0x72, 0x6f, 0x74, + 0x6f, 0x73, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, + 0x06, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_peer_policy_proto_rawDescOnce sync.Once + file_peer_policy_proto_rawDescData = file_peer_policy_proto_rawDesc +) + +func file_peer_policy_proto_rawDescGZIP() []byte { + file_peer_policy_proto_rawDescOnce.Do(func() { + file_peer_policy_proto_rawDescData = protoimpl.X.CompressGZIP(file_peer_policy_proto_rawDescData) + }) + return file_peer_policy_proto_rawDescData +} + +var file_peer_policy_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_peer_policy_proto_goTypes = []interface{}{ + (*ApplicationPolicy)(nil), // 0: protos.ApplicationPolicy + (*common.SignaturePolicyEnvelope)(nil), // 1: common.SignaturePolicyEnvelope +} +var file_peer_policy_proto_depIdxs = []int32{ + 1, // 0: protos.ApplicationPolicy.signature_policy:type_name -> common.SignaturePolicyEnvelope + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_peer_policy_proto_init() } +func file_peer_policy_proto_init() { + if File_peer_policy_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_peer_policy_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ApplicationPolicy); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_peer_policy_proto_msgTypes[0].OneofWrappers = []interface{}{ + (*ApplicationPolicy_SignaturePolicy)(nil), + (*ApplicationPolicy_ChannelConfigPolicyReference)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_peer_policy_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_peer_policy_proto_goTypes, + DependencyIndexes: file_peer_policy_proto_depIdxs, + MessageInfos: file_peer_policy_proto_msgTypes, + }.Build() + File_peer_policy_proto = out.File + file_peer_policy_proto_rawDesc = nil + file_peer_policy_proto_goTypes = nil + file_peer_policy_proto_depIdxs = nil +} diff --git a/vendor/github.com/hyperledger/fabric-protos-go-apiv2/peer/proposal.pb.go b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/peer/proposal.pb.go new file mode 100644 index 00000000000..c737a9da2e7 --- /dev/null +++ b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/peer/proposal.pb.go @@ -0,0 +1,582 @@ +// Copyright the Hyperledger Fabric contributors. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: peer/proposal.proto + +package peer + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// This structure is necessary to sign the proposal which contains the header +// and the payload. Without this structure, we would have to concatenate the +// header and the payload to verify the signature, which could be expensive +// with large payload +// +// When an endorser receives a SignedProposal message, it should verify the +// signature over the proposal bytes. This verification requires the following +// steps: +// 1. Verification of the validity of the certificate that was used to produce +// the signature. The certificate will be available once proposalBytes has +// been unmarshalled to a Proposal message, and Proposal.header has been +// unmarshalled to a Header message. While this unmarshalling-before-verifying +// might not be ideal, it is unavoidable because i) the signature needs to also +// protect the signing certificate; ii) it is desirable that Header is created +// once by the client and never changed (for the sake of accountability and +// non-repudiation). Note also that it is actually impossible to conclusively +// verify the validity of the certificate included in a Proposal, because the +// proposal needs to first be endorsed and ordered with respect to certificate +// expiration transactions. Still, it is useful to pre-filter expired +// certificates at this stage. +// 2. Verification that the certificate is trusted (signed by a trusted CA) and +// that it is allowed to transact with us (with respect to some ACLs); +// 3. Verification that the signature on proposalBytes is valid; +// 4. Detect replay attacks; +type SignedProposal struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The bytes of Proposal + ProposalBytes []byte `protobuf:"bytes,1,opt,name=proposal_bytes,json=proposalBytes,proto3" json:"proposal_bytes,omitempty"` + // Signaure over proposalBytes; this signature is to be verified against + // the creator identity contained in the header of the Proposal message + // marshaled as proposalBytes + Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` +} + +func (x *SignedProposal) Reset() { + *x = SignedProposal{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_proposal_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SignedProposal) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SignedProposal) ProtoMessage() {} + +func (x *SignedProposal) ProtoReflect() protoreflect.Message { + mi := &file_peer_proposal_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SignedProposal.ProtoReflect.Descriptor instead. +func (*SignedProposal) Descriptor() ([]byte, []int) { + return file_peer_proposal_proto_rawDescGZIP(), []int{0} +} + +func (x *SignedProposal) GetProposalBytes() []byte { + if x != nil { + return x.ProposalBytes + } + return nil +} + +func (x *SignedProposal) GetSignature() []byte { + if x != nil { + return x.Signature + } + return nil +} + +// A Proposal is sent to an endorser for endorsement. The proposal contains: +// 1. A header which should be unmarshaled to a Header message. Note that +// Header is both the header of a Proposal and of a Transaction, in that i) +// both headers should be unmarshaled to this message; and ii) it is used to +// compute cryptographic hashes and signatures. The header has fields common +// to all proposals/transactions. In addition it has a type field for +// additional customization. An example of this is the ChaincodeHeaderExtension +// message used to extend the Header for type CHAINCODE. +// 2. A payload whose type depends on the header's type field. +// 3. An extension whose type depends on the header's type field. +// +// Let us see an example. For type CHAINCODE (see the Header message), +// we have the following: +// 1. The header is a Header message whose extensions field is a +// ChaincodeHeaderExtension message. +// 2. The payload is a ChaincodeProposalPayload message. +// 3. The extension is a ChaincodeAction that might be used to ask the +// endorsers to endorse a specific ChaincodeAction, thus emulating the +// submitting peer model. +type Proposal struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The header of the proposal. It is the bytes of the Header + Header []byte `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + // The payload of the proposal as defined by the type in the proposal + // header. + Payload []byte `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"` + // Optional extensions to the proposal. Its content depends on the Header's + // type field. For the type CHAINCODE, it might be the bytes of a + // ChaincodeAction message. + Extension []byte `protobuf:"bytes,3,opt,name=extension,proto3" json:"extension,omitempty"` +} + +func (x *Proposal) Reset() { + *x = Proposal{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_proposal_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Proposal) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Proposal) ProtoMessage() {} + +func (x *Proposal) ProtoReflect() protoreflect.Message { + mi := &file_peer_proposal_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Proposal.ProtoReflect.Descriptor instead. +func (*Proposal) Descriptor() ([]byte, []int) { + return file_peer_proposal_proto_rawDescGZIP(), []int{1} +} + +func (x *Proposal) GetHeader() []byte { + if x != nil { + return x.Header + } + return nil +} + +func (x *Proposal) GetPayload() []byte { + if x != nil { + return x.Payload + } + return nil +} + +func (x *Proposal) GetExtension() []byte { + if x != nil { + return x.Extension + } + return nil +} + +// ChaincodeHeaderExtension is the Header's extentions message to be used when +// the Header's type is CHAINCODE. This extensions is used to specify which +// chaincode to invoke and what should appear on the ledger. +type ChaincodeHeaderExtension struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The ID of the chaincode to target. + ChaincodeId *ChaincodeID `protobuf:"bytes,2,opt,name=chaincode_id,json=chaincodeId,proto3" json:"chaincode_id,omitempty"` +} + +func (x *ChaincodeHeaderExtension) Reset() { + *x = ChaincodeHeaderExtension{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_proposal_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChaincodeHeaderExtension) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChaincodeHeaderExtension) ProtoMessage() {} + +func (x *ChaincodeHeaderExtension) ProtoReflect() protoreflect.Message { + mi := &file_peer_proposal_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ChaincodeHeaderExtension.ProtoReflect.Descriptor instead. +func (*ChaincodeHeaderExtension) Descriptor() ([]byte, []int) { + return file_peer_proposal_proto_rawDescGZIP(), []int{2} +} + +func (x *ChaincodeHeaderExtension) GetChaincodeId() *ChaincodeID { + if x != nil { + return x.ChaincodeId + } + return nil +} + +// ChaincodeProposalPayload is the Proposal's payload message to be used when +// the Header's type is CHAINCODE. It contains the arguments for this +// invocation. +type ChaincodeProposalPayload struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Input contains the arguments for this invocation. If this invocation + // deploys a new chaincode, ESCC/VSCC are part of this field. + // This is usually a marshaled ChaincodeInvocationSpec + Input []byte `protobuf:"bytes,1,opt,name=input,proto3" json:"input,omitempty"` + // TransientMap contains data (e.g. cryptographic material) that might be used + // to implement some form of application-level confidentiality. The contents + // of this field are supposed to always be omitted from the transaction and + // excluded from the ledger. + TransientMap map[string][]byte `protobuf:"bytes,2,rep,name=TransientMap,proto3" json:"TransientMap,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *ChaincodeProposalPayload) Reset() { + *x = ChaincodeProposalPayload{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_proposal_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChaincodeProposalPayload) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChaincodeProposalPayload) ProtoMessage() {} + +func (x *ChaincodeProposalPayload) ProtoReflect() protoreflect.Message { + mi := &file_peer_proposal_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ChaincodeProposalPayload.ProtoReflect.Descriptor instead. +func (*ChaincodeProposalPayload) Descriptor() ([]byte, []int) { + return file_peer_proposal_proto_rawDescGZIP(), []int{3} +} + +func (x *ChaincodeProposalPayload) GetInput() []byte { + if x != nil { + return x.Input + } + return nil +} + +func (x *ChaincodeProposalPayload) GetTransientMap() map[string][]byte { + if x != nil { + return x.TransientMap + } + return nil +} + +// ChaincodeAction contains the executed chaincode results, response, and event. +type ChaincodeAction struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // This field contains the read set and the write set produced by the + // chaincode executing this invocation. + Results []byte `protobuf:"bytes,1,opt,name=results,proto3" json:"results,omitempty"` + // This field contains the event generated by the chaincode. + // Only a single marshaled ChaincodeEvent is included. + Events []byte `protobuf:"bytes,2,opt,name=events,proto3" json:"events,omitempty"` + // This field contains the result of executing this invocation. + Response *Response `protobuf:"bytes,3,opt,name=response,proto3" json:"response,omitempty"` + // This field contains the ChaincodeID of executing this invocation. Endorser + // will set it with the ChaincodeID called by endorser while simulating proposal. + // Committer will validate the version matching with latest chaincode version. + // Adding ChaincodeID to keep version opens up the possibility of multiple + // ChaincodeAction per transaction. + ChaincodeId *ChaincodeID `protobuf:"bytes,4,opt,name=chaincode_id,json=chaincodeId,proto3" json:"chaincode_id,omitempty"` +} + +func (x *ChaincodeAction) Reset() { + *x = ChaincodeAction{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_proposal_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChaincodeAction) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChaincodeAction) ProtoMessage() {} + +func (x *ChaincodeAction) ProtoReflect() protoreflect.Message { + mi := &file_peer_proposal_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ChaincodeAction.ProtoReflect.Descriptor instead. +func (*ChaincodeAction) Descriptor() ([]byte, []int) { + return file_peer_proposal_proto_rawDescGZIP(), []int{4} +} + +func (x *ChaincodeAction) GetResults() []byte { + if x != nil { + return x.Results + } + return nil +} + +func (x *ChaincodeAction) GetEvents() []byte { + if x != nil { + return x.Events + } + return nil +} + +func (x *ChaincodeAction) GetResponse() *Response { + if x != nil { + return x.Response + } + return nil +} + +func (x *ChaincodeAction) GetChaincodeId() *ChaincodeID { + if x != nil { + return x.ChaincodeId + } + return nil +} + +var File_peer_proposal_proto protoreflect.FileDescriptor + +var file_peer_proposal_proto_rawDesc = []byte{ + 0x0a, 0x13, 0x70, 0x65, 0x65, 0x72, 0x2f, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x1a, 0x14, 0x70, + 0x65, 0x65, 0x72, 0x2f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x70, 0x65, 0x65, 0x72, 0x2f, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, + 0x61, 0x6c, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x22, 0x55, 0x0a, 0x0e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x50, 0x72, 0x6f, 0x70, 0x6f, + 0x73, 0x61, 0x6c, 0x12, 0x25, 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, + 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0d, 0x70, 0x72, 0x6f, + 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, + 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, + 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x5a, 0x0a, 0x08, 0x50, 0x72, 0x6f, 0x70, + 0x6f, 0x73, 0x61, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, + 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x70, + 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, + 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x65, 0x78, 0x74, 0x65, 0x6e, + 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x6b, 0x0a, 0x18, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, + 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, + 0x12, 0x36, 0x0a, 0x0c, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x5f, 0x69, 0x64, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, + 0x43, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x49, 0x44, 0x52, 0x0b, 0x63, 0x68, 0x61, + 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x4a, 0x04, 0x08, 0x01, 0x10, 0x02, 0x52, 0x11, + 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x76, 0x69, 0x73, 0x62, 0x69, 0x6c, 0x69, 0x74, + 0x79, 0x22, 0xc9, 0x01, 0x0a, 0x18, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x50, + 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x14, + 0x0a, 0x05, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x69, + 0x6e, 0x70, 0x75, 0x74, 0x12, 0x56, 0x0a, 0x0c, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x65, 0x6e, + 0x74, 0x4d, 0x61, 0x70, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x73, 0x2e, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x50, 0x72, 0x6f, + 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x54, 0x72, 0x61, + 0x6e, 0x73, 0x69, 0x65, 0x6e, 0x74, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0c, + 0x54, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x65, 0x6e, 0x74, 0x4d, 0x61, 0x70, 0x1a, 0x3f, 0x0a, 0x11, + 0x54, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x65, 0x6e, 0x74, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, + 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xc1, 0x01, + 0x0a, 0x0f, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x41, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x65, + 0x76, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x65, 0x76, 0x65, + 0x6e, 0x74, 0x73, 0x12, 0x2c, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x36, 0x0a, 0x0c, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x5f, 0x69, + 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, + 0x2e, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x49, 0x44, 0x52, 0x0b, 0x63, 0x68, + 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x4a, 0x04, 0x08, 0x05, 0x10, 0x06, 0x52, + 0x10, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x42, 0x9f, 0x01, 0x0a, 0x22, 0x6f, 0x72, 0x67, 0x2e, 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, + 0x65, 0x64, 0x67, 0x65, 0x72, 0x2e, 0x66, 0x61, 0x62, 0x72, 0x69, 0x63, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x73, 0x2e, 0x70, 0x65, 0x65, 0x72, 0x42, 0x0d, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, + 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x32, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x65, 0x64, 0x67, 0x65, + 0x72, 0x2f, 0x66, 0x61, 0x62, 0x72, 0x69, 0x63, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2d, + 0x67, 0x6f, 0x2d, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x70, 0x65, 0x65, 0x72, 0xa2, 0x02, 0x03, + 0x50, 0x58, 0x58, 0xaa, 0x02, 0x06, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0xca, 0x02, 0x06, 0x50, + 0x72, 0x6f, 0x74, 0x6f, 0x73, 0xe2, 0x02, 0x12, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x5c, 0x47, + 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x06, 0x50, 0x72, 0x6f, + 0x74, 0x6f, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_peer_proposal_proto_rawDescOnce sync.Once + file_peer_proposal_proto_rawDescData = file_peer_proposal_proto_rawDesc +) + +func file_peer_proposal_proto_rawDescGZIP() []byte { + file_peer_proposal_proto_rawDescOnce.Do(func() { + file_peer_proposal_proto_rawDescData = protoimpl.X.CompressGZIP(file_peer_proposal_proto_rawDescData) + }) + return file_peer_proposal_proto_rawDescData +} + +var file_peer_proposal_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_peer_proposal_proto_goTypes = []interface{}{ + (*SignedProposal)(nil), // 0: protos.SignedProposal + (*Proposal)(nil), // 1: protos.Proposal + (*ChaincodeHeaderExtension)(nil), // 2: protos.ChaincodeHeaderExtension + (*ChaincodeProposalPayload)(nil), // 3: protos.ChaincodeProposalPayload + (*ChaincodeAction)(nil), // 4: protos.ChaincodeAction + nil, // 5: protos.ChaincodeProposalPayload.TransientMapEntry + (*ChaincodeID)(nil), // 6: protos.ChaincodeID + (*Response)(nil), // 7: protos.Response +} +var file_peer_proposal_proto_depIdxs = []int32{ + 6, // 0: protos.ChaincodeHeaderExtension.chaincode_id:type_name -> protos.ChaincodeID + 5, // 1: protos.ChaincodeProposalPayload.TransientMap:type_name -> protos.ChaincodeProposalPayload.TransientMapEntry + 7, // 2: protos.ChaincodeAction.response:type_name -> protos.Response + 6, // 3: protos.ChaincodeAction.chaincode_id:type_name -> protos.ChaincodeID + 4, // [4:4] is the sub-list for method output_type + 4, // [4:4] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name +} + +func init() { file_peer_proposal_proto_init() } +func file_peer_proposal_proto_init() { + if File_peer_proposal_proto != nil { + return + } + file_peer_chaincode_proto_init() + file_peer_proposal_response_proto_init() + if !protoimpl.UnsafeEnabled { + file_peer_proposal_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SignedProposal); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peer_proposal_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Proposal); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peer_proposal_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChaincodeHeaderExtension); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peer_proposal_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChaincodeProposalPayload); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peer_proposal_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChaincodeAction); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_peer_proposal_proto_rawDesc, + NumEnums: 0, + NumMessages: 6, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_peer_proposal_proto_goTypes, + DependencyIndexes: file_peer_proposal_proto_depIdxs, + MessageInfos: file_peer_proposal_proto_msgTypes, + }.Build() + File_peer_proposal_proto = out.File + file_peer_proposal_proto_rawDesc = nil + file_peer_proposal_proto_goTypes = nil + file_peer_proposal_proto_depIdxs = nil +} diff --git a/vendor/github.com/hyperledger/fabric-protos-go-apiv2/peer/proposal_response.pb.go b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/peer/proposal_response.pb.go new file mode 100644 index 00000000000..40a48d3ac56 --- /dev/null +++ b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/peer/proposal_response.pb.go @@ -0,0 +1,694 @@ +// Copyright the Hyperledger Fabric contributors. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: peer/proposal_response.proto + +package peer + +import ( + common "github.com/hyperledger/fabric-protos-go-apiv2/common" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// A ProposalResponse is returned from an endorser to the proposal submitter. +// The idea is that this message contains the endorser's response to the +// request of a client to perform an action over a chaincode (or more +// generically on the ledger); the response might be success/error (conveyed in +// the Response field) together with a description of the action and a +// signature over it by that endorser. If a sufficient number of distinct +// endorsers agree on the same action and produce signature to that effect, a +// transaction can be generated and sent for ordering. +type ProposalResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Version indicates message protocol version + Version int32 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` + // Timestamp is the time that the message + // was created as defined by the sender + Timestamp *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + // A response message indicating whether the + // endorsement of the action was successful + Response *Response `protobuf:"bytes,4,opt,name=response,proto3" json:"response,omitempty"` + // The payload of response. It is the bytes of ProposalResponsePayload + Payload []byte `protobuf:"bytes,5,opt,name=payload,proto3" json:"payload,omitempty"` + // The endorsement of the proposal, basically + // the endorser's signature over the payload + Endorsement *Endorsement `protobuf:"bytes,6,opt,name=endorsement,proto3" json:"endorsement,omitempty"` + // The chaincode interest derived from simulating the proposal. + Interest *ChaincodeInterest `protobuf:"bytes,7,opt,name=interest,proto3" json:"interest,omitempty"` +} + +func (x *ProposalResponse) Reset() { + *x = ProposalResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_proposal_response_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ProposalResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ProposalResponse) ProtoMessage() {} + +func (x *ProposalResponse) ProtoReflect() protoreflect.Message { + mi := &file_peer_proposal_response_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ProposalResponse.ProtoReflect.Descriptor instead. +func (*ProposalResponse) Descriptor() ([]byte, []int) { + return file_peer_proposal_response_proto_rawDescGZIP(), []int{0} +} + +func (x *ProposalResponse) GetVersion() int32 { + if x != nil { + return x.Version + } + return 0 +} + +func (x *ProposalResponse) GetTimestamp() *timestamppb.Timestamp { + if x != nil { + return x.Timestamp + } + return nil +} + +func (x *ProposalResponse) GetResponse() *Response { + if x != nil { + return x.Response + } + return nil +} + +func (x *ProposalResponse) GetPayload() []byte { + if x != nil { + return x.Payload + } + return nil +} + +func (x *ProposalResponse) GetEndorsement() *Endorsement { + if x != nil { + return x.Endorsement + } + return nil +} + +func (x *ProposalResponse) GetInterest() *ChaincodeInterest { + if x != nil { + return x.Interest + } + return nil +} + +// A response with a representation similar to an HTTP response that can +// be used within another message. +type Response struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // A status code that should follow the HTTP status codes. + Status int32 `protobuf:"varint,1,opt,name=status,proto3" json:"status,omitempty"` + // A message associated with the response code. + Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` + // A payload that can be used to include metadata with this response. + Payload []byte `protobuf:"bytes,3,opt,name=payload,proto3" json:"payload,omitempty"` +} + +func (x *Response) Reset() { + *x = Response{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_proposal_response_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Response) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Response) ProtoMessage() {} + +func (x *Response) ProtoReflect() protoreflect.Message { + mi := &file_peer_proposal_response_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Response.ProtoReflect.Descriptor instead. +func (*Response) Descriptor() ([]byte, []int) { + return file_peer_proposal_response_proto_rawDescGZIP(), []int{1} +} + +func (x *Response) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +func (x *Response) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +func (x *Response) GetPayload() []byte { + if x != nil { + return x.Payload + } + return nil +} + +// ProposalResponsePayload is the payload of a proposal response. This message +// is the "bridge" between the client's request and the endorser's action in +// response to that request. Concretely, for chaincodes, it contains a hashed +// representation of the proposal (proposalHash) and a representation of the +// chaincode state changes and events inside the extension field. +type ProposalResponsePayload struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Hash of the proposal that triggered this response. The hash is used to + // link a response with its proposal, both for bookeeping purposes on an + // asynchronous system and for security reasons (accountability, + // non-repudiation). The hash usually covers the entire Proposal message + // (byte-by-byte). + ProposalHash []byte `protobuf:"bytes,1,opt,name=proposal_hash,json=proposalHash,proto3" json:"proposal_hash,omitempty"` + // Extension should be unmarshaled to a type-specific message. The type of + // the extension in any proposal response depends on the type of the proposal + // that the client selected when the proposal was initially sent out. In + // particular, this information is stored in the type field of a Header. For + // chaincode, it's a ChaincodeAction message + Extension []byte `protobuf:"bytes,2,opt,name=extension,proto3" json:"extension,omitempty"` +} + +func (x *ProposalResponsePayload) Reset() { + *x = ProposalResponsePayload{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_proposal_response_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ProposalResponsePayload) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ProposalResponsePayload) ProtoMessage() {} + +func (x *ProposalResponsePayload) ProtoReflect() protoreflect.Message { + mi := &file_peer_proposal_response_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ProposalResponsePayload.ProtoReflect.Descriptor instead. +func (*ProposalResponsePayload) Descriptor() ([]byte, []int) { + return file_peer_proposal_response_proto_rawDescGZIP(), []int{2} +} + +func (x *ProposalResponsePayload) GetProposalHash() []byte { + if x != nil { + return x.ProposalHash + } + return nil +} + +func (x *ProposalResponsePayload) GetExtension() []byte { + if x != nil { + return x.Extension + } + return nil +} + +// An endorsement is a signature of an endorser over a proposal response. By +// producing an endorsement message, an endorser implicitly "approves" that +// proposal response and the actions contained therein. When enough +// endorsements have been collected, a transaction can be generated out of a +// set of proposal responses. Note that this message only contains an identity +// and a signature but no signed payload. This is intentional because +// endorsements are supposed to be collected in a transaction, and they are all +// expected to endorse a single proposal response/action (many endorsements +// over a single proposal response) +type Endorsement struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Identity of the endorser (e.g. its certificate) + Endorser []byte `protobuf:"bytes,1,opt,name=endorser,proto3" json:"endorser,omitempty"` + // Signature of the payload included in ProposalResponse concatenated with + // the endorser's certificate; ie, sign(ProposalResponse.payload + endorser) + Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` +} + +func (x *Endorsement) Reset() { + *x = Endorsement{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_proposal_response_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Endorsement) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Endorsement) ProtoMessage() {} + +func (x *Endorsement) ProtoReflect() protoreflect.Message { + mi := &file_peer_proposal_response_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Endorsement.ProtoReflect.Descriptor instead. +func (*Endorsement) Descriptor() ([]byte, []int) { + return file_peer_proposal_response_proto_rawDescGZIP(), []int{3} +} + +func (x *Endorsement) GetEndorser() []byte { + if x != nil { + return x.Endorser + } + return nil +} + +func (x *Endorsement) GetSignature() []byte { + if x != nil { + return x.Signature + } + return nil +} + +// ChaincodeInterest defines an interest about an endorsement +// for a specific single chaincode invocation. +// Multiple chaincodes indicate chaincode to chaincode invocations. +type ChaincodeInterest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Chaincodes []*ChaincodeCall `protobuf:"bytes,1,rep,name=chaincodes,proto3" json:"chaincodes,omitempty"` +} + +func (x *ChaincodeInterest) Reset() { + *x = ChaincodeInterest{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_proposal_response_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChaincodeInterest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChaincodeInterest) ProtoMessage() {} + +func (x *ChaincodeInterest) ProtoReflect() protoreflect.Message { + mi := &file_peer_proposal_response_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ChaincodeInterest.ProtoReflect.Descriptor instead. +func (*ChaincodeInterest) Descriptor() ([]byte, []int) { + return file_peer_proposal_response_proto_rawDescGZIP(), []int{4} +} + +func (x *ChaincodeInterest) GetChaincodes() []*ChaincodeCall { + if x != nil { + return x.Chaincodes + } + return nil +} + +// ChaincodeCall defines a call to a chaincode. +// It may have collections that are related to the chaincode +type ChaincodeCall struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + CollectionNames []string `protobuf:"bytes,2,rep,name=collection_names,json=collectionNames,proto3" json:"collection_names,omitempty"` + NoPrivateReads bool `protobuf:"varint,3,opt,name=no_private_reads,json=noPrivateReads,proto3" json:"no_private_reads,omitempty"` // Indicates we do not need to read from private data + NoPublicWrites bool `protobuf:"varint,4,opt,name=no_public_writes,json=noPublicWrites,proto3" json:"no_public_writes,omitempty"` // Indicates we do not need to write to the chaincode namespace + // The set of signature policies associated with states in the write-set + // that have state-based endorsement policies. + KeyPolicies []*common.SignaturePolicyEnvelope `protobuf:"bytes,5,rep,name=key_policies,json=keyPolicies,proto3" json:"key_policies,omitempty"` + // Indicates we wish to ignore the namespace endorsement policy + DisregardNamespacePolicy bool `protobuf:"varint,6,opt,name=disregard_namespace_policy,json=disregardNamespacePolicy,proto3" json:"disregard_namespace_policy,omitempty"` +} + +func (x *ChaincodeCall) Reset() { + *x = ChaincodeCall{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_proposal_response_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChaincodeCall) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChaincodeCall) ProtoMessage() {} + +func (x *ChaincodeCall) ProtoReflect() protoreflect.Message { + mi := &file_peer_proposal_response_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ChaincodeCall.ProtoReflect.Descriptor instead. +func (*ChaincodeCall) Descriptor() ([]byte, []int) { + return file_peer_proposal_response_proto_rawDescGZIP(), []int{5} +} + +func (x *ChaincodeCall) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *ChaincodeCall) GetCollectionNames() []string { + if x != nil { + return x.CollectionNames + } + return nil +} + +func (x *ChaincodeCall) GetNoPrivateReads() bool { + if x != nil { + return x.NoPrivateReads + } + return false +} + +func (x *ChaincodeCall) GetNoPublicWrites() bool { + if x != nil { + return x.NoPublicWrites + } + return false +} + +func (x *ChaincodeCall) GetKeyPolicies() []*common.SignaturePolicyEnvelope { + if x != nil { + return x.KeyPolicies + } + return nil +} + +func (x *ChaincodeCall) GetDisregardNamespacePolicy() bool { + if x != nil { + return x.DisregardNamespacePolicy + } + return false +} + +var File_peer_proposal_response_proto protoreflect.FileDescriptor + +var file_peer_proposal_response_proto_rawDesc = []byte{ + 0x0a, 0x1c, 0x70, 0x65, 0x65, 0x72, 0x2f, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, + 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x15, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, + 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x9c, + 0x02, 0x0a, 0x10, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x38, 0x0a, + 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x74, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x2c, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x73, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x08, 0x72, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, + 0x35, 0x0a, 0x0b, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x73, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x45, 0x6e, + 0x64, 0x6f, 0x72, 0x73, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x0b, 0x65, 0x6e, 0x64, 0x6f, 0x72, + 0x73, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x35, 0x0a, 0x08, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x65, + 0x73, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x73, 0x2e, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x74, 0x65, 0x72, + 0x65, 0x73, 0x74, 0x52, 0x08, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x65, 0x73, 0x74, 0x22, 0x56, 0x0a, + 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x70, + 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x70, 0x61, + 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x5c, 0x0a, 0x17, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, + 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, + 0x12, 0x23, 0x0a, 0x0d, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x68, 0x61, 0x73, + 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, + 0x6c, 0x48, 0x61, 0x73, 0x68, 0x12, 0x1c, 0x0a, 0x09, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, + 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, + 0x69, 0x6f, 0x6e, 0x22, 0x47, 0x0a, 0x0b, 0x45, 0x6e, 0x64, 0x6f, 0x72, 0x73, 0x65, 0x6d, 0x65, + 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x73, 0x65, 0x72, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x73, 0x65, 0x72, 0x12, 0x1c, + 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x4a, 0x0a, 0x11, + 0x43, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x65, 0x73, + 0x74, 0x12, 0x35, 0x0a, 0x0a, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x43, + 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x43, 0x61, 0x6c, 0x6c, 0x52, 0x0a, 0x63, 0x68, + 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x73, 0x22, 0xa4, 0x02, 0x0a, 0x0d, 0x43, 0x68, 0x61, + 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x43, 0x61, 0x6c, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x29, + 0x0a, 0x10, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x61, 0x6d, + 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0f, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x12, 0x28, 0x0a, 0x10, 0x6e, 0x6f, 0x5f, + 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x65, 0x61, 0x64, 0x73, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x0e, 0x6e, 0x6f, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x52, 0x65, + 0x61, 0x64, 0x73, 0x12, 0x28, 0x0a, 0x10, 0x6e, 0x6f, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, + 0x5f, 0x77, 0x72, 0x69, 0x74, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x6e, + 0x6f, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x57, 0x72, 0x69, 0x74, 0x65, 0x73, 0x12, 0x42, 0x0a, + 0x0c, 0x6b, 0x65, 0x79, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x18, 0x05, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x53, 0x69, 0x67, + 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x45, 0x6e, 0x76, 0x65, + 0x6c, 0x6f, 0x70, 0x65, 0x52, 0x0b, 0x6b, 0x65, 0x79, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, + 0x73, 0x12, 0x3c, 0x0a, 0x1a, 0x64, 0x69, 0x73, 0x72, 0x65, 0x67, 0x61, 0x72, 0x64, 0x5f, 0x6e, + 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x18, 0x64, 0x69, 0x73, 0x72, 0x65, 0x67, 0x61, 0x72, 0x64, + 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x42, + 0xa7, 0x01, 0x0a, 0x22, 0x6f, 0x72, 0x67, 0x2e, 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x65, 0x64, + 0x67, 0x65, 0x72, 0x2e, 0x66, 0x61, 0x62, 0x72, 0x69, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x73, 0x2e, 0x70, 0x65, 0x65, 0x72, 0x42, 0x15, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, + 0x32, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x79, 0x70, 0x65, + 0x72, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2f, 0x66, 0x61, 0x62, 0x72, 0x69, 0x63, 0x2d, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2d, 0x67, 0x6f, 0x2d, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x70, + 0x65, 0x65, 0x72, 0xa2, 0x02, 0x03, 0x50, 0x58, 0x58, 0xaa, 0x02, 0x06, 0x50, 0x72, 0x6f, 0x74, + 0x6f, 0x73, 0xca, 0x02, 0x06, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0xe2, 0x02, 0x12, 0x50, 0x72, + 0x6f, 0x74, 0x6f, 0x73, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0xea, 0x02, 0x06, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, +} + +var ( + file_peer_proposal_response_proto_rawDescOnce sync.Once + file_peer_proposal_response_proto_rawDescData = file_peer_proposal_response_proto_rawDesc +) + +func file_peer_proposal_response_proto_rawDescGZIP() []byte { + file_peer_proposal_response_proto_rawDescOnce.Do(func() { + file_peer_proposal_response_proto_rawDescData = protoimpl.X.CompressGZIP(file_peer_proposal_response_proto_rawDescData) + }) + return file_peer_proposal_response_proto_rawDescData +} + +var file_peer_proposal_response_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_peer_proposal_response_proto_goTypes = []interface{}{ + (*ProposalResponse)(nil), // 0: protos.ProposalResponse + (*Response)(nil), // 1: protos.Response + (*ProposalResponsePayload)(nil), // 2: protos.ProposalResponsePayload + (*Endorsement)(nil), // 3: protos.Endorsement + (*ChaincodeInterest)(nil), // 4: protos.ChaincodeInterest + (*ChaincodeCall)(nil), // 5: protos.ChaincodeCall + (*timestamppb.Timestamp)(nil), // 6: google.protobuf.Timestamp + (*common.SignaturePolicyEnvelope)(nil), // 7: common.SignaturePolicyEnvelope +} +var file_peer_proposal_response_proto_depIdxs = []int32{ + 6, // 0: protos.ProposalResponse.timestamp:type_name -> google.protobuf.Timestamp + 1, // 1: protos.ProposalResponse.response:type_name -> protos.Response + 3, // 2: protos.ProposalResponse.endorsement:type_name -> protos.Endorsement + 4, // 3: protos.ProposalResponse.interest:type_name -> protos.ChaincodeInterest + 5, // 4: protos.ChaincodeInterest.chaincodes:type_name -> protos.ChaincodeCall + 7, // 5: protos.ChaincodeCall.key_policies:type_name -> common.SignaturePolicyEnvelope + 6, // [6:6] is the sub-list for method output_type + 6, // [6:6] is the sub-list for method input_type + 6, // [6:6] is the sub-list for extension type_name + 6, // [6:6] is the sub-list for extension extendee + 0, // [0:6] is the sub-list for field type_name +} + +func init() { file_peer_proposal_response_proto_init() } +func file_peer_proposal_response_proto_init() { + if File_peer_proposal_response_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_peer_proposal_response_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ProposalResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peer_proposal_response_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Response); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peer_proposal_response_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ProposalResponsePayload); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peer_proposal_response_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Endorsement); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peer_proposal_response_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChaincodeInterest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peer_proposal_response_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChaincodeCall); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_peer_proposal_response_proto_rawDesc, + NumEnums: 0, + NumMessages: 6, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_peer_proposal_response_proto_goTypes, + DependencyIndexes: file_peer_proposal_response_proto_depIdxs, + MessageInfos: file_peer_proposal_response_proto_msgTypes, + }.Build() + File_peer_proposal_response_proto = out.File + file_peer_proposal_response_proto_rawDesc = nil + file_peer_proposal_response_proto_goTypes = nil + file_peer_proposal_response_proto_depIdxs = nil +} diff --git a/vendor/github.com/hyperledger/fabric-protos-go-apiv2/peer/query.pb.go b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/peer/query.pb.go new file mode 100644 index 00000000000..fc263cdddcf --- /dev/null +++ b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/peer/query.pb.go @@ -0,0 +1,506 @@ +// Copyright the Hyperledger Fabric contributors. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: peer/query.proto + +package peer + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// ChaincodeQueryResponse returns information about each chaincode that pertains +// to a query in lscc.go, such as GetChaincodes (returns all chaincodes +// instantiated on a channel), and GetInstalledChaincodes (returns all chaincodes +// installed on a peer) +type ChaincodeQueryResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Chaincodes []*ChaincodeInfo `protobuf:"bytes,1,rep,name=chaincodes,proto3" json:"chaincodes,omitempty"` +} + +func (x *ChaincodeQueryResponse) Reset() { + *x = ChaincodeQueryResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_query_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChaincodeQueryResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChaincodeQueryResponse) ProtoMessage() {} + +func (x *ChaincodeQueryResponse) ProtoReflect() protoreflect.Message { + mi := &file_peer_query_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ChaincodeQueryResponse.ProtoReflect.Descriptor instead. +func (*ChaincodeQueryResponse) Descriptor() ([]byte, []int) { + return file_peer_query_proto_rawDescGZIP(), []int{0} +} + +func (x *ChaincodeQueryResponse) GetChaincodes() []*ChaincodeInfo { + if x != nil { + return x.Chaincodes + } + return nil +} + +// ChaincodeInfo contains general information about an installed/instantiated +// chaincode +type ChaincodeInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` + // the path as specified by the install/instantiate transaction + Path string `protobuf:"bytes,3,opt,name=path,proto3" json:"path,omitempty"` + // the chaincode function upon instantiation and its arguments. This will be + // blank if the query is returning information about installed chaincodes. + Input string `protobuf:"bytes,4,opt,name=input,proto3" json:"input,omitempty"` + // the name of the ESCC for this chaincode. This will be + // blank if the query is returning information about installed chaincodes. + Escc string `protobuf:"bytes,5,opt,name=escc,proto3" json:"escc,omitempty"` + // the name of the VSCC for this chaincode. This will be + // blank if the query is returning information about installed chaincodes. + Vscc string `protobuf:"bytes,6,opt,name=vscc,proto3" json:"vscc,omitempty"` + // the chaincode unique id. + // computed as: H( + // + // H(name || version) || + // H(CodePackage) + // ) + Id []byte `protobuf:"bytes,7,opt,name=id,proto3" json:"id,omitempty"` +} + +func (x *ChaincodeInfo) Reset() { + *x = ChaincodeInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_query_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChaincodeInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChaincodeInfo) ProtoMessage() {} + +func (x *ChaincodeInfo) ProtoReflect() protoreflect.Message { + mi := &file_peer_query_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ChaincodeInfo.ProtoReflect.Descriptor instead. +func (*ChaincodeInfo) Descriptor() ([]byte, []int) { + return file_peer_query_proto_rawDescGZIP(), []int{1} +} + +func (x *ChaincodeInfo) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *ChaincodeInfo) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +func (x *ChaincodeInfo) GetPath() string { + if x != nil { + return x.Path + } + return "" +} + +func (x *ChaincodeInfo) GetInput() string { + if x != nil { + return x.Input + } + return "" +} + +func (x *ChaincodeInfo) GetEscc() string { + if x != nil { + return x.Escc + } + return "" +} + +func (x *ChaincodeInfo) GetVscc() string { + if x != nil { + return x.Vscc + } + return "" +} + +func (x *ChaincodeInfo) GetId() []byte { + if x != nil { + return x.Id + } + return nil +} + +// ChannelQueryResponse returns information about each channel that pertains +// to a query in lscc.go, such as GetChannels (returns all channels for a +// given peer) +type ChannelQueryResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Channels []*ChannelInfo `protobuf:"bytes,1,rep,name=channels,proto3" json:"channels,omitempty"` +} + +func (x *ChannelQueryResponse) Reset() { + *x = ChannelQueryResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_query_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChannelQueryResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChannelQueryResponse) ProtoMessage() {} + +func (x *ChannelQueryResponse) ProtoReflect() protoreflect.Message { + mi := &file_peer_query_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ChannelQueryResponse.ProtoReflect.Descriptor instead. +func (*ChannelQueryResponse) Descriptor() ([]byte, []int) { + return file_peer_query_proto_rawDescGZIP(), []int{2} +} + +func (x *ChannelQueryResponse) GetChannels() []*ChannelInfo { + if x != nil { + return x.Channels + } + return nil +} + +// ChannelInfo contains general information about channels +type ChannelInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ChannelId string `protobuf:"bytes,1,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` +} + +func (x *ChannelInfo) Reset() { + *x = ChannelInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_query_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChannelInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChannelInfo) ProtoMessage() {} + +func (x *ChannelInfo) ProtoReflect() protoreflect.Message { + mi := &file_peer_query_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ChannelInfo.ProtoReflect.Descriptor instead. +func (*ChannelInfo) Descriptor() ([]byte, []int) { + return file_peer_query_proto_rawDescGZIP(), []int{3} +} + +func (x *ChannelInfo) GetChannelId() string { + if x != nil { + return x.ChannelId + } + return "" +} + +// JoinBySnapshotStatus contains information about whether or a JoinBySnapshot operation +// is in progress and the related bootstrap dir if it is running. +type JoinBySnapshotStatus struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + InProgress bool `protobuf:"varint,1,opt,name=in_progress,json=inProgress,proto3" json:"in_progress,omitempty"` + BootstrappingSnapshotDir string `protobuf:"bytes,2,opt,name=bootstrapping_snapshot_dir,json=bootstrappingSnapshotDir,proto3" json:"bootstrapping_snapshot_dir,omitempty"` +} + +func (x *JoinBySnapshotStatus) Reset() { + *x = JoinBySnapshotStatus{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_query_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *JoinBySnapshotStatus) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*JoinBySnapshotStatus) ProtoMessage() {} + +func (x *JoinBySnapshotStatus) ProtoReflect() protoreflect.Message { + mi := &file_peer_query_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use JoinBySnapshotStatus.ProtoReflect.Descriptor instead. +func (*JoinBySnapshotStatus) Descriptor() ([]byte, []int) { + return file_peer_query_proto_rawDescGZIP(), []int{4} +} + +func (x *JoinBySnapshotStatus) GetInProgress() bool { + if x != nil { + return x.InProgress + } + return false +} + +func (x *JoinBySnapshotStatus) GetBootstrappingSnapshotDir() string { + if x != nil { + return x.BootstrappingSnapshotDir + } + return "" +} + +var File_peer_query_proto protoreflect.FileDescriptor + +var file_peer_query_proto_rawDesc = []byte{ + 0x0a, 0x10, 0x70, 0x65, 0x65, 0x72, 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x12, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x22, 0x4f, 0x0a, 0x16, 0x43, 0x68, + 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x35, 0x0a, 0x0a, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, + 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x73, 0x2e, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, + 0x0a, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x73, 0x22, 0x9f, 0x01, 0x0a, 0x0d, + 0x43, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x12, 0x0a, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x70, + 0x61, 0x74, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, + 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x69, 0x6e, 0x70, 0x75, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x65, 0x73, 0x63, 0x63, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x65, 0x73, 0x63, 0x63, 0x12, 0x12, 0x0a, 0x04, 0x76, 0x73, 0x63, + 0x63, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x76, 0x73, 0x63, 0x63, 0x12, 0x0e, 0x0a, + 0x02, 0x69, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x02, 0x69, 0x64, 0x22, 0x47, 0x0a, + 0x14, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2f, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, + 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, + 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x08, 0x63, 0x68, + 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x73, 0x22, 0x2c, 0x0a, 0x0b, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, + 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, + 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x68, 0x61, 0x6e, 0x6e, + 0x65, 0x6c, 0x49, 0x64, 0x22, 0x75, 0x0a, 0x14, 0x4a, 0x6f, 0x69, 0x6e, 0x42, 0x79, 0x53, 0x6e, + 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1f, 0x0a, 0x0b, + 0x69, 0x6e, 0x5f, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x0a, 0x69, 0x6e, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x12, 0x3c, 0x0a, + 0x1a, 0x62, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x5f, 0x73, + 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x5f, 0x64, 0x69, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x18, 0x62, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, + 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x44, 0x69, 0x72, 0x42, 0x9c, 0x01, 0x0a, 0x22, + 0x6f, 0x72, 0x67, 0x2e, 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2e, + 0x66, 0x61, 0x62, 0x72, 0x69, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x70, 0x65, + 0x65, 0x72, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, + 0x5a, 0x32, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x79, 0x70, + 0x65, 0x72, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2f, 0x66, 0x61, 0x62, 0x72, 0x69, 0x63, 0x2d, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2d, 0x67, 0x6f, 0x2d, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, + 0x70, 0x65, 0x65, 0x72, 0xa2, 0x02, 0x03, 0x50, 0x58, 0x58, 0xaa, 0x02, 0x06, 0x50, 0x72, 0x6f, + 0x74, 0x6f, 0x73, 0xca, 0x02, 0x06, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0xe2, 0x02, 0x12, 0x50, + 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0xea, 0x02, 0x06, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, +} + +var ( + file_peer_query_proto_rawDescOnce sync.Once + file_peer_query_proto_rawDescData = file_peer_query_proto_rawDesc +) + +func file_peer_query_proto_rawDescGZIP() []byte { + file_peer_query_proto_rawDescOnce.Do(func() { + file_peer_query_proto_rawDescData = protoimpl.X.CompressGZIP(file_peer_query_proto_rawDescData) + }) + return file_peer_query_proto_rawDescData +} + +var file_peer_query_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +var file_peer_query_proto_goTypes = []interface{}{ + (*ChaincodeQueryResponse)(nil), // 0: protos.ChaincodeQueryResponse + (*ChaincodeInfo)(nil), // 1: protos.ChaincodeInfo + (*ChannelQueryResponse)(nil), // 2: protos.ChannelQueryResponse + (*ChannelInfo)(nil), // 3: protos.ChannelInfo + (*JoinBySnapshotStatus)(nil), // 4: protos.JoinBySnapshotStatus +} +var file_peer_query_proto_depIdxs = []int32{ + 1, // 0: protos.ChaincodeQueryResponse.chaincodes:type_name -> protos.ChaincodeInfo + 3, // 1: protos.ChannelQueryResponse.channels:type_name -> protos.ChannelInfo + 2, // [2:2] is the sub-list for method output_type + 2, // [2:2] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_peer_query_proto_init() } +func file_peer_query_proto_init() { + if File_peer_query_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_peer_query_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChaincodeQueryResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peer_query_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChaincodeInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peer_query_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChannelQueryResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peer_query_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChannelInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peer_query_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*JoinBySnapshotStatus); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_peer_query_proto_rawDesc, + NumEnums: 0, + NumMessages: 5, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_peer_query_proto_goTypes, + DependencyIndexes: file_peer_query_proto_depIdxs, + MessageInfos: file_peer_query_proto_msgTypes, + }.Build() + File_peer_query_proto = out.File + file_peer_query_proto_rawDesc = nil + file_peer_query_proto_goTypes = nil + file_peer_query_proto_depIdxs = nil +} diff --git a/vendor/github.com/hyperledger/fabric-protos-go-apiv2/peer/resources.pb.go b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/peer/resources.pb.go new file mode 100644 index 00000000000..a7c2eef34f9 --- /dev/null +++ b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/peer/resources.pb.go @@ -0,0 +1,462 @@ +// Copyright the Hyperledger Fabric contributors. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: peer/resources.proto + +package peer + +import ( + common "github.com/hyperledger/fabric-protos-go-apiv2/common" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// ChaincodeIdentifier identifies a piece of chaincode. For a peer to accept invocations of +// this chaincode, the hash of the installed code must match, as must the version string +// included with the install command. +type ChaincodeIdentifier struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` // The hash of the chaincode bytes + Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` // A user friendly human readable name corresponding to the ID +} + +func (x *ChaincodeIdentifier) Reset() { + *x = ChaincodeIdentifier{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_resources_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChaincodeIdentifier) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChaincodeIdentifier) ProtoMessage() {} + +func (x *ChaincodeIdentifier) ProtoReflect() protoreflect.Message { + mi := &file_peer_resources_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ChaincodeIdentifier.ProtoReflect.Descriptor instead. +func (*ChaincodeIdentifier) Descriptor() ([]byte, []int) { + return file_peer_resources_proto_rawDescGZIP(), []int{0} +} + +func (x *ChaincodeIdentifier) GetHash() []byte { + if x != nil { + return x.Hash + } + return nil +} + +func (x *ChaincodeIdentifier) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +// ChaincodeValidation instructs the peer how transactions for this chaincode should be +// validated. The only validation mechanism which ships with fabric today is the standard +// 'vscc' validation mechanism. This built in validation method utilizes an endorsement policy +// which checks that a sufficient number of signatures have been included. The 'arguement' +// field encodes any parameters required by the validation implementation. +type ChaincodeValidation struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // Specifies which code to run to validate transactions, defaults to 'vscc' + Argument []byte `protobuf:"bytes,2,opt,name=argument,proto3" json:"argument,omitempty"` // When 'vscc' a marshaled VSCCArgs +} + +func (x *ChaincodeValidation) Reset() { + *x = ChaincodeValidation{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_resources_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChaincodeValidation) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChaincodeValidation) ProtoMessage() {} + +func (x *ChaincodeValidation) ProtoReflect() protoreflect.Message { + mi := &file_peer_resources_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ChaincodeValidation.ProtoReflect.Descriptor instead. +func (*ChaincodeValidation) Descriptor() ([]byte, []int) { + return file_peer_resources_proto_rawDescGZIP(), []int{1} +} + +func (x *ChaincodeValidation) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *ChaincodeValidation) GetArgument() []byte { + if x != nil { + return x.Argument + } + return nil +} + +// VSCCArgs is passed (marshaled) as a parameter to the VSCC imlementation via the +// argument field of the ChaincodeValidation message. +type VSCCArgs struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + EndorsementPolicyRef string `protobuf:"bytes,1,opt,name=endorsement_policy_ref,json=endorsementPolicyRef,proto3" json:"endorsement_policy_ref,omitempty"` // A named reference to an endorsement policy, +} + +func (x *VSCCArgs) Reset() { + *x = VSCCArgs{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_resources_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *VSCCArgs) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*VSCCArgs) ProtoMessage() {} + +func (x *VSCCArgs) ProtoReflect() protoreflect.Message { + mi := &file_peer_resources_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use VSCCArgs.ProtoReflect.Descriptor instead. +func (*VSCCArgs) Descriptor() ([]byte, []int) { + return file_peer_resources_proto_rawDescGZIP(), []int{2} +} + +func (x *VSCCArgs) GetEndorsementPolicyRef() string { + if x != nil { + return x.EndorsementPolicyRef + } + return "" +} + +// ChaincodeEndorsement instructs the peer how transactions should be endorsed. The only +// endorsement mechanism which ships with the fabric today is the standard 'escc' mechanism. +// This code simply simulates the proposal to generate a RW set, then signs the result +// using the peer's local signing identity. +type ChaincodeEndorsement struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // Specifies what code to run for endorsements, defaults 'escc' +} + +func (x *ChaincodeEndorsement) Reset() { + *x = ChaincodeEndorsement{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_resources_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChaincodeEndorsement) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChaincodeEndorsement) ProtoMessage() {} + +func (x *ChaincodeEndorsement) ProtoReflect() protoreflect.Message { + mi := &file_peer_resources_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ChaincodeEndorsement.ProtoReflect.Descriptor instead. +func (*ChaincodeEndorsement) Descriptor() ([]byte, []int) { + return file_peer_resources_proto_rawDescGZIP(), []int{3} +} + +func (x *ChaincodeEndorsement) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +// ConfigTree encapsulates channel and resources configuration of a channel. +// Both configurations are represented as common.Config +type ConfigTree struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ChannelConfig *common.Config `protobuf:"bytes,1,opt,name=channel_config,json=channelConfig,proto3" json:"channel_config,omitempty"` + ResourcesConfig *common.Config `protobuf:"bytes,2,opt,name=resources_config,json=resourcesConfig,proto3" json:"resources_config,omitempty"` +} + +func (x *ConfigTree) Reset() { + *x = ConfigTree{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_resources_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ConfigTree) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ConfigTree) ProtoMessage() {} + +func (x *ConfigTree) ProtoReflect() protoreflect.Message { + mi := &file_peer_resources_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ConfigTree.ProtoReflect.Descriptor instead. +func (*ConfigTree) Descriptor() ([]byte, []int) { + return file_peer_resources_proto_rawDescGZIP(), []int{4} +} + +func (x *ConfigTree) GetChannelConfig() *common.Config { + if x != nil { + return x.ChannelConfig + } + return nil +} + +func (x *ConfigTree) GetResourcesConfig() *common.Config { + if x != nil { + return x.ResourcesConfig + } + return nil +} + +var File_peer_resources_proto protoreflect.FileDescriptor + +var file_peer_resources_proto_rawDesc = []byte{ + 0x0a, 0x14, 0x70, 0x65, 0x65, 0x72, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x1a, 0x15, + 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x74, 0x78, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x43, 0x0a, 0x13, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, + 0x64, 0x65, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, + 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x68, 0x61, 0x73, 0x68, + 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x45, 0x0a, 0x13, 0x43, 0x68, + 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, + 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, + 0x74, 0x22, 0x40, 0x0a, 0x08, 0x56, 0x53, 0x43, 0x43, 0x41, 0x72, 0x67, 0x73, 0x12, 0x34, 0x0a, + 0x16, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x73, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x70, 0x6f, 0x6c, + 0x69, 0x63, 0x79, 0x5f, 0x72, 0x65, 0x66, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x14, 0x65, + 0x6e, 0x64, 0x6f, 0x72, 0x73, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, + 0x52, 0x65, 0x66, 0x22, 0x2a, 0x0a, 0x14, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, + 0x45, 0x6e, 0x64, 0x6f, 0x72, 0x73, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, + 0x7e, 0x0a, 0x0a, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x54, 0x72, 0x65, 0x65, 0x12, 0x35, 0x0a, + 0x0e, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x43, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x0d, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x43, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x12, 0x39, 0x0a, 0x10, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x73, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, + 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x0f, + 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x42, + 0xa0, 0x01, 0x0a, 0x22, 0x6f, 0x72, 0x67, 0x2e, 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x65, 0x64, + 0x67, 0x65, 0x72, 0x2e, 0x66, 0x61, 0x62, 0x72, 0x69, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x73, 0x2e, 0x70, 0x65, 0x65, 0x72, 0x42, 0x0e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x32, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, + 0x2f, 0x66, 0x61, 0x62, 0x72, 0x69, 0x63, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2d, 0x67, + 0x6f, 0x2d, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x70, 0x65, 0x65, 0x72, 0xa2, 0x02, 0x03, 0x50, + 0x58, 0x58, 0xaa, 0x02, 0x06, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0xca, 0x02, 0x06, 0x50, 0x72, + 0x6f, 0x74, 0x6f, 0x73, 0xe2, 0x02, 0x12, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x5c, 0x47, 0x50, + 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x06, 0x50, 0x72, 0x6f, 0x74, + 0x6f, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_peer_resources_proto_rawDescOnce sync.Once + file_peer_resources_proto_rawDescData = file_peer_resources_proto_rawDesc +) + +func file_peer_resources_proto_rawDescGZIP() []byte { + file_peer_resources_proto_rawDescOnce.Do(func() { + file_peer_resources_proto_rawDescData = protoimpl.X.CompressGZIP(file_peer_resources_proto_rawDescData) + }) + return file_peer_resources_proto_rawDescData +} + +var file_peer_resources_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +var file_peer_resources_proto_goTypes = []interface{}{ + (*ChaincodeIdentifier)(nil), // 0: protos.ChaincodeIdentifier + (*ChaincodeValidation)(nil), // 1: protos.ChaincodeValidation + (*VSCCArgs)(nil), // 2: protos.VSCCArgs + (*ChaincodeEndorsement)(nil), // 3: protos.ChaincodeEndorsement + (*ConfigTree)(nil), // 4: protos.ConfigTree + (*common.Config)(nil), // 5: common.Config +} +var file_peer_resources_proto_depIdxs = []int32{ + 5, // 0: protos.ConfigTree.channel_config:type_name -> common.Config + 5, // 1: protos.ConfigTree.resources_config:type_name -> common.Config + 2, // [2:2] is the sub-list for method output_type + 2, // [2:2] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_peer_resources_proto_init() } +func file_peer_resources_proto_init() { + if File_peer_resources_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_peer_resources_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChaincodeIdentifier); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peer_resources_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChaincodeValidation); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peer_resources_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*VSCCArgs); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peer_resources_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChaincodeEndorsement); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peer_resources_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ConfigTree); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_peer_resources_proto_rawDesc, + NumEnums: 0, + NumMessages: 5, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_peer_resources_proto_goTypes, + DependencyIndexes: file_peer_resources_proto_depIdxs, + MessageInfos: file_peer_resources_proto_msgTypes, + }.Build() + File_peer_resources_proto = out.File + file_peer_resources_proto_rawDesc = nil + file_peer_resources_proto_goTypes = nil + file_peer_resources_proto_depIdxs = nil +} diff --git a/vendor/github.com/hyperledger/fabric-protos-go-apiv2/peer/signed_cc_dep_spec.pb.go b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/peer/signed_cc_dep_spec.pb.go new file mode 100644 index 00000000000..4c31baa7736 --- /dev/null +++ b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/peer/signed_cc_dep_spec.pb.go @@ -0,0 +1,197 @@ +// Copyright the Hyperledger Fabric contributors. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: peer/signed_cc_dep_spec.proto + +package peer + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// SignedChaincodeDeploymentSpec carries the CDS along with endorsements +type SignedChaincodeDeploymentSpec struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // This is the bytes of the ChaincodeDeploymentSpec + ChaincodeDeploymentSpec []byte `protobuf:"bytes,1,opt,name=chaincode_deployment_spec,json=chaincodeDeploymentSpec,proto3" json:"chaincode_deployment_spec,omitempty"` + // This is the instantiation policy which is identical in structure + // to endorsement policy. This policy is checked by the VSCC at commit + // time on the instantiation (all peers will get the same policy as it + // will be part of the LSCC instantation record and will be part of the + // hash as well) + InstantiationPolicy []byte `protobuf:"bytes,2,opt,name=instantiation_policy,json=instantiationPolicy,proto3" json:"instantiation_policy,omitempty"` + // The endorsements of the above deployment spec, the owner's signature over + // chaincode_deployment_spec and Endorsement.endorser. + OwnerEndorsements []*Endorsement `protobuf:"bytes,3,rep,name=owner_endorsements,json=ownerEndorsements,proto3" json:"owner_endorsements,omitempty"` +} + +func (x *SignedChaincodeDeploymentSpec) Reset() { + *x = SignedChaincodeDeploymentSpec{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_signed_cc_dep_spec_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SignedChaincodeDeploymentSpec) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SignedChaincodeDeploymentSpec) ProtoMessage() {} + +func (x *SignedChaincodeDeploymentSpec) ProtoReflect() protoreflect.Message { + mi := &file_peer_signed_cc_dep_spec_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SignedChaincodeDeploymentSpec.ProtoReflect.Descriptor instead. +func (*SignedChaincodeDeploymentSpec) Descriptor() ([]byte, []int) { + return file_peer_signed_cc_dep_spec_proto_rawDescGZIP(), []int{0} +} + +func (x *SignedChaincodeDeploymentSpec) GetChaincodeDeploymentSpec() []byte { + if x != nil { + return x.ChaincodeDeploymentSpec + } + return nil +} + +func (x *SignedChaincodeDeploymentSpec) GetInstantiationPolicy() []byte { + if x != nil { + return x.InstantiationPolicy + } + return nil +} + +func (x *SignedChaincodeDeploymentSpec) GetOwnerEndorsements() []*Endorsement { + if x != nil { + return x.OwnerEndorsements + } + return nil +} + +var File_peer_signed_cc_dep_spec_proto protoreflect.FileDescriptor + +var file_peer_signed_cc_dep_spec_proto_rawDesc = []byte{ + 0x0a, 0x1d, 0x70, 0x65, 0x65, 0x72, 0x2f, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x5f, 0x63, 0x63, + 0x5f, 0x64, 0x65, 0x70, 0x5f, 0x73, 0x70, 0x65, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x1a, 0x1c, 0x70, 0x65, 0x65, 0x72, 0x2f, 0x70, 0x72, + 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xd2, 0x01, 0x0a, 0x1d, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, + 0x43, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, + 0x65, 0x6e, 0x74, 0x53, 0x70, 0x65, 0x63, 0x12, 0x3a, 0x0a, 0x19, 0x63, 0x68, 0x61, 0x69, 0x6e, + 0x63, 0x6f, 0x64, 0x65, 0x5f, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x5f, + 0x73, 0x70, 0x65, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x17, 0x63, 0x68, 0x61, 0x69, + 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x53, + 0x70, 0x65, 0x63, 0x12, 0x31, 0x0a, 0x14, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x69, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x13, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x69, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x42, 0x0a, 0x12, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x5f, + 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x73, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x45, 0x6e, 0x64, 0x6f, + 0x72, 0x73, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x11, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x45, 0x6e, + 0x64, 0x6f, 0x72, 0x73, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x42, 0xa6, 0x01, 0x0a, 0x22, 0x6f, + 0x72, 0x67, 0x2e, 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2e, 0x66, + 0x61, 0x62, 0x72, 0x69, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x70, 0x65, 0x65, + 0x72, 0x42, 0x14, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x43, 0x63, 0x44, 0x65, 0x70, 0x53, 0x70, + 0x65, 0x63, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x32, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x65, 0x64, 0x67, 0x65, + 0x72, 0x2f, 0x66, 0x61, 0x62, 0x72, 0x69, 0x63, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2d, + 0x67, 0x6f, 0x2d, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x70, 0x65, 0x65, 0x72, 0xa2, 0x02, 0x03, + 0x50, 0x58, 0x58, 0xaa, 0x02, 0x06, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0xca, 0x02, 0x06, 0x50, + 0x72, 0x6f, 0x74, 0x6f, 0x73, 0xe2, 0x02, 0x12, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x5c, 0x47, + 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x06, 0x50, 0x72, 0x6f, + 0x74, 0x6f, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_peer_signed_cc_dep_spec_proto_rawDescOnce sync.Once + file_peer_signed_cc_dep_spec_proto_rawDescData = file_peer_signed_cc_dep_spec_proto_rawDesc +) + +func file_peer_signed_cc_dep_spec_proto_rawDescGZIP() []byte { + file_peer_signed_cc_dep_spec_proto_rawDescOnce.Do(func() { + file_peer_signed_cc_dep_spec_proto_rawDescData = protoimpl.X.CompressGZIP(file_peer_signed_cc_dep_spec_proto_rawDescData) + }) + return file_peer_signed_cc_dep_spec_proto_rawDescData +} + +var file_peer_signed_cc_dep_spec_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_peer_signed_cc_dep_spec_proto_goTypes = []interface{}{ + (*SignedChaincodeDeploymentSpec)(nil), // 0: protos.SignedChaincodeDeploymentSpec + (*Endorsement)(nil), // 1: protos.Endorsement +} +var file_peer_signed_cc_dep_spec_proto_depIdxs = []int32{ + 1, // 0: protos.SignedChaincodeDeploymentSpec.owner_endorsements:type_name -> protos.Endorsement + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_peer_signed_cc_dep_spec_proto_init() } +func file_peer_signed_cc_dep_spec_proto_init() { + if File_peer_signed_cc_dep_spec_proto != nil { + return + } + file_peer_proposal_response_proto_init() + if !protoimpl.UnsafeEnabled { + file_peer_signed_cc_dep_spec_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SignedChaincodeDeploymentSpec); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_peer_signed_cc_dep_spec_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_peer_signed_cc_dep_spec_proto_goTypes, + DependencyIndexes: file_peer_signed_cc_dep_spec_proto_depIdxs, + MessageInfos: file_peer_signed_cc_dep_spec_proto_msgTypes, + }.Build() + File_peer_signed_cc_dep_spec_proto = out.File + file_peer_signed_cc_dep_spec_proto_rawDesc = nil + file_peer_signed_cc_dep_spec_proto_goTypes = nil + file_peer_signed_cc_dep_spec_proto_depIdxs = nil +} diff --git a/vendor/github.com/hyperledger/fabric-protos-go-apiv2/peer/snapshot.pb.go b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/peer/snapshot.pb.go new file mode 100644 index 00000000000..4f9494c9af4 --- /dev/null +++ b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/peer/snapshot.pb.go @@ -0,0 +1,432 @@ +// Copyright the Hyperledger Fabric contributors. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: peer/snapshot.proto + +package peer + +import ( + common "github.com/hyperledger/fabric-protos-go-apiv2/common" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + emptypb "google.golang.org/protobuf/types/known/emptypb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// SnapshotRequest contains information for a generate/cancel snapshot request +type SnapshotRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The signature header that contains creator identity and nonce + SignatureHeader *common.SignatureHeader `protobuf:"bytes,1,opt,name=signature_header,json=signatureHeader,proto3" json:"signature_header,omitempty"` + // The channel ID + ChannelId string `protobuf:"bytes,2,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` + // The block number to generate a snapshot + BlockNumber uint64 `protobuf:"varint,3,opt,name=block_number,json=blockNumber,proto3" json:"block_number,omitempty"` +} + +func (x *SnapshotRequest) Reset() { + *x = SnapshotRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_snapshot_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SnapshotRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SnapshotRequest) ProtoMessage() {} + +func (x *SnapshotRequest) ProtoReflect() protoreflect.Message { + mi := &file_peer_snapshot_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SnapshotRequest.ProtoReflect.Descriptor instead. +func (*SnapshotRequest) Descriptor() ([]byte, []int) { + return file_peer_snapshot_proto_rawDescGZIP(), []int{0} +} + +func (x *SnapshotRequest) GetSignatureHeader() *common.SignatureHeader { + if x != nil { + return x.SignatureHeader + } + return nil +} + +func (x *SnapshotRequest) GetChannelId() string { + if x != nil { + return x.ChannelId + } + return "" +} + +func (x *SnapshotRequest) GetBlockNumber() uint64 { + if x != nil { + return x.BlockNumber + } + return 0 +} + +// SnapshotQuery contains information for a query snapshot request +type SnapshotQuery struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The signature header that contains creator identity and nonce + SignatureHeader *common.SignatureHeader `protobuf:"bytes,1,opt,name=signature_header,json=signatureHeader,proto3" json:"signature_header,omitempty"` + // The channel ID + ChannelId string `protobuf:"bytes,2,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` +} + +func (x *SnapshotQuery) Reset() { + *x = SnapshotQuery{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_snapshot_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SnapshotQuery) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SnapshotQuery) ProtoMessage() {} + +func (x *SnapshotQuery) ProtoReflect() protoreflect.Message { + mi := &file_peer_snapshot_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SnapshotQuery.ProtoReflect.Descriptor instead. +func (*SnapshotQuery) Descriptor() ([]byte, []int) { + return file_peer_snapshot_proto_rawDescGZIP(), []int{1} +} + +func (x *SnapshotQuery) GetSignatureHeader() *common.SignatureHeader { + if x != nil { + return x.SignatureHeader + } + return nil +} + +func (x *SnapshotQuery) GetChannelId() string { + if x != nil { + return x.ChannelId + } + return "" +} + +// SignedSnapshotRequest contains marshalled request bytes and signature +type SignedSnapshotRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The bytes of SnapshotRequest or SnapshotQuery + Request []byte `protobuf:"bytes,1,opt,name=request,proto3" json:"request,omitempty"` + // Signaure over request bytes; this signature is to be verified against the client identity + Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` +} + +func (x *SignedSnapshotRequest) Reset() { + *x = SignedSnapshotRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_snapshot_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SignedSnapshotRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SignedSnapshotRequest) ProtoMessage() {} + +func (x *SignedSnapshotRequest) ProtoReflect() protoreflect.Message { + mi := &file_peer_snapshot_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SignedSnapshotRequest.ProtoReflect.Descriptor instead. +func (*SignedSnapshotRequest) Descriptor() ([]byte, []int) { + return file_peer_snapshot_proto_rawDescGZIP(), []int{2} +} + +func (x *SignedSnapshotRequest) GetRequest() []byte { + if x != nil { + return x.Request + } + return nil +} + +func (x *SignedSnapshotRequest) GetSignature() []byte { + if x != nil { + return x.Signature + } + return nil +} + +// QueryPendingSnapshotsResponse specifies the response payload of a query pending snapshots request +type QueryPendingSnapshotsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + BlockNumbers []uint64 `protobuf:"varint,1,rep,packed,name=block_numbers,json=blockNumbers,proto3" json:"block_numbers,omitempty"` +} + +func (x *QueryPendingSnapshotsResponse) Reset() { + *x = QueryPendingSnapshotsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_snapshot_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryPendingSnapshotsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryPendingSnapshotsResponse) ProtoMessage() {} + +func (x *QueryPendingSnapshotsResponse) ProtoReflect() protoreflect.Message { + mi := &file_peer_snapshot_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use QueryPendingSnapshotsResponse.ProtoReflect.Descriptor instead. +func (*QueryPendingSnapshotsResponse) Descriptor() ([]byte, []int) { + return file_peer_snapshot_proto_rawDescGZIP(), []int{3} +} + +func (x *QueryPendingSnapshotsResponse) GetBlockNumbers() []uint64 { + if x != nil { + return x.BlockNumbers + } + return nil +} + +var File_peer_snapshot_proto protoreflect.FileDescriptor + +var file_peer_snapshot_proto_rawDesc = []byte{ + 0x0a, 0x13, 0x70, 0x65, 0x65, 0x72, 0x2f, 0x73, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x1a, 0x1b, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, + 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x13, 0x63, 0x6f, 0x6d, 0x6d, + 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, + 0x97, 0x01, 0x0a, 0x0f, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x42, 0x0a, 0x10, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, + 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, + 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, + 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, + 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x68, 0x61, 0x6e, 0x6e, + 0x65, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x68, 0x61, + 0x6e, 0x6e, 0x65, 0x6c, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, + 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x62, 0x6c, + 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, 0x72, 0x0a, 0x0d, 0x53, 0x6e, 0x61, + 0x70, 0x73, 0x68, 0x6f, 0x74, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x42, 0x0a, 0x10, 0x73, 0x69, + 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x53, 0x69, + 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0f, 0x73, + 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x1d, + 0x0a, 0x0a, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x09, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x49, 0x64, 0x22, 0x4f, 0x0a, + 0x15, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x44, + 0x0a, 0x1d, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x53, 0x6e, + 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x23, 0x0a, 0x0d, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x04, 0x52, 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, + 0x62, 0x65, 0x72, 0x73, 0x32, 0xeb, 0x01, 0x0a, 0x08, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, + 0x74, 0x12, 0x43, 0x0a, 0x08, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x12, 0x1d, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x53, 0x6e, 0x61, + 0x70, 0x73, 0x68, 0x6f, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, + 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x41, 0x0a, 0x06, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, + 0x12, 0x1d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, + 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x57, 0x0a, 0x0d, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x1d, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, + 0x6f, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x73, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x53, + 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x00, 0x42, 0x9f, 0x01, 0x0a, 0x22, 0x6f, 0x72, 0x67, 0x2e, 0x68, 0x79, 0x70, 0x65, 0x72, + 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2e, 0x66, 0x61, 0x62, 0x72, 0x69, 0x63, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x70, 0x65, 0x65, 0x72, 0x42, 0x0d, 0x53, 0x6e, 0x61, 0x70, 0x73, + 0x68, 0x6f, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x32, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x65, 0x64, 0x67, + 0x65, 0x72, 0x2f, 0x66, 0x61, 0x62, 0x72, 0x69, 0x63, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, + 0x2d, 0x67, 0x6f, 0x2d, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x70, 0x65, 0x65, 0x72, 0xa2, 0x02, + 0x03, 0x50, 0x58, 0x58, 0xaa, 0x02, 0x06, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0xca, 0x02, 0x06, + 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0xe2, 0x02, 0x12, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x5c, + 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x06, 0x50, 0x72, + 0x6f, 0x74, 0x6f, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_peer_snapshot_proto_rawDescOnce sync.Once + file_peer_snapshot_proto_rawDescData = file_peer_snapshot_proto_rawDesc +) + +func file_peer_snapshot_proto_rawDescGZIP() []byte { + file_peer_snapshot_proto_rawDescOnce.Do(func() { + file_peer_snapshot_proto_rawDescData = protoimpl.X.CompressGZIP(file_peer_snapshot_proto_rawDescData) + }) + return file_peer_snapshot_proto_rawDescData +} + +var file_peer_snapshot_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_peer_snapshot_proto_goTypes = []interface{}{ + (*SnapshotRequest)(nil), // 0: protos.SnapshotRequest + (*SnapshotQuery)(nil), // 1: protos.SnapshotQuery + (*SignedSnapshotRequest)(nil), // 2: protos.SignedSnapshotRequest + (*QueryPendingSnapshotsResponse)(nil), // 3: protos.QueryPendingSnapshotsResponse + (*common.SignatureHeader)(nil), // 4: common.SignatureHeader + (*emptypb.Empty)(nil), // 5: google.protobuf.Empty +} +var file_peer_snapshot_proto_depIdxs = []int32{ + 4, // 0: protos.SnapshotRequest.signature_header:type_name -> common.SignatureHeader + 4, // 1: protos.SnapshotQuery.signature_header:type_name -> common.SignatureHeader + 2, // 2: protos.Snapshot.Generate:input_type -> protos.SignedSnapshotRequest + 2, // 3: protos.Snapshot.Cancel:input_type -> protos.SignedSnapshotRequest + 2, // 4: protos.Snapshot.QueryPendings:input_type -> protos.SignedSnapshotRequest + 5, // 5: protos.Snapshot.Generate:output_type -> google.protobuf.Empty + 5, // 6: protos.Snapshot.Cancel:output_type -> google.protobuf.Empty + 3, // 7: protos.Snapshot.QueryPendings:output_type -> protos.QueryPendingSnapshotsResponse + 5, // [5:8] is the sub-list for method output_type + 2, // [2:5] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_peer_snapshot_proto_init() } +func file_peer_snapshot_proto_init() { + if File_peer_snapshot_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_peer_snapshot_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SnapshotRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peer_snapshot_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SnapshotQuery); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peer_snapshot_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SignedSnapshotRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peer_snapshot_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryPendingSnapshotsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_peer_snapshot_proto_rawDesc, + NumEnums: 0, + NumMessages: 4, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_peer_snapshot_proto_goTypes, + DependencyIndexes: file_peer_snapshot_proto_depIdxs, + MessageInfos: file_peer_snapshot_proto_msgTypes, + }.Build() + File_peer_snapshot_proto = out.File + file_peer_snapshot_proto_rawDesc = nil + file_peer_snapshot_proto_goTypes = nil + file_peer_snapshot_proto_depIdxs = nil +} diff --git a/vendor/github.com/hyperledger/fabric-protos-go-apiv2/peer/snapshot_grpc.pb.go b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/peer/snapshot_grpc.pb.go new file mode 100644 index 00000000000..466f8eedc93 --- /dev/null +++ b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/peer/snapshot_grpc.pb.go @@ -0,0 +1,192 @@ +// Copyright the Hyperledger Fabric contributors. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: peer/snapshot.proto + +package peer + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + emptypb "google.golang.org/protobuf/types/known/emptypb" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + Snapshot_Generate_FullMethodName = "/protos.Snapshot/Generate" + Snapshot_Cancel_FullMethodName = "/protos.Snapshot/Cancel" + Snapshot_QueryPendings_FullMethodName = "/protos.Snapshot/QueryPendings" +) + +// SnapshotClient is the client API for Snapshot service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type SnapshotClient interface { + // Generate a snapshot reqeust. SignedSnapshotRequest contains marshalled bytes for SnaphostRequest + Generate(ctx context.Context, in *SignedSnapshotRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // Cancel a snapshot reqeust. SignedSnapshotRequest contains marshalled bytes for SnaphostRequest + Cancel(ctx context.Context, in *SignedSnapshotRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // Query pending snapshots query. SignedSnapshotRequest contains marshalled bytes for SnaphostQuery + QueryPendings(ctx context.Context, in *SignedSnapshotRequest, opts ...grpc.CallOption) (*QueryPendingSnapshotsResponse, error) +} + +type snapshotClient struct { + cc grpc.ClientConnInterface +} + +func NewSnapshotClient(cc grpc.ClientConnInterface) SnapshotClient { + return &snapshotClient{cc} +} + +func (c *snapshotClient) Generate(ctx context.Context, in *SignedSnapshotRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, Snapshot_Generate_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *snapshotClient) Cancel(ctx context.Context, in *SignedSnapshotRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, Snapshot_Cancel_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *snapshotClient) QueryPendings(ctx context.Context, in *SignedSnapshotRequest, opts ...grpc.CallOption) (*QueryPendingSnapshotsResponse, error) { + out := new(QueryPendingSnapshotsResponse) + err := c.cc.Invoke(ctx, Snapshot_QueryPendings_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// SnapshotServer is the server API for Snapshot service. +// All implementations should embed UnimplementedSnapshotServer +// for forward compatibility +type SnapshotServer interface { + // Generate a snapshot reqeust. SignedSnapshotRequest contains marshalled bytes for SnaphostRequest + Generate(context.Context, *SignedSnapshotRequest) (*emptypb.Empty, error) + // Cancel a snapshot reqeust. SignedSnapshotRequest contains marshalled bytes for SnaphostRequest + Cancel(context.Context, *SignedSnapshotRequest) (*emptypb.Empty, error) + // Query pending snapshots query. SignedSnapshotRequest contains marshalled bytes for SnaphostQuery + QueryPendings(context.Context, *SignedSnapshotRequest) (*QueryPendingSnapshotsResponse, error) +} + +// UnimplementedSnapshotServer should be embedded to have forward compatible implementations. +type UnimplementedSnapshotServer struct { +} + +func (UnimplementedSnapshotServer) Generate(context.Context, *SignedSnapshotRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method Generate not implemented") +} +func (UnimplementedSnapshotServer) Cancel(context.Context, *SignedSnapshotRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method Cancel not implemented") +} +func (UnimplementedSnapshotServer) QueryPendings(context.Context, *SignedSnapshotRequest) (*QueryPendingSnapshotsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryPendings not implemented") +} + +// UnsafeSnapshotServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to SnapshotServer will +// result in compilation errors. +type UnsafeSnapshotServer interface { + mustEmbedUnimplementedSnapshotServer() +} + +func RegisterSnapshotServer(s grpc.ServiceRegistrar, srv SnapshotServer) { + s.RegisterService(&Snapshot_ServiceDesc, srv) +} + +func _Snapshot_Generate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SignedSnapshotRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SnapshotServer).Generate(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Snapshot_Generate_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SnapshotServer).Generate(ctx, req.(*SignedSnapshotRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Snapshot_Cancel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SignedSnapshotRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SnapshotServer).Cancel(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Snapshot_Cancel_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SnapshotServer).Cancel(ctx, req.(*SignedSnapshotRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Snapshot_QueryPendings_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SignedSnapshotRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SnapshotServer).QueryPendings(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Snapshot_QueryPendings_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SnapshotServer).QueryPendings(ctx, req.(*SignedSnapshotRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// Snapshot_ServiceDesc is the grpc.ServiceDesc for Snapshot service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Snapshot_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "protos.Snapshot", + HandlerType: (*SnapshotServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Generate", + Handler: _Snapshot_Generate_Handler, + }, + { + MethodName: "Cancel", + Handler: _Snapshot_Cancel_Handler, + }, + { + MethodName: "QueryPendings", + Handler: _Snapshot_QueryPendings_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "peer/snapshot.proto", +} diff --git a/vendor/github.com/hyperledger/fabric-protos-go-apiv2/peer/transaction.pb.go b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/peer/transaction.pb.go new file mode 100644 index 00000000000..dc094f2627f --- /dev/null +++ b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/peer/transaction.pb.go @@ -0,0 +1,741 @@ +// Copyright the Hyperledger Fabric contributors. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: peer/transaction.proto + +package peer + +import ( + common "github.com/hyperledger/fabric-protos-go-apiv2/common" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type TxValidationCode int32 + +const ( + TxValidationCode_VALID TxValidationCode = 0 + TxValidationCode_NIL_ENVELOPE TxValidationCode = 1 + TxValidationCode_BAD_PAYLOAD TxValidationCode = 2 + TxValidationCode_BAD_COMMON_HEADER TxValidationCode = 3 + TxValidationCode_BAD_CREATOR_SIGNATURE TxValidationCode = 4 + TxValidationCode_INVALID_ENDORSER_TRANSACTION TxValidationCode = 5 + TxValidationCode_INVALID_CONFIG_TRANSACTION TxValidationCode = 6 + TxValidationCode_UNSUPPORTED_TX_PAYLOAD TxValidationCode = 7 + TxValidationCode_BAD_PROPOSAL_TXID TxValidationCode = 8 + TxValidationCode_DUPLICATE_TXID TxValidationCode = 9 + TxValidationCode_ENDORSEMENT_POLICY_FAILURE TxValidationCode = 10 + TxValidationCode_MVCC_READ_CONFLICT TxValidationCode = 11 + TxValidationCode_PHANTOM_READ_CONFLICT TxValidationCode = 12 + TxValidationCode_UNKNOWN_TX_TYPE TxValidationCode = 13 + TxValidationCode_TARGET_CHAIN_NOT_FOUND TxValidationCode = 14 + TxValidationCode_MARSHAL_TX_ERROR TxValidationCode = 15 + TxValidationCode_NIL_TXACTION TxValidationCode = 16 + TxValidationCode_EXPIRED_CHAINCODE TxValidationCode = 17 + TxValidationCode_CHAINCODE_VERSION_CONFLICT TxValidationCode = 18 + TxValidationCode_BAD_HEADER_EXTENSION TxValidationCode = 19 + TxValidationCode_BAD_CHANNEL_HEADER TxValidationCode = 20 + TxValidationCode_BAD_RESPONSE_PAYLOAD TxValidationCode = 21 + TxValidationCode_BAD_RWSET TxValidationCode = 22 + TxValidationCode_ILLEGAL_WRITESET TxValidationCode = 23 + TxValidationCode_INVALID_WRITESET TxValidationCode = 24 + TxValidationCode_INVALID_CHAINCODE TxValidationCode = 25 + TxValidationCode_NOT_VALIDATED TxValidationCode = 254 + TxValidationCode_INVALID_OTHER_REASON TxValidationCode = 255 +) + +// Enum value maps for TxValidationCode. +var ( + TxValidationCode_name = map[int32]string{ + 0: "VALID", + 1: "NIL_ENVELOPE", + 2: "BAD_PAYLOAD", + 3: "BAD_COMMON_HEADER", + 4: "BAD_CREATOR_SIGNATURE", + 5: "INVALID_ENDORSER_TRANSACTION", + 6: "INVALID_CONFIG_TRANSACTION", + 7: "UNSUPPORTED_TX_PAYLOAD", + 8: "BAD_PROPOSAL_TXID", + 9: "DUPLICATE_TXID", + 10: "ENDORSEMENT_POLICY_FAILURE", + 11: "MVCC_READ_CONFLICT", + 12: "PHANTOM_READ_CONFLICT", + 13: "UNKNOWN_TX_TYPE", + 14: "TARGET_CHAIN_NOT_FOUND", + 15: "MARSHAL_TX_ERROR", + 16: "NIL_TXACTION", + 17: "EXPIRED_CHAINCODE", + 18: "CHAINCODE_VERSION_CONFLICT", + 19: "BAD_HEADER_EXTENSION", + 20: "BAD_CHANNEL_HEADER", + 21: "BAD_RESPONSE_PAYLOAD", + 22: "BAD_RWSET", + 23: "ILLEGAL_WRITESET", + 24: "INVALID_WRITESET", + 25: "INVALID_CHAINCODE", + 254: "NOT_VALIDATED", + 255: "INVALID_OTHER_REASON", + } + TxValidationCode_value = map[string]int32{ + "VALID": 0, + "NIL_ENVELOPE": 1, + "BAD_PAYLOAD": 2, + "BAD_COMMON_HEADER": 3, + "BAD_CREATOR_SIGNATURE": 4, + "INVALID_ENDORSER_TRANSACTION": 5, + "INVALID_CONFIG_TRANSACTION": 6, + "UNSUPPORTED_TX_PAYLOAD": 7, + "BAD_PROPOSAL_TXID": 8, + "DUPLICATE_TXID": 9, + "ENDORSEMENT_POLICY_FAILURE": 10, + "MVCC_READ_CONFLICT": 11, + "PHANTOM_READ_CONFLICT": 12, + "UNKNOWN_TX_TYPE": 13, + "TARGET_CHAIN_NOT_FOUND": 14, + "MARSHAL_TX_ERROR": 15, + "NIL_TXACTION": 16, + "EXPIRED_CHAINCODE": 17, + "CHAINCODE_VERSION_CONFLICT": 18, + "BAD_HEADER_EXTENSION": 19, + "BAD_CHANNEL_HEADER": 20, + "BAD_RESPONSE_PAYLOAD": 21, + "BAD_RWSET": 22, + "ILLEGAL_WRITESET": 23, + "INVALID_WRITESET": 24, + "INVALID_CHAINCODE": 25, + "NOT_VALIDATED": 254, + "INVALID_OTHER_REASON": 255, + } +) + +func (x TxValidationCode) Enum() *TxValidationCode { + p := new(TxValidationCode) + *p = x + return p +} + +func (x TxValidationCode) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (TxValidationCode) Descriptor() protoreflect.EnumDescriptor { + return file_peer_transaction_proto_enumTypes[0].Descriptor() +} + +func (TxValidationCode) Type() protoreflect.EnumType { + return &file_peer_transaction_proto_enumTypes[0] +} + +func (x TxValidationCode) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use TxValidationCode.Descriptor instead. +func (TxValidationCode) EnumDescriptor() ([]byte, []int) { + return file_peer_transaction_proto_rawDescGZIP(), []int{0} +} + +// Reserved entries in the key-level metadata map +type MetaDataKeys int32 + +const ( + MetaDataKeys_VALIDATION_PARAMETER MetaDataKeys = 0 + MetaDataKeys_VALIDATION_PARAMETER_V2 MetaDataKeys = 1 +) + +// Enum value maps for MetaDataKeys. +var ( + MetaDataKeys_name = map[int32]string{ + 0: "VALIDATION_PARAMETER", + 1: "VALIDATION_PARAMETER_V2", + } + MetaDataKeys_value = map[string]int32{ + "VALIDATION_PARAMETER": 0, + "VALIDATION_PARAMETER_V2": 1, + } +) + +func (x MetaDataKeys) Enum() *MetaDataKeys { + p := new(MetaDataKeys) + *p = x + return p +} + +func (x MetaDataKeys) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (MetaDataKeys) Descriptor() protoreflect.EnumDescriptor { + return file_peer_transaction_proto_enumTypes[1].Descriptor() +} + +func (MetaDataKeys) Type() protoreflect.EnumType { + return &file_peer_transaction_proto_enumTypes[1] +} + +func (x MetaDataKeys) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use MetaDataKeys.Descriptor instead. +func (MetaDataKeys) EnumDescriptor() ([]byte, []int) { + return file_peer_transaction_proto_rawDescGZIP(), []int{1} +} + +// ProcessedTransaction wraps an Envelope that includes a transaction along with an indication +// of whether the transaction was validated or invalidated by committing peer. +// The use case is that GetTransactionByID API needs to retrieve the transaction Envelope +// from block storage, and return it to a client, and indicate whether the transaction +// was validated or invalidated by committing peer. So that the originally submitted +// transaction Envelope is not modified, the ProcessedTransaction wrapper is returned. +type ProcessedTransaction struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // An Envelope which includes a processed transaction + TransactionEnvelope *common.Envelope `protobuf:"bytes,1,opt,name=transactionEnvelope,proto3" json:"transactionEnvelope,omitempty"` + // An indication of whether the transaction was validated or invalidated by committing peer + ValidationCode int32 `protobuf:"varint,2,opt,name=validationCode,proto3" json:"validationCode,omitempty"` +} + +func (x *ProcessedTransaction) Reset() { + *x = ProcessedTransaction{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_transaction_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ProcessedTransaction) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ProcessedTransaction) ProtoMessage() {} + +func (x *ProcessedTransaction) ProtoReflect() protoreflect.Message { + mi := &file_peer_transaction_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ProcessedTransaction.ProtoReflect.Descriptor instead. +func (*ProcessedTransaction) Descriptor() ([]byte, []int) { + return file_peer_transaction_proto_rawDescGZIP(), []int{0} +} + +func (x *ProcessedTransaction) GetTransactionEnvelope() *common.Envelope { + if x != nil { + return x.TransactionEnvelope + } + return nil +} + +func (x *ProcessedTransaction) GetValidationCode() int32 { + if x != nil { + return x.ValidationCode + } + return 0 +} + +// The transaction to be sent to the ordering service. A transaction contains +// one or more TransactionAction. Each TransactionAction binds a proposal to +// potentially multiple actions. The transaction is atomic meaning that either +// all actions in the transaction will be committed or none will. Note that +// while a Transaction might include more than one Header, the Header.creator +// field must be the same in each. +// A single client is free to issue a number of independent Proposal, each with +// their header (Header) and request payload (ChaincodeProposalPayload). Each +// proposal is independently endorsed generating an action +// (ProposalResponsePayload) with one signature per Endorser. Any number of +// independent proposals (and their action) might be included in a transaction +// to ensure that they are treated atomically. +type Transaction struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The payload is an array of TransactionAction. An array is necessary to + // accommodate multiple actions per transaction + Actions []*TransactionAction `protobuf:"bytes,1,rep,name=actions,proto3" json:"actions,omitempty"` +} + +func (x *Transaction) Reset() { + *x = Transaction{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_transaction_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Transaction) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Transaction) ProtoMessage() {} + +func (x *Transaction) ProtoReflect() protoreflect.Message { + mi := &file_peer_transaction_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Transaction.ProtoReflect.Descriptor instead. +func (*Transaction) Descriptor() ([]byte, []int) { + return file_peer_transaction_proto_rawDescGZIP(), []int{1} +} + +func (x *Transaction) GetActions() []*TransactionAction { + if x != nil { + return x.Actions + } + return nil +} + +// TransactionAction binds a proposal to its action. The type field in the +// header dictates the type of action to be applied to the ledger. +type TransactionAction struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The header of the proposal action, which is the proposal header + Header []byte `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + // The payload of the action as defined by the type in the header For + // chaincode, it's the bytes of ChaincodeActionPayload + Payload []byte `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"` +} + +func (x *TransactionAction) Reset() { + *x = TransactionAction{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_transaction_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TransactionAction) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TransactionAction) ProtoMessage() {} + +func (x *TransactionAction) ProtoReflect() protoreflect.Message { + mi := &file_peer_transaction_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TransactionAction.ProtoReflect.Descriptor instead. +func (*TransactionAction) Descriptor() ([]byte, []int) { + return file_peer_transaction_proto_rawDescGZIP(), []int{2} +} + +func (x *TransactionAction) GetHeader() []byte { + if x != nil { + return x.Header + } + return nil +} + +func (x *TransactionAction) GetPayload() []byte { + if x != nil { + return x.Payload + } + return nil +} + +// ChaincodeActionPayload is the message to be used for the TransactionAction's +// payload when the Header's type is set to CHAINCODE. It carries the +// chaincodeProposalPayload and an endorsed action to apply to the ledger. +type ChaincodeActionPayload struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // This field contains the bytes of the ChaincodeProposalPayload message from + // the original invocation (essentially the arguments) after the application + // of the visibility function. The main visibility modes are "full" (the + // entire ChaincodeProposalPayload message is included here), "hash" (only + // the hash of the ChaincodeProposalPayload message is included) or + // "nothing". This field will be used to check the consistency of + // ProposalResponsePayload.proposalHash. For the CHAINCODE type, + // ProposalResponsePayload.proposalHash is supposed to be H(ProposalHeader || + // f(ChaincodeProposalPayload)) where f is the visibility function. + ChaincodeProposalPayload []byte `protobuf:"bytes,1,opt,name=chaincode_proposal_payload,json=chaincodeProposalPayload,proto3" json:"chaincode_proposal_payload,omitempty"` + // The list of actions to apply to the ledger + Action *ChaincodeEndorsedAction `protobuf:"bytes,2,opt,name=action,proto3" json:"action,omitempty"` +} + +func (x *ChaincodeActionPayload) Reset() { + *x = ChaincodeActionPayload{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_transaction_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChaincodeActionPayload) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChaincodeActionPayload) ProtoMessage() {} + +func (x *ChaincodeActionPayload) ProtoReflect() protoreflect.Message { + mi := &file_peer_transaction_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ChaincodeActionPayload.ProtoReflect.Descriptor instead. +func (*ChaincodeActionPayload) Descriptor() ([]byte, []int) { + return file_peer_transaction_proto_rawDescGZIP(), []int{3} +} + +func (x *ChaincodeActionPayload) GetChaincodeProposalPayload() []byte { + if x != nil { + return x.ChaincodeProposalPayload + } + return nil +} + +func (x *ChaincodeActionPayload) GetAction() *ChaincodeEndorsedAction { + if x != nil { + return x.Action + } + return nil +} + +// ChaincodeEndorsedAction carries information about the endorsement of a +// specific proposal +type ChaincodeEndorsedAction struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // This is the bytes of the ProposalResponsePayload message signed by the + // endorsers. Recall that for the CHAINCODE type, the + // ProposalResponsePayload's extenstion field carries a ChaincodeAction + ProposalResponsePayload []byte `protobuf:"bytes,1,opt,name=proposal_response_payload,json=proposalResponsePayload,proto3" json:"proposal_response_payload,omitempty"` + // The endorsement of the proposal, basically the endorser's signature over + // proposalResponsePayload + Endorsements []*Endorsement `protobuf:"bytes,2,rep,name=endorsements,proto3" json:"endorsements,omitempty"` +} + +func (x *ChaincodeEndorsedAction) Reset() { + *x = ChaincodeEndorsedAction{} + if protoimpl.UnsafeEnabled { + mi := &file_peer_transaction_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChaincodeEndorsedAction) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChaincodeEndorsedAction) ProtoMessage() {} + +func (x *ChaincodeEndorsedAction) ProtoReflect() protoreflect.Message { + mi := &file_peer_transaction_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ChaincodeEndorsedAction.ProtoReflect.Descriptor instead. +func (*ChaincodeEndorsedAction) Descriptor() ([]byte, []int) { + return file_peer_transaction_proto_rawDescGZIP(), []int{4} +} + +func (x *ChaincodeEndorsedAction) GetProposalResponsePayload() []byte { + if x != nil { + return x.ProposalResponsePayload + } + return nil +} + +func (x *ChaincodeEndorsedAction) GetEndorsements() []*Endorsement { + if x != nil { + return x.Endorsements + } + return nil +} + +var File_peer_transaction_proto protoreflect.FileDescriptor + +var file_peer_transaction_proto_rawDesc = []byte{ + 0x0a, 0x16, 0x70, 0x65, 0x65, 0x72, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, + 0x1a, 0x1c, 0x70, 0x65, 0x65, 0x72, 0x2f, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, + 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x13, + 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x22, 0x82, 0x01, 0x0a, 0x14, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x65, + 0x64, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x42, 0x0a, 0x13, + 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x76, 0x65, 0x6c, + 0x6f, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, + 0x6f, 0x6e, 0x2e, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x52, 0x13, 0x74, 0x72, 0x61, + 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, + 0x12, 0x26, 0x0a, 0x0e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, + 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x22, 0x42, 0x0a, 0x0b, 0x54, 0x72, 0x61, 0x6e, + 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x33, 0x0a, 0x07, 0x61, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x73, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x45, 0x0a, 0x11, + 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x79, + 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, + 0x6f, 0x61, 0x64, 0x22, 0x8f, 0x01, 0x0a, 0x16, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, + 0x65, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x3c, + 0x0a, 0x1a, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x5f, 0x70, 0x72, 0x6f, 0x70, + 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x18, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x50, 0x72, 0x6f, + 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x37, 0x0a, 0x06, + 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x45, + 0x6e, 0x64, 0x6f, 0x72, 0x73, 0x65, 0x64, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x06, 0x61, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x8e, 0x01, 0x0a, 0x17, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x63, + 0x6f, 0x64, 0x65, 0x45, 0x6e, 0x64, 0x6f, 0x72, 0x73, 0x65, 0x64, 0x41, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x3a, 0x0a, 0x19, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x72, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x5f, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x17, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x37, 0x0a, + 0x0c, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x73, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x45, 0x6e, 0x64, + 0x6f, 0x72, 0x73, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x0c, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x73, + 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2a, 0xab, 0x05, 0x0a, 0x10, 0x54, 0x78, 0x56, 0x61, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x09, 0x0a, 0x05, 0x56, + 0x41, 0x4c, 0x49, 0x44, 0x10, 0x00, 0x12, 0x10, 0x0a, 0x0c, 0x4e, 0x49, 0x4c, 0x5f, 0x45, 0x4e, + 0x56, 0x45, 0x4c, 0x4f, 0x50, 0x45, 0x10, 0x01, 0x12, 0x0f, 0x0a, 0x0b, 0x42, 0x41, 0x44, 0x5f, + 0x50, 0x41, 0x59, 0x4c, 0x4f, 0x41, 0x44, 0x10, 0x02, 0x12, 0x15, 0x0a, 0x11, 0x42, 0x41, 0x44, + 0x5f, 0x43, 0x4f, 0x4d, 0x4d, 0x4f, 0x4e, 0x5f, 0x48, 0x45, 0x41, 0x44, 0x45, 0x52, 0x10, 0x03, + 0x12, 0x19, 0x0a, 0x15, 0x42, 0x41, 0x44, 0x5f, 0x43, 0x52, 0x45, 0x41, 0x54, 0x4f, 0x52, 0x5f, + 0x53, 0x49, 0x47, 0x4e, 0x41, 0x54, 0x55, 0x52, 0x45, 0x10, 0x04, 0x12, 0x20, 0x0a, 0x1c, 0x49, + 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x45, 0x4e, 0x44, 0x4f, 0x52, 0x53, 0x45, 0x52, 0x5f, + 0x54, 0x52, 0x41, 0x4e, 0x53, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x05, 0x12, 0x1e, 0x0a, + 0x1a, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x43, 0x4f, 0x4e, 0x46, 0x49, 0x47, 0x5f, + 0x54, 0x52, 0x41, 0x4e, 0x53, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x06, 0x12, 0x1a, 0x0a, + 0x16, 0x55, 0x4e, 0x53, 0x55, 0x50, 0x50, 0x4f, 0x52, 0x54, 0x45, 0x44, 0x5f, 0x54, 0x58, 0x5f, + 0x50, 0x41, 0x59, 0x4c, 0x4f, 0x41, 0x44, 0x10, 0x07, 0x12, 0x15, 0x0a, 0x11, 0x42, 0x41, 0x44, + 0x5f, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x54, 0x58, 0x49, 0x44, 0x10, 0x08, + 0x12, 0x12, 0x0a, 0x0e, 0x44, 0x55, 0x50, 0x4c, 0x49, 0x43, 0x41, 0x54, 0x45, 0x5f, 0x54, 0x58, + 0x49, 0x44, 0x10, 0x09, 0x12, 0x1e, 0x0a, 0x1a, 0x45, 0x4e, 0x44, 0x4f, 0x52, 0x53, 0x45, 0x4d, + 0x45, 0x4e, 0x54, 0x5f, 0x50, 0x4f, 0x4c, 0x49, 0x43, 0x59, 0x5f, 0x46, 0x41, 0x49, 0x4c, 0x55, + 0x52, 0x45, 0x10, 0x0a, 0x12, 0x16, 0x0a, 0x12, 0x4d, 0x56, 0x43, 0x43, 0x5f, 0x52, 0x45, 0x41, + 0x44, 0x5f, 0x43, 0x4f, 0x4e, 0x46, 0x4c, 0x49, 0x43, 0x54, 0x10, 0x0b, 0x12, 0x19, 0x0a, 0x15, + 0x50, 0x48, 0x41, 0x4e, 0x54, 0x4f, 0x4d, 0x5f, 0x52, 0x45, 0x41, 0x44, 0x5f, 0x43, 0x4f, 0x4e, + 0x46, 0x4c, 0x49, 0x43, 0x54, 0x10, 0x0c, 0x12, 0x13, 0x0a, 0x0f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, + 0x57, 0x4e, 0x5f, 0x54, 0x58, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x10, 0x0d, 0x12, 0x1a, 0x0a, 0x16, + 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x43, 0x48, 0x41, 0x49, 0x4e, 0x5f, 0x4e, 0x4f, 0x54, + 0x5f, 0x46, 0x4f, 0x55, 0x4e, 0x44, 0x10, 0x0e, 0x12, 0x14, 0x0a, 0x10, 0x4d, 0x41, 0x52, 0x53, + 0x48, 0x41, 0x4c, 0x5f, 0x54, 0x58, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x0f, 0x12, 0x10, + 0x0a, 0x0c, 0x4e, 0x49, 0x4c, 0x5f, 0x54, 0x58, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x10, + 0x12, 0x15, 0x0a, 0x11, 0x45, 0x58, 0x50, 0x49, 0x52, 0x45, 0x44, 0x5f, 0x43, 0x48, 0x41, 0x49, + 0x4e, 0x43, 0x4f, 0x44, 0x45, 0x10, 0x11, 0x12, 0x1e, 0x0a, 0x1a, 0x43, 0x48, 0x41, 0x49, 0x4e, + 0x43, 0x4f, 0x44, 0x45, 0x5f, 0x56, 0x45, 0x52, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x43, 0x4f, 0x4e, + 0x46, 0x4c, 0x49, 0x43, 0x54, 0x10, 0x12, 0x12, 0x18, 0x0a, 0x14, 0x42, 0x41, 0x44, 0x5f, 0x48, + 0x45, 0x41, 0x44, 0x45, 0x52, 0x5f, 0x45, 0x58, 0x54, 0x45, 0x4e, 0x53, 0x49, 0x4f, 0x4e, 0x10, + 0x13, 0x12, 0x16, 0x0a, 0x12, 0x42, 0x41, 0x44, 0x5f, 0x43, 0x48, 0x41, 0x4e, 0x4e, 0x45, 0x4c, + 0x5f, 0x48, 0x45, 0x41, 0x44, 0x45, 0x52, 0x10, 0x14, 0x12, 0x18, 0x0a, 0x14, 0x42, 0x41, 0x44, + 0x5f, 0x52, 0x45, 0x53, 0x50, 0x4f, 0x4e, 0x53, 0x45, 0x5f, 0x50, 0x41, 0x59, 0x4c, 0x4f, 0x41, + 0x44, 0x10, 0x15, 0x12, 0x0d, 0x0a, 0x09, 0x42, 0x41, 0x44, 0x5f, 0x52, 0x57, 0x53, 0x45, 0x54, + 0x10, 0x16, 0x12, 0x14, 0x0a, 0x10, 0x49, 0x4c, 0x4c, 0x45, 0x47, 0x41, 0x4c, 0x5f, 0x57, 0x52, + 0x49, 0x54, 0x45, 0x53, 0x45, 0x54, 0x10, 0x17, 0x12, 0x14, 0x0a, 0x10, 0x49, 0x4e, 0x56, 0x41, + 0x4c, 0x49, 0x44, 0x5f, 0x57, 0x52, 0x49, 0x54, 0x45, 0x53, 0x45, 0x54, 0x10, 0x18, 0x12, 0x15, + 0x0a, 0x11, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x43, 0x48, 0x41, 0x49, 0x4e, 0x43, + 0x4f, 0x44, 0x45, 0x10, 0x19, 0x12, 0x12, 0x0a, 0x0d, 0x4e, 0x4f, 0x54, 0x5f, 0x56, 0x41, 0x4c, + 0x49, 0x44, 0x41, 0x54, 0x45, 0x44, 0x10, 0xfe, 0x01, 0x12, 0x19, 0x0a, 0x14, 0x49, 0x4e, 0x56, + 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x4f, 0x54, 0x48, 0x45, 0x52, 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, + 0x4e, 0x10, 0xff, 0x01, 0x2a, 0x45, 0x0a, 0x0c, 0x4d, 0x65, 0x74, 0x61, 0x44, 0x61, 0x74, 0x61, + 0x4b, 0x65, 0x79, 0x73, 0x12, 0x18, 0x0a, 0x14, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x41, 0x54, 0x49, + 0x4f, 0x4e, 0x5f, 0x50, 0x41, 0x52, 0x41, 0x4d, 0x45, 0x54, 0x45, 0x52, 0x10, 0x00, 0x12, 0x1b, + 0x0a, 0x17, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x50, 0x41, 0x52, + 0x41, 0x4d, 0x45, 0x54, 0x45, 0x52, 0x5f, 0x56, 0x32, 0x10, 0x01, 0x42, 0xa2, 0x01, 0x0a, 0x22, + 0x6f, 0x72, 0x67, 0x2e, 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2e, + 0x66, 0x61, 0x62, 0x72, 0x69, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x70, 0x65, + 0x65, 0x72, 0x42, 0x10, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x50, + 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x32, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2f, 0x66, + 0x61, 0x62, 0x72, 0x69, 0x63, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2d, 0x67, 0x6f, 0x2d, + 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x70, 0x65, 0x65, 0x72, 0xa2, 0x02, 0x03, 0x50, 0x58, 0x58, + 0xaa, 0x02, 0x06, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0xca, 0x02, 0x06, 0x50, 0x72, 0x6f, 0x74, + 0x6f, 0x73, 0xe2, 0x02, 0x12, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x5c, 0x47, 0x50, 0x42, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x06, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x73, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_peer_transaction_proto_rawDescOnce sync.Once + file_peer_transaction_proto_rawDescData = file_peer_transaction_proto_rawDesc +) + +func file_peer_transaction_proto_rawDescGZIP() []byte { + file_peer_transaction_proto_rawDescOnce.Do(func() { + file_peer_transaction_proto_rawDescData = protoimpl.X.CompressGZIP(file_peer_transaction_proto_rawDescData) + }) + return file_peer_transaction_proto_rawDescData +} + +var file_peer_transaction_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_peer_transaction_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +var file_peer_transaction_proto_goTypes = []interface{}{ + (TxValidationCode)(0), // 0: protos.TxValidationCode + (MetaDataKeys)(0), // 1: protos.MetaDataKeys + (*ProcessedTransaction)(nil), // 2: protos.ProcessedTransaction + (*Transaction)(nil), // 3: protos.Transaction + (*TransactionAction)(nil), // 4: protos.TransactionAction + (*ChaincodeActionPayload)(nil), // 5: protos.ChaincodeActionPayload + (*ChaincodeEndorsedAction)(nil), // 6: protos.ChaincodeEndorsedAction + (*common.Envelope)(nil), // 7: common.Envelope + (*Endorsement)(nil), // 8: protos.Endorsement +} +var file_peer_transaction_proto_depIdxs = []int32{ + 7, // 0: protos.ProcessedTransaction.transactionEnvelope:type_name -> common.Envelope + 4, // 1: protos.Transaction.actions:type_name -> protos.TransactionAction + 6, // 2: protos.ChaincodeActionPayload.action:type_name -> protos.ChaincodeEndorsedAction + 8, // 3: protos.ChaincodeEndorsedAction.endorsements:type_name -> protos.Endorsement + 4, // [4:4] is the sub-list for method output_type + 4, // [4:4] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name +} + +func init() { file_peer_transaction_proto_init() } +func file_peer_transaction_proto_init() { + if File_peer_transaction_proto != nil { + return + } + file_peer_proposal_response_proto_init() + if !protoimpl.UnsafeEnabled { + file_peer_transaction_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ProcessedTransaction); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peer_transaction_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Transaction); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peer_transaction_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TransactionAction); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peer_transaction_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChaincodeActionPayload); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_peer_transaction_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChaincodeEndorsedAction); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_peer_transaction_proto_rawDesc, + NumEnums: 2, + NumMessages: 5, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_peer_transaction_proto_goTypes, + DependencyIndexes: file_peer_transaction_proto_depIdxs, + EnumInfos: file_peer_transaction_proto_enumTypes, + MessageInfos: file_peer_transaction_proto_msgTypes, + }.Build() + File_peer_transaction_proto = out.File + file_peer_transaction_proto_rawDesc = nil + file_peer_transaction_proto_goTypes = nil + file_peer_transaction_proto_depIdxs = nil +} diff --git a/vendor/github.com/hyperledger/fabric-protos-go-apiv2/transientstore/transientstore.pb.go b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/transientstore/transientstore.pb.go new file mode 100644 index 00000000000..b4ee02279a3 --- /dev/null +++ b/vendor/github.com/hyperledger/fabric-protos-go-apiv2/transientstore/transientstore.pb.go @@ -0,0 +1,210 @@ +// Copyright the Hyperledger Fabric contributors. All rights reserved. +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: transientstore/transientstore.proto + +package transientstore + +import ( + rwset "github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset" + peer "github.com/hyperledger/fabric-protos-go-apiv2/peer" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// TxPvtReadWriteSetWithConfigInfo encapsulates the transaction's private +// read-write set and additional information about the configurations such as +// the latest collection config when the transaction is simulated +type TxPvtReadWriteSetWithConfigInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + EndorsedAt uint64 `protobuf:"varint,1,opt,name=endorsed_at,json=endorsedAt,proto3" json:"endorsed_at,omitempty"` + PvtRwset *rwset.TxPvtReadWriteSet `protobuf:"bytes,2,opt,name=pvt_rwset,json=pvtRwset,proto3" json:"pvt_rwset,omitempty"` + CollectionConfigs map[string]*peer.CollectionConfigPackage `protobuf:"bytes,3,rep,name=collection_configs,json=collectionConfigs,proto3" json:"collection_configs,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *TxPvtReadWriteSetWithConfigInfo) Reset() { + *x = TxPvtReadWriteSetWithConfigInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_transientstore_transientstore_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TxPvtReadWriteSetWithConfigInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TxPvtReadWriteSetWithConfigInfo) ProtoMessage() {} + +func (x *TxPvtReadWriteSetWithConfigInfo) ProtoReflect() protoreflect.Message { + mi := &file_transientstore_transientstore_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TxPvtReadWriteSetWithConfigInfo.ProtoReflect.Descriptor instead. +func (*TxPvtReadWriteSetWithConfigInfo) Descriptor() ([]byte, []int) { + return file_transientstore_transientstore_proto_rawDescGZIP(), []int{0} +} + +func (x *TxPvtReadWriteSetWithConfigInfo) GetEndorsedAt() uint64 { + if x != nil { + return x.EndorsedAt + } + return 0 +} + +func (x *TxPvtReadWriteSetWithConfigInfo) GetPvtRwset() *rwset.TxPvtReadWriteSet { + if x != nil { + return x.PvtRwset + } + return nil +} + +func (x *TxPvtReadWriteSetWithConfigInfo) GetCollectionConfigs() map[string]*peer.CollectionConfigPackage { + if x != nil { + return x.CollectionConfigs + } + return nil +} + +var File_transientstore_transientstore_proto protoreflect.FileDescriptor + +var file_transientstore_transientstore_proto_rawDesc = []byte{ + 0x0a, 0x23, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x74, 0x6f, 0x72, 0x65, + 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x65, 0x6e, 0x74, + 0x73, 0x74, 0x6f, 0x72, 0x65, 0x1a, 0x18, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x2f, 0x72, 0x77, + 0x73, 0x65, 0x74, 0x2f, 0x72, 0x77, 0x73, 0x65, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x15, 0x70, 0x65, 0x65, 0x72, 0x2f, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xd7, 0x02, 0x0a, 0x1f, 0x54, 0x78, 0x50, 0x76, 0x74, + 0x52, 0x65, 0x61, 0x64, 0x57, 0x72, 0x69, 0x74, 0x65, 0x53, 0x65, 0x74, 0x57, 0x69, 0x74, 0x68, + 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1f, 0x0a, 0x0b, 0x65, 0x6e, + 0x64, 0x6f, 0x72, 0x73, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x0a, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x73, 0x65, 0x64, 0x41, 0x74, 0x12, 0x35, 0x0a, 0x09, 0x70, + 0x76, 0x74, 0x5f, 0x72, 0x77, 0x73, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, + 0x2e, 0x72, 0x77, 0x73, 0x65, 0x74, 0x2e, 0x54, 0x78, 0x50, 0x76, 0x74, 0x52, 0x65, 0x61, 0x64, + 0x57, 0x72, 0x69, 0x74, 0x65, 0x53, 0x65, 0x74, 0x52, 0x08, 0x70, 0x76, 0x74, 0x52, 0x77, 0x73, + 0x65, 0x74, 0x12, 0x75, 0x0a, 0x12, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x46, + 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, + 0x54, 0x78, 0x50, 0x76, 0x74, 0x52, 0x65, 0x61, 0x64, 0x57, 0x72, 0x69, 0x74, 0x65, 0x53, 0x65, + 0x74, 0x57, 0x69, 0x74, 0x68, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x49, 0x6e, 0x66, 0x6f, 0x2e, + 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x11, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x1a, 0x65, 0x0a, 0x16, 0x43, 0x6f, 0x6c, + 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x45, 0x6e, + 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x35, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x43, 0x6f, + 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x50, 0x61, + 0x63, 0x6b, 0x61, 0x67, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, + 0x42, 0xd9, 0x01, 0x0a, 0x2c, 0x6f, 0x72, 0x67, 0x2e, 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x65, + 0x64, 0x67, 0x65, 0x72, 0x2e, 0x66, 0x61, 0x62, 0x72, 0x69, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x73, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x74, 0x6f, 0x72, + 0x65, 0x42, 0x13, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x74, 0x6f, 0x72, + 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x79, 0x70, 0x65, 0x72, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, + 0x2f, 0x66, 0x61, 0x62, 0x72, 0x69, 0x63, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2d, 0x67, + 0x6f, 0x2d, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x65, 0x6e, + 0x74, 0x73, 0x74, 0x6f, 0x72, 0x65, 0xa2, 0x02, 0x03, 0x54, 0x58, 0x58, 0xaa, 0x02, 0x0e, 0x54, + 0x72, 0x61, 0x6e, 0x73, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x74, 0x6f, 0x72, 0x65, 0xca, 0x02, 0x0e, + 0x54, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x74, 0x6f, 0x72, 0x65, 0xe2, 0x02, + 0x1a, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5c, + 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0e, 0x54, 0x72, + 0x61, 0x6e, 0x73, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_transientstore_transientstore_proto_rawDescOnce sync.Once + file_transientstore_transientstore_proto_rawDescData = file_transientstore_transientstore_proto_rawDesc +) + +func file_transientstore_transientstore_proto_rawDescGZIP() []byte { + file_transientstore_transientstore_proto_rawDescOnce.Do(func() { + file_transientstore_transientstore_proto_rawDescData = protoimpl.X.CompressGZIP(file_transientstore_transientstore_proto_rawDescData) + }) + return file_transientstore_transientstore_proto_rawDescData +} + +var file_transientstore_transientstore_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_transientstore_transientstore_proto_goTypes = []interface{}{ + (*TxPvtReadWriteSetWithConfigInfo)(nil), // 0: transientstore.TxPvtReadWriteSetWithConfigInfo + nil, // 1: transientstore.TxPvtReadWriteSetWithConfigInfo.CollectionConfigsEntry + (*rwset.TxPvtReadWriteSet)(nil), // 2: rwset.TxPvtReadWriteSet + (*peer.CollectionConfigPackage)(nil), // 3: protos.CollectionConfigPackage +} +var file_transientstore_transientstore_proto_depIdxs = []int32{ + 2, // 0: transientstore.TxPvtReadWriteSetWithConfigInfo.pvt_rwset:type_name -> rwset.TxPvtReadWriteSet + 1, // 1: transientstore.TxPvtReadWriteSetWithConfigInfo.collection_configs:type_name -> transientstore.TxPvtReadWriteSetWithConfigInfo.CollectionConfigsEntry + 3, // 2: transientstore.TxPvtReadWriteSetWithConfigInfo.CollectionConfigsEntry.value:type_name -> protos.CollectionConfigPackage + 3, // [3:3] is the sub-list for method output_type + 3, // [3:3] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name +} + +func init() { file_transientstore_transientstore_proto_init() } +func file_transientstore_transientstore_proto_init() { + if File_transientstore_transientstore_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_transientstore_transientstore_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TxPvtReadWriteSetWithConfigInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_transientstore_transientstore_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_transientstore_transientstore_proto_goTypes, + DependencyIndexes: file_transientstore_transientstore_proto_depIdxs, + MessageInfos: file_transientstore_transientstore_proto_msgTypes, + }.Build() + File_transientstore_transientstore_proto = out.File + file_transientstore_transientstore_proto_rawDesc = nil + file_transientstore_transientstore_proto_goTypes = nil + file_transientstore_transientstore_proto_depIdxs = nil +} diff --git a/vendor/github.com/hyperledger/fabric-protos-go/common/collection.pb.go b/vendor/github.com/hyperledger/fabric-protos-go/common/collection.pb.go deleted file mode 100644 index 3f40021d21d..00000000000 --- a/vendor/github.com/hyperledger/fabric-protos-go/common/collection.pb.go +++ /dev/null @@ -1,373 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: common/collection.proto - -package common - -import ( - fmt "fmt" - proto "github.com/golang/protobuf/proto" - math "math" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package - -// CollectionConfigPackage represents an array of CollectionConfig -// messages; the extra struct is required because repeated oneof is -// forbidden by the protobuf syntax -// -// Deprecated: Do not use. -type CollectionConfigPackage struct { - Config []*CollectionConfig `protobuf:"bytes,1,rep,name=config,proto3" json:"config,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CollectionConfigPackage) Reset() { *m = CollectionConfigPackage{} } -func (m *CollectionConfigPackage) String() string { return proto.CompactTextString(m) } -func (*CollectionConfigPackage) ProtoMessage() {} -func (*CollectionConfigPackage) Descriptor() ([]byte, []int) { - return fileDescriptor_89f245fc544906c7, []int{0} -} - -func (m *CollectionConfigPackage) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CollectionConfigPackage.Unmarshal(m, b) -} -func (m *CollectionConfigPackage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CollectionConfigPackage.Marshal(b, m, deterministic) -} -func (m *CollectionConfigPackage) XXX_Merge(src proto.Message) { - xxx_messageInfo_CollectionConfigPackage.Merge(m, src) -} -func (m *CollectionConfigPackage) XXX_Size() int { - return xxx_messageInfo_CollectionConfigPackage.Size(m) -} -func (m *CollectionConfigPackage) XXX_DiscardUnknown() { - xxx_messageInfo_CollectionConfigPackage.DiscardUnknown(m) -} - -var xxx_messageInfo_CollectionConfigPackage proto.InternalMessageInfo - -func (m *CollectionConfigPackage) GetConfig() []*CollectionConfig { - if m != nil { - return m.Config - } - return nil -} - -// CollectionConfig defines the configuration of a collection object; -// it currently contains a single, static type. -// Dynamic collections are deferred. -// -// Deprecated: Do not use. -type CollectionConfig struct { - // Types that are valid to be assigned to Payload: - // - // *CollectionConfig_StaticCollectionConfig - Payload isCollectionConfig_Payload `protobuf_oneof:"payload"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CollectionConfig) Reset() { *m = CollectionConfig{} } -func (m *CollectionConfig) String() string { return proto.CompactTextString(m) } -func (*CollectionConfig) ProtoMessage() {} -func (*CollectionConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_89f245fc544906c7, []int{1} -} - -func (m *CollectionConfig) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CollectionConfig.Unmarshal(m, b) -} -func (m *CollectionConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CollectionConfig.Marshal(b, m, deterministic) -} -func (m *CollectionConfig) XXX_Merge(src proto.Message) { - xxx_messageInfo_CollectionConfig.Merge(m, src) -} -func (m *CollectionConfig) XXX_Size() int { - return xxx_messageInfo_CollectionConfig.Size(m) -} -func (m *CollectionConfig) XXX_DiscardUnknown() { - xxx_messageInfo_CollectionConfig.DiscardUnknown(m) -} - -var xxx_messageInfo_CollectionConfig proto.InternalMessageInfo - -type isCollectionConfig_Payload interface { - isCollectionConfig_Payload() -} - -type CollectionConfig_StaticCollectionConfig struct { - StaticCollectionConfig *StaticCollectionConfig `protobuf:"bytes,1,opt,name=static_collection_config,json=staticCollectionConfig,proto3,oneof"` -} - -func (*CollectionConfig_StaticCollectionConfig) isCollectionConfig_Payload() {} - -func (m *CollectionConfig) GetPayload() isCollectionConfig_Payload { - if m != nil { - return m.Payload - } - return nil -} - -func (m *CollectionConfig) GetStaticCollectionConfig() *StaticCollectionConfig { - if x, ok := m.GetPayload().(*CollectionConfig_StaticCollectionConfig); ok { - return x.StaticCollectionConfig - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*CollectionConfig) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*CollectionConfig_StaticCollectionConfig)(nil), - } -} - -// StaticCollectionConfig constitutes the configuration parameters of a -// static collection object. Static collections are collections that are -// known at chaincode instantiation time, and that cannot be changed. -// Dynamic collections are deferred. -// -// Deprecated: Do not use. -type StaticCollectionConfig struct { - // the name of the collection inside the denoted chaincode - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // a reference to a policy residing / managed in the config block - // to define which orgs have access to this collection’s private data - MemberOrgsPolicy *CollectionPolicyConfig `protobuf:"bytes,2,opt,name=member_orgs_policy,json=memberOrgsPolicy,proto3" json:"member_orgs_policy,omitempty"` - // The minimum number of peers private data will be sent to upon - // endorsement. The endorsement would fail if dissemination to at least - // this number of peers is not achieved. - RequiredPeerCount int32 `protobuf:"varint,3,opt,name=required_peer_count,json=requiredPeerCount,proto3" json:"required_peer_count,omitempty"` - // The maximum number of peers that private data will be sent to - // upon endorsement. This number has to be bigger than required_peer_count. - MaximumPeerCount int32 `protobuf:"varint,4,opt,name=maximum_peer_count,json=maximumPeerCount,proto3" json:"maximum_peer_count,omitempty"` - // The number of blocks after which the collection data expires. - // For instance if the value is set to 10, a key last modified by block number 100 - // will be purged at block number 111. A zero value is treated same as MaxUint64 - BlockToLive uint64 `protobuf:"varint,5,opt,name=block_to_live,json=blockToLive,proto3" json:"block_to_live,omitempty"` - // The member only read access denotes whether only collection member clients - // can read the private data (if set to true), or even non members can - // read the data (if set to false, for example if you want to implement more granular - // access logic in the chaincode) - MemberOnlyRead bool `protobuf:"varint,6,opt,name=member_only_read,json=memberOnlyRead,proto3" json:"member_only_read,omitempty"` - // The member only write access denotes whether only collection member clients - // can write the private data (if set to true), or even non members can - // write the data (if set to false, for example if you want to implement more granular - // access logic in the chaincode) - MemberOnlyWrite bool `protobuf:"varint,7,opt,name=member_only_write,json=memberOnlyWrite,proto3" json:"member_only_write,omitempty"` - // a reference to a policy residing / managed in the config block - // to define the endorsement policy for this collection - EndorsementPolicy *ApplicationPolicy `protobuf:"bytes,8,opt,name=endorsement_policy,json=endorsementPolicy,proto3" json:"endorsement_policy,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *StaticCollectionConfig) Reset() { *m = StaticCollectionConfig{} } -func (m *StaticCollectionConfig) String() string { return proto.CompactTextString(m) } -func (*StaticCollectionConfig) ProtoMessage() {} -func (*StaticCollectionConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_89f245fc544906c7, []int{2} -} - -func (m *StaticCollectionConfig) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_StaticCollectionConfig.Unmarshal(m, b) -} -func (m *StaticCollectionConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_StaticCollectionConfig.Marshal(b, m, deterministic) -} -func (m *StaticCollectionConfig) XXX_Merge(src proto.Message) { - xxx_messageInfo_StaticCollectionConfig.Merge(m, src) -} -func (m *StaticCollectionConfig) XXX_Size() int { - return xxx_messageInfo_StaticCollectionConfig.Size(m) -} -func (m *StaticCollectionConfig) XXX_DiscardUnknown() { - xxx_messageInfo_StaticCollectionConfig.DiscardUnknown(m) -} - -var xxx_messageInfo_StaticCollectionConfig proto.InternalMessageInfo - -func (m *StaticCollectionConfig) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *StaticCollectionConfig) GetMemberOrgsPolicy() *CollectionPolicyConfig { - if m != nil { - return m.MemberOrgsPolicy - } - return nil -} - -func (m *StaticCollectionConfig) GetRequiredPeerCount() int32 { - if m != nil { - return m.RequiredPeerCount - } - return 0 -} - -func (m *StaticCollectionConfig) GetMaximumPeerCount() int32 { - if m != nil { - return m.MaximumPeerCount - } - return 0 -} - -func (m *StaticCollectionConfig) GetBlockToLive() uint64 { - if m != nil { - return m.BlockToLive - } - return 0 -} - -func (m *StaticCollectionConfig) GetMemberOnlyRead() bool { - if m != nil { - return m.MemberOnlyRead - } - return false -} - -func (m *StaticCollectionConfig) GetMemberOnlyWrite() bool { - if m != nil { - return m.MemberOnlyWrite - } - return false -} - -func (m *StaticCollectionConfig) GetEndorsementPolicy() *ApplicationPolicy { - if m != nil { - return m.EndorsementPolicy - } - return nil -} - -// Collection policy configuration. Initially, the configuration can only -// contain a SignaturePolicy. In the future, the SignaturePolicy may be a -// more general Policy. Instead of containing the actual policy, the -// configuration may in the future contain a string reference to a policy. -// -// Deprecated: Do not use. -type CollectionPolicyConfig struct { - // Types that are valid to be assigned to Payload: - // - // *CollectionPolicyConfig_SignaturePolicy - Payload isCollectionPolicyConfig_Payload `protobuf_oneof:"payload"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CollectionPolicyConfig) Reset() { *m = CollectionPolicyConfig{} } -func (m *CollectionPolicyConfig) String() string { return proto.CompactTextString(m) } -func (*CollectionPolicyConfig) ProtoMessage() {} -func (*CollectionPolicyConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_89f245fc544906c7, []int{3} -} - -func (m *CollectionPolicyConfig) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CollectionPolicyConfig.Unmarshal(m, b) -} -func (m *CollectionPolicyConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CollectionPolicyConfig.Marshal(b, m, deterministic) -} -func (m *CollectionPolicyConfig) XXX_Merge(src proto.Message) { - xxx_messageInfo_CollectionPolicyConfig.Merge(m, src) -} -func (m *CollectionPolicyConfig) XXX_Size() int { - return xxx_messageInfo_CollectionPolicyConfig.Size(m) -} -func (m *CollectionPolicyConfig) XXX_DiscardUnknown() { - xxx_messageInfo_CollectionPolicyConfig.DiscardUnknown(m) -} - -var xxx_messageInfo_CollectionPolicyConfig proto.InternalMessageInfo - -type isCollectionPolicyConfig_Payload interface { - isCollectionPolicyConfig_Payload() -} - -type CollectionPolicyConfig_SignaturePolicy struct { - SignaturePolicy *SignaturePolicyEnvelope `protobuf:"bytes,1,opt,name=signature_policy,json=signaturePolicy,proto3,oneof"` -} - -func (*CollectionPolicyConfig_SignaturePolicy) isCollectionPolicyConfig_Payload() {} - -func (m *CollectionPolicyConfig) GetPayload() isCollectionPolicyConfig_Payload { - if m != nil { - return m.Payload - } - return nil -} - -func (m *CollectionPolicyConfig) GetSignaturePolicy() *SignaturePolicyEnvelope { - if x, ok := m.GetPayload().(*CollectionPolicyConfig_SignaturePolicy); ok { - return x.SignaturePolicy - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*CollectionPolicyConfig) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*CollectionPolicyConfig_SignaturePolicy)(nil), - } -} - -func init() { - proto.RegisterType((*CollectionConfigPackage)(nil), "common.CollectionConfigPackage") - proto.RegisterType((*CollectionConfig)(nil), "common.CollectionConfig") - proto.RegisterType((*StaticCollectionConfig)(nil), "common.StaticCollectionConfig") - proto.RegisterType((*CollectionPolicyConfig)(nil), "common.CollectionPolicyConfig") -} - -func init() { proto.RegisterFile("common/collection.proto", fileDescriptor_89f245fc544906c7) } - -var fileDescriptor_89f245fc544906c7 = []byte{ - // 479 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x93, 0xc1, 0x6f, 0xd3, 0x30, - 0x14, 0xc6, 0x97, 0xb5, 0xeb, 0x36, 0x57, 0xb0, 0xd4, 0x88, 0x2e, 0x70, 0x80, 0xaa, 0xe2, 0x10, - 0x21, 0x96, 0xa2, 0x71, 0xe3, 0xc6, 0x2a, 0xa4, 0x1e, 0x2a, 0xad, 0x0a, 0x08, 0xa4, 0x5d, 0x22, - 0xc7, 0x79, 0xcb, 0xac, 0x39, 0x76, 0xb0, 0x9d, 0x42, 0x0e, 0xfc, 0x2f, 0xfc, 0xa9, 0xa8, 0x76, - 0xd2, 0x74, 0x55, 0x6f, 0xed, 0xfb, 0x7e, 0xef, 0x7b, 0xcf, 0x9f, 0x5e, 0xd0, 0x25, 0x95, 0x45, - 0x21, 0xc5, 0x8c, 0x4a, 0xce, 0x81, 0x1a, 0x26, 0x45, 0x54, 0x2a, 0x69, 0x24, 0x1e, 0x38, 0xe1, - 0xf5, 0xcb, 0x06, 0x28, 0x25, 0x67, 0x94, 0x81, 0x76, 0xf2, 0xf4, 0x16, 0x5d, 0xce, 0xb7, 0x2d, - 0x73, 0x29, 0xee, 0x59, 0xbe, 0x22, 0xf4, 0x91, 0xe4, 0x80, 0x3f, 0xa2, 0x01, 0xb5, 0x85, 0xc0, - 0x9b, 0xf4, 0xc2, 0xe1, 0x75, 0x10, 0x39, 0x8b, 0x68, 0xbf, 0x21, 0x6e, 0xb8, 0xcf, 0xc7, 0x81, - 0x37, 0xfd, 0x8b, 0xfc, 0x7d, 0x1d, 0xdf, 0xa1, 0x40, 0x1b, 0x62, 0x18, 0x4d, 0xba, 0xf5, 0x92, - 0xad, 0xb7, 0x17, 0x0e, 0xaf, 0xdf, 0xb4, 0xde, 0xdf, 0x2c, 0xb7, 0xef, 0xb0, 0x38, 0x8a, 0xc7, - 0xfa, 0xa0, 0xb2, 0x99, 0x79, 0x73, 0x8e, 0x4e, 0x4b, 0x52, 0x73, 0x49, 0xb2, 0xe9, 0xbf, 0x1e, - 0x1a, 0x1f, 0xf6, 0xc0, 0x18, 0xf5, 0x05, 0x29, 0xc0, 0x4e, 0x3c, 0x8f, 0xed, 0x6f, 0xbc, 0x44, - 0xb8, 0x80, 0x22, 0x05, 0x95, 0x48, 0x95, 0xeb, 0xc4, 0x86, 0x53, 0x07, 0xc7, 0x4f, 0x77, 0xea, - 0x9c, 0x56, 0x56, 0x6f, 0x5e, 0xed, 0xbb, 0xce, 0x5b, 0x95, 0x6b, 0x57, 0xc7, 0x11, 0x7a, 0xa1, - 0xe0, 0x57, 0xc5, 0x14, 0x64, 0x49, 0x09, 0xa0, 0x12, 0x2a, 0x2b, 0x61, 0x82, 0xde, 0xc4, 0x0b, - 0x4f, 0xe2, 0x51, 0x2b, 0xad, 0x00, 0xd4, 0x7c, 0x23, 0xe0, 0x0f, 0x08, 0x17, 0xe4, 0x0f, 0x2b, - 0xaa, 0x62, 0x17, 0xef, 0x5b, 0xdc, 0x6f, 0x94, 0x8e, 0x9e, 0xa2, 0x67, 0x29, 0x97, 0xf4, 0x31, - 0x31, 0x32, 0xe1, 0x6c, 0x0d, 0xc1, 0xc9, 0xc4, 0x0b, 0xfb, 0xf1, 0xd0, 0x16, 0xbf, 0xcb, 0x25, - 0x5b, 0x03, 0x0e, 0x91, 0xdf, 0xbe, 0x47, 0xf0, 0x3a, 0x51, 0x40, 0xb2, 0x60, 0x30, 0xf1, 0xc2, - 0xb3, 0xf8, 0x79, 0xb3, 0xad, 0xe0, 0x75, 0x0c, 0x24, 0xc3, 0xef, 0xd1, 0x68, 0x97, 0xfc, 0xad, - 0x98, 0x81, 0xe0, 0xd4, 0xa2, 0x17, 0x1d, 0xfa, 0x73, 0x53, 0xc6, 0x0b, 0x84, 0x41, 0x64, 0x52, - 0x69, 0x28, 0x40, 0x98, 0x36, 0xa5, 0x33, 0x9b, 0xd2, 0xab, 0x36, 0xa5, 0x2f, 0x65, 0xc9, 0x19, - 0x25, 0x5d, 0x4c, 0xf1, 0x68, 0xa7, 0xc9, 0x95, 0xec, 0x85, 0x54, 0x68, 0x7c, 0x38, 0x51, 0xbc, - 0x44, 0xbe, 0x66, 0xb9, 0x20, 0xa6, 0x52, 0xd0, 0x4e, 0x71, 0xf7, 0xf1, 0x76, 0x7b, 0x1f, 0xad, - 0xee, 0x1a, 0xbf, 0x8a, 0x35, 0x70, 0x59, 0xc2, 0xe2, 0x28, 0xbe, 0xd0, 0x4f, 0xa5, 0xbd, 0xcb, - 0xb8, 0xf9, 0x81, 0xde, 0x49, 0x95, 0x47, 0x0f, 0x75, 0x09, 0x8a, 0x43, 0x96, 0x83, 0x8a, 0xee, - 0x49, 0xaa, 0x18, 0x75, 0x5f, 0x82, 0x6e, 0x26, 0xdc, 0x45, 0x39, 0x33, 0x0f, 0x55, 0xba, 0xf9, - 0x3b, 0xdb, 0x81, 0x67, 0x0e, 0xbe, 0x72, 0xf0, 0x55, 0x2e, 0x67, 0x8e, 0x4f, 0x07, 0xb6, 0xf2, - 0xe9, 0x7f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x86, 0x11, 0xe6, 0xd8, 0x82, 0x03, 0x00, 0x00, -} diff --git a/vendor/github.com/hyperledger/fabric-protos-go/common/common.pb.go b/vendor/github.com/hyperledger/fabric-protos-go/common/common.pb.go deleted file mode 100644 index 639b5bf5fb5..00000000000 --- a/vendor/github.com/hyperledger/fabric-protos-go/common/common.pb.go +++ /dev/null @@ -1,985 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: common/common.proto - -package common - -import ( - fmt "fmt" - proto "github.com/golang/protobuf/proto" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" - math "math" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package - -// These status codes are intended to resemble selected HTTP status codes -type Status int32 - -const ( - Status_UNKNOWN Status = 0 - Status_SUCCESS Status = 200 - Status_BAD_REQUEST Status = 400 - Status_FORBIDDEN Status = 403 - Status_NOT_FOUND Status = 404 - Status_REQUEST_ENTITY_TOO_LARGE Status = 413 - Status_INTERNAL_SERVER_ERROR Status = 500 - Status_NOT_IMPLEMENTED Status = 501 - Status_SERVICE_UNAVAILABLE Status = 503 -) - -var Status_name = map[int32]string{ - 0: "UNKNOWN", - 200: "SUCCESS", - 400: "BAD_REQUEST", - 403: "FORBIDDEN", - 404: "NOT_FOUND", - 413: "REQUEST_ENTITY_TOO_LARGE", - 500: "INTERNAL_SERVER_ERROR", - 501: "NOT_IMPLEMENTED", - 503: "SERVICE_UNAVAILABLE", -} - -var Status_value = map[string]int32{ - "UNKNOWN": 0, - "SUCCESS": 200, - "BAD_REQUEST": 400, - "FORBIDDEN": 403, - "NOT_FOUND": 404, - "REQUEST_ENTITY_TOO_LARGE": 413, - "INTERNAL_SERVER_ERROR": 500, - "NOT_IMPLEMENTED": 501, - "SERVICE_UNAVAILABLE": 503, -} - -func (x Status) String() string { - return proto.EnumName(Status_name, int32(x)) -} - -func (Status) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_8f954d82c0b891f6, []int{0} -} - -type HeaderType int32 - -const ( - HeaderType_MESSAGE HeaderType = 0 - HeaderType_CONFIG HeaderType = 1 - HeaderType_CONFIG_UPDATE HeaderType = 2 - HeaderType_ENDORSER_TRANSACTION HeaderType = 3 - HeaderType_ORDERER_TRANSACTION HeaderType = 4 // Deprecated: Do not use. - HeaderType_DELIVER_SEEK_INFO HeaderType = 5 - HeaderType_CHAINCODE_PACKAGE HeaderType = 6 -) - -var HeaderType_name = map[int32]string{ - 0: "MESSAGE", - 1: "CONFIG", - 2: "CONFIG_UPDATE", - 3: "ENDORSER_TRANSACTION", - 4: "ORDERER_TRANSACTION", - 5: "DELIVER_SEEK_INFO", - 6: "CHAINCODE_PACKAGE", -} - -var HeaderType_value = map[string]int32{ - "MESSAGE": 0, - "CONFIG": 1, - "CONFIG_UPDATE": 2, - "ENDORSER_TRANSACTION": 3, - "ORDERER_TRANSACTION": 4, - "DELIVER_SEEK_INFO": 5, - "CHAINCODE_PACKAGE": 6, -} - -func (x HeaderType) String() string { - return proto.EnumName(HeaderType_name, int32(x)) -} - -func (HeaderType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_8f954d82c0b891f6, []int{1} -} - -// This enum enlists indexes of the block metadata array -type BlockMetadataIndex int32 - -const ( - BlockMetadataIndex_SIGNATURES BlockMetadataIndex = 0 - BlockMetadataIndex_LAST_CONFIG BlockMetadataIndex = 1 // Deprecated: Do not use. - BlockMetadataIndex_TRANSACTIONS_FILTER BlockMetadataIndex = 2 - BlockMetadataIndex_ORDERER BlockMetadataIndex = 3 // Deprecated: Do not use. - BlockMetadataIndex_COMMIT_HASH BlockMetadataIndex = 4 -) - -var BlockMetadataIndex_name = map[int32]string{ - 0: "SIGNATURES", - 1: "LAST_CONFIG", - 2: "TRANSACTIONS_FILTER", - 3: "ORDERER", - 4: "COMMIT_HASH", -} - -var BlockMetadataIndex_value = map[string]int32{ - "SIGNATURES": 0, - "LAST_CONFIG": 1, - "TRANSACTIONS_FILTER": 2, - "ORDERER": 3, - "COMMIT_HASH": 4, -} - -func (x BlockMetadataIndex) String() string { - return proto.EnumName(BlockMetadataIndex_name, int32(x)) -} - -func (BlockMetadataIndex) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_8f954d82c0b891f6, []int{2} -} - -// LastConfig is the encoded value for the Metadata message which is encoded in the LAST_CONFIGURATION block metadata index -type LastConfig struct { - Index uint64 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *LastConfig) Reset() { *m = LastConfig{} } -func (m *LastConfig) String() string { return proto.CompactTextString(m) } -func (*LastConfig) ProtoMessage() {} -func (*LastConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_8f954d82c0b891f6, []int{0} -} - -func (m *LastConfig) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_LastConfig.Unmarshal(m, b) -} -func (m *LastConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_LastConfig.Marshal(b, m, deterministic) -} -func (m *LastConfig) XXX_Merge(src proto.Message) { - xxx_messageInfo_LastConfig.Merge(m, src) -} -func (m *LastConfig) XXX_Size() int { - return xxx_messageInfo_LastConfig.Size(m) -} -func (m *LastConfig) XXX_DiscardUnknown() { - xxx_messageInfo_LastConfig.DiscardUnknown(m) -} - -var xxx_messageInfo_LastConfig proto.InternalMessageInfo - -func (m *LastConfig) GetIndex() uint64 { - if m != nil { - return m.Index - } - return 0 -} - -// Metadata is a common structure to be used to encode block metadata -type Metadata struct { - Value []byte `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` - Signatures []*MetadataSignature `protobuf:"bytes,2,rep,name=signatures,proto3" json:"signatures,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Metadata) Reset() { *m = Metadata{} } -func (m *Metadata) String() string { return proto.CompactTextString(m) } -func (*Metadata) ProtoMessage() {} -func (*Metadata) Descriptor() ([]byte, []int) { - return fileDescriptor_8f954d82c0b891f6, []int{1} -} - -func (m *Metadata) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Metadata.Unmarshal(m, b) -} -func (m *Metadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Metadata.Marshal(b, m, deterministic) -} -func (m *Metadata) XXX_Merge(src proto.Message) { - xxx_messageInfo_Metadata.Merge(m, src) -} -func (m *Metadata) XXX_Size() int { - return xxx_messageInfo_Metadata.Size(m) -} -func (m *Metadata) XXX_DiscardUnknown() { - xxx_messageInfo_Metadata.DiscardUnknown(m) -} - -var xxx_messageInfo_Metadata proto.InternalMessageInfo - -func (m *Metadata) GetValue() []byte { - if m != nil { - return m.Value - } - return nil -} - -func (m *Metadata) GetSignatures() []*MetadataSignature { - if m != nil { - return m.Signatures - } - return nil -} - -type MetadataSignature struct { - SignatureHeader []byte `protobuf:"bytes,1,opt,name=signature_header,json=signatureHeader,proto3" json:"signature_header,omitempty"` - Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` - IdentifierHeader []byte `protobuf:"bytes,3,opt,name=identifier_header,json=identifierHeader,proto3" json:"identifier_header,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MetadataSignature) Reset() { *m = MetadataSignature{} } -func (m *MetadataSignature) String() string { return proto.CompactTextString(m) } -func (*MetadataSignature) ProtoMessage() {} -func (*MetadataSignature) Descriptor() ([]byte, []int) { - return fileDescriptor_8f954d82c0b891f6, []int{2} -} - -func (m *MetadataSignature) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MetadataSignature.Unmarshal(m, b) -} -func (m *MetadataSignature) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MetadataSignature.Marshal(b, m, deterministic) -} -func (m *MetadataSignature) XXX_Merge(src proto.Message) { - xxx_messageInfo_MetadataSignature.Merge(m, src) -} -func (m *MetadataSignature) XXX_Size() int { - return xxx_messageInfo_MetadataSignature.Size(m) -} -func (m *MetadataSignature) XXX_DiscardUnknown() { - xxx_messageInfo_MetadataSignature.DiscardUnknown(m) -} - -var xxx_messageInfo_MetadataSignature proto.InternalMessageInfo - -func (m *MetadataSignature) GetSignatureHeader() []byte { - if m != nil { - return m.SignatureHeader - } - return nil -} - -func (m *MetadataSignature) GetSignature() []byte { - if m != nil { - return m.Signature - } - return nil -} - -func (m *MetadataSignature) GetIdentifierHeader() []byte { - if m != nil { - return m.IdentifierHeader - } - return nil -} - -// IdentifierHeader is used as an alternative to a SignatureHeader when the creator can be referenced by id -type IdentifierHeader struct { - Identifier uint32 `protobuf:"varint,1,opt,name=identifier,proto3" json:"identifier,omitempty"` - Nonce []byte `protobuf:"bytes,2,opt,name=nonce,proto3" json:"nonce,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *IdentifierHeader) Reset() { *m = IdentifierHeader{} } -func (m *IdentifierHeader) String() string { return proto.CompactTextString(m) } -func (*IdentifierHeader) ProtoMessage() {} -func (*IdentifierHeader) Descriptor() ([]byte, []int) { - return fileDescriptor_8f954d82c0b891f6, []int{3} -} - -func (m *IdentifierHeader) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_IdentifierHeader.Unmarshal(m, b) -} -func (m *IdentifierHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_IdentifierHeader.Marshal(b, m, deterministic) -} -func (m *IdentifierHeader) XXX_Merge(src proto.Message) { - xxx_messageInfo_IdentifierHeader.Merge(m, src) -} -func (m *IdentifierHeader) XXX_Size() int { - return xxx_messageInfo_IdentifierHeader.Size(m) -} -func (m *IdentifierHeader) XXX_DiscardUnknown() { - xxx_messageInfo_IdentifierHeader.DiscardUnknown(m) -} - -var xxx_messageInfo_IdentifierHeader proto.InternalMessageInfo - -func (m *IdentifierHeader) GetIdentifier() uint32 { - if m != nil { - return m.Identifier - } - return 0 -} - -func (m *IdentifierHeader) GetNonce() []byte { - if m != nil { - return m.Nonce - } - return nil -} - -type Header struct { - ChannelHeader []byte `protobuf:"bytes,1,opt,name=channel_header,json=channelHeader,proto3" json:"channel_header,omitempty"` - SignatureHeader []byte `protobuf:"bytes,2,opt,name=signature_header,json=signatureHeader,proto3" json:"signature_header,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Header) Reset() { *m = Header{} } -func (m *Header) String() string { return proto.CompactTextString(m) } -func (*Header) ProtoMessage() {} -func (*Header) Descriptor() ([]byte, []int) { - return fileDescriptor_8f954d82c0b891f6, []int{4} -} - -func (m *Header) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Header.Unmarshal(m, b) -} -func (m *Header) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Header.Marshal(b, m, deterministic) -} -func (m *Header) XXX_Merge(src proto.Message) { - xxx_messageInfo_Header.Merge(m, src) -} -func (m *Header) XXX_Size() int { - return xxx_messageInfo_Header.Size(m) -} -func (m *Header) XXX_DiscardUnknown() { - xxx_messageInfo_Header.DiscardUnknown(m) -} - -var xxx_messageInfo_Header proto.InternalMessageInfo - -func (m *Header) GetChannelHeader() []byte { - if m != nil { - return m.ChannelHeader - } - return nil -} - -func (m *Header) GetSignatureHeader() []byte { - if m != nil { - return m.SignatureHeader - } - return nil -} - -// Header is a generic replay prevention and identity message to include in a signed payload -type ChannelHeader struct { - Type int32 `protobuf:"varint,1,opt,name=type,proto3" json:"type,omitempty"` - // Version indicates message protocol version - Version int32 `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"` - // Timestamp is the local time when the message was created - // by the sender - Timestamp *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - // Identifier of the channel this message is bound for - ChannelId string `protobuf:"bytes,4,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` - // An unique identifier that is used end-to-end. - // - set by higher layers such as end user or SDK - // - passed to the endorser (which will check for uniqueness) - // - as the header is passed along unchanged, it will be - // be retrieved by the committer (uniqueness check here as well) - // - to be stored in the ledger - TxId string `protobuf:"bytes,5,opt,name=tx_id,json=txId,proto3" json:"tx_id,omitempty"` - // The epoch in which this header was generated, where epoch is defined based on block height - // Epoch in which the response has been generated. This field identifies a - // logical window of time. A proposal response is accepted by a peer only if - // two conditions hold: - // 1. the epoch specified in the message is the current epoch - // 2. this message has been only seen once during this epoch (i.e. it hasn't - // been replayed) - Epoch uint64 `protobuf:"varint,6,opt,name=epoch,proto3" json:"epoch,omitempty"` - // Extension that may be attached based on the header type - Extension []byte `protobuf:"bytes,7,opt,name=extension,proto3" json:"extension,omitempty"` - // If mutual TLS is employed, this represents - // the hash of the client's TLS certificate - TlsCertHash []byte `protobuf:"bytes,8,opt,name=tls_cert_hash,json=tlsCertHash,proto3" json:"tls_cert_hash,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ChannelHeader) Reset() { *m = ChannelHeader{} } -func (m *ChannelHeader) String() string { return proto.CompactTextString(m) } -func (*ChannelHeader) ProtoMessage() {} -func (*ChannelHeader) Descriptor() ([]byte, []int) { - return fileDescriptor_8f954d82c0b891f6, []int{5} -} - -func (m *ChannelHeader) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ChannelHeader.Unmarshal(m, b) -} -func (m *ChannelHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ChannelHeader.Marshal(b, m, deterministic) -} -func (m *ChannelHeader) XXX_Merge(src proto.Message) { - xxx_messageInfo_ChannelHeader.Merge(m, src) -} -func (m *ChannelHeader) XXX_Size() int { - return xxx_messageInfo_ChannelHeader.Size(m) -} -func (m *ChannelHeader) XXX_DiscardUnknown() { - xxx_messageInfo_ChannelHeader.DiscardUnknown(m) -} - -var xxx_messageInfo_ChannelHeader proto.InternalMessageInfo - -func (m *ChannelHeader) GetType() int32 { - if m != nil { - return m.Type - } - return 0 -} - -func (m *ChannelHeader) GetVersion() int32 { - if m != nil { - return m.Version - } - return 0 -} - -func (m *ChannelHeader) GetTimestamp() *timestamppb.Timestamp { - if m != nil { - return m.Timestamp - } - return nil -} - -func (m *ChannelHeader) GetChannelId() string { - if m != nil { - return m.ChannelId - } - return "" -} - -func (m *ChannelHeader) GetTxId() string { - if m != nil { - return m.TxId - } - return "" -} - -func (m *ChannelHeader) GetEpoch() uint64 { - if m != nil { - return m.Epoch - } - return 0 -} - -func (m *ChannelHeader) GetExtension() []byte { - if m != nil { - return m.Extension - } - return nil -} - -func (m *ChannelHeader) GetTlsCertHash() []byte { - if m != nil { - return m.TlsCertHash - } - return nil -} - -type SignatureHeader struct { - // Creator of the message, a marshaled msp.SerializedIdentity - Creator []byte `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` - // Arbitrary number that may only be used once. Can be used to detect replay attacks. - Nonce []byte `protobuf:"bytes,2,opt,name=nonce,proto3" json:"nonce,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SignatureHeader) Reset() { *m = SignatureHeader{} } -func (m *SignatureHeader) String() string { return proto.CompactTextString(m) } -func (*SignatureHeader) ProtoMessage() {} -func (*SignatureHeader) Descriptor() ([]byte, []int) { - return fileDescriptor_8f954d82c0b891f6, []int{6} -} - -func (m *SignatureHeader) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SignatureHeader.Unmarshal(m, b) -} -func (m *SignatureHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SignatureHeader.Marshal(b, m, deterministic) -} -func (m *SignatureHeader) XXX_Merge(src proto.Message) { - xxx_messageInfo_SignatureHeader.Merge(m, src) -} -func (m *SignatureHeader) XXX_Size() int { - return xxx_messageInfo_SignatureHeader.Size(m) -} -func (m *SignatureHeader) XXX_DiscardUnknown() { - xxx_messageInfo_SignatureHeader.DiscardUnknown(m) -} - -var xxx_messageInfo_SignatureHeader proto.InternalMessageInfo - -func (m *SignatureHeader) GetCreator() []byte { - if m != nil { - return m.Creator - } - return nil -} - -func (m *SignatureHeader) GetNonce() []byte { - if m != nil { - return m.Nonce - } - return nil -} - -// Payload is the message contents (and header to allow for signing) -type Payload struct { - // Header is included to provide identity and prevent replay - Header *Header `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` - // Data, the encoding of which is defined by the type in the header - Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Payload) Reset() { *m = Payload{} } -func (m *Payload) String() string { return proto.CompactTextString(m) } -func (*Payload) ProtoMessage() {} -func (*Payload) Descriptor() ([]byte, []int) { - return fileDescriptor_8f954d82c0b891f6, []int{7} -} - -func (m *Payload) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Payload.Unmarshal(m, b) -} -func (m *Payload) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Payload.Marshal(b, m, deterministic) -} -func (m *Payload) XXX_Merge(src proto.Message) { - xxx_messageInfo_Payload.Merge(m, src) -} -func (m *Payload) XXX_Size() int { - return xxx_messageInfo_Payload.Size(m) -} -func (m *Payload) XXX_DiscardUnknown() { - xxx_messageInfo_Payload.DiscardUnknown(m) -} - -var xxx_messageInfo_Payload proto.InternalMessageInfo - -func (m *Payload) GetHeader() *Header { - if m != nil { - return m.Header - } - return nil -} - -func (m *Payload) GetData() []byte { - if m != nil { - return m.Data - } - return nil -} - -// Envelope wraps a Payload with a signature so that the message may be authenticated -type Envelope struct { - // A marshaled Payload - Payload []byte `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"` - // A signature by the creator specified in the Payload header - Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Envelope) Reset() { *m = Envelope{} } -func (m *Envelope) String() string { return proto.CompactTextString(m) } -func (*Envelope) ProtoMessage() {} -func (*Envelope) Descriptor() ([]byte, []int) { - return fileDescriptor_8f954d82c0b891f6, []int{8} -} - -func (m *Envelope) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Envelope.Unmarshal(m, b) -} -func (m *Envelope) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Envelope.Marshal(b, m, deterministic) -} -func (m *Envelope) XXX_Merge(src proto.Message) { - xxx_messageInfo_Envelope.Merge(m, src) -} -func (m *Envelope) XXX_Size() int { - return xxx_messageInfo_Envelope.Size(m) -} -func (m *Envelope) XXX_DiscardUnknown() { - xxx_messageInfo_Envelope.DiscardUnknown(m) -} - -var xxx_messageInfo_Envelope proto.InternalMessageInfo - -func (m *Envelope) GetPayload() []byte { - if m != nil { - return m.Payload - } - return nil -} - -func (m *Envelope) GetSignature() []byte { - if m != nil { - return m.Signature - } - return nil -} - -// This is finalized block structure to be shared among the orderer and peer -// Note that the BlockHeader chains to the previous BlockHeader, and the BlockData hash is embedded -// in the BlockHeader. This makes it natural and obvious that the Data is included in the hash, but -// the Metadata is not. -type Block struct { - Header *BlockHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` - Data *BlockData `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` - Metadata *BlockMetadata `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Block) Reset() { *m = Block{} } -func (m *Block) String() string { return proto.CompactTextString(m) } -func (*Block) ProtoMessage() {} -func (*Block) Descriptor() ([]byte, []int) { - return fileDescriptor_8f954d82c0b891f6, []int{9} -} - -func (m *Block) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Block.Unmarshal(m, b) -} -func (m *Block) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Block.Marshal(b, m, deterministic) -} -func (m *Block) XXX_Merge(src proto.Message) { - xxx_messageInfo_Block.Merge(m, src) -} -func (m *Block) XXX_Size() int { - return xxx_messageInfo_Block.Size(m) -} -func (m *Block) XXX_DiscardUnknown() { - xxx_messageInfo_Block.DiscardUnknown(m) -} - -var xxx_messageInfo_Block proto.InternalMessageInfo - -func (m *Block) GetHeader() *BlockHeader { - if m != nil { - return m.Header - } - return nil -} - -func (m *Block) GetData() *BlockData { - if m != nil { - return m.Data - } - return nil -} - -func (m *Block) GetMetadata() *BlockMetadata { - if m != nil { - return m.Metadata - } - return nil -} - -// BlockHeader is the element of the block which forms the block chain -// The block header is hashed using the configured chain hashing algorithm -// over the ASN.1 encoding of the BlockHeader -type BlockHeader struct { - Number uint64 `protobuf:"varint,1,opt,name=number,proto3" json:"number,omitempty"` - PreviousHash []byte `protobuf:"bytes,2,opt,name=previous_hash,json=previousHash,proto3" json:"previous_hash,omitempty"` - DataHash []byte `protobuf:"bytes,3,opt,name=data_hash,json=dataHash,proto3" json:"data_hash,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *BlockHeader) Reset() { *m = BlockHeader{} } -func (m *BlockHeader) String() string { return proto.CompactTextString(m) } -func (*BlockHeader) ProtoMessage() {} -func (*BlockHeader) Descriptor() ([]byte, []int) { - return fileDescriptor_8f954d82c0b891f6, []int{10} -} - -func (m *BlockHeader) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_BlockHeader.Unmarshal(m, b) -} -func (m *BlockHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_BlockHeader.Marshal(b, m, deterministic) -} -func (m *BlockHeader) XXX_Merge(src proto.Message) { - xxx_messageInfo_BlockHeader.Merge(m, src) -} -func (m *BlockHeader) XXX_Size() int { - return xxx_messageInfo_BlockHeader.Size(m) -} -func (m *BlockHeader) XXX_DiscardUnknown() { - xxx_messageInfo_BlockHeader.DiscardUnknown(m) -} - -var xxx_messageInfo_BlockHeader proto.InternalMessageInfo - -func (m *BlockHeader) GetNumber() uint64 { - if m != nil { - return m.Number - } - return 0 -} - -func (m *BlockHeader) GetPreviousHash() []byte { - if m != nil { - return m.PreviousHash - } - return nil -} - -func (m *BlockHeader) GetDataHash() []byte { - if m != nil { - return m.DataHash - } - return nil -} - -type BlockData struct { - Data [][]byte `protobuf:"bytes,1,rep,name=data,proto3" json:"data,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *BlockData) Reset() { *m = BlockData{} } -func (m *BlockData) String() string { return proto.CompactTextString(m) } -func (*BlockData) ProtoMessage() {} -func (*BlockData) Descriptor() ([]byte, []int) { - return fileDescriptor_8f954d82c0b891f6, []int{11} -} - -func (m *BlockData) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_BlockData.Unmarshal(m, b) -} -func (m *BlockData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_BlockData.Marshal(b, m, deterministic) -} -func (m *BlockData) XXX_Merge(src proto.Message) { - xxx_messageInfo_BlockData.Merge(m, src) -} -func (m *BlockData) XXX_Size() int { - return xxx_messageInfo_BlockData.Size(m) -} -func (m *BlockData) XXX_DiscardUnknown() { - xxx_messageInfo_BlockData.DiscardUnknown(m) -} - -var xxx_messageInfo_BlockData proto.InternalMessageInfo - -func (m *BlockData) GetData() [][]byte { - if m != nil { - return m.Data - } - return nil -} - -type BlockMetadata struct { - Metadata [][]byte `protobuf:"bytes,1,rep,name=metadata,proto3" json:"metadata,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *BlockMetadata) Reset() { *m = BlockMetadata{} } -func (m *BlockMetadata) String() string { return proto.CompactTextString(m) } -func (*BlockMetadata) ProtoMessage() {} -func (*BlockMetadata) Descriptor() ([]byte, []int) { - return fileDescriptor_8f954d82c0b891f6, []int{12} -} - -func (m *BlockMetadata) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_BlockMetadata.Unmarshal(m, b) -} -func (m *BlockMetadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_BlockMetadata.Marshal(b, m, deterministic) -} -func (m *BlockMetadata) XXX_Merge(src proto.Message) { - xxx_messageInfo_BlockMetadata.Merge(m, src) -} -func (m *BlockMetadata) XXX_Size() int { - return xxx_messageInfo_BlockMetadata.Size(m) -} -func (m *BlockMetadata) XXX_DiscardUnknown() { - xxx_messageInfo_BlockMetadata.DiscardUnknown(m) -} - -var xxx_messageInfo_BlockMetadata proto.InternalMessageInfo - -func (m *BlockMetadata) GetMetadata() [][]byte { - if m != nil { - return m.Metadata - } - return nil -} - -// OrdererBlockMetadata defines metadata that is set by the ordering service. -type OrdererBlockMetadata struct { - LastConfig *LastConfig `protobuf:"bytes,1,opt,name=last_config,json=lastConfig,proto3" json:"last_config,omitempty"` - ConsenterMetadata []byte `protobuf:"bytes,2,opt,name=consenter_metadata,json=consenterMetadata,proto3" json:"consenter_metadata,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *OrdererBlockMetadata) Reset() { *m = OrdererBlockMetadata{} } -func (m *OrdererBlockMetadata) String() string { return proto.CompactTextString(m) } -func (*OrdererBlockMetadata) ProtoMessage() {} -func (*OrdererBlockMetadata) Descriptor() ([]byte, []int) { - return fileDescriptor_8f954d82c0b891f6, []int{13} -} - -func (m *OrdererBlockMetadata) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_OrdererBlockMetadata.Unmarshal(m, b) -} -func (m *OrdererBlockMetadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_OrdererBlockMetadata.Marshal(b, m, deterministic) -} -func (m *OrdererBlockMetadata) XXX_Merge(src proto.Message) { - xxx_messageInfo_OrdererBlockMetadata.Merge(m, src) -} -func (m *OrdererBlockMetadata) XXX_Size() int { - return xxx_messageInfo_OrdererBlockMetadata.Size(m) -} -func (m *OrdererBlockMetadata) XXX_DiscardUnknown() { - xxx_messageInfo_OrdererBlockMetadata.DiscardUnknown(m) -} - -var xxx_messageInfo_OrdererBlockMetadata proto.InternalMessageInfo - -func (m *OrdererBlockMetadata) GetLastConfig() *LastConfig { - if m != nil { - return m.LastConfig - } - return nil -} - -func (m *OrdererBlockMetadata) GetConsenterMetadata() []byte { - if m != nil { - return m.ConsenterMetadata - } - return nil -} - -func init() { - proto.RegisterEnum("common.Status", Status_name, Status_value) - proto.RegisterEnum("common.HeaderType", HeaderType_name, HeaderType_value) - proto.RegisterEnum("common.BlockMetadataIndex", BlockMetadataIndex_name, BlockMetadataIndex_value) - proto.RegisterType((*LastConfig)(nil), "common.LastConfig") - proto.RegisterType((*Metadata)(nil), "common.Metadata") - proto.RegisterType((*MetadataSignature)(nil), "common.MetadataSignature") - proto.RegisterType((*IdentifierHeader)(nil), "common.IdentifierHeader") - proto.RegisterType((*Header)(nil), "common.Header") - proto.RegisterType((*ChannelHeader)(nil), "common.ChannelHeader") - proto.RegisterType((*SignatureHeader)(nil), "common.SignatureHeader") - proto.RegisterType((*Payload)(nil), "common.Payload") - proto.RegisterType((*Envelope)(nil), "common.Envelope") - proto.RegisterType((*Block)(nil), "common.Block") - proto.RegisterType((*BlockHeader)(nil), "common.BlockHeader") - proto.RegisterType((*BlockData)(nil), "common.BlockData") - proto.RegisterType((*BlockMetadata)(nil), "common.BlockMetadata") - proto.RegisterType((*OrdererBlockMetadata)(nil), "common.OrdererBlockMetadata") -} - -func init() { proto.RegisterFile("common/common.proto", fileDescriptor_8f954d82c0b891f6) } - -var fileDescriptor_8f954d82c0b891f6 = []byte{ - // 1095 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x55, 0x4d, 0x6f, 0xeb, 0x44, - 0x17, 0x6e, 0xbe, 0x93, 0xe3, 0xa6, 0x9d, 0x4c, 0xda, 0xf7, 0x0d, 0xbd, 0x5c, 0x6e, 0x65, 0xb8, - 0xa8, 0xb4, 0x6a, 0x2a, 0x7a, 0x37, 0xb0, 0x74, 0xec, 0x69, 0x63, 0x35, 0xb1, 0xc3, 0xd8, 0x29, - 0xe2, 0xb2, 0xb0, 0xdc, 0x64, 0x9a, 0x58, 0x24, 0x76, 0x64, 0x4f, 0xaa, 0x96, 0x2d, 0x2b, 0x36, - 0x08, 0x09, 0xb6, 0xfc, 0x17, 0x96, 0xfc, 0x1a, 0x56, 0x20, 0xb6, 0xc8, 0x1e, 0x3b, 0x1f, 0xe5, - 0xc2, 0x2a, 0x3e, 0xcf, 0x79, 0xe6, 0x9c, 0xe7, 0x7c, 0xcc, 0x04, 0x9a, 0xa3, 0x60, 0x3e, 0x0f, - 0xfc, 0x0b, 0xf1, 0xd3, 0x5e, 0x84, 0x01, 0x0f, 0x70, 0x59, 0x58, 0x47, 0xaf, 0x26, 0x41, 0x30, - 0x99, 0xb1, 0x8b, 0x04, 0xbd, 0x5b, 0xde, 0x5f, 0x70, 0x6f, 0xce, 0x22, 0xee, 0xce, 0x17, 0x82, - 0x28, 0xcb, 0x00, 0x3d, 0x37, 0xe2, 0x6a, 0xe0, 0xdf, 0x7b, 0x13, 0x7c, 0x00, 0x25, 0xcf, 0x1f, - 0xb3, 0xc7, 0x56, 0xee, 0x38, 0x77, 0x52, 0xa4, 0xc2, 0x90, 0xbf, 0x86, 0x6a, 0x9f, 0x71, 0x77, - 0xec, 0x72, 0x37, 0x66, 0x3c, 0xb8, 0xb3, 0x25, 0x4b, 0x18, 0xbb, 0x54, 0x18, 0xf8, 0x73, 0x80, - 0xc8, 0x9b, 0xf8, 0x2e, 0x5f, 0x86, 0x2c, 0x6a, 0xe5, 0x8f, 0x0b, 0x27, 0xd2, 0xe5, 0x7b, 0xed, - 0x54, 0x51, 0x76, 0xd6, 0xca, 0x18, 0x74, 0x83, 0x2c, 0x7f, 0x9f, 0x83, 0xc6, 0x3f, 0x18, 0xf8, - 0x13, 0x40, 0x2b, 0x8e, 0x33, 0x65, 0xee, 0x98, 0x85, 0x69, 0xc6, 0xfd, 0x15, 0xde, 0x4d, 0x60, - 0xfc, 0x3e, 0xd4, 0x56, 0x50, 0x2b, 0x9f, 0x70, 0xd6, 0x00, 0x3e, 0x83, 0x86, 0x37, 0x66, 0x3e, - 0xf7, 0xee, 0x3d, 0x16, 0x66, 0x91, 0x0a, 0x09, 0x0b, 0xad, 0x1d, 0x22, 0x94, 0xdc, 0x05, 0xa4, - 0x3f, 0xc3, 0xf0, 0x07, 0x00, 0x6b, 0x5e, 0xa2, 0xa1, 0x4e, 0x37, 0x90, 0xb8, 0x21, 0x7e, 0xe0, - 0x8f, 0xb2, 0xd4, 0xc2, 0x90, 0xdf, 0x42, 0x39, 0x3d, 0xff, 0x1a, 0xf6, 0x46, 0x53, 0xd7, 0xf7, - 0xd9, 0x6c, 0xbb, 0x8e, 0x7a, 0x8a, 0xa6, 0xb4, 0x77, 0x15, 0x9c, 0x7f, 0x67, 0xc1, 0xf2, 0x77, - 0x79, 0xa8, 0xab, 0x5b, 0x87, 0x31, 0x14, 0xf9, 0xd3, 0x42, 0xcc, 0xa4, 0x44, 0x93, 0x6f, 0xdc, - 0x82, 0xca, 0x03, 0x0b, 0x23, 0x2f, 0xf0, 0x93, 0x38, 0x25, 0x9a, 0x99, 0xf8, 0x33, 0xa8, 0xad, - 0xb6, 0x20, 0x69, 0x85, 0x74, 0x79, 0xd4, 0x16, 0x7b, 0xd2, 0xce, 0xf6, 0xa4, 0x6d, 0x67, 0x0c, - 0xba, 0x26, 0xe3, 0x97, 0x00, 0x59, 0x2d, 0xde, 0xb8, 0x55, 0x3c, 0xce, 0x9d, 0xd4, 0x68, 0x2d, - 0x45, 0xf4, 0x31, 0x6e, 0x42, 0x89, 0x3f, 0xc6, 0x9e, 0x52, 0xe2, 0x29, 0xf2, 0x47, 0x7d, 0x1c, - 0xf7, 0x87, 0x2d, 0x82, 0xd1, 0xb4, 0x55, 0x16, 0x2b, 0x95, 0x18, 0xf1, 0xd0, 0xd8, 0x23, 0x67, - 0x7e, 0xa2, 0xaf, 0x22, 0x86, 0xb6, 0x02, 0xb0, 0x0c, 0x75, 0x3e, 0x8b, 0x9c, 0x11, 0x0b, 0xb9, - 0x33, 0x75, 0xa3, 0x69, 0xab, 0x9a, 0x30, 0x24, 0x3e, 0x8b, 0x54, 0x16, 0xf2, 0xae, 0x1b, 0x4d, - 0x65, 0x05, 0xf6, 0xad, 0x67, 0x9b, 0xd0, 0x82, 0xca, 0x28, 0x64, 0x2e, 0x0f, 0xb2, 0x1e, 0x67, - 0xe6, 0xbf, 0x0c, 0x89, 0x40, 0x65, 0xe0, 0x3e, 0xcd, 0x02, 0x77, 0x8c, 0x3f, 0x86, 0xf2, 0xc6, - 0x74, 0xa4, 0xcb, 0xbd, 0x6c, 0x79, 0x45, 0x68, 0x9a, 0x7a, 0xe3, 0x4e, 0xc7, 0x8b, 0x9a, 0xc6, - 0x49, 0xbe, 0xe5, 0x0e, 0x54, 0x89, 0xff, 0xc0, 0x66, 0x81, 0xe8, 0xfa, 0x42, 0x84, 0xcc, 0x24, - 0xa4, 0xe6, 0x7f, 0xaf, 0xa9, 0xfc, 0x43, 0x0e, 0x4a, 0x9d, 0x59, 0x30, 0xfa, 0x06, 0x9f, 0x3d, - 0x53, 0xd2, 0xcc, 0x94, 0x24, 0xee, 0x67, 0x72, 0x5e, 0x6f, 0xc8, 0x91, 0x2e, 0x1b, 0x5b, 0x54, - 0xcd, 0xe5, 0xae, 0x50, 0x88, 0x3f, 0x85, 0xea, 0x3c, 0xbd, 0x62, 0xe9, 0xc0, 0x0f, 0xb7, 0xa8, - 0xd9, 0xfd, 0xa3, 0x2b, 0x9a, 0x3c, 0x01, 0x69, 0x23, 0x21, 0xfe, 0x1f, 0x94, 0xfd, 0xe5, 0xfc, - 0x2e, 0x55, 0x55, 0xa4, 0xa9, 0x85, 0x3f, 0x84, 0xfa, 0x22, 0x64, 0x0f, 0x5e, 0xb0, 0x8c, 0xc4, - 0xa4, 0x44, 0x65, 0xbb, 0x19, 0x18, 0x8f, 0x0a, 0xbf, 0x80, 0x5a, 0x1c, 0x53, 0x10, 0xc4, 0xdd, - 0xab, 0xc6, 0x40, 0x32, 0xc7, 0x57, 0x50, 0x5b, 0xc9, 0x5d, 0xb5, 0x37, 0x77, 0x5c, 0x58, 0xb5, - 0xf7, 0x0c, 0xea, 0x5b, 0x22, 0xf1, 0xd1, 0x46, 0x35, 0x82, 0xb8, 0x96, 0xfd, 0x2d, 0x1c, 0x98, - 0xe1, 0x98, 0x85, 0x2c, 0xdc, 0x3e, 0xf3, 0x06, 0xa4, 0x99, 0x1b, 0x71, 0x67, 0x94, 0xbc, 0x73, - 0x69, 0x6b, 0x71, 0xd6, 0x84, 0xf5, 0x0b, 0x48, 0x61, 0xb6, 0x7e, 0x0d, 0xcf, 0x01, 0x8f, 0x02, - 0x3f, 0x62, 0x3e, 0x67, 0xa1, 0xb3, 0x4a, 0x29, 0x2a, 0x6c, 0xac, 0x3c, 0x59, 0x8e, 0xd3, 0x5f, - 0x73, 0x50, 0xb6, 0xb8, 0xcb, 0x97, 0x11, 0x96, 0xa0, 0x32, 0x34, 0x6e, 0x0c, 0xf3, 0x4b, 0x03, - 0xed, 0xe0, 0x5d, 0xa8, 0x58, 0x43, 0x55, 0x25, 0x96, 0x85, 0x7e, 0xcb, 0x61, 0x04, 0x52, 0x47, - 0xd1, 0x1c, 0x4a, 0xbe, 0x18, 0x12, 0xcb, 0x46, 0x3f, 0x16, 0xf0, 0x1e, 0xd4, 0xae, 0x4c, 0xda, - 0xd1, 0x35, 0x8d, 0x18, 0xe8, 0xa7, 0xc4, 0x36, 0x4c, 0xdb, 0xb9, 0x32, 0x87, 0x86, 0x86, 0x7e, - 0x2e, 0xe0, 0x97, 0xd0, 0x4a, 0xd9, 0x0e, 0x31, 0x6c, 0xdd, 0xfe, 0xca, 0xb1, 0x4d, 0xd3, 0xe9, - 0x29, 0xf4, 0x9a, 0xa0, 0x5f, 0x0a, 0xf8, 0x08, 0x0e, 0x75, 0xc3, 0x26, 0xd4, 0x50, 0x7a, 0x8e, - 0x45, 0xe8, 0x2d, 0xa1, 0x0e, 0xa1, 0xd4, 0xa4, 0xe8, 0x8f, 0x02, 0x3e, 0x80, 0xfd, 0x38, 0x94, - 0xde, 0x1f, 0xf4, 0x48, 0x9f, 0x18, 0x36, 0xd1, 0xd0, 0x9f, 0x05, 0xdc, 0x82, 0x66, 0x4c, 0xd4, - 0x55, 0xe2, 0x0c, 0x0d, 0xe5, 0x56, 0xd1, 0x7b, 0x4a, 0xa7, 0x47, 0xd0, 0x5f, 0x85, 0xd3, 0xdf, - 0x73, 0x00, 0x62, 0xe2, 0x76, 0xfc, 0x86, 0x48, 0x50, 0xe9, 0x13, 0xcb, 0x52, 0xae, 0x09, 0xda, - 0xc1, 0x00, 0x65, 0xd5, 0x34, 0xae, 0xf4, 0x6b, 0x94, 0xc3, 0x0d, 0xa8, 0x8b, 0x6f, 0x67, 0x38, - 0xd0, 0x14, 0x9b, 0xa0, 0x3c, 0x6e, 0xc1, 0x01, 0x31, 0x34, 0x93, 0x5a, 0x84, 0x3a, 0x36, 0x55, - 0x0c, 0x4b, 0x51, 0x6d, 0xdd, 0x34, 0x50, 0x01, 0xbf, 0x80, 0xa6, 0x49, 0x35, 0x42, 0x9f, 0x39, - 0x8a, 0x47, 0xf9, 0x6a, 0x0e, 0x1f, 0x42, 0x43, 0x23, 0x3d, 0x3d, 0x56, 0x6d, 0x11, 0x72, 0xe3, - 0xe8, 0xc6, 0x95, 0x89, 0x4a, 0x31, 0xac, 0x76, 0x15, 0xdd, 0x50, 0x4d, 0x8d, 0x38, 0x03, 0x45, - 0xbd, 0x89, 0x35, 0x94, 0xe5, 0x62, 0xb5, 0x82, 0x2a, 0x72, 0xb1, 0x5a, 0x45, 0x55, 0xb9, 0x58, - 0xad, 0xa1, 0xda, 0xe9, 0xc1, 0x80, 0x10, 0xea, 0x50, 0x62, 0x99, 0x43, 0x1a, 0xd7, 0x93, 0xc8, - 0x49, 0x51, 0x45, 0xeb, 0xeb, 0x86, 0x63, 0x0e, 0x08, 0x55, 0xe2, 0x8c, 0xa7, 0x0d, 0xdb, 0xbc, - 0x21, 0xc6, 0xa6, 0x88, 0x53, 0x0e, 0x78, 0x6b, 0x51, 0xf4, 0xf8, 0x0f, 0x0f, 0xef, 0x01, 0x58, - 0xfa, 0xb5, 0xa1, 0xd8, 0x43, 0x4a, 0x2c, 0xb4, 0x83, 0x9b, 0x20, 0xf5, 0x14, 0xcb, 0x76, 0xb2, - 0xfa, 0x13, 0xe5, 0xff, 0x87, 0xe6, 0x46, 0x24, 0xcb, 0xb9, 0xd2, 0x7b, 0x36, 0xa1, 0x28, 0x8f, - 0xf7, 0xa1, 0x92, 0xd6, 0x8b, 0x0a, 0x09, 0x73, 0x1f, 0x24, 0xd5, 0xec, 0xf7, 0x75, 0xdb, 0xe9, - 0x2a, 0x56, 0x17, 0x15, 0x3b, 0xb7, 0xf0, 0x51, 0x10, 0x4e, 0xda, 0xd3, 0xa7, 0x05, 0x0b, 0x67, - 0x6c, 0x3c, 0x61, 0x61, 0xfb, 0xde, 0xbd, 0x0b, 0xbd, 0x91, 0x78, 0x7f, 0xa3, 0x74, 0x2f, 0xdf, - 0xb6, 0x27, 0x1e, 0x9f, 0x2e, 0xef, 0x62, 0xf3, 0x62, 0x83, 0x7c, 0x21, 0xc8, 0xe7, 0x82, 0x7c, - 0x3e, 0x09, 0xd2, 0xff, 0xfe, 0xbb, 0x72, 0x82, 0xbc, 0xf9, 0x3b, 0x00, 0x00, 0xff, 0xff, 0x2a, - 0xfe, 0x18, 0xa3, 0x13, 0x08, 0x00, 0x00, -} diff --git a/vendor/github.com/hyperledger/fabric-protos-go/common/configtx.pb.go b/vendor/github.com/hyperledger/fabric-protos-go/common/configtx.pb.go deleted file mode 100644 index 7e7fc5e0845..00000000000 --- a/vendor/github.com/hyperledger/fabric-protos-go/common/configtx.pb.go +++ /dev/null @@ -1,548 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: common/configtx.proto - -package common - -import ( - fmt "fmt" - proto "github.com/golang/protobuf/proto" - math "math" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package - -// ConfigEnvelope is designed to contain _all_ configuration for a chain with no dependency -// on previous configuration transactions. -// -// It is generated with the following scheme: -// 1. Retrieve the existing configuration -// 2. Note the config properties (ConfigValue, ConfigPolicy, ConfigGroup) to be modified -// 3. Add any intermediate ConfigGroups to the ConfigUpdate.read_set (sparsely) -// 4. Add any additional desired dependencies to ConfigUpdate.read_set (sparsely) -// 5. Modify the config properties, incrementing each version by 1, set them in the ConfigUpdate.write_set -// Note: any element not modified but specified should already be in the read_set, so may be specified sparsely -// 6. Create ConfigUpdate message and marshal it into ConfigUpdateEnvelope.update and encode the required signatures -// a) Each signature is of type ConfigSignature -// b) The ConfigSignature signature is over the concatenation of signature_header and the ConfigUpdate bytes (which includes a ChainHeader) -// 5. Submit new Config for ordering in Envelope signed by submitter -// a) The Envelope Payload has data set to the marshaled ConfigEnvelope -// b) The Envelope Payload has a header of type Header.Type.CONFIG_UPDATE -// -// The configuration manager will verify: -// 1. All items in the read_set exist at the read versions -// 2. All items in the write_set at a different version than, or not in, the read_set have been appropriately signed according to their mod_policy -// 3. The new configuration satisfies the ConfigSchema -type ConfigEnvelope struct { - Config *Config `protobuf:"bytes,1,opt,name=config,proto3" json:"config,omitempty"` - LastUpdate *Envelope `protobuf:"bytes,2,opt,name=last_update,json=lastUpdate,proto3" json:"last_update,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ConfigEnvelope) Reset() { *m = ConfigEnvelope{} } -func (m *ConfigEnvelope) String() string { return proto.CompactTextString(m) } -func (*ConfigEnvelope) ProtoMessage() {} -func (*ConfigEnvelope) Descriptor() ([]byte, []int) { - return fileDescriptor_5190bbf196fa7499, []int{0} -} - -func (m *ConfigEnvelope) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ConfigEnvelope.Unmarshal(m, b) -} -func (m *ConfigEnvelope) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ConfigEnvelope.Marshal(b, m, deterministic) -} -func (m *ConfigEnvelope) XXX_Merge(src proto.Message) { - xxx_messageInfo_ConfigEnvelope.Merge(m, src) -} -func (m *ConfigEnvelope) XXX_Size() int { - return xxx_messageInfo_ConfigEnvelope.Size(m) -} -func (m *ConfigEnvelope) XXX_DiscardUnknown() { - xxx_messageInfo_ConfigEnvelope.DiscardUnknown(m) -} - -var xxx_messageInfo_ConfigEnvelope proto.InternalMessageInfo - -func (m *ConfigEnvelope) GetConfig() *Config { - if m != nil { - return m.Config - } - return nil -} - -func (m *ConfigEnvelope) GetLastUpdate() *Envelope { - if m != nil { - return m.LastUpdate - } - return nil -} - -// Config represents the config for a particular channel -type Config struct { - Sequence uint64 `protobuf:"varint,1,opt,name=sequence,proto3" json:"sequence,omitempty"` - ChannelGroup *ConfigGroup `protobuf:"bytes,2,opt,name=channel_group,json=channelGroup,proto3" json:"channel_group,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Config) Reset() { *m = Config{} } -func (m *Config) String() string { return proto.CompactTextString(m) } -func (*Config) ProtoMessage() {} -func (*Config) Descriptor() ([]byte, []int) { - return fileDescriptor_5190bbf196fa7499, []int{1} -} - -func (m *Config) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Config.Unmarshal(m, b) -} -func (m *Config) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Config.Marshal(b, m, deterministic) -} -func (m *Config) XXX_Merge(src proto.Message) { - xxx_messageInfo_Config.Merge(m, src) -} -func (m *Config) XXX_Size() int { - return xxx_messageInfo_Config.Size(m) -} -func (m *Config) XXX_DiscardUnknown() { - xxx_messageInfo_Config.DiscardUnknown(m) -} - -var xxx_messageInfo_Config proto.InternalMessageInfo - -func (m *Config) GetSequence() uint64 { - if m != nil { - return m.Sequence - } - return 0 -} - -func (m *Config) GetChannelGroup() *ConfigGroup { - if m != nil { - return m.ChannelGroup - } - return nil -} - -type ConfigUpdateEnvelope struct { - ConfigUpdate []byte `protobuf:"bytes,1,opt,name=config_update,json=configUpdate,proto3" json:"config_update,omitempty"` - Signatures []*ConfigSignature `protobuf:"bytes,2,rep,name=signatures,proto3" json:"signatures,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ConfigUpdateEnvelope) Reset() { *m = ConfigUpdateEnvelope{} } -func (m *ConfigUpdateEnvelope) String() string { return proto.CompactTextString(m) } -func (*ConfigUpdateEnvelope) ProtoMessage() {} -func (*ConfigUpdateEnvelope) Descriptor() ([]byte, []int) { - return fileDescriptor_5190bbf196fa7499, []int{2} -} - -func (m *ConfigUpdateEnvelope) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ConfigUpdateEnvelope.Unmarshal(m, b) -} -func (m *ConfigUpdateEnvelope) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ConfigUpdateEnvelope.Marshal(b, m, deterministic) -} -func (m *ConfigUpdateEnvelope) XXX_Merge(src proto.Message) { - xxx_messageInfo_ConfigUpdateEnvelope.Merge(m, src) -} -func (m *ConfigUpdateEnvelope) XXX_Size() int { - return xxx_messageInfo_ConfigUpdateEnvelope.Size(m) -} -func (m *ConfigUpdateEnvelope) XXX_DiscardUnknown() { - xxx_messageInfo_ConfigUpdateEnvelope.DiscardUnknown(m) -} - -var xxx_messageInfo_ConfigUpdateEnvelope proto.InternalMessageInfo - -func (m *ConfigUpdateEnvelope) GetConfigUpdate() []byte { - if m != nil { - return m.ConfigUpdate - } - return nil -} - -func (m *ConfigUpdateEnvelope) GetSignatures() []*ConfigSignature { - if m != nil { - return m.Signatures - } - return nil -} - -// ConfigUpdate is used to submit a subset of config and to have the orderer apply to Config -// it is always submitted inside a ConfigUpdateEnvelope which allows the addition of signatures -// resulting in a new total configuration. The update is applied as follows: -// 1. The versions from all of the elements in the read_set is verified against the versions in the existing config. -// If there is a mismatch in the read versions, then the config update fails and is rejected. -// 2. Any elements in the write_set with the same version as the read_set are ignored. -// 3. The corresponding mod_policy for every remaining element in the write_set is collected. -// 4. Each policy is checked against the signatures from the ConfigUpdateEnvelope, any failing to verify are rejected -// 5. The write_set is applied to the Config and the ConfigGroupSchema verifies that the updates were legal -type ConfigUpdate struct { - ChannelId string `protobuf:"bytes,1,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` - ReadSet *ConfigGroup `protobuf:"bytes,2,opt,name=read_set,json=readSet,proto3" json:"read_set,omitempty"` - WriteSet *ConfigGroup `protobuf:"bytes,3,opt,name=write_set,json=writeSet,proto3" json:"write_set,omitempty"` - IsolatedData map[string][]byte `protobuf:"bytes,5,rep,name=isolated_data,json=isolatedData,proto3" json:"isolated_data,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ConfigUpdate) Reset() { *m = ConfigUpdate{} } -func (m *ConfigUpdate) String() string { return proto.CompactTextString(m) } -func (*ConfigUpdate) ProtoMessage() {} -func (*ConfigUpdate) Descriptor() ([]byte, []int) { - return fileDescriptor_5190bbf196fa7499, []int{3} -} - -func (m *ConfigUpdate) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ConfigUpdate.Unmarshal(m, b) -} -func (m *ConfigUpdate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ConfigUpdate.Marshal(b, m, deterministic) -} -func (m *ConfigUpdate) XXX_Merge(src proto.Message) { - xxx_messageInfo_ConfigUpdate.Merge(m, src) -} -func (m *ConfigUpdate) XXX_Size() int { - return xxx_messageInfo_ConfigUpdate.Size(m) -} -func (m *ConfigUpdate) XXX_DiscardUnknown() { - xxx_messageInfo_ConfigUpdate.DiscardUnknown(m) -} - -var xxx_messageInfo_ConfigUpdate proto.InternalMessageInfo - -func (m *ConfigUpdate) GetChannelId() string { - if m != nil { - return m.ChannelId - } - return "" -} - -func (m *ConfigUpdate) GetReadSet() *ConfigGroup { - if m != nil { - return m.ReadSet - } - return nil -} - -func (m *ConfigUpdate) GetWriteSet() *ConfigGroup { - if m != nil { - return m.WriteSet - } - return nil -} - -func (m *ConfigUpdate) GetIsolatedData() map[string][]byte { - if m != nil { - return m.IsolatedData - } - return nil -} - -// ConfigGroup is the hierarchical data structure for holding config -type ConfigGroup struct { - Version uint64 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` - Groups map[string]*ConfigGroup `protobuf:"bytes,2,rep,name=groups,proto3" json:"groups,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - Values map[string]*ConfigValue `protobuf:"bytes,3,rep,name=values,proto3" json:"values,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - Policies map[string]*ConfigPolicy `protobuf:"bytes,4,rep,name=policies,proto3" json:"policies,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - ModPolicy string `protobuf:"bytes,5,opt,name=mod_policy,json=modPolicy,proto3" json:"mod_policy,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ConfigGroup) Reset() { *m = ConfigGroup{} } -func (m *ConfigGroup) String() string { return proto.CompactTextString(m) } -func (*ConfigGroup) ProtoMessage() {} -func (*ConfigGroup) Descriptor() ([]byte, []int) { - return fileDescriptor_5190bbf196fa7499, []int{4} -} - -func (m *ConfigGroup) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ConfigGroup.Unmarshal(m, b) -} -func (m *ConfigGroup) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ConfigGroup.Marshal(b, m, deterministic) -} -func (m *ConfigGroup) XXX_Merge(src proto.Message) { - xxx_messageInfo_ConfigGroup.Merge(m, src) -} -func (m *ConfigGroup) XXX_Size() int { - return xxx_messageInfo_ConfigGroup.Size(m) -} -func (m *ConfigGroup) XXX_DiscardUnknown() { - xxx_messageInfo_ConfigGroup.DiscardUnknown(m) -} - -var xxx_messageInfo_ConfigGroup proto.InternalMessageInfo - -func (m *ConfigGroup) GetVersion() uint64 { - if m != nil { - return m.Version - } - return 0 -} - -func (m *ConfigGroup) GetGroups() map[string]*ConfigGroup { - if m != nil { - return m.Groups - } - return nil -} - -func (m *ConfigGroup) GetValues() map[string]*ConfigValue { - if m != nil { - return m.Values - } - return nil -} - -func (m *ConfigGroup) GetPolicies() map[string]*ConfigPolicy { - if m != nil { - return m.Policies - } - return nil -} - -func (m *ConfigGroup) GetModPolicy() string { - if m != nil { - return m.ModPolicy - } - return "" -} - -// ConfigValue represents an individual piece of config data -type ConfigValue struct { - Version uint64 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` - Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` - ModPolicy string `protobuf:"bytes,3,opt,name=mod_policy,json=modPolicy,proto3" json:"mod_policy,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ConfigValue) Reset() { *m = ConfigValue{} } -func (m *ConfigValue) String() string { return proto.CompactTextString(m) } -func (*ConfigValue) ProtoMessage() {} -func (*ConfigValue) Descriptor() ([]byte, []int) { - return fileDescriptor_5190bbf196fa7499, []int{5} -} - -func (m *ConfigValue) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ConfigValue.Unmarshal(m, b) -} -func (m *ConfigValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ConfigValue.Marshal(b, m, deterministic) -} -func (m *ConfigValue) XXX_Merge(src proto.Message) { - xxx_messageInfo_ConfigValue.Merge(m, src) -} -func (m *ConfigValue) XXX_Size() int { - return xxx_messageInfo_ConfigValue.Size(m) -} -func (m *ConfigValue) XXX_DiscardUnknown() { - xxx_messageInfo_ConfigValue.DiscardUnknown(m) -} - -var xxx_messageInfo_ConfigValue proto.InternalMessageInfo - -func (m *ConfigValue) GetVersion() uint64 { - if m != nil { - return m.Version - } - return 0 -} - -func (m *ConfigValue) GetValue() []byte { - if m != nil { - return m.Value - } - return nil -} - -func (m *ConfigValue) GetModPolicy() string { - if m != nil { - return m.ModPolicy - } - return "" -} - -type ConfigPolicy struct { - Version uint64 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` - Policy *Policy `protobuf:"bytes,2,opt,name=policy,proto3" json:"policy,omitempty"` - ModPolicy string `protobuf:"bytes,3,opt,name=mod_policy,json=modPolicy,proto3" json:"mod_policy,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ConfigPolicy) Reset() { *m = ConfigPolicy{} } -func (m *ConfigPolicy) String() string { return proto.CompactTextString(m) } -func (*ConfigPolicy) ProtoMessage() {} -func (*ConfigPolicy) Descriptor() ([]byte, []int) { - return fileDescriptor_5190bbf196fa7499, []int{6} -} - -func (m *ConfigPolicy) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ConfigPolicy.Unmarshal(m, b) -} -func (m *ConfigPolicy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ConfigPolicy.Marshal(b, m, deterministic) -} -func (m *ConfigPolicy) XXX_Merge(src proto.Message) { - xxx_messageInfo_ConfigPolicy.Merge(m, src) -} -func (m *ConfigPolicy) XXX_Size() int { - return xxx_messageInfo_ConfigPolicy.Size(m) -} -func (m *ConfigPolicy) XXX_DiscardUnknown() { - xxx_messageInfo_ConfigPolicy.DiscardUnknown(m) -} - -var xxx_messageInfo_ConfigPolicy proto.InternalMessageInfo - -func (m *ConfigPolicy) GetVersion() uint64 { - if m != nil { - return m.Version - } - return 0 -} - -func (m *ConfigPolicy) GetPolicy() *Policy { - if m != nil { - return m.Policy - } - return nil -} - -func (m *ConfigPolicy) GetModPolicy() string { - if m != nil { - return m.ModPolicy - } - return "" -} - -type ConfigSignature struct { - SignatureHeader []byte `protobuf:"bytes,1,opt,name=signature_header,json=signatureHeader,proto3" json:"signature_header,omitempty"` - Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ConfigSignature) Reset() { *m = ConfigSignature{} } -func (m *ConfigSignature) String() string { return proto.CompactTextString(m) } -func (*ConfigSignature) ProtoMessage() {} -func (*ConfigSignature) Descriptor() ([]byte, []int) { - return fileDescriptor_5190bbf196fa7499, []int{7} -} - -func (m *ConfigSignature) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ConfigSignature.Unmarshal(m, b) -} -func (m *ConfigSignature) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ConfigSignature.Marshal(b, m, deterministic) -} -func (m *ConfigSignature) XXX_Merge(src proto.Message) { - xxx_messageInfo_ConfigSignature.Merge(m, src) -} -func (m *ConfigSignature) XXX_Size() int { - return xxx_messageInfo_ConfigSignature.Size(m) -} -func (m *ConfigSignature) XXX_DiscardUnknown() { - xxx_messageInfo_ConfigSignature.DiscardUnknown(m) -} - -var xxx_messageInfo_ConfigSignature proto.InternalMessageInfo - -func (m *ConfigSignature) GetSignatureHeader() []byte { - if m != nil { - return m.SignatureHeader - } - return nil -} - -func (m *ConfigSignature) GetSignature() []byte { - if m != nil { - return m.Signature - } - return nil -} - -func init() { - proto.RegisterType((*ConfigEnvelope)(nil), "common.ConfigEnvelope") - proto.RegisterType((*Config)(nil), "common.Config") - proto.RegisterType((*ConfigUpdateEnvelope)(nil), "common.ConfigUpdateEnvelope") - proto.RegisterType((*ConfigUpdate)(nil), "common.ConfigUpdate") - proto.RegisterMapType((map[string][]byte)(nil), "common.ConfigUpdate.IsolatedDataEntry") - proto.RegisterType((*ConfigGroup)(nil), "common.ConfigGroup") - proto.RegisterMapType((map[string]*ConfigGroup)(nil), "common.ConfigGroup.GroupsEntry") - proto.RegisterMapType((map[string]*ConfigPolicy)(nil), "common.ConfigGroup.PoliciesEntry") - proto.RegisterMapType((map[string]*ConfigValue)(nil), "common.ConfigGroup.ValuesEntry") - proto.RegisterType((*ConfigValue)(nil), "common.ConfigValue") - proto.RegisterType((*ConfigPolicy)(nil), "common.ConfigPolicy") - proto.RegisterType((*ConfigSignature)(nil), "common.ConfigSignature") -} - -func init() { proto.RegisterFile("common/configtx.proto", fileDescriptor_5190bbf196fa7499) } - -var fileDescriptor_5190bbf196fa7499 = []byte{ - // 645 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x55, 0x61, 0x4f, 0xd4, 0x4c, - 0x10, 0x0e, 0xd7, 0x5e, 0xe9, 0xcd, 0xf5, 0xe0, 0xde, 0x85, 0x37, 0x36, 0x17, 0x8d, 0x58, 0x0d, - 0x01, 0x13, 0x8a, 0xe2, 0x07, 0x88, 0x89, 0x31, 0x51, 0x89, 0x82, 0x89, 0xd1, 0x12, 0xf9, 0x40, - 0x4c, 0x9a, 0xa5, 0x5d, 0x7a, 0x95, 0x5e, 0xb7, 0x6e, 0xb7, 0x68, 0x7f, 0x92, 0x7f, 0xcd, 0x5f, - 0x61, 0xba, 0xbb, 0x2d, 0x2d, 0x1e, 0x67, 0xfc, 0x02, 0xcc, 0xcc, 0xf3, 0x3c, 0x33, 0xcf, 0xce, - 0x76, 0x81, 0xff, 0x03, 0x3a, 0x9b, 0xd1, 0x74, 0x37, 0xa0, 0xe9, 0x45, 0x1c, 0xf1, 0x1f, 0x6e, - 0xc6, 0x28, 0xa7, 0xc8, 0x90, 0xe9, 0xc9, 0x5a, 0x53, 0xae, 0x7e, 0xc9, 0xe2, 0xa4, 0xe6, 0x64, - 0x34, 0x89, 0x83, 0x98, 0xe4, 0x32, 0xed, 0x5c, 0xc2, 0xca, 0x6b, 0xa1, 0x72, 0x98, 0x5e, 0x91, - 0x84, 0x66, 0x04, 0x6d, 0x82, 0x21, 0x75, 0xed, 0xa5, 0x8d, 0xa5, 0xad, 0xe1, 0xde, 0x8a, 0xab, - 0x74, 0x24, 0xce, 0x53, 0x55, 0xf4, 0x14, 0x86, 0x09, 0xce, 0xb9, 0x5f, 0x64, 0x21, 0xe6, 0xc4, - 0xee, 0x09, 0xf0, 0xb8, 0x06, 0xd7, 0x72, 0x1e, 0x54, 0xa0, 0xcf, 0x02, 0xe3, 0x7c, 0x05, 0x43, - 0x8a, 0xa0, 0x09, 0x98, 0x39, 0xf9, 0x56, 0x90, 0x34, 0x20, 0xa2, 0x8d, 0xee, 0x35, 0x31, 0x3a, - 0x80, 0x51, 0x30, 0xc5, 0x69, 0x4a, 0x12, 0x3f, 0x62, 0xb4, 0xc8, 0x94, 0xf4, 0x5a, 0x77, 0x8e, - 0xb7, 0x55, 0xc9, 0xb3, 0x14, 0x52, 0x44, 0xc7, 0xba, 0xa9, 0x8d, 0x75, 0x4f, 0xe7, 0x65, 0x46, - 0x1c, 0x0e, 0xeb, 0x12, 0x28, 0x7b, 0x37, 0xf6, 0x1e, 0xc2, 0x48, 0x1a, 0xa8, 0x07, 0xaf, 0xda, - 0x5b, 0x9e, 0x15, 0xb4, 0xc0, 0x68, 0x1f, 0x20, 0x8f, 0xa3, 0x14, 0xf3, 0x82, 0x91, 0xdc, 0xee, - 0x6d, 0x68, 0x5b, 0xc3, 0xbd, 0x3b, 0xdd, 0xfe, 0x27, 0x75, 0xdd, 0x6b, 0x41, 0x9d, 0x9f, 0x3d, - 0xb0, 0xda, 0x6d, 0xd1, 0x3d, 0x80, 0xda, 0x4c, 0x1c, 0x8a, 0x5e, 0x03, 0x6f, 0xa0, 0x32, 0x47, - 0x21, 0x72, 0xc1, 0x64, 0x04, 0x87, 0x7e, 0x4e, 0xf8, 0x22, 0x9b, 0xcb, 0x15, 0xe8, 0x84, 0x70, - 0xf4, 0x04, 0x06, 0xdf, 0x59, 0xcc, 0x89, 0x20, 0x68, 0xb7, 0x13, 0x4c, 0x81, 0xaa, 0x18, 0xef, - 0x61, 0x14, 0xe7, 0x34, 0xc1, 0x9c, 0x84, 0x7e, 0x88, 0x39, 0xb6, 0xfb, 0xc2, 0xcd, 0x66, 0x97, - 0x25, 0xa7, 0x75, 0x8f, 0x14, 0xf2, 0x0d, 0xe6, 0xf8, 0x30, 0xe5, 0xac, 0xf4, 0xac, 0xb8, 0x95, - 0x9a, 0xbc, 0x84, 0xff, 0xfe, 0x80, 0xa0, 0x31, 0x68, 0x97, 0xa4, 0x54, 0xde, 0xaa, 0x3f, 0xd1, - 0x3a, 0xf4, 0xaf, 0x70, 0x52, 0xc8, 0x4b, 0x61, 0x79, 0x32, 0x78, 0xde, 0x3b, 0x58, 0x3a, 0xd6, - 0x4d, 0x7d, 0xdc, 0x57, 0x1b, 0xfa, 0xa5, 0xc1, 0xb0, 0x35, 0x33, 0xb2, 0x61, 0xf9, 0x8a, 0xb0, - 0x3c, 0xa6, 0xa9, 0xba, 0x12, 0x75, 0x88, 0xf6, 0xc1, 0x10, 0x37, 0xa1, 0x5e, 0xc5, 0xfd, 0x39, - 0x96, 0x5d, 0xf1, 0x33, 0x97, 0x53, 0x2b, 0x78, 0x45, 0x14, 0xbd, 0x73, 0x5b, 0xbb, 0x9d, 0x78, - 0x2a, 0x10, 0x8a, 0x28, 0xe1, 0xe8, 0x05, 0x98, 0xf5, 0x87, 0x62, 0xeb, 0x82, 0xfa, 0x60, 0x1e, - 0xf5, 0xa3, 0xc2, 0x48, 0x72, 0x43, 0xa9, 0xb6, 0x3e, 0xa3, 0xa1, 0x2f, 0xe2, 0xd2, 0xee, 0xcb, - 0xad, 0xcf, 0x68, 0x28, 0xf0, 0xe5, 0xe4, 0x03, 0x0c, 0x5b, 0xd3, 0xce, 0x39, 0xc0, 0xed, 0xf6, - 0x01, 0xde, 0xb2, 0xe2, 0xeb, 0x53, 0xad, 0xf4, 0x5a, 0x26, 0xfe, 0x59, 0x4f, 0x70, 0xdb, 0x7a, - 0x9f, 0x60, 0xd4, 0x71, 0x36, 0x47, 0xf1, 0x71, 0x57, 0x71, 0xbd, 0xab, 0x28, 0x7d, 0xb6, 0x24, - 0x9d, 0x2f, 0xf5, 0xae, 0x45, 0xb3, 0x05, 0xbb, 0x9e, 0x7b, 0x77, 0x6e, 0x1c, 0xa8, 0x76, 0xe3, - 0x40, 0x1d, 0x5a, 0x7f, 0x75, 0x32, 0x5e, 0x20, 0xbf, 0x09, 0x86, 0x12, 0xe9, 0x75, 0x5f, 0x37, - 0x35, 0xb2, 0xaa, 0xfe, 0xad, 0xe1, 0x19, 0xac, 0xde, 0x78, 0x06, 0xd0, 0x36, 0x8c, 0x9b, 0x87, - 0xc0, 0x9f, 0x12, 0x1c, 0x12, 0xa6, 0xde, 0x96, 0xd5, 0x26, 0xff, 0x4e, 0xa4, 0xd1, 0x5d, 0x18, - 0x34, 0x29, 0xe5, 0xf3, 0x3a, 0xf1, 0xea, 0x14, 0x1e, 0x51, 0x16, 0xb9, 0xd3, 0x32, 0x23, 0x2c, - 0x21, 0x61, 0x44, 0x98, 0x7b, 0x81, 0xcf, 0x59, 0x1c, 0xc8, 0x27, 0x3b, 0x57, 0x13, 0x9f, 0xb9, - 0x51, 0xcc, 0xa7, 0xc5, 0x79, 0x15, 0xee, 0xb6, 0xc0, 0xbb, 0x12, 0xbc, 0x23, 0xc1, 0x3b, 0x11, - 0x55, 0xff, 0x07, 0xce, 0x0d, 0x91, 0x79, 0xf6, 0x3b, 0x00, 0x00, 0xff, 0xff, 0x4e, 0x9b, 0x6e, - 0xa7, 0x3e, 0x06, 0x00, 0x00, -} diff --git a/vendor/github.com/hyperledger/fabric-protos-go/common/configuration.pb.go b/vendor/github.com/hyperledger/fabric-protos-go/common/configuration.pb.go deleted file mode 100644 index bcd80aabf48..00000000000 --- a/vendor/github.com/hyperledger/fabric-protos-go/common/configuration.pb.go +++ /dev/null @@ -1,468 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: common/configuration.proto - -package common - -import ( - fmt "fmt" - proto "github.com/golang/protobuf/proto" - math "math" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package - -// HashingAlgorithm is encoded into the configuration transaction as a -// configuration item of type Chain with a Key of "HashingAlgorithm" and a -// Value of HashingAlgorithm as marshaled protobuf bytes -type HashingAlgorithm struct { - // SHA256 is currently the only supported and tested algorithm. - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *HashingAlgorithm) Reset() { *m = HashingAlgorithm{} } -func (m *HashingAlgorithm) String() string { return proto.CompactTextString(m) } -func (*HashingAlgorithm) ProtoMessage() {} -func (*HashingAlgorithm) Descriptor() ([]byte, []int) { - return fileDescriptor_cba1ec2883858369, []int{0} -} - -func (m *HashingAlgorithm) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_HashingAlgorithm.Unmarshal(m, b) -} -func (m *HashingAlgorithm) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_HashingAlgorithm.Marshal(b, m, deterministic) -} -func (m *HashingAlgorithm) XXX_Merge(src proto.Message) { - xxx_messageInfo_HashingAlgorithm.Merge(m, src) -} -func (m *HashingAlgorithm) XXX_Size() int { - return xxx_messageInfo_HashingAlgorithm.Size(m) -} -func (m *HashingAlgorithm) XXX_DiscardUnknown() { - xxx_messageInfo_HashingAlgorithm.DiscardUnknown(m) -} - -var xxx_messageInfo_HashingAlgorithm proto.InternalMessageInfo - -func (m *HashingAlgorithm) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -// BlockDataHashingStructure is encoded into the configuration transaction as a configuration item of -// type Chain with a Key of "BlockDataHashingStructure" and a Value of HashingAlgorithm as marshaled protobuf bytes -type BlockDataHashingStructure struct { - // width specifies the width of the Merkle tree to use when computing the BlockDataHash - // in order to replicate flat hashing, set this width to MAX_UINT32 - Width uint32 `protobuf:"varint,1,opt,name=width,proto3" json:"width,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *BlockDataHashingStructure) Reset() { *m = BlockDataHashingStructure{} } -func (m *BlockDataHashingStructure) String() string { return proto.CompactTextString(m) } -func (*BlockDataHashingStructure) ProtoMessage() {} -func (*BlockDataHashingStructure) Descriptor() ([]byte, []int) { - return fileDescriptor_cba1ec2883858369, []int{1} -} - -func (m *BlockDataHashingStructure) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_BlockDataHashingStructure.Unmarshal(m, b) -} -func (m *BlockDataHashingStructure) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_BlockDataHashingStructure.Marshal(b, m, deterministic) -} -func (m *BlockDataHashingStructure) XXX_Merge(src proto.Message) { - xxx_messageInfo_BlockDataHashingStructure.Merge(m, src) -} -func (m *BlockDataHashingStructure) XXX_Size() int { - return xxx_messageInfo_BlockDataHashingStructure.Size(m) -} -func (m *BlockDataHashingStructure) XXX_DiscardUnknown() { - xxx_messageInfo_BlockDataHashingStructure.DiscardUnknown(m) -} - -var xxx_messageInfo_BlockDataHashingStructure proto.InternalMessageInfo - -func (m *BlockDataHashingStructure) GetWidth() uint32 { - if m != nil { - return m.Width - } - return 0 -} - -// OrdererAddresses is encoded into the configuration transaction as a configuration item of type Chain -// with a Key of "OrdererAddresses" and a Value of OrdererAddresses as marshaled protobuf bytes -type OrdererAddresses struct { - Addresses []string `protobuf:"bytes,1,rep,name=addresses,proto3" json:"addresses,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *OrdererAddresses) Reset() { *m = OrdererAddresses{} } -func (m *OrdererAddresses) String() string { return proto.CompactTextString(m) } -func (*OrdererAddresses) ProtoMessage() {} -func (*OrdererAddresses) Descriptor() ([]byte, []int) { - return fileDescriptor_cba1ec2883858369, []int{2} -} - -func (m *OrdererAddresses) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_OrdererAddresses.Unmarshal(m, b) -} -func (m *OrdererAddresses) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_OrdererAddresses.Marshal(b, m, deterministic) -} -func (m *OrdererAddresses) XXX_Merge(src proto.Message) { - xxx_messageInfo_OrdererAddresses.Merge(m, src) -} -func (m *OrdererAddresses) XXX_Size() int { - return xxx_messageInfo_OrdererAddresses.Size(m) -} -func (m *OrdererAddresses) XXX_DiscardUnknown() { - xxx_messageInfo_OrdererAddresses.DiscardUnknown(m) -} - -var xxx_messageInfo_OrdererAddresses proto.InternalMessageInfo - -func (m *OrdererAddresses) GetAddresses() []string { - if m != nil { - return m.Addresses - } - return nil -} - -// Consenter represents a consenting node (i.e. replica). -type Consenter struct { - Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Host string `protobuf:"bytes,2,opt,name=host,proto3" json:"host,omitempty"` - Port uint32 `protobuf:"varint,3,opt,name=port,proto3" json:"port,omitempty"` - MspId string `protobuf:"bytes,4,opt,name=msp_id,json=mspId,proto3" json:"msp_id,omitempty"` - Identity []byte `protobuf:"bytes,5,opt,name=identity,proto3" json:"identity,omitempty"` - ClientTlsCert []byte `protobuf:"bytes,6,opt,name=client_tls_cert,json=clientTlsCert,proto3" json:"client_tls_cert,omitempty"` - ServerTlsCert []byte `protobuf:"bytes,7,opt,name=server_tls_cert,json=serverTlsCert,proto3" json:"server_tls_cert,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Consenter) Reset() { *m = Consenter{} } -func (m *Consenter) String() string { return proto.CompactTextString(m) } -func (*Consenter) ProtoMessage() {} -func (*Consenter) Descriptor() ([]byte, []int) { - return fileDescriptor_cba1ec2883858369, []int{3} -} - -func (m *Consenter) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Consenter.Unmarshal(m, b) -} -func (m *Consenter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Consenter.Marshal(b, m, deterministic) -} -func (m *Consenter) XXX_Merge(src proto.Message) { - xxx_messageInfo_Consenter.Merge(m, src) -} -func (m *Consenter) XXX_Size() int { - return xxx_messageInfo_Consenter.Size(m) -} -func (m *Consenter) XXX_DiscardUnknown() { - xxx_messageInfo_Consenter.DiscardUnknown(m) -} - -var xxx_messageInfo_Consenter proto.InternalMessageInfo - -func (m *Consenter) GetId() uint32 { - if m != nil { - return m.Id - } - return 0 -} - -func (m *Consenter) GetHost() string { - if m != nil { - return m.Host - } - return "" -} - -func (m *Consenter) GetPort() uint32 { - if m != nil { - return m.Port - } - return 0 -} - -func (m *Consenter) GetMspId() string { - if m != nil { - return m.MspId - } - return "" -} - -func (m *Consenter) GetIdentity() []byte { - if m != nil { - return m.Identity - } - return nil -} - -func (m *Consenter) GetClientTlsCert() []byte { - if m != nil { - return m.ClientTlsCert - } - return nil -} - -func (m *Consenter) GetServerTlsCert() []byte { - if m != nil { - return m.ServerTlsCert - } - return nil -} - -// Orderers is encoded into the configuration transaction as a configuration item of type Chain -// with a Key of "Orderers" and a Value of Orderers as marshaled protobuf bytes -type Orderers struct { - ConsenterMapping []*Consenter `protobuf:"bytes,1,rep,name=consenter_mapping,json=consenterMapping,proto3" json:"consenter_mapping,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Orderers) Reset() { *m = Orderers{} } -func (m *Orderers) String() string { return proto.CompactTextString(m) } -func (*Orderers) ProtoMessage() {} -func (*Orderers) Descriptor() ([]byte, []int) { - return fileDescriptor_cba1ec2883858369, []int{4} -} - -func (m *Orderers) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Orderers.Unmarshal(m, b) -} -func (m *Orderers) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Orderers.Marshal(b, m, deterministic) -} -func (m *Orderers) XXX_Merge(src proto.Message) { - xxx_messageInfo_Orderers.Merge(m, src) -} -func (m *Orderers) XXX_Size() int { - return xxx_messageInfo_Orderers.Size(m) -} -func (m *Orderers) XXX_DiscardUnknown() { - xxx_messageInfo_Orderers.DiscardUnknown(m) -} - -var xxx_messageInfo_Orderers proto.InternalMessageInfo - -func (m *Orderers) GetConsenterMapping() []*Consenter { - if m != nil { - return m.ConsenterMapping - } - return nil -} - -// Consortium represents the consortium context in which the channel was created -type Consortium struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Consortium) Reset() { *m = Consortium{} } -func (m *Consortium) String() string { return proto.CompactTextString(m) } -func (*Consortium) ProtoMessage() {} -func (*Consortium) Descriptor() ([]byte, []int) { - return fileDescriptor_cba1ec2883858369, []int{5} -} - -func (m *Consortium) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Consortium.Unmarshal(m, b) -} -func (m *Consortium) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Consortium.Marshal(b, m, deterministic) -} -func (m *Consortium) XXX_Merge(src proto.Message) { - xxx_messageInfo_Consortium.Merge(m, src) -} -func (m *Consortium) XXX_Size() int { - return xxx_messageInfo_Consortium.Size(m) -} -func (m *Consortium) XXX_DiscardUnknown() { - xxx_messageInfo_Consortium.DiscardUnknown(m) -} - -var xxx_messageInfo_Consortium proto.InternalMessageInfo - -func (m *Consortium) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -// Capabilities message defines the capabilities a particular binary must implement -// for that binary to be able to safely participate in the channel. The capabilities -// message is defined at the /Channel level, the /Channel/Application level, and the -// /Channel/Orderer level. -// -// The /Channel level capabilties define capabilities which both the orderer and peer -// binaries must satisfy. These capabilties might be things like a new MSP type, -// or a new policy type. -// -// The /Channel/Orderer level capabilties define capabilities which must be supported -// by the orderer, but which have no bearing on the behavior of the peer. For instance -// if the orderer changes the logic for how it constructs new channels, only all orderers -// must agree on the new logic. The peers do not need to be aware of this change as -// they only interact with the channel after it has been constructed. -// -// Finally, the /Channel/Application level capabilities define capabilities which the peer -// binary must satisfy, but which have no bearing on the orderer. For instance, if the -// peer adds a new UTXO transaction type, or changes the chaincode lifecycle requirements, -// all peers must agree on the new logic. However, orderers never inspect transactions -// this deeply, and therefore have no need to be aware of the change. -// -// The capabilities strings defined in these messages typically correspond to release -// binary versions (e.g. "V1.1"), and are used primarilly as a mechanism for a fully -// upgraded network to switch from one set of logic to a new one. -// -// Although for V1.1, the orderers must be upgraded to V1.1 prior to the rest of the -// network, going forward, because of the split between the /Channel, /Channel/Orderer -// and /Channel/Application capabilities. It should be possible for the orderer and -// application networks to upgrade themselves independently (with the exception of any -// new capabilities defined at the /Channel level). -type Capabilities struct { - Capabilities map[string]*Capability `protobuf:"bytes,1,rep,name=capabilities,proto3" json:"capabilities,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Capabilities) Reset() { *m = Capabilities{} } -func (m *Capabilities) String() string { return proto.CompactTextString(m) } -func (*Capabilities) ProtoMessage() {} -func (*Capabilities) Descriptor() ([]byte, []int) { - return fileDescriptor_cba1ec2883858369, []int{6} -} - -func (m *Capabilities) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Capabilities.Unmarshal(m, b) -} -func (m *Capabilities) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Capabilities.Marshal(b, m, deterministic) -} -func (m *Capabilities) XXX_Merge(src proto.Message) { - xxx_messageInfo_Capabilities.Merge(m, src) -} -func (m *Capabilities) XXX_Size() int { - return xxx_messageInfo_Capabilities.Size(m) -} -func (m *Capabilities) XXX_DiscardUnknown() { - xxx_messageInfo_Capabilities.DiscardUnknown(m) -} - -var xxx_messageInfo_Capabilities proto.InternalMessageInfo - -func (m *Capabilities) GetCapabilities() map[string]*Capability { - if m != nil { - return m.Capabilities - } - return nil -} - -// Capability is an empty message for the time being. It is defined as a protobuf -// message rather than a constant, so that we may extend capabilities with other fields -// if the need arises in the future. For the time being, a capability being in the -// capabilities map requires that that capability be supported. -type Capability struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Capability) Reset() { *m = Capability{} } -func (m *Capability) String() string { return proto.CompactTextString(m) } -func (*Capability) ProtoMessage() {} -func (*Capability) Descriptor() ([]byte, []int) { - return fileDescriptor_cba1ec2883858369, []int{7} -} - -func (m *Capability) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Capability.Unmarshal(m, b) -} -func (m *Capability) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Capability.Marshal(b, m, deterministic) -} -func (m *Capability) XXX_Merge(src proto.Message) { - xxx_messageInfo_Capability.Merge(m, src) -} -func (m *Capability) XXX_Size() int { - return xxx_messageInfo_Capability.Size(m) -} -func (m *Capability) XXX_DiscardUnknown() { - xxx_messageInfo_Capability.DiscardUnknown(m) -} - -var xxx_messageInfo_Capability proto.InternalMessageInfo - -func init() { - proto.RegisterType((*HashingAlgorithm)(nil), "common.HashingAlgorithm") - proto.RegisterType((*BlockDataHashingStructure)(nil), "common.BlockDataHashingStructure") - proto.RegisterType((*OrdererAddresses)(nil), "common.OrdererAddresses") - proto.RegisterType((*Consenter)(nil), "common.Consenter") - proto.RegisterType((*Orderers)(nil), "common.Orderers") - proto.RegisterType((*Consortium)(nil), "common.Consortium") - proto.RegisterType((*Capabilities)(nil), "common.Capabilities") - proto.RegisterMapType((map[string]*Capability)(nil), "common.Capabilities.CapabilitiesEntry") - proto.RegisterType((*Capability)(nil), "common.Capability") -} - -func init() { proto.RegisterFile("common/configuration.proto", fileDescriptor_cba1ec2883858369) } - -var fileDescriptor_cba1ec2883858369 = []byte{ - // 459 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x92, 0xc1, 0x6e, 0xd3, 0x40, - 0x10, 0x86, 0xe5, 0xa4, 0x09, 0xcd, 0x34, 0x85, 0x64, 0x05, 0x92, 0x89, 0x38, 0x44, 0x16, 0x8a, - 0x72, 0xa9, 0x03, 0xe5, 0x82, 0x38, 0x20, 0xb5, 0x01, 0x09, 0x2a, 0x21, 0x24, 0x17, 0x71, 0xe0, - 0x12, 0x6d, 0xec, 0xa9, 0xbd, 0xaa, 0xbd, 0x6b, 0xcd, 0x8e, 0x8b, 0xfc, 0x54, 0xbc, 0x05, 0xcf, - 0x85, 0xec, 0x75, 0x93, 0x54, 0xe5, 0x36, 0xff, 0x3f, 0xdf, 0xec, 0xcc, 0x68, 0x16, 0x66, 0xb1, - 0x29, 0x0a, 0xa3, 0x57, 0xb1, 0xd1, 0x37, 0x2a, 0xad, 0x48, 0xb2, 0x32, 0x3a, 0x2c, 0xc9, 0xb0, - 0x11, 0x43, 0x97, 0x0b, 0x16, 0x30, 0xf9, 0x22, 0x6d, 0xa6, 0x74, 0x7a, 0x91, 0xa7, 0x86, 0x14, - 0x67, 0x85, 0x10, 0x70, 0xa4, 0x65, 0x81, 0xbe, 0x37, 0xf7, 0x96, 0xa3, 0xa8, 0x8d, 0x83, 0xb7, - 0xf0, 0xf2, 0x32, 0x37, 0xf1, 0xed, 0x27, 0xc9, 0xb2, 0x2b, 0xb8, 0x66, 0xaa, 0x62, 0xae, 0x08, - 0xc5, 0x73, 0x18, 0xfc, 0x56, 0x09, 0x67, 0x6d, 0xc5, 0x69, 0xe4, 0x44, 0xf0, 0x06, 0x26, 0xdf, - 0x29, 0x41, 0x42, 0xba, 0x48, 0x12, 0x42, 0x6b, 0xd1, 0x8a, 0x57, 0x30, 0x92, 0xf7, 0xc2, 0xf7, - 0xe6, 0xfd, 0xe5, 0x28, 0xda, 0x1b, 0xc1, 0x5f, 0x0f, 0x46, 0x6b, 0xa3, 0x2d, 0x6a, 0x46, 0x12, - 0x4f, 0xa1, 0xa7, 0x92, 0xee, 0xc9, 0x9e, 0x4a, 0x9a, 0xb1, 0x32, 0x63, 0xd9, 0xef, 0xb9, 0xb1, - 0x9a, 0xb8, 0xf1, 0x4a, 0x43, 0xec, 0xf7, 0x5b, 0xaa, 0x8d, 0xc5, 0x0b, 0x18, 0x16, 0xb6, 0xdc, - 0xa8, 0xc4, 0x3f, 0x6a, 0xc9, 0x41, 0x61, 0xcb, 0xaf, 0x89, 0x98, 0xc1, 0xb1, 0x4a, 0x50, 0xb3, - 0xe2, 0xda, 0x1f, 0xcc, 0xbd, 0xe5, 0x38, 0xda, 0x69, 0xb1, 0x80, 0x67, 0x71, 0xae, 0x50, 0xf3, - 0x86, 0x73, 0xbb, 0x89, 0x91, 0xd8, 0x1f, 0xb6, 0xc8, 0xa9, 0xb3, 0x7f, 0xe4, 0x76, 0x8d, 0xc4, - 0x0d, 0x67, 0x91, 0xee, 0x90, 0xf6, 0xdc, 0x13, 0xc7, 0x39, 0xbb, 0xe3, 0x82, 0x2b, 0x38, 0xee, - 0x56, 0xb7, 0xe2, 0x23, 0x4c, 0xe3, 0xfb, 0x9d, 0x36, 0x85, 0x2c, 0x4b, 0xa5, 0xd3, 0x76, 0xf5, - 0x93, 0xf3, 0x69, 0xe8, 0xae, 0x10, 0xee, 0x96, 0x8e, 0x26, 0x3b, 0xf6, 0x9b, 0x43, 0x83, 0x39, - 0x40, 0x93, 0x36, 0xc4, 0xaa, 0xfa, 0xff, 0x6d, 0xfe, 0x78, 0x30, 0x5e, 0xcb, 0x52, 0x6e, 0x55, - 0xae, 0x58, 0xa1, 0x15, 0x57, 0x30, 0x8e, 0x0f, 0x74, 0xd7, 0x6d, 0xb1, 0xeb, 0x76, 0x90, 0x7b, - 0x20, 0x3e, 0x6b, 0xa6, 0x3a, 0x7a, 0x50, 0x3b, 0xbb, 0x86, 0xe9, 0x23, 0x44, 0x4c, 0xa0, 0x7f, - 0x8b, 0x75, 0x37, 0x44, 0x13, 0x8a, 0x25, 0x0c, 0xee, 0x64, 0x5e, 0x61, 0x7b, 0x9d, 0x93, 0x73, - 0xf1, 0xa8, 0x57, 0x1d, 0x39, 0xe0, 0x43, 0xef, 0xbd, 0x17, 0x8c, 0x01, 0xf6, 0x89, 0xcb, 0x9f, - 0xf0, 0xda, 0x50, 0x1a, 0x66, 0x75, 0x89, 0x94, 0x63, 0x92, 0x22, 0x85, 0x37, 0x72, 0x4b, 0x2a, - 0x76, 0x7f, 0xd5, 0x76, 0x6f, 0xfd, 0x0a, 0x53, 0xc5, 0x59, 0xb5, 0x6d, 0xe4, 0xea, 0x00, 0x5e, - 0x39, 0xf8, 0xcc, 0xc1, 0x67, 0xa9, 0x59, 0x39, 0x7e, 0x3b, 0x6c, 0x9d, 0x77, 0xff, 0x02, 0x00, - 0x00, 0xff, 0xff, 0x49, 0xe4, 0x92, 0xcc, 0x08, 0x03, 0x00, 0x00, -} diff --git a/vendor/github.com/hyperledger/fabric-protos-go/common/ledger.pb.go b/vendor/github.com/hyperledger/fabric-protos-go/common/ledger.pb.go deleted file mode 100644 index b9c87970496..00000000000 --- a/vendor/github.com/hyperledger/fabric-protos-go/common/ledger.pb.go +++ /dev/null @@ -1,155 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: common/ledger.proto - -package common - -import ( - fmt "fmt" - proto "github.com/golang/protobuf/proto" - math "math" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package - -// Contains information about the blockchain ledger such as height, current -// block hash, and previous block hash. -type BlockchainInfo struct { - Height uint64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` - CurrentBlockHash []byte `protobuf:"bytes,2,opt,name=currentBlockHash,proto3" json:"currentBlockHash,omitempty"` - PreviousBlockHash []byte `protobuf:"bytes,3,opt,name=previousBlockHash,proto3" json:"previousBlockHash,omitempty"` - // Specifies bootstrapping snapshot info if the channel is bootstrapped from a snapshot. - // It is nil if the channel is not bootstrapped from a snapshot. - BootstrappingSnapshotInfo *BootstrappingSnapshotInfo `protobuf:"bytes,4,opt,name=bootstrappingSnapshotInfo,proto3" json:"bootstrappingSnapshotInfo,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *BlockchainInfo) Reset() { *m = BlockchainInfo{} } -func (m *BlockchainInfo) String() string { return proto.CompactTextString(m) } -func (*BlockchainInfo) ProtoMessage() {} -func (*BlockchainInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_da3410306adbea27, []int{0} -} - -func (m *BlockchainInfo) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_BlockchainInfo.Unmarshal(m, b) -} -func (m *BlockchainInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_BlockchainInfo.Marshal(b, m, deterministic) -} -func (m *BlockchainInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_BlockchainInfo.Merge(m, src) -} -func (m *BlockchainInfo) XXX_Size() int { - return xxx_messageInfo_BlockchainInfo.Size(m) -} -func (m *BlockchainInfo) XXX_DiscardUnknown() { - xxx_messageInfo_BlockchainInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_BlockchainInfo proto.InternalMessageInfo - -func (m *BlockchainInfo) GetHeight() uint64 { - if m != nil { - return m.Height - } - return 0 -} - -func (m *BlockchainInfo) GetCurrentBlockHash() []byte { - if m != nil { - return m.CurrentBlockHash - } - return nil -} - -func (m *BlockchainInfo) GetPreviousBlockHash() []byte { - if m != nil { - return m.PreviousBlockHash - } - return nil -} - -func (m *BlockchainInfo) GetBootstrappingSnapshotInfo() *BootstrappingSnapshotInfo { - if m != nil { - return m.BootstrappingSnapshotInfo - } - return nil -} - -// Contains information for the bootstrapping snapshot. -type BootstrappingSnapshotInfo struct { - LastBlockInSnapshot uint64 `protobuf:"varint,1,opt,name=lastBlockInSnapshot,proto3" json:"lastBlockInSnapshot,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *BootstrappingSnapshotInfo) Reset() { *m = BootstrappingSnapshotInfo{} } -func (m *BootstrappingSnapshotInfo) String() string { return proto.CompactTextString(m) } -func (*BootstrappingSnapshotInfo) ProtoMessage() {} -func (*BootstrappingSnapshotInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_da3410306adbea27, []int{1} -} - -func (m *BootstrappingSnapshotInfo) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_BootstrappingSnapshotInfo.Unmarshal(m, b) -} -func (m *BootstrappingSnapshotInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_BootstrappingSnapshotInfo.Marshal(b, m, deterministic) -} -func (m *BootstrappingSnapshotInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_BootstrappingSnapshotInfo.Merge(m, src) -} -func (m *BootstrappingSnapshotInfo) XXX_Size() int { - return xxx_messageInfo_BootstrappingSnapshotInfo.Size(m) -} -func (m *BootstrappingSnapshotInfo) XXX_DiscardUnknown() { - xxx_messageInfo_BootstrappingSnapshotInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_BootstrappingSnapshotInfo proto.InternalMessageInfo - -func (m *BootstrappingSnapshotInfo) GetLastBlockInSnapshot() uint64 { - if m != nil { - return m.LastBlockInSnapshot - } - return 0 -} - -func init() { - proto.RegisterType((*BlockchainInfo)(nil), "common.BlockchainInfo") - proto.RegisterType((*BootstrappingSnapshotInfo)(nil), "common.BootstrappingSnapshotInfo") -} - -func init() { proto.RegisterFile("common/ledger.proto", fileDescriptor_da3410306adbea27) } - -var fileDescriptor_da3410306adbea27 = []byte{ - // 252 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x90, 0xc1, 0x4a, 0xc4, 0x30, - 0x10, 0x86, 0x89, 0x2e, 0x3d, 0x44, 0x11, 0xcd, 0x82, 0x74, 0x6f, 0x75, 0xf1, 0x50, 0xc4, 0x4d, - 0x45, 0xdf, 0xa0, 0x27, 0xf7, 0xe0, 0xa5, 0x82, 0x07, 0x2f, 0x92, 0xc6, 0x6c, 0x12, 0xec, 0x66, - 0xc2, 0x24, 0x15, 0x7c, 0x5e, 0x5f, 0x44, 0xb6, 0xa9, 0x28, 0xec, 0xf6, 0x38, 0xff, 0xff, 0x4d, - 0xf8, 0x32, 0x74, 0x2e, 0x61, 0xbb, 0x05, 0x57, 0x75, 0xea, 0x5d, 0x2b, 0xe4, 0x1e, 0x21, 0x02, - 0xcb, 0x52, 0xb8, 0xfc, 0x26, 0xf4, 0xac, 0xee, 0x40, 0x7e, 0x48, 0x23, 0xac, 0x5b, 0xbb, 0x0d, - 0xb0, 0x4b, 0x9a, 0x19, 0x65, 0xb5, 0x89, 0x39, 0x29, 0x48, 0x39, 0x6b, 0xc6, 0x89, 0xdd, 0xd0, - 0x73, 0xd9, 0x23, 0x2a, 0x17, 0x87, 0x85, 0x47, 0x11, 0x4c, 0x7e, 0x54, 0x90, 0xf2, 0xb4, 0xd9, - 0xcb, 0xd9, 0x2d, 0xbd, 0xf0, 0xa8, 0x3e, 0x2d, 0xf4, 0xe1, 0x0f, 0x3e, 0x1e, 0xe0, 0xfd, 0x82, - 0xbd, 0xd1, 0x45, 0x0b, 0x10, 0x43, 0x44, 0xe1, 0xbd, 0x75, 0xfa, 0xd9, 0x09, 0x1f, 0x0c, 0xc4, - 0x9d, 0x4e, 0x3e, 0x2b, 0x48, 0x79, 0x72, 0x7f, 0xc5, 0x93, 0x30, 0xaf, 0xa7, 0xc0, 0x66, 0xfa, - 0x8d, 0xe5, 0x13, 0x5d, 0x4c, 0xee, 0xb1, 0x3b, 0x3a, 0xef, 0x44, 0x48, 0xf2, 0x6b, 0xf7, 0x5b, - 0x8d, 0x9f, 0x3f, 0x54, 0xd5, 0x2f, 0xf4, 0x1a, 0x50, 0x73, 0xf3, 0xe5, 0x15, 0x8e, 0x57, 0xdd, - 0x88, 0x16, 0xad, 0x4c, 0xc7, 0x0d, 0xa3, 0xeb, 0x2b, 0xd7, 0x36, 0x9a, 0xbe, 0xdd, 0x8d, 0xd5, - 0x3f, 0xb8, 0x4a, 0xf0, 0x2a, 0xc1, 0x2b, 0x0d, 0x55, 0xe2, 0xdb, 0x6c, 0x48, 0x1e, 0x7e, 0x02, - 0x00, 0x00, 0xff, 0xff, 0x34, 0xc4, 0xfd, 0x0b, 0xb2, 0x01, 0x00, 0x00, -} diff --git a/vendor/github.com/hyperledger/fabric-protos-go/common/policies.pb.go b/vendor/github.com/hyperledger/fabric-protos-go/common/policies.pb.go deleted file mode 100644 index 7dcbbdf8bcd..00000000000 --- a/vendor/github.com/hyperledger/fabric-protos-go/common/policies.pb.go +++ /dev/null @@ -1,512 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: common/policies.proto - -package common - -import ( - fmt "fmt" - proto "github.com/golang/protobuf/proto" - msp "github.com/hyperledger/fabric-protos-go/msp" - math "math" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package - -type Policy_PolicyType int32 - -const ( - Policy_UNKNOWN Policy_PolicyType = 0 - Policy_SIGNATURE Policy_PolicyType = 1 - Policy_MSP Policy_PolicyType = 2 - Policy_IMPLICIT_META Policy_PolicyType = 3 -) - -var Policy_PolicyType_name = map[int32]string{ - 0: "UNKNOWN", - 1: "SIGNATURE", - 2: "MSP", - 3: "IMPLICIT_META", -} - -var Policy_PolicyType_value = map[string]int32{ - "UNKNOWN": 0, - "SIGNATURE": 1, - "MSP": 2, - "IMPLICIT_META": 3, -} - -func (x Policy_PolicyType) String() string { - return proto.EnumName(Policy_PolicyType_name, int32(x)) -} - -func (Policy_PolicyType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_0d02cf0d453425a3, []int{0, 0} -} - -type ImplicitMetaPolicy_Rule int32 - -const ( - ImplicitMetaPolicy_ANY ImplicitMetaPolicy_Rule = 0 - ImplicitMetaPolicy_ALL ImplicitMetaPolicy_Rule = 1 - ImplicitMetaPolicy_MAJORITY ImplicitMetaPolicy_Rule = 2 -) - -var ImplicitMetaPolicy_Rule_name = map[int32]string{ - 0: "ANY", - 1: "ALL", - 2: "MAJORITY", -} - -var ImplicitMetaPolicy_Rule_value = map[string]int32{ - "ANY": 0, - "ALL": 1, - "MAJORITY": 2, -} - -func (x ImplicitMetaPolicy_Rule) String() string { - return proto.EnumName(ImplicitMetaPolicy_Rule_name, int32(x)) -} - -func (ImplicitMetaPolicy_Rule) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_0d02cf0d453425a3, []int{3, 0} -} - -// Policy expresses a policy which the orderer can evaluate, because there has been some desire expressed to support -// multiple policy engines, this is typed as a oneof for now -type Policy struct { - Type int32 `protobuf:"varint,1,opt,name=type,proto3" json:"type,omitempty"` - Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Policy) Reset() { *m = Policy{} } -func (m *Policy) String() string { return proto.CompactTextString(m) } -func (*Policy) ProtoMessage() {} -func (*Policy) Descriptor() ([]byte, []int) { - return fileDescriptor_0d02cf0d453425a3, []int{0} -} - -func (m *Policy) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Policy.Unmarshal(m, b) -} -func (m *Policy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Policy.Marshal(b, m, deterministic) -} -func (m *Policy) XXX_Merge(src proto.Message) { - xxx_messageInfo_Policy.Merge(m, src) -} -func (m *Policy) XXX_Size() int { - return xxx_messageInfo_Policy.Size(m) -} -func (m *Policy) XXX_DiscardUnknown() { - xxx_messageInfo_Policy.DiscardUnknown(m) -} - -var xxx_messageInfo_Policy proto.InternalMessageInfo - -func (m *Policy) GetType() int32 { - if m != nil { - return m.Type - } - return 0 -} - -func (m *Policy) GetValue() []byte { - if m != nil { - return m.Value - } - return nil -} - -// SignaturePolicyEnvelope wraps a SignaturePolicy and includes a version for future enhancements -type SignaturePolicyEnvelope struct { - Version int32 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` - Rule *SignaturePolicy `protobuf:"bytes,2,opt,name=rule,proto3" json:"rule,omitempty"` - Identities []*msp.MSPPrincipal `protobuf:"bytes,3,rep,name=identities,proto3" json:"identities,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SignaturePolicyEnvelope) Reset() { *m = SignaturePolicyEnvelope{} } -func (m *SignaturePolicyEnvelope) String() string { return proto.CompactTextString(m) } -func (*SignaturePolicyEnvelope) ProtoMessage() {} -func (*SignaturePolicyEnvelope) Descriptor() ([]byte, []int) { - return fileDescriptor_0d02cf0d453425a3, []int{1} -} - -func (m *SignaturePolicyEnvelope) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SignaturePolicyEnvelope.Unmarshal(m, b) -} -func (m *SignaturePolicyEnvelope) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SignaturePolicyEnvelope.Marshal(b, m, deterministic) -} -func (m *SignaturePolicyEnvelope) XXX_Merge(src proto.Message) { - xxx_messageInfo_SignaturePolicyEnvelope.Merge(m, src) -} -func (m *SignaturePolicyEnvelope) XXX_Size() int { - return xxx_messageInfo_SignaturePolicyEnvelope.Size(m) -} -func (m *SignaturePolicyEnvelope) XXX_DiscardUnknown() { - xxx_messageInfo_SignaturePolicyEnvelope.DiscardUnknown(m) -} - -var xxx_messageInfo_SignaturePolicyEnvelope proto.InternalMessageInfo - -func (m *SignaturePolicyEnvelope) GetVersion() int32 { - if m != nil { - return m.Version - } - return 0 -} - -func (m *SignaturePolicyEnvelope) GetRule() *SignaturePolicy { - if m != nil { - return m.Rule - } - return nil -} - -func (m *SignaturePolicyEnvelope) GetIdentities() []*msp.MSPPrincipal { - if m != nil { - return m.Identities - } - return nil -} - -// SignaturePolicy is a recursive message structure which defines a featherweight DSL for describing -// policies which are more complicated than 'exactly this signature'. The NOutOf operator is sufficent -// to express AND as well as OR, as well as of course N out of the following M policies -// SignedBy implies that the signature is from a valid certificate which is signed by the trusted -// authority specified in the bytes. This will be the certificate itself for a self-signed certificate -// and will be the CA for more traditional certificates -type SignaturePolicy struct { - // Types that are valid to be assigned to Type: - // - // *SignaturePolicy_SignedBy - // *SignaturePolicy_NOutOf_ - Type isSignaturePolicy_Type `protobuf_oneof:"Type"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SignaturePolicy) Reset() { *m = SignaturePolicy{} } -func (m *SignaturePolicy) String() string { return proto.CompactTextString(m) } -func (*SignaturePolicy) ProtoMessage() {} -func (*SignaturePolicy) Descriptor() ([]byte, []int) { - return fileDescriptor_0d02cf0d453425a3, []int{2} -} - -func (m *SignaturePolicy) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SignaturePolicy.Unmarshal(m, b) -} -func (m *SignaturePolicy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SignaturePolicy.Marshal(b, m, deterministic) -} -func (m *SignaturePolicy) XXX_Merge(src proto.Message) { - xxx_messageInfo_SignaturePolicy.Merge(m, src) -} -func (m *SignaturePolicy) XXX_Size() int { - return xxx_messageInfo_SignaturePolicy.Size(m) -} -func (m *SignaturePolicy) XXX_DiscardUnknown() { - xxx_messageInfo_SignaturePolicy.DiscardUnknown(m) -} - -var xxx_messageInfo_SignaturePolicy proto.InternalMessageInfo - -type isSignaturePolicy_Type interface { - isSignaturePolicy_Type() -} - -type SignaturePolicy_SignedBy struct { - SignedBy int32 `protobuf:"varint,1,opt,name=signed_by,json=signedBy,proto3,oneof"` -} - -type SignaturePolicy_NOutOf_ struct { - NOutOf *SignaturePolicy_NOutOf `protobuf:"bytes,2,opt,name=n_out_of,json=nOutOf,proto3,oneof"` -} - -func (*SignaturePolicy_SignedBy) isSignaturePolicy_Type() {} - -func (*SignaturePolicy_NOutOf_) isSignaturePolicy_Type() {} - -func (m *SignaturePolicy) GetType() isSignaturePolicy_Type { - if m != nil { - return m.Type - } - return nil -} - -func (m *SignaturePolicy) GetSignedBy() int32 { - if x, ok := m.GetType().(*SignaturePolicy_SignedBy); ok { - return x.SignedBy - } - return 0 -} - -func (m *SignaturePolicy) GetNOutOf() *SignaturePolicy_NOutOf { - if x, ok := m.GetType().(*SignaturePolicy_NOutOf_); ok { - return x.NOutOf - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*SignaturePolicy) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*SignaturePolicy_SignedBy)(nil), - (*SignaturePolicy_NOutOf_)(nil), - } -} - -type SignaturePolicy_NOutOf struct { - N int32 `protobuf:"varint,1,opt,name=n,proto3" json:"n,omitempty"` - Rules []*SignaturePolicy `protobuf:"bytes,2,rep,name=rules,proto3" json:"rules,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SignaturePolicy_NOutOf) Reset() { *m = SignaturePolicy_NOutOf{} } -func (m *SignaturePolicy_NOutOf) String() string { return proto.CompactTextString(m) } -func (*SignaturePolicy_NOutOf) ProtoMessage() {} -func (*SignaturePolicy_NOutOf) Descriptor() ([]byte, []int) { - return fileDescriptor_0d02cf0d453425a3, []int{2, 0} -} - -func (m *SignaturePolicy_NOutOf) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SignaturePolicy_NOutOf.Unmarshal(m, b) -} -func (m *SignaturePolicy_NOutOf) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SignaturePolicy_NOutOf.Marshal(b, m, deterministic) -} -func (m *SignaturePolicy_NOutOf) XXX_Merge(src proto.Message) { - xxx_messageInfo_SignaturePolicy_NOutOf.Merge(m, src) -} -func (m *SignaturePolicy_NOutOf) XXX_Size() int { - return xxx_messageInfo_SignaturePolicy_NOutOf.Size(m) -} -func (m *SignaturePolicy_NOutOf) XXX_DiscardUnknown() { - xxx_messageInfo_SignaturePolicy_NOutOf.DiscardUnknown(m) -} - -var xxx_messageInfo_SignaturePolicy_NOutOf proto.InternalMessageInfo - -func (m *SignaturePolicy_NOutOf) GetN() int32 { - if m != nil { - return m.N - } - return 0 -} - -func (m *SignaturePolicy_NOutOf) GetRules() []*SignaturePolicy { - if m != nil { - return m.Rules - } - return nil -} - -// ImplicitMetaPolicy is a policy type which depends on the hierarchical nature of the configuration -// It is implicit because the rule is generate implicitly based on the number of sub policies -// It is meta because it depends only on the result of other policies -// When evaluated, this policy iterates over all immediate child sub-groups, retrieves the policy -// of name sub_policy, evaluates the collection and applies the rule. -// For example, with 4 sub-groups, and a policy name of "foo", ImplicitMetaPolicy retrieves -// each sub-group, retrieves policy "foo" for each subgroup, evaluates it, and, in the case of ANY -// 1 satisfied is sufficient, ALL would require 4 signatures, and MAJORITY would require 3 signatures. -type ImplicitMetaPolicy struct { - SubPolicy string `protobuf:"bytes,1,opt,name=sub_policy,json=subPolicy,proto3" json:"sub_policy,omitempty"` - Rule ImplicitMetaPolicy_Rule `protobuf:"varint,2,opt,name=rule,proto3,enum=common.ImplicitMetaPolicy_Rule" json:"rule,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ImplicitMetaPolicy) Reset() { *m = ImplicitMetaPolicy{} } -func (m *ImplicitMetaPolicy) String() string { return proto.CompactTextString(m) } -func (*ImplicitMetaPolicy) ProtoMessage() {} -func (*ImplicitMetaPolicy) Descriptor() ([]byte, []int) { - return fileDescriptor_0d02cf0d453425a3, []int{3} -} - -func (m *ImplicitMetaPolicy) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ImplicitMetaPolicy.Unmarshal(m, b) -} -func (m *ImplicitMetaPolicy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ImplicitMetaPolicy.Marshal(b, m, deterministic) -} -func (m *ImplicitMetaPolicy) XXX_Merge(src proto.Message) { - xxx_messageInfo_ImplicitMetaPolicy.Merge(m, src) -} -func (m *ImplicitMetaPolicy) XXX_Size() int { - return xxx_messageInfo_ImplicitMetaPolicy.Size(m) -} -func (m *ImplicitMetaPolicy) XXX_DiscardUnknown() { - xxx_messageInfo_ImplicitMetaPolicy.DiscardUnknown(m) -} - -var xxx_messageInfo_ImplicitMetaPolicy proto.InternalMessageInfo - -func (m *ImplicitMetaPolicy) GetSubPolicy() string { - if m != nil { - return m.SubPolicy - } - return "" -} - -func (m *ImplicitMetaPolicy) GetRule() ImplicitMetaPolicy_Rule { - if m != nil { - return m.Rule - } - return ImplicitMetaPolicy_ANY -} - -// ApplicationPolicy captures the diffenrent policy types that -// are set and evaluted at the application level. -// -// Deprecated: Do not use. -type ApplicationPolicy struct { - // Types that are valid to be assigned to Type: - // - // *ApplicationPolicy_SignaturePolicy - // *ApplicationPolicy_ChannelConfigPolicyReference - Type isApplicationPolicy_Type `protobuf_oneof:"Type"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ApplicationPolicy) Reset() { *m = ApplicationPolicy{} } -func (m *ApplicationPolicy) String() string { return proto.CompactTextString(m) } -func (*ApplicationPolicy) ProtoMessage() {} -func (*ApplicationPolicy) Descriptor() ([]byte, []int) { - return fileDescriptor_0d02cf0d453425a3, []int{4} -} - -func (m *ApplicationPolicy) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ApplicationPolicy.Unmarshal(m, b) -} -func (m *ApplicationPolicy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ApplicationPolicy.Marshal(b, m, deterministic) -} -func (m *ApplicationPolicy) XXX_Merge(src proto.Message) { - xxx_messageInfo_ApplicationPolicy.Merge(m, src) -} -func (m *ApplicationPolicy) XXX_Size() int { - return xxx_messageInfo_ApplicationPolicy.Size(m) -} -func (m *ApplicationPolicy) XXX_DiscardUnknown() { - xxx_messageInfo_ApplicationPolicy.DiscardUnknown(m) -} - -var xxx_messageInfo_ApplicationPolicy proto.InternalMessageInfo - -type isApplicationPolicy_Type interface { - isApplicationPolicy_Type() -} - -type ApplicationPolicy_SignaturePolicy struct { - SignaturePolicy *SignaturePolicyEnvelope `protobuf:"bytes,1,opt,name=signature_policy,json=signaturePolicy,proto3,oneof"` -} - -type ApplicationPolicy_ChannelConfigPolicyReference struct { - ChannelConfigPolicyReference string `protobuf:"bytes,2,opt,name=channel_config_policy_reference,json=channelConfigPolicyReference,proto3,oneof"` -} - -func (*ApplicationPolicy_SignaturePolicy) isApplicationPolicy_Type() {} - -func (*ApplicationPolicy_ChannelConfigPolicyReference) isApplicationPolicy_Type() {} - -func (m *ApplicationPolicy) GetType() isApplicationPolicy_Type { - if m != nil { - return m.Type - } - return nil -} - -func (m *ApplicationPolicy) GetSignaturePolicy() *SignaturePolicyEnvelope { - if x, ok := m.GetType().(*ApplicationPolicy_SignaturePolicy); ok { - return x.SignaturePolicy - } - return nil -} - -func (m *ApplicationPolicy) GetChannelConfigPolicyReference() string { - if x, ok := m.GetType().(*ApplicationPolicy_ChannelConfigPolicyReference); ok { - return x.ChannelConfigPolicyReference - } - return "" -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*ApplicationPolicy) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*ApplicationPolicy_SignaturePolicy)(nil), - (*ApplicationPolicy_ChannelConfigPolicyReference)(nil), - } -} - -func init() { - proto.RegisterEnum("common.Policy_PolicyType", Policy_PolicyType_name, Policy_PolicyType_value) - proto.RegisterEnum("common.ImplicitMetaPolicy_Rule", ImplicitMetaPolicy_Rule_name, ImplicitMetaPolicy_Rule_value) - proto.RegisterType((*Policy)(nil), "common.Policy") - proto.RegisterType((*SignaturePolicyEnvelope)(nil), "common.SignaturePolicyEnvelope") - proto.RegisterType((*SignaturePolicy)(nil), "common.SignaturePolicy") - proto.RegisterType((*SignaturePolicy_NOutOf)(nil), "common.SignaturePolicy.NOutOf") - proto.RegisterType((*ImplicitMetaPolicy)(nil), "common.ImplicitMetaPolicy") - proto.RegisterType((*ApplicationPolicy)(nil), "common.ApplicationPolicy") -} - -func init() { proto.RegisterFile("common/policies.proto", fileDescriptor_0d02cf0d453425a3) } - -var fileDescriptor_0d02cf0d453425a3 = []byte{ - // 559 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x93, 0xd1, 0x4e, 0xdb, 0x30, - 0x14, 0x86, 0xe3, 0xb6, 0x04, 0x7a, 0x0a, 0x23, 0x58, 0x4c, 0x44, 0x68, 0x1b, 0x28, 0x9a, 0x26, - 0xa4, 0x89, 0x54, 0x82, 0x5d, 0x71, 0x57, 0x58, 0x45, 0xb3, 0x35, 0x69, 0xe5, 0x96, 0x4d, 0xec, - 0x26, 0x4a, 0x82, 0x1b, 0x2c, 0xa5, 0x76, 0x14, 0x27, 0x68, 0x7d, 0x8b, 0x5d, 0xed, 0x51, 0x76, - 0xb3, 0x97, 0x9b, 0x12, 0x27, 0x5b, 0xc5, 0xd4, 0x3b, 0x9f, 0x93, 0xcf, 0xbf, 0xff, 0xff, 0xd8, - 0x81, 0x97, 0x91, 0x58, 0x2e, 0x05, 0xef, 0xa7, 0x22, 0x61, 0x11, 0xa3, 0xd2, 0x4e, 0x33, 0x91, - 0x0b, 0xac, 0xab, 0xf6, 0xf1, 0xd1, 0x52, 0xa6, 0xfd, 0xa5, 0x4c, 0xfd, 0x34, 0x63, 0x3c, 0x62, - 0x69, 0x90, 0x28, 0xc0, 0xfa, 0x0e, 0xfa, 0xb4, 0xdc, 0xb2, 0xc2, 0x18, 0x3a, 0xf9, 0x2a, 0xa5, - 0x26, 0x3a, 0x45, 0x67, 0x5b, 0xa4, 0x5a, 0xe3, 0x43, 0xd8, 0x7a, 0x0a, 0x92, 0x82, 0x9a, 0xad, - 0x53, 0x74, 0xb6, 0x4b, 0x54, 0x61, 0x7d, 0x04, 0x50, 0x7b, 0xe6, 0x25, 0xd3, 0x83, 0xed, 0x3b, - 0xef, 0xb3, 0x37, 0xf9, 0xea, 0x19, 0x1a, 0xde, 0x83, 0xee, 0xcc, 0xb9, 0xf5, 0x06, 0xf3, 0x3b, - 0x32, 0x34, 0x10, 0xde, 0x86, 0xb6, 0x3b, 0x9b, 0x1a, 0x2d, 0x7c, 0x00, 0x7b, 0x8e, 0x3b, 0x1d, - 0x3b, 0x37, 0xce, 0xdc, 0x77, 0x87, 0xf3, 0x81, 0xd1, 0xb6, 0x7e, 0x22, 0x38, 0x9a, 0xb1, 0x98, - 0x07, 0x79, 0x91, 0x51, 0xa5, 0x37, 0xe4, 0x4f, 0x34, 0x11, 0x29, 0xc5, 0x26, 0x6c, 0x3f, 0xd1, - 0x4c, 0x32, 0xc1, 0x6b, 0x3b, 0x4d, 0x89, 0xdf, 0x43, 0x27, 0x2b, 0x12, 0x65, 0xa8, 0x77, 0x71, - 0x64, 0xab, 0x7c, 0xf6, 0x33, 0x21, 0x52, 0x41, 0xf8, 0x03, 0x00, 0x7b, 0xa0, 0x3c, 0x67, 0x39, - 0xa3, 0xd2, 0x6c, 0x9f, 0xb6, 0xcf, 0x7a, 0x17, 0x87, 0xcd, 0x16, 0x77, 0x36, 0x9d, 0x36, 0xc3, - 0x20, 0x6b, 0x9c, 0xf5, 0x1b, 0xc1, 0xfe, 0x33, 0x3d, 0xfc, 0x1a, 0xba, 0x92, 0xc5, 0x9c, 0x3e, - 0xf8, 0xe1, 0x4a, 0x59, 0x1a, 0x69, 0x64, 0x47, 0xb5, 0xae, 0x57, 0xf8, 0x0a, 0x76, 0xb8, 0x2f, - 0x8a, 0xdc, 0x17, 0x8b, 0xda, 0xd9, 0x9b, 0x0d, 0xce, 0x6c, 0x6f, 0x52, 0xe4, 0x93, 0xc5, 0x48, - 0x23, 0x3a, 0xaf, 0x56, 0xc7, 0x43, 0xd0, 0x55, 0x0f, 0xef, 0x02, 0x6a, 0xf2, 0x22, 0x8e, 0xcf, - 0x61, 0xab, 0x0c, 0x21, 0xcd, 0x56, 0xe5, 0x7b, 0x63, 0x54, 0x45, 0x5d, 0xeb, 0xd0, 0x29, 0xaf, - 0xc3, 0xfa, 0x81, 0x00, 0x3b, 0xcb, 0xb4, 0x7c, 0x05, 0xb9, 0x4b, 0xf3, 0xe0, 0x6f, 0x00, 0x90, - 0x45, 0xe8, 0x57, 0xcf, 0x43, 0x25, 0xe8, 0x92, 0xae, 0x2c, 0xc2, 0xfa, 0xf3, 0xe5, 0xda, 0x58, - 0x5f, 0x5c, 0x9c, 0x34, 0x67, 0xfd, 0x2f, 0x64, 0x93, 0x22, 0xa1, 0x6a, 0xbc, 0xd6, 0x3b, 0xe8, - 0x94, 0x55, 0x79, 0xcb, 0x03, 0xef, 0xde, 0xd0, 0xaa, 0xc5, 0x78, 0x6c, 0x20, 0xbc, 0x0b, 0x3b, - 0xee, 0xe0, 0xd3, 0x84, 0x38, 0xf3, 0x7b, 0xa3, 0x65, 0xfd, 0x42, 0x70, 0x30, 0x48, 0x4b, 0xa5, - 0x20, 0x67, 0x82, 0xd7, 0x47, 0x8e, 0xc1, 0x90, 0x4d, 0x94, 0x75, 0x5f, 0xbd, 0x7f, 0xc7, 0x6f, - 0x78, 0x1e, 0x23, 0x8d, 0xec, 0xcb, 0x67, 0x17, 0x74, 0x0b, 0x27, 0xd1, 0x63, 0xc0, 0x39, 0x4d, - 0xfc, 0x48, 0xf0, 0x05, 0x8b, 0x6b, 0x49, 0x3f, 0xa3, 0x0b, 0x9a, 0x51, 0x1e, 0xa9, 0x6c, 0xdd, - 0x91, 0x46, 0x5e, 0xd5, 0xe0, 0x4d, 0xc5, 0xd5, 0x53, 0x6c, 0xa8, 0xab, 0x96, 0x89, 0x9a, 0x59, - 0x5e, 0x7f, 0x81, 0xb7, 0x22, 0x8b, 0xed, 0xc7, 0x55, 0x4a, 0xb3, 0x84, 0x3e, 0xc4, 0x34, 0xb3, - 0x17, 0x41, 0x98, 0xb1, 0x48, 0xfd, 0x3c, 0xb2, 0xf6, 0xf9, 0xcd, 0x8e, 0x59, 0xfe, 0x58, 0x84, - 0x65, 0xd9, 0x5f, 0x83, 0xfb, 0x0a, 0x3e, 0x57, 0xf0, 0x79, 0x2c, 0xfa, 0x8a, 0x0f, 0xf5, 0xaa, - 0x73, 0xf9, 0x27, 0x00, 0x00, 0xff, 0xff, 0x77, 0x84, 0xc8, 0xc7, 0xb5, 0x03, 0x00, 0x00, -} diff --git a/vendor/github.com/hyperledger/fabric-protos-go/discovery/protocol.pb.go b/vendor/github.com/hyperledger/fabric-protos-go/discovery/protocol.pb.go deleted file mode 100644 index 30fb6937780..00000000000 --- a/vendor/github.com/hyperledger/fabric-protos-go/discovery/protocol.pb.go +++ /dev/null @@ -1,1275 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: discovery/protocol.proto - -package discovery - -import ( - context "context" - fmt "fmt" - proto "github.com/golang/protobuf/proto" - gossip "github.com/hyperledger/fabric-protos-go/gossip" - msp "github.com/hyperledger/fabric-protos-go/msp" - peer "github.com/hyperledger/fabric-protos-go/peer" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - math "math" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package - -// SignedRequest contains a serialized Request in the payload field -// and a signature. -// The identity that is used to verify the signature -// can be extracted from the authentication field of type AuthInfo -// in the Request itself after deserializing it. -type SignedRequest struct { - Payload []byte `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"` - Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SignedRequest) Reset() { *m = SignedRequest{} } -func (m *SignedRequest) String() string { return proto.CompactTextString(m) } -func (*SignedRequest) ProtoMessage() {} -func (*SignedRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_ce69bf33982206ff, []int{0} -} - -func (m *SignedRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SignedRequest.Unmarshal(m, b) -} -func (m *SignedRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SignedRequest.Marshal(b, m, deterministic) -} -func (m *SignedRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_SignedRequest.Merge(m, src) -} -func (m *SignedRequest) XXX_Size() int { - return xxx_messageInfo_SignedRequest.Size(m) -} -func (m *SignedRequest) XXX_DiscardUnknown() { - xxx_messageInfo_SignedRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_SignedRequest proto.InternalMessageInfo - -func (m *SignedRequest) GetPayload() []byte { - if m != nil { - return m.Payload - } - return nil -} - -func (m *SignedRequest) GetSignature() []byte { - if m != nil { - return m.Signature - } - return nil -} - -// Request contains authentication info about the client that sent the request -// and the queries it wishes to query the service -type Request struct { - // authentication contains information that the service uses to check - // the client's eligibility for the queries. - Authentication *AuthInfo `protobuf:"bytes,1,opt,name=authentication,proto3" json:"authentication,omitempty"` - // queries - Queries []*Query `protobuf:"bytes,2,rep,name=queries,proto3" json:"queries,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Request) Reset() { *m = Request{} } -func (m *Request) String() string { return proto.CompactTextString(m) } -func (*Request) ProtoMessage() {} -func (*Request) Descriptor() ([]byte, []int) { - return fileDescriptor_ce69bf33982206ff, []int{1} -} - -func (m *Request) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Request.Unmarshal(m, b) -} -func (m *Request) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Request.Marshal(b, m, deterministic) -} -func (m *Request) XXX_Merge(src proto.Message) { - xxx_messageInfo_Request.Merge(m, src) -} -func (m *Request) XXX_Size() int { - return xxx_messageInfo_Request.Size(m) -} -func (m *Request) XXX_DiscardUnknown() { - xxx_messageInfo_Request.DiscardUnknown(m) -} - -var xxx_messageInfo_Request proto.InternalMessageInfo - -func (m *Request) GetAuthentication() *AuthInfo { - if m != nil { - return m.Authentication - } - return nil -} - -func (m *Request) GetQueries() []*Query { - if m != nil { - return m.Queries - } - return nil -} - -type Response struct { - // The results are returned in the same order of the queries - Results []*QueryResult `protobuf:"bytes,1,rep,name=results,proto3" json:"results,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Response) Reset() { *m = Response{} } -func (m *Response) String() string { return proto.CompactTextString(m) } -func (*Response) ProtoMessage() {} -func (*Response) Descriptor() ([]byte, []int) { - return fileDescriptor_ce69bf33982206ff, []int{2} -} - -func (m *Response) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Response.Unmarshal(m, b) -} -func (m *Response) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Response.Marshal(b, m, deterministic) -} -func (m *Response) XXX_Merge(src proto.Message) { - xxx_messageInfo_Response.Merge(m, src) -} -func (m *Response) XXX_Size() int { - return xxx_messageInfo_Response.Size(m) -} -func (m *Response) XXX_DiscardUnknown() { - xxx_messageInfo_Response.DiscardUnknown(m) -} - -var xxx_messageInfo_Response proto.InternalMessageInfo - -func (m *Response) GetResults() []*QueryResult { - if m != nil { - return m.Results - } - return nil -} - -// AuthInfo aggregates authentication information that the server uses -// to authenticate the client -type AuthInfo struct { - // This is the identity of the client that is used to verify the signature - // on the SignedRequest's payload. - // It is a msp.SerializedIdentity in bytes form - ClientIdentity []byte `protobuf:"bytes,1,opt,name=client_identity,json=clientIdentity,proto3" json:"client_identity,omitempty"` - // This is the hash of the client's TLS cert. - // When the network is running with TLS, clients that don't include a certificate - // will be denied access to the service. - // Since the Request is encapsulated with a SignedRequest (which is signed), - // this binds the TLS session to the enrollement identity of the client and - // therefore both authenticates the client to the server, - // and also prevents the server from relaying the request message to another server. - ClientTlsCertHash []byte `protobuf:"bytes,2,opt,name=client_tls_cert_hash,json=clientTlsCertHash,proto3" json:"client_tls_cert_hash,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *AuthInfo) Reset() { *m = AuthInfo{} } -func (m *AuthInfo) String() string { return proto.CompactTextString(m) } -func (*AuthInfo) ProtoMessage() {} -func (*AuthInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_ce69bf33982206ff, []int{3} -} - -func (m *AuthInfo) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_AuthInfo.Unmarshal(m, b) -} -func (m *AuthInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_AuthInfo.Marshal(b, m, deterministic) -} -func (m *AuthInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_AuthInfo.Merge(m, src) -} -func (m *AuthInfo) XXX_Size() int { - return xxx_messageInfo_AuthInfo.Size(m) -} -func (m *AuthInfo) XXX_DiscardUnknown() { - xxx_messageInfo_AuthInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_AuthInfo proto.InternalMessageInfo - -func (m *AuthInfo) GetClientIdentity() []byte { - if m != nil { - return m.ClientIdentity - } - return nil -} - -func (m *AuthInfo) GetClientTlsCertHash() []byte { - if m != nil { - return m.ClientTlsCertHash - } - return nil -} - -// Query asks for information in the context of a specific channel -type Query struct { - Channel string `protobuf:"bytes,1,opt,name=channel,proto3" json:"channel,omitempty"` - // Types that are valid to be assigned to Query: - // - // *Query_ConfigQuery - // *Query_PeerQuery - // *Query_CcQuery - // *Query_LocalPeers - Query isQuery_Query `protobuf_oneof:"query"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Query) Reset() { *m = Query{} } -func (m *Query) String() string { return proto.CompactTextString(m) } -func (*Query) ProtoMessage() {} -func (*Query) Descriptor() ([]byte, []int) { - return fileDescriptor_ce69bf33982206ff, []int{4} -} - -func (m *Query) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Query.Unmarshal(m, b) -} -func (m *Query) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Query.Marshal(b, m, deterministic) -} -func (m *Query) XXX_Merge(src proto.Message) { - xxx_messageInfo_Query.Merge(m, src) -} -func (m *Query) XXX_Size() int { - return xxx_messageInfo_Query.Size(m) -} -func (m *Query) XXX_DiscardUnknown() { - xxx_messageInfo_Query.DiscardUnknown(m) -} - -var xxx_messageInfo_Query proto.InternalMessageInfo - -func (m *Query) GetChannel() string { - if m != nil { - return m.Channel - } - return "" -} - -type isQuery_Query interface { - isQuery_Query() -} - -type Query_ConfigQuery struct { - ConfigQuery *ConfigQuery `protobuf:"bytes,2,opt,name=config_query,json=configQuery,proto3,oneof"` -} - -type Query_PeerQuery struct { - PeerQuery *PeerMembershipQuery `protobuf:"bytes,3,opt,name=peer_query,json=peerQuery,proto3,oneof"` -} - -type Query_CcQuery struct { - CcQuery *ChaincodeQuery `protobuf:"bytes,4,opt,name=cc_query,json=ccQuery,proto3,oneof"` -} - -type Query_LocalPeers struct { - LocalPeers *LocalPeerQuery `protobuf:"bytes,5,opt,name=local_peers,json=localPeers,proto3,oneof"` -} - -func (*Query_ConfigQuery) isQuery_Query() {} - -func (*Query_PeerQuery) isQuery_Query() {} - -func (*Query_CcQuery) isQuery_Query() {} - -func (*Query_LocalPeers) isQuery_Query() {} - -func (m *Query) GetQuery() isQuery_Query { - if m != nil { - return m.Query - } - return nil -} - -func (m *Query) GetConfigQuery() *ConfigQuery { - if x, ok := m.GetQuery().(*Query_ConfigQuery); ok { - return x.ConfigQuery - } - return nil -} - -func (m *Query) GetPeerQuery() *PeerMembershipQuery { - if x, ok := m.GetQuery().(*Query_PeerQuery); ok { - return x.PeerQuery - } - return nil -} - -func (m *Query) GetCcQuery() *ChaincodeQuery { - if x, ok := m.GetQuery().(*Query_CcQuery); ok { - return x.CcQuery - } - return nil -} - -func (m *Query) GetLocalPeers() *LocalPeerQuery { - if x, ok := m.GetQuery().(*Query_LocalPeers); ok { - return x.LocalPeers - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*Query) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*Query_ConfigQuery)(nil), - (*Query_PeerQuery)(nil), - (*Query_CcQuery)(nil), - (*Query_LocalPeers)(nil), - } -} - -// QueryResult contains a result for a given Query. -// The corresponding Query can be inferred by the index of the QueryResult from -// its enclosing Response message. -// QueryResults are ordered in the same order as the Queries are ordered in their enclosing Request. -type QueryResult struct { - // Types that are valid to be assigned to Result: - // - // *QueryResult_Error - // *QueryResult_ConfigResult - // *QueryResult_CcQueryRes - // *QueryResult_Members - Result isQueryResult_Result `protobuf_oneof:"result"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *QueryResult) Reset() { *m = QueryResult{} } -func (m *QueryResult) String() string { return proto.CompactTextString(m) } -func (*QueryResult) ProtoMessage() {} -func (*QueryResult) Descriptor() ([]byte, []int) { - return fileDescriptor_ce69bf33982206ff, []int{5} -} - -func (m *QueryResult) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_QueryResult.Unmarshal(m, b) -} -func (m *QueryResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_QueryResult.Marshal(b, m, deterministic) -} -func (m *QueryResult) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryResult.Merge(m, src) -} -func (m *QueryResult) XXX_Size() int { - return xxx_messageInfo_QueryResult.Size(m) -} -func (m *QueryResult) XXX_DiscardUnknown() { - xxx_messageInfo_QueryResult.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryResult proto.InternalMessageInfo - -type isQueryResult_Result interface { - isQueryResult_Result() -} - -type QueryResult_Error struct { - Error *Error `protobuf:"bytes,1,opt,name=error,proto3,oneof"` -} - -type QueryResult_ConfigResult struct { - ConfigResult *ConfigResult `protobuf:"bytes,2,opt,name=config_result,json=configResult,proto3,oneof"` -} - -type QueryResult_CcQueryRes struct { - CcQueryRes *ChaincodeQueryResult `protobuf:"bytes,3,opt,name=cc_query_res,json=ccQueryRes,proto3,oneof"` -} - -type QueryResult_Members struct { - Members *PeerMembershipResult `protobuf:"bytes,4,opt,name=members,proto3,oneof"` -} - -func (*QueryResult_Error) isQueryResult_Result() {} - -func (*QueryResult_ConfigResult) isQueryResult_Result() {} - -func (*QueryResult_CcQueryRes) isQueryResult_Result() {} - -func (*QueryResult_Members) isQueryResult_Result() {} - -func (m *QueryResult) GetResult() isQueryResult_Result { - if m != nil { - return m.Result - } - return nil -} - -func (m *QueryResult) GetError() *Error { - if x, ok := m.GetResult().(*QueryResult_Error); ok { - return x.Error - } - return nil -} - -func (m *QueryResult) GetConfigResult() *ConfigResult { - if x, ok := m.GetResult().(*QueryResult_ConfigResult); ok { - return x.ConfigResult - } - return nil -} - -func (m *QueryResult) GetCcQueryRes() *ChaincodeQueryResult { - if x, ok := m.GetResult().(*QueryResult_CcQueryRes); ok { - return x.CcQueryRes - } - return nil -} - -func (m *QueryResult) GetMembers() *PeerMembershipResult { - if x, ok := m.GetResult().(*QueryResult_Members); ok { - return x.Members - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*QueryResult) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*QueryResult_Error)(nil), - (*QueryResult_ConfigResult)(nil), - (*QueryResult_CcQueryRes)(nil), - (*QueryResult_Members)(nil), - } -} - -// ConfigQuery requests a ConfigResult -type ConfigQuery struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ConfigQuery) Reset() { *m = ConfigQuery{} } -func (m *ConfigQuery) String() string { return proto.CompactTextString(m) } -func (*ConfigQuery) ProtoMessage() {} -func (*ConfigQuery) Descriptor() ([]byte, []int) { - return fileDescriptor_ce69bf33982206ff, []int{6} -} - -func (m *ConfigQuery) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ConfigQuery.Unmarshal(m, b) -} -func (m *ConfigQuery) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ConfigQuery.Marshal(b, m, deterministic) -} -func (m *ConfigQuery) XXX_Merge(src proto.Message) { - xxx_messageInfo_ConfigQuery.Merge(m, src) -} -func (m *ConfigQuery) XXX_Size() int { - return xxx_messageInfo_ConfigQuery.Size(m) -} -func (m *ConfigQuery) XXX_DiscardUnknown() { - xxx_messageInfo_ConfigQuery.DiscardUnknown(m) -} - -var xxx_messageInfo_ConfigQuery proto.InternalMessageInfo - -type ConfigResult struct { - // msps is a map from MSP_ID to FabricMSPConfig - Msps map[string]*msp.FabricMSPConfig `protobuf:"bytes,1,rep,name=msps,proto3" json:"msps,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - // orderers is a map from MSP_ID to endpoint lists of orderers - Orderers map[string]*Endpoints `protobuf:"bytes,2,rep,name=orderers,proto3" json:"orderers,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ConfigResult) Reset() { *m = ConfigResult{} } -func (m *ConfigResult) String() string { return proto.CompactTextString(m) } -func (*ConfigResult) ProtoMessage() {} -func (*ConfigResult) Descriptor() ([]byte, []int) { - return fileDescriptor_ce69bf33982206ff, []int{7} -} - -func (m *ConfigResult) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ConfigResult.Unmarshal(m, b) -} -func (m *ConfigResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ConfigResult.Marshal(b, m, deterministic) -} -func (m *ConfigResult) XXX_Merge(src proto.Message) { - xxx_messageInfo_ConfigResult.Merge(m, src) -} -func (m *ConfigResult) XXX_Size() int { - return xxx_messageInfo_ConfigResult.Size(m) -} -func (m *ConfigResult) XXX_DiscardUnknown() { - xxx_messageInfo_ConfigResult.DiscardUnknown(m) -} - -var xxx_messageInfo_ConfigResult proto.InternalMessageInfo - -func (m *ConfigResult) GetMsps() map[string]*msp.FabricMSPConfig { - if m != nil { - return m.Msps - } - return nil -} - -func (m *ConfigResult) GetOrderers() map[string]*Endpoints { - if m != nil { - return m.Orderers - } - return nil -} - -// PeerMembershipQuery requests PeerMembershipResult. -// The filter field may be optionally populated in order -// for the peer membership to be filtered according to -// chaincodes that are installed on peers and collection -// access control policies. -type PeerMembershipQuery struct { - Filter *peer.ChaincodeInterest `protobuf:"bytes,1,opt,name=filter,proto3" json:"filter,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *PeerMembershipQuery) Reset() { *m = PeerMembershipQuery{} } -func (m *PeerMembershipQuery) String() string { return proto.CompactTextString(m) } -func (*PeerMembershipQuery) ProtoMessage() {} -func (*PeerMembershipQuery) Descriptor() ([]byte, []int) { - return fileDescriptor_ce69bf33982206ff, []int{8} -} - -func (m *PeerMembershipQuery) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_PeerMembershipQuery.Unmarshal(m, b) -} -func (m *PeerMembershipQuery) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_PeerMembershipQuery.Marshal(b, m, deterministic) -} -func (m *PeerMembershipQuery) XXX_Merge(src proto.Message) { - xxx_messageInfo_PeerMembershipQuery.Merge(m, src) -} -func (m *PeerMembershipQuery) XXX_Size() int { - return xxx_messageInfo_PeerMembershipQuery.Size(m) -} -func (m *PeerMembershipQuery) XXX_DiscardUnknown() { - xxx_messageInfo_PeerMembershipQuery.DiscardUnknown(m) -} - -var xxx_messageInfo_PeerMembershipQuery proto.InternalMessageInfo - -func (m *PeerMembershipQuery) GetFilter() *peer.ChaincodeInterest { - if m != nil { - return m.Filter - } - return nil -} - -// PeerMembershipResult contains peers mapped by their organizations (MSP_ID) -type PeerMembershipResult struct { - PeersByOrg map[string]*Peers `protobuf:"bytes,1,rep,name=peers_by_org,json=peersByOrg,proto3" json:"peers_by_org,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *PeerMembershipResult) Reset() { *m = PeerMembershipResult{} } -func (m *PeerMembershipResult) String() string { return proto.CompactTextString(m) } -func (*PeerMembershipResult) ProtoMessage() {} -func (*PeerMembershipResult) Descriptor() ([]byte, []int) { - return fileDescriptor_ce69bf33982206ff, []int{9} -} - -func (m *PeerMembershipResult) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_PeerMembershipResult.Unmarshal(m, b) -} -func (m *PeerMembershipResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_PeerMembershipResult.Marshal(b, m, deterministic) -} -func (m *PeerMembershipResult) XXX_Merge(src proto.Message) { - xxx_messageInfo_PeerMembershipResult.Merge(m, src) -} -func (m *PeerMembershipResult) XXX_Size() int { - return xxx_messageInfo_PeerMembershipResult.Size(m) -} -func (m *PeerMembershipResult) XXX_DiscardUnknown() { - xxx_messageInfo_PeerMembershipResult.DiscardUnknown(m) -} - -var xxx_messageInfo_PeerMembershipResult proto.InternalMessageInfo - -func (m *PeerMembershipResult) GetPeersByOrg() map[string]*Peers { - if m != nil { - return m.PeersByOrg - } - return nil -} - -// ChaincodeQuery requests ChaincodeQueryResults for a given -// list of chaincode invocations. -// Each invocation is a separate one, and the endorsement policy -// is evaluated independantly for each given interest. -type ChaincodeQuery struct { - Interests []*peer.ChaincodeInterest `protobuf:"bytes,1,rep,name=interests,proto3" json:"interests,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ChaincodeQuery) Reset() { *m = ChaincodeQuery{} } -func (m *ChaincodeQuery) String() string { return proto.CompactTextString(m) } -func (*ChaincodeQuery) ProtoMessage() {} -func (*ChaincodeQuery) Descriptor() ([]byte, []int) { - return fileDescriptor_ce69bf33982206ff, []int{10} -} - -func (m *ChaincodeQuery) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ChaincodeQuery.Unmarshal(m, b) -} -func (m *ChaincodeQuery) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ChaincodeQuery.Marshal(b, m, deterministic) -} -func (m *ChaincodeQuery) XXX_Merge(src proto.Message) { - xxx_messageInfo_ChaincodeQuery.Merge(m, src) -} -func (m *ChaincodeQuery) XXX_Size() int { - return xxx_messageInfo_ChaincodeQuery.Size(m) -} -func (m *ChaincodeQuery) XXX_DiscardUnknown() { - xxx_messageInfo_ChaincodeQuery.DiscardUnknown(m) -} - -var xxx_messageInfo_ChaincodeQuery proto.InternalMessageInfo - -func (m *ChaincodeQuery) GetInterests() []*peer.ChaincodeInterest { - if m != nil { - return m.Interests - } - return nil -} - -// ChaincodeQueryResult contains EndorsementDescriptors for -// chaincodes -type ChaincodeQueryResult struct { - Content []*EndorsementDescriptor `protobuf:"bytes,1,rep,name=content,proto3" json:"content,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ChaincodeQueryResult) Reset() { *m = ChaincodeQueryResult{} } -func (m *ChaincodeQueryResult) String() string { return proto.CompactTextString(m) } -func (*ChaincodeQueryResult) ProtoMessage() {} -func (*ChaincodeQueryResult) Descriptor() ([]byte, []int) { - return fileDescriptor_ce69bf33982206ff, []int{11} -} - -func (m *ChaincodeQueryResult) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ChaincodeQueryResult.Unmarshal(m, b) -} -func (m *ChaincodeQueryResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ChaincodeQueryResult.Marshal(b, m, deterministic) -} -func (m *ChaincodeQueryResult) XXX_Merge(src proto.Message) { - xxx_messageInfo_ChaincodeQueryResult.Merge(m, src) -} -func (m *ChaincodeQueryResult) XXX_Size() int { - return xxx_messageInfo_ChaincodeQueryResult.Size(m) -} -func (m *ChaincodeQueryResult) XXX_DiscardUnknown() { - xxx_messageInfo_ChaincodeQueryResult.DiscardUnknown(m) -} - -var xxx_messageInfo_ChaincodeQueryResult proto.InternalMessageInfo - -func (m *ChaincodeQueryResult) GetContent() []*EndorsementDescriptor { - if m != nil { - return m.Content - } - return nil -} - -// LocalPeerQuery queries for peers in a non channel context -type LocalPeerQuery struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *LocalPeerQuery) Reset() { *m = LocalPeerQuery{} } -func (m *LocalPeerQuery) String() string { return proto.CompactTextString(m) } -func (*LocalPeerQuery) ProtoMessage() {} -func (*LocalPeerQuery) Descriptor() ([]byte, []int) { - return fileDescriptor_ce69bf33982206ff, []int{12} -} - -func (m *LocalPeerQuery) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_LocalPeerQuery.Unmarshal(m, b) -} -func (m *LocalPeerQuery) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_LocalPeerQuery.Marshal(b, m, deterministic) -} -func (m *LocalPeerQuery) XXX_Merge(src proto.Message) { - xxx_messageInfo_LocalPeerQuery.Merge(m, src) -} -func (m *LocalPeerQuery) XXX_Size() int { - return xxx_messageInfo_LocalPeerQuery.Size(m) -} -func (m *LocalPeerQuery) XXX_DiscardUnknown() { - xxx_messageInfo_LocalPeerQuery.DiscardUnknown(m) -} - -var xxx_messageInfo_LocalPeerQuery proto.InternalMessageInfo - -// EndorsementDescriptor contains information about which peers can be used -// to request endorsement from, such that the endorsement policy would be fulfilled. -// Here is how to compute a set of peers to ask an endorsement from, given an EndorsementDescriptor: -// Let e: G --> P be the endorsers_by_groups field that maps a group to a set of peers. -// Note that applying e on a group g yields a set of peers. -// 1. Select a layout l: G --> N out of the layouts given. -// l is the quantities_by_group field of a Layout, and it maps a group to an integer. -// 2. R = {} (an empty set of peers) -// 3. For each group g in the layout l, compute n = l(g) -// 3.1) Denote P_g as a set of n random peers {p0, p1, ... p_n} selected from e(g) -// 3.2) R = R U P_g (add P_g to R) -// 4. The set of peers R is the peers the client needs to request endorsements from -type EndorsementDescriptor struct { - Chaincode string `protobuf:"bytes,1,opt,name=chaincode,proto3" json:"chaincode,omitempty"` - // Specifies the endorsers, separated to groups. - EndorsersByGroups map[string]*Peers `protobuf:"bytes,2,rep,name=endorsers_by_groups,json=endorsersByGroups,proto3" json:"endorsers_by_groups,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - // Specifies options of fulfulling the endorsement policy. - // Each option lists the group names, and the amount of signatures needed - // from each group. - Layouts []*Layout `protobuf:"bytes,3,rep,name=layouts,proto3" json:"layouts,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *EndorsementDescriptor) Reset() { *m = EndorsementDescriptor{} } -func (m *EndorsementDescriptor) String() string { return proto.CompactTextString(m) } -func (*EndorsementDescriptor) ProtoMessage() {} -func (*EndorsementDescriptor) Descriptor() ([]byte, []int) { - return fileDescriptor_ce69bf33982206ff, []int{13} -} - -func (m *EndorsementDescriptor) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_EndorsementDescriptor.Unmarshal(m, b) -} -func (m *EndorsementDescriptor) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_EndorsementDescriptor.Marshal(b, m, deterministic) -} -func (m *EndorsementDescriptor) XXX_Merge(src proto.Message) { - xxx_messageInfo_EndorsementDescriptor.Merge(m, src) -} -func (m *EndorsementDescriptor) XXX_Size() int { - return xxx_messageInfo_EndorsementDescriptor.Size(m) -} -func (m *EndorsementDescriptor) XXX_DiscardUnknown() { - xxx_messageInfo_EndorsementDescriptor.DiscardUnknown(m) -} - -var xxx_messageInfo_EndorsementDescriptor proto.InternalMessageInfo - -func (m *EndorsementDescriptor) GetChaincode() string { - if m != nil { - return m.Chaincode - } - return "" -} - -func (m *EndorsementDescriptor) GetEndorsersByGroups() map[string]*Peers { - if m != nil { - return m.EndorsersByGroups - } - return nil -} - -func (m *EndorsementDescriptor) GetLayouts() []*Layout { - if m != nil { - return m.Layouts - } - return nil -} - -// Layout contains a mapping from a group name to number of peers -// that are needed for fulfilling an endorsement policy -type Layout struct { - // Specifies how many non repeated signatures of each group - // are needed for endorsement - QuantitiesByGroup map[string]uint32 `protobuf:"bytes,1,rep,name=quantities_by_group,json=quantitiesByGroup,proto3" json:"quantities_by_group,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Layout) Reset() { *m = Layout{} } -func (m *Layout) String() string { return proto.CompactTextString(m) } -func (*Layout) ProtoMessage() {} -func (*Layout) Descriptor() ([]byte, []int) { - return fileDescriptor_ce69bf33982206ff, []int{14} -} - -func (m *Layout) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Layout.Unmarshal(m, b) -} -func (m *Layout) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Layout.Marshal(b, m, deterministic) -} -func (m *Layout) XXX_Merge(src proto.Message) { - xxx_messageInfo_Layout.Merge(m, src) -} -func (m *Layout) XXX_Size() int { - return xxx_messageInfo_Layout.Size(m) -} -func (m *Layout) XXX_DiscardUnknown() { - xxx_messageInfo_Layout.DiscardUnknown(m) -} - -var xxx_messageInfo_Layout proto.InternalMessageInfo - -func (m *Layout) GetQuantitiesByGroup() map[string]uint32 { - if m != nil { - return m.QuantitiesByGroup - } - return nil -} - -// Peers contains a list of Peer(s) -type Peers struct { - Peers []*Peer `protobuf:"bytes,1,rep,name=peers,proto3" json:"peers,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Peers) Reset() { *m = Peers{} } -func (m *Peers) String() string { return proto.CompactTextString(m) } -func (*Peers) ProtoMessage() {} -func (*Peers) Descriptor() ([]byte, []int) { - return fileDescriptor_ce69bf33982206ff, []int{15} -} - -func (m *Peers) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Peers.Unmarshal(m, b) -} -func (m *Peers) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Peers.Marshal(b, m, deterministic) -} -func (m *Peers) XXX_Merge(src proto.Message) { - xxx_messageInfo_Peers.Merge(m, src) -} -func (m *Peers) XXX_Size() int { - return xxx_messageInfo_Peers.Size(m) -} -func (m *Peers) XXX_DiscardUnknown() { - xxx_messageInfo_Peers.DiscardUnknown(m) -} - -var xxx_messageInfo_Peers proto.InternalMessageInfo - -func (m *Peers) GetPeers() []*Peer { - if m != nil { - return m.Peers - } - return nil -} - -// Peer contains information about the peer such as its channel specific -// state, and membership information. -type Peer struct { - // This is an Envelope of a GossipMessage with a gossip.StateInfo message - StateInfo *gossip.Envelope `protobuf:"bytes,1,opt,name=state_info,json=stateInfo,proto3" json:"state_info,omitempty"` - // This is an Envelope of a GossipMessage with a gossip.AliveMessage message - MembershipInfo *gossip.Envelope `protobuf:"bytes,2,opt,name=membership_info,json=membershipInfo,proto3" json:"membership_info,omitempty"` - // This is the msp.SerializedIdentity of the peer, represented in bytes. - Identity []byte `protobuf:"bytes,3,opt,name=identity,proto3" json:"identity,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Peer) Reset() { *m = Peer{} } -func (m *Peer) String() string { return proto.CompactTextString(m) } -func (*Peer) ProtoMessage() {} -func (*Peer) Descriptor() ([]byte, []int) { - return fileDescriptor_ce69bf33982206ff, []int{16} -} - -func (m *Peer) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Peer.Unmarshal(m, b) -} -func (m *Peer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Peer.Marshal(b, m, deterministic) -} -func (m *Peer) XXX_Merge(src proto.Message) { - xxx_messageInfo_Peer.Merge(m, src) -} -func (m *Peer) XXX_Size() int { - return xxx_messageInfo_Peer.Size(m) -} -func (m *Peer) XXX_DiscardUnknown() { - xxx_messageInfo_Peer.DiscardUnknown(m) -} - -var xxx_messageInfo_Peer proto.InternalMessageInfo - -func (m *Peer) GetStateInfo() *gossip.Envelope { - if m != nil { - return m.StateInfo - } - return nil -} - -func (m *Peer) GetMembershipInfo() *gossip.Envelope { - if m != nil { - return m.MembershipInfo - } - return nil -} - -func (m *Peer) GetIdentity() []byte { - if m != nil { - return m.Identity - } - return nil -} - -// Error denotes that something went wrong and contains the error message -type Error struct { - Content string `protobuf:"bytes,1,opt,name=content,proto3" json:"content,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Error) Reset() { *m = Error{} } -func (m *Error) String() string { return proto.CompactTextString(m) } -func (*Error) ProtoMessage() {} -func (*Error) Descriptor() ([]byte, []int) { - return fileDescriptor_ce69bf33982206ff, []int{17} -} - -func (m *Error) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Error.Unmarshal(m, b) -} -func (m *Error) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Error.Marshal(b, m, deterministic) -} -func (m *Error) XXX_Merge(src proto.Message) { - xxx_messageInfo_Error.Merge(m, src) -} -func (m *Error) XXX_Size() int { - return xxx_messageInfo_Error.Size(m) -} -func (m *Error) XXX_DiscardUnknown() { - xxx_messageInfo_Error.DiscardUnknown(m) -} - -var xxx_messageInfo_Error proto.InternalMessageInfo - -func (m *Error) GetContent() string { - if m != nil { - return m.Content - } - return "" -} - -// Endpoints is a list of Endpoint(s) -type Endpoints struct { - Endpoint []*Endpoint `protobuf:"bytes,1,rep,name=endpoint,proto3" json:"endpoint,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Endpoints) Reset() { *m = Endpoints{} } -func (m *Endpoints) String() string { return proto.CompactTextString(m) } -func (*Endpoints) ProtoMessage() {} -func (*Endpoints) Descriptor() ([]byte, []int) { - return fileDescriptor_ce69bf33982206ff, []int{18} -} - -func (m *Endpoints) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Endpoints.Unmarshal(m, b) -} -func (m *Endpoints) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Endpoints.Marshal(b, m, deterministic) -} -func (m *Endpoints) XXX_Merge(src proto.Message) { - xxx_messageInfo_Endpoints.Merge(m, src) -} -func (m *Endpoints) XXX_Size() int { - return xxx_messageInfo_Endpoints.Size(m) -} -func (m *Endpoints) XXX_DiscardUnknown() { - xxx_messageInfo_Endpoints.DiscardUnknown(m) -} - -var xxx_messageInfo_Endpoints proto.InternalMessageInfo - -func (m *Endpoints) GetEndpoint() []*Endpoint { - if m != nil { - return m.Endpoint - } - return nil -} - -// Endpoint is a combination of a host and a port -type Endpoint struct { - Host string `protobuf:"bytes,1,opt,name=host,proto3" json:"host,omitempty"` - Port uint32 `protobuf:"varint,2,opt,name=port,proto3" json:"port,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Endpoint) Reset() { *m = Endpoint{} } -func (m *Endpoint) String() string { return proto.CompactTextString(m) } -func (*Endpoint) ProtoMessage() {} -func (*Endpoint) Descriptor() ([]byte, []int) { - return fileDescriptor_ce69bf33982206ff, []int{19} -} - -func (m *Endpoint) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Endpoint.Unmarshal(m, b) -} -func (m *Endpoint) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Endpoint.Marshal(b, m, deterministic) -} -func (m *Endpoint) XXX_Merge(src proto.Message) { - xxx_messageInfo_Endpoint.Merge(m, src) -} -func (m *Endpoint) XXX_Size() int { - return xxx_messageInfo_Endpoint.Size(m) -} -func (m *Endpoint) XXX_DiscardUnknown() { - xxx_messageInfo_Endpoint.DiscardUnknown(m) -} - -var xxx_messageInfo_Endpoint proto.InternalMessageInfo - -func (m *Endpoint) GetHost() string { - if m != nil { - return m.Host - } - return "" -} - -func (m *Endpoint) GetPort() uint32 { - if m != nil { - return m.Port - } - return 0 -} - -func init() { - proto.RegisterType((*SignedRequest)(nil), "discovery.SignedRequest") - proto.RegisterType((*Request)(nil), "discovery.Request") - proto.RegisterType((*Response)(nil), "discovery.Response") - proto.RegisterType((*AuthInfo)(nil), "discovery.AuthInfo") - proto.RegisterType((*Query)(nil), "discovery.Query") - proto.RegisterType((*QueryResult)(nil), "discovery.QueryResult") - proto.RegisterType((*ConfigQuery)(nil), "discovery.ConfigQuery") - proto.RegisterType((*ConfigResult)(nil), "discovery.ConfigResult") - proto.RegisterMapType((map[string]*msp.FabricMSPConfig)(nil), "discovery.ConfigResult.MspsEntry") - proto.RegisterMapType((map[string]*Endpoints)(nil), "discovery.ConfigResult.OrderersEntry") - proto.RegisterType((*PeerMembershipQuery)(nil), "discovery.PeerMembershipQuery") - proto.RegisterType((*PeerMembershipResult)(nil), "discovery.PeerMembershipResult") - proto.RegisterMapType((map[string]*Peers)(nil), "discovery.PeerMembershipResult.PeersByOrgEntry") - proto.RegisterType((*ChaincodeQuery)(nil), "discovery.ChaincodeQuery") - proto.RegisterType((*ChaincodeQueryResult)(nil), "discovery.ChaincodeQueryResult") - proto.RegisterType((*LocalPeerQuery)(nil), "discovery.LocalPeerQuery") - proto.RegisterType((*EndorsementDescriptor)(nil), "discovery.EndorsementDescriptor") - proto.RegisterMapType((map[string]*Peers)(nil), "discovery.EndorsementDescriptor.EndorsersByGroupsEntry") - proto.RegisterType((*Layout)(nil), "discovery.Layout") - proto.RegisterMapType((map[string]uint32)(nil), "discovery.Layout.QuantitiesByGroupEntry") - proto.RegisterType((*Peers)(nil), "discovery.Peers") - proto.RegisterType((*Peer)(nil), "discovery.Peer") - proto.RegisterType((*Error)(nil), "discovery.Error") - proto.RegisterType((*Endpoints)(nil), "discovery.Endpoints") - proto.RegisterType((*Endpoint)(nil), "discovery.Endpoint") -} - -func init() { proto.RegisterFile("discovery/protocol.proto", fileDescriptor_ce69bf33982206ff) } - -var fileDescriptor_ce69bf33982206ff = []byte{ - // 1113 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x56, 0x5b, 0x6f, 0xe3, 0x44, - 0x14, 0x6e, 0xd2, 0xa6, 0x49, 0x4e, 0x7a, 0x9d, 0x86, 0x92, 0x8d, 0x56, 0x6c, 0xd7, 0xd2, 0xb2, - 0xd5, 0xa2, 0x75, 0xd8, 0x22, 0x58, 0x76, 0x5b, 0x81, 0xb6, 0x97, 0xdd, 0x54, 0xa2, 0x6a, 0xeb, - 0x45, 0x08, 0x21, 0xa4, 0xc8, 0x75, 0x4e, 0x6d, 0x0b, 0xdb, 0xe3, 0xce, 0x8c, 0x2b, 0xf9, 0x99, - 0x77, 0x7e, 0x02, 0x2f, 0xbc, 0x20, 0x7e, 0x02, 0xbf, 0x0e, 0x79, 0x2e, 0x8e, 0x93, 0xa6, 0x2c, - 0x12, 0x6f, 0x33, 0x67, 0xbe, 0xef, 0x5c, 0xbe, 0x73, 0x3c, 0x63, 0xe8, 0x8d, 0x43, 0xee, 0xd1, - 0x5b, 0x64, 0xf9, 0x20, 0x65, 0x54, 0x50, 0x8f, 0x46, 0xb6, 0x5c, 0x90, 0x76, 0x79, 0xd2, 0xef, - 0xfa, 0x94, 0xf3, 0x30, 0x1d, 0xc4, 0xc8, 0xb9, 0xeb, 0xa3, 0x02, 0xf4, 0xbb, 0x31, 0x4f, 0x07, - 0x31, 0x4f, 0x47, 0x1e, 0x4d, 0xae, 0x43, 0x5f, 0x5b, 0x1f, 0xa6, 0x88, 0xac, 0xf0, 0x95, 0x52, - 0xee, 0x46, 0x23, 0x86, 0x3c, 0xa5, 0x09, 0xd7, 0x1c, 0xeb, 0x1d, 0xac, 0xbe, 0x0f, 0xfd, 0x04, - 0xc7, 0x0e, 0xde, 0x64, 0xc8, 0x05, 0xe9, 0x41, 0x33, 0x75, 0xf3, 0x88, 0xba, 0xe3, 0x5e, 0x6d, - 0xa7, 0xb6, 0xbb, 0xe2, 0x98, 0x2d, 0x79, 0x08, 0x6d, 0x1e, 0xfa, 0x89, 0x2b, 0x32, 0x86, 0xbd, - 0xba, 0x3c, 0x9b, 0x18, 0x2c, 0x06, 0x4d, 0xe3, 0x62, 0x1f, 0xd6, 0xdc, 0x4c, 0x04, 0x98, 0x88, - 0xd0, 0x73, 0x45, 0x48, 0x13, 0xe9, 0xa9, 0xb3, 0xb7, 0x65, 0x97, 0x15, 0xd8, 0x6f, 0x32, 0x11, - 0x9c, 0x26, 0xd7, 0xd4, 0x99, 0x81, 0x92, 0x67, 0xd0, 0xbc, 0xc9, 0x90, 0x85, 0xc8, 0x7b, 0xf5, - 0x9d, 0xc5, 0xdd, 0xce, 0xde, 0x46, 0x85, 0x75, 0x99, 0x21, 0xcb, 0x1d, 0x03, 0xb0, 0x0e, 0xa0, - 0xe5, 0xe8, 0x72, 0xc8, 0xe7, 0xd0, 0x64, 0xc8, 0xb3, 0x48, 0xf0, 0x5e, 0x4d, 0xf2, 0xb6, 0xef, - 0xf0, 0xe4, 0xb1, 0x63, 0x60, 0xd6, 0x18, 0x5a, 0x26, 0x0b, 0xf2, 0x14, 0xd6, 0xbd, 0x28, 0xc4, - 0x44, 0x8c, 0xc2, 0x71, 0x91, 0x8c, 0xc8, 0x75, 0xf5, 0x6b, 0xca, 0x7c, 0xaa, 0xad, 0x64, 0x00, - 0x5d, 0x0d, 0x14, 0x11, 0x1f, 0x79, 0xc8, 0xc4, 0x28, 0x70, 0x79, 0xa0, 0xf5, 0xd8, 0x54, 0x67, - 0xdf, 0x47, 0xfc, 0x08, 0x99, 0x18, 0xba, 0x3c, 0xb0, 0x7e, 0xaf, 0x43, 0x43, 0x86, 0x2f, 0x94, - 0xf5, 0x02, 0x37, 0x49, 0x30, 0x92, 0xbe, 0xdb, 0x8e, 0xd9, 0x92, 0x7d, 0x58, 0x51, 0x2d, 0x1b, - 0x15, 0x95, 0xe5, 0xd2, 0xd9, 0x74, 0x01, 0x47, 0xf2, 0x58, 0xfa, 0x19, 0x2e, 0x38, 0x1d, 0x6f, - 0xb2, 0x25, 0xdf, 0x02, 0x14, 0x1d, 0xd6, 0xd4, 0x45, 0x49, 0xfd, 0xa4, 0x42, 0xbd, 0x40, 0x64, - 0x67, 0x18, 0x5f, 0x21, 0xe3, 0x41, 0x98, 0x1a, 0x17, 0xed, 0x82, 0xa3, 0x1c, 0x7c, 0x05, 0x2d, - 0xcf, 0xd3, 0xf4, 0x25, 0x49, 0x7f, 0x50, 0x8d, 0x1c, 0xb8, 0x61, 0xe2, 0xd1, 0x31, 0x1a, 0x66, - 0xd3, 0xf3, 0x14, 0xef, 0x00, 0x3a, 0x11, 0xf5, 0xdc, 0x68, 0x54, 0xb8, 0xe2, 0xbd, 0xc6, 0x1d, - 0xea, 0x77, 0xc5, 0xe9, 0x85, 0x89, 0x33, 0x5c, 0x70, 0x20, 0x32, 0x16, 0x7e, 0xd8, 0x84, 0x86, - 0x0c, 0x69, 0xfd, 0x5a, 0x87, 0x4e, 0xa5, 0x3f, 0x64, 0x17, 0x1a, 0xc8, 0x18, 0x65, 0x7a, 0x68, - 0xaa, 0xed, 0x3f, 0x29, 0xec, 0xc3, 0x05, 0x47, 0x01, 0xc8, 0x37, 0xb0, 0xaa, 0x65, 0x53, 0x2d, - 0xd5, 0xba, 0x7d, 0x7c, 0x47, 0x37, 0xe5, 0x79, 0xb8, 0xe0, 0x68, 0x99, 0x75, 0xa4, 0x23, 0x58, - 0x31, 0x85, 0x17, 0x1e, 0xb4, 0x76, 0x8f, 0xee, 0x2d, 0xbe, 0x74, 0x03, 0x5a, 0x02, 0x07, 0x39, - 0xd9, 0x87, 0x66, 0xac, 0xd4, 0xd5, 0xe2, 0x3d, 0xba, 0x57, 0xfb, 0x92, 0x6f, 0x18, 0x87, 0x2d, - 0x58, 0x56, 0xa9, 0x5b, 0xab, 0xd0, 0xa9, 0xf4, 0xd8, 0xfa, 0xab, 0x0e, 0x2b, 0xd5, 0xdc, 0xc9, - 0x97, 0xb0, 0x14, 0xf3, 0xd4, 0xcc, 0xf6, 0xe3, 0x7b, 0x4a, 0xb4, 0xcf, 0x78, 0xca, 0x4f, 0x12, - 0xc1, 0x72, 0x47, 0xc2, 0xc9, 0x1b, 0x68, 0x51, 0x36, 0x46, 0x56, 0xa4, 0xa7, 0x3e, 0xa7, 0x27, - 0xf7, 0x51, 0xcf, 0x35, 0x4e, 0xd1, 0x4b, 0x5a, 0xff, 0x0c, 0xda, 0xa5, 0x57, 0xb2, 0x01, 0x8b, - 0xbf, 0x60, 0xae, 0xe7, 0xb7, 0x58, 0x92, 0x67, 0xd0, 0xb8, 0x75, 0xa3, 0x0c, 0xb5, 0xf8, 0x5d, - 0x3b, 0xe6, 0xa9, 0xfd, 0xd6, 0xbd, 0x62, 0xa1, 0x77, 0xf6, 0xfe, 0x42, 0x47, 0x50, 0x90, 0xd7, - 0xf5, 0xaf, 0x6b, 0xfd, 0x4b, 0x58, 0x9d, 0x8a, 0xf4, 0x5f, 0x5c, 0x56, 0x26, 0x20, 0x19, 0xa7, - 0x34, 0x4c, 0x04, 0xaf, 0xb8, 0xb4, 0x86, 0xb0, 0x35, 0x67, 0xc8, 0xc9, 0x0b, 0x58, 0xbe, 0x0e, - 0x23, 0x81, 0x66, 0x92, 0x1e, 0xa8, 0x2b, 0x8f, 0x4f, 0xba, 0x7a, 0x9a, 0x08, 0x64, 0xc8, 0x85, - 0xa3, 0x81, 0xd6, 0xdf, 0x35, 0xe8, 0xce, 0xeb, 0x19, 0xb9, 0x84, 0x15, 0x39, 0xe5, 0xa3, 0xab, - 0x7c, 0x44, 0x99, 0xaf, 0xdb, 0x30, 0xf8, 0x40, 0xab, 0x6d, 0x35, 0xea, 0xf9, 0x39, 0xf3, 0x95, - 0xaa, 0xf2, 0x4b, 0x55, 0x86, 0xfe, 0x39, 0xac, 0xcf, 0x1c, 0xcf, 0x91, 0xe2, 0xd3, 0x69, 0x29, - 0x36, 0x66, 0x02, 0x4e, 0xc9, 0x70, 0x0a, 0x6b, 0xd3, 0xf3, 0x4a, 0x5e, 0x42, 0x3b, 0xd4, 0x25, - 0x9a, 0xc9, 0xf9, 0x17, 0x11, 0x26, 0x58, 0xcb, 0x81, 0xee, 0xbc, 0xd1, 0x27, 0xaf, 0xa1, 0xe9, - 0xd1, 0x44, 0x60, 0x22, 0xb4, 0xbb, 0x9d, 0xe9, 0xde, 0x50, 0xc6, 0x31, 0xc6, 0x44, 0x1c, 0x23, - 0xf7, 0x58, 0x98, 0x0a, 0xca, 0x1c, 0x43, 0xb0, 0x36, 0x60, 0x6d, 0xfa, 0x42, 0xb0, 0xfe, 0xa8, - 0xc3, 0x47, 0x73, 0x49, 0xc5, 0x53, 0xe3, 0x99, 0xf8, 0x5a, 0x8e, 0x89, 0x81, 0xf8, 0xb0, 0x85, - 0x8a, 0xa6, 0x1a, 0xe2, 0x33, 0x9a, 0xa5, 0x66, 0xbe, 0x5f, 0x7e, 0x28, 0x23, 0x63, 0x2d, 0x94, - 0x7f, 0x27, 0x99, 0xaa, 0x37, 0x9b, 0x38, 0x6b, 0x27, 0x9f, 0x41, 0x33, 0x72, 0x73, 0x9a, 0x89, - 0xe2, 0x6e, 0x28, 0x9c, 0x6f, 0x56, 0x6f, 0x37, 0x79, 0xe2, 0x18, 0x44, 0xff, 0x07, 0xd8, 0x9e, - 0xef, 0xf9, 0x7f, 0xb6, 0xf5, 0xcf, 0x1a, 0x2c, 0xab, 0x58, 0xe4, 0x47, 0xd8, 0xba, 0xc9, 0xdc, - 0xe2, 0x21, 0x0a, 0x71, 0x52, 0xb9, 0x6e, 0xc5, 0xee, 0x9d, 0xdc, 0xec, 0xcb, 0x12, 0xac, 0x13, - 0xd2, 0x95, 0xde, 0xcc, 0xda, 0xfb, 0xc7, 0xb0, 0x3d, 0x1f, 0x3c, 0x27, 0xf9, 0x6e, 0x35, 0xf9, - 0xd5, 0x6a, 0xaa, 0x36, 0x34, 0x64, 0xfa, 0xe4, 0x09, 0x34, 0xd4, 0xa3, 0xa0, 0x52, 0x5b, 0x9f, - 0xa9, 0xcf, 0x51, 0xa7, 0xd6, 0x6f, 0x35, 0x58, 0x2a, 0xf6, 0x64, 0x00, 0xc0, 0x85, 0x2b, 0x70, - 0x14, 0x26, 0xd7, 0xb4, 0xbc, 0xf8, 0xd5, 0x4f, 0x8e, 0x7d, 0x92, 0xdc, 0x62, 0x44, 0x53, 0x74, - 0xda, 0x12, 0x23, 0xdf, 0xeb, 0x57, 0xb0, 0x1e, 0x97, 0x1f, 0x9b, 0x62, 0xd5, 0xef, 0x61, 0xad, - 0x4d, 0x80, 0x92, 0xda, 0x87, 0x56, 0xf9, 0xc6, 0x2f, 0xca, 0x57, 0xbb, 0xdc, 0x5b, 0x8f, 0xa1, - 0x21, 0xdf, 0x18, 0xf9, 0x56, 0x97, 0x83, 0xae, 0xde, 0x6a, 0x3d, 0xc6, 0x07, 0xd0, 0x2e, 0x2f, - 0x21, 0x32, 0x80, 0x16, 0xea, 0x8d, 0x2e, 0x75, 0x6b, 0xce, 0x65, 0xe5, 0x94, 0x20, 0x6b, 0x0f, - 0x5a, 0xc6, 0x4a, 0x08, 0x2c, 0x05, 0x94, 0x9b, 0x00, 0x72, 0x5d, 0xd8, 0x52, 0xca, 0x84, 0x96, - 0x56, 0xae, 0xf7, 0xde, 0x42, 0xfb, 0xd8, 0xf8, 0x24, 0xaf, 0xa0, 0x65, 0x36, 0xa4, 0x57, 0x89, - 0x35, 0xf5, 0x13, 0xd7, 0xaf, 0x66, 0x61, 0xfe, 0x90, 0x0e, 0x7f, 0x86, 0xa7, 0x94, 0xf9, 0x76, - 0x90, 0xa7, 0xc8, 0x22, 0x1c, 0xfb, 0xc8, 0xec, 0x6b, 0x79, 0x4f, 0x9b, 0x2b, 0xa1, 0xe4, 0xfc, - 0xf4, 0xc2, 0x0f, 0x45, 0x90, 0x5d, 0xd9, 0x1e, 0x8d, 0x07, 0x15, 0xfc, 0x40, 0xe1, 0x9f, 0x2b, - 0xfc, 0x73, 0x9f, 0x0e, 0x4a, 0xca, 0xd5, 0xb2, 0x34, 0x7e, 0xf1, 0x4f, 0x00, 0x00, 0x00, 0xff, - 0xff, 0xc5, 0x26, 0x97, 0xc6, 0xc0, 0x0a, 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// DiscoveryClient is the client API for Discovery service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type DiscoveryClient interface { - // Discover receives a signed request, and returns a response. - Discover(ctx context.Context, in *SignedRequest, opts ...grpc.CallOption) (*Response, error) -} - -type discoveryClient struct { - cc *grpc.ClientConn -} - -func NewDiscoveryClient(cc *grpc.ClientConn) DiscoveryClient { - return &discoveryClient{cc} -} - -func (c *discoveryClient) Discover(ctx context.Context, in *SignedRequest, opts ...grpc.CallOption) (*Response, error) { - out := new(Response) - err := c.cc.Invoke(ctx, "/discovery.Discovery/Discover", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// DiscoveryServer is the server API for Discovery service. -type DiscoveryServer interface { - // Discover receives a signed request, and returns a response. - Discover(context.Context, *SignedRequest) (*Response, error) -} - -// UnimplementedDiscoveryServer can be embedded to have forward compatible implementations. -type UnimplementedDiscoveryServer struct { -} - -func (*UnimplementedDiscoveryServer) Discover(ctx context.Context, req *SignedRequest) (*Response, error) { - return nil, status.Errorf(codes.Unimplemented, "method Discover not implemented") -} - -func RegisterDiscoveryServer(s *grpc.Server, srv DiscoveryServer) { - s.RegisterService(&_Discovery_serviceDesc, srv) -} - -func _Discovery_Discover_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SignedRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(DiscoveryServer).Discover(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/discovery.Discovery/Discover", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DiscoveryServer).Discover(ctx, req.(*SignedRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Discovery_serviceDesc = grpc.ServiceDesc{ - ServiceName: "discovery.Discovery", - HandlerType: (*DiscoveryServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Discover", - Handler: _Discovery_Discover_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "discovery/protocol.proto", -} diff --git a/vendor/github.com/hyperledger/fabric-protos-go/gateway/gateway.pb.go b/vendor/github.com/hyperledger/fabric-protos-go/gateway/gateway.pb.go deleted file mode 100644 index ee53858179a..00000000000 --- a/vendor/github.com/hyperledger/fabric-protos-go/gateway/gateway.pb.go +++ /dev/null @@ -1,1231 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: gateway/gateway.proto - -package gateway - -import ( - context "context" - fmt "fmt" - proto "github.com/golang/protobuf/proto" - common "github.com/hyperledger/fabric-protos-go/common" - orderer "github.com/hyperledger/fabric-protos-go/orderer" - peer "github.com/hyperledger/fabric-protos-go/peer" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - math "math" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package - -// EndorseRequest contains the details required to obtain sufficient endorsements for a -// transaction to be committed to the ledger. -type EndorseRequest struct { - // The unique identifier for the transaction. - TransactionId string `protobuf:"bytes,1,opt,name=transaction_id,json=transactionId,proto3" json:"transaction_id,omitempty"` - // Identifier of the channel this request is bound for. - ChannelId string `protobuf:"bytes,2,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` - // The signed proposal ready for endorsement. - ProposedTransaction *peer.SignedProposal `protobuf:"bytes,3,opt,name=proposed_transaction,json=proposedTransaction,proto3" json:"proposed_transaction,omitempty"` - // If targeting the peers of specific organizations (e.g. for private data scenarios), - // the list of organizations' MSPIDs should be supplied here. - EndorsingOrganizations []string `protobuf:"bytes,4,rep,name=endorsing_organizations,json=endorsingOrganizations,proto3" json:"endorsing_organizations,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *EndorseRequest) Reset() { *m = EndorseRequest{} } -func (m *EndorseRequest) String() string { return proto.CompactTextString(m) } -func (*EndorseRequest) ProtoMessage() {} -func (*EndorseRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_285396c8df15061f, []int{0} -} - -func (m *EndorseRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_EndorseRequest.Unmarshal(m, b) -} -func (m *EndorseRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_EndorseRequest.Marshal(b, m, deterministic) -} -func (m *EndorseRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_EndorseRequest.Merge(m, src) -} -func (m *EndorseRequest) XXX_Size() int { - return xxx_messageInfo_EndorseRequest.Size(m) -} -func (m *EndorseRequest) XXX_DiscardUnknown() { - xxx_messageInfo_EndorseRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_EndorseRequest proto.InternalMessageInfo - -func (m *EndorseRequest) GetTransactionId() string { - if m != nil { - return m.TransactionId - } - return "" -} - -func (m *EndorseRequest) GetChannelId() string { - if m != nil { - return m.ChannelId - } - return "" -} - -func (m *EndorseRequest) GetProposedTransaction() *peer.SignedProposal { - if m != nil { - return m.ProposedTransaction - } - return nil -} - -func (m *EndorseRequest) GetEndorsingOrganizations() []string { - if m != nil { - return m.EndorsingOrganizations - } - return nil -} - -// EndorseResponse returns the result of endorsing a transaction. -type EndorseResponse struct { - // The unsigned set of transaction responses from the endorsing peers for signing by the client - // before submitting to ordering service (via gateway). - PreparedTransaction *common.Envelope `protobuf:"bytes,1,opt,name=prepared_transaction,json=preparedTransaction,proto3" json:"prepared_transaction,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *EndorseResponse) Reset() { *m = EndorseResponse{} } -func (m *EndorseResponse) String() string { return proto.CompactTextString(m) } -func (*EndorseResponse) ProtoMessage() {} -func (*EndorseResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_285396c8df15061f, []int{1} -} - -func (m *EndorseResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_EndorseResponse.Unmarshal(m, b) -} -func (m *EndorseResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_EndorseResponse.Marshal(b, m, deterministic) -} -func (m *EndorseResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_EndorseResponse.Merge(m, src) -} -func (m *EndorseResponse) XXX_Size() int { - return xxx_messageInfo_EndorseResponse.Size(m) -} -func (m *EndorseResponse) XXX_DiscardUnknown() { - xxx_messageInfo_EndorseResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_EndorseResponse proto.InternalMessageInfo - -func (m *EndorseResponse) GetPreparedTransaction() *common.Envelope { - if m != nil { - return m.PreparedTransaction - } - return nil -} - -// SubmitRequest contains the details required to submit a transaction (update the ledger). -type SubmitRequest struct { - // Identifier of the transaction to submit. - TransactionId string `protobuf:"bytes,1,opt,name=transaction_id,json=transactionId,proto3" json:"transaction_id,omitempty"` - // Identifier of the channel this request is bound for. - ChannelId string `protobuf:"bytes,2,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` - // The signed set of endorsed transaction responses to submit. - PreparedTransaction *common.Envelope `protobuf:"bytes,3,opt,name=prepared_transaction,json=preparedTransaction,proto3" json:"prepared_transaction,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SubmitRequest) Reset() { *m = SubmitRequest{} } -func (m *SubmitRequest) String() string { return proto.CompactTextString(m) } -func (*SubmitRequest) ProtoMessage() {} -func (*SubmitRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_285396c8df15061f, []int{2} -} - -func (m *SubmitRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SubmitRequest.Unmarshal(m, b) -} -func (m *SubmitRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SubmitRequest.Marshal(b, m, deterministic) -} -func (m *SubmitRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_SubmitRequest.Merge(m, src) -} -func (m *SubmitRequest) XXX_Size() int { - return xxx_messageInfo_SubmitRequest.Size(m) -} -func (m *SubmitRequest) XXX_DiscardUnknown() { - xxx_messageInfo_SubmitRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_SubmitRequest proto.InternalMessageInfo - -func (m *SubmitRequest) GetTransactionId() string { - if m != nil { - return m.TransactionId - } - return "" -} - -func (m *SubmitRequest) GetChannelId() string { - if m != nil { - return m.ChannelId - } - return "" -} - -func (m *SubmitRequest) GetPreparedTransaction() *common.Envelope { - if m != nil { - return m.PreparedTransaction - } - return nil -} - -// SubmitResponse returns the result of submitting a transaction. -type SubmitResponse struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SubmitResponse) Reset() { *m = SubmitResponse{} } -func (m *SubmitResponse) String() string { return proto.CompactTextString(m) } -func (*SubmitResponse) ProtoMessage() {} -func (*SubmitResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_285396c8df15061f, []int{3} -} - -func (m *SubmitResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SubmitResponse.Unmarshal(m, b) -} -func (m *SubmitResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SubmitResponse.Marshal(b, m, deterministic) -} -func (m *SubmitResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_SubmitResponse.Merge(m, src) -} -func (m *SubmitResponse) XXX_Size() int { - return xxx_messageInfo_SubmitResponse.Size(m) -} -func (m *SubmitResponse) XXX_DiscardUnknown() { - xxx_messageInfo_SubmitResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_SubmitResponse proto.InternalMessageInfo - -// SignedCommitStatusRequest contains a serialized CommitStatusRequest message, and a digital signature for the -// serialized request message. -type SignedCommitStatusRequest struct { - // Serialized CommitStatusRequest message. - Request []byte `protobuf:"bytes,1,opt,name=request,proto3" json:"request,omitempty"` - // Signature for request message. - Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SignedCommitStatusRequest) Reset() { *m = SignedCommitStatusRequest{} } -func (m *SignedCommitStatusRequest) String() string { return proto.CompactTextString(m) } -func (*SignedCommitStatusRequest) ProtoMessage() {} -func (*SignedCommitStatusRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_285396c8df15061f, []int{4} -} - -func (m *SignedCommitStatusRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SignedCommitStatusRequest.Unmarshal(m, b) -} -func (m *SignedCommitStatusRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SignedCommitStatusRequest.Marshal(b, m, deterministic) -} -func (m *SignedCommitStatusRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_SignedCommitStatusRequest.Merge(m, src) -} -func (m *SignedCommitStatusRequest) XXX_Size() int { - return xxx_messageInfo_SignedCommitStatusRequest.Size(m) -} -func (m *SignedCommitStatusRequest) XXX_DiscardUnknown() { - xxx_messageInfo_SignedCommitStatusRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_SignedCommitStatusRequest proto.InternalMessageInfo - -func (m *SignedCommitStatusRequest) GetRequest() []byte { - if m != nil { - return m.Request - } - return nil -} - -func (m *SignedCommitStatusRequest) GetSignature() []byte { - if m != nil { - return m.Signature - } - return nil -} - -// CommitStatusRequest contains the details required to check whether a transaction has been -// successfully committed. -type CommitStatusRequest struct { - // Identifier of the transaction to check. - TransactionId string `protobuf:"bytes,1,opt,name=transaction_id,json=transactionId,proto3" json:"transaction_id,omitempty"` - // Identifier of the channel this request is bound for. - ChannelId string `protobuf:"bytes,2,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` - // Client requestor identity. - Identity []byte `protobuf:"bytes,3,opt,name=identity,proto3" json:"identity,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CommitStatusRequest) Reset() { *m = CommitStatusRequest{} } -func (m *CommitStatusRequest) String() string { return proto.CompactTextString(m) } -func (*CommitStatusRequest) ProtoMessage() {} -func (*CommitStatusRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_285396c8df15061f, []int{5} -} - -func (m *CommitStatusRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CommitStatusRequest.Unmarshal(m, b) -} -func (m *CommitStatusRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CommitStatusRequest.Marshal(b, m, deterministic) -} -func (m *CommitStatusRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_CommitStatusRequest.Merge(m, src) -} -func (m *CommitStatusRequest) XXX_Size() int { - return xxx_messageInfo_CommitStatusRequest.Size(m) -} -func (m *CommitStatusRequest) XXX_DiscardUnknown() { - xxx_messageInfo_CommitStatusRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_CommitStatusRequest proto.InternalMessageInfo - -func (m *CommitStatusRequest) GetTransactionId() string { - if m != nil { - return m.TransactionId - } - return "" -} - -func (m *CommitStatusRequest) GetChannelId() string { - if m != nil { - return m.ChannelId - } - return "" -} - -func (m *CommitStatusRequest) GetIdentity() []byte { - if m != nil { - return m.Identity - } - return nil -} - -// CommitStatusResponse returns the result of committing a transaction. -type CommitStatusResponse struct { - // The result of the transaction commit, as defined in peer/transaction.proto. - Result peer.TxValidationCode `protobuf:"varint,1,opt,name=result,proto3,enum=protos.TxValidationCode" json:"result,omitempty"` - // Block number that contains the transaction. - BlockNumber uint64 `protobuf:"varint,2,opt,name=block_number,json=blockNumber,proto3" json:"block_number,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CommitStatusResponse) Reset() { *m = CommitStatusResponse{} } -func (m *CommitStatusResponse) String() string { return proto.CompactTextString(m) } -func (*CommitStatusResponse) ProtoMessage() {} -func (*CommitStatusResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_285396c8df15061f, []int{6} -} - -func (m *CommitStatusResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CommitStatusResponse.Unmarshal(m, b) -} -func (m *CommitStatusResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CommitStatusResponse.Marshal(b, m, deterministic) -} -func (m *CommitStatusResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_CommitStatusResponse.Merge(m, src) -} -func (m *CommitStatusResponse) XXX_Size() int { - return xxx_messageInfo_CommitStatusResponse.Size(m) -} -func (m *CommitStatusResponse) XXX_DiscardUnknown() { - xxx_messageInfo_CommitStatusResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_CommitStatusResponse proto.InternalMessageInfo - -func (m *CommitStatusResponse) GetResult() peer.TxValidationCode { - if m != nil { - return m.Result - } - return peer.TxValidationCode_VALID -} - -func (m *CommitStatusResponse) GetBlockNumber() uint64 { - if m != nil { - return m.BlockNumber - } - return 0 -} - -// EvaluateRequest contains the details required to evaluate a transaction (query the ledger). -type EvaluateRequest struct { - // Identifier of the transaction to evaluate. - TransactionId string `protobuf:"bytes,1,opt,name=transaction_id,json=transactionId,proto3" json:"transaction_id,omitempty"` - // Identifier of the channel this request is bound for. - ChannelId string `protobuf:"bytes,2,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` - // The signed proposal ready for evaluation. - ProposedTransaction *peer.SignedProposal `protobuf:"bytes,3,opt,name=proposed_transaction,json=proposedTransaction,proto3" json:"proposed_transaction,omitempty"` - // If targeting the peers of specific organizations (e.g. for private data scenarios), - // the list of organizations' MSPIDs should be supplied here. - TargetOrganizations []string `protobuf:"bytes,4,rep,name=target_organizations,json=targetOrganizations,proto3" json:"target_organizations,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *EvaluateRequest) Reset() { *m = EvaluateRequest{} } -func (m *EvaluateRequest) String() string { return proto.CompactTextString(m) } -func (*EvaluateRequest) ProtoMessage() {} -func (*EvaluateRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_285396c8df15061f, []int{7} -} - -func (m *EvaluateRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_EvaluateRequest.Unmarshal(m, b) -} -func (m *EvaluateRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_EvaluateRequest.Marshal(b, m, deterministic) -} -func (m *EvaluateRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_EvaluateRequest.Merge(m, src) -} -func (m *EvaluateRequest) XXX_Size() int { - return xxx_messageInfo_EvaluateRequest.Size(m) -} -func (m *EvaluateRequest) XXX_DiscardUnknown() { - xxx_messageInfo_EvaluateRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_EvaluateRequest proto.InternalMessageInfo - -func (m *EvaluateRequest) GetTransactionId() string { - if m != nil { - return m.TransactionId - } - return "" -} - -func (m *EvaluateRequest) GetChannelId() string { - if m != nil { - return m.ChannelId - } - return "" -} - -func (m *EvaluateRequest) GetProposedTransaction() *peer.SignedProposal { - if m != nil { - return m.ProposedTransaction - } - return nil -} - -func (m *EvaluateRequest) GetTargetOrganizations() []string { - if m != nil { - return m.TargetOrganizations - } - return nil -} - -// EvaluateResponse returns the result of evaluating a transaction. -type EvaluateResponse struct { - // The response that is returned by the transaction function, as defined - // in peer/proposal_response.proto. - Result *peer.Response `protobuf:"bytes,1,opt,name=result,proto3" json:"result,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *EvaluateResponse) Reset() { *m = EvaluateResponse{} } -func (m *EvaluateResponse) String() string { return proto.CompactTextString(m) } -func (*EvaluateResponse) ProtoMessage() {} -func (*EvaluateResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_285396c8df15061f, []int{8} -} - -func (m *EvaluateResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_EvaluateResponse.Unmarshal(m, b) -} -func (m *EvaluateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_EvaluateResponse.Marshal(b, m, deterministic) -} -func (m *EvaluateResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_EvaluateResponse.Merge(m, src) -} -func (m *EvaluateResponse) XXX_Size() int { - return xxx_messageInfo_EvaluateResponse.Size(m) -} -func (m *EvaluateResponse) XXX_DiscardUnknown() { - xxx_messageInfo_EvaluateResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_EvaluateResponse proto.InternalMessageInfo - -func (m *EvaluateResponse) GetResult() *peer.Response { - if m != nil { - return m.Result - } - return nil -} - -// SignedChaincodeEventsRequest contains a serialized ChaincodeEventsRequest message, and a digital signature for the -// serialized request message. -type SignedChaincodeEventsRequest struct { - // Serialized ChaincodeEventsRequest message. - Request []byte `protobuf:"bytes,1,opt,name=request,proto3" json:"request,omitempty"` - // Signature for request message. - Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SignedChaincodeEventsRequest) Reset() { *m = SignedChaincodeEventsRequest{} } -func (m *SignedChaincodeEventsRequest) String() string { return proto.CompactTextString(m) } -func (*SignedChaincodeEventsRequest) ProtoMessage() {} -func (*SignedChaincodeEventsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_285396c8df15061f, []int{9} -} - -func (m *SignedChaincodeEventsRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SignedChaincodeEventsRequest.Unmarshal(m, b) -} -func (m *SignedChaincodeEventsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SignedChaincodeEventsRequest.Marshal(b, m, deterministic) -} -func (m *SignedChaincodeEventsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_SignedChaincodeEventsRequest.Merge(m, src) -} -func (m *SignedChaincodeEventsRequest) XXX_Size() int { - return xxx_messageInfo_SignedChaincodeEventsRequest.Size(m) -} -func (m *SignedChaincodeEventsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_SignedChaincodeEventsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_SignedChaincodeEventsRequest proto.InternalMessageInfo - -func (m *SignedChaincodeEventsRequest) GetRequest() []byte { - if m != nil { - return m.Request - } - return nil -} - -func (m *SignedChaincodeEventsRequest) GetSignature() []byte { - if m != nil { - return m.Signature - } - return nil -} - -// ChaincodeEventsRequest contains details of the chaincode events that the caller wants to receive. -type ChaincodeEventsRequest struct { - // Identifier of the channel this request is bound for. - ChannelId string `protobuf:"bytes,1,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` - // Name of the chaincode for which events are requested. - ChaincodeId string `protobuf:"bytes,2,opt,name=chaincode_id,json=chaincodeId,proto3" json:"chaincode_id,omitempty"` - // Client requestor identity. - Identity []byte `protobuf:"bytes,3,opt,name=identity,proto3" json:"identity,omitempty"` - // Position within the ledger at which to start reading events. - StartPosition *orderer.SeekPosition `protobuf:"bytes,4,opt,name=start_position,json=startPosition,proto3" json:"start_position,omitempty"` - // Only returns events after this transaction ID. Transactions up to and including this one should be ignored. This - // is used to allow resume of event listening from a certain position within a start block specified by - // start_position. - AfterTransactionId string `protobuf:"bytes,5,opt,name=after_transaction_id,json=afterTransactionId,proto3" json:"after_transaction_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ChaincodeEventsRequest) Reset() { *m = ChaincodeEventsRequest{} } -func (m *ChaincodeEventsRequest) String() string { return proto.CompactTextString(m) } -func (*ChaincodeEventsRequest) ProtoMessage() {} -func (*ChaincodeEventsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_285396c8df15061f, []int{10} -} - -func (m *ChaincodeEventsRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ChaincodeEventsRequest.Unmarshal(m, b) -} -func (m *ChaincodeEventsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ChaincodeEventsRequest.Marshal(b, m, deterministic) -} -func (m *ChaincodeEventsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ChaincodeEventsRequest.Merge(m, src) -} -func (m *ChaincodeEventsRequest) XXX_Size() int { - return xxx_messageInfo_ChaincodeEventsRequest.Size(m) -} -func (m *ChaincodeEventsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_ChaincodeEventsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_ChaincodeEventsRequest proto.InternalMessageInfo - -func (m *ChaincodeEventsRequest) GetChannelId() string { - if m != nil { - return m.ChannelId - } - return "" -} - -func (m *ChaincodeEventsRequest) GetChaincodeId() string { - if m != nil { - return m.ChaincodeId - } - return "" -} - -func (m *ChaincodeEventsRequest) GetIdentity() []byte { - if m != nil { - return m.Identity - } - return nil -} - -func (m *ChaincodeEventsRequest) GetStartPosition() *orderer.SeekPosition { - if m != nil { - return m.StartPosition - } - return nil -} - -func (m *ChaincodeEventsRequest) GetAfterTransactionId() string { - if m != nil { - return m.AfterTransactionId - } - return "" -} - -// ChaincodeEventsResponse returns chaincode events emitted from a specific block. -type ChaincodeEventsResponse struct { - // Chaincode events emitted by the requested chaincode. The events are presented in the same order that the - // transactions that emitted them appear within the block. - Events []*peer.ChaincodeEvent `protobuf:"bytes,1,rep,name=events,proto3" json:"events,omitempty"` - // Block number in which the chaincode events were emitted. - BlockNumber uint64 `protobuf:"varint,2,opt,name=block_number,json=blockNumber,proto3" json:"block_number,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ChaincodeEventsResponse) Reset() { *m = ChaincodeEventsResponse{} } -func (m *ChaincodeEventsResponse) String() string { return proto.CompactTextString(m) } -func (*ChaincodeEventsResponse) ProtoMessage() {} -func (*ChaincodeEventsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_285396c8df15061f, []int{11} -} - -func (m *ChaincodeEventsResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ChaincodeEventsResponse.Unmarshal(m, b) -} -func (m *ChaincodeEventsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ChaincodeEventsResponse.Marshal(b, m, deterministic) -} -func (m *ChaincodeEventsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ChaincodeEventsResponse.Merge(m, src) -} -func (m *ChaincodeEventsResponse) XXX_Size() int { - return xxx_messageInfo_ChaincodeEventsResponse.Size(m) -} -func (m *ChaincodeEventsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ChaincodeEventsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_ChaincodeEventsResponse proto.InternalMessageInfo - -func (m *ChaincodeEventsResponse) GetEvents() []*peer.ChaincodeEvent { - if m != nil { - return m.Events - } - return nil -} - -func (m *ChaincodeEventsResponse) GetBlockNumber() uint64 { - if m != nil { - return m.BlockNumber - } - return 0 -} - -// If any of the functions in the Gateway service returns an error, then it will be in the format of -// a google.rpc.Status message. The 'details' field of this message will be populated with extra -// information if the error is a result of one or more failed requests to remote peers or orderer nodes. -// ErrorDetail contains details of errors that are received by any of the endorsing peers -// as a result of processing the Evaluate or Endorse services, or from the ordering node(s) as a result of -// processing the Submit service. -type ErrorDetail struct { - // The address of the endorsing peer or ordering node that returned an error. - Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` - // The MSP Identifier of this node. - MspId string `protobuf:"bytes,2,opt,name=msp_id,json=mspId,proto3" json:"msp_id,omitempty"` - // The error message returned by this node. - Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ErrorDetail) Reset() { *m = ErrorDetail{} } -func (m *ErrorDetail) String() string { return proto.CompactTextString(m) } -func (*ErrorDetail) ProtoMessage() {} -func (*ErrorDetail) Descriptor() ([]byte, []int) { - return fileDescriptor_285396c8df15061f, []int{12} -} - -func (m *ErrorDetail) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ErrorDetail.Unmarshal(m, b) -} -func (m *ErrorDetail) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ErrorDetail.Marshal(b, m, deterministic) -} -func (m *ErrorDetail) XXX_Merge(src proto.Message) { - xxx_messageInfo_ErrorDetail.Merge(m, src) -} -func (m *ErrorDetail) XXX_Size() int { - return xxx_messageInfo_ErrorDetail.Size(m) -} -func (m *ErrorDetail) XXX_DiscardUnknown() { - xxx_messageInfo_ErrorDetail.DiscardUnknown(m) -} - -var xxx_messageInfo_ErrorDetail proto.InternalMessageInfo - -func (m *ErrorDetail) GetAddress() string { - if m != nil { - return m.Address - } - return "" -} - -func (m *ErrorDetail) GetMspId() string { - if m != nil { - return m.MspId - } - return "" -} - -func (m *ErrorDetail) GetMessage() string { - if m != nil { - return m.Message - } - return "" -} - -// ProposedTransaction contains the details required for offline signing prior to evaluating or endorsing -// a transaction. -type ProposedTransaction struct { - // Identifier of the proposed transaction. - TransactionId string `protobuf:"bytes,1,opt,name=transaction_id,json=transactionId,proto3" json:"transaction_id,omitempty"` - // The signed proposal. - Proposal *peer.SignedProposal `protobuf:"bytes,2,opt,name=proposal,proto3" json:"proposal,omitempty"` - // The list of endorsing organizations. - EndorsingOrganizations []string `protobuf:"bytes,3,rep,name=endorsing_organizations,json=endorsingOrganizations,proto3" json:"endorsing_organizations,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ProposedTransaction) Reset() { *m = ProposedTransaction{} } -func (m *ProposedTransaction) String() string { return proto.CompactTextString(m) } -func (*ProposedTransaction) ProtoMessage() {} -func (*ProposedTransaction) Descriptor() ([]byte, []int) { - return fileDescriptor_285396c8df15061f, []int{13} -} - -func (m *ProposedTransaction) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ProposedTransaction.Unmarshal(m, b) -} -func (m *ProposedTransaction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ProposedTransaction.Marshal(b, m, deterministic) -} -func (m *ProposedTransaction) XXX_Merge(src proto.Message) { - xxx_messageInfo_ProposedTransaction.Merge(m, src) -} -func (m *ProposedTransaction) XXX_Size() int { - return xxx_messageInfo_ProposedTransaction.Size(m) -} -func (m *ProposedTransaction) XXX_DiscardUnknown() { - xxx_messageInfo_ProposedTransaction.DiscardUnknown(m) -} - -var xxx_messageInfo_ProposedTransaction proto.InternalMessageInfo - -func (m *ProposedTransaction) GetTransactionId() string { - if m != nil { - return m.TransactionId - } - return "" -} - -func (m *ProposedTransaction) GetProposal() *peer.SignedProposal { - if m != nil { - return m.Proposal - } - return nil -} - -func (m *ProposedTransaction) GetEndorsingOrganizations() []string { - if m != nil { - return m.EndorsingOrganizations - } - return nil -} - -// PreparedTransaction contains the details required for offline signing prior to submitting a transaction. -type PreparedTransaction struct { - // Identifier of the prepared transaction. - TransactionId string `protobuf:"bytes,1,opt,name=transaction_id,json=transactionId,proto3" json:"transaction_id,omitempty"` - // The transaction envelope. - Envelope *common.Envelope `protobuf:"bytes,2,opt,name=envelope,proto3" json:"envelope,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *PreparedTransaction) Reset() { *m = PreparedTransaction{} } -func (m *PreparedTransaction) String() string { return proto.CompactTextString(m) } -func (*PreparedTransaction) ProtoMessage() {} -func (*PreparedTransaction) Descriptor() ([]byte, []int) { - return fileDescriptor_285396c8df15061f, []int{14} -} - -func (m *PreparedTransaction) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_PreparedTransaction.Unmarshal(m, b) -} -func (m *PreparedTransaction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_PreparedTransaction.Marshal(b, m, deterministic) -} -func (m *PreparedTransaction) XXX_Merge(src proto.Message) { - xxx_messageInfo_PreparedTransaction.Merge(m, src) -} -func (m *PreparedTransaction) XXX_Size() int { - return xxx_messageInfo_PreparedTransaction.Size(m) -} -func (m *PreparedTransaction) XXX_DiscardUnknown() { - xxx_messageInfo_PreparedTransaction.DiscardUnknown(m) -} - -var xxx_messageInfo_PreparedTransaction proto.InternalMessageInfo - -func (m *PreparedTransaction) GetTransactionId() string { - if m != nil { - return m.TransactionId - } - return "" -} - -func (m *PreparedTransaction) GetEnvelope() *common.Envelope { - if m != nil { - return m.Envelope - } - return nil -} - -func init() { - proto.RegisterType((*EndorseRequest)(nil), "gateway.EndorseRequest") - proto.RegisterType((*EndorseResponse)(nil), "gateway.EndorseResponse") - proto.RegisterType((*SubmitRequest)(nil), "gateway.SubmitRequest") - proto.RegisterType((*SubmitResponse)(nil), "gateway.SubmitResponse") - proto.RegisterType((*SignedCommitStatusRequest)(nil), "gateway.SignedCommitStatusRequest") - proto.RegisterType((*CommitStatusRequest)(nil), "gateway.CommitStatusRequest") - proto.RegisterType((*CommitStatusResponse)(nil), "gateway.CommitStatusResponse") - proto.RegisterType((*EvaluateRequest)(nil), "gateway.EvaluateRequest") - proto.RegisterType((*EvaluateResponse)(nil), "gateway.EvaluateResponse") - proto.RegisterType((*SignedChaincodeEventsRequest)(nil), "gateway.SignedChaincodeEventsRequest") - proto.RegisterType((*ChaincodeEventsRequest)(nil), "gateway.ChaincodeEventsRequest") - proto.RegisterType((*ChaincodeEventsResponse)(nil), "gateway.ChaincodeEventsResponse") - proto.RegisterType((*ErrorDetail)(nil), "gateway.ErrorDetail") - proto.RegisterType((*ProposedTransaction)(nil), "gateway.ProposedTransaction") - proto.RegisterType((*PreparedTransaction)(nil), "gateway.PreparedTransaction") -} - -func init() { proto.RegisterFile("gateway/gateway.proto", fileDescriptor_285396c8df15061f) } - -var fileDescriptor_285396c8df15061f = []byte{ - // 875 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x56, 0xdd, 0x6e, 0xe3, 0x44, - 0x14, 0x96, 0x37, 0xdd, 0xb4, 0x39, 0x4d, 0xd3, 0x6a, 0xd2, 0xa6, 0x59, 0xab, 0x2b, 0x65, 0x2d, - 0x55, 0xea, 0x05, 0xeb, 0x94, 0x72, 0x81, 0x90, 0x2a, 0x21, 0x6d, 0x89, 0x50, 0x6f, 0x20, 0x38, - 0x55, 0x85, 0x10, 0x52, 0x34, 0x89, 0xcf, 0x3a, 0xa6, 0xb6, 0xc7, 0xcc, 0x8c, 0xbb, 0x94, 0x47, - 0xe1, 0x0d, 0x78, 0x20, 0x6e, 0x78, 0x00, 0x9e, 0x80, 0x07, 0x40, 0x1e, 0xcf, 0x38, 0x76, 0x92, - 0x56, 0x45, 0xec, 0x05, 0x57, 0xc9, 0x9c, 0x9f, 0x99, 0xef, 0x7c, 0xf3, 0xcd, 0x39, 0x86, 0xa3, - 0x80, 0x4a, 0xfc, 0x40, 0x1f, 0x86, 0xfa, 0xd7, 0x4d, 0x39, 0x93, 0x8c, 0x6c, 0xeb, 0xa5, 0x6d, - 0xa7, 0x88, 0x7c, 0x38, 0x5f, 0xd0, 0x30, 0x99, 0x33, 0x1f, 0xa7, 0x78, 0x8f, 0x89, 0x2c, 0x82, - 0xec, 0xae, 0xf2, 0xa5, 0x9c, 0xa5, 0x4c, 0xd0, 0x48, 0x1b, 0x4f, 0x6a, 0xc6, 0x29, 0x47, 0x91, - 0xb2, 0x44, 0xa0, 0xf6, 0xf6, 0x94, 0x57, 0x72, 0x9a, 0x08, 0x3a, 0x97, 0x21, 0x4b, 0xcc, 0x56, - 0x73, 0x16, 0xc7, 0x2c, 0x19, 0x16, 0x3f, 0xda, 0x78, 0xc0, 0xb8, 0x8f, 0x1c, 0xf9, 0x90, 0xce, - 0x0a, 0x8b, 0xf3, 0xa7, 0x05, 0x9d, 0x51, 0xe2, 0x33, 0x2e, 0xd0, 0xc3, 0x9f, 0x33, 0x14, 0x92, - 0x9c, 0x42, 0xa7, 0xb2, 0xdd, 0x34, 0xf4, 0xfb, 0xd6, 0xc0, 0x3a, 0x6b, 0x79, 0x7b, 0x15, 0xeb, - 0xb5, 0x4f, 0x5e, 0x03, 0xcc, 0x17, 0x34, 0x49, 0x30, 0xca, 0x43, 0x5e, 0xa8, 0x90, 0x96, 0xb6, - 0x5c, 0xfb, 0xe4, 0x1a, 0x0e, 0x0b, 0xc8, 0xe8, 0x4f, 0x2b, 0x89, 0xfd, 0xc6, 0xc0, 0x3a, 0xdb, - 0xbd, 0xe8, 0x15, 0xc7, 0x0b, 0x77, 0x12, 0x06, 0x09, 0xfa, 0x63, 0x5d, 0x9c, 0xd7, 0x35, 0x39, - 0x37, 0xcb, 0x14, 0xf2, 0x39, 0x1c, 0xa3, 0x82, 0x18, 0x26, 0xc1, 0x94, 0xf1, 0x80, 0x26, 0xe1, - 0xaf, 0x34, 0xf7, 0x88, 0xfe, 0xd6, 0xa0, 0x71, 0xd6, 0xf2, 0x7a, 0xa5, 0xfb, 0xdb, 0xaa, 0xd7, - 0xb9, 0x85, 0xfd, 0xb2, 0xb6, 0x82, 0x34, 0x72, 0x95, 0xc3, 0xc2, 0x94, 0xf2, 0x15, 0x58, 0x96, - 0x82, 0x75, 0xe0, 0x6a, 0xba, 0x46, 0xc9, 0x3d, 0x46, 0x2c, 0xc5, 0x1c, 0x50, 0x11, 0x5d, 0x01, - 0xe4, 0xfc, 0x66, 0xc1, 0xde, 0x24, 0x9b, 0xc5, 0xa1, 0xfc, 0xb8, 0x9c, 0x3d, 0x06, 0xae, 0xf1, - 0x6f, 0xc0, 0x1d, 0x40, 0xc7, 0x60, 0x2b, 0x6a, 0x76, 0x26, 0xf0, 0xaa, 0xa0, 0xf9, 0x8a, 0xc5, - 0x71, 0x28, 0x27, 0x92, 0xca, 0x4c, 0x18, 0xe4, 0x7d, 0xd8, 0xe6, 0xc5, 0x5f, 0x05, 0xb9, 0xed, - 0x99, 0x25, 0x39, 0x81, 0x96, 0x08, 0x83, 0x84, 0xca, 0x8c, 0xa3, 0xc2, 0xda, 0xf6, 0x96, 0x06, - 0xe7, 0x03, 0x74, 0x37, 0x6d, 0xf7, 0x71, 0x88, 0xb0, 0x61, 0x27, 0xf4, 0x31, 0x91, 0xa1, 0x7c, - 0x50, 0xc5, 0xb7, 0xbd, 0x72, 0xed, 0xdc, 0xc1, 0x61, 0xfd, 0x60, 0x7d, 0xb3, 0xe7, 0xd0, 0xe4, - 0x28, 0xb2, 0xa8, 0xa8, 0xa3, 0x73, 0xd1, 0x37, 0x12, 0xbb, 0xf9, 0xe5, 0x96, 0x46, 0xa1, 0xaf, - 0x34, 0x71, 0xc5, 0x7c, 0xf4, 0x74, 0x1c, 0x79, 0x03, 0xed, 0x59, 0xc4, 0xe6, 0x77, 0xd3, 0x24, - 0x8b, 0x67, 0xc8, 0x15, 0x8c, 0x2d, 0x6f, 0x57, 0xd9, 0xbe, 0x51, 0x26, 0xe7, 0x0f, 0x0b, 0xf6, - 0x47, 0xf7, 0x34, 0xca, 0xa8, 0xfc, 0xff, 0xbe, 0x8f, 0x4f, 0xe1, 0x50, 0x52, 0x1e, 0xa0, 0xdc, - 0xf8, 0x38, 0xba, 0x85, 0xaf, 0xfe, 0x32, 0x2e, 0xe1, 0x60, 0x59, 0x96, 0x26, 0xf0, 0xac, 0x46, - 0x60, 0xae, 0x37, 0x8d, 0xc1, 0x44, 0x18, 0xe2, 0x9c, 0x5b, 0x38, 0xd1, 0x82, 0x32, 0x5d, 0x6c, - 0x94, 0x37, 0xb1, 0xff, 0xac, 0xa9, 0xbf, 0x2c, 0xe8, 0x3d, 0xb2, 0x65, 0x9d, 0x4d, 0x6b, 0x95, - 0xcd, 0x37, 0xd0, 0x5e, 0x76, 0xd4, 0x92, 0xee, 0xdd, 0xd2, 0xf6, 0xb4, 0xa6, 0xc8, 0x25, 0x74, - 0x84, 0xa4, 0x5c, 0x4e, 0x53, 0x26, 0x42, 0x75, 0x0d, 0x5b, 0x8a, 0x82, 0x23, 0x57, 0x37, 0x4c, - 0x77, 0x82, 0x78, 0x37, 0xd6, 0x4e, 0x6f, 0x4f, 0x05, 0x9b, 0x25, 0x39, 0x87, 0x43, 0xfa, 0x5e, - 0x22, 0x9f, 0xae, 0xc8, 0xe2, 0xa5, 0x02, 0x41, 0x94, 0xef, 0xa6, 0xaa, 0x0d, 0x27, 0x82, 0xe3, - 0xb5, 0x3a, 0xf5, 0x2d, 0xb8, 0xd0, 0x54, 0x13, 0x41, 0xf4, 0xad, 0x41, 0xa3, 0xaa, 0x84, 0x7a, - 0x82, 0xa7, 0xa3, 0x9e, 0x23, 0xe2, 0xef, 0x61, 0x77, 0xc4, 0x39, 0xe3, 0x5f, 0xa1, 0xa4, 0x61, - 0x94, 0xdf, 0x0e, 0xf5, 0x7d, 0x8e, 0x42, 0x68, 0x1e, 0xcd, 0x92, 0x1c, 0x41, 0x33, 0x16, 0xe9, - 0x92, 0xbf, 0x97, 0xb1, 0x48, 0xaf, 0xfd, 0x3c, 0x21, 0x46, 0x21, 0x68, 0x80, 0x8a, 0xb8, 0x96, - 0x67, 0x96, 0xce, 0xef, 0x16, 0x74, 0xc7, 0x1b, 0x14, 0xf9, 0xcc, 0x27, 0x72, 0x01, 0x3b, 0x66, - 0xac, 0xa9, 0x13, 0x1f, 0xd7, 0x7d, 0x19, 0xf7, 0xd4, 0x30, 0x68, 0x3c, 0x39, 0x0c, 0x7e, 0xca, - 0xa1, 0xae, 0xb5, 0xcb, 0xe7, 0x42, 0xfd, 0x04, 0x76, 0x50, 0xb7, 0x5d, 0x0d, 0x75, 0xbd, 0x1d, - 0x97, 0x11, 0x17, 0x7f, 0xbf, 0x80, 0xed, 0xaf, 0x8b, 0x79, 0x4f, 0x2e, 0x61, 0x5b, 0x0f, 0x21, - 0x72, 0xec, 0x9a, 0x6f, 0x82, 0xfa, 0xc8, 0xb5, 0xfb, 0xeb, 0x0e, 0x2d, 0x87, 0x2f, 0xa0, 0x59, - 0x74, 0x73, 0xd2, 0x2b, 0x63, 0x6a, 0xa3, 0xc7, 0x3e, 0x5e, 0xb3, 0xeb, 0xd4, 0xef, 0xa0, 0x5d, - 0x6d, 0x94, 0xc4, 0x59, 0x06, 0x3e, 0x36, 0x0d, 0xec, 0xd7, 0x65, 0xcc, 0xc6, 0x1e, 0xfb, 0x25, - 0xec, 0x98, 0xb6, 0x41, 0x2a, 0x98, 0xeb, 0x0d, 0xd2, 0x7e, 0xb5, 0xc1, 0xa3, 0x37, 0xf8, 0x11, - 0xf6, 0x57, 0x84, 0x4f, 0x4e, 0x57, 0x61, 0x6d, 0x6c, 0x00, 0xf6, 0x60, 0x89, 0x6c, 0xf3, 0xcb, - 0x39, 0xb7, 0xde, 0x2d, 0xe0, 0x94, 0xf1, 0xc0, 0x5d, 0x3c, 0xa4, 0xc8, 0x23, 0xf4, 0x03, 0xe4, - 0xee, 0x7b, 0x3a, 0xe3, 0xe1, 0xdc, 0xa8, 0x4a, 0x6f, 0xf1, 0xae, 0xad, 0x2f, 0x67, 0x9c, 0x9b, - 0xc7, 0xd6, 0x0f, 0xc3, 0x20, 0x94, 0x8b, 0x6c, 0x96, 0xdf, 0xe8, 0xb0, 0x92, 0x3d, 0x2c, 0xb2, - 0xdf, 0x16, 0xd9, 0x6f, 0x03, 0x66, 0xbe, 0xe9, 0x66, 0x4d, 0x65, 0xfa, 0xec, 0x9f, 0x00, 0x00, - 0x00, 0xff, 0xff, 0x41, 0xfb, 0x4e, 0xca, 0xed, 0x09, 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// GatewayClient is the client API for Gateway service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type GatewayClient interface { - // The Endorse service passes a proposed transaction to the gateway in order to - // obtain sufficient endorsement. - // The gateway will determine the endorsement plan for the requested chaincode and - // forward to the appropriate peers for endorsement. It will return to the client a - // prepared transaction in the form of an Envelope message as defined - // in common/common.proto. The client must sign the contents of this envelope - // before invoking the Submit service. - Endorse(ctx context.Context, in *EndorseRequest, opts ...grpc.CallOption) (*EndorseResponse, error) - // The Submit service will process the prepared transaction returned from Endorse service - // once it has been signed by the client. It will wait for the transaction to be submitted to the - // ordering service but the client must invoke the CommitStatus service to wait for the transaction - // to be committed. - Submit(ctx context.Context, in *SubmitRequest, opts ...grpc.CallOption) (*SubmitResponse, error) - // The CommitStatus service will indicate whether a prepared transaction previously submitted to - // the Submit service has been committed. It will wait for the commit to occur if it hasn’t already - // committed. - CommitStatus(ctx context.Context, in *SignedCommitStatusRequest, opts ...grpc.CallOption) (*CommitStatusResponse, error) - // The Evaluate service passes a proposed transaction to the gateway in order to invoke the - // transaction function and return the result to the client. No ledger updates are made. - // The gateway will select an appropriate peer to query based on block height and load. - Evaluate(ctx context.Context, in *EvaluateRequest, opts ...grpc.CallOption) (*EvaluateResponse, error) - // The ChaincodeEvents service supplies a stream of responses, each containing all the events emitted by the - // requested chaincode for a specific block. The streamed responses are ordered by ascending block number. Responses - // are only returned for blocks that contain the requested events, while blocks not containing any of the requested - // events are skipped. - ChaincodeEvents(ctx context.Context, in *SignedChaincodeEventsRequest, opts ...grpc.CallOption) (Gateway_ChaincodeEventsClient, error) -} - -type gatewayClient struct { - cc *grpc.ClientConn -} - -func NewGatewayClient(cc *grpc.ClientConn) GatewayClient { - return &gatewayClient{cc} -} - -func (c *gatewayClient) Endorse(ctx context.Context, in *EndorseRequest, opts ...grpc.CallOption) (*EndorseResponse, error) { - out := new(EndorseResponse) - err := c.cc.Invoke(ctx, "/gateway.Gateway/Endorse", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *gatewayClient) Submit(ctx context.Context, in *SubmitRequest, opts ...grpc.CallOption) (*SubmitResponse, error) { - out := new(SubmitResponse) - err := c.cc.Invoke(ctx, "/gateway.Gateway/Submit", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *gatewayClient) CommitStatus(ctx context.Context, in *SignedCommitStatusRequest, opts ...grpc.CallOption) (*CommitStatusResponse, error) { - out := new(CommitStatusResponse) - err := c.cc.Invoke(ctx, "/gateway.Gateway/CommitStatus", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *gatewayClient) Evaluate(ctx context.Context, in *EvaluateRequest, opts ...grpc.CallOption) (*EvaluateResponse, error) { - out := new(EvaluateResponse) - err := c.cc.Invoke(ctx, "/gateway.Gateway/Evaluate", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *gatewayClient) ChaincodeEvents(ctx context.Context, in *SignedChaincodeEventsRequest, opts ...grpc.CallOption) (Gateway_ChaincodeEventsClient, error) { - stream, err := c.cc.NewStream(ctx, &_Gateway_serviceDesc.Streams[0], "/gateway.Gateway/ChaincodeEvents", opts...) - if err != nil { - return nil, err - } - x := &gatewayChaincodeEventsClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -type Gateway_ChaincodeEventsClient interface { - Recv() (*ChaincodeEventsResponse, error) - grpc.ClientStream -} - -type gatewayChaincodeEventsClient struct { - grpc.ClientStream -} - -func (x *gatewayChaincodeEventsClient) Recv() (*ChaincodeEventsResponse, error) { - m := new(ChaincodeEventsResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -// GatewayServer is the server API for Gateway service. -type GatewayServer interface { - // The Endorse service passes a proposed transaction to the gateway in order to - // obtain sufficient endorsement. - // The gateway will determine the endorsement plan for the requested chaincode and - // forward to the appropriate peers for endorsement. It will return to the client a - // prepared transaction in the form of an Envelope message as defined - // in common/common.proto. The client must sign the contents of this envelope - // before invoking the Submit service. - Endorse(context.Context, *EndorseRequest) (*EndorseResponse, error) - // The Submit service will process the prepared transaction returned from Endorse service - // once it has been signed by the client. It will wait for the transaction to be submitted to the - // ordering service but the client must invoke the CommitStatus service to wait for the transaction - // to be committed. - Submit(context.Context, *SubmitRequest) (*SubmitResponse, error) - // The CommitStatus service will indicate whether a prepared transaction previously submitted to - // the Submit service has been committed. It will wait for the commit to occur if it hasn’t already - // committed. - CommitStatus(context.Context, *SignedCommitStatusRequest) (*CommitStatusResponse, error) - // The Evaluate service passes a proposed transaction to the gateway in order to invoke the - // transaction function and return the result to the client. No ledger updates are made. - // The gateway will select an appropriate peer to query based on block height and load. - Evaluate(context.Context, *EvaluateRequest) (*EvaluateResponse, error) - // The ChaincodeEvents service supplies a stream of responses, each containing all the events emitted by the - // requested chaincode for a specific block. The streamed responses are ordered by ascending block number. Responses - // are only returned for blocks that contain the requested events, while blocks not containing any of the requested - // events are skipped. - ChaincodeEvents(*SignedChaincodeEventsRequest, Gateway_ChaincodeEventsServer) error -} - -// UnimplementedGatewayServer can be embedded to have forward compatible implementations. -type UnimplementedGatewayServer struct { -} - -func (*UnimplementedGatewayServer) Endorse(ctx context.Context, req *EndorseRequest) (*EndorseResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Endorse not implemented") -} -func (*UnimplementedGatewayServer) Submit(ctx context.Context, req *SubmitRequest) (*SubmitResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Submit not implemented") -} -func (*UnimplementedGatewayServer) CommitStatus(ctx context.Context, req *SignedCommitStatusRequest) (*CommitStatusResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CommitStatus not implemented") -} -func (*UnimplementedGatewayServer) Evaluate(ctx context.Context, req *EvaluateRequest) (*EvaluateResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Evaluate not implemented") -} -func (*UnimplementedGatewayServer) ChaincodeEvents(req *SignedChaincodeEventsRequest, srv Gateway_ChaincodeEventsServer) error { - return status.Errorf(codes.Unimplemented, "method ChaincodeEvents not implemented") -} - -func RegisterGatewayServer(s *grpc.Server, srv GatewayServer) { - s.RegisterService(&_Gateway_serviceDesc, srv) -} - -func _Gateway_Endorse_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(EndorseRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(GatewayServer).Endorse(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/gateway.Gateway/Endorse", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(GatewayServer).Endorse(ctx, req.(*EndorseRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Gateway_Submit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SubmitRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(GatewayServer).Submit(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/gateway.Gateway/Submit", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(GatewayServer).Submit(ctx, req.(*SubmitRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Gateway_CommitStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SignedCommitStatusRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(GatewayServer).CommitStatus(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/gateway.Gateway/CommitStatus", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(GatewayServer).CommitStatus(ctx, req.(*SignedCommitStatusRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Gateway_Evaluate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(EvaluateRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(GatewayServer).Evaluate(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/gateway.Gateway/Evaluate", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(GatewayServer).Evaluate(ctx, req.(*EvaluateRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Gateway_ChaincodeEvents_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(SignedChaincodeEventsRequest) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(GatewayServer).ChaincodeEvents(m, &gatewayChaincodeEventsServer{stream}) -} - -type Gateway_ChaincodeEventsServer interface { - Send(*ChaincodeEventsResponse) error - grpc.ServerStream -} - -type gatewayChaincodeEventsServer struct { - grpc.ServerStream -} - -func (x *gatewayChaincodeEventsServer) Send(m *ChaincodeEventsResponse) error { - return x.ServerStream.SendMsg(m) -} - -var _Gateway_serviceDesc = grpc.ServiceDesc{ - ServiceName: "gateway.Gateway", - HandlerType: (*GatewayServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Endorse", - Handler: _Gateway_Endorse_Handler, - }, - { - MethodName: "Submit", - Handler: _Gateway_Submit_Handler, - }, - { - MethodName: "CommitStatus", - Handler: _Gateway_CommitStatus_Handler, - }, - { - MethodName: "Evaluate", - Handler: _Gateway_Evaluate_Handler, - }, - }, - Streams: []grpc.StreamDesc{ - { - StreamName: "ChaincodeEvents", - Handler: _Gateway_ChaincodeEvents_Handler, - ServerStreams: true, - }, - }, - Metadata: "gateway/gateway.proto", -} diff --git a/vendor/github.com/hyperledger/fabric-protos-go/gossip/message.pb.go b/vendor/github.com/hyperledger/fabric-protos-go/gossip/message.pb.go deleted file mode 100644 index 92da452fc80..00000000000 --- a/vendor/github.com/hyperledger/fabric-protos-go/gossip/message.pb.go +++ /dev/null @@ -1,2552 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: gossip/message.proto - -package gossip - -import ( - context "context" - fmt "fmt" - proto "github.com/golang/protobuf/proto" - peer "github.com/hyperledger/fabric-protos-go/peer" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - math "math" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package - -type PullMsgType int32 - -const ( - PullMsgType_UNDEFINED PullMsgType = 0 - PullMsgType_BLOCK_MSG PullMsgType = 1 - PullMsgType_IDENTITY_MSG PullMsgType = 2 -) - -var PullMsgType_name = map[int32]string{ - 0: "UNDEFINED", - 1: "BLOCK_MSG", - 2: "IDENTITY_MSG", -} - -var PullMsgType_value = map[string]int32{ - "UNDEFINED": 0, - "BLOCK_MSG": 1, - "IDENTITY_MSG": 2, -} - -func (x PullMsgType) String() string { - return proto.EnumName(PullMsgType_name, int32(x)) -} - -func (PullMsgType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_24518b295636120e, []int{0} -} - -type GossipMessage_Tag int32 - -const ( - GossipMessage_UNDEFINED GossipMessage_Tag = 0 - GossipMessage_EMPTY GossipMessage_Tag = 1 - GossipMessage_ORG_ONLY GossipMessage_Tag = 2 - GossipMessage_CHAN_ONLY GossipMessage_Tag = 3 - GossipMessage_CHAN_AND_ORG GossipMessage_Tag = 4 - GossipMessage_CHAN_OR_ORG GossipMessage_Tag = 5 -) - -var GossipMessage_Tag_name = map[int32]string{ - 0: "UNDEFINED", - 1: "EMPTY", - 2: "ORG_ONLY", - 3: "CHAN_ONLY", - 4: "CHAN_AND_ORG", - 5: "CHAN_OR_ORG", -} - -var GossipMessage_Tag_value = map[string]int32{ - "UNDEFINED": 0, - "EMPTY": 1, - "ORG_ONLY": 2, - "CHAN_ONLY": 3, - "CHAN_AND_ORG": 4, - "CHAN_OR_ORG": 5, -} - -func (x GossipMessage_Tag) String() string { - return proto.EnumName(GossipMessage_Tag_name, int32(x)) -} - -func (GossipMessage_Tag) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_24518b295636120e, []int{3, 0} -} - -// Envelope contains a marshalled -// GossipMessage and a signature over it. -// It may also contain a SecretEnvelope -// which is a marshalled Secret -type Envelope struct { - Payload []byte `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"` - Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` - SecretEnvelope *SecretEnvelope `protobuf:"bytes,3,opt,name=secret_envelope,json=secretEnvelope,proto3" json:"secret_envelope,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Envelope) Reset() { *m = Envelope{} } -func (m *Envelope) String() string { return proto.CompactTextString(m) } -func (*Envelope) ProtoMessage() {} -func (*Envelope) Descriptor() ([]byte, []int) { - return fileDescriptor_24518b295636120e, []int{0} -} - -func (m *Envelope) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Envelope.Unmarshal(m, b) -} -func (m *Envelope) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Envelope.Marshal(b, m, deterministic) -} -func (m *Envelope) XXX_Merge(src proto.Message) { - xxx_messageInfo_Envelope.Merge(m, src) -} -func (m *Envelope) XXX_Size() int { - return xxx_messageInfo_Envelope.Size(m) -} -func (m *Envelope) XXX_DiscardUnknown() { - xxx_messageInfo_Envelope.DiscardUnknown(m) -} - -var xxx_messageInfo_Envelope proto.InternalMessageInfo - -func (m *Envelope) GetPayload() []byte { - if m != nil { - return m.Payload - } - return nil -} - -func (m *Envelope) GetSignature() []byte { - if m != nil { - return m.Signature - } - return nil -} - -func (m *Envelope) GetSecretEnvelope() *SecretEnvelope { - if m != nil { - return m.SecretEnvelope - } - return nil -} - -// SecretEnvelope is a marshalled Secret -// and a signature over it. -// The signature should be validated by the peer -// that signed the Envelope the SecretEnvelope -// came with -type SecretEnvelope struct { - Payload []byte `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"` - Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SecretEnvelope) Reset() { *m = SecretEnvelope{} } -func (m *SecretEnvelope) String() string { return proto.CompactTextString(m) } -func (*SecretEnvelope) ProtoMessage() {} -func (*SecretEnvelope) Descriptor() ([]byte, []int) { - return fileDescriptor_24518b295636120e, []int{1} -} - -func (m *SecretEnvelope) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SecretEnvelope.Unmarshal(m, b) -} -func (m *SecretEnvelope) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SecretEnvelope.Marshal(b, m, deterministic) -} -func (m *SecretEnvelope) XXX_Merge(src proto.Message) { - xxx_messageInfo_SecretEnvelope.Merge(m, src) -} -func (m *SecretEnvelope) XXX_Size() int { - return xxx_messageInfo_SecretEnvelope.Size(m) -} -func (m *SecretEnvelope) XXX_DiscardUnknown() { - xxx_messageInfo_SecretEnvelope.DiscardUnknown(m) -} - -var xxx_messageInfo_SecretEnvelope proto.InternalMessageInfo - -func (m *SecretEnvelope) GetPayload() []byte { - if m != nil { - return m.Payload - } - return nil -} - -func (m *SecretEnvelope) GetSignature() []byte { - if m != nil { - return m.Signature - } - return nil -} - -// Secret is an entity that might be omitted -// from an Envelope when the remote peer that is receiving -// the Envelope shouldn't know the secret's content. -type Secret struct { - // Types that are valid to be assigned to Content: - // - // *Secret_InternalEndpoint - Content isSecret_Content `protobuf_oneof:"content"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Secret) Reset() { *m = Secret{} } -func (m *Secret) String() string { return proto.CompactTextString(m) } -func (*Secret) ProtoMessage() {} -func (*Secret) Descriptor() ([]byte, []int) { - return fileDescriptor_24518b295636120e, []int{2} -} - -func (m *Secret) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Secret.Unmarshal(m, b) -} -func (m *Secret) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Secret.Marshal(b, m, deterministic) -} -func (m *Secret) XXX_Merge(src proto.Message) { - xxx_messageInfo_Secret.Merge(m, src) -} -func (m *Secret) XXX_Size() int { - return xxx_messageInfo_Secret.Size(m) -} -func (m *Secret) XXX_DiscardUnknown() { - xxx_messageInfo_Secret.DiscardUnknown(m) -} - -var xxx_messageInfo_Secret proto.InternalMessageInfo - -type isSecret_Content interface { - isSecret_Content() -} - -type Secret_InternalEndpoint struct { - InternalEndpoint string `protobuf:"bytes,1,opt,name=internalEndpoint,proto3,oneof"` -} - -func (*Secret_InternalEndpoint) isSecret_Content() {} - -func (m *Secret) GetContent() isSecret_Content { - if m != nil { - return m.Content - } - return nil -} - -func (m *Secret) GetInternalEndpoint() string { - if x, ok := m.GetContent().(*Secret_InternalEndpoint); ok { - return x.InternalEndpoint - } - return "" -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*Secret) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*Secret_InternalEndpoint)(nil), - } -} - -// GossipMessage defines the message sent in a gossip network -type GossipMessage struct { - // used mainly for testing, but will might be used in the future - // for ensuring message delivery by acking - Nonce uint64 `protobuf:"varint,1,opt,name=nonce,proto3" json:"nonce,omitempty"` - // The channel of the message. - // Some GossipMessages may set this to nil, because - // they are cross-channels but some may not - Channel []byte `protobuf:"bytes,2,opt,name=channel,proto3" json:"channel,omitempty"` - // determines to which peers it is allowed - // to forward the message - Tag GossipMessage_Tag `protobuf:"varint,3,opt,name=tag,proto3,enum=gossip.GossipMessage_Tag" json:"tag,omitempty"` - // Types that are valid to be assigned to Content: - // - // *GossipMessage_AliveMsg - // *GossipMessage_MemReq - // *GossipMessage_MemRes - // *GossipMessage_DataMsg - // *GossipMessage_Hello - // *GossipMessage_DataDig - // *GossipMessage_DataReq - // *GossipMessage_DataUpdate - // *GossipMessage_Empty - // *GossipMessage_Conn - // *GossipMessage_StateInfo - // *GossipMessage_StateSnapshot - // *GossipMessage_StateInfoPullReq - // *GossipMessage_StateRequest - // *GossipMessage_StateResponse - // *GossipMessage_LeadershipMsg - // *GossipMessage_PeerIdentity - // *GossipMessage_Ack - // *GossipMessage_PrivateReq - // *GossipMessage_PrivateRes - // *GossipMessage_PrivateData - Content isGossipMessage_Content `protobuf_oneof:"content"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GossipMessage) Reset() { *m = GossipMessage{} } -func (m *GossipMessage) String() string { return proto.CompactTextString(m) } -func (*GossipMessage) ProtoMessage() {} -func (*GossipMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_24518b295636120e, []int{3} -} - -func (m *GossipMessage) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GossipMessage.Unmarshal(m, b) -} -func (m *GossipMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GossipMessage.Marshal(b, m, deterministic) -} -func (m *GossipMessage) XXX_Merge(src proto.Message) { - xxx_messageInfo_GossipMessage.Merge(m, src) -} -func (m *GossipMessage) XXX_Size() int { - return xxx_messageInfo_GossipMessage.Size(m) -} -func (m *GossipMessage) XXX_DiscardUnknown() { - xxx_messageInfo_GossipMessage.DiscardUnknown(m) -} - -var xxx_messageInfo_GossipMessage proto.InternalMessageInfo - -func (m *GossipMessage) GetNonce() uint64 { - if m != nil { - return m.Nonce - } - return 0 -} - -func (m *GossipMessage) GetChannel() []byte { - if m != nil { - return m.Channel - } - return nil -} - -func (m *GossipMessage) GetTag() GossipMessage_Tag { - if m != nil { - return m.Tag - } - return GossipMessage_UNDEFINED -} - -type isGossipMessage_Content interface { - isGossipMessage_Content() -} - -type GossipMessage_AliveMsg struct { - AliveMsg *AliveMessage `protobuf:"bytes,5,opt,name=alive_msg,json=aliveMsg,proto3,oneof"` -} - -type GossipMessage_MemReq struct { - MemReq *MembershipRequest `protobuf:"bytes,6,opt,name=mem_req,json=memReq,proto3,oneof"` -} - -type GossipMessage_MemRes struct { - MemRes *MembershipResponse `protobuf:"bytes,7,opt,name=mem_res,json=memRes,proto3,oneof"` -} - -type GossipMessage_DataMsg struct { - DataMsg *DataMessage `protobuf:"bytes,8,opt,name=data_msg,json=dataMsg,proto3,oneof"` -} - -type GossipMessage_Hello struct { - Hello *GossipHello `protobuf:"bytes,9,opt,name=hello,proto3,oneof"` -} - -type GossipMessage_DataDig struct { - DataDig *DataDigest `protobuf:"bytes,10,opt,name=data_dig,json=dataDig,proto3,oneof"` -} - -type GossipMessage_DataReq struct { - DataReq *DataRequest `protobuf:"bytes,11,opt,name=data_req,json=dataReq,proto3,oneof"` -} - -type GossipMessage_DataUpdate struct { - DataUpdate *DataUpdate `protobuf:"bytes,12,opt,name=data_update,json=dataUpdate,proto3,oneof"` -} - -type GossipMessage_Empty struct { - Empty *Empty `protobuf:"bytes,13,opt,name=empty,proto3,oneof"` -} - -type GossipMessage_Conn struct { - Conn *ConnEstablish `protobuf:"bytes,14,opt,name=conn,proto3,oneof"` -} - -type GossipMessage_StateInfo struct { - StateInfo *StateInfo `protobuf:"bytes,15,opt,name=state_info,json=stateInfo,proto3,oneof"` -} - -type GossipMessage_StateSnapshot struct { - StateSnapshot *StateInfoSnapshot `protobuf:"bytes,16,opt,name=state_snapshot,json=stateSnapshot,proto3,oneof"` -} - -type GossipMessage_StateInfoPullReq struct { - StateInfoPullReq *StateInfoPullRequest `protobuf:"bytes,17,opt,name=state_info_pull_req,json=stateInfoPullReq,proto3,oneof"` -} - -type GossipMessage_StateRequest struct { - StateRequest *RemoteStateRequest `protobuf:"bytes,18,opt,name=state_request,json=stateRequest,proto3,oneof"` -} - -type GossipMessage_StateResponse struct { - StateResponse *RemoteStateResponse `protobuf:"bytes,19,opt,name=state_response,json=stateResponse,proto3,oneof"` -} - -type GossipMessage_LeadershipMsg struct { - LeadershipMsg *LeadershipMessage `protobuf:"bytes,20,opt,name=leadership_msg,json=leadershipMsg,proto3,oneof"` -} - -type GossipMessage_PeerIdentity struct { - PeerIdentity *PeerIdentity `protobuf:"bytes,21,opt,name=peer_identity,json=peerIdentity,proto3,oneof"` -} - -type GossipMessage_Ack struct { - Ack *Acknowledgement `protobuf:"bytes,22,opt,name=ack,proto3,oneof"` -} - -type GossipMessage_PrivateReq struct { - PrivateReq *RemotePvtDataRequest `protobuf:"bytes,23,opt,name=privateReq,proto3,oneof"` -} - -type GossipMessage_PrivateRes struct { - PrivateRes *RemotePvtDataResponse `protobuf:"bytes,24,opt,name=privateRes,proto3,oneof"` -} - -type GossipMessage_PrivateData struct { - PrivateData *PrivateDataMessage `protobuf:"bytes,25,opt,name=private_data,json=privateData,proto3,oneof"` -} - -func (*GossipMessage_AliveMsg) isGossipMessage_Content() {} - -func (*GossipMessage_MemReq) isGossipMessage_Content() {} - -func (*GossipMessage_MemRes) isGossipMessage_Content() {} - -func (*GossipMessage_DataMsg) isGossipMessage_Content() {} - -func (*GossipMessage_Hello) isGossipMessage_Content() {} - -func (*GossipMessage_DataDig) isGossipMessage_Content() {} - -func (*GossipMessage_DataReq) isGossipMessage_Content() {} - -func (*GossipMessage_DataUpdate) isGossipMessage_Content() {} - -func (*GossipMessage_Empty) isGossipMessage_Content() {} - -func (*GossipMessage_Conn) isGossipMessage_Content() {} - -func (*GossipMessage_StateInfo) isGossipMessage_Content() {} - -func (*GossipMessage_StateSnapshot) isGossipMessage_Content() {} - -func (*GossipMessage_StateInfoPullReq) isGossipMessage_Content() {} - -func (*GossipMessage_StateRequest) isGossipMessage_Content() {} - -func (*GossipMessage_StateResponse) isGossipMessage_Content() {} - -func (*GossipMessage_LeadershipMsg) isGossipMessage_Content() {} - -func (*GossipMessage_PeerIdentity) isGossipMessage_Content() {} - -func (*GossipMessage_Ack) isGossipMessage_Content() {} - -func (*GossipMessage_PrivateReq) isGossipMessage_Content() {} - -func (*GossipMessage_PrivateRes) isGossipMessage_Content() {} - -func (*GossipMessage_PrivateData) isGossipMessage_Content() {} - -func (m *GossipMessage) GetContent() isGossipMessage_Content { - if m != nil { - return m.Content - } - return nil -} - -func (m *GossipMessage) GetAliveMsg() *AliveMessage { - if x, ok := m.GetContent().(*GossipMessage_AliveMsg); ok { - return x.AliveMsg - } - return nil -} - -func (m *GossipMessage) GetMemReq() *MembershipRequest { - if x, ok := m.GetContent().(*GossipMessage_MemReq); ok { - return x.MemReq - } - return nil -} - -func (m *GossipMessage) GetMemRes() *MembershipResponse { - if x, ok := m.GetContent().(*GossipMessage_MemRes); ok { - return x.MemRes - } - return nil -} - -func (m *GossipMessage) GetDataMsg() *DataMessage { - if x, ok := m.GetContent().(*GossipMessage_DataMsg); ok { - return x.DataMsg - } - return nil -} - -func (m *GossipMessage) GetHello() *GossipHello { - if x, ok := m.GetContent().(*GossipMessage_Hello); ok { - return x.Hello - } - return nil -} - -func (m *GossipMessage) GetDataDig() *DataDigest { - if x, ok := m.GetContent().(*GossipMessage_DataDig); ok { - return x.DataDig - } - return nil -} - -func (m *GossipMessage) GetDataReq() *DataRequest { - if x, ok := m.GetContent().(*GossipMessage_DataReq); ok { - return x.DataReq - } - return nil -} - -func (m *GossipMessage) GetDataUpdate() *DataUpdate { - if x, ok := m.GetContent().(*GossipMessage_DataUpdate); ok { - return x.DataUpdate - } - return nil -} - -func (m *GossipMessage) GetEmpty() *Empty { - if x, ok := m.GetContent().(*GossipMessage_Empty); ok { - return x.Empty - } - return nil -} - -func (m *GossipMessage) GetConn() *ConnEstablish { - if x, ok := m.GetContent().(*GossipMessage_Conn); ok { - return x.Conn - } - return nil -} - -func (m *GossipMessage) GetStateInfo() *StateInfo { - if x, ok := m.GetContent().(*GossipMessage_StateInfo); ok { - return x.StateInfo - } - return nil -} - -func (m *GossipMessage) GetStateSnapshot() *StateInfoSnapshot { - if x, ok := m.GetContent().(*GossipMessage_StateSnapshot); ok { - return x.StateSnapshot - } - return nil -} - -func (m *GossipMessage) GetStateInfoPullReq() *StateInfoPullRequest { - if x, ok := m.GetContent().(*GossipMessage_StateInfoPullReq); ok { - return x.StateInfoPullReq - } - return nil -} - -func (m *GossipMessage) GetStateRequest() *RemoteStateRequest { - if x, ok := m.GetContent().(*GossipMessage_StateRequest); ok { - return x.StateRequest - } - return nil -} - -func (m *GossipMessage) GetStateResponse() *RemoteStateResponse { - if x, ok := m.GetContent().(*GossipMessage_StateResponse); ok { - return x.StateResponse - } - return nil -} - -func (m *GossipMessage) GetLeadershipMsg() *LeadershipMessage { - if x, ok := m.GetContent().(*GossipMessage_LeadershipMsg); ok { - return x.LeadershipMsg - } - return nil -} - -func (m *GossipMessage) GetPeerIdentity() *PeerIdentity { - if x, ok := m.GetContent().(*GossipMessage_PeerIdentity); ok { - return x.PeerIdentity - } - return nil -} - -func (m *GossipMessage) GetAck() *Acknowledgement { - if x, ok := m.GetContent().(*GossipMessage_Ack); ok { - return x.Ack - } - return nil -} - -func (m *GossipMessage) GetPrivateReq() *RemotePvtDataRequest { - if x, ok := m.GetContent().(*GossipMessage_PrivateReq); ok { - return x.PrivateReq - } - return nil -} - -func (m *GossipMessage) GetPrivateRes() *RemotePvtDataResponse { - if x, ok := m.GetContent().(*GossipMessage_PrivateRes); ok { - return x.PrivateRes - } - return nil -} - -func (m *GossipMessage) GetPrivateData() *PrivateDataMessage { - if x, ok := m.GetContent().(*GossipMessage_PrivateData); ok { - return x.PrivateData - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*GossipMessage) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*GossipMessage_AliveMsg)(nil), - (*GossipMessage_MemReq)(nil), - (*GossipMessage_MemRes)(nil), - (*GossipMessage_DataMsg)(nil), - (*GossipMessage_Hello)(nil), - (*GossipMessage_DataDig)(nil), - (*GossipMessage_DataReq)(nil), - (*GossipMessage_DataUpdate)(nil), - (*GossipMessage_Empty)(nil), - (*GossipMessage_Conn)(nil), - (*GossipMessage_StateInfo)(nil), - (*GossipMessage_StateSnapshot)(nil), - (*GossipMessage_StateInfoPullReq)(nil), - (*GossipMessage_StateRequest)(nil), - (*GossipMessage_StateResponse)(nil), - (*GossipMessage_LeadershipMsg)(nil), - (*GossipMessage_PeerIdentity)(nil), - (*GossipMessage_Ack)(nil), - (*GossipMessage_PrivateReq)(nil), - (*GossipMessage_PrivateRes)(nil), - (*GossipMessage_PrivateData)(nil), - } -} - -// StateInfo is used for a peer to relay its state information -// to other peers -type StateInfo struct { - Timestamp *PeerTime `protobuf:"bytes,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - PkiId []byte `protobuf:"bytes,3,opt,name=pki_id,json=pkiId,proto3" json:"pki_id,omitempty"` - // channel_MAC is an authentication code that proves - // that the peer that sent this message knows - // the name of the channel. - Channel_MAC []byte `protobuf:"bytes,4,opt,name=channel_MAC,json=channelMAC,proto3" json:"channel_MAC,omitempty"` - Properties *Properties `protobuf:"bytes,5,opt,name=properties,proto3" json:"properties,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *StateInfo) Reset() { *m = StateInfo{} } -func (m *StateInfo) String() string { return proto.CompactTextString(m) } -func (*StateInfo) ProtoMessage() {} -func (*StateInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_24518b295636120e, []int{4} -} - -func (m *StateInfo) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_StateInfo.Unmarshal(m, b) -} -func (m *StateInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_StateInfo.Marshal(b, m, deterministic) -} -func (m *StateInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_StateInfo.Merge(m, src) -} -func (m *StateInfo) XXX_Size() int { - return xxx_messageInfo_StateInfo.Size(m) -} -func (m *StateInfo) XXX_DiscardUnknown() { - xxx_messageInfo_StateInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_StateInfo proto.InternalMessageInfo - -func (m *StateInfo) GetTimestamp() *PeerTime { - if m != nil { - return m.Timestamp - } - return nil -} - -func (m *StateInfo) GetPkiId() []byte { - if m != nil { - return m.PkiId - } - return nil -} - -func (m *StateInfo) GetChannel_MAC() []byte { - if m != nil { - return m.Channel_MAC - } - return nil -} - -func (m *StateInfo) GetProperties() *Properties { - if m != nil { - return m.Properties - } - return nil -} - -type Properties struct { - LedgerHeight uint64 `protobuf:"varint,1,opt,name=ledger_height,json=ledgerHeight,proto3" json:"ledger_height,omitempty"` - LeftChannel bool `protobuf:"varint,2,opt,name=left_channel,json=leftChannel,proto3" json:"left_channel,omitempty"` - Chaincodes []*Chaincode `protobuf:"bytes,3,rep,name=chaincodes,proto3" json:"chaincodes,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Properties) Reset() { *m = Properties{} } -func (m *Properties) String() string { return proto.CompactTextString(m) } -func (*Properties) ProtoMessage() {} -func (*Properties) Descriptor() ([]byte, []int) { - return fileDescriptor_24518b295636120e, []int{5} -} - -func (m *Properties) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Properties.Unmarshal(m, b) -} -func (m *Properties) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Properties.Marshal(b, m, deterministic) -} -func (m *Properties) XXX_Merge(src proto.Message) { - xxx_messageInfo_Properties.Merge(m, src) -} -func (m *Properties) XXX_Size() int { - return xxx_messageInfo_Properties.Size(m) -} -func (m *Properties) XXX_DiscardUnknown() { - xxx_messageInfo_Properties.DiscardUnknown(m) -} - -var xxx_messageInfo_Properties proto.InternalMessageInfo - -func (m *Properties) GetLedgerHeight() uint64 { - if m != nil { - return m.LedgerHeight - } - return 0 -} - -func (m *Properties) GetLeftChannel() bool { - if m != nil { - return m.LeftChannel - } - return false -} - -func (m *Properties) GetChaincodes() []*Chaincode { - if m != nil { - return m.Chaincodes - } - return nil -} - -// StateInfoSnapshot is an aggregation of StateInfo messages -type StateInfoSnapshot struct { - Elements []*Envelope `protobuf:"bytes,1,rep,name=elements,proto3" json:"elements,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *StateInfoSnapshot) Reset() { *m = StateInfoSnapshot{} } -func (m *StateInfoSnapshot) String() string { return proto.CompactTextString(m) } -func (*StateInfoSnapshot) ProtoMessage() {} -func (*StateInfoSnapshot) Descriptor() ([]byte, []int) { - return fileDescriptor_24518b295636120e, []int{6} -} - -func (m *StateInfoSnapshot) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_StateInfoSnapshot.Unmarshal(m, b) -} -func (m *StateInfoSnapshot) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_StateInfoSnapshot.Marshal(b, m, deterministic) -} -func (m *StateInfoSnapshot) XXX_Merge(src proto.Message) { - xxx_messageInfo_StateInfoSnapshot.Merge(m, src) -} -func (m *StateInfoSnapshot) XXX_Size() int { - return xxx_messageInfo_StateInfoSnapshot.Size(m) -} -func (m *StateInfoSnapshot) XXX_DiscardUnknown() { - xxx_messageInfo_StateInfoSnapshot.DiscardUnknown(m) -} - -var xxx_messageInfo_StateInfoSnapshot proto.InternalMessageInfo - -func (m *StateInfoSnapshot) GetElements() []*Envelope { - if m != nil { - return m.Elements - } - return nil -} - -// StateInfoPullRequest is used to fetch a StateInfoSnapshot -// from a remote peer -type StateInfoPullRequest struct { - // channel_MAC is an authentication code that proves - // that the peer that sent this message knows - // the name of the channel. - Channel_MAC []byte `protobuf:"bytes,1,opt,name=channel_MAC,json=channelMAC,proto3" json:"channel_MAC,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *StateInfoPullRequest) Reset() { *m = StateInfoPullRequest{} } -func (m *StateInfoPullRequest) String() string { return proto.CompactTextString(m) } -func (*StateInfoPullRequest) ProtoMessage() {} -func (*StateInfoPullRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_24518b295636120e, []int{7} -} - -func (m *StateInfoPullRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_StateInfoPullRequest.Unmarshal(m, b) -} -func (m *StateInfoPullRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_StateInfoPullRequest.Marshal(b, m, deterministic) -} -func (m *StateInfoPullRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_StateInfoPullRequest.Merge(m, src) -} -func (m *StateInfoPullRequest) XXX_Size() int { - return xxx_messageInfo_StateInfoPullRequest.Size(m) -} -func (m *StateInfoPullRequest) XXX_DiscardUnknown() { - xxx_messageInfo_StateInfoPullRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_StateInfoPullRequest proto.InternalMessageInfo - -func (m *StateInfoPullRequest) GetChannel_MAC() []byte { - if m != nil { - return m.Channel_MAC - } - return nil -} - -// ConnEstablish is the message used for the gossip handshake -// Whenever a peer connects to another peer, it handshakes -// with it by sending this message that proves its identity -type ConnEstablish struct { - PkiId []byte `protobuf:"bytes,1,opt,name=pki_id,json=pkiId,proto3" json:"pki_id,omitempty"` - Identity []byte `protobuf:"bytes,2,opt,name=identity,proto3" json:"identity,omitempty"` - TlsCertHash []byte `protobuf:"bytes,3,opt,name=tls_cert_hash,json=tlsCertHash,proto3" json:"tls_cert_hash,omitempty"` - Probe bool `protobuf:"varint,4,opt,name=probe,proto3" json:"probe,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ConnEstablish) Reset() { *m = ConnEstablish{} } -func (m *ConnEstablish) String() string { return proto.CompactTextString(m) } -func (*ConnEstablish) ProtoMessage() {} -func (*ConnEstablish) Descriptor() ([]byte, []int) { - return fileDescriptor_24518b295636120e, []int{8} -} - -func (m *ConnEstablish) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ConnEstablish.Unmarshal(m, b) -} -func (m *ConnEstablish) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ConnEstablish.Marshal(b, m, deterministic) -} -func (m *ConnEstablish) XXX_Merge(src proto.Message) { - xxx_messageInfo_ConnEstablish.Merge(m, src) -} -func (m *ConnEstablish) XXX_Size() int { - return xxx_messageInfo_ConnEstablish.Size(m) -} -func (m *ConnEstablish) XXX_DiscardUnknown() { - xxx_messageInfo_ConnEstablish.DiscardUnknown(m) -} - -var xxx_messageInfo_ConnEstablish proto.InternalMessageInfo - -func (m *ConnEstablish) GetPkiId() []byte { - if m != nil { - return m.PkiId - } - return nil -} - -func (m *ConnEstablish) GetIdentity() []byte { - if m != nil { - return m.Identity - } - return nil -} - -func (m *ConnEstablish) GetTlsCertHash() []byte { - if m != nil { - return m.TlsCertHash - } - return nil -} - -func (m *ConnEstablish) GetProbe() bool { - if m != nil { - return m.Probe - } - return false -} - -// PeerIdentity defines the identity of the peer -// Used to make other peers learn of the identity -// of a certain peer -type PeerIdentity struct { - PkiId []byte `protobuf:"bytes,1,opt,name=pki_id,json=pkiId,proto3" json:"pki_id,omitempty"` - Cert []byte `protobuf:"bytes,2,opt,name=cert,proto3" json:"cert,omitempty"` - Metadata []byte `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *PeerIdentity) Reset() { *m = PeerIdentity{} } -func (m *PeerIdentity) String() string { return proto.CompactTextString(m) } -func (*PeerIdentity) ProtoMessage() {} -func (*PeerIdentity) Descriptor() ([]byte, []int) { - return fileDescriptor_24518b295636120e, []int{9} -} - -func (m *PeerIdentity) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_PeerIdentity.Unmarshal(m, b) -} -func (m *PeerIdentity) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_PeerIdentity.Marshal(b, m, deterministic) -} -func (m *PeerIdentity) XXX_Merge(src proto.Message) { - xxx_messageInfo_PeerIdentity.Merge(m, src) -} -func (m *PeerIdentity) XXX_Size() int { - return xxx_messageInfo_PeerIdentity.Size(m) -} -func (m *PeerIdentity) XXX_DiscardUnknown() { - xxx_messageInfo_PeerIdentity.DiscardUnknown(m) -} - -var xxx_messageInfo_PeerIdentity proto.InternalMessageInfo - -func (m *PeerIdentity) GetPkiId() []byte { - if m != nil { - return m.PkiId - } - return nil -} - -func (m *PeerIdentity) GetCert() []byte { - if m != nil { - return m.Cert - } - return nil -} - -func (m *PeerIdentity) GetMetadata() []byte { - if m != nil { - return m.Metadata - } - return nil -} - -// DataRequest is a message used for a peer to request -// certain data blocks from a remote peer -type DataRequest struct { - Nonce uint64 `protobuf:"varint,1,opt,name=nonce,proto3" json:"nonce,omitempty"` - Digests [][]byte `protobuf:"bytes,2,rep,name=digests,proto3" json:"digests,omitempty"` - MsgType PullMsgType `protobuf:"varint,3,opt,name=msg_type,json=msgType,proto3,enum=gossip.PullMsgType" json:"msg_type,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DataRequest) Reset() { *m = DataRequest{} } -func (m *DataRequest) String() string { return proto.CompactTextString(m) } -func (*DataRequest) ProtoMessage() {} -func (*DataRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_24518b295636120e, []int{10} -} - -func (m *DataRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DataRequest.Unmarshal(m, b) -} -func (m *DataRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DataRequest.Marshal(b, m, deterministic) -} -func (m *DataRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_DataRequest.Merge(m, src) -} -func (m *DataRequest) XXX_Size() int { - return xxx_messageInfo_DataRequest.Size(m) -} -func (m *DataRequest) XXX_DiscardUnknown() { - xxx_messageInfo_DataRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_DataRequest proto.InternalMessageInfo - -func (m *DataRequest) GetNonce() uint64 { - if m != nil { - return m.Nonce - } - return 0 -} - -func (m *DataRequest) GetDigests() [][]byte { - if m != nil { - return m.Digests - } - return nil -} - -func (m *DataRequest) GetMsgType() PullMsgType { - if m != nil { - return m.MsgType - } - return PullMsgType_UNDEFINED -} - -// GossipHello is the message that is used for the peer to initiate -// a pull round with another peer -type GossipHello struct { - Nonce uint64 `protobuf:"varint,1,opt,name=nonce,proto3" json:"nonce,omitempty"` - Metadata []byte `protobuf:"bytes,2,opt,name=metadata,proto3" json:"metadata,omitempty"` - MsgType PullMsgType `protobuf:"varint,3,opt,name=msg_type,json=msgType,proto3,enum=gossip.PullMsgType" json:"msg_type,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GossipHello) Reset() { *m = GossipHello{} } -func (m *GossipHello) String() string { return proto.CompactTextString(m) } -func (*GossipHello) ProtoMessage() {} -func (*GossipHello) Descriptor() ([]byte, []int) { - return fileDescriptor_24518b295636120e, []int{11} -} - -func (m *GossipHello) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GossipHello.Unmarshal(m, b) -} -func (m *GossipHello) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GossipHello.Marshal(b, m, deterministic) -} -func (m *GossipHello) XXX_Merge(src proto.Message) { - xxx_messageInfo_GossipHello.Merge(m, src) -} -func (m *GossipHello) XXX_Size() int { - return xxx_messageInfo_GossipHello.Size(m) -} -func (m *GossipHello) XXX_DiscardUnknown() { - xxx_messageInfo_GossipHello.DiscardUnknown(m) -} - -var xxx_messageInfo_GossipHello proto.InternalMessageInfo - -func (m *GossipHello) GetNonce() uint64 { - if m != nil { - return m.Nonce - } - return 0 -} - -func (m *GossipHello) GetMetadata() []byte { - if m != nil { - return m.Metadata - } - return nil -} - -func (m *GossipHello) GetMsgType() PullMsgType { - if m != nil { - return m.MsgType - } - return PullMsgType_UNDEFINED -} - -// DataUpdate is the final message in the pull phase -// sent from the receiver to the initiator -type DataUpdate struct { - Nonce uint64 `protobuf:"varint,1,opt,name=nonce,proto3" json:"nonce,omitempty"` - Data []*Envelope `protobuf:"bytes,2,rep,name=data,proto3" json:"data,omitempty"` - MsgType PullMsgType `protobuf:"varint,3,opt,name=msg_type,json=msgType,proto3,enum=gossip.PullMsgType" json:"msg_type,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DataUpdate) Reset() { *m = DataUpdate{} } -func (m *DataUpdate) String() string { return proto.CompactTextString(m) } -func (*DataUpdate) ProtoMessage() {} -func (*DataUpdate) Descriptor() ([]byte, []int) { - return fileDescriptor_24518b295636120e, []int{12} -} - -func (m *DataUpdate) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DataUpdate.Unmarshal(m, b) -} -func (m *DataUpdate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DataUpdate.Marshal(b, m, deterministic) -} -func (m *DataUpdate) XXX_Merge(src proto.Message) { - xxx_messageInfo_DataUpdate.Merge(m, src) -} -func (m *DataUpdate) XXX_Size() int { - return xxx_messageInfo_DataUpdate.Size(m) -} -func (m *DataUpdate) XXX_DiscardUnknown() { - xxx_messageInfo_DataUpdate.DiscardUnknown(m) -} - -var xxx_messageInfo_DataUpdate proto.InternalMessageInfo - -func (m *DataUpdate) GetNonce() uint64 { - if m != nil { - return m.Nonce - } - return 0 -} - -func (m *DataUpdate) GetData() []*Envelope { - if m != nil { - return m.Data - } - return nil -} - -func (m *DataUpdate) GetMsgType() PullMsgType { - if m != nil { - return m.MsgType - } - return PullMsgType_UNDEFINED -} - -// DataDigest is the message sent from the receiver peer -// to the initator peer and contains the data items it has -type DataDigest struct { - Nonce uint64 `protobuf:"varint,1,opt,name=nonce,proto3" json:"nonce,omitempty"` - Digests [][]byte `protobuf:"bytes,2,rep,name=digests,proto3" json:"digests,omitempty"` - MsgType PullMsgType `protobuf:"varint,3,opt,name=msg_type,json=msgType,proto3,enum=gossip.PullMsgType" json:"msg_type,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DataDigest) Reset() { *m = DataDigest{} } -func (m *DataDigest) String() string { return proto.CompactTextString(m) } -func (*DataDigest) ProtoMessage() {} -func (*DataDigest) Descriptor() ([]byte, []int) { - return fileDescriptor_24518b295636120e, []int{13} -} - -func (m *DataDigest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DataDigest.Unmarshal(m, b) -} -func (m *DataDigest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DataDigest.Marshal(b, m, deterministic) -} -func (m *DataDigest) XXX_Merge(src proto.Message) { - xxx_messageInfo_DataDigest.Merge(m, src) -} -func (m *DataDigest) XXX_Size() int { - return xxx_messageInfo_DataDigest.Size(m) -} -func (m *DataDigest) XXX_DiscardUnknown() { - xxx_messageInfo_DataDigest.DiscardUnknown(m) -} - -var xxx_messageInfo_DataDigest proto.InternalMessageInfo - -func (m *DataDigest) GetNonce() uint64 { - if m != nil { - return m.Nonce - } - return 0 -} - -func (m *DataDigest) GetDigests() [][]byte { - if m != nil { - return m.Digests - } - return nil -} - -func (m *DataDigest) GetMsgType() PullMsgType { - if m != nil { - return m.MsgType - } - return PullMsgType_UNDEFINED -} - -// DataMessage is the message that contains a block -type DataMessage struct { - Payload *Payload `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DataMessage) Reset() { *m = DataMessage{} } -func (m *DataMessage) String() string { return proto.CompactTextString(m) } -func (*DataMessage) ProtoMessage() {} -func (*DataMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_24518b295636120e, []int{14} -} - -func (m *DataMessage) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DataMessage.Unmarshal(m, b) -} -func (m *DataMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DataMessage.Marshal(b, m, deterministic) -} -func (m *DataMessage) XXX_Merge(src proto.Message) { - xxx_messageInfo_DataMessage.Merge(m, src) -} -func (m *DataMessage) XXX_Size() int { - return xxx_messageInfo_DataMessage.Size(m) -} -func (m *DataMessage) XXX_DiscardUnknown() { - xxx_messageInfo_DataMessage.DiscardUnknown(m) -} - -var xxx_messageInfo_DataMessage proto.InternalMessageInfo - -func (m *DataMessage) GetPayload() *Payload { - if m != nil { - return m.Payload - } - return nil -} - -// PrivateDataMessage message which includes private -// data information to distributed once transaction -// has been endorsed -type PrivateDataMessage struct { - Payload *PrivatePayload `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *PrivateDataMessage) Reset() { *m = PrivateDataMessage{} } -func (m *PrivateDataMessage) String() string { return proto.CompactTextString(m) } -func (*PrivateDataMessage) ProtoMessage() {} -func (*PrivateDataMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_24518b295636120e, []int{15} -} - -func (m *PrivateDataMessage) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_PrivateDataMessage.Unmarshal(m, b) -} -func (m *PrivateDataMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_PrivateDataMessage.Marshal(b, m, deterministic) -} -func (m *PrivateDataMessage) XXX_Merge(src proto.Message) { - xxx_messageInfo_PrivateDataMessage.Merge(m, src) -} -func (m *PrivateDataMessage) XXX_Size() int { - return xxx_messageInfo_PrivateDataMessage.Size(m) -} -func (m *PrivateDataMessage) XXX_DiscardUnknown() { - xxx_messageInfo_PrivateDataMessage.DiscardUnknown(m) -} - -var xxx_messageInfo_PrivateDataMessage proto.InternalMessageInfo - -func (m *PrivateDataMessage) GetPayload() *PrivatePayload { - if m != nil { - return m.Payload - } - return nil -} - -// Payload contains a block -type Payload struct { - SeqNum uint64 `protobuf:"varint,1,opt,name=seq_num,json=seqNum,proto3" json:"seq_num,omitempty"` - Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` - PrivateData [][]byte `protobuf:"bytes,3,rep,name=private_data,json=privateData,proto3" json:"private_data,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Payload) Reset() { *m = Payload{} } -func (m *Payload) String() string { return proto.CompactTextString(m) } -func (*Payload) ProtoMessage() {} -func (*Payload) Descriptor() ([]byte, []int) { - return fileDescriptor_24518b295636120e, []int{16} -} - -func (m *Payload) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Payload.Unmarshal(m, b) -} -func (m *Payload) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Payload.Marshal(b, m, deterministic) -} -func (m *Payload) XXX_Merge(src proto.Message) { - xxx_messageInfo_Payload.Merge(m, src) -} -func (m *Payload) XXX_Size() int { - return xxx_messageInfo_Payload.Size(m) -} -func (m *Payload) XXX_DiscardUnknown() { - xxx_messageInfo_Payload.DiscardUnknown(m) -} - -var xxx_messageInfo_Payload proto.InternalMessageInfo - -func (m *Payload) GetSeqNum() uint64 { - if m != nil { - return m.SeqNum - } - return 0 -} - -func (m *Payload) GetData() []byte { - if m != nil { - return m.Data - } - return nil -} - -func (m *Payload) GetPrivateData() [][]byte { - if m != nil { - return m.PrivateData - } - return nil -} - -// PrivatePayload payload to encapsulate private -// data with collection name to enable routing -// based on collection partitioning -type PrivatePayload struct { - CollectionName string `protobuf:"bytes,1,opt,name=collection_name,json=collectionName,proto3" json:"collection_name,omitempty"` - Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"` - TxId string `protobuf:"bytes,3,opt,name=tx_id,json=txId,proto3" json:"tx_id,omitempty"` - PrivateRwset []byte `protobuf:"bytes,4,opt,name=private_rwset,json=privateRwset,proto3" json:"private_rwset,omitempty"` - PrivateSimHeight uint64 `protobuf:"varint,5,opt,name=private_sim_height,json=privateSimHeight,proto3" json:"private_sim_height,omitempty"` - CollectionConfigs *peer.CollectionConfigPackage `protobuf:"bytes,6,opt,name=collection_configs,json=collectionConfigs,proto3" json:"collection_configs,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *PrivatePayload) Reset() { *m = PrivatePayload{} } -func (m *PrivatePayload) String() string { return proto.CompactTextString(m) } -func (*PrivatePayload) ProtoMessage() {} -func (*PrivatePayload) Descriptor() ([]byte, []int) { - return fileDescriptor_24518b295636120e, []int{17} -} - -func (m *PrivatePayload) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_PrivatePayload.Unmarshal(m, b) -} -func (m *PrivatePayload) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_PrivatePayload.Marshal(b, m, deterministic) -} -func (m *PrivatePayload) XXX_Merge(src proto.Message) { - xxx_messageInfo_PrivatePayload.Merge(m, src) -} -func (m *PrivatePayload) XXX_Size() int { - return xxx_messageInfo_PrivatePayload.Size(m) -} -func (m *PrivatePayload) XXX_DiscardUnknown() { - xxx_messageInfo_PrivatePayload.DiscardUnknown(m) -} - -var xxx_messageInfo_PrivatePayload proto.InternalMessageInfo - -func (m *PrivatePayload) GetCollectionName() string { - if m != nil { - return m.CollectionName - } - return "" -} - -func (m *PrivatePayload) GetNamespace() string { - if m != nil { - return m.Namespace - } - return "" -} - -func (m *PrivatePayload) GetTxId() string { - if m != nil { - return m.TxId - } - return "" -} - -func (m *PrivatePayload) GetPrivateRwset() []byte { - if m != nil { - return m.PrivateRwset - } - return nil -} - -func (m *PrivatePayload) GetPrivateSimHeight() uint64 { - if m != nil { - return m.PrivateSimHeight - } - return 0 -} - -func (m *PrivatePayload) GetCollectionConfigs() *peer.CollectionConfigPackage { - if m != nil { - return m.CollectionConfigs - } - return nil -} - -// AliveMessage is sent to inform remote peers -// of a peer's existence and activity -type AliveMessage struct { - Membership *Member `protobuf:"bytes,1,opt,name=membership,proto3" json:"membership,omitempty"` - Timestamp *PeerTime `protobuf:"bytes,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - Identity []byte `protobuf:"bytes,4,opt,name=identity,proto3" json:"identity,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *AliveMessage) Reset() { *m = AliveMessage{} } -func (m *AliveMessage) String() string { return proto.CompactTextString(m) } -func (*AliveMessage) ProtoMessage() {} -func (*AliveMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_24518b295636120e, []int{18} -} - -func (m *AliveMessage) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_AliveMessage.Unmarshal(m, b) -} -func (m *AliveMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_AliveMessage.Marshal(b, m, deterministic) -} -func (m *AliveMessage) XXX_Merge(src proto.Message) { - xxx_messageInfo_AliveMessage.Merge(m, src) -} -func (m *AliveMessage) XXX_Size() int { - return xxx_messageInfo_AliveMessage.Size(m) -} -func (m *AliveMessage) XXX_DiscardUnknown() { - xxx_messageInfo_AliveMessage.DiscardUnknown(m) -} - -var xxx_messageInfo_AliveMessage proto.InternalMessageInfo - -func (m *AliveMessage) GetMembership() *Member { - if m != nil { - return m.Membership - } - return nil -} - -func (m *AliveMessage) GetTimestamp() *PeerTime { - if m != nil { - return m.Timestamp - } - return nil -} - -func (m *AliveMessage) GetIdentity() []byte { - if m != nil { - return m.Identity - } - return nil -} - -// Leadership Message is sent during leader election to inform -// remote peers about intent of peer to proclaim itself as leader -type LeadershipMessage struct { - PkiId []byte `protobuf:"bytes,1,opt,name=pki_id,json=pkiId,proto3" json:"pki_id,omitempty"` - Timestamp *PeerTime `protobuf:"bytes,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - IsDeclaration bool `protobuf:"varint,3,opt,name=is_declaration,json=isDeclaration,proto3" json:"is_declaration,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *LeadershipMessage) Reset() { *m = LeadershipMessage{} } -func (m *LeadershipMessage) String() string { return proto.CompactTextString(m) } -func (*LeadershipMessage) ProtoMessage() {} -func (*LeadershipMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_24518b295636120e, []int{19} -} - -func (m *LeadershipMessage) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_LeadershipMessage.Unmarshal(m, b) -} -func (m *LeadershipMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_LeadershipMessage.Marshal(b, m, deterministic) -} -func (m *LeadershipMessage) XXX_Merge(src proto.Message) { - xxx_messageInfo_LeadershipMessage.Merge(m, src) -} -func (m *LeadershipMessage) XXX_Size() int { - return xxx_messageInfo_LeadershipMessage.Size(m) -} -func (m *LeadershipMessage) XXX_DiscardUnknown() { - xxx_messageInfo_LeadershipMessage.DiscardUnknown(m) -} - -var xxx_messageInfo_LeadershipMessage proto.InternalMessageInfo - -func (m *LeadershipMessage) GetPkiId() []byte { - if m != nil { - return m.PkiId - } - return nil -} - -func (m *LeadershipMessage) GetTimestamp() *PeerTime { - if m != nil { - return m.Timestamp - } - return nil -} - -func (m *LeadershipMessage) GetIsDeclaration() bool { - if m != nil { - return m.IsDeclaration - } - return false -} - -// PeerTime defines the logical time of a peer's life -type PeerTime struct { - IncNum uint64 `protobuf:"varint,1,opt,name=inc_num,json=incNum,proto3" json:"inc_num,omitempty"` - SeqNum uint64 `protobuf:"varint,2,opt,name=seq_num,json=seqNum,proto3" json:"seq_num,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *PeerTime) Reset() { *m = PeerTime{} } -func (m *PeerTime) String() string { return proto.CompactTextString(m) } -func (*PeerTime) ProtoMessage() {} -func (*PeerTime) Descriptor() ([]byte, []int) { - return fileDescriptor_24518b295636120e, []int{20} -} - -func (m *PeerTime) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_PeerTime.Unmarshal(m, b) -} -func (m *PeerTime) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_PeerTime.Marshal(b, m, deterministic) -} -func (m *PeerTime) XXX_Merge(src proto.Message) { - xxx_messageInfo_PeerTime.Merge(m, src) -} -func (m *PeerTime) XXX_Size() int { - return xxx_messageInfo_PeerTime.Size(m) -} -func (m *PeerTime) XXX_DiscardUnknown() { - xxx_messageInfo_PeerTime.DiscardUnknown(m) -} - -var xxx_messageInfo_PeerTime proto.InternalMessageInfo - -func (m *PeerTime) GetIncNum() uint64 { - if m != nil { - return m.IncNum - } - return 0 -} - -func (m *PeerTime) GetSeqNum() uint64 { - if m != nil { - return m.SeqNum - } - return 0 -} - -// MembershipRequest is used to ask membership information -// from a remote peer -type MembershipRequest struct { - SelfInformation *Envelope `protobuf:"bytes,1,opt,name=self_information,json=selfInformation,proto3" json:"self_information,omitempty"` - Known [][]byte `protobuf:"bytes,2,rep,name=known,proto3" json:"known,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MembershipRequest) Reset() { *m = MembershipRequest{} } -func (m *MembershipRequest) String() string { return proto.CompactTextString(m) } -func (*MembershipRequest) ProtoMessage() {} -func (*MembershipRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_24518b295636120e, []int{21} -} - -func (m *MembershipRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MembershipRequest.Unmarshal(m, b) -} -func (m *MembershipRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MembershipRequest.Marshal(b, m, deterministic) -} -func (m *MembershipRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_MembershipRequest.Merge(m, src) -} -func (m *MembershipRequest) XXX_Size() int { - return xxx_messageInfo_MembershipRequest.Size(m) -} -func (m *MembershipRequest) XXX_DiscardUnknown() { - xxx_messageInfo_MembershipRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_MembershipRequest proto.InternalMessageInfo - -func (m *MembershipRequest) GetSelfInformation() *Envelope { - if m != nil { - return m.SelfInformation - } - return nil -} - -func (m *MembershipRequest) GetKnown() [][]byte { - if m != nil { - return m.Known - } - return nil -} - -// MembershipResponse is used for replying to MembershipRequests -type MembershipResponse struct { - Alive []*Envelope `protobuf:"bytes,1,rep,name=alive,proto3" json:"alive,omitempty"` - Dead []*Envelope `protobuf:"bytes,2,rep,name=dead,proto3" json:"dead,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MembershipResponse) Reset() { *m = MembershipResponse{} } -func (m *MembershipResponse) String() string { return proto.CompactTextString(m) } -func (*MembershipResponse) ProtoMessage() {} -func (*MembershipResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_24518b295636120e, []int{22} -} - -func (m *MembershipResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MembershipResponse.Unmarshal(m, b) -} -func (m *MembershipResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MembershipResponse.Marshal(b, m, deterministic) -} -func (m *MembershipResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MembershipResponse.Merge(m, src) -} -func (m *MembershipResponse) XXX_Size() int { - return xxx_messageInfo_MembershipResponse.Size(m) -} -func (m *MembershipResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MembershipResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MembershipResponse proto.InternalMessageInfo - -func (m *MembershipResponse) GetAlive() []*Envelope { - if m != nil { - return m.Alive - } - return nil -} - -func (m *MembershipResponse) GetDead() []*Envelope { - if m != nil { - return m.Dead - } - return nil -} - -// Member holds membership-related information -// about a peer -type Member struct { - Endpoint string `protobuf:"bytes,1,opt,name=endpoint,proto3" json:"endpoint,omitempty"` - Metadata []byte `protobuf:"bytes,2,opt,name=metadata,proto3" json:"metadata,omitempty"` - PkiId []byte `protobuf:"bytes,3,opt,name=pki_id,json=pkiId,proto3" json:"pki_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Member) Reset() { *m = Member{} } -func (m *Member) String() string { return proto.CompactTextString(m) } -func (*Member) ProtoMessage() {} -func (*Member) Descriptor() ([]byte, []int) { - return fileDescriptor_24518b295636120e, []int{23} -} - -func (m *Member) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Member.Unmarshal(m, b) -} -func (m *Member) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Member.Marshal(b, m, deterministic) -} -func (m *Member) XXX_Merge(src proto.Message) { - xxx_messageInfo_Member.Merge(m, src) -} -func (m *Member) XXX_Size() int { - return xxx_messageInfo_Member.Size(m) -} -func (m *Member) XXX_DiscardUnknown() { - xxx_messageInfo_Member.DiscardUnknown(m) -} - -var xxx_messageInfo_Member proto.InternalMessageInfo - -func (m *Member) GetEndpoint() string { - if m != nil { - return m.Endpoint - } - return "" -} - -func (m *Member) GetMetadata() []byte { - if m != nil { - return m.Metadata - } - return nil -} - -func (m *Member) GetPkiId() []byte { - if m != nil { - return m.PkiId - } - return nil -} - -// Empty is used for pinging and in tests -type Empty struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Empty) Reset() { *m = Empty{} } -func (m *Empty) String() string { return proto.CompactTextString(m) } -func (*Empty) ProtoMessage() {} -func (*Empty) Descriptor() ([]byte, []int) { - return fileDescriptor_24518b295636120e, []int{24} -} - -func (m *Empty) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Empty.Unmarshal(m, b) -} -func (m *Empty) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Empty.Marshal(b, m, deterministic) -} -func (m *Empty) XXX_Merge(src proto.Message) { - xxx_messageInfo_Empty.Merge(m, src) -} -func (m *Empty) XXX_Size() int { - return xxx_messageInfo_Empty.Size(m) -} -func (m *Empty) XXX_DiscardUnknown() { - xxx_messageInfo_Empty.DiscardUnknown(m) -} - -var xxx_messageInfo_Empty proto.InternalMessageInfo - -// RemoteStateRequest is used to ask a set of blocks -// from a remote peer -type RemoteStateRequest struct { - StartSeqNum uint64 `protobuf:"varint,1,opt,name=start_seq_num,json=startSeqNum,proto3" json:"start_seq_num,omitempty"` - EndSeqNum uint64 `protobuf:"varint,2,opt,name=end_seq_num,json=endSeqNum,proto3" json:"end_seq_num,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *RemoteStateRequest) Reset() { *m = RemoteStateRequest{} } -func (m *RemoteStateRequest) String() string { return proto.CompactTextString(m) } -func (*RemoteStateRequest) ProtoMessage() {} -func (*RemoteStateRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_24518b295636120e, []int{25} -} - -func (m *RemoteStateRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_RemoteStateRequest.Unmarshal(m, b) -} -func (m *RemoteStateRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_RemoteStateRequest.Marshal(b, m, deterministic) -} -func (m *RemoteStateRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_RemoteStateRequest.Merge(m, src) -} -func (m *RemoteStateRequest) XXX_Size() int { - return xxx_messageInfo_RemoteStateRequest.Size(m) -} -func (m *RemoteStateRequest) XXX_DiscardUnknown() { - xxx_messageInfo_RemoteStateRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_RemoteStateRequest proto.InternalMessageInfo - -func (m *RemoteStateRequest) GetStartSeqNum() uint64 { - if m != nil { - return m.StartSeqNum - } - return 0 -} - -func (m *RemoteStateRequest) GetEndSeqNum() uint64 { - if m != nil { - return m.EndSeqNum - } - return 0 -} - -// RemoteStateResponse is used to send a set of blocks -// to a remote peer -type RemoteStateResponse struct { - Payloads []*Payload `protobuf:"bytes,1,rep,name=payloads,proto3" json:"payloads,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *RemoteStateResponse) Reset() { *m = RemoteStateResponse{} } -func (m *RemoteStateResponse) String() string { return proto.CompactTextString(m) } -func (*RemoteStateResponse) ProtoMessage() {} -func (*RemoteStateResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_24518b295636120e, []int{26} -} - -func (m *RemoteStateResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_RemoteStateResponse.Unmarshal(m, b) -} -func (m *RemoteStateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_RemoteStateResponse.Marshal(b, m, deterministic) -} -func (m *RemoteStateResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_RemoteStateResponse.Merge(m, src) -} -func (m *RemoteStateResponse) XXX_Size() int { - return xxx_messageInfo_RemoteStateResponse.Size(m) -} -func (m *RemoteStateResponse) XXX_DiscardUnknown() { - xxx_messageInfo_RemoteStateResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_RemoteStateResponse proto.InternalMessageInfo - -func (m *RemoteStateResponse) GetPayloads() []*Payload { - if m != nil { - return m.Payloads - } - return nil -} - -// RemotePrivateDataRequest message used to request -// missing private rwset -type RemotePvtDataRequest struct { - Digests []*PvtDataDigest `protobuf:"bytes,1,rep,name=digests,proto3" json:"digests,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *RemotePvtDataRequest) Reset() { *m = RemotePvtDataRequest{} } -func (m *RemotePvtDataRequest) String() string { return proto.CompactTextString(m) } -func (*RemotePvtDataRequest) ProtoMessage() {} -func (*RemotePvtDataRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_24518b295636120e, []int{27} -} - -func (m *RemotePvtDataRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_RemotePvtDataRequest.Unmarshal(m, b) -} -func (m *RemotePvtDataRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_RemotePvtDataRequest.Marshal(b, m, deterministic) -} -func (m *RemotePvtDataRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_RemotePvtDataRequest.Merge(m, src) -} -func (m *RemotePvtDataRequest) XXX_Size() int { - return xxx_messageInfo_RemotePvtDataRequest.Size(m) -} -func (m *RemotePvtDataRequest) XXX_DiscardUnknown() { - xxx_messageInfo_RemotePvtDataRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_RemotePvtDataRequest proto.InternalMessageInfo - -func (m *RemotePvtDataRequest) GetDigests() []*PvtDataDigest { - if m != nil { - return m.Digests - } - return nil -} - -// PvtDataDigest defines a digest of private data -type PvtDataDigest struct { - TxId string `protobuf:"bytes,1,opt,name=tx_id,json=txId,proto3" json:"tx_id,omitempty"` - Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"` - Collection string `protobuf:"bytes,3,opt,name=collection,proto3" json:"collection,omitempty"` - BlockSeq uint64 `protobuf:"varint,4,opt,name=block_seq,json=blockSeq,proto3" json:"block_seq,omitempty"` - SeqInBlock uint64 `protobuf:"varint,5,opt,name=seq_in_block,json=seqInBlock,proto3" json:"seq_in_block,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *PvtDataDigest) Reset() { *m = PvtDataDigest{} } -func (m *PvtDataDigest) String() string { return proto.CompactTextString(m) } -func (*PvtDataDigest) ProtoMessage() {} -func (*PvtDataDigest) Descriptor() ([]byte, []int) { - return fileDescriptor_24518b295636120e, []int{28} -} - -func (m *PvtDataDigest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_PvtDataDigest.Unmarshal(m, b) -} -func (m *PvtDataDigest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_PvtDataDigest.Marshal(b, m, deterministic) -} -func (m *PvtDataDigest) XXX_Merge(src proto.Message) { - xxx_messageInfo_PvtDataDigest.Merge(m, src) -} -func (m *PvtDataDigest) XXX_Size() int { - return xxx_messageInfo_PvtDataDigest.Size(m) -} -func (m *PvtDataDigest) XXX_DiscardUnknown() { - xxx_messageInfo_PvtDataDigest.DiscardUnknown(m) -} - -var xxx_messageInfo_PvtDataDigest proto.InternalMessageInfo - -func (m *PvtDataDigest) GetTxId() string { - if m != nil { - return m.TxId - } - return "" -} - -func (m *PvtDataDigest) GetNamespace() string { - if m != nil { - return m.Namespace - } - return "" -} - -func (m *PvtDataDigest) GetCollection() string { - if m != nil { - return m.Collection - } - return "" -} - -func (m *PvtDataDigest) GetBlockSeq() uint64 { - if m != nil { - return m.BlockSeq - } - return 0 -} - -func (m *PvtDataDigest) GetSeqInBlock() uint64 { - if m != nil { - return m.SeqInBlock - } - return 0 -} - -// RemotePrivateData message to response on private -// data replication request -type RemotePvtDataResponse struct { - Elements []*PvtDataElement `protobuf:"bytes,1,rep,name=elements,proto3" json:"elements,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *RemotePvtDataResponse) Reset() { *m = RemotePvtDataResponse{} } -func (m *RemotePvtDataResponse) String() string { return proto.CompactTextString(m) } -func (*RemotePvtDataResponse) ProtoMessage() {} -func (*RemotePvtDataResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_24518b295636120e, []int{29} -} - -func (m *RemotePvtDataResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_RemotePvtDataResponse.Unmarshal(m, b) -} -func (m *RemotePvtDataResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_RemotePvtDataResponse.Marshal(b, m, deterministic) -} -func (m *RemotePvtDataResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_RemotePvtDataResponse.Merge(m, src) -} -func (m *RemotePvtDataResponse) XXX_Size() int { - return xxx_messageInfo_RemotePvtDataResponse.Size(m) -} -func (m *RemotePvtDataResponse) XXX_DiscardUnknown() { - xxx_messageInfo_RemotePvtDataResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_RemotePvtDataResponse proto.InternalMessageInfo - -func (m *RemotePvtDataResponse) GetElements() []*PvtDataElement { - if m != nil { - return m.Elements - } - return nil -} - -type PvtDataElement struct { - Digest *PvtDataDigest `protobuf:"bytes,1,opt,name=digest,proto3" json:"digest,omitempty"` - // the payload is a marshaled kvrwset.KVRWSet - Payload [][]byte `protobuf:"bytes,2,rep,name=payload,proto3" json:"payload,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *PvtDataElement) Reset() { *m = PvtDataElement{} } -func (m *PvtDataElement) String() string { return proto.CompactTextString(m) } -func (*PvtDataElement) ProtoMessage() {} -func (*PvtDataElement) Descriptor() ([]byte, []int) { - return fileDescriptor_24518b295636120e, []int{30} -} - -func (m *PvtDataElement) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_PvtDataElement.Unmarshal(m, b) -} -func (m *PvtDataElement) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_PvtDataElement.Marshal(b, m, deterministic) -} -func (m *PvtDataElement) XXX_Merge(src proto.Message) { - xxx_messageInfo_PvtDataElement.Merge(m, src) -} -func (m *PvtDataElement) XXX_Size() int { - return xxx_messageInfo_PvtDataElement.Size(m) -} -func (m *PvtDataElement) XXX_DiscardUnknown() { - xxx_messageInfo_PvtDataElement.DiscardUnknown(m) -} - -var xxx_messageInfo_PvtDataElement proto.InternalMessageInfo - -func (m *PvtDataElement) GetDigest() *PvtDataDigest { - if m != nil { - return m.Digest - } - return nil -} - -func (m *PvtDataElement) GetPayload() [][]byte { - if m != nil { - return m.Payload - } - return nil -} - -// PvtPayload augments private rwset data and tx index -// inside the block -type PvtDataPayload struct { - TxSeqInBlock uint64 `protobuf:"varint,1,opt,name=tx_seq_in_block,json=txSeqInBlock,proto3" json:"tx_seq_in_block,omitempty"` - // Encodes marhslaed bytes of rwset.TxPvtReadWriteSet - // defined in rwset.proto - Payload []byte `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *PvtDataPayload) Reset() { *m = PvtDataPayload{} } -func (m *PvtDataPayload) String() string { return proto.CompactTextString(m) } -func (*PvtDataPayload) ProtoMessage() {} -func (*PvtDataPayload) Descriptor() ([]byte, []int) { - return fileDescriptor_24518b295636120e, []int{31} -} - -func (m *PvtDataPayload) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_PvtDataPayload.Unmarshal(m, b) -} -func (m *PvtDataPayload) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_PvtDataPayload.Marshal(b, m, deterministic) -} -func (m *PvtDataPayload) XXX_Merge(src proto.Message) { - xxx_messageInfo_PvtDataPayload.Merge(m, src) -} -func (m *PvtDataPayload) XXX_Size() int { - return xxx_messageInfo_PvtDataPayload.Size(m) -} -func (m *PvtDataPayload) XXX_DiscardUnknown() { - xxx_messageInfo_PvtDataPayload.DiscardUnknown(m) -} - -var xxx_messageInfo_PvtDataPayload proto.InternalMessageInfo - -func (m *PvtDataPayload) GetTxSeqInBlock() uint64 { - if m != nil { - return m.TxSeqInBlock - } - return 0 -} - -func (m *PvtDataPayload) GetPayload() []byte { - if m != nil { - return m.Payload - } - return nil -} - -type Acknowledgement struct { - Error string `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Acknowledgement) Reset() { *m = Acknowledgement{} } -func (m *Acknowledgement) String() string { return proto.CompactTextString(m) } -func (*Acknowledgement) ProtoMessage() {} -func (*Acknowledgement) Descriptor() ([]byte, []int) { - return fileDescriptor_24518b295636120e, []int{32} -} - -func (m *Acknowledgement) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Acknowledgement.Unmarshal(m, b) -} -func (m *Acknowledgement) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Acknowledgement.Marshal(b, m, deterministic) -} -func (m *Acknowledgement) XXX_Merge(src proto.Message) { - xxx_messageInfo_Acknowledgement.Merge(m, src) -} -func (m *Acknowledgement) XXX_Size() int { - return xxx_messageInfo_Acknowledgement.Size(m) -} -func (m *Acknowledgement) XXX_DiscardUnknown() { - xxx_messageInfo_Acknowledgement.DiscardUnknown(m) -} - -var xxx_messageInfo_Acknowledgement proto.InternalMessageInfo - -func (m *Acknowledgement) GetError() string { - if m != nil { - return m.Error - } - return "" -} - -// Chaincode represents a Chaincode that is installed -// on a peer -type Chaincode struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` - Metadata []byte `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Chaincode) Reset() { *m = Chaincode{} } -func (m *Chaincode) String() string { return proto.CompactTextString(m) } -func (*Chaincode) ProtoMessage() {} -func (*Chaincode) Descriptor() ([]byte, []int) { - return fileDescriptor_24518b295636120e, []int{33} -} - -func (m *Chaincode) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Chaincode.Unmarshal(m, b) -} -func (m *Chaincode) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Chaincode.Marshal(b, m, deterministic) -} -func (m *Chaincode) XXX_Merge(src proto.Message) { - xxx_messageInfo_Chaincode.Merge(m, src) -} -func (m *Chaincode) XXX_Size() int { - return xxx_messageInfo_Chaincode.Size(m) -} -func (m *Chaincode) XXX_DiscardUnknown() { - xxx_messageInfo_Chaincode.DiscardUnknown(m) -} - -var xxx_messageInfo_Chaincode proto.InternalMessageInfo - -func (m *Chaincode) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *Chaincode) GetVersion() string { - if m != nil { - return m.Version - } - return "" -} - -func (m *Chaincode) GetMetadata() []byte { - if m != nil { - return m.Metadata - } - return nil -} - -func init() { - proto.RegisterEnum("gossip.PullMsgType", PullMsgType_name, PullMsgType_value) - proto.RegisterEnum("gossip.GossipMessage_Tag", GossipMessage_Tag_name, GossipMessage_Tag_value) - proto.RegisterType((*Envelope)(nil), "gossip.Envelope") - proto.RegisterType((*SecretEnvelope)(nil), "gossip.SecretEnvelope") - proto.RegisterType((*Secret)(nil), "gossip.Secret") - proto.RegisterType((*GossipMessage)(nil), "gossip.GossipMessage") - proto.RegisterType((*StateInfo)(nil), "gossip.StateInfo") - proto.RegisterType((*Properties)(nil), "gossip.Properties") - proto.RegisterType((*StateInfoSnapshot)(nil), "gossip.StateInfoSnapshot") - proto.RegisterType((*StateInfoPullRequest)(nil), "gossip.StateInfoPullRequest") - proto.RegisterType((*ConnEstablish)(nil), "gossip.ConnEstablish") - proto.RegisterType((*PeerIdentity)(nil), "gossip.PeerIdentity") - proto.RegisterType((*DataRequest)(nil), "gossip.DataRequest") - proto.RegisterType((*GossipHello)(nil), "gossip.GossipHello") - proto.RegisterType((*DataUpdate)(nil), "gossip.DataUpdate") - proto.RegisterType((*DataDigest)(nil), "gossip.DataDigest") - proto.RegisterType((*DataMessage)(nil), "gossip.DataMessage") - proto.RegisterType((*PrivateDataMessage)(nil), "gossip.PrivateDataMessage") - proto.RegisterType((*Payload)(nil), "gossip.Payload") - proto.RegisterType((*PrivatePayload)(nil), "gossip.PrivatePayload") - proto.RegisterType((*AliveMessage)(nil), "gossip.AliveMessage") - proto.RegisterType((*LeadershipMessage)(nil), "gossip.LeadershipMessage") - proto.RegisterType((*PeerTime)(nil), "gossip.PeerTime") - proto.RegisterType((*MembershipRequest)(nil), "gossip.MembershipRequest") - proto.RegisterType((*MembershipResponse)(nil), "gossip.MembershipResponse") - proto.RegisterType((*Member)(nil), "gossip.Member") - proto.RegisterType((*Empty)(nil), "gossip.Empty") - proto.RegisterType((*RemoteStateRequest)(nil), "gossip.RemoteStateRequest") - proto.RegisterType((*RemoteStateResponse)(nil), "gossip.RemoteStateResponse") - proto.RegisterType((*RemotePvtDataRequest)(nil), "gossip.RemotePvtDataRequest") - proto.RegisterType((*PvtDataDigest)(nil), "gossip.PvtDataDigest") - proto.RegisterType((*RemotePvtDataResponse)(nil), "gossip.RemotePvtDataResponse") - proto.RegisterType((*PvtDataElement)(nil), "gossip.PvtDataElement") - proto.RegisterType((*PvtDataPayload)(nil), "gossip.PvtDataPayload") - proto.RegisterType((*Acknowledgement)(nil), "gossip.Acknowledgement") - proto.RegisterType((*Chaincode)(nil), "gossip.Chaincode") -} - -func init() { proto.RegisterFile("gossip/message.proto", fileDescriptor_24518b295636120e) } - -var fileDescriptor_24518b295636120e = []byte{ - // 1895 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x58, 0x5b, 0x53, 0xe3, 0xc8, - 0x15, 0x46, 0xe0, 0xeb, 0xf1, 0x05, 0xd3, 0xc0, 0x8c, 0x96, 0xdd, 0xec, 0xb2, 0xca, 0x4e, 0x76, - 0x92, 0x99, 0x31, 0x13, 0x36, 0xb7, 0xaa, 0x4d, 0x32, 0x05, 0xb6, 0x17, 0xbb, 0x76, 0xec, 0x21, - 0x82, 0x49, 0x42, 0x5e, 0x54, 0x8d, 0xd4, 0xc8, 0x2a, 0xa4, 0x96, 0x50, 0x37, 0x2c, 0x54, 0xe5, - 0x25, 0x95, 0x87, 0xad, 0xca, 0x4b, 0x7e, 0x43, 0x9e, 0xf2, 0x37, 0x53, 0xdd, 0xad, 0xab, 0x0d, - 0x54, 0xcd, 0x54, 0xe5, 0xcd, 0xe7, 0xde, 0x7d, 0xfa, 0x9c, 0xef, 0x1c, 0x19, 0xb6, 0xdc, 0x90, - 0x31, 0x2f, 0xda, 0x0b, 0x08, 0x63, 0xd8, 0x25, 0xfd, 0x28, 0x0e, 0x79, 0x88, 0x6a, 0x8a, 0xbb, - 0xb3, 0x1d, 0x11, 0x12, 0xef, 0xd9, 0xa1, 0xef, 0x13, 0x9b, 0x7b, 0x21, 0x55, 0x62, 0xe3, 0x9f, - 0x1a, 0x34, 0x46, 0xf4, 0x86, 0xf8, 0x61, 0x44, 0x90, 0x0e, 0xf5, 0x08, 0xdf, 0xf9, 0x21, 0x76, - 0x74, 0x6d, 0x57, 0x7b, 0xde, 0x36, 0x53, 0x12, 0x7d, 0x06, 0x4d, 0xe6, 0xb9, 0x14, 0xf3, 0xeb, - 0x98, 0xe8, 0xab, 0x52, 0x96, 0x33, 0xd0, 0x1b, 0x58, 0x67, 0xc4, 0x8e, 0x09, 0xb7, 0x48, 0xe2, - 0x4a, 0x5f, 0xdb, 0xd5, 0x9e, 0xb7, 0xf6, 0x9f, 0xf4, 0x55, 0xf4, 0xfe, 0x89, 0x14, 0xa7, 0x81, - 0xcc, 0x2e, 0x2b, 0xd1, 0xc6, 0x18, 0xba, 0x65, 0x8d, 0x8f, 0x3d, 0x8a, 0x71, 0x00, 0x35, 0xe5, - 0x09, 0xbd, 0x84, 0x9e, 0x47, 0x39, 0x89, 0x29, 0xf6, 0x47, 0xd4, 0x89, 0x42, 0x8f, 0x72, 0xe9, - 0xaa, 0x39, 0x5e, 0x31, 0x97, 0x24, 0x87, 0x4d, 0xa8, 0xdb, 0x21, 0xe5, 0x84, 0x72, 0xe3, 0xc7, - 0x16, 0x74, 0x8e, 0xe4, 0xb1, 0xa7, 0x2a, 0x93, 0x68, 0x0b, 0xaa, 0x34, 0xa4, 0x36, 0x91, 0xf6, - 0x15, 0x53, 0x11, 0xe2, 0x88, 0xf6, 0x1c, 0x53, 0x4a, 0xfc, 0xe4, 0x18, 0x29, 0x89, 0x5e, 0xc0, - 0x1a, 0xc7, 0xae, 0xcc, 0x41, 0x77, 0xff, 0x93, 0x34, 0x07, 0x25, 0x9f, 0xfd, 0x53, 0xec, 0x9a, - 0x42, 0x0b, 0x7d, 0x03, 0x4d, 0xec, 0x7b, 0x37, 0xc4, 0x0a, 0x98, 0xab, 0x57, 0x65, 0xda, 0xb6, - 0x52, 0x93, 0x03, 0x21, 0x48, 0x2c, 0xc6, 0x2b, 0x66, 0x43, 0x2a, 0x4e, 0x99, 0x8b, 0x7e, 0x05, - 0xf5, 0x80, 0x04, 0x56, 0x4c, 0xae, 0xf4, 0x9a, 0x34, 0xc9, 0xa2, 0x4c, 0x49, 0x70, 0x4e, 0x62, - 0x36, 0xf7, 0x22, 0x93, 0x5c, 0x5d, 0x13, 0xc6, 0xc7, 0x2b, 0x66, 0x2d, 0x20, 0x81, 0x49, 0xae, - 0xd0, 0xaf, 0x53, 0x2b, 0xa6, 0xd7, 0xa5, 0xd5, 0xce, 0x7d, 0x56, 0x2c, 0x0a, 0x29, 0x23, 0x99, - 0x19, 0x43, 0xaf, 0xa1, 0xe1, 0x60, 0x8e, 0xe5, 0x01, 0x1b, 0xd2, 0x6e, 0x33, 0xb5, 0x1b, 0x62, - 0x8e, 0xf3, 0xf3, 0xd5, 0x85, 0x9a, 0x38, 0xde, 0x0b, 0xa8, 0xce, 0x89, 0xef, 0x87, 0x7a, 0xb3, - 0xac, 0xae, 0x52, 0x30, 0x16, 0xa2, 0xf1, 0x8a, 0xa9, 0x74, 0xd0, 0x5e, 0xe2, 0xde, 0xf1, 0x5c, - 0x1d, 0xa4, 0x3e, 0x2a, 0xba, 0x1f, 0x7a, 0xae, 0xba, 0x85, 0xf4, 0x3e, 0xf4, 0xdc, 0xec, 0x3c, - 0xe2, 0xf6, 0xad, 0xe5, 0xf3, 0xe4, 0xf7, 0x96, 0x16, 0xea, 0xe2, 0x2d, 0x69, 0x71, 0x1d, 0x39, - 0x98, 0x13, 0xbd, 0xbd, 0x1c, 0xe5, 0xbd, 0x94, 0x8c, 0x57, 0x4c, 0x70, 0x32, 0x0a, 0x3d, 0x83, - 0x2a, 0x09, 0x22, 0x7e, 0xa7, 0x77, 0xa4, 0x41, 0x27, 0x35, 0x18, 0x09, 0xa6, 0xb8, 0x80, 0x94, - 0xa2, 0x17, 0x50, 0xb1, 0x43, 0x4a, 0xf5, 0xae, 0xd4, 0xda, 0x4e, 0xb5, 0x06, 0x21, 0xa5, 0x23, - 0xc6, 0xf1, 0xb9, 0xef, 0xb1, 0xf9, 0x78, 0xc5, 0x94, 0x4a, 0x68, 0x1f, 0x80, 0x71, 0xcc, 0x89, - 0xe5, 0xd1, 0x8b, 0x50, 0x5f, 0x97, 0x26, 0x1b, 0x59, 0x9b, 0x08, 0xc9, 0x84, 0x5e, 0x88, 0xec, - 0x34, 0x59, 0x4a, 0xa0, 0x43, 0xe8, 0x2a, 0x1b, 0x46, 0x71, 0xc4, 0xe6, 0x21, 0xd7, 0x7b, 0xe5, - 0x47, 0xcf, 0xec, 0x4e, 0x12, 0x85, 0xf1, 0x8a, 0xd9, 0x91, 0x26, 0x29, 0x03, 0x4d, 0x61, 0x33, - 0x8f, 0x6b, 0x45, 0xd7, 0xbe, 0x2f, 0xf3, 0xb7, 0x21, 0x1d, 0x7d, 0xb6, 0xe4, 0xe8, 0xf8, 0xda, - 0xf7, 0xf3, 0x44, 0xf6, 0xd8, 0x02, 0x1f, 0x1d, 0x80, 0xf2, 0x2f, 0x9c, 0x08, 0x25, 0x1d, 0x95, - 0x0b, 0xca, 0x24, 0x41, 0xc8, 0x89, 0x74, 0x97, 0xbb, 0x69, 0xb3, 0x02, 0x8d, 0x86, 0xe9, 0xad, - 0xe2, 0xa4, 0xe4, 0xf4, 0x4d, 0xe9, 0xe3, 0xd3, 0x7b, 0x7d, 0x64, 0x55, 0xd9, 0x61, 0x45, 0x86, - 0xc8, 0x8d, 0x4f, 0xb0, 0xa3, 0x8a, 0x57, 0x96, 0xe8, 0x56, 0x39, 0x37, 0x6f, 0x33, 0x69, 0x5e, - 0xa8, 0x9d, 0xdc, 0x44, 0x94, 0xeb, 0xb7, 0xd0, 0x11, 0xe8, 0x68, 0x79, 0x0e, 0xa1, 0xdc, 0xe3, - 0x77, 0xfa, 0x76, 0xb9, 0x0d, 0x8f, 0x09, 0x89, 0x27, 0x89, 0x4c, 0x5c, 0x23, 0x2a, 0xd0, 0xa2, - 0xd9, 0xb1, 0x7d, 0xa9, 0x3f, 0x91, 0x26, 0x4f, 0xb3, 0xce, 0xb5, 0x2f, 0x69, 0xf8, 0x83, 0x4f, - 0x1c, 0x97, 0x04, 0x84, 0x8a, 0xcb, 0x0b, 0x2d, 0xf4, 0x47, 0x80, 0x28, 0xf6, 0x6e, 0x54, 0x16, - 0xf4, 0xa7, 0xe5, 0xe4, 0xab, 0xfb, 0x1e, 0xdf, 0xf0, 0x72, 0x15, 0x17, 0x2c, 0xd0, 0x9b, 0x82, - 0x3d, 0xd3, 0x75, 0x69, 0xff, 0x93, 0x07, 0xec, 0xb3, 0x8c, 0x15, 0x4c, 0xd0, 0x1b, 0x68, 0x27, - 0x94, 0x25, 0x0a, 0x5d, 0xff, 0xa4, 0xfc, 0x6c, 0xc7, 0x4a, 0x56, 0x6e, 0xeb, 0x56, 0x94, 0x73, - 0x0d, 0x0b, 0xd6, 0x4e, 0xb1, 0x8b, 0x3a, 0xd0, 0x7c, 0x3f, 0x1b, 0x8e, 0xbe, 0x9b, 0xcc, 0x46, - 0xc3, 0xde, 0x0a, 0x6a, 0x42, 0x75, 0x34, 0x3d, 0x3e, 0x3d, 0xeb, 0x69, 0xa8, 0x0d, 0x8d, 0x77, - 0xe6, 0x91, 0xf5, 0x6e, 0xf6, 0xf6, 0xac, 0xb7, 0x2a, 0xf4, 0x06, 0xe3, 0x83, 0x99, 0x22, 0xd7, - 0x50, 0x0f, 0xda, 0x92, 0x3c, 0x98, 0x0d, 0xad, 0x77, 0xe6, 0x51, 0xaf, 0x82, 0xd6, 0xa1, 0xa5, - 0x14, 0x4c, 0xc9, 0xa8, 0x16, 0x91, 0xf8, 0xbf, 0x1a, 0x34, 0xb3, 0x8a, 0x44, 0x7d, 0x68, 0x72, - 0x2f, 0x20, 0x8c, 0xe3, 0x20, 0x92, 0x88, 0xdb, 0xda, 0xef, 0x15, 0x5f, 0xe8, 0xd4, 0x0b, 0x88, - 0x99, 0xab, 0xa0, 0x6d, 0xa8, 0x45, 0x97, 0x9e, 0xe5, 0x39, 0x12, 0x88, 0xdb, 0x66, 0x35, 0xba, - 0xf4, 0x26, 0x0e, 0xfa, 0x02, 0x5a, 0x09, 0x4e, 0x5b, 0xd3, 0x83, 0x81, 0x5e, 0x91, 0x32, 0x48, - 0x58, 0xd3, 0x83, 0x81, 0xe8, 0xd0, 0x28, 0x0e, 0x23, 0x12, 0x73, 0x8f, 0xb0, 0x04, 0x91, 0x51, - 0x9e, 0xa0, 0x54, 0x62, 0x16, 0xb4, 0x8c, 0x1f, 0x35, 0x80, 0x5c, 0x84, 0x7e, 0x0a, 0x1d, 0xf9, - 0xf4, 0xb1, 0x35, 0x27, 0x9e, 0x3b, 0xe7, 0xc9, 0xe0, 0x68, 0x2b, 0xe6, 0x58, 0xf2, 0xd0, 0x97, - 0xd0, 0xf6, 0xc9, 0x05, 0xb7, 0x8a, 0x43, 0xa4, 0x61, 0xb6, 0x04, 0x6f, 0x90, 0x0c, 0x92, 0x5f, - 0x82, 0x38, 0x98, 0x47, 0xed, 0xd0, 0x21, 0x4c, 0x5f, 0xdb, 0x5d, 0x2b, 0x82, 0xc5, 0x20, 0x95, - 0x98, 0x05, 0x25, 0xe3, 0x00, 0x36, 0x96, 0xd0, 0x00, 0xbd, 0x84, 0x06, 0xf1, 0x65, 0x21, 0x32, - 0x5d, 0x93, 0x5e, 0xb2, 0xcc, 0x65, 0x33, 0x39, 0xd3, 0x30, 0x7e, 0x0b, 0x5b, 0xf7, 0xe1, 0xc0, - 0x62, 0xe6, 0xb4, 0xc5, 0xcc, 0x19, 0x7f, 0x87, 0x4e, 0x09, 0xf4, 0x0a, 0x4f, 0xa0, 0x15, 0x9f, - 0x60, 0x07, 0x1a, 0x59, 0xab, 0xa9, 0xd1, 0x99, 0xd1, 0xc8, 0x80, 0x0e, 0xf7, 0x99, 0x65, 0x93, - 0x98, 0x5b, 0x73, 0xcc, 0xe6, 0xc9, 0xe3, 0xb5, 0xb8, 0xcf, 0x06, 0x24, 0xe6, 0x63, 0xcc, 0xe6, - 0x62, 0x1e, 0x47, 0x71, 0x78, 0x4e, 0xe4, 0xe3, 0x35, 0x4c, 0x45, 0x18, 0xef, 0xa1, 0x5d, 0x6c, - 0xd4, 0x87, 0x82, 0x23, 0xa8, 0x08, 0xe7, 0x49, 0x60, 0xf9, 0x5b, 0x1c, 0x28, 0x20, 0x1c, 0xcb, - 0x8e, 0x50, 0xf1, 0x32, 0xda, 0x08, 0xa0, 0x55, 0xe8, 0xc7, 0x87, 0x77, 0x01, 0x47, 0xce, 0x29, - 0xa6, 0xaf, 0xee, 0xae, 0x89, 0x5d, 0x20, 0x21, 0x51, 0x1f, 0x1a, 0x01, 0x73, 0x2d, 0x7e, 0x97, - 0x2c, 0x45, 0xdd, 0x7c, 0x58, 0x89, 0xdc, 0x4e, 0x99, 0x7b, 0x7a, 0x17, 0x11, 0xb3, 0x1e, 0xa8, - 0x1f, 0x46, 0x08, 0xad, 0xc2, 0x94, 0x7c, 0x20, 0x5c, 0xf1, 0xbc, 0xab, 0xe5, 0xf3, 0x7e, 0x70, - 0xc0, 0x5b, 0x80, 0x7c, 0x00, 0x3e, 0x10, 0xef, 0x2b, 0xa8, 0x24, 0xb1, 0xee, 0xaf, 0x9d, 0xca, - 0x47, 0x45, 0xf6, 0x55, 0x64, 0x35, 0xe0, 0xff, 0xef, 0x89, 0xfd, 0x9d, 0x7a, 0xc7, 0x74, 0xa7, - 0xfb, 0x79, 0x79, 0xc1, 0x6c, 0xed, 0xaf, 0x67, 0xd6, 0x8a, 0x9d, 0x6d, 0x9c, 0xc6, 0x77, 0x80, - 0x96, 0x71, 0x11, 0xbd, 0x5e, 0x74, 0xf0, 0x64, 0x01, 0x44, 0x97, 0xfc, 0x9c, 0x41, 0x3d, 0xe1, - 0xa1, 0xa7, 0x50, 0x67, 0xe4, 0xca, 0xa2, 0xd7, 0x41, 0x72, 0xdd, 0x1a, 0x23, 0x57, 0xb3, 0xeb, - 0x40, 0x54, 0x67, 0xe1, 0x55, 0x55, 0x5e, 0xbf, 0x5c, 0xc0, 0xec, 0x35, 0x99, 0x88, 0x12, 0x2a, - 0xff, 0x7b, 0x15, 0xba, 0xe5, 0xb0, 0xe8, 0x6b, 0x58, 0xcf, 0xb7, 0x7d, 0x8b, 0xe2, 0x40, 0x65, - 0xb6, 0x69, 0x76, 0x73, 0xf6, 0x0c, 0x07, 0x44, 0x2c, 0xd4, 0x42, 0xca, 0x22, 0x6c, 0xab, 0x85, - 0xba, 0x69, 0xe6, 0x0c, 0xb4, 0x09, 0x55, 0x7e, 0x9b, 0x82, 0x68, 0xd3, 0xac, 0xf0, 0xdb, 0x89, - 0x23, 0xf0, 0x2d, 0x3d, 0x51, 0xfc, 0x03, 0x23, 0x3c, 0x41, 0xd1, 0xf4, 0x98, 0xa6, 0xe0, 0xa1, - 0x97, 0x80, 0x52, 0x25, 0xe6, 0x05, 0x29, 0x12, 0x56, 0xe5, 0x75, 0x7b, 0x89, 0xe4, 0xc4, 0x0b, - 0x12, 0x34, 0x9c, 0x01, 0x2a, 0x1c, 0xd7, 0x0e, 0xe9, 0x85, 0xe7, 0xb2, 0x64, 0xb9, 0xfd, 0x42, - 0x7d, 0xac, 0xb0, 0xfe, 0x20, 0xd3, 0x18, 0x48, 0x85, 0x63, 0x6c, 0x5f, 0x62, 0x97, 0x98, 0x1b, - 0xf6, 0x82, 0x80, 0x19, 0xff, 0xd2, 0xa0, 0x5d, 0x5c, 0x9f, 0x51, 0x1f, 0x20, 0xc8, 0xb6, 0xdc, - 0xe4, 0xc9, 0xba, 0xe5, 0xfd, 0xd7, 0x2c, 0x68, 0x7c, 0xf0, 0xb8, 0x29, 0x82, 0x5a, 0xa5, 0x0c, - 0x6a, 0xc6, 0x3f, 0x34, 0xd8, 0x58, 0xda, 0x43, 0x1e, 0x02, 0xa8, 0x0f, 0x0d, 0xfc, 0x0c, 0xba, - 0x1e, 0xb3, 0x1c, 0x62, 0xfb, 0x38, 0xc6, 0x22, 0x05, 0xf2, 0xa9, 0x1a, 0x66, 0xc7, 0x63, 0xc3, - 0x9c, 0x69, 0xfc, 0x1e, 0x1a, 0xa9, 0xb5, 0x28, 0x3f, 0x8f, 0xda, 0xc5, 0xf2, 0xf3, 0xa8, 0x2d, - 0xca, 0xaf, 0x50, 0x97, 0xab, 0xc5, 0xba, 0x34, 0x2e, 0x60, 0x63, 0xe9, 0xcb, 0x02, 0x7d, 0x0b, - 0x3d, 0x46, 0xfc, 0x0b, 0xb9, 0x52, 0xc6, 0x81, 0x8a, 0xad, 0x95, 0x0f, 0x9c, 0x41, 0xc4, 0xba, - 0xd0, 0x9c, 0xe4, 0x8a, 0xa2, 0xdf, 0xc5, 0x8a, 0x44, 0x93, 0xbe, 0x56, 0x84, 0x71, 0x0e, 0x68, - 0xf9, 0x5b, 0x04, 0xfd, 0x0c, 0xaa, 0xf2, 0xd3, 0xe7, 0xc1, 0xe1, 0xa5, 0xc4, 0x12, 0xa7, 0x08, - 0x76, 0x1e, 0xc1, 0x29, 0x82, 0x1d, 0xe3, 0x2f, 0x50, 0x53, 0x31, 0xc4, 0x9b, 0x91, 0xd2, 0xb7, - 0xa1, 0x99, 0xd1, 0x8f, 0x62, 0xec, 0xfd, 0xab, 0x85, 0x51, 0x87, 0xaa, 0xfc, 0x34, 0x30, 0xfe, - 0x0a, 0x68, 0x79, 0x01, 0x16, 0xa3, 0x8d, 0x71, 0x1c, 0x73, 0xab, 0xdc, 0xfa, 0x2d, 0xc9, 0x3c, - 0x51, 0xfd, 0xff, 0x39, 0xb4, 0x08, 0x75, 0xac, 0xf2, 0x23, 0x34, 0x09, 0x75, 0x94, 0xdc, 0x38, - 0x84, 0xcd, 0x7b, 0xd6, 0x62, 0xf4, 0x02, 0x1a, 0x09, 0xca, 0xa4, 0x03, 0x7e, 0x09, 0xce, 0x32, - 0x05, 0xe3, 0x08, 0xb6, 0xee, 0x5b, 0x35, 0xd1, 0x5e, 0x8e, 0xb5, 0xca, 0x47, 0xf6, 0x29, 0x93, - 0x28, 0x2a, 0xa4, 0xce, 0x20, 0xd8, 0xf8, 0x8f, 0x06, 0x9d, 0x92, 0x28, 0x47, 0x0b, 0xad, 0x80, - 0x16, 0x8f, 0x03, 0xcc, 0xe7, 0x00, 0x79, 0xf7, 0x26, 0x28, 0x53, 0xe0, 0xa0, 0x4f, 0xa1, 0x79, - 0xee, 0x87, 0xf6, 0xa5, 0xc8, 0x89, 0x6c, 0xac, 0x8a, 0xd9, 0x90, 0x8c, 0x13, 0x72, 0x85, 0x76, - 0xa1, 0x2d, 0x52, 0xe5, 0x51, 0x4b, 0xb2, 0x12, 0x74, 0x01, 0x46, 0xae, 0x26, 0xf4, 0x50, 0x70, - 0x8c, 0xef, 0x61, 0xfb, 0xde, 0xbd, 0x18, 0xed, 0x2f, 0xed, 0x44, 0x4f, 0x16, 0xae, 0x3b, 0x52, - 0xe2, 0xc2, 0x66, 0x74, 0x06, 0xdd, 0xb2, 0x0c, 0xbd, 0x82, 0x9a, 0xca, 0x46, 0x52, 0xf8, 0x0f, - 0xa4, 0x2c, 0x51, 0x2a, 0xfe, 0xad, 0x91, 0x8c, 0xb3, 0x74, 0x38, 0xfc, 0x29, 0x73, 0x9d, 0x02, - 0xf8, 0x33, 0x58, 0xe7, 0xb7, 0x56, 0xe9, 0x7a, 0xc9, 0x1a, 0xc9, 0x6f, 0x4f, 0xb2, 0x0b, 0x96, - 0x5d, 0x16, 0xff, 0x29, 0x31, 0xbe, 0x86, 0xf5, 0x85, 0xcf, 0x10, 0xd1, 0x74, 0x24, 0x8e, 0xc3, - 0x38, 0x79, 0x1f, 0x45, 0x18, 0xef, 0xa1, 0x99, 0x2d, 0x93, 0x62, 0x02, 0x15, 0x86, 0x85, 0xfc, - 0x2d, 0x62, 0xdc, 0x90, 0x98, 0x89, 0x07, 0x52, 0xef, 0x97, 0x92, 0x8f, 0x6d, 0x4e, 0xbf, 0xf8, - 0x03, 0xb4, 0x0a, 0x93, 0x78, 0xf1, 0x93, 0xa1, 0x03, 0xcd, 0xc3, 0xb7, 0xef, 0x06, 0xdf, 0x5b, - 0xd3, 0x93, 0xa3, 0x9e, 0x26, 0xbe, 0x0c, 0x26, 0xc3, 0xd1, 0xec, 0x74, 0x72, 0x7a, 0x26, 0x39, - 0xab, 0xfb, 0x17, 0x50, 0x53, 0x9b, 0x10, 0xfa, 0x0d, 0xb4, 0xd5, 0xaf, 0x13, 0x1e, 0x13, 0x1c, - 0xa0, 0xa5, 0xc6, 0xde, 0x59, 0xe2, 0x3c, 0xd7, 0x5e, 0x6b, 0x02, 0x0e, 0x8e, 0x3d, 0xea, 0xa2, - 0xf2, 0x87, 0xfb, 0x4e, 0x99, 0x3c, 0xfc, 0x33, 0x7c, 0x15, 0xc6, 0x6e, 0x7f, 0x7e, 0x17, 0x91, - 0x58, 0x2d, 0xe8, 0xfd, 0x0b, 0x7c, 0x1e, 0x7b, 0x76, 0x3a, 0x75, 0x94, 0xf6, 0xdf, 0xfa, 0xae, - 0xc7, 0xe7, 0xd7, 0xe7, 0x7d, 0x3b, 0x0c, 0xf6, 0x0a, 0xca, 0x7b, 0x4a, 0xf9, 0x95, 0x52, 0x7e, - 0xe5, 0x86, 0x7b, 0x4a, 0xff, 0xbc, 0x26, 0x39, 0xdf, 0xfc, 0x2f, 0x00, 0x00, 0xff, 0xff, 0xa6, - 0xdd, 0x37, 0x76, 0x98, 0x13, 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// GossipClient is the client API for Gossip service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type GossipClient interface { - // GossipStream is the gRPC stream used for sending and receiving messages - GossipStream(ctx context.Context, opts ...grpc.CallOption) (Gossip_GossipStreamClient, error) - // Ping is used to probe a remote peer's aliveness - Ping(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error) -} - -type gossipClient struct { - cc *grpc.ClientConn -} - -func NewGossipClient(cc *grpc.ClientConn) GossipClient { - return &gossipClient{cc} -} - -func (c *gossipClient) GossipStream(ctx context.Context, opts ...grpc.CallOption) (Gossip_GossipStreamClient, error) { - stream, err := c.cc.NewStream(ctx, &_Gossip_serviceDesc.Streams[0], "/gossip.Gossip/GossipStream", opts...) - if err != nil { - return nil, err - } - x := &gossipGossipStreamClient{stream} - return x, nil -} - -type Gossip_GossipStreamClient interface { - Send(*Envelope) error - Recv() (*Envelope, error) - grpc.ClientStream -} - -type gossipGossipStreamClient struct { - grpc.ClientStream -} - -func (x *gossipGossipStreamClient) Send(m *Envelope) error { - return x.ClientStream.SendMsg(m) -} - -func (x *gossipGossipStreamClient) Recv() (*Envelope, error) { - m := new(Envelope) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *gossipClient) Ping(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error) { - out := new(Empty) - err := c.cc.Invoke(ctx, "/gossip.Gossip/Ping", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// GossipServer is the server API for Gossip service. -type GossipServer interface { - // GossipStream is the gRPC stream used for sending and receiving messages - GossipStream(Gossip_GossipStreamServer) error - // Ping is used to probe a remote peer's aliveness - Ping(context.Context, *Empty) (*Empty, error) -} - -// UnimplementedGossipServer can be embedded to have forward compatible implementations. -type UnimplementedGossipServer struct { -} - -func (*UnimplementedGossipServer) GossipStream(srv Gossip_GossipStreamServer) error { - return status.Errorf(codes.Unimplemented, "method GossipStream not implemented") -} -func (*UnimplementedGossipServer) Ping(ctx context.Context, req *Empty) (*Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method Ping not implemented") -} - -func RegisterGossipServer(s *grpc.Server, srv GossipServer) { - s.RegisterService(&_Gossip_serviceDesc, srv) -} - -func _Gossip_GossipStream_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(GossipServer).GossipStream(&gossipGossipStreamServer{stream}) -} - -type Gossip_GossipStreamServer interface { - Send(*Envelope) error - Recv() (*Envelope, error) - grpc.ServerStream -} - -type gossipGossipStreamServer struct { - grpc.ServerStream -} - -func (x *gossipGossipStreamServer) Send(m *Envelope) error { - return x.ServerStream.SendMsg(m) -} - -func (x *gossipGossipStreamServer) Recv() (*Envelope, error) { - m := new(Envelope) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func _Gossip_Ping_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(Empty) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(GossipServer).Ping(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/gossip.Gossip/Ping", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(GossipServer).Ping(ctx, req.(*Empty)) - } - return interceptor(ctx, in, info, handler) -} - -var _Gossip_serviceDesc = grpc.ServiceDesc{ - ServiceName: "gossip.Gossip", - HandlerType: (*GossipServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Ping", - Handler: _Gossip_Ping_Handler, - }, - }, - Streams: []grpc.StreamDesc{ - { - StreamName: "GossipStream", - Handler: _Gossip_GossipStream_Handler, - ServerStreams: true, - ClientStreams: true, - }, - }, - Metadata: "gossip/message.proto", -} diff --git a/vendor/github.com/hyperledger/fabric-protos-go/ledger/queryresult/kv_query_result.pb.go b/vendor/github.com/hyperledger/fabric-protos-go/ledger/queryresult/kv_query_result.pb.go deleted file mode 100644 index 45d8ba565f7..00000000000 --- a/vendor/github.com/hyperledger/fabric-protos-go/ledger/queryresult/kv_query_result.pb.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: ledger/queryresult/kv_query_result.proto - -package queryresult - -import ( - fmt "fmt" - proto "github.com/golang/protobuf/proto" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" - math "math" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package - -// KV -- QueryResult for range/execute query. Holds a key and corresponding value. -type KV struct { - Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"` - Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` - Value []byte `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *KV) Reset() { *m = KV{} } -func (m *KV) String() string { return proto.CompactTextString(m) } -func (*KV) ProtoMessage() {} -func (*KV) Descriptor() ([]byte, []int) { - return fileDescriptor_f8ee2fe66594a8f2, []int{0} -} - -func (m *KV) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_KV.Unmarshal(m, b) -} -func (m *KV) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_KV.Marshal(b, m, deterministic) -} -func (m *KV) XXX_Merge(src proto.Message) { - xxx_messageInfo_KV.Merge(m, src) -} -func (m *KV) XXX_Size() int { - return xxx_messageInfo_KV.Size(m) -} -func (m *KV) XXX_DiscardUnknown() { - xxx_messageInfo_KV.DiscardUnknown(m) -} - -var xxx_messageInfo_KV proto.InternalMessageInfo - -func (m *KV) GetNamespace() string { - if m != nil { - return m.Namespace - } - return "" -} - -func (m *KV) GetKey() string { - if m != nil { - return m.Key - } - return "" -} - -func (m *KV) GetValue() []byte { - if m != nil { - return m.Value - } - return nil -} - -// KeyModification -- QueryResult for history query. Holds a transaction ID, value, -// timestamp, and delete marker which resulted from a history query. -type KeyModification struct { - TxId string `protobuf:"bytes,1,opt,name=tx_id,json=txId,proto3" json:"tx_id,omitempty"` - Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` - Timestamp *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - IsDelete bool `protobuf:"varint,4,opt,name=is_delete,json=isDelete,proto3" json:"is_delete,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *KeyModification) Reset() { *m = KeyModification{} } -func (m *KeyModification) String() string { return proto.CompactTextString(m) } -func (*KeyModification) ProtoMessage() {} -func (*KeyModification) Descriptor() ([]byte, []int) { - return fileDescriptor_f8ee2fe66594a8f2, []int{1} -} - -func (m *KeyModification) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_KeyModification.Unmarshal(m, b) -} -func (m *KeyModification) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_KeyModification.Marshal(b, m, deterministic) -} -func (m *KeyModification) XXX_Merge(src proto.Message) { - xxx_messageInfo_KeyModification.Merge(m, src) -} -func (m *KeyModification) XXX_Size() int { - return xxx_messageInfo_KeyModification.Size(m) -} -func (m *KeyModification) XXX_DiscardUnknown() { - xxx_messageInfo_KeyModification.DiscardUnknown(m) -} - -var xxx_messageInfo_KeyModification proto.InternalMessageInfo - -func (m *KeyModification) GetTxId() string { - if m != nil { - return m.TxId - } - return "" -} - -func (m *KeyModification) GetValue() []byte { - if m != nil { - return m.Value - } - return nil -} - -func (m *KeyModification) GetTimestamp() *timestamppb.Timestamp { - if m != nil { - return m.Timestamp - } - return nil -} - -func (m *KeyModification) GetIsDelete() bool { - if m != nil { - return m.IsDelete - } - return false -} - -func init() { - proto.RegisterType((*KV)(nil), "queryresult.KV") - proto.RegisterType((*KeyModification)(nil), "queryresult.KeyModification") -} - -func init() { - proto.RegisterFile("ledger/queryresult/kv_query_result.proto", fileDescriptor_f8ee2fe66594a8f2) -} - -var fileDescriptor_f8ee2fe66594a8f2 = []byte{ - // 290 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x91, 0x4f, 0x4b, 0xc3, 0x30, - 0x18, 0xc6, 0xe9, 0xfe, 0xc8, 0x9a, 0x09, 0x4a, 0xf4, 0x50, 0xa6, 0x60, 0xd9, 0xa9, 0x97, 0x25, - 0xa2, 0x17, 0xf1, 0x28, 0x5e, 0x74, 0x78, 0x29, 0xe2, 0xc1, 0x4b, 0x49, 0xdb, 0xb7, 0x59, 0x58, - 0xdb, 0xd4, 0x24, 0x1d, 0xeb, 0xe7, 0xf0, 0x0b, 0x8b, 0xc9, 0x66, 0x0b, 0xde, 0xf2, 0xbc, 0xef, - 0xf3, 0x7b, 0x78, 0x78, 0x83, 0xa2, 0x12, 0x72, 0x0e, 0x8a, 0x7e, 0xb5, 0xa0, 0x3a, 0x05, 0xba, - 0x2d, 0x0d, 0xdd, 0xee, 0x12, 0x2b, 0x13, 0xa7, 0x49, 0xa3, 0xa4, 0x91, 0x78, 0x3e, 0xb0, 0x2c, - 0x6e, 0xb8, 0x94, 0xbc, 0x04, 0x6a, 0x57, 0x69, 0x5b, 0x50, 0x23, 0x2a, 0xd0, 0x86, 0x55, 0x8d, - 0x73, 0x2f, 0x5f, 0xd1, 0x68, 0xfd, 0x81, 0xaf, 0x91, 0x5f, 0xb3, 0x0a, 0x74, 0xc3, 0x32, 0x08, - 0xbc, 0xd0, 0x8b, 0xfc, 0xb8, 0x1f, 0xe0, 0x73, 0x34, 0xde, 0x42, 0x17, 0x8c, 0xec, 0xfc, 0xf7, - 0x89, 0x2f, 0xd1, 0x74, 0xc7, 0xca, 0x16, 0x82, 0x71, 0xe8, 0x45, 0xa7, 0xb1, 0x13, 0xcb, 0x6f, - 0x0f, 0x9d, 0xad, 0xa1, 0x7b, 0x93, 0xb9, 0x28, 0x44, 0xc6, 0x8c, 0x90, 0x35, 0xbe, 0x40, 0x53, - 0xb3, 0x4f, 0x44, 0x7e, 0x48, 0x9d, 0x98, 0xfd, 0x4b, 0xde, 0xe3, 0xa3, 0x01, 0x8e, 0x1f, 0x90, - 0xff, 0xd7, 0xce, 0x06, 0xcf, 0xef, 0x16, 0xc4, 0xf5, 0x27, 0xc7, 0xfe, 0xe4, 0xfd, 0xe8, 0x88, - 0x7b, 0x33, 0xbe, 0x42, 0xbe, 0xd0, 0x49, 0x0e, 0x25, 0x18, 0x08, 0x26, 0xa1, 0x17, 0xcd, 0xe2, - 0x99, 0xd0, 0xcf, 0x56, 0x3f, 0xd5, 0xe8, 0x56, 0x2a, 0x4e, 0x36, 0x5d, 0x03, 0xca, 0x1d, 0x91, - 0x14, 0x2c, 0x55, 0x22, 0x73, 0xa1, 0x9a, 0x1c, 0x86, 0x83, 0xb3, 0x7d, 0x3e, 0x72, 0x61, 0x36, - 0x6d, 0x4a, 0x32, 0x59, 0xd1, 0x01, 0x48, 0x1d, 0xb8, 0x72, 0xe0, 0x8a, 0x4b, 0xfa, 0xff, 0x57, - 0xd2, 0x13, 0xbb, 0xbd, 0xff, 0x09, 0x00, 0x00, 0xff, 0xff, 0x07, 0x6d, 0xd7, 0x47, 0xb2, 0x01, - 0x00, 0x00, -} diff --git a/vendor/github.com/hyperledger/fabric-protos-go/ledger/rwset/kvrwset/kv_rwset.pb.go b/vendor/github.com/hyperledger/fabric-protos-go/ledger/rwset/kvrwset/kv_rwset.pb.go deleted file mode 100644 index 1f985151571..00000000000 --- a/vendor/github.com/hyperledger/fabric-protos-go/ledger/rwset/kvrwset/kv_rwset.pb.go +++ /dev/null @@ -1,839 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: ledger/rwset/kvrwset/kv_rwset.proto - -package kvrwset - -import ( - fmt "fmt" - proto "github.com/golang/protobuf/proto" - math "math" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package - -// KVRWSet encapsulates the read-write set for a chaincode that operates upon a KV or Document data model -// This structure is used for both the public data and the private data -type KVRWSet struct { - Reads []*KVRead `protobuf:"bytes,1,rep,name=reads,proto3" json:"reads,omitempty"` - RangeQueriesInfo []*RangeQueryInfo `protobuf:"bytes,2,rep,name=range_queries_info,json=rangeQueriesInfo,proto3" json:"range_queries_info,omitempty"` - Writes []*KVWrite `protobuf:"bytes,3,rep,name=writes,proto3" json:"writes,omitempty"` - MetadataWrites []*KVMetadataWrite `protobuf:"bytes,4,rep,name=metadata_writes,json=metadataWrites,proto3" json:"metadata_writes,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *KVRWSet) Reset() { *m = KVRWSet{} } -func (m *KVRWSet) String() string { return proto.CompactTextString(m) } -func (*KVRWSet) ProtoMessage() {} -func (*KVRWSet) Descriptor() ([]byte, []int) { - return fileDescriptor_ee5d686eab23a142, []int{0} -} - -func (m *KVRWSet) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_KVRWSet.Unmarshal(m, b) -} -func (m *KVRWSet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_KVRWSet.Marshal(b, m, deterministic) -} -func (m *KVRWSet) XXX_Merge(src proto.Message) { - xxx_messageInfo_KVRWSet.Merge(m, src) -} -func (m *KVRWSet) XXX_Size() int { - return xxx_messageInfo_KVRWSet.Size(m) -} -func (m *KVRWSet) XXX_DiscardUnknown() { - xxx_messageInfo_KVRWSet.DiscardUnknown(m) -} - -var xxx_messageInfo_KVRWSet proto.InternalMessageInfo - -func (m *KVRWSet) GetReads() []*KVRead { - if m != nil { - return m.Reads - } - return nil -} - -func (m *KVRWSet) GetRangeQueriesInfo() []*RangeQueryInfo { - if m != nil { - return m.RangeQueriesInfo - } - return nil -} - -func (m *KVRWSet) GetWrites() []*KVWrite { - if m != nil { - return m.Writes - } - return nil -} - -func (m *KVRWSet) GetMetadataWrites() []*KVMetadataWrite { - if m != nil { - return m.MetadataWrites - } - return nil -} - -// HashedRWSet encapsulates hashed representation of a private read-write set for KV or Document data model -type HashedRWSet struct { - HashedReads []*KVReadHash `protobuf:"bytes,1,rep,name=hashed_reads,json=hashedReads,proto3" json:"hashed_reads,omitempty"` - HashedWrites []*KVWriteHash `protobuf:"bytes,2,rep,name=hashed_writes,json=hashedWrites,proto3" json:"hashed_writes,omitempty"` - MetadataWrites []*KVMetadataWriteHash `protobuf:"bytes,3,rep,name=metadata_writes,json=metadataWrites,proto3" json:"metadata_writes,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *HashedRWSet) Reset() { *m = HashedRWSet{} } -func (m *HashedRWSet) String() string { return proto.CompactTextString(m) } -func (*HashedRWSet) ProtoMessage() {} -func (*HashedRWSet) Descriptor() ([]byte, []int) { - return fileDescriptor_ee5d686eab23a142, []int{1} -} - -func (m *HashedRWSet) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_HashedRWSet.Unmarshal(m, b) -} -func (m *HashedRWSet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_HashedRWSet.Marshal(b, m, deterministic) -} -func (m *HashedRWSet) XXX_Merge(src proto.Message) { - xxx_messageInfo_HashedRWSet.Merge(m, src) -} -func (m *HashedRWSet) XXX_Size() int { - return xxx_messageInfo_HashedRWSet.Size(m) -} -func (m *HashedRWSet) XXX_DiscardUnknown() { - xxx_messageInfo_HashedRWSet.DiscardUnknown(m) -} - -var xxx_messageInfo_HashedRWSet proto.InternalMessageInfo - -func (m *HashedRWSet) GetHashedReads() []*KVReadHash { - if m != nil { - return m.HashedReads - } - return nil -} - -func (m *HashedRWSet) GetHashedWrites() []*KVWriteHash { - if m != nil { - return m.HashedWrites - } - return nil -} - -func (m *HashedRWSet) GetMetadataWrites() []*KVMetadataWriteHash { - if m != nil { - return m.MetadataWrites - } - return nil -} - -// KVRead captures a read operation performed during transaction simulation -// A 'nil' version indicates a non-existing key read by the transaction -type KVRead struct { - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - Version *Version `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *KVRead) Reset() { *m = KVRead{} } -func (m *KVRead) String() string { return proto.CompactTextString(m) } -func (*KVRead) ProtoMessage() {} -func (*KVRead) Descriptor() ([]byte, []int) { - return fileDescriptor_ee5d686eab23a142, []int{2} -} - -func (m *KVRead) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_KVRead.Unmarshal(m, b) -} -func (m *KVRead) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_KVRead.Marshal(b, m, deterministic) -} -func (m *KVRead) XXX_Merge(src proto.Message) { - xxx_messageInfo_KVRead.Merge(m, src) -} -func (m *KVRead) XXX_Size() int { - return xxx_messageInfo_KVRead.Size(m) -} -func (m *KVRead) XXX_DiscardUnknown() { - xxx_messageInfo_KVRead.DiscardUnknown(m) -} - -var xxx_messageInfo_KVRead proto.InternalMessageInfo - -func (m *KVRead) GetKey() string { - if m != nil { - return m.Key - } - return "" -} - -func (m *KVRead) GetVersion() *Version { - if m != nil { - return m.Version - } - return nil -} - -// KVWrite captures a write (update/delete) operation performed during transaction simulation -type KVWrite struct { - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - IsDelete bool `protobuf:"varint,2,opt,name=is_delete,json=isDelete,proto3" json:"is_delete,omitempty"` - Value []byte `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *KVWrite) Reset() { *m = KVWrite{} } -func (m *KVWrite) String() string { return proto.CompactTextString(m) } -func (*KVWrite) ProtoMessage() {} -func (*KVWrite) Descriptor() ([]byte, []int) { - return fileDescriptor_ee5d686eab23a142, []int{3} -} - -func (m *KVWrite) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_KVWrite.Unmarshal(m, b) -} -func (m *KVWrite) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_KVWrite.Marshal(b, m, deterministic) -} -func (m *KVWrite) XXX_Merge(src proto.Message) { - xxx_messageInfo_KVWrite.Merge(m, src) -} -func (m *KVWrite) XXX_Size() int { - return xxx_messageInfo_KVWrite.Size(m) -} -func (m *KVWrite) XXX_DiscardUnknown() { - xxx_messageInfo_KVWrite.DiscardUnknown(m) -} - -var xxx_messageInfo_KVWrite proto.InternalMessageInfo - -func (m *KVWrite) GetKey() string { - if m != nil { - return m.Key - } - return "" -} - -func (m *KVWrite) GetIsDelete() bool { - if m != nil { - return m.IsDelete - } - return false -} - -func (m *KVWrite) GetValue() []byte { - if m != nil { - return m.Value - } - return nil -} - -// KVMetadataWrite captures all the entries in the metadata associated with a key -type KVMetadataWrite struct { - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - Entries []*KVMetadataEntry `protobuf:"bytes,2,rep,name=entries,proto3" json:"entries,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *KVMetadataWrite) Reset() { *m = KVMetadataWrite{} } -func (m *KVMetadataWrite) String() string { return proto.CompactTextString(m) } -func (*KVMetadataWrite) ProtoMessage() {} -func (*KVMetadataWrite) Descriptor() ([]byte, []int) { - return fileDescriptor_ee5d686eab23a142, []int{4} -} - -func (m *KVMetadataWrite) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_KVMetadataWrite.Unmarshal(m, b) -} -func (m *KVMetadataWrite) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_KVMetadataWrite.Marshal(b, m, deterministic) -} -func (m *KVMetadataWrite) XXX_Merge(src proto.Message) { - xxx_messageInfo_KVMetadataWrite.Merge(m, src) -} -func (m *KVMetadataWrite) XXX_Size() int { - return xxx_messageInfo_KVMetadataWrite.Size(m) -} -func (m *KVMetadataWrite) XXX_DiscardUnknown() { - xxx_messageInfo_KVMetadataWrite.DiscardUnknown(m) -} - -var xxx_messageInfo_KVMetadataWrite proto.InternalMessageInfo - -func (m *KVMetadataWrite) GetKey() string { - if m != nil { - return m.Key - } - return "" -} - -func (m *KVMetadataWrite) GetEntries() []*KVMetadataEntry { - if m != nil { - return m.Entries - } - return nil -} - -// KVReadHash is similar to the KVRead in spirit. However, it captures the hash of the key instead of the key itself -// version is kept as is for now. However, if the version also needs to be privacy-protected, it would need to be the -// hash of the version and hence of 'bytes' type -type KVReadHash struct { - KeyHash []byte `protobuf:"bytes,1,opt,name=key_hash,json=keyHash,proto3" json:"key_hash,omitempty"` - Version *Version `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *KVReadHash) Reset() { *m = KVReadHash{} } -func (m *KVReadHash) String() string { return proto.CompactTextString(m) } -func (*KVReadHash) ProtoMessage() {} -func (*KVReadHash) Descriptor() ([]byte, []int) { - return fileDescriptor_ee5d686eab23a142, []int{5} -} - -func (m *KVReadHash) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_KVReadHash.Unmarshal(m, b) -} -func (m *KVReadHash) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_KVReadHash.Marshal(b, m, deterministic) -} -func (m *KVReadHash) XXX_Merge(src proto.Message) { - xxx_messageInfo_KVReadHash.Merge(m, src) -} -func (m *KVReadHash) XXX_Size() int { - return xxx_messageInfo_KVReadHash.Size(m) -} -func (m *KVReadHash) XXX_DiscardUnknown() { - xxx_messageInfo_KVReadHash.DiscardUnknown(m) -} - -var xxx_messageInfo_KVReadHash proto.InternalMessageInfo - -func (m *KVReadHash) GetKeyHash() []byte { - if m != nil { - return m.KeyHash - } - return nil -} - -func (m *KVReadHash) GetVersion() *Version { - if m != nil { - return m.Version - } - return nil -} - -// KVWriteHash is similar to the KVWrite. It captures a write (update/delete) operation performed during transaction simulation -type KVWriteHash struct { - KeyHash []byte `protobuf:"bytes,1,opt,name=key_hash,json=keyHash,proto3" json:"key_hash,omitempty"` - IsDelete bool `protobuf:"varint,2,opt,name=is_delete,json=isDelete,proto3" json:"is_delete,omitempty"` - ValueHash []byte `protobuf:"bytes,3,opt,name=value_hash,json=valueHash,proto3" json:"value_hash,omitempty"` - IsPurge bool `protobuf:"varint,4,opt,name=is_purge,json=isPurge,proto3" json:"is_purge,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *KVWriteHash) Reset() { *m = KVWriteHash{} } -func (m *KVWriteHash) String() string { return proto.CompactTextString(m) } -func (*KVWriteHash) ProtoMessage() {} -func (*KVWriteHash) Descriptor() ([]byte, []int) { - return fileDescriptor_ee5d686eab23a142, []int{6} -} - -func (m *KVWriteHash) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_KVWriteHash.Unmarshal(m, b) -} -func (m *KVWriteHash) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_KVWriteHash.Marshal(b, m, deterministic) -} -func (m *KVWriteHash) XXX_Merge(src proto.Message) { - xxx_messageInfo_KVWriteHash.Merge(m, src) -} -func (m *KVWriteHash) XXX_Size() int { - return xxx_messageInfo_KVWriteHash.Size(m) -} -func (m *KVWriteHash) XXX_DiscardUnknown() { - xxx_messageInfo_KVWriteHash.DiscardUnknown(m) -} - -var xxx_messageInfo_KVWriteHash proto.InternalMessageInfo - -func (m *KVWriteHash) GetKeyHash() []byte { - if m != nil { - return m.KeyHash - } - return nil -} - -func (m *KVWriteHash) GetIsDelete() bool { - if m != nil { - return m.IsDelete - } - return false -} - -func (m *KVWriteHash) GetValueHash() []byte { - if m != nil { - return m.ValueHash - } - return nil -} - -func (m *KVWriteHash) GetIsPurge() bool { - if m != nil { - return m.IsPurge - } - return false -} - -// KVMetadataWriteHash captures all the upserts to the metadata associated with a key hash -type KVMetadataWriteHash struct { - KeyHash []byte `protobuf:"bytes,1,opt,name=key_hash,json=keyHash,proto3" json:"key_hash,omitempty"` - Entries []*KVMetadataEntry `protobuf:"bytes,2,rep,name=entries,proto3" json:"entries,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *KVMetadataWriteHash) Reset() { *m = KVMetadataWriteHash{} } -func (m *KVMetadataWriteHash) String() string { return proto.CompactTextString(m) } -func (*KVMetadataWriteHash) ProtoMessage() {} -func (*KVMetadataWriteHash) Descriptor() ([]byte, []int) { - return fileDescriptor_ee5d686eab23a142, []int{7} -} - -func (m *KVMetadataWriteHash) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_KVMetadataWriteHash.Unmarshal(m, b) -} -func (m *KVMetadataWriteHash) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_KVMetadataWriteHash.Marshal(b, m, deterministic) -} -func (m *KVMetadataWriteHash) XXX_Merge(src proto.Message) { - xxx_messageInfo_KVMetadataWriteHash.Merge(m, src) -} -func (m *KVMetadataWriteHash) XXX_Size() int { - return xxx_messageInfo_KVMetadataWriteHash.Size(m) -} -func (m *KVMetadataWriteHash) XXX_DiscardUnknown() { - xxx_messageInfo_KVMetadataWriteHash.DiscardUnknown(m) -} - -var xxx_messageInfo_KVMetadataWriteHash proto.InternalMessageInfo - -func (m *KVMetadataWriteHash) GetKeyHash() []byte { - if m != nil { - return m.KeyHash - } - return nil -} - -func (m *KVMetadataWriteHash) GetEntries() []*KVMetadataEntry { - if m != nil { - return m.Entries - } - return nil -} - -// KVMetadataEntry captures a 'name'ed entry in the metadata of a key/key-hash. -type KVMetadataEntry struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *KVMetadataEntry) Reset() { *m = KVMetadataEntry{} } -func (m *KVMetadataEntry) String() string { return proto.CompactTextString(m) } -func (*KVMetadataEntry) ProtoMessage() {} -func (*KVMetadataEntry) Descriptor() ([]byte, []int) { - return fileDescriptor_ee5d686eab23a142, []int{8} -} - -func (m *KVMetadataEntry) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_KVMetadataEntry.Unmarshal(m, b) -} -func (m *KVMetadataEntry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_KVMetadataEntry.Marshal(b, m, deterministic) -} -func (m *KVMetadataEntry) XXX_Merge(src proto.Message) { - xxx_messageInfo_KVMetadataEntry.Merge(m, src) -} -func (m *KVMetadataEntry) XXX_Size() int { - return xxx_messageInfo_KVMetadataEntry.Size(m) -} -func (m *KVMetadataEntry) XXX_DiscardUnknown() { - xxx_messageInfo_KVMetadataEntry.DiscardUnknown(m) -} - -var xxx_messageInfo_KVMetadataEntry proto.InternalMessageInfo - -func (m *KVMetadataEntry) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *KVMetadataEntry) GetValue() []byte { - if m != nil { - return m.Value - } - return nil -} - -// Version encapsulates the version of a Key -// A version of a committed key is maintained as the height of the transaction that committed the key. -// The height is represenetd as a tuple where the txNum is the position of the transaction -// (starting with 0) within block -type Version struct { - BlockNum uint64 `protobuf:"varint,1,opt,name=block_num,json=blockNum,proto3" json:"block_num,omitempty"` - TxNum uint64 `protobuf:"varint,2,opt,name=tx_num,json=txNum,proto3" json:"tx_num,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Version) Reset() { *m = Version{} } -func (m *Version) String() string { return proto.CompactTextString(m) } -func (*Version) ProtoMessage() {} -func (*Version) Descriptor() ([]byte, []int) { - return fileDescriptor_ee5d686eab23a142, []int{9} -} - -func (m *Version) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Version.Unmarshal(m, b) -} -func (m *Version) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Version.Marshal(b, m, deterministic) -} -func (m *Version) XXX_Merge(src proto.Message) { - xxx_messageInfo_Version.Merge(m, src) -} -func (m *Version) XXX_Size() int { - return xxx_messageInfo_Version.Size(m) -} -func (m *Version) XXX_DiscardUnknown() { - xxx_messageInfo_Version.DiscardUnknown(m) -} - -var xxx_messageInfo_Version proto.InternalMessageInfo - -func (m *Version) GetBlockNum() uint64 { - if m != nil { - return m.BlockNum - } - return 0 -} - -func (m *Version) GetTxNum() uint64 { - if m != nil { - return m.TxNum - } - return 0 -} - -// RangeQueryInfo encapsulates the details of a range query performed by a transaction during simulation. -// This helps protect transactions from phantom reads by varifying during validation whether any new items -// got committed within the given range between transaction simuation and validation -// (in addition to regular checks for updates/deletes of the existing items). -// readInfo field contains either the KVReads (for the items read by the range query) or a merkle-tree hash -// if the KVReads exceeds a pre-configured numbers -type RangeQueryInfo struct { - StartKey string `protobuf:"bytes,1,opt,name=start_key,json=startKey,proto3" json:"start_key,omitempty"` - EndKey string `protobuf:"bytes,2,opt,name=end_key,json=endKey,proto3" json:"end_key,omitempty"` - ItrExhausted bool `protobuf:"varint,3,opt,name=itr_exhausted,json=itrExhausted,proto3" json:"itr_exhausted,omitempty"` - // Types that are valid to be assigned to ReadsInfo: - // - // *RangeQueryInfo_RawReads - // *RangeQueryInfo_ReadsMerkleHashes - ReadsInfo isRangeQueryInfo_ReadsInfo `protobuf_oneof:"reads_info"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *RangeQueryInfo) Reset() { *m = RangeQueryInfo{} } -func (m *RangeQueryInfo) String() string { return proto.CompactTextString(m) } -func (*RangeQueryInfo) ProtoMessage() {} -func (*RangeQueryInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_ee5d686eab23a142, []int{10} -} - -func (m *RangeQueryInfo) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_RangeQueryInfo.Unmarshal(m, b) -} -func (m *RangeQueryInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_RangeQueryInfo.Marshal(b, m, deterministic) -} -func (m *RangeQueryInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_RangeQueryInfo.Merge(m, src) -} -func (m *RangeQueryInfo) XXX_Size() int { - return xxx_messageInfo_RangeQueryInfo.Size(m) -} -func (m *RangeQueryInfo) XXX_DiscardUnknown() { - xxx_messageInfo_RangeQueryInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_RangeQueryInfo proto.InternalMessageInfo - -func (m *RangeQueryInfo) GetStartKey() string { - if m != nil { - return m.StartKey - } - return "" -} - -func (m *RangeQueryInfo) GetEndKey() string { - if m != nil { - return m.EndKey - } - return "" -} - -func (m *RangeQueryInfo) GetItrExhausted() bool { - if m != nil { - return m.ItrExhausted - } - return false -} - -type isRangeQueryInfo_ReadsInfo interface { - isRangeQueryInfo_ReadsInfo() -} - -type RangeQueryInfo_RawReads struct { - RawReads *QueryReads `protobuf:"bytes,4,opt,name=raw_reads,json=rawReads,proto3,oneof"` -} - -type RangeQueryInfo_ReadsMerkleHashes struct { - ReadsMerkleHashes *QueryReadsMerkleSummary `protobuf:"bytes,5,opt,name=reads_merkle_hashes,json=readsMerkleHashes,proto3,oneof"` -} - -func (*RangeQueryInfo_RawReads) isRangeQueryInfo_ReadsInfo() {} - -func (*RangeQueryInfo_ReadsMerkleHashes) isRangeQueryInfo_ReadsInfo() {} - -func (m *RangeQueryInfo) GetReadsInfo() isRangeQueryInfo_ReadsInfo { - if m != nil { - return m.ReadsInfo - } - return nil -} - -func (m *RangeQueryInfo) GetRawReads() *QueryReads { - if x, ok := m.GetReadsInfo().(*RangeQueryInfo_RawReads); ok { - return x.RawReads - } - return nil -} - -func (m *RangeQueryInfo) GetReadsMerkleHashes() *QueryReadsMerkleSummary { - if x, ok := m.GetReadsInfo().(*RangeQueryInfo_ReadsMerkleHashes); ok { - return x.ReadsMerkleHashes - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*RangeQueryInfo) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*RangeQueryInfo_RawReads)(nil), - (*RangeQueryInfo_ReadsMerkleHashes)(nil), - } -} - -// QueryReads encapsulates the KVReads for the items read by a transaction as a result of a query execution -type QueryReads struct { - KvReads []*KVRead `protobuf:"bytes,1,rep,name=kv_reads,json=kvReads,proto3" json:"kv_reads,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *QueryReads) Reset() { *m = QueryReads{} } -func (m *QueryReads) String() string { return proto.CompactTextString(m) } -func (*QueryReads) ProtoMessage() {} -func (*QueryReads) Descriptor() ([]byte, []int) { - return fileDescriptor_ee5d686eab23a142, []int{11} -} - -func (m *QueryReads) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_QueryReads.Unmarshal(m, b) -} -func (m *QueryReads) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_QueryReads.Marshal(b, m, deterministic) -} -func (m *QueryReads) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryReads.Merge(m, src) -} -func (m *QueryReads) XXX_Size() int { - return xxx_messageInfo_QueryReads.Size(m) -} -func (m *QueryReads) XXX_DiscardUnknown() { - xxx_messageInfo_QueryReads.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryReads proto.InternalMessageInfo - -func (m *QueryReads) GetKvReads() []*KVRead { - if m != nil { - return m.KvReads - } - return nil -} - -// QueryReadsMerkleSummary encapsulates the Merkle-tree hashes for the QueryReads -// This allows to reduce the size of RWSet in the presence of query results -// by storing certain hashes instead of actual results. -// maxDegree field refers to the maximum number of children in the tree at any level -// maxLevel field contains the lowest level which has lesser nodes than maxDegree (starting from leaf level) -type QueryReadsMerkleSummary struct { - MaxDegree uint32 `protobuf:"varint,1,opt,name=max_degree,json=maxDegree,proto3" json:"max_degree,omitempty"` - MaxLevel uint32 `protobuf:"varint,2,opt,name=max_level,json=maxLevel,proto3" json:"max_level,omitempty"` - MaxLevelHashes [][]byte `protobuf:"bytes,3,rep,name=max_level_hashes,json=maxLevelHashes,proto3" json:"max_level_hashes,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *QueryReadsMerkleSummary) Reset() { *m = QueryReadsMerkleSummary{} } -func (m *QueryReadsMerkleSummary) String() string { return proto.CompactTextString(m) } -func (*QueryReadsMerkleSummary) ProtoMessage() {} -func (*QueryReadsMerkleSummary) Descriptor() ([]byte, []int) { - return fileDescriptor_ee5d686eab23a142, []int{12} -} - -func (m *QueryReadsMerkleSummary) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_QueryReadsMerkleSummary.Unmarshal(m, b) -} -func (m *QueryReadsMerkleSummary) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_QueryReadsMerkleSummary.Marshal(b, m, deterministic) -} -func (m *QueryReadsMerkleSummary) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryReadsMerkleSummary.Merge(m, src) -} -func (m *QueryReadsMerkleSummary) XXX_Size() int { - return xxx_messageInfo_QueryReadsMerkleSummary.Size(m) -} -func (m *QueryReadsMerkleSummary) XXX_DiscardUnknown() { - xxx_messageInfo_QueryReadsMerkleSummary.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryReadsMerkleSummary proto.InternalMessageInfo - -func (m *QueryReadsMerkleSummary) GetMaxDegree() uint32 { - if m != nil { - return m.MaxDegree - } - return 0 -} - -func (m *QueryReadsMerkleSummary) GetMaxLevel() uint32 { - if m != nil { - return m.MaxLevel - } - return 0 -} - -func (m *QueryReadsMerkleSummary) GetMaxLevelHashes() [][]byte { - if m != nil { - return m.MaxLevelHashes - } - return nil -} - -func init() { - proto.RegisterType((*KVRWSet)(nil), "kvrwset.KVRWSet") - proto.RegisterType((*HashedRWSet)(nil), "kvrwset.HashedRWSet") - proto.RegisterType((*KVRead)(nil), "kvrwset.KVRead") - proto.RegisterType((*KVWrite)(nil), "kvrwset.KVWrite") - proto.RegisterType((*KVMetadataWrite)(nil), "kvrwset.KVMetadataWrite") - proto.RegisterType((*KVReadHash)(nil), "kvrwset.KVReadHash") - proto.RegisterType((*KVWriteHash)(nil), "kvrwset.KVWriteHash") - proto.RegisterType((*KVMetadataWriteHash)(nil), "kvrwset.KVMetadataWriteHash") - proto.RegisterType((*KVMetadataEntry)(nil), "kvrwset.KVMetadataEntry") - proto.RegisterType((*Version)(nil), "kvrwset.Version") - proto.RegisterType((*RangeQueryInfo)(nil), "kvrwset.RangeQueryInfo") - proto.RegisterType((*QueryReads)(nil), "kvrwset.QueryReads") - proto.RegisterType((*QueryReadsMerkleSummary)(nil), "kvrwset.QueryReadsMerkleSummary") -} - -func init() { - proto.RegisterFile("ledger/rwset/kvrwset/kv_rwset.proto", fileDescriptor_ee5d686eab23a142) -} - -var fileDescriptor_ee5d686eab23a142 = []byte{ - // 759 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x55, 0x5f, 0x6b, 0xe3, 0x46, - 0x10, 0x3f, 0xff, 0x95, 0x3c, 0xb6, 0x13, 0x77, 0x73, 0x25, 0x2a, 0x6d, 0xc1, 0xe8, 0x28, 0x98, - 0x83, 0xb3, 0xc1, 0x85, 0xd2, 0xd2, 0xf6, 0xa1, 0xe5, 0x5c, 0x52, 0xd2, 0x0b, 0xed, 0x06, 0x12, - 0xe8, 0x8b, 0x58, 0x47, 0x13, 0x5b, 0xd8, 0x92, 0xd2, 0xdd, 0x95, 0x6d, 0x3d, 0x1d, 0xfd, 0x74, - 0xfd, 0x22, 0xfd, 0x20, 0x65, 0x67, 0xa5, 0xb3, 0xce, 0xf5, 0x19, 0xda, 0x27, 0x69, 0xe6, 0x37, - 0xbf, 0xd1, 0xfc, 0x66, 0xb4, 0xb3, 0xf0, 0x62, 0x8d, 0xe1, 0x02, 0xe5, 0x44, 0x6e, 0x15, 0xea, - 0xc9, 0x6a, 0x53, 0x3e, 0x03, 0x7a, 0x19, 0x3f, 0xc9, 0x54, 0xa7, 0xcc, 0x29, 0xfc, 0xfe, 0xdf, - 0x35, 0x70, 0xae, 0xef, 0xf8, 0xfd, 0x2d, 0x6a, 0xf6, 0x05, 0xb4, 0x24, 0x8a, 0x50, 0x79, 0xb5, - 0x61, 0x63, 0xd4, 0x9d, 0x9e, 0x8f, 0x8b, 0xa0, 0xf1, 0xf5, 0x1d, 0x47, 0x11, 0x72, 0x8b, 0xb2, - 0x19, 0x30, 0x29, 0x92, 0x05, 0x06, 0x7f, 0x64, 0x28, 0x23, 0x54, 0x41, 0x94, 0x3c, 0xa6, 0x5e, - 0x9d, 0x38, 0x97, 0xef, 0x38, 0xdc, 0x84, 0xfc, 0x96, 0xa1, 0xcc, 0x7f, 0x4e, 0x1e, 0x53, 0x3e, - 0x90, 0xa5, 0x1d, 0xa1, 0x32, 0x1e, 0x36, 0x82, 0xf6, 0x56, 0x46, 0x1a, 0x95, 0xd7, 0x20, 0xea, - 0xa0, 0xf2, 0xb9, 0x7b, 0x03, 0xf0, 0x02, 0x67, 0x3f, 0xc0, 0x79, 0x8c, 0x5a, 0x84, 0x42, 0x8b, - 0xa0, 0xa0, 0x34, 0x89, 0xe2, 0x55, 0x28, 0x6f, 0x8a, 0x08, 0x4b, 0x3d, 0x8b, 0xab, 0xa6, 0xf2, - 0xff, 0xaa, 0x41, 0xf7, 0x4a, 0xa8, 0x25, 0x86, 0x56, 0xea, 0x57, 0xd0, 0x5b, 0x92, 0x19, 0x54, - 0x15, 0x5f, 0x1c, 0x28, 0x36, 0x0c, 0xde, 0xb5, 0x81, 0x9c, 0xb4, 0x7f, 0x03, 0xfd, 0x82, 0x57, - 0x14, 0x62, 0x65, 0x3f, 0x3f, 0xac, 0x9d, 0x98, 0xc5, 0x27, 0x6c, 0x09, 0x6c, 0xf6, 0x6f, 0x15, - 0x56, 0xf8, 0x67, 0x1f, 0x52, 0x41, 0x49, 0x0e, 0x95, 0xfc, 0x04, 0x6d, 0x5b, 0x1c, 0x1b, 0x40, - 0x63, 0x85, 0xb9, 0x57, 0x1b, 0xd6, 0x46, 0x1d, 0x6e, 0x5e, 0xd9, 0x4b, 0x70, 0x36, 0x28, 0x55, - 0x94, 0x26, 0x5e, 0x7d, 0x58, 0x7b, 0xaf, 0xa7, 0x77, 0xd6, 0xcf, 0xcb, 0x00, 0xff, 0xc6, 0xcc, - 0x9d, 0x72, 0x1e, 0x49, 0xf4, 0x29, 0x74, 0x22, 0x15, 0x84, 0xb8, 0x46, 0x8d, 0x94, 0xca, 0xe5, - 0x6e, 0xa4, 0x5e, 0x93, 0xcd, 0x9e, 0x43, 0x6b, 0x23, 0xd6, 0x19, 0x7a, 0x8d, 0x61, 0x6d, 0xd4, - 0xe3, 0xd6, 0xf0, 0xef, 0xe1, 0xfc, 0xa0, 0xfc, 0x23, 0x79, 0xa7, 0xe0, 0x60, 0xa2, 0xcd, 0x2f, - 0x50, 0x34, 0xee, 0xd8, 0x04, 0x67, 0x89, 0x96, 0x39, 0x2f, 0x03, 0xfd, 0x5b, 0x80, 0xfd, 0x34, - 0xd8, 0x27, 0xe0, 0xae, 0x30, 0x0f, 0x4c, 0x67, 0x29, 0x71, 0x8f, 0x3b, 0x2b, 0xcc, 0x09, 0xfa, - 0x2f, 0xea, 0xdf, 0x42, 0xb7, 0x32, 0xa9, 0x53, 0x59, 0x4f, 0xb6, 0xe2, 0x73, 0x00, 0x52, 0x6f, - 0x99, 0xb6, 0x1f, 0x1d, 0xf2, 0x94, 0x69, 0x23, 0x15, 0x3c, 0x65, 0x72, 0x81, 0x5e, 0x93, 0xa8, - 0x4e, 0xa4, 0x7e, 0x35, 0xa6, 0x1f, 0xc2, 0xc5, 0x91, 0x69, 0x9f, 0x2a, 0xe4, 0xff, 0xf4, 0xee, - 0xdb, 0xea, 0x50, 0x08, 0x63, 0x0c, 0x9a, 0x89, 0x88, 0xb1, 0x98, 0x0a, 0xbd, 0xef, 0x27, 0x5a, - 0xaf, 0x4e, 0xf4, 0x7b, 0x70, 0x8a, 0xbe, 0x99, 0x26, 0xcc, 0xd7, 0xe9, 0xc3, 0x2a, 0x48, 0xb2, - 0x98, 0x98, 0x4d, 0xee, 0x92, 0xe3, 0x26, 0x8b, 0xd9, 0xc7, 0xd0, 0xd6, 0x3b, 0x42, 0xea, 0x84, - 0xb4, 0xf4, 0xee, 0x26, 0x8b, 0xfd, 0x3f, 0xeb, 0x70, 0xf6, 0xfe, 0x12, 0x30, 0x69, 0x94, 0x16, - 0x52, 0x07, 0xfb, 0xdf, 0xc2, 0x25, 0xc7, 0x35, 0xe6, 0xec, 0xd2, 0xe8, 0x0b, 0x09, 0xaa, 0x13, - 0xd4, 0xc6, 0x24, 0x34, 0xc0, 0x0b, 0xe8, 0x47, 0x5a, 0x06, 0xb8, 0x5b, 0x8a, 0x4c, 0x69, 0x0c, - 0xa9, 0xcf, 0x2e, 0xef, 0x45, 0x5a, 0xce, 0x4a, 0x1f, 0x9b, 0x42, 0x47, 0x8a, 0x6d, 0x71, 0x9a, - 0x9b, 0x34, 0xfe, 0xfd, 0x69, 0xa6, 0x0a, 0xe8, 0x00, 0x5f, 0x3d, 0xe3, 0xae, 0x14, 0x5b, 0x7b, - 0x98, 0x39, 0x5c, 0x50, 0x7c, 0x10, 0xa3, 0x5c, 0xad, 0xed, 0x10, 0x51, 0x79, 0x2d, 0x62, 0x0f, - 0x8f, 0xb0, 0xdf, 0x50, 0xdc, 0x6d, 0x16, 0xc7, 0x42, 0xe6, 0x57, 0xcf, 0xf8, 0x47, 0x72, 0xef, - 0xa5, 0xed, 0xa2, 0x7e, 0xec, 0x01, 0xd8, 0x9c, 0x66, 0x29, 0xfa, 0x5f, 0x03, 0xec, 0xd9, 0xec, - 0x25, 0xb8, 0x66, 0x0d, 0x9f, 0x5a, 0xb1, 0xce, 0x6a, 0x43, 0xb1, 0xfe, 0x5b, 0xb8, 0xfc, 0xc0, - 0x77, 0xcd, 0x4f, 0x17, 0x8b, 0x5d, 0x10, 0xe2, 0x42, 0xa2, 0x9d, 0x63, 0x9f, 0x77, 0x62, 0xb1, - 0x7b, 0x4d, 0x0e, 0xd3, 0x64, 0x03, 0xaf, 0x71, 0x83, 0x6b, 0xea, 0x64, 0x9f, 0xbb, 0xb1, 0xd8, - 0xfd, 0x62, 0x6c, 0x36, 0x82, 0xc1, 0x3b, 0xb0, 0xd4, 0x6b, 0xb6, 0x50, 0x8f, 0x9f, 0x95, 0x31, - 0x85, 0x10, 0x09, 0xd3, 0x54, 0x2e, 0xc6, 0xcb, 0xfc, 0x09, 0xa5, 0xbd, 0x51, 0xc6, 0x8f, 0x62, - 0x2e, 0xa3, 0x07, 0x7b, 0x83, 0xa8, 0x71, 0xe1, 0xb4, 0xe5, 0x17, 0x32, 0x7e, 0xff, 0x6e, 0x11, - 0xe9, 0x65, 0x36, 0x1f, 0x3f, 0xa4, 0xf1, 0xa4, 0x42, 0x9d, 0x58, 0xea, 0x2b, 0x4b, 0x7d, 0xb5, - 0x48, 0x27, 0xc7, 0x2e, 0xa9, 0x79, 0x9b, 0xf0, 0x2f, 0xff, 0x09, 0x00, 0x00, 0xff, 0xff, 0x3e, - 0x32, 0xae, 0x35, 0xc3, 0x06, 0x00, 0x00, -} diff --git a/vendor/github.com/hyperledger/fabric-protos-go/ledger/rwset/rwset.pb.go b/vendor/github.com/hyperledger/fabric-protos-go/ledger/rwset/rwset.pb.go deleted file mode 100644 index 5bacfdcc574..00000000000 --- a/vendor/github.com/hyperledger/fabric-protos-go/ledger/rwset/rwset.pb.go +++ /dev/null @@ -1,392 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: ledger/rwset/rwset.proto - -package rwset - -import ( - fmt "fmt" - proto "github.com/golang/protobuf/proto" - math "math" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package - -type TxReadWriteSet_DataModel int32 - -const ( - TxReadWriteSet_KV TxReadWriteSet_DataModel = 0 -) - -var TxReadWriteSet_DataModel_name = map[int32]string{ - 0: "KV", -} - -var TxReadWriteSet_DataModel_value = map[string]int32{ - "KV": 0, -} - -func (x TxReadWriteSet_DataModel) String() string { - return proto.EnumName(TxReadWriteSet_DataModel_name, int32(x)) -} - -func (TxReadWriteSet_DataModel) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_794d00b812408f20, []int{0, 0} -} - -// TxReadWriteSet encapsulates a read-write set for a transaction -// DataModel specifies the enum value of the data model -// ns_rwset field specifies a list of chaincode specific read-write set (one for each chaincode) -type TxReadWriteSet struct { - DataModel TxReadWriteSet_DataModel `protobuf:"varint,1,opt,name=data_model,json=dataModel,proto3,enum=rwset.TxReadWriteSet_DataModel" json:"data_model,omitempty"` - NsRwset []*NsReadWriteSet `protobuf:"bytes,2,rep,name=ns_rwset,json=nsRwset,proto3" json:"ns_rwset,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *TxReadWriteSet) Reset() { *m = TxReadWriteSet{} } -func (m *TxReadWriteSet) String() string { return proto.CompactTextString(m) } -func (*TxReadWriteSet) ProtoMessage() {} -func (*TxReadWriteSet) Descriptor() ([]byte, []int) { - return fileDescriptor_794d00b812408f20, []int{0} -} - -func (m *TxReadWriteSet) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_TxReadWriteSet.Unmarshal(m, b) -} -func (m *TxReadWriteSet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_TxReadWriteSet.Marshal(b, m, deterministic) -} -func (m *TxReadWriteSet) XXX_Merge(src proto.Message) { - xxx_messageInfo_TxReadWriteSet.Merge(m, src) -} -func (m *TxReadWriteSet) XXX_Size() int { - return xxx_messageInfo_TxReadWriteSet.Size(m) -} -func (m *TxReadWriteSet) XXX_DiscardUnknown() { - xxx_messageInfo_TxReadWriteSet.DiscardUnknown(m) -} - -var xxx_messageInfo_TxReadWriteSet proto.InternalMessageInfo - -func (m *TxReadWriteSet) GetDataModel() TxReadWriteSet_DataModel { - if m != nil { - return m.DataModel - } - return TxReadWriteSet_KV -} - -func (m *TxReadWriteSet) GetNsRwset() []*NsReadWriteSet { - if m != nil { - return m.NsRwset - } - return nil -} - -// NsReadWriteSet encapsulates the read-write set for a chaincode -type NsReadWriteSet struct { - Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"` - Rwset []byte `protobuf:"bytes,2,opt,name=rwset,proto3" json:"rwset,omitempty"` - CollectionHashedRwset []*CollectionHashedReadWriteSet `protobuf:"bytes,3,rep,name=collection_hashed_rwset,json=collectionHashedRwset,proto3" json:"collection_hashed_rwset,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *NsReadWriteSet) Reset() { *m = NsReadWriteSet{} } -func (m *NsReadWriteSet) String() string { return proto.CompactTextString(m) } -func (*NsReadWriteSet) ProtoMessage() {} -func (*NsReadWriteSet) Descriptor() ([]byte, []int) { - return fileDescriptor_794d00b812408f20, []int{1} -} - -func (m *NsReadWriteSet) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_NsReadWriteSet.Unmarshal(m, b) -} -func (m *NsReadWriteSet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_NsReadWriteSet.Marshal(b, m, deterministic) -} -func (m *NsReadWriteSet) XXX_Merge(src proto.Message) { - xxx_messageInfo_NsReadWriteSet.Merge(m, src) -} -func (m *NsReadWriteSet) XXX_Size() int { - return xxx_messageInfo_NsReadWriteSet.Size(m) -} -func (m *NsReadWriteSet) XXX_DiscardUnknown() { - xxx_messageInfo_NsReadWriteSet.DiscardUnknown(m) -} - -var xxx_messageInfo_NsReadWriteSet proto.InternalMessageInfo - -func (m *NsReadWriteSet) GetNamespace() string { - if m != nil { - return m.Namespace - } - return "" -} - -func (m *NsReadWriteSet) GetRwset() []byte { - if m != nil { - return m.Rwset - } - return nil -} - -func (m *NsReadWriteSet) GetCollectionHashedRwset() []*CollectionHashedReadWriteSet { - if m != nil { - return m.CollectionHashedRwset - } - return nil -} - -// CollectionHashedReadWriteSet encapsulate the hashed representation for the private read-write set for a collection -type CollectionHashedReadWriteSet struct { - CollectionName string `protobuf:"bytes,1,opt,name=collection_name,json=collectionName,proto3" json:"collection_name,omitempty"` - HashedRwset []byte `protobuf:"bytes,2,opt,name=hashed_rwset,json=hashedRwset,proto3" json:"hashed_rwset,omitempty"` - PvtRwsetHash []byte `protobuf:"bytes,3,opt,name=pvt_rwset_hash,json=pvtRwsetHash,proto3" json:"pvt_rwset_hash,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CollectionHashedReadWriteSet) Reset() { *m = CollectionHashedReadWriteSet{} } -func (m *CollectionHashedReadWriteSet) String() string { return proto.CompactTextString(m) } -func (*CollectionHashedReadWriteSet) ProtoMessage() {} -func (*CollectionHashedReadWriteSet) Descriptor() ([]byte, []int) { - return fileDescriptor_794d00b812408f20, []int{2} -} - -func (m *CollectionHashedReadWriteSet) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CollectionHashedReadWriteSet.Unmarshal(m, b) -} -func (m *CollectionHashedReadWriteSet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CollectionHashedReadWriteSet.Marshal(b, m, deterministic) -} -func (m *CollectionHashedReadWriteSet) XXX_Merge(src proto.Message) { - xxx_messageInfo_CollectionHashedReadWriteSet.Merge(m, src) -} -func (m *CollectionHashedReadWriteSet) XXX_Size() int { - return xxx_messageInfo_CollectionHashedReadWriteSet.Size(m) -} -func (m *CollectionHashedReadWriteSet) XXX_DiscardUnknown() { - xxx_messageInfo_CollectionHashedReadWriteSet.DiscardUnknown(m) -} - -var xxx_messageInfo_CollectionHashedReadWriteSet proto.InternalMessageInfo - -func (m *CollectionHashedReadWriteSet) GetCollectionName() string { - if m != nil { - return m.CollectionName - } - return "" -} - -func (m *CollectionHashedReadWriteSet) GetHashedRwset() []byte { - if m != nil { - return m.HashedRwset - } - return nil -} - -func (m *CollectionHashedReadWriteSet) GetPvtRwsetHash() []byte { - if m != nil { - return m.PvtRwsetHash - } - return nil -} - -// TxPvtReadWriteSet encapsulate the private read-write set for a transaction -type TxPvtReadWriteSet struct { - DataModel TxReadWriteSet_DataModel `protobuf:"varint,1,opt,name=data_model,json=dataModel,proto3,enum=rwset.TxReadWriteSet_DataModel" json:"data_model,omitempty"` - NsPvtRwset []*NsPvtReadWriteSet `protobuf:"bytes,2,rep,name=ns_pvt_rwset,json=nsPvtRwset,proto3" json:"ns_pvt_rwset,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *TxPvtReadWriteSet) Reset() { *m = TxPvtReadWriteSet{} } -func (m *TxPvtReadWriteSet) String() string { return proto.CompactTextString(m) } -func (*TxPvtReadWriteSet) ProtoMessage() {} -func (*TxPvtReadWriteSet) Descriptor() ([]byte, []int) { - return fileDescriptor_794d00b812408f20, []int{3} -} - -func (m *TxPvtReadWriteSet) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_TxPvtReadWriteSet.Unmarshal(m, b) -} -func (m *TxPvtReadWriteSet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_TxPvtReadWriteSet.Marshal(b, m, deterministic) -} -func (m *TxPvtReadWriteSet) XXX_Merge(src proto.Message) { - xxx_messageInfo_TxPvtReadWriteSet.Merge(m, src) -} -func (m *TxPvtReadWriteSet) XXX_Size() int { - return xxx_messageInfo_TxPvtReadWriteSet.Size(m) -} -func (m *TxPvtReadWriteSet) XXX_DiscardUnknown() { - xxx_messageInfo_TxPvtReadWriteSet.DiscardUnknown(m) -} - -var xxx_messageInfo_TxPvtReadWriteSet proto.InternalMessageInfo - -func (m *TxPvtReadWriteSet) GetDataModel() TxReadWriteSet_DataModel { - if m != nil { - return m.DataModel - } - return TxReadWriteSet_KV -} - -func (m *TxPvtReadWriteSet) GetNsPvtRwset() []*NsPvtReadWriteSet { - if m != nil { - return m.NsPvtRwset - } - return nil -} - -// NsPvtReadWriteSet encapsulates the private read-write set for a chaincode -type NsPvtReadWriteSet struct { - Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"` - CollectionPvtRwset []*CollectionPvtReadWriteSet `protobuf:"bytes,2,rep,name=collection_pvt_rwset,json=collectionPvtRwset,proto3" json:"collection_pvt_rwset,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *NsPvtReadWriteSet) Reset() { *m = NsPvtReadWriteSet{} } -func (m *NsPvtReadWriteSet) String() string { return proto.CompactTextString(m) } -func (*NsPvtReadWriteSet) ProtoMessage() {} -func (*NsPvtReadWriteSet) Descriptor() ([]byte, []int) { - return fileDescriptor_794d00b812408f20, []int{4} -} - -func (m *NsPvtReadWriteSet) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_NsPvtReadWriteSet.Unmarshal(m, b) -} -func (m *NsPvtReadWriteSet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_NsPvtReadWriteSet.Marshal(b, m, deterministic) -} -func (m *NsPvtReadWriteSet) XXX_Merge(src proto.Message) { - xxx_messageInfo_NsPvtReadWriteSet.Merge(m, src) -} -func (m *NsPvtReadWriteSet) XXX_Size() int { - return xxx_messageInfo_NsPvtReadWriteSet.Size(m) -} -func (m *NsPvtReadWriteSet) XXX_DiscardUnknown() { - xxx_messageInfo_NsPvtReadWriteSet.DiscardUnknown(m) -} - -var xxx_messageInfo_NsPvtReadWriteSet proto.InternalMessageInfo - -func (m *NsPvtReadWriteSet) GetNamespace() string { - if m != nil { - return m.Namespace - } - return "" -} - -func (m *NsPvtReadWriteSet) GetCollectionPvtRwset() []*CollectionPvtReadWriteSet { - if m != nil { - return m.CollectionPvtRwset - } - return nil -} - -// CollectionPvtReadWriteSet encapsulates the private read-write set for a collection -type CollectionPvtReadWriteSet struct { - CollectionName string `protobuf:"bytes,1,opt,name=collection_name,json=collectionName,proto3" json:"collection_name,omitempty"` - Rwset []byte `protobuf:"bytes,2,opt,name=rwset,proto3" json:"rwset,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CollectionPvtReadWriteSet) Reset() { *m = CollectionPvtReadWriteSet{} } -func (m *CollectionPvtReadWriteSet) String() string { return proto.CompactTextString(m) } -func (*CollectionPvtReadWriteSet) ProtoMessage() {} -func (*CollectionPvtReadWriteSet) Descriptor() ([]byte, []int) { - return fileDescriptor_794d00b812408f20, []int{5} -} - -func (m *CollectionPvtReadWriteSet) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CollectionPvtReadWriteSet.Unmarshal(m, b) -} -func (m *CollectionPvtReadWriteSet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CollectionPvtReadWriteSet.Marshal(b, m, deterministic) -} -func (m *CollectionPvtReadWriteSet) XXX_Merge(src proto.Message) { - xxx_messageInfo_CollectionPvtReadWriteSet.Merge(m, src) -} -func (m *CollectionPvtReadWriteSet) XXX_Size() int { - return xxx_messageInfo_CollectionPvtReadWriteSet.Size(m) -} -func (m *CollectionPvtReadWriteSet) XXX_DiscardUnknown() { - xxx_messageInfo_CollectionPvtReadWriteSet.DiscardUnknown(m) -} - -var xxx_messageInfo_CollectionPvtReadWriteSet proto.InternalMessageInfo - -func (m *CollectionPvtReadWriteSet) GetCollectionName() string { - if m != nil { - return m.CollectionName - } - return "" -} - -func (m *CollectionPvtReadWriteSet) GetRwset() []byte { - if m != nil { - return m.Rwset - } - return nil -} - -func init() { - proto.RegisterEnum("rwset.TxReadWriteSet_DataModel", TxReadWriteSet_DataModel_name, TxReadWriteSet_DataModel_value) - proto.RegisterType((*TxReadWriteSet)(nil), "rwset.TxReadWriteSet") - proto.RegisterType((*NsReadWriteSet)(nil), "rwset.NsReadWriteSet") - proto.RegisterType((*CollectionHashedReadWriteSet)(nil), "rwset.CollectionHashedReadWriteSet") - proto.RegisterType((*TxPvtReadWriteSet)(nil), "rwset.TxPvtReadWriteSet") - proto.RegisterType((*NsPvtReadWriteSet)(nil), "rwset.NsPvtReadWriteSet") - proto.RegisterType((*CollectionPvtReadWriteSet)(nil), "rwset.CollectionPvtReadWriteSet") -} - -func init() { proto.RegisterFile("ledger/rwset/rwset.proto", fileDescriptor_794d00b812408f20) } - -var fileDescriptor_794d00b812408f20 = []byte{ - // 421 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x93, 0xcf, 0xef, 0x93, 0x30, - 0x18, 0xc6, 0xed, 0x77, 0xd9, 0x94, 0x77, 0x04, 0x5d, 0xdd, 0x22, 0x26, 0x4b, 0x9c, 0xd3, 0xc4, - 0xc5, 0x64, 0x60, 0xa6, 0x27, 0x0f, 0x1e, 0xd4, 0x83, 0x89, 0x71, 0x31, 0x75, 0xd1, 0x64, 0x1e, - 0x48, 0x81, 0x0a, 0x24, 0x40, 0x09, 0xad, 0x73, 0xfe, 0x01, 0x9e, 0xf5, 0xe6, 0xd9, 0xff, 0xd4, - 0xac, 0x65, 0x0c, 0x98, 0xbf, 0x0e, 0x5e, 0x08, 0x7d, 0xfb, 0x3c, 0x3c, 0x9f, 0xf6, 0xe5, 0x05, - 0x3b, 0x65, 0x61, 0xc4, 0x4a, 0xb7, 0xfc, 0x24, 0x98, 0xd4, 0x4f, 0xa7, 0x28, 0xb9, 0xe4, 0xb8, - 0xaf, 0x16, 0xf3, 0xef, 0x08, 0xac, 0xcd, 0x9e, 0x30, 0x1a, 0xbe, 0x2b, 0x13, 0xc9, 0xde, 0x30, - 0x89, 0x9f, 0x00, 0x84, 0x54, 0x52, 0x2f, 0xe3, 0x21, 0x4b, 0x6d, 0x34, 0x43, 0x0b, 0x6b, 0x75, - 0xcb, 0xd1, 0xde, 0xb6, 0xd4, 0x79, 0x4e, 0x25, 0x7d, 0x75, 0x90, 0x11, 0x23, 0x3c, 0xbe, 0xe2, - 0x07, 0x70, 0x25, 0x17, 0x9e, 0xd2, 0xdb, 0x17, 0xb3, 0xde, 0x62, 0xb8, 0x9a, 0x54, 0xee, 0xb5, - 0x68, 0xba, 0xc9, 0xe5, 0x5c, 0x10, 0x05, 0x71, 0x1d, 0x8c, 0xfa, 0x4b, 0x78, 0x00, 0x17, 0x2f, - 0xdf, 0x5e, 0xbb, 0x34, 0xff, 0x81, 0xc0, 0x6a, 0x1b, 0xf0, 0x14, 0x8c, 0x9c, 0x66, 0x4c, 0x14, - 0x34, 0x60, 0x0a, 0xcc, 0x20, 0xa7, 0x02, 0x1e, 0x43, 0xff, 0x18, 0x8a, 0x16, 0x26, 0xd1, 0x0b, - 0xfc, 0x1e, 0x6e, 0x04, 0x3c, 0x4d, 0x59, 0x20, 0x13, 0x9e, 0x7b, 0x31, 0x15, 0x31, 0x0b, 0x2b, - 0xb8, 0x9e, 0x82, 0xbb, 0x53, 0xc1, 0x3d, 0xab, 0x55, 0x2f, 0x94, 0xa8, 0x85, 0x3a, 0x09, 0xba, - 0xbb, 0x0a, 0xfc, 0x1b, 0x82, 0xe9, 0x9f, 0x7c, 0xf8, 0x1e, 0x5c, 0x6d, 0xa4, 0x1f, 0x58, 0x2b, - 0x6e, 0xeb, 0x54, 0x5e, 0xd3, 0x8c, 0xe1, 0xdb, 0x60, 0xb6, 0xd8, 0xf4, 0x19, 0x86, 0xf1, 0x29, - 0x0c, 0xdf, 0x05, 0xab, 0xd8, 0x49, 0xbd, 0xaf, 0x0e, 0x62, 0xf7, 0x94, 0xc8, 0x2c, 0x76, 0x52, - 0x29, 0x0e, 0xf9, 0xf3, 0xaf, 0x08, 0x46, 0x9b, 0xfd, 0xeb, 0x9d, 0xfc, 0xaf, 0x3d, 0x7d, 0x0c, - 0x66, 0x2e, 0xbc, 0x3a, 0xbe, 0xea, 0xab, 0x5d, 0xf7, 0xb5, 0x93, 0x47, 0x20, 0x57, 0x25, 0x75, - 0x49, 0x5f, 0x10, 0x8c, 0xce, 0x14, 0x7f, 0xe9, 0x25, 0x81, 0x71, 0xe3, 0xde, 0xba, 0xb9, 0xb3, - 0xb3, 0x96, 0x75, 0xf3, 0x71, 0xd0, 0xda, 0x52, 0x1c, 0x5b, 0xb8, 0xf9, 0x5b, 0xc3, 0xbf, 0x37, - 0xea, 0x97, 0x7f, 0xd9, 0x53, 0x1f, 0xee, 0xf3, 0x32, 0x72, 0xe2, 0xcf, 0x05, 0x2b, 0xf5, 0xc8, - 0x39, 0x1f, 0xa8, 0x5f, 0x26, 0x81, 0x9e, 0x36, 0xe1, 0x54, 0x45, 0xa5, 0xde, 0x3e, 0x8a, 0x12, - 0x19, 0x7f, 0xf4, 0x9d, 0x80, 0x67, 0x6e, 0xc3, 0xe2, 0x6a, 0xcb, 0x52, 0x5b, 0x96, 0x11, 0x77, - 0x9b, 0xd3, 0xeb, 0x0f, 0x54, 0xfd, 0xe1, 0xcf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x47, 0x32, 0x8f, - 0x91, 0xd4, 0x03, 0x00, 0x00, -} diff --git a/vendor/github.com/hyperledger/fabric-protos-go/msp/identities.pb.go b/vendor/github.com/hyperledger/fabric-protos-go/msp/identities.pb.go deleted file mode 100644 index 65bcfb216ad..00000000000 --- a/vendor/github.com/hyperledger/fabric-protos-go/msp/identities.pb.go +++ /dev/null @@ -1,184 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: msp/identities.proto - -package msp - -import ( - fmt "fmt" - proto "github.com/golang/protobuf/proto" - math "math" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package - -// This struct represents an Identity -// (with its MSP identifier) to be used -// to serialize it and deserialize it -type SerializedIdentity struct { - // The identifier of the associated membership service provider - Mspid string `protobuf:"bytes,1,opt,name=mspid,proto3" json:"mspid,omitempty"` - // the Identity, serialized according to the rules of its MPS - IdBytes []byte `protobuf:"bytes,2,opt,name=id_bytes,json=idBytes,proto3" json:"id_bytes,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SerializedIdentity) Reset() { *m = SerializedIdentity{} } -func (m *SerializedIdentity) String() string { return proto.CompactTextString(m) } -func (*SerializedIdentity) ProtoMessage() {} -func (*SerializedIdentity) Descriptor() ([]byte, []int) { - return fileDescriptor_872f7fc14bf2c238, []int{0} -} - -func (m *SerializedIdentity) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SerializedIdentity.Unmarshal(m, b) -} -func (m *SerializedIdentity) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SerializedIdentity.Marshal(b, m, deterministic) -} -func (m *SerializedIdentity) XXX_Merge(src proto.Message) { - xxx_messageInfo_SerializedIdentity.Merge(m, src) -} -func (m *SerializedIdentity) XXX_Size() int { - return xxx_messageInfo_SerializedIdentity.Size(m) -} -func (m *SerializedIdentity) XXX_DiscardUnknown() { - xxx_messageInfo_SerializedIdentity.DiscardUnknown(m) -} - -var xxx_messageInfo_SerializedIdentity proto.InternalMessageInfo - -func (m *SerializedIdentity) GetMspid() string { - if m != nil { - return m.Mspid - } - return "" -} - -func (m *SerializedIdentity) GetIdBytes() []byte { - if m != nil { - return m.IdBytes - } - return nil -} - -// This struct represents an Idemix Identity -// to be used to serialize it and deserialize it. -// The IdemixMSP will first serialize an idemix identity to bytes using -// this proto, and then uses these bytes as id_bytes in SerializedIdentity -type SerializedIdemixIdentity struct { - // nym_x is the X-component of the pseudonym elliptic curve point. - // It is a []byte representation of an amcl.BIG - // The pseudonym can be seen as a public key of the identity, it is used to verify signatures. - NymX []byte `protobuf:"bytes,1,opt,name=nym_x,json=nymX,proto3" json:"nym_x,omitempty"` - // nym_y is the Y-component of the pseudonym elliptic curve point. - // It is a []byte representation of an amcl.BIG - // The pseudonym can be seen as a public key of the identity, it is used to verify signatures. - NymY []byte `protobuf:"bytes,2,opt,name=nym_y,json=nymY,proto3" json:"nym_y,omitempty"` - // ou contains the organizational unit of the idemix identity - Ou []byte `protobuf:"bytes,3,opt,name=ou,proto3" json:"ou,omitempty"` - // role contains the role of this identity (e.g., ADMIN or MEMBER) - Role []byte `protobuf:"bytes,4,opt,name=role,proto3" json:"role,omitempty"` - // proof contains the cryptographic evidence that this identity is valid - Proof []byte `protobuf:"bytes,5,opt,name=proof,proto3" json:"proof,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SerializedIdemixIdentity) Reset() { *m = SerializedIdemixIdentity{} } -func (m *SerializedIdemixIdentity) String() string { return proto.CompactTextString(m) } -func (*SerializedIdemixIdentity) ProtoMessage() {} -func (*SerializedIdemixIdentity) Descriptor() ([]byte, []int) { - return fileDescriptor_872f7fc14bf2c238, []int{1} -} - -func (m *SerializedIdemixIdentity) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SerializedIdemixIdentity.Unmarshal(m, b) -} -func (m *SerializedIdemixIdentity) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SerializedIdemixIdentity.Marshal(b, m, deterministic) -} -func (m *SerializedIdemixIdentity) XXX_Merge(src proto.Message) { - xxx_messageInfo_SerializedIdemixIdentity.Merge(m, src) -} -func (m *SerializedIdemixIdentity) XXX_Size() int { - return xxx_messageInfo_SerializedIdemixIdentity.Size(m) -} -func (m *SerializedIdemixIdentity) XXX_DiscardUnknown() { - xxx_messageInfo_SerializedIdemixIdentity.DiscardUnknown(m) -} - -var xxx_messageInfo_SerializedIdemixIdentity proto.InternalMessageInfo - -func (m *SerializedIdemixIdentity) GetNymX() []byte { - if m != nil { - return m.NymX - } - return nil -} - -func (m *SerializedIdemixIdentity) GetNymY() []byte { - if m != nil { - return m.NymY - } - return nil -} - -func (m *SerializedIdemixIdentity) GetOu() []byte { - if m != nil { - return m.Ou - } - return nil -} - -func (m *SerializedIdemixIdentity) GetRole() []byte { - if m != nil { - return m.Role - } - return nil -} - -func (m *SerializedIdemixIdentity) GetProof() []byte { - if m != nil { - return m.Proof - } - return nil -} - -func init() { - proto.RegisterType((*SerializedIdentity)(nil), "msp.SerializedIdentity") - proto.RegisterType((*SerializedIdemixIdentity)(nil), "msp.SerializedIdemixIdentity") -} - -func init() { proto.RegisterFile("msp/identities.proto", fileDescriptor_872f7fc14bf2c238) } - -var fileDescriptor_872f7fc14bf2c238 = []byte{ - // 243 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x8f, 0x31, 0x4f, 0xfb, 0x30, - 0x10, 0x47, 0x95, 0x34, 0xf9, 0xff, 0xc1, 0xaa, 0x18, 0x4c, 0x07, 0xb3, 0x95, 0x4e, 0x95, 0x50, - 0x9d, 0x81, 0x6f, 0x50, 0x89, 0x81, 0x0d, 0x85, 0x05, 0x58, 0xaa, 0xa6, 0xbe, 0xa6, 0x27, 0xe5, - 0x72, 0x96, 0xed, 0x48, 0x35, 0x03, 0x9f, 0x1d, 0x25, 0x06, 0x04, 0x9b, 0x7f, 0x4f, 0x4f, 0x4f, - 0x3e, 0xb1, 0x20, 0x6f, 0x2b, 0x34, 0xd0, 0x07, 0x0c, 0x08, 0x5e, 0x5b, 0xc7, 0x81, 0xe5, 0x8c, - 0xbc, 0x5d, 0x3d, 0x08, 0xf9, 0x0c, 0x0e, 0xf7, 0x1d, 0xbe, 0x83, 0x79, 0x4c, 0x4a, 0x94, 0x0b, - 0x51, 0x92, 0xb7, 0x68, 0x54, 0xb6, 0xcc, 0xd6, 0x97, 0x75, 0x1a, 0xf2, 0x46, 0x5c, 0xa0, 0xd9, - 0x35, 0x31, 0x80, 0x57, 0xf9, 0x32, 0x5b, 0xcf, 0xeb, 0xff, 0x68, 0xb6, 0xe3, 0x5c, 0x7d, 0x08, - 0xf5, 0x27, 0x43, 0x78, 0xfe, 0x89, 0x5d, 0x8b, 0xb2, 0x8f, 0xb4, 0x3b, 0x4f, 0xb1, 0x79, 0x5d, - 0xf4, 0x91, 0x5e, 0xbe, 0x61, 0xfc, 0x0a, 0x8d, 0xf0, 0x55, 0x5e, 0x89, 0x9c, 0x07, 0x35, 0x9b, - 0x48, 0xce, 0x83, 0x94, 0xa2, 0x70, 0xdc, 0x81, 0x2a, 0x92, 0x33, 0xbe, 0xc7, 0xaf, 0x59, 0xc7, - 0x7c, 0x54, 0xe5, 0x04, 0xd3, 0xd8, 0x3e, 0x89, 0x5b, 0x76, 0xad, 0x3e, 0x45, 0x0b, 0xae, 0x03, - 0xd3, 0x82, 0xd3, 0xc7, 0x7d, 0xe3, 0xf0, 0x90, 0x6e, 0xf5, 0x9a, 0xbc, 0x7d, 0xbb, 0x6b, 0x31, - 0x9c, 0x86, 0x46, 0x1f, 0x98, 0xaa, 0x5f, 0x66, 0x95, 0xcc, 0x4d, 0x32, 0x37, 0x2d, 0x57, 0xe4, - 0x6d, 0xf3, 0x6f, 0x9a, 0xf7, 0x9f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x2d, 0xf7, 0x41, 0xf7, 0x3c, - 0x01, 0x00, 0x00, -} diff --git a/vendor/github.com/hyperledger/fabric-protos-go/msp/msp_config.pb.go b/vendor/github.com/hyperledger/fabric-protos-go/msp/msp_config.pb.go deleted file mode 100644 index 005663c1b98..00000000000 --- a/vendor/github.com/hyperledger/fabric-protos-go/msp/msp_config.pb.go +++ /dev/null @@ -1,775 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: msp/msp_config.proto - -package msp - -import ( - fmt "fmt" - proto "github.com/golang/protobuf/proto" - math "math" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package - -// MSPConfig collects all the configuration information for -// an MSP. The Config field should be unmarshalled in a way -// that depends on the Type -type MSPConfig struct { - // Type holds the type of the MSP; the default one would - // be of type FABRIC implementing an X.509 based provider - Type int32 `protobuf:"varint,1,opt,name=type,proto3" json:"type,omitempty"` - // Config is MSP dependent configuration info - Config []byte `protobuf:"bytes,2,opt,name=config,proto3" json:"config,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MSPConfig) Reset() { *m = MSPConfig{} } -func (m *MSPConfig) String() string { return proto.CompactTextString(m) } -func (*MSPConfig) ProtoMessage() {} -func (*MSPConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_9c34771f529d9d1a, []int{0} -} - -func (m *MSPConfig) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MSPConfig.Unmarshal(m, b) -} -func (m *MSPConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MSPConfig.Marshal(b, m, deterministic) -} -func (m *MSPConfig) XXX_Merge(src proto.Message) { - xxx_messageInfo_MSPConfig.Merge(m, src) -} -func (m *MSPConfig) XXX_Size() int { - return xxx_messageInfo_MSPConfig.Size(m) -} -func (m *MSPConfig) XXX_DiscardUnknown() { - xxx_messageInfo_MSPConfig.DiscardUnknown(m) -} - -var xxx_messageInfo_MSPConfig proto.InternalMessageInfo - -func (m *MSPConfig) GetType() int32 { - if m != nil { - return m.Type - } - return 0 -} - -func (m *MSPConfig) GetConfig() []byte { - if m != nil { - return m.Config - } - return nil -} - -// FabricMSPConfig collects all the configuration information for -// a Fabric MSP. -// Here we assume a default certificate validation policy, where -// any certificate signed by any of the listed rootCA certs would -// be considered as valid under this MSP. -// This MSP may or may not come with a signing identity. If it does, -// it can also issue signing identities. If it does not, it can only -// be used to validate and verify certificates. -type FabricMSPConfig struct { - // Name holds the identifier of the MSP; MSP identifier - // is chosen by the application that governs this MSP. - // For example, and assuming the default implementation of MSP, - // that is X.509-based and considers a single Issuer, - // this can refer to the Subject OU field or the Issuer OU field. - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // List of root certificates trusted by this MSP - // they are used upon certificate validation (see - // comment for IntermediateCerts below) - RootCerts [][]byte `protobuf:"bytes,2,rep,name=root_certs,json=rootCerts,proto3" json:"root_certs,omitempty"` - // List of intermediate certificates trusted by this MSP; - // they are used upon certificate validation as follows: - // validation attempts to build a path from the certificate - // to be validated (which is at one end of the path) and - // one of the certs in the RootCerts field (which is at - // the other end of the path). If the path is longer than - // 2, certificates in the middle are searched within the - // IntermediateCerts pool - IntermediateCerts [][]byte `protobuf:"bytes,3,rep,name=intermediate_certs,json=intermediateCerts,proto3" json:"intermediate_certs,omitempty"` - // Identity denoting the administrator of this MSP - Admins [][]byte `protobuf:"bytes,4,rep,name=admins,proto3" json:"admins,omitempty"` - // Identity revocation list - RevocationList [][]byte `protobuf:"bytes,5,rep,name=revocation_list,json=revocationList,proto3" json:"revocation_list,omitempty"` - // SigningIdentity holds information on the signing identity - // this peer is to use, and which is to be imported by the - // MSP defined before - SigningIdentity *SigningIdentityInfo `protobuf:"bytes,6,opt,name=signing_identity,json=signingIdentity,proto3" json:"signing_identity,omitempty"` - // OrganizationalUnitIdentifiers holds one or more - // fabric organizational unit identifiers that belong to - // this MSP configuration - OrganizationalUnitIdentifiers []*FabricOUIdentifier `protobuf:"bytes,7,rep,name=organizational_unit_identifiers,json=organizationalUnitIdentifiers,proto3" json:"organizational_unit_identifiers,omitempty"` - // FabricCryptoConfig contains the configuration parameters - // for the cryptographic algorithms used by this MSP - CryptoConfig *FabricCryptoConfig `protobuf:"bytes,8,opt,name=crypto_config,json=cryptoConfig,proto3" json:"crypto_config,omitempty"` - // List of TLS root certificates trusted by this MSP. - // They are returned by GetTLSRootCerts. - TlsRootCerts [][]byte `protobuf:"bytes,9,rep,name=tls_root_certs,json=tlsRootCerts,proto3" json:"tls_root_certs,omitempty"` - // List of TLS intermediate certificates trusted by this MSP; - // They are returned by GetTLSIntermediateCerts. - TlsIntermediateCerts [][]byte `protobuf:"bytes,10,rep,name=tls_intermediate_certs,json=tlsIntermediateCerts,proto3" json:"tls_intermediate_certs,omitempty"` - // fabric_node_ous contains the configuration to distinguish clients from peers from orderers - // based on the OUs. - FabricNodeOus *FabricNodeOUs `protobuf:"bytes,11,opt,name=fabric_node_ous,json=fabricNodeOus,proto3" json:"fabric_node_ous,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *FabricMSPConfig) Reset() { *m = FabricMSPConfig{} } -func (m *FabricMSPConfig) String() string { return proto.CompactTextString(m) } -func (*FabricMSPConfig) ProtoMessage() {} -func (*FabricMSPConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_9c34771f529d9d1a, []int{1} -} - -func (m *FabricMSPConfig) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_FabricMSPConfig.Unmarshal(m, b) -} -func (m *FabricMSPConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_FabricMSPConfig.Marshal(b, m, deterministic) -} -func (m *FabricMSPConfig) XXX_Merge(src proto.Message) { - xxx_messageInfo_FabricMSPConfig.Merge(m, src) -} -func (m *FabricMSPConfig) XXX_Size() int { - return xxx_messageInfo_FabricMSPConfig.Size(m) -} -func (m *FabricMSPConfig) XXX_DiscardUnknown() { - xxx_messageInfo_FabricMSPConfig.DiscardUnknown(m) -} - -var xxx_messageInfo_FabricMSPConfig proto.InternalMessageInfo - -func (m *FabricMSPConfig) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *FabricMSPConfig) GetRootCerts() [][]byte { - if m != nil { - return m.RootCerts - } - return nil -} - -func (m *FabricMSPConfig) GetIntermediateCerts() [][]byte { - if m != nil { - return m.IntermediateCerts - } - return nil -} - -func (m *FabricMSPConfig) GetAdmins() [][]byte { - if m != nil { - return m.Admins - } - return nil -} - -func (m *FabricMSPConfig) GetRevocationList() [][]byte { - if m != nil { - return m.RevocationList - } - return nil -} - -func (m *FabricMSPConfig) GetSigningIdentity() *SigningIdentityInfo { - if m != nil { - return m.SigningIdentity - } - return nil -} - -func (m *FabricMSPConfig) GetOrganizationalUnitIdentifiers() []*FabricOUIdentifier { - if m != nil { - return m.OrganizationalUnitIdentifiers - } - return nil -} - -func (m *FabricMSPConfig) GetCryptoConfig() *FabricCryptoConfig { - if m != nil { - return m.CryptoConfig - } - return nil -} - -func (m *FabricMSPConfig) GetTlsRootCerts() [][]byte { - if m != nil { - return m.TlsRootCerts - } - return nil -} - -func (m *FabricMSPConfig) GetTlsIntermediateCerts() [][]byte { - if m != nil { - return m.TlsIntermediateCerts - } - return nil -} - -func (m *FabricMSPConfig) GetFabricNodeOus() *FabricNodeOUs { - if m != nil { - return m.FabricNodeOus - } - return nil -} - -// FabricCryptoConfig contains configuration parameters -// for the cryptographic algorithms used by the MSP -// this configuration refers to -type FabricCryptoConfig struct { - // SignatureHashFamily is a string representing the hash family to be used - // during sign and verify operations. - // Allowed values are "SHA2" and "SHA3". - SignatureHashFamily string `protobuf:"bytes,1,opt,name=signature_hash_family,json=signatureHashFamily,proto3" json:"signature_hash_family,omitempty"` - // IdentityIdentifierHashFunction is a string representing the hash function - // to be used during the computation of the identity identifier of an MSP identity. - // Allowed values are "SHA256", "SHA384" and "SHA3_256", "SHA3_384". - IdentityIdentifierHashFunction string `protobuf:"bytes,2,opt,name=identity_identifier_hash_function,json=identityIdentifierHashFunction,proto3" json:"identity_identifier_hash_function,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *FabricCryptoConfig) Reset() { *m = FabricCryptoConfig{} } -func (m *FabricCryptoConfig) String() string { return proto.CompactTextString(m) } -func (*FabricCryptoConfig) ProtoMessage() {} -func (*FabricCryptoConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_9c34771f529d9d1a, []int{2} -} - -func (m *FabricCryptoConfig) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_FabricCryptoConfig.Unmarshal(m, b) -} -func (m *FabricCryptoConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_FabricCryptoConfig.Marshal(b, m, deterministic) -} -func (m *FabricCryptoConfig) XXX_Merge(src proto.Message) { - xxx_messageInfo_FabricCryptoConfig.Merge(m, src) -} -func (m *FabricCryptoConfig) XXX_Size() int { - return xxx_messageInfo_FabricCryptoConfig.Size(m) -} -func (m *FabricCryptoConfig) XXX_DiscardUnknown() { - xxx_messageInfo_FabricCryptoConfig.DiscardUnknown(m) -} - -var xxx_messageInfo_FabricCryptoConfig proto.InternalMessageInfo - -func (m *FabricCryptoConfig) GetSignatureHashFamily() string { - if m != nil { - return m.SignatureHashFamily - } - return "" -} - -func (m *FabricCryptoConfig) GetIdentityIdentifierHashFunction() string { - if m != nil { - return m.IdentityIdentifierHashFunction - } - return "" -} - -// IdemixMSPConfig collects all the configuration information for -// an Idemix MSP. -type IdemixMSPConfig struct { - // Name holds the identifier of the MSP - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // ipk represents the (serialized) issuer public key - Ipk []byte `protobuf:"bytes,2,opt,name=ipk,proto3" json:"ipk,omitempty"` - // signer may contain crypto material to configure a default signer - Signer *IdemixMSPSignerConfig `protobuf:"bytes,3,opt,name=signer,proto3" json:"signer,omitempty"` - // revocation_pk is the public key used for revocation of credentials - RevocationPk []byte `protobuf:"bytes,4,opt,name=revocation_pk,json=revocationPk,proto3" json:"revocation_pk,omitempty"` - // epoch represents the current epoch (time interval) used for revocation - Epoch int64 `protobuf:"varint,5,opt,name=epoch,proto3" json:"epoch,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *IdemixMSPConfig) Reset() { *m = IdemixMSPConfig{} } -func (m *IdemixMSPConfig) String() string { return proto.CompactTextString(m) } -func (*IdemixMSPConfig) ProtoMessage() {} -func (*IdemixMSPConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_9c34771f529d9d1a, []int{3} -} - -func (m *IdemixMSPConfig) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_IdemixMSPConfig.Unmarshal(m, b) -} -func (m *IdemixMSPConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_IdemixMSPConfig.Marshal(b, m, deterministic) -} -func (m *IdemixMSPConfig) XXX_Merge(src proto.Message) { - xxx_messageInfo_IdemixMSPConfig.Merge(m, src) -} -func (m *IdemixMSPConfig) XXX_Size() int { - return xxx_messageInfo_IdemixMSPConfig.Size(m) -} -func (m *IdemixMSPConfig) XXX_DiscardUnknown() { - xxx_messageInfo_IdemixMSPConfig.DiscardUnknown(m) -} - -var xxx_messageInfo_IdemixMSPConfig proto.InternalMessageInfo - -func (m *IdemixMSPConfig) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *IdemixMSPConfig) GetIpk() []byte { - if m != nil { - return m.Ipk - } - return nil -} - -func (m *IdemixMSPConfig) GetSigner() *IdemixMSPSignerConfig { - if m != nil { - return m.Signer - } - return nil -} - -func (m *IdemixMSPConfig) GetRevocationPk() []byte { - if m != nil { - return m.RevocationPk - } - return nil -} - -func (m *IdemixMSPConfig) GetEpoch() int64 { - if m != nil { - return m.Epoch - } - return 0 -} - -// IdemixMSPSIgnerConfig contains the crypto material to set up an idemix signing identity -type IdemixMSPSignerConfig struct { - // cred represents the serialized idemix credential of the default signer - Cred []byte `protobuf:"bytes,1,opt,name=cred,proto3" json:"cred,omitempty"` - // sk is the secret key of the default signer, corresponding to credential Cred - Sk []byte `protobuf:"bytes,2,opt,name=sk,proto3" json:"sk,omitempty"` - // organizational_unit_identifier defines the organizational unit the default signer is in - OrganizationalUnitIdentifier string `protobuf:"bytes,3,opt,name=organizational_unit_identifier,json=organizationalUnitIdentifier,proto3" json:"organizational_unit_identifier,omitempty"` - // role defines whether the default signer is admin, peer, member or client - Role int32 `protobuf:"varint,4,opt,name=role,proto3" json:"role,omitempty"` - // enrollment_id contains the enrollment id of this signer - EnrollmentId string `protobuf:"bytes,5,opt,name=enrollment_id,json=enrollmentId,proto3" json:"enrollment_id,omitempty"` - // credential_revocation_information contains a serialized CredentialRevocationInformation - CredentialRevocationInformation []byte `protobuf:"bytes,6,opt,name=credential_revocation_information,json=credentialRevocationInformation,proto3" json:"credential_revocation_information,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *IdemixMSPSignerConfig) Reset() { *m = IdemixMSPSignerConfig{} } -func (m *IdemixMSPSignerConfig) String() string { return proto.CompactTextString(m) } -func (*IdemixMSPSignerConfig) ProtoMessage() {} -func (*IdemixMSPSignerConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_9c34771f529d9d1a, []int{4} -} - -func (m *IdemixMSPSignerConfig) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_IdemixMSPSignerConfig.Unmarshal(m, b) -} -func (m *IdemixMSPSignerConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_IdemixMSPSignerConfig.Marshal(b, m, deterministic) -} -func (m *IdemixMSPSignerConfig) XXX_Merge(src proto.Message) { - xxx_messageInfo_IdemixMSPSignerConfig.Merge(m, src) -} -func (m *IdemixMSPSignerConfig) XXX_Size() int { - return xxx_messageInfo_IdemixMSPSignerConfig.Size(m) -} -func (m *IdemixMSPSignerConfig) XXX_DiscardUnknown() { - xxx_messageInfo_IdemixMSPSignerConfig.DiscardUnknown(m) -} - -var xxx_messageInfo_IdemixMSPSignerConfig proto.InternalMessageInfo - -func (m *IdemixMSPSignerConfig) GetCred() []byte { - if m != nil { - return m.Cred - } - return nil -} - -func (m *IdemixMSPSignerConfig) GetSk() []byte { - if m != nil { - return m.Sk - } - return nil -} - -func (m *IdemixMSPSignerConfig) GetOrganizationalUnitIdentifier() string { - if m != nil { - return m.OrganizationalUnitIdentifier - } - return "" -} - -func (m *IdemixMSPSignerConfig) GetRole() int32 { - if m != nil { - return m.Role - } - return 0 -} - -func (m *IdemixMSPSignerConfig) GetEnrollmentId() string { - if m != nil { - return m.EnrollmentId - } - return "" -} - -func (m *IdemixMSPSignerConfig) GetCredentialRevocationInformation() []byte { - if m != nil { - return m.CredentialRevocationInformation - } - return nil -} - -// SigningIdentityInfo represents the configuration information -// related to the signing identity the peer is to use for generating -// endorsements -type SigningIdentityInfo struct { - // PublicSigner carries the public information of the signing - // identity. For an X.509 provider this would be represented by - // an X.509 certificate - PublicSigner []byte `protobuf:"bytes,1,opt,name=public_signer,json=publicSigner,proto3" json:"public_signer,omitempty"` - // PrivateSigner denotes a reference to the private key of the - // peer's signing identity - PrivateSigner *KeyInfo `protobuf:"bytes,2,opt,name=private_signer,json=privateSigner,proto3" json:"private_signer,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SigningIdentityInfo) Reset() { *m = SigningIdentityInfo{} } -func (m *SigningIdentityInfo) String() string { return proto.CompactTextString(m) } -func (*SigningIdentityInfo) ProtoMessage() {} -func (*SigningIdentityInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_9c34771f529d9d1a, []int{5} -} - -func (m *SigningIdentityInfo) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SigningIdentityInfo.Unmarshal(m, b) -} -func (m *SigningIdentityInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SigningIdentityInfo.Marshal(b, m, deterministic) -} -func (m *SigningIdentityInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_SigningIdentityInfo.Merge(m, src) -} -func (m *SigningIdentityInfo) XXX_Size() int { - return xxx_messageInfo_SigningIdentityInfo.Size(m) -} -func (m *SigningIdentityInfo) XXX_DiscardUnknown() { - xxx_messageInfo_SigningIdentityInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_SigningIdentityInfo proto.InternalMessageInfo - -func (m *SigningIdentityInfo) GetPublicSigner() []byte { - if m != nil { - return m.PublicSigner - } - return nil -} - -func (m *SigningIdentityInfo) GetPrivateSigner() *KeyInfo { - if m != nil { - return m.PrivateSigner - } - return nil -} - -// KeyInfo represents a (secret) key that is either already stored -// in the bccsp/keystore or key material to be imported to the -// bccsp key-store. In later versions it may contain also a -// keystore identifier -type KeyInfo struct { - // Identifier of the key inside the default keystore; this for - // the case of Software BCCSP as well as the HSM BCCSP would be - // the SKI of the key - KeyIdentifier string `protobuf:"bytes,1,opt,name=key_identifier,json=keyIdentifier,proto3" json:"key_identifier,omitempty"` - // KeyMaterial (optional) for the key to be imported; this is - // properly encoded key bytes, prefixed by the type of the key - KeyMaterial []byte `protobuf:"bytes,2,opt,name=key_material,json=keyMaterial,proto3" json:"key_material,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *KeyInfo) Reset() { *m = KeyInfo{} } -func (m *KeyInfo) String() string { return proto.CompactTextString(m) } -func (*KeyInfo) ProtoMessage() {} -func (*KeyInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_9c34771f529d9d1a, []int{6} -} - -func (m *KeyInfo) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_KeyInfo.Unmarshal(m, b) -} -func (m *KeyInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_KeyInfo.Marshal(b, m, deterministic) -} -func (m *KeyInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_KeyInfo.Merge(m, src) -} -func (m *KeyInfo) XXX_Size() int { - return xxx_messageInfo_KeyInfo.Size(m) -} -func (m *KeyInfo) XXX_DiscardUnknown() { - xxx_messageInfo_KeyInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_KeyInfo proto.InternalMessageInfo - -func (m *KeyInfo) GetKeyIdentifier() string { - if m != nil { - return m.KeyIdentifier - } - return "" -} - -func (m *KeyInfo) GetKeyMaterial() []byte { - if m != nil { - return m.KeyMaterial - } - return nil -} - -// FabricOUIdentifier represents an organizational unit and -// its related chain of trust identifier. -type FabricOUIdentifier struct { - // Certificate represents the second certificate in a certification chain. - // (Notice that the first certificate in a certification chain is supposed - // to be the certificate of an identity). - // It must correspond to the certificate of root or intermediate CA - // recognized by the MSP this message belongs to. - // Starting from this certificate, a certification chain is computed - // and bound to the OrganizationUnitIdentifier specified - Certificate []byte `protobuf:"bytes,1,opt,name=certificate,proto3" json:"certificate,omitempty"` - // OrganizationUnitIdentifier defines the organizational unit under the - // MSP identified with MSPIdentifier - OrganizationalUnitIdentifier string `protobuf:"bytes,2,opt,name=organizational_unit_identifier,json=organizationalUnitIdentifier,proto3" json:"organizational_unit_identifier,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *FabricOUIdentifier) Reset() { *m = FabricOUIdentifier{} } -func (m *FabricOUIdentifier) String() string { return proto.CompactTextString(m) } -func (*FabricOUIdentifier) ProtoMessage() {} -func (*FabricOUIdentifier) Descriptor() ([]byte, []int) { - return fileDescriptor_9c34771f529d9d1a, []int{7} -} - -func (m *FabricOUIdentifier) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_FabricOUIdentifier.Unmarshal(m, b) -} -func (m *FabricOUIdentifier) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_FabricOUIdentifier.Marshal(b, m, deterministic) -} -func (m *FabricOUIdentifier) XXX_Merge(src proto.Message) { - xxx_messageInfo_FabricOUIdentifier.Merge(m, src) -} -func (m *FabricOUIdentifier) XXX_Size() int { - return xxx_messageInfo_FabricOUIdentifier.Size(m) -} -func (m *FabricOUIdentifier) XXX_DiscardUnknown() { - xxx_messageInfo_FabricOUIdentifier.DiscardUnknown(m) -} - -var xxx_messageInfo_FabricOUIdentifier proto.InternalMessageInfo - -func (m *FabricOUIdentifier) GetCertificate() []byte { - if m != nil { - return m.Certificate - } - return nil -} - -func (m *FabricOUIdentifier) GetOrganizationalUnitIdentifier() string { - if m != nil { - return m.OrganizationalUnitIdentifier - } - return "" -} - -// FabricNodeOUs contains configuration to tell apart clients from peers from orderers -// based on OUs. If NodeOUs recognition is enabled then an msp identity -// that does not contain any of the specified OU will be considered invalid. -type FabricNodeOUs struct { - // If true then an msp identity that does not contain any of the specified OU will be considered invalid. - Enable bool `protobuf:"varint,1,opt,name=enable,proto3" json:"enable,omitempty"` - // OU Identifier of the clients - ClientOuIdentifier *FabricOUIdentifier `protobuf:"bytes,2,opt,name=client_ou_identifier,json=clientOuIdentifier,proto3" json:"client_ou_identifier,omitempty"` - // OU Identifier of the peers - PeerOuIdentifier *FabricOUIdentifier `protobuf:"bytes,3,opt,name=peer_ou_identifier,json=peerOuIdentifier,proto3" json:"peer_ou_identifier,omitempty"` - // OU Identifier of the admins - AdminOuIdentifier *FabricOUIdentifier `protobuf:"bytes,4,opt,name=admin_ou_identifier,json=adminOuIdentifier,proto3" json:"admin_ou_identifier,omitempty"` - // OU Identifier of the orderers - OrdererOuIdentifier *FabricOUIdentifier `protobuf:"bytes,5,opt,name=orderer_ou_identifier,json=ordererOuIdentifier,proto3" json:"orderer_ou_identifier,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *FabricNodeOUs) Reset() { *m = FabricNodeOUs{} } -func (m *FabricNodeOUs) String() string { return proto.CompactTextString(m) } -func (*FabricNodeOUs) ProtoMessage() {} -func (*FabricNodeOUs) Descriptor() ([]byte, []int) { - return fileDescriptor_9c34771f529d9d1a, []int{8} -} - -func (m *FabricNodeOUs) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_FabricNodeOUs.Unmarshal(m, b) -} -func (m *FabricNodeOUs) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_FabricNodeOUs.Marshal(b, m, deterministic) -} -func (m *FabricNodeOUs) XXX_Merge(src proto.Message) { - xxx_messageInfo_FabricNodeOUs.Merge(m, src) -} -func (m *FabricNodeOUs) XXX_Size() int { - return xxx_messageInfo_FabricNodeOUs.Size(m) -} -func (m *FabricNodeOUs) XXX_DiscardUnknown() { - xxx_messageInfo_FabricNodeOUs.DiscardUnknown(m) -} - -var xxx_messageInfo_FabricNodeOUs proto.InternalMessageInfo - -func (m *FabricNodeOUs) GetEnable() bool { - if m != nil { - return m.Enable - } - return false -} - -func (m *FabricNodeOUs) GetClientOuIdentifier() *FabricOUIdentifier { - if m != nil { - return m.ClientOuIdentifier - } - return nil -} - -func (m *FabricNodeOUs) GetPeerOuIdentifier() *FabricOUIdentifier { - if m != nil { - return m.PeerOuIdentifier - } - return nil -} - -func (m *FabricNodeOUs) GetAdminOuIdentifier() *FabricOUIdentifier { - if m != nil { - return m.AdminOuIdentifier - } - return nil -} - -func (m *FabricNodeOUs) GetOrdererOuIdentifier() *FabricOUIdentifier { - if m != nil { - return m.OrdererOuIdentifier - } - return nil -} - -func init() { - proto.RegisterType((*MSPConfig)(nil), "msp.MSPConfig") - proto.RegisterType((*FabricMSPConfig)(nil), "msp.FabricMSPConfig") - proto.RegisterType((*FabricCryptoConfig)(nil), "msp.FabricCryptoConfig") - proto.RegisterType((*IdemixMSPConfig)(nil), "msp.IdemixMSPConfig") - proto.RegisterType((*IdemixMSPSignerConfig)(nil), "msp.IdemixMSPSignerConfig") - proto.RegisterType((*SigningIdentityInfo)(nil), "msp.SigningIdentityInfo") - proto.RegisterType((*KeyInfo)(nil), "msp.KeyInfo") - proto.RegisterType((*FabricOUIdentifier)(nil), "msp.FabricOUIdentifier") - proto.RegisterType((*FabricNodeOUs)(nil), "msp.FabricNodeOUs") -} - -func init() { proto.RegisterFile("msp/msp_config.proto", fileDescriptor_9c34771f529d9d1a) } - -var fileDescriptor_9c34771f529d9d1a = []byte{ - // 883 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x55, 0xdb, 0x6e, 0x23, 0x45, - 0x13, 0x96, 0x8f, 0xbb, 0x2e, 0x8f, 0xed, 0x6c, 0xe7, 0xf0, 0x8f, 0x7e, 0xb1, 0xbb, 0x8e, 0x01, - 0x61, 0x09, 0xc5, 0x91, 0xb2, 0x48, 0x48, 0x88, 0xab, 0x0d, 0x2c, 0x0c, 0x4b, 0x48, 0xd4, 0x51, - 0x6e, 0xb8, 0x19, 0xb5, 0x67, 0xda, 0xe3, 0x96, 0x67, 0xba, 0x47, 0xdd, 0x3d, 0x2b, 0x8c, 0xb8, - 0xe6, 0x05, 0x78, 0x07, 0xae, 0x79, 0x13, 0x5e, 0x09, 0xf5, 0x21, 0xf6, 0x38, 0x89, 0x0c, 0x77, - 0x5d, 0x55, 0x5f, 0x7d, 0x53, 0xfd, 0x55, 0x55, 0x0f, 0x1c, 0x15, 0xaa, 0x3c, 0x2f, 0x54, 0x19, - 0x27, 0x82, 0x2f, 0x58, 0x36, 0x2b, 0xa5, 0xd0, 0x02, 0xb5, 0x0a, 0x55, 0x4e, 0xbe, 0x84, 0xde, - 0xd5, 0xed, 0xcd, 0xa5, 0xf5, 0x23, 0x04, 0x6d, 0xbd, 0x2e, 0x69, 0xd8, 0x18, 0x37, 0xa6, 0x1d, - 0x6c, 0xcf, 0xe8, 0x04, 0xba, 0x2e, 0x2b, 0x6c, 0x8e, 0x1b, 0xd3, 0x00, 0x7b, 0x6b, 0xf2, 0x57, - 0x1b, 0x46, 0xef, 0xc8, 0x5c, 0xb2, 0x64, 0x27, 0x9f, 0x93, 0xc2, 0xe5, 0xf7, 0xb0, 0x3d, 0xa3, - 0x97, 0x00, 0x52, 0x08, 0x1d, 0x27, 0x54, 0x6a, 0x15, 0x36, 0xc7, 0xad, 0x69, 0x80, 0x7b, 0xc6, - 0x73, 0x69, 0x1c, 0xe8, 0x0c, 0x10, 0xe3, 0x9a, 0xca, 0x82, 0xa6, 0x8c, 0x68, 0xea, 0x61, 0x2d, - 0x0b, 0x7b, 0x51, 0x8f, 0x38, 0xf8, 0x09, 0x74, 0x49, 0x5a, 0x30, 0xae, 0xc2, 0xb6, 0x85, 0x78, - 0x0b, 0x7d, 0x06, 0x23, 0x49, 0x3f, 0x88, 0x84, 0x68, 0x26, 0x78, 0x9c, 0x33, 0xa5, 0xc3, 0x8e, - 0x05, 0x0c, 0xb7, 0xee, 0x1f, 0x99, 0xd2, 0xe8, 0x12, 0x0e, 0x14, 0xcb, 0x38, 0xe3, 0x59, 0xcc, - 0x52, 0xca, 0x35, 0xd3, 0xeb, 0xb0, 0x3b, 0x6e, 0x4c, 0xfb, 0x17, 0xe1, 0xac, 0x50, 0xe5, 0xec, - 0xd6, 0x05, 0x23, 0x1f, 0x8b, 0xf8, 0x42, 0xe0, 0x91, 0xda, 0x75, 0xa2, 0x18, 0x5e, 0x0b, 0x99, - 0x11, 0xce, 0x7e, 0xb5, 0xc4, 0x24, 0x8f, 0x2b, 0xce, 0xb4, 0x27, 0x5c, 0x30, 0x2a, 0x55, 0xf8, - 0x6c, 0xdc, 0x9a, 0xf6, 0x2f, 0xfe, 0x67, 0x39, 0x9d, 0x4c, 0xd7, 0x77, 0xd1, 0x26, 0x8e, 0x5f, - 0xee, 0xe6, 0xdf, 0x71, 0xa6, 0xb7, 0x51, 0x85, 0xbe, 0x86, 0x41, 0x22, 0xd7, 0xa5, 0x16, 0xbe, - 0x63, 0xe1, 0x73, 0x5b, 0x62, 0x9d, 0xee, 0xd2, 0xc6, 0x9d, 0xf0, 0x38, 0x48, 0x6a, 0x16, 0xfa, - 0x04, 0x86, 0x3a, 0x57, 0x71, 0x4d, 0xf6, 0x9e, 0xd5, 0x22, 0xd0, 0xb9, 0xc2, 0x1b, 0xe5, 0xbf, - 0x80, 0x13, 0x83, 0x7a, 0x42, 0x7d, 0xb0, 0xe8, 0x23, 0x9d, 0xab, 0xe8, 0x51, 0x03, 0xbe, 0x82, - 0xd1, 0xc2, 0x7e, 0x3f, 0xe6, 0x22, 0xa5, 0xb1, 0xa8, 0x54, 0xd8, 0xb7, 0xb5, 0xa1, 0x5a, 0x6d, - 0x3f, 0x89, 0x94, 0x5e, 0xdf, 0x29, 0x3c, 0x58, 0x6c, 0xcd, 0x4a, 0x4d, 0xfe, 0x68, 0x00, 0x7a, - 0x5c, 0x3c, 0xba, 0x80, 0x63, 0x23, 0x30, 0xd1, 0x95, 0xa4, 0xf1, 0x92, 0xa8, 0x65, 0xbc, 0x20, - 0x05, 0xcb, 0xd7, 0x7e, 0x8c, 0x0e, 0x37, 0xc1, 0xef, 0x89, 0x5a, 0xbe, 0xb3, 0x21, 0x14, 0xc1, - 0xe9, 0x7d, 0xfb, 0x6a, 0xb2, 0xfb, 0xec, 0x8a, 0x27, 0x46, 0x56, 0x3b, 0xb0, 0x3d, 0xfc, 0xea, - 0x1e, 0xb8, 0x15, 0xd8, 0x12, 0x79, 0xd4, 0xe4, 0xcf, 0x06, 0x8c, 0xa2, 0x94, 0x16, 0xec, 0x97, - 0xfd, 0x83, 0x7c, 0x00, 0x2d, 0x56, 0xae, 0xfc, 0x16, 0x98, 0x23, 0xba, 0x80, 0xae, 0xa9, 0x8d, - 0xca, 0xb0, 0x65, 0x25, 0xf8, 0xbf, 0x95, 0x60, 0xc3, 0x75, 0x6b, 0x63, 0xbe, 0x43, 0x1e, 0x89, - 0x3e, 0x86, 0x41, 0x6d, 0x50, 0xcb, 0x55, 0xd8, 0xb6, 0x7c, 0xc1, 0xd6, 0x79, 0xb3, 0x42, 0x47, - 0xd0, 0xa1, 0xa5, 0x48, 0x96, 0x61, 0x67, 0xdc, 0x98, 0xb6, 0xb0, 0x33, 0x26, 0xbf, 0x37, 0xe1, - 0xf8, 0x49, 0x72, 0x53, 0x6e, 0x22, 0x69, 0x6a, 0xcb, 0x0d, 0xb0, 0x3d, 0xa3, 0x21, 0x34, 0xd5, - 0x7d, 0xb5, 0x4d, 0xb5, 0x42, 0xdf, 0xc0, 0xab, 0xfd, 0x33, 0x6b, 0x2f, 0xd1, 0xc3, 0x1f, 0xed, - 0x9b, 0x4c, 0xf3, 0x25, 0x29, 0x72, 0x6a, 0xab, 0xee, 0x60, 0x7b, 0x36, 0x57, 0xa2, 0x5c, 0x8a, - 0x3c, 0x2f, 0x28, 0x37, 0x84, 0xb6, 0xea, 0x1e, 0x0e, 0xb6, 0xce, 0x28, 0x45, 0x3f, 0xc0, 0xa9, - 0x29, 0xcb, 0x10, 0x91, 0x3c, 0xae, 0x49, 0xc0, 0xf8, 0x42, 0xc8, 0xc2, 0x9e, 0xed, 0x22, 0x06, - 0xf8, 0xf5, 0x16, 0x88, 0x37, 0xb8, 0x68, 0x0b, 0x9b, 0x08, 0x38, 0x7c, 0x62, 0x4d, 0x4d, 0x1d, - 0x65, 0x35, 0xcf, 0x59, 0x12, 0xfb, 0xae, 0x38, 0x39, 0x02, 0xe7, 0x74, 0x82, 0xa1, 0x37, 0x30, - 0x2c, 0x25, 0xfb, 0x60, 0x86, 0xdd, 0xa3, 0x9a, 0xb6, 0x77, 0x81, 0xed, 0xdd, 0x7b, 0xea, 0x36, - 0x7e, 0xe0, 0x31, 0x2e, 0x69, 0x72, 0x0b, 0xcf, 0x7c, 0x04, 0x7d, 0x0a, 0xc3, 0x15, 0xad, 0xcf, - 0x9c, 0x9f, 0x91, 0xc1, 0x8a, 0xd6, 0x06, 0x0c, 0x9d, 0x42, 0x60, 0x60, 0x05, 0xd1, 0x54, 0x32, - 0x92, 0xfb, 0x3e, 0xf4, 0x57, 0x74, 0x7d, 0xe5, 0x5d, 0x93, 0xdf, 0xee, 0x97, 0xa1, 0xfe, 0x30, - 0xa0, 0x31, 0xf4, 0xcd, 0x12, 0xb2, 0x05, 0x4b, 0x88, 0xa6, 0xfe, 0x0a, 0x75, 0xd7, 0x7f, 0x68, - 0x64, 0xf3, 0xdf, 0x1b, 0x39, 0xf9, 0xbb, 0x09, 0x83, 0x9d, 0x65, 0x35, 0x4f, 0x2b, 0xe5, 0x64, - 0x9e, 0xbb, 0x8f, 0x3e, 0xc7, 0xde, 0x42, 0x11, 0x1c, 0x25, 0x39, 0x33, 0xad, 0x15, 0xd5, 0xc3, - 0xaf, 0xec, 0x79, 0xe1, 0x90, 0x4b, 0xba, 0xae, 0x6a, 0x97, 0xfb, 0x16, 0x50, 0x49, 0xa9, 0x7c, - 0x40, 0xd4, 0xda, 0x4f, 0x74, 0x60, 0x52, 0x76, 0x68, 0xbe, 0x83, 0x43, 0xfb, 0xec, 0x3f, 0xe0, - 0x69, 0xef, 0xe7, 0x79, 0x61, 0x73, 0x76, 0x88, 0xde, 0xc3, 0xb1, 0x90, 0x29, 0x95, 0x8f, 0x4a, - 0xea, 0xec, 0xa7, 0x3a, 0xf4, 0x59, 0x75, 0xb2, 0xb7, 0x73, 0x38, 0x15, 0x32, 0x9b, 0x2d, 0xd7, - 0x25, 0x95, 0x39, 0x4d, 0x33, 0x2a, 0x67, 0xee, 0xf9, 0x73, 0xbf, 0x5b, 0x65, 0xc8, 0xde, 0x1e, - 0x5c, 0xa9, 0xd2, 0x2d, 0xed, 0x0d, 0x49, 0x56, 0x24, 0xa3, 0x3f, 0x7f, 0x9e, 0x31, 0xbd, 0xac, - 0xe6, 0xb3, 0x44, 0x14, 0xe7, 0xb5, 0xdc, 0x73, 0x97, 0x7b, 0xe6, 0x72, 0xcf, 0x32, 0x61, 0xfe, - 0xdf, 0xf3, 0xae, 0x35, 0xdf, 0xfc, 0x13, 0x00, 0x00, 0xff, 0xff, 0x42, 0x15, 0x49, 0x47, 0xd1, - 0x07, 0x00, 0x00, -} diff --git a/vendor/github.com/hyperledger/fabric-protos-go/msp/msp_principal.pb.go b/vendor/github.com/hyperledger/fabric-protos-go/msp/msp_principal.pb.go deleted file mode 100644 index 8ebc3c99e11..00000000000 --- a/vendor/github.com/hyperledger/fabric-protos-go/msp/msp_principal.pb.go +++ /dev/null @@ -1,452 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: msp/msp_principal.proto - -package msp - -import ( - fmt "fmt" - proto "github.com/golang/protobuf/proto" - math "math" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package - -type MSPPrincipal_Classification int32 - -const ( - MSPPrincipal_ROLE MSPPrincipal_Classification = 0 - // one of a member of MSP network, and the one of an - // administrator of an MSP network - MSPPrincipal_ORGANIZATION_UNIT MSPPrincipal_Classification = 1 - // groupping of entities, per MSP affiliation - // E.g., this can well be represented by an MSP's - // Organization unit - MSPPrincipal_IDENTITY MSPPrincipal_Classification = 2 - // identity - MSPPrincipal_ANONYMITY MSPPrincipal_Classification = 3 - // an identity to be anonymous or nominal. - MSPPrincipal_COMBINED MSPPrincipal_Classification = 4 -) - -var MSPPrincipal_Classification_name = map[int32]string{ - 0: "ROLE", - 1: "ORGANIZATION_UNIT", - 2: "IDENTITY", - 3: "ANONYMITY", - 4: "COMBINED", -} - -var MSPPrincipal_Classification_value = map[string]int32{ - "ROLE": 0, - "ORGANIZATION_UNIT": 1, - "IDENTITY": 2, - "ANONYMITY": 3, - "COMBINED": 4, -} - -func (x MSPPrincipal_Classification) String() string { - return proto.EnumName(MSPPrincipal_Classification_name, int32(x)) -} - -func (MSPPrincipal_Classification) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_82e08b7ead29bd48, []int{0, 0} -} - -type MSPRole_MSPRoleType int32 - -const ( - MSPRole_MEMBER MSPRole_MSPRoleType = 0 - MSPRole_ADMIN MSPRole_MSPRoleType = 1 - MSPRole_CLIENT MSPRole_MSPRoleType = 2 - MSPRole_PEER MSPRole_MSPRoleType = 3 - MSPRole_ORDERER MSPRole_MSPRoleType = 4 -) - -var MSPRole_MSPRoleType_name = map[int32]string{ - 0: "MEMBER", - 1: "ADMIN", - 2: "CLIENT", - 3: "PEER", - 4: "ORDERER", -} - -var MSPRole_MSPRoleType_value = map[string]int32{ - "MEMBER": 0, - "ADMIN": 1, - "CLIENT": 2, - "PEER": 3, - "ORDERER": 4, -} - -func (x MSPRole_MSPRoleType) String() string { - return proto.EnumName(MSPRole_MSPRoleType_name, int32(x)) -} - -func (MSPRole_MSPRoleType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_82e08b7ead29bd48, []int{2, 0} -} - -type MSPIdentityAnonymity_MSPIdentityAnonymityType int32 - -const ( - MSPIdentityAnonymity_NOMINAL MSPIdentityAnonymity_MSPIdentityAnonymityType = 0 - MSPIdentityAnonymity_ANONYMOUS MSPIdentityAnonymity_MSPIdentityAnonymityType = 1 -) - -var MSPIdentityAnonymity_MSPIdentityAnonymityType_name = map[int32]string{ - 0: "NOMINAL", - 1: "ANONYMOUS", -} - -var MSPIdentityAnonymity_MSPIdentityAnonymityType_value = map[string]int32{ - "NOMINAL": 0, - "ANONYMOUS": 1, -} - -func (x MSPIdentityAnonymity_MSPIdentityAnonymityType) String() string { - return proto.EnumName(MSPIdentityAnonymity_MSPIdentityAnonymityType_name, int32(x)) -} - -func (MSPIdentityAnonymity_MSPIdentityAnonymityType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_82e08b7ead29bd48, []int{3, 0} -} - -// MSPPrincipal aims to represent an MSP-centric set of identities. -// In particular, this structure allows for definition of -// - a group of identities that are member of the same MSP -// - a group of identities that are member of the same organization unit -// in the same MSP -// - a group of identities that are administering a specific MSP -// - a specific identity -// -// Expressing these groups is done given two fields of the fields below -// - Classification, that defines the type of classification of identities -// in an MSP this principal would be defined on; Classification can take -// three values: -// (i) ByMSPRole: that represents a classification of identities within -// MSP based on one of the two pre-defined MSP rules, "member" and "admin" -// (ii) ByOrganizationUnit: that represents a classification of identities -// within MSP based on the organization unit an identity belongs to -// (iii)ByIdentity that denotes that MSPPrincipal is mapped to a single -// identity/certificate; this would mean that the Principal bytes -// message -type MSPPrincipal struct { - // Classification describes the way that one should process - // Principal. An Classification value of "ByOrganizationUnit" reflects - // that "Principal" contains the name of an organization this MSP - // handles. A Classification value "ByIdentity" means that - // "Principal" contains a specific identity. Default value - // denotes that Principal contains one of the groups by - // default supported by all MSPs ("admin" or "member"). - PrincipalClassification MSPPrincipal_Classification `protobuf:"varint,1,opt,name=principal_classification,json=principalClassification,proto3,enum=common.MSPPrincipal_Classification" json:"principal_classification,omitempty"` - // Principal completes the policy principal definition. For the default - // principal types, Principal can be either "Admin" or "Member". - // For the ByOrganizationUnit/ByIdentity values of Classification, - // PolicyPrincipal acquires its value from an organization unit or - // identity, respectively. - // For the Combined Classification type, the Principal is a marshalled - // CombinedPrincipal. - Principal []byte `protobuf:"bytes,2,opt,name=principal,proto3" json:"principal,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MSPPrincipal) Reset() { *m = MSPPrincipal{} } -func (m *MSPPrincipal) String() string { return proto.CompactTextString(m) } -func (*MSPPrincipal) ProtoMessage() {} -func (*MSPPrincipal) Descriptor() ([]byte, []int) { - return fileDescriptor_82e08b7ead29bd48, []int{0} -} - -func (m *MSPPrincipal) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MSPPrincipal.Unmarshal(m, b) -} -func (m *MSPPrincipal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MSPPrincipal.Marshal(b, m, deterministic) -} -func (m *MSPPrincipal) XXX_Merge(src proto.Message) { - xxx_messageInfo_MSPPrincipal.Merge(m, src) -} -func (m *MSPPrincipal) XXX_Size() int { - return xxx_messageInfo_MSPPrincipal.Size(m) -} -func (m *MSPPrincipal) XXX_DiscardUnknown() { - xxx_messageInfo_MSPPrincipal.DiscardUnknown(m) -} - -var xxx_messageInfo_MSPPrincipal proto.InternalMessageInfo - -func (m *MSPPrincipal) GetPrincipalClassification() MSPPrincipal_Classification { - if m != nil { - return m.PrincipalClassification - } - return MSPPrincipal_ROLE -} - -func (m *MSPPrincipal) GetPrincipal() []byte { - if m != nil { - return m.Principal - } - return nil -} - -// OrganizationUnit governs the organization of the Principal -// field of a policy principal when a specific organization unity members -// are to be defined within a policy principal. -type OrganizationUnit struct { - // MSPIdentifier represents the identifier of the MSP this organization unit - // refers to - MspIdentifier string `protobuf:"bytes,1,opt,name=msp_identifier,json=mspIdentifier,proto3" json:"msp_identifier,omitempty"` - // OrganizationUnitIdentifier defines the organizational unit under the - // MSP identified with MSPIdentifier - OrganizationalUnitIdentifier string `protobuf:"bytes,2,opt,name=organizational_unit_identifier,json=organizationalUnitIdentifier,proto3" json:"organizational_unit_identifier,omitempty"` - // CertifiersIdentifier is the hash of certificates chain of trust - // related to this organizational unit - CertifiersIdentifier []byte `protobuf:"bytes,3,opt,name=certifiers_identifier,json=certifiersIdentifier,proto3" json:"certifiers_identifier,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *OrganizationUnit) Reset() { *m = OrganizationUnit{} } -func (m *OrganizationUnit) String() string { return proto.CompactTextString(m) } -func (*OrganizationUnit) ProtoMessage() {} -func (*OrganizationUnit) Descriptor() ([]byte, []int) { - return fileDescriptor_82e08b7ead29bd48, []int{1} -} - -func (m *OrganizationUnit) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_OrganizationUnit.Unmarshal(m, b) -} -func (m *OrganizationUnit) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_OrganizationUnit.Marshal(b, m, deterministic) -} -func (m *OrganizationUnit) XXX_Merge(src proto.Message) { - xxx_messageInfo_OrganizationUnit.Merge(m, src) -} -func (m *OrganizationUnit) XXX_Size() int { - return xxx_messageInfo_OrganizationUnit.Size(m) -} -func (m *OrganizationUnit) XXX_DiscardUnknown() { - xxx_messageInfo_OrganizationUnit.DiscardUnknown(m) -} - -var xxx_messageInfo_OrganizationUnit proto.InternalMessageInfo - -func (m *OrganizationUnit) GetMspIdentifier() string { - if m != nil { - return m.MspIdentifier - } - return "" -} - -func (m *OrganizationUnit) GetOrganizationalUnitIdentifier() string { - if m != nil { - return m.OrganizationalUnitIdentifier - } - return "" -} - -func (m *OrganizationUnit) GetCertifiersIdentifier() []byte { - if m != nil { - return m.CertifiersIdentifier - } - return nil -} - -// MSPRole governs the organization of the Principal -// field of an MSPPrincipal when it aims to define one of the -// two dedicated roles within an MSP: Admin and Members. -type MSPRole struct { - // MSPIdentifier represents the identifier of the MSP this principal - // refers to - MspIdentifier string `protobuf:"bytes,1,opt,name=msp_identifier,json=mspIdentifier,proto3" json:"msp_identifier,omitempty"` - // MSPRoleType defines which of the available, pre-defined MSP-roles - // an identiy should posess inside the MSP with identifier MSPidentifier - Role MSPRole_MSPRoleType `protobuf:"varint,2,opt,name=role,proto3,enum=common.MSPRole_MSPRoleType" json:"role,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MSPRole) Reset() { *m = MSPRole{} } -func (m *MSPRole) String() string { return proto.CompactTextString(m) } -func (*MSPRole) ProtoMessage() {} -func (*MSPRole) Descriptor() ([]byte, []int) { - return fileDescriptor_82e08b7ead29bd48, []int{2} -} - -func (m *MSPRole) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MSPRole.Unmarshal(m, b) -} -func (m *MSPRole) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MSPRole.Marshal(b, m, deterministic) -} -func (m *MSPRole) XXX_Merge(src proto.Message) { - xxx_messageInfo_MSPRole.Merge(m, src) -} -func (m *MSPRole) XXX_Size() int { - return xxx_messageInfo_MSPRole.Size(m) -} -func (m *MSPRole) XXX_DiscardUnknown() { - xxx_messageInfo_MSPRole.DiscardUnknown(m) -} - -var xxx_messageInfo_MSPRole proto.InternalMessageInfo - -func (m *MSPRole) GetMspIdentifier() string { - if m != nil { - return m.MspIdentifier - } - return "" -} - -func (m *MSPRole) GetRole() MSPRole_MSPRoleType { - if m != nil { - return m.Role - } - return MSPRole_MEMBER -} - -// MSPIdentityAnonymity can be used to enforce an identity to be anonymous or nominal. -type MSPIdentityAnonymity struct { - AnonymityType MSPIdentityAnonymity_MSPIdentityAnonymityType `protobuf:"varint,1,opt,name=anonymity_type,json=anonymityType,proto3,enum=common.MSPIdentityAnonymity_MSPIdentityAnonymityType" json:"anonymity_type,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MSPIdentityAnonymity) Reset() { *m = MSPIdentityAnonymity{} } -func (m *MSPIdentityAnonymity) String() string { return proto.CompactTextString(m) } -func (*MSPIdentityAnonymity) ProtoMessage() {} -func (*MSPIdentityAnonymity) Descriptor() ([]byte, []int) { - return fileDescriptor_82e08b7ead29bd48, []int{3} -} - -func (m *MSPIdentityAnonymity) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MSPIdentityAnonymity.Unmarshal(m, b) -} -func (m *MSPIdentityAnonymity) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MSPIdentityAnonymity.Marshal(b, m, deterministic) -} -func (m *MSPIdentityAnonymity) XXX_Merge(src proto.Message) { - xxx_messageInfo_MSPIdentityAnonymity.Merge(m, src) -} -func (m *MSPIdentityAnonymity) XXX_Size() int { - return xxx_messageInfo_MSPIdentityAnonymity.Size(m) -} -func (m *MSPIdentityAnonymity) XXX_DiscardUnknown() { - xxx_messageInfo_MSPIdentityAnonymity.DiscardUnknown(m) -} - -var xxx_messageInfo_MSPIdentityAnonymity proto.InternalMessageInfo - -func (m *MSPIdentityAnonymity) GetAnonymityType() MSPIdentityAnonymity_MSPIdentityAnonymityType { - if m != nil { - return m.AnonymityType - } - return MSPIdentityAnonymity_NOMINAL -} - -// CombinedPrincipal governs the organization of the Principal -// field of a policy principal when principal_classification has -// indicated that a combined form of principals is required -type CombinedPrincipal struct { - // Principals refer to combined principals - Principals []*MSPPrincipal `protobuf:"bytes,1,rep,name=principals,proto3" json:"principals,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CombinedPrincipal) Reset() { *m = CombinedPrincipal{} } -func (m *CombinedPrincipal) String() string { return proto.CompactTextString(m) } -func (*CombinedPrincipal) ProtoMessage() {} -func (*CombinedPrincipal) Descriptor() ([]byte, []int) { - return fileDescriptor_82e08b7ead29bd48, []int{4} -} - -func (m *CombinedPrincipal) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CombinedPrincipal.Unmarshal(m, b) -} -func (m *CombinedPrincipal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CombinedPrincipal.Marshal(b, m, deterministic) -} -func (m *CombinedPrincipal) XXX_Merge(src proto.Message) { - xxx_messageInfo_CombinedPrincipal.Merge(m, src) -} -func (m *CombinedPrincipal) XXX_Size() int { - return xxx_messageInfo_CombinedPrincipal.Size(m) -} -func (m *CombinedPrincipal) XXX_DiscardUnknown() { - xxx_messageInfo_CombinedPrincipal.DiscardUnknown(m) -} - -var xxx_messageInfo_CombinedPrincipal proto.InternalMessageInfo - -func (m *CombinedPrincipal) GetPrincipals() []*MSPPrincipal { - if m != nil { - return m.Principals - } - return nil -} - -func init() { - proto.RegisterEnum("common.MSPPrincipal_Classification", MSPPrincipal_Classification_name, MSPPrincipal_Classification_value) - proto.RegisterEnum("common.MSPRole_MSPRoleType", MSPRole_MSPRoleType_name, MSPRole_MSPRoleType_value) - proto.RegisterEnum("common.MSPIdentityAnonymity_MSPIdentityAnonymityType", MSPIdentityAnonymity_MSPIdentityAnonymityType_name, MSPIdentityAnonymity_MSPIdentityAnonymityType_value) - proto.RegisterType((*MSPPrincipal)(nil), "common.MSPPrincipal") - proto.RegisterType((*OrganizationUnit)(nil), "common.OrganizationUnit") - proto.RegisterType((*MSPRole)(nil), "common.MSPRole") - proto.RegisterType((*MSPIdentityAnonymity)(nil), "common.MSPIdentityAnonymity") - proto.RegisterType((*CombinedPrincipal)(nil), "common.CombinedPrincipal") -} - -func init() { proto.RegisterFile("msp/msp_principal.proto", fileDescriptor_82e08b7ead29bd48) } - -var fileDescriptor_82e08b7ead29bd48 = []byte{ - // 528 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x53, 0x5f, 0x6b, 0xdb, 0x3e, - 0x14, 0xad, 0x93, 0xfc, 0xda, 0xe6, 0xe6, 0x0f, 0xaa, 0x48, 0x69, 0xe0, 0x57, 0x46, 0xf0, 0x36, - 0x08, 0x8c, 0x3a, 0x90, 0x6e, 0x7b, 0x77, 0x12, 0x53, 0x0c, 0xb1, 0x1c, 0x14, 0xe7, 0xa1, 0xa5, - 0x2c, 0x38, 0x8e, 0x92, 0x0a, 0x6c, 0xcb, 0xd8, 0xee, 0x83, 0xf7, 0x91, 0xc6, 0x1e, 0xf7, 0xa9, - 0xf6, 0x29, 0x86, 0xed, 0x26, 0x51, 0xb6, 0x0e, 0xf6, 0x64, 0xce, 0xbd, 0xe7, 0x1c, 0x1f, 0x49, - 0xf7, 0xc2, 0x55, 0x90, 0x44, 0x83, 0x20, 0x89, 0x96, 0x51, 0xcc, 0x43, 0x8f, 0x47, 0xae, 0xaf, - 0x45, 0xb1, 0x48, 0x05, 0x3e, 0xf5, 0x44, 0x10, 0x88, 0x50, 0xfd, 0xa9, 0x40, 0xd3, 0x9a, 0xcf, - 0x66, 0xbb, 0x36, 0xfe, 0x02, 0xdd, 0x3d, 0x77, 0xe9, 0xf9, 0x6e, 0x92, 0xf0, 0x0d, 0xf7, 0xdc, - 0x94, 0x8b, 0xb0, 0xab, 0xf4, 0x94, 0x7e, 0x7b, 0xf8, 0x56, 0x2b, 0xb5, 0x9a, 0xac, 0xd3, 0xc6, - 0x47, 0x54, 0x7a, 0xb5, 0x37, 0x39, 0x6e, 0xe0, 0x6b, 0xa8, 0xef, 0x5b, 0xdd, 0x4a, 0x4f, 0xe9, - 0x37, 0xe9, 0xa1, 0xa0, 0x3e, 0x42, 0xfb, 0x37, 0xfe, 0x39, 0xd4, 0xa8, 0x3d, 0x35, 0xd0, 0x09, - 0xbe, 0x84, 0x0b, 0x9b, 0xde, 0xe9, 0xc4, 0x7c, 0xd0, 0x1d, 0xd3, 0x26, 0xcb, 0x05, 0x31, 0x1d, - 0xa4, 0xe0, 0x26, 0x9c, 0x9b, 0x13, 0x83, 0x38, 0xa6, 0x73, 0x8f, 0x2a, 0xb8, 0x05, 0x75, 0x9d, - 0xd8, 0xe4, 0xde, 0xca, 0x61, 0x35, 0x6f, 0x8e, 0x6d, 0x6b, 0x64, 0x12, 0x63, 0x82, 0x6a, 0xea, - 0x0f, 0x05, 0x90, 0x1d, 0x6f, 0xdd, 0x90, 0x7f, 0x2d, 0xcc, 0x17, 0x21, 0x4f, 0xf1, 0x7b, 0x68, - 0xe7, 0x17, 0xc4, 0xd7, 0x2c, 0x4c, 0xf9, 0x86, 0xb3, 0xb8, 0x38, 0x66, 0x9d, 0xb6, 0x82, 0x24, - 0x32, 0xf7, 0x45, 0x3c, 0x81, 0x37, 0x42, 0x92, 0xba, 0xfe, 0xf2, 0x39, 0xe4, 0xa9, 0x2c, 0xab, - 0x14, 0xb2, 0xeb, 0x63, 0x56, 0xfe, 0x0b, 0xc9, 0xe5, 0x16, 0x2e, 0x3d, 0x16, 0x97, 0x20, 0x91, - 0xc5, 0xd5, 0xe2, 0x26, 0x3a, 0x87, 0xe6, 0x41, 0xa4, 0x7e, 0x53, 0xe0, 0xcc, 0x9a, 0xcf, 0xa8, - 0xf0, 0xd9, 0xbf, 0xa6, 0x1d, 0x40, 0x2d, 0x16, 0x3e, 0x2b, 0x32, 0xb5, 0x87, 0xff, 0x4b, 0x2f, - 0x96, 0xbb, 0xec, 0xbe, 0x4e, 0x16, 0x31, 0x5a, 0x10, 0xd5, 0x3b, 0x68, 0x48, 0x45, 0x0c, 0x70, - 0x6a, 0x19, 0xd6, 0xc8, 0xa0, 0xe8, 0x04, 0xd7, 0xe1, 0x3f, 0x7d, 0x62, 0x99, 0x04, 0x29, 0x79, - 0x79, 0x3c, 0x35, 0x0d, 0xe2, 0xa0, 0x4a, 0xfe, 0x30, 0x33, 0xc3, 0xa0, 0xa8, 0x8a, 0x1b, 0x70, - 0x66, 0xd3, 0x89, 0x41, 0x0d, 0x8a, 0x6a, 0xea, 0x77, 0x05, 0x3a, 0xd6, 0x7c, 0x56, 0x66, 0x49, - 0x33, 0x3d, 0x14, 0x61, 0x16, 0xf0, 0x34, 0xc3, 0x8f, 0xd0, 0x76, 0x77, 0x60, 0x99, 0x66, 0x11, - 0x7b, 0x19, 0xa7, 0x4f, 0x52, 0xb8, 0x3f, 0x54, 0xaf, 0x16, 0x8b, 0xd8, 0x2d, 0x57, 0x86, 0xea, - 0x67, 0xe8, 0xfe, 0x8d, 0x9a, 0xe7, 0x23, 0xb6, 0x65, 0x12, 0x7d, 0x8a, 0x4e, 0x0e, 0x03, 0x62, - 0x2f, 0xe6, 0x48, 0x51, 0x4d, 0xb8, 0x18, 0x8b, 0x60, 0xc5, 0x43, 0xb6, 0x3e, 0xec, 0xc0, 0x47, - 0x80, 0xfd, 0x48, 0x26, 0x5d, 0xa5, 0x57, 0xed, 0x37, 0x86, 0x9d, 0xd7, 0xa6, 0x9e, 0x4a, 0xbc, - 0xd1, 0x1c, 0xde, 0x89, 0x78, 0xab, 0x3d, 0x65, 0x11, 0x8b, 0x7d, 0xb6, 0xde, 0xb2, 0x58, 0xdb, - 0xb8, 0xab, 0x98, 0x7b, 0xe5, 0xca, 0x25, 0x2f, 0x06, 0x0f, 0x1f, 0xb6, 0x3c, 0x7d, 0x7a, 0x5e, - 0xe5, 0x70, 0x20, 0x91, 0x07, 0x25, 0xf9, 0xa6, 0x24, 0xdf, 0x6c, 0x45, 0xbe, 0xb7, 0xab, 0xd3, - 0x02, 0xde, 0xfe, 0x0a, 0x00, 0x00, 0xff, 0xff, 0x2b, 0x94, 0x15, 0xa2, 0xc9, 0x03, 0x00, 0x00, -} diff --git a/vendor/github.com/hyperledger/fabric-protos-go/orderer/ab.pb.go b/vendor/github.com/hyperledger/fabric-protos-go/orderer/ab.pb.go deleted file mode 100644 index f28aa5553d6..00000000000 --- a/vendor/github.com/hyperledger/fabric-protos-go/orderer/ab.pb.go +++ /dev/null @@ -1,812 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: orderer/ab.proto - -package orderer - -import ( - context "context" - fmt "fmt" - proto "github.com/golang/protobuf/proto" - common "github.com/hyperledger/fabric-protos-go/common" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - math "math" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package - -// If BLOCK_UNTIL_READY is specified, the reply will block until the requested blocks are available, -// if FAIL_IF_NOT_READY is specified, the reply will return an error indicating that the block is not -// found. To request that all blocks be returned indefinitely as they are created, behavior should be -// set to BLOCK_UNTIL_READY and the stop should be set to specified with a number of MAX_UINT64 -type SeekInfo_SeekBehavior int32 - -const ( - SeekInfo_BLOCK_UNTIL_READY SeekInfo_SeekBehavior = 0 - SeekInfo_FAIL_IF_NOT_READY SeekInfo_SeekBehavior = 1 -) - -var SeekInfo_SeekBehavior_name = map[int32]string{ - 0: "BLOCK_UNTIL_READY", - 1: "FAIL_IF_NOT_READY", -} - -var SeekInfo_SeekBehavior_value = map[string]int32{ - "BLOCK_UNTIL_READY": 0, - "FAIL_IF_NOT_READY": 1, -} - -func (x SeekInfo_SeekBehavior) String() string { - return proto.EnumName(SeekInfo_SeekBehavior_name, int32(x)) -} - -func (SeekInfo_SeekBehavior) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_79fce58dd8d86d62, []int{6, 0} -} - -// SeekErrorTolerance indicates to the server how block provider errors should be tolerated. By default, -// if the deliver service detects a problem in the underlying block source (typically, in the orderer, -// a consenter error), it will begin to reject deliver requests. This is to prevent a client from waiting -// for blocks from an orderer which is stuck in an errored state. This is almost always the desired behavior -// and clients should stick with the default STRICT checking behavior. However, in some scenarios, particularly -// when attempting to recover from a crash or other corruption, it's desirable to force an orderer to respond -// with blocks on a best effort basis, even if the backing consensus implementation is in an errored state. -// In this case, set the SeekErrorResponse to BEST_EFFORT to ignore the consenter errors. -type SeekInfo_SeekErrorResponse int32 - -const ( - SeekInfo_STRICT SeekInfo_SeekErrorResponse = 0 - SeekInfo_BEST_EFFORT SeekInfo_SeekErrorResponse = 1 -) - -var SeekInfo_SeekErrorResponse_name = map[int32]string{ - 0: "STRICT", - 1: "BEST_EFFORT", -} - -var SeekInfo_SeekErrorResponse_value = map[string]int32{ - "STRICT": 0, - "BEST_EFFORT": 1, -} - -func (x SeekInfo_SeekErrorResponse) String() string { - return proto.EnumName(SeekInfo_SeekErrorResponse_name, int32(x)) -} - -func (SeekInfo_SeekErrorResponse) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_79fce58dd8d86d62, []int{6, 1} -} - -// SeekContentType indicates what type of content to deliver in response to a request. If BLOCK is specified, -// the orderer will stream blocks back to the peer. This is the default behavior. If HEADER_WITH_SIG is specified, the -// orderer will stream only a the header and the signature, and the payload field will be set to nil. This allows -// the requester to ascertain that the respective signed block exists in the orderer (or cluster of orderers). -type SeekInfo_SeekContentType int32 - -const ( - SeekInfo_BLOCK SeekInfo_SeekContentType = 0 - SeekInfo_HEADER_WITH_SIG SeekInfo_SeekContentType = 1 -) - -var SeekInfo_SeekContentType_name = map[int32]string{ - 0: "BLOCK", - 1: "HEADER_WITH_SIG", -} - -var SeekInfo_SeekContentType_value = map[string]int32{ - "BLOCK": 0, - "HEADER_WITH_SIG": 1, -} - -func (x SeekInfo_SeekContentType) String() string { - return proto.EnumName(SeekInfo_SeekContentType_name, int32(x)) -} - -func (SeekInfo_SeekContentType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_79fce58dd8d86d62, []int{6, 2} -} - -type BroadcastResponse struct { - // Status code, which may be used to programatically respond to success/failure - Status common.Status `protobuf:"varint,1,opt,name=status,proto3,enum=common.Status" json:"status,omitempty"` - // Info string which may contain additional information about the status returned - Info string `protobuf:"bytes,2,opt,name=info,proto3" json:"info,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *BroadcastResponse) Reset() { *m = BroadcastResponse{} } -func (m *BroadcastResponse) String() string { return proto.CompactTextString(m) } -func (*BroadcastResponse) ProtoMessage() {} -func (*BroadcastResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_79fce58dd8d86d62, []int{0} -} - -func (m *BroadcastResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_BroadcastResponse.Unmarshal(m, b) -} -func (m *BroadcastResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_BroadcastResponse.Marshal(b, m, deterministic) -} -func (m *BroadcastResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_BroadcastResponse.Merge(m, src) -} -func (m *BroadcastResponse) XXX_Size() int { - return xxx_messageInfo_BroadcastResponse.Size(m) -} -func (m *BroadcastResponse) XXX_DiscardUnknown() { - xxx_messageInfo_BroadcastResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_BroadcastResponse proto.InternalMessageInfo - -func (m *BroadcastResponse) GetStatus() common.Status { - if m != nil { - return m.Status - } - return common.Status_UNKNOWN -} - -func (m *BroadcastResponse) GetInfo() string { - if m != nil { - return m.Info - } - return "" -} - -type SeekNewest struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SeekNewest) Reset() { *m = SeekNewest{} } -func (m *SeekNewest) String() string { return proto.CompactTextString(m) } -func (*SeekNewest) ProtoMessage() {} -func (*SeekNewest) Descriptor() ([]byte, []int) { - return fileDescriptor_79fce58dd8d86d62, []int{1} -} - -func (m *SeekNewest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SeekNewest.Unmarshal(m, b) -} -func (m *SeekNewest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SeekNewest.Marshal(b, m, deterministic) -} -func (m *SeekNewest) XXX_Merge(src proto.Message) { - xxx_messageInfo_SeekNewest.Merge(m, src) -} -func (m *SeekNewest) XXX_Size() int { - return xxx_messageInfo_SeekNewest.Size(m) -} -func (m *SeekNewest) XXX_DiscardUnknown() { - xxx_messageInfo_SeekNewest.DiscardUnknown(m) -} - -var xxx_messageInfo_SeekNewest proto.InternalMessageInfo - -type SeekOldest struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SeekOldest) Reset() { *m = SeekOldest{} } -func (m *SeekOldest) String() string { return proto.CompactTextString(m) } -func (*SeekOldest) ProtoMessage() {} -func (*SeekOldest) Descriptor() ([]byte, []int) { - return fileDescriptor_79fce58dd8d86d62, []int{2} -} - -func (m *SeekOldest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SeekOldest.Unmarshal(m, b) -} -func (m *SeekOldest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SeekOldest.Marshal(b, m, deterministic) -} -func (m *SeekOldest) XXX_Merge(src proto.Message) { - xxx_messageInfo_SeekOldest.Merge(m, src) -} -func (m *SeekOldest) XXX_Size() int { - return xxx_messageInfo_SeekOldest.Size(m) -} -func (m *SeekOldest) XXX_DiscardUnknown() { - xxx_messageInfo_SeekOldest.DiscardUnknown(m) -} - -var xxx_messageInfo_SeekOldest proto.InternalMessageInfo - -type SeekSpecified struct { - Number uint64 `protobuf:"varint,1,opt,name=number,proto3" json:"number,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SeekSpecified) Reset() { *m = SeekSpecified{} } -func (m *SeekSpecified) String() string { return proto.CompactTextString(m) } -func (*SeekSpecified) ProtoMessage() {} -func (*SeekSpecified) Descriptor() ([]byte, []int) { - return fileDescriptor_79fce58dd8d86d62, []int{3} -} - -func (m *SeekSpecified) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SeekSpecified.Unmarshal(m, b) -} -func (m *SeekSpecified) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SeekSpecified.Marshal(b, m, deterministic) -} -func (m *SeekSpecified) XXX_Merge(src proto.Message) { - xxx_messageInfo_SeekSpecified.Merge(m, src) -} -func (m *SeekSpecified) XXX_Size() int { - return xxx_messageInfo_SeekSpecified.Size(m) -} -func (m *SeekSpecified) XXX_DiscardUnknown() { - xxx_messageInfo_SeekSpecified.DiscardUnknown(m) -} - -var xxx_messageInfo_SeekSpecified proto.InternalMessageInfo - -func (m *SeekSpecified) GetNumber() uint64 { - if m != nil { - return m.Number - } - return 0 -} - -// SeekNextCommit refers to the next block that will be committed -type SeekNextCommit struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SeekNextCommit) Reset() { *m = SeekNextCommit{} } -func (m *SeekNextCommit) String() string { return proto.CompactTextString(m) } -func (*SeekNextCommit) ProtoMessage() {} -func (*SeekNextCommit) Descriptor() ([]byte, []int) { - return fileDescriptor_79fce58dd8d86d62, []int{4} -} - -func (m *SeekNextCommit) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SeekNextCommit.Unmarshal(m, b) -} -func (m *SeekNextCommit) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SeekNextCommit.Marshal(b, m, deterministic) -} -func (m *SeekNextCommit) XXX_Merge(src proto.Message) { - xxx_messageInfo_SeekNextCommit.Merge(m, src) -} -func (m *SeekNextCommit) XXX_Size() int { - return xxx_messageInfo_SeekNextCommit.Size(m) -} -func (m *SeekNextCommit) XXX_DiscardUnknown() { - xxx_messageInfo_SeekNextCommit.DiscardUnknown(m) -} - -var xxx_messageInfo_SeekNextCommit proto.InternalMessageInfo - -type SeekPosition struct { - // Types that are valid to be assigned to Type: - // - // *SeekPosition_Newest - // *SeekPosition_Oldest - // *SeekPosition_Specified - // *SeekPosition_NextCommit - Type isSeekPosition_Type `protobuf_oneof:"Type"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SeekPosition) Reset() { *m = SeekPosition{} } -func (m *SeekPosition) String() string { return proto.CompactTextString(m) } -func (*SeekPosition) ProtoMessage() {} -func (*SeekPosition) Descriptor() ([]byte, []int) { - return fileDescriptor_79fce58dd8d86d62, []int{5} -} - -func (m *SeekPosition) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SeekPosition.Unmarshal(m, b) -} -func (m *SeekPosition) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SeekPosition.Marshal(b, m, deterministic) -} -func (m *SeekPosition) XXX_Merge(src proto.Message) { - xxx_messageInfo_SeekPosition.Merge(m, src) -} -func (m *SeekPosition) XXX_Size() int { - return xxx_messageInfo_SeekPosition.Size(m) -} -func (m *SeekPosition) XXX_DiscardUnknown() { - xxx_messageInfo_SeekPosition.DiscardUnknown(m) -} - -var xxx_messageInfo_SeekPosition proto.InternalMessageInfo - -type isSeekPosition_Type interface { - isSeekPosition_Type() -} - -type SeekPosition_Newest struct { - Newest *SeekNewest `protobuf:"bytes,1,opt,name=newest,proto3,oneof"` -} - -type SeekPosition_Oldest struct { - Oldest *SeekOldest `protobuf:"bytes,2,opt,name=oldest,proto3,oneof"` -} - -type SeekPosition_Specified struct { - Specified *SeekSpecified `protobuf:"bytes,3,opt,name=specified,proto3,oneof"` -} - -type SeekPosition_NextCommit struct { - NextCommit *SeekNextCommit `protobuf:"bytes,4,opt,name=next_commit,json=nextCommit,proto3,oneof"` -} - -func (*SeekPosition_Newest) isSeekPosition_Type() {} - -func (*SeekPosition_Oldest) isSeekPosition_Type() {} - -func (*SeekPosition_Specified) isSeekPosition_Type() {} - -func (*SeekPosition_NextCommit) isSeekPosition_Type() {} - -func (m *SeekPosition) GetType() isSeekPosition_Type { - if m != nil { - return m.Type - } - return nil -} - -func (m *SeekPosition) GetNewest() *SeekNewest { - if x, ok := m.GetType().(*SeekPosition_Newest); ok { - return x.Newest - } - return nil -} - -func (m *SeekPosition) GetOldest() *SeekOldest { - if x, ok := m.GetType().(*SeekPosition_Oldest); ok { - return x.Oldest - } - return nil -} - -func (m *SeekPosition) GetSpecified() *SeekSpecified { - if x, ok := m.GetType().(*SeekPosition_Specified); ok { - return x.Specified - } - return nil -} - -func (m *SeekPosition) GetNextCommit() *SeekNextCommit { - if x, ok := m.GetType().(*SeekPosition_NextCommit); ok { - return x.NextCommit - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*SeekPosition) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*SeekPosition_Newest)(nil), - (*SeekPosition_Oldest)(nil), - (*SeekPosition_Specified)(nil), - (*SeekPosition_NextCommit)(nil), - } -} - -// SeekInfo specifies the range of requested blocks to return -// If the start position is not found, an error is immediately returned -// Otherwise, blocks are returned until a missing block is encountered, then behavior is dictated -// by the SeekBehavior specified. -type SeekInfo struct { - Start *SeekPosition `protobuf:"bytes,1,opt,name=start,proto3" json:"start,omitempty"` - Stop *SeekPosition `protobuf:"bytes,2,opt,name=stop,proto3" json:"stop,omitempty"` - Behavior SeekInfo_SeekBehavior `protobuf:"varint,3,opt,name=behavior,proto3,enum=orderer.SeekInfo_SeekBehavior" json:"behavior,omitempty"` - ErrorResponse SeekInfo_SeekErrorResponse `protobuf:"varint,4,opt,name=error_response,json=errorResponse,proto3,enum=orderer.SeekInfo_SeekErrorResponse" json:"error_response,omitempty"` - ContentType SeekInfo_SeekContentType `protobuf:"varint,5,opt,name=content_type,json=contentType,proto3,enum=orderer.SeekInfo_SeekContentType" json:"content_type,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SeekInfo) Reset() { *m = SeekInfo{} } -func (m *SeekInfo) String() string { return proto.CompactTextString(m) } -func (*SeekInfo) ProtoMessage() {} -func (*SeekInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_79fce58dd8d86d62, []int{6} -} - -func (m *SeekInfo) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SeekInfo.Unmarshal(m, b) -} -func (m *SeekInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SeekInfo.Marshal(b, m, deterministic) -} -func (m *SeekInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_SeekInfo.Merge(m, src) -} -func (m *SeekInfo) XXX_Size() int { - return xxx_messageInfo_SeekInfo.Size(m) -} -func (m *SeekInfo) XXX_DiscardUnknown() { - xxx_messageInfo_SeekInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_SeekInfo proto.InternalMessageInfo - -func (m *SeekInfo) GetStart() *SeekPosition { - if m != nil { - return m.Start - } - return nil -} - -func (m *SeekInfo) GetStop() *SeekPosition { - if m != nil { - return m.Stop - } - return nil -} - -func (m *SeekInfo) GetBehavior() SeekInfo_SeekBehavior { - if m != nil { - return m.Behavior - } - return SeekInfo_BLOCK_UNTIL_READY -} - -func (m *SeekInfo) GetErrorResponse() SeekInfo_SeekErrorResponse { - if m != nil { - return m.ErrorResponse - } - return SeekInfo_STRICT -} - -func (m *SeekInfo) GetContentType() SeekInfo_SeekContentType { - if m != nil { - return m.ContentType - } - return SeekInfo_BLOCK -} - -type DeliverResponse struct { - // Types that are valid to be assigned to Type: - // - // *DeliverResponse_Status - // *DeliverResponse_Block - Type isDeliverResponse_Type `protobuf_oneof:"Type"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DeliverResponse) Reset() { *m = DeliverResponse{} } -func (m *DeliverResponse) String() string { return proto.CompactTextString(m) } -func (*DeliverResponse) ProtoMessage() {} -func (*DeliverResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_79fce58dd8d86d62, []int{7} -} - -func (m *DeliverResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DeliverResponse.Unmarshal(m, b) -} -func (m *DeliverResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DeliverResponse.Marshal(b, m, deterministic) -} -func (m *DeliverResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_DeliverResponse.Merge(m, src) -} -func (m *DeliverResponse) XXX_Size() int { - return xxx_messageInfo_DeliverResponse.Size(m) -} -func (m *DeliverResponse) XXX_DiscardUnknown() { - xxx_messageInfo_DeliverResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_DeliverResponse proto.InternalMessageInfo - -type isDeliverResponse_Type interface { - isDeliverResponse_Type() -} - -type DeliverResponse_Status struct { - Status common.Status `protobuf:"varint,1,opt,name=status,proto3,enum=common.Status,oneof"` -} - -type DeliverResponse_Block struct { - Block *common.Block `protobuf:"bytes,2,opt,name=block,proto3,oneof"` -} - -func (*DeliverResponse_Status) isDeliverResponse_Type() {} - -func (*DeliverResponse_Block) isDeliverResponse_Type() {} - -func (m *DeliverResponse) GetType() isDeliverResponse_Type { - if m != nil { - return m.Type - } - return nil -} - -func (m *DeliverResponse) GetStatus() common.Status { - if x, ok := m.GetType().(*DeliverResponse_Status); ok { - return x.Status - } - return common.Status_UNKNOWN -} - -func (m *DeliverResponse) GetBlock() *common.Block { - if x, ok := m.GetType().(*DeliverResponse_Block); ok { - return x.Block - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*DeliverResponse) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*DeliverResponse_Status)(nil), - (*DeliverResponse_Block)(nil), - } -} - -func init() { - proto.RegisterEnum("orderer.SeekInfo_SeekBehavior", SeekInfo_SeekBehavior_name, SeekInfo_SeekBehavior_value) - proto.RegisterEnum("orderer.SeekInfo_SeekErrorResponse", SeekInfo_SeekErrorResponse_name, SeekInfo_SeekErrorResponse_value) - proto.RegisterEnum("orderer.SeekInfo_SeekContentType", SeekInfo_SeekContentType_name, SeekInfo_SeekContentType_value) - proto.RegisterType((*BroadcastResponse)(nil), "orderer.BroadcastResponse") - proto.RegisterType((*SeekNewest)(nil), "orderer.SeekNewest") - proto.RegisterType((*SeekOldest)(nil), "orderer.SeekOldest") - proto.RegisterType((*SeekSpecified)(nil), "orderer.SeekSpecified") - proto.RegisterType((*SeekNextCommit)(nil), "orderer.SeekNextCommit") - proto.RegisterType((*SeekPosition)(nil), "orderer.SeekPosition") - proto.RegisterType((*SeekInfo)(nil), "orderer.SeekInfo") - proto.RegisterType((*DeliverResponse)(nil), "orderer.DeliverResponse") -} - -func init() { proto.RegisterFile("orderer/ab.proto", fileDescriptor_79fce58dd8d86d62) } - -var fileDescriptor_79fce58dd8d86d62 = []byte{ - // 658 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x94, 0xdf, 0x6e, 0xda, 0x4a, - 0x10, 0xc6, 0xed, 0x13, 0x20, 0x61, 0x48, 0xc0, 0xd9, 0x28, 0x39, 0x28, 0x17, 0x47, 0x39, 0xae, - 0xd2, 0x52, 0x55, 0x81, 0x94, 0x4a, 0x95, 0x1a, 0xb5, 0x17, 0x18, 0x4c, 0x71, 0x1b, 0x85, 0x6a, - 0x71, 0xd5, 0x3f, 0x37, 0x96, 0x6d, 0x16, 0xe2, 0x06, 0xbc, 0xd6, 0x7a, 0x93, 0x26, 0xcf, 0xd0, - 0xc7, 0xeb, 0x4b, 0xf4, 0x31, 0xaa, 0x5d, 0xaf, 0x21, 0x21, 0x69, 0xaf, 0xf0, 0x8c, 0x7f, 0xdf, - 0xcc, 0x37, 0xcb, 0xac, 0xc1, 0xa0, 0x6c, 0x4c, 0x18, 0x61, 0x2d, 0x3f, 0x68, 0x26, 0x8c, 0x72, - 0x8a, 0xd6, 0x55, 0x66, 0x7f, 0x27, 0xa4, 0xf3, 0x39, 0x8d, 0x5b, 0xd9, 0x4f, 0xf6, 0xd6, 0x1c, - 0xc2, 0xb6, 0xc5, 0xa8, 0x3f, 0x0e, 0xfd, 0x94, 0x63, 0x92, 0x26, 0x34, 0x4e, 0x09, 0x7a, 0x0c, - 0xa5, 0x94, 0xfb, 0xfc, 0x32, 0xad, 0xeb, 0x07, 0x7a, 0xa3, 0xda, 0xae, 0x36, 0x95, 0x66, 0x24, - 0xb3, 0x58, 0xbd, 0x45, 0x08, 0x0a, 0x51, 0x3c, 0xa1, 0xf5, 0x7f, 0x0e, 0xf4, 0x46, 0x19, 0xcb, - 0x67, 0x73, 0x13, 0x60, 0x44, 0xc8, 0xc5, 0x19, 0xf9, 0x4e, 0x52, 0x9e, 0x47, 0xc3, 0xd9, 0x58, - 0x44, 0x4f, 0x60, 0x4b, 0x44, 0xa3, 0x84, 0x84, 0xd1, 0x24, 0x22, 0x63, 0xb4, 0x07, 0xa5, 0xf8, - 0x72, 0x1e, 0x10, 0x26, 0x1b, 0x15, 0xb0, 0x8a, 0x4c, 0x03, 0xaa, 0x59, 0x91, 0x6b, 0xde, 0xa5, - 0xf3, 0x79, 0xc4, 0xcd, 0x5f, 0x3a, 0x6c, 0x8a, 0xd4, 0x07, 0x9a, 0x46, 0x3c, 0xa2, 0x31, 0x3a, - 0x82, 0x52, 0x2c, 0x7b, 0x48, 0x69, 0xa5, 0xbd, 0xd3, 0x54, 0x73, 0x36, 0x97, 0xed, 0x07, 0x1a, - 0x56, 0x90, 0xc0, 0xa9, 0x34, 0x21, 0xcd, 0xae, 0xe2, 0x99, 0x3f, 0x81, 0x67, 0x10, 0x7a, 0x09, - 0xe5, 0x34, 0x77, 0x59, 0x5f, 0x93, 0x8a, 0xbd, 0x3b, 0x8a, 0xc5, 0x0c, 0x03, 0x0d, 0x2f, 0x51, - 0x74, 0x02, 0x95, 0x98, 0x5c, 0x73, 0x2f, 0x94, 0xae, 0xeb, 0x05, 0xa9, 0xfc, 0x77, 0xc5, 0x5a, - 0x3e, 0xd4, 0x40, 0xc3, 0x10, 0x2f, 0x22, 0xab, 0x04, 0x05, 0xf7, 0x26, 0x21, 0xe6, 0xcf, 0x35, - 0xd8, 0x10, 0xa0, 0x13, 0x4f, 0x28, 0x7a, 0x06, 0xc5, 0x94, 0xfb, 0x2c, 0x9f, 0x72, 0xf7, 0x4e, - 0xa9, 0xfc, 0x30, 0x70, 0xc6, 0xa0, 0xa7, 0x50, 0x48, 0x39, 0x4d, 0xd4, 0x88, 0x7f, 0x60, 0x25, - 0x82, 0x4e, 0x60, 0x23, 0x20, 0xe7, 0xfe, 0x55, 0x44, 0x99, 0x9c, 0xaf, 0xda, 0xfe, 0xef, 0x0e, - 0x2e, 0x9a, 0xcb, 0x07, 0x4b, 0x51, 0x78, 0xc1, 0xa3, 0x77, 0x50, 0x25, 0x8c, 0x51, 0xe6, 0x31, - 0xb5, 0x30, 0x72, 0xce, 0x6a, 0xfb, 0xd1, 0xc3, 0x15, 0x6c, 0xc1, 0xe6, 0xbb, 0x85, 0xb7, 0xc8, - 0xed, 0x10, 0xf5, 0x60, 0x33, 0xa4, 0x31, 0x27, 0x31, 0xf7, 0xf8, 0x4d, 0x42, 0xea, 0x45, 0x59, - 0xe9, 0xff, 0x87, 0x2b, 0x75, 0x33, 0x52, 0x9c, 0x12, 0xae, 0x84, 0xcb, 0xc0, 0x7c, 0x9d, 0x2d, - 0x47, 0xee, 0x15, 0xed, 0xc2, 0xb6, 0x75, 0x3a, 0xec, 0xbe, 0xf7, 0x3e, 0x9e, 0xb9, 0xce, 0xa9, - 0x87, 0xed, 0x4e, 0xef, 0x8b, 0xa1, 0x89, 0x74, 0xbf, 0xe3, 0x9c, 0x7a, 0x4e, 0xdf, 0x3b, 0x1b, - 0xba, 0x2a, 0xad, 0x9b, 0xc7, 0xb0, 0x7d, 0xcf, 0x27, 0x02, 0x28, 0x8d, 0x5c, 0xec, 0x74, 0x5d, - 0x43, 0x43, 0x35, 0xa8, 0x58, 0xf6, 0xc8, 0xf5, 0xec, 0x7e, 0x7f, 0x88, 0x5d, 0x43, 0x37, 0x9f, - 0x43, 0x6d, 0xc5, 0x0f, 0x2a, 0x43, 0x51, 0xb6, 0x34, 0x34, 0xb4, 0x03, 0xb5, 0x81, 0xdd, 0xe9, - 0xd9, 0xd8, 0xfb, 0xe4, 0xb8, 0x03, 0x6f, 0xe4, 0xbc, 0x35, 0x74, 0xf3, 0x1b, 0xd4, 0x7a, 0x64, - 0x16, 0x5d, 0x91, 0x65, 0x8b, 0xc6, 0xdf, 0xaf, 0x99, 0x58, 0x47, 0x75, 0xd1, 0x0e, 0xa1, 0x18, - 0xcc, 0x68, 0x78, 0xa1, 0xfe, 0xd9, 0xad, 0x1c, 0xb4, 0x44, 0x72, 0xa0, 0xe1, 0xec, 0x6d, 0xbe, - 0x41, 0xed, 0x1f, 0x3a, 0xd4, 0x3a, 0x9c, 0xce, 0xa3, 0x70, 0x71, 0xb7, 0xd1, 0x1b, 0x28, 0x2f, - 0x03, 0x23, 0x2f, 0x60, 0xc7, 0x57, 0x64, 0x46, 0x13, 0xb2, 0xbf, 0xbf, 0x38, 0xf1, 0x7b, 0x9f, - 0x83, 0x86, 0x7e, 0xac, 0xa3, 0x57, 0xb0, 0xae, 0xec, 0x3f, 0x20, 0xae, 0x2f, 0xc4, 0x2b, 0x23, - 0x0a, 0xa9, 0xf5, 0x19, 0x0e, 0x29, 0x9b, 0x36, 0xcf, 0x6f, 0x12, 0xc2, 0x66, 0x64, 0x3c, 0x25, - 0xac, 0x39, 0xf1, 0x03, 0x16, 0x85, 0xd9, 0x27, 0x28, 0xcd, 0xc5, 0x5f, 0x5b, 0xd3, 0x88, 0x9f, - 0x5f, 0x06, 0xa2, 0x7c, 0xeb, 0x16, 0xdd, 0xca, 0xe8, 0xa3, 0x8c, 0x3e, 0x9a, 0xd2, 0x96, 0x12, - 0x04, 0x25, 0x99, 0x7a, 0xf1, 0x3b, 0x00, 0x00, 0xff, 0xff, 0x0f, 0x4e, 0x38, 0xe9, 0xf5, 0x04, - 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// AtomicBroadcastClient is the client API for AtomicBroadcast service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type AtomicBroadcastClient interface { - // broadcast receives a reply of Acknowledgement for each common.Envelope in order, indicating success or type of failure - Broadcast(ctx context.Context, opts ...grpc.CallOption) (AtomicBroadcast_BroadcastClient, error) - // deliver first requires an Envelope of type DELIVER_SEEK_INFO with Payload data as a mashaled SeekInfo message, then a stream of block replies is received. - Deliver(ctx context.Context, opts ...grpc.CallOption) (AtomicBroadcast_DeliverClient, error) -} - -type atomicBroadcastClient struct { - cc *grpc.ClientConn -} - -func NewAtomicBroadcastClient(cc *grpc.ClientConn) AtomicBroadcastClient { - return &atomicBroadcastClient{cc} -} - -func (c *atomicBroadcastClient) Broadcast(ctx context.Context, opts ...grpc.CallOption) (AtomicBroadcast_BroadcastClient, error) { - stream, err := c.cc.NewStream(ctx, &_AtomicBroadcast_serviceDesc.Streams[0], "/orderer.AtomicBroadcast/Broadcast", opts...) - if err != nil { - return nil, err - } - x := &atomicBroadcastBroadcastClient{stream} - return x, nil -} - -type AtomicBroadcast_BroadcastClient interface { - Send(*common.Envelope) error - Recv() (*BroadcastResponse, error) - grpc.ClientStream -} - -type atomicBroadcastBroadcastClient struct { - grpc.ClientStream -} - -func (x *atomicBroadcastBroadcastClient) Send(m *common.Envelope) error { - return x.ClientStream.SendMsg(m) -} - -func (x *atomicBroadcastBroadcastClient) Recv() (*BroadcastResponse, error) { - m := new(BroadcastResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *atomicBroadcastClient) Deliver(ctx context.Context, opts ...grpc.CallOption) (AtomicBroadcast_DeliverClient, error) { - stream, err := c.cc.NewStream(ctx, &_AtomicBroadcast_serviceDesc.Streams[1], "/orderer.AtomicBroadcast/Deliver", opts...) - if err != nil { - return nil, err - } - x := &atomicBroadcastDeliverClient{stream} - return x, nil -} - -type AtomicBroadcast_DeliverClient interface { - Send(*common.Envelope) error - Recv() (*DeliverResponse, error) - grpc.ClientStream -} - -type atomicBroadcastDeliverClient struct { - grpc.ClientStream -} - -func (x *atomicBroadcastDeliverClient) Send(m *common.Envelope) error { - return x.ClientStream.SendMsg(m) -} - -func (x *atomicBroadcastDeliverClient) Recv() (*DeliverResponse, error) { - m := new(DeliverResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -// AtomicBroadcastServer is the server API for AtomicBroadcast service. -type AtomicBroadcastServer interface { - // broadcast receives a reply of Acknowledgement for each common.Envelope in order, indicating success or type of failure - Broadcast(AtomicBroadcast_BroadcastServer) error - // deliver first requires an Envelope of type DELIVER_SEEK_INFO with Payload data as a mashaled SeekInfo message, then a stream of block replies is received. - Deliver(AtomicBroadcast_DeliverServer) error -} - -// UnimplementedAtomicBroadcastServer can be embedded to have forward compatible implementations. -type UnimplementedAtomicBroadcastServer struct { -} - -func (*UnimplementedAtomicBroadcastServer) Broadcast(srv AtomicBroadcast_BroadcastServer) error { - return status.Errorf(codes.Unimplemented, "method Broadcast not implemented") -} -func (*UnimplementedAtomicBroadcastServer) Deliver(srv AtomicBroadcast_DeliverServer) error { - return status.Errorf(codes.Unimplemented, "method Deliver not implemented") -} - -func RegisterAtomicBroadcastServer(s *grpc.Server, srv AtomicBroadcastServer) { - s.RegisterService(&_AtomicBroadcast_serviceDesc, srv) -} - -func _AtomicBroadcast_Broadcast_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(AtomicBroadcastServer).Broadcast(&atomicBroadcastBroadcastServer{stream}) -} - -type AtomicBroadcast_BroadcastServer interface { - Send(*BroadcastResponse) error - Recv() (*common.Envelope, error) - grpc.ServerStream -} - -type atomicBroadcastBroadcastServer struct { - grpc.ServerStream -} - -func (x *atomicBroadcastBroadcastServer) Send(m *BroadcastResponse) error { - return x.ServerStream.SendMsg(m) -} - -func (x *atomicBroadcastBroadcastServer) Recv() (*common.Envelope, error) { - m := new(common.Envelope) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func _AtomicBroadcast_Deliver_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(AtomicBroadcastServer).Deliver(&atomicBroadcastDeliverServer{stream}) -} - -type AtomicBroadcast_DeliverServer interface { - Send(*DeliverResponse) error - Recv() (*common.Envelope, error) - grpc.ServerStream -} - -type atomicBroadcastDeliverServer struct { - grpc.ServerStream -} - -func (x *atomicBroadcastDeliverServer) Send(m *DeliverResponse) error { - return x.ServerStream.SendMsg(m) -} - -func (x *atomicBroadcastDeliverServer) Recv() (*common.Envelope, error) { - m := new(common.Envelope) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -var _AtomicBroadcast_serviceDesc = grpc.ServiceDesc{ - ServiceName: "orderer.AtomicBroadcast", - HandlerType: (*AtomicBroadcastServer)(nil), - Methods: []grpc.MethodDesc{}, - Streams: []grpc.StreamDesc{ - { - StreamName: "Broadcast", - Handler: _AtomicBroadcast_Broadcast_Handler, - ServerStreams: true, - ClientStreams: true, - }, - { - StreamName: "Deliver", - Handler: _AtomicBroadcast_Deliver_Handler, - ServerStreams: true, - ClientStreams: true, - }, - }, - Metadata: "orderer/ab.proto", -} diff --git a/vendor/github.com/hyperledger/fabric-protos-go/orderer/blockattestation.pb.go b/vendor/github.com/hyperledger/fabric-protos-go/orderer/blockattestation.pb.go deleted file mode 100644 index a0cc1175360..00000000000 --- a/vendor/github.com/hyperledger/fabric-protos-go/orderer/blockattestation.pb.go +++ /dev/null @@ -1,293 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: orderer/blockattestation.proto - -package orderer - -import ( - context "context" - fmt "fmt" - proto "github.com/golang/protobuf/proto" - common "github.com/hyperledger/fabric-protos-go/common" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - math "math" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package - -type BlockAttestation struct { - Header *common.BlockHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` - Metadata *common.BlockMetadata `protobuf:"bytes,2,opt,name=metadata,proto3" json:"metadata,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *BlockAttestation) Reset() { *m = BlockAttestation{} } -func (m *BlockAttestation) String() string { return proto.CompactTextString(m) } -func (*BlockAttestation) ProtoMessage() {} -func (*BlockAttestation) Descriptor() ([]byte, []int) { - return fileDescriptor_24d99d0b3bd658b0, []int{0} -} - -func (m *BlockAttestation) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_BlockAttestation.Unmarshal(m, b) -} -func (m *BlockAttestation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_BlockAttestation.Marshal(b, m, deterministic) -} -func (m *BlockAttestation) XXX_Merge(src proto.Message) { - xxx_messageInfo_BlockAttestation.Merge(m, src) -} -func (m *BlockAttestation) XXX_Size() int { - return xxx_messageInfo_BlockAttestation.Size(m) -} -func (m *BlockAttestation) XXX_DiscardUnknown() { - xxx_messageInfo_BlockAttestation.DiscardUnknown(m) -} - -var xxx_messageInfo_BlockAttestation proto.InternalMessageInfo - -func (m *BlockAttestation) GetHeader() *common.BlockHeader { - if m != nil { - return m.Header - } - return nil -} - -func (m *BlockAttestation) GetMetadata() *common.BlockMetadata { - if m != nil { - return m.Metadata - } - return nil -} - -type BlockAttestationResponse struct { - // Types that are valid to be assigned to Type: - // - // *BlockAttestationResponse_Status - // *BlockAttestationResponse_BlockAttestation - Type isBlockAttestationResponse_Type `protobuf_oneof:"Type"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *BlockAttestationResponse) Reset() { *m = BlockAttestationResponse{} } -func (m *BlockAttestationResponse) String() string { return proto.CompactTextString(m) } -func (*BlockAttestationResponse) ProtoMessage() {} -func (*BlockAttestationResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_24d99d0b3bd658b0, []int{1} -} - -func (m *BlockAttestationResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_BlockAttestationResponse.Unmarshal(m, b) -} -func (m *BlockAttestationResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_BlockAttestationResponse.Marshal(b, m, deterministic) -} -func (m *BlockAttestationResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_BlockAttestationResponse.Merge(m, src) -} -func (m *BlockAttestationResponse) XXX_Size() int { - return xxx_messageInfo_BlockAttestationResponse.Size(m) -} -func (m *BlockAttestationResponse) XXX_DiscardUnknown() { - xxx_messageInfo_BlockAttestationResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_BlockAttestationResponse proto.InternalMessageInfo - -type isBlockAttestationResponse_Type interface { - isBlockAttestationResponse_Type() -} - -type BlockAttestationResponse_Status struct { - Status common.Status `protobuf:"varint,1,opt,name=status,proto3,enum=common.Status,oneof"` -} - -type BlockAttestationResponse_BlockAttestation struct { - BlockAttestation *BlockAttestation `protobuf:"bytes,2,opt,name=block_attestation,json=blockAttestation,proto3,oneof"` -} - -func (*BlockAttestationResponse_Status) isBlockAttestationResponse_Type() {} - -func (*BlockAttestationResponse_BlockAttestation) isBlockAttestationResponse_Type() {} - -func (m *BlockAttestationResponse) GetType() isBlockAttestationResponse_Type { - if m != nil { - return m.Type - } - return nil -} - -func (m *BlockAttestationResponse) GetStatus() common.Status { - if x, ok := m.GetType().(*BlockAttestationResponse_Status); ok { - return x.Status - } - return common.Status_UNKNOWN -} - -func (m *BlockAttestationResponse) GetBlockAttestation() *BlockAttestation { - if x, ok := m.GetType().(*BlockAttestationResponse_BlockAttestation); ok { - return x.BlockAttestation - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*BlockAttestationResponse) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*BlockAttestationResponse_Status)(nil), - (*BlockAttestationResponse_BlockAttestation)(nil), - } -} - -func init() { - proto.RegisterType((*BlockAttestation)(nil), "orderer.BlockAttestation") - proto.RegisterType((*BlockAttestationResponse)(nil), "orderer.BlockAttestationResponse") -} - -func init() { proto.RegisterFile("orderer/blockattestation.proto", fileDescriptor_24d99d0b3bd658b0) } - -var fileDescriptor_24d99d0b3bd658b0 = []byte{ - // 293 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x91, 0xd1, 0x4a, 0xbc, 0x40, - 0x18, 0xc5, 0xd7, 0x3f, 0x7f, 0x2c, 0x26, 0x58, 0xdc, 0x59, 0x02, 0xdb, 0x8b, 0xa8, 0x85, 0x60, - 0x21, 0x76, 0xa6, 0xec, 0x09, 0x12, 0x02, 0x09, 0xba, 0xb1, 0x2e, 0xa2, 0x9b, 0x65, 0xd4, 0x2f, - 0x95, 0xd4, 0x4f, 0x66, 0x66, 0x83, 0x7d, 0x91, 0x9e, 0x37, 0x1c, 0xc7, 0xda, 0xa4, 0xae, 0x84, - 0x73, 0x7e, 0x67, 0xce, 0x77, 0x90, 0x9c, 0xa2, 0xcc, 0x40, 0x82, 0xe4, 0x49, 0x85, 0xe9, 0x9b, - 0xd0, 0x1a, 0x94, 0x16, 0xba, 0xc4, 0x86, 0xb5, 0x12, 0x35, 0xd2, 0x03, 0xeb, 0x2f, 0xe6, 0x29, - 0xd6, 0x35, 0x36, 0xbc, 0xff, 0xf4, 0xee, 0x52, 0x12, 0x2f, 0xec, 0x72, 0xb7, 0xdf, 0x39, 0x7a, - 0x49, 0xdc, 0x02, 0x44, 0x06, 0xd2, 0x77, 0xce, 0x9c, 0xd5, 0x51, 0x30, 0x67, 0x36, 0x62, 0xc8, - 0xc8, 0x58, 0xb1, 0x45, 0xe8, 0x35, 0x39, 0xac, 0x41, 0x8b, 0x4c, 0x68, 0xe1, 0xff, 0x33, 0xf8, - 0xf1, 0x0f, 0xfc, 0xc1, 0x9a, 0xf1, 0x17, 0xb6, 0xfc, 0x70, 0x88, 0x3f, 0x2e, 0x8d, 0x41, 0xb5, - 0xd8, 0x28, 0xa0, 0x2b, 0xe2, 0x76, 0xd2, 0x56, 0x99, 0xf2, 0x69, 0x30, 0x1d, 0x5e, 0x7b, 0x34, - 0x6a, 0x34, 0x89, 0xad, 0x4f, 0x23, 0x32, 0x33, 0x93, 0x37, 0x7b, 0x9b, 0xed, 0x09, 0x27, 0xcc, - 0x8e, 0x66, 0xe3, 0x9e, 0x68, 0x12, 0x7b, 0xc9, 0x48, 0x0b, 0x5d, 0xf2, 0xff, 0x69, 0xd7, 0x42, - 0xb0, 0x21, 0xb3, 0x31, 0xaf, 0xe8, 0xfd, 0x6f, 0xa2, 0x37, 0x5c, 0x75, 0xd7, 0xbc, 0x43, 0x85, - 0x2d, 0x2c, 0xce, 0xff, 0xac, 0x1c, 0xa6, 0x5d, 0x39, 0xe1, 0x33, 0xb9, 0x40, 0x99, 0xb3, 0x62, - 0xd7, 0x82, 0xac, 0x20, 0xcb, 0x41, 0xb2, 0x57, 0x91, 0xc8, 0x32, 0xed, 0xff, 0x86, 0x1a, 0xde, - 0x78, 0xe1, 0x79, 0xa9, 0x8b, 0x6d, 0xd2, 0xb5, 0xf0, 0x3d, 0x9a, 0xf7, 0xf4, 0xba, 0xa7, 0xd7, - 0x39, 0x72, 0x1b, 0x48, 0x5c, 0x23, 0xdd, 0x7c, 0x06, 0x00, 0x00, 0xff, 0xff, 0xe2, 0x54, 0x77, - 0xb8, 0x0e, 0x02, 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// BlockAttestationsClient is the client API for BlockAttestations service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type BlockAttestationsClient interface { - // BlockAttestations receives an Envelope of type DELIVER_SEEK_INFO , then sends back a stream of BlockAttestations. - BlockAttestations(ctx context.Context, in *common.Envelope, opts ...grpc.CallOption) (BlockAttestations_BlockAttestationsClient, error) -} - -type blockAttestationsClient struct { - cc *grpc.ClientConn -} - -func NewBlockAttestationsClient(cc *grpc.ClientConn) BlockAttestationsClient { - return &blockAttestationsClient{cc} -} - -func (c *blockAttestationsClient) BlockAttestations(ctx context.Context, in *common.Envelope, opts ...grpc.CallOption) (BlockAttestations_BlockAttestationsClient, error) { - stream, err := c.cc.NewStream(ctx, &_BlockAttestations_serviceDesc.Streams[0], "/orderer.BlockAttestations/BlockAttestations", opts...) - if err != nil { - return nil, err - } - x := &blockAttestationsBlockAttestationsClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -type BlockAttestations_BlockAttestationsClient interface { - Recv() (*BlockAttestationResponse, error) - grpc.ClientStream -} - -type blockAttestationsBlockAttestationsClient struct { - grpc.ClientStream -} - -func (x *blockAttestationsBlockAttestationsClient) Recv() (*BlockAttestationResponse, error) { - m := new(BlockAttestationResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -// BlockAttestationsServer is the server API for BlockAttestations service. -type BlockAttestationsServer interface { - // BlockAttestations receives an Envelope of type DELIVER_SEEK_INFO , then sends back a stream of BlockAttestations. - BlockAttestations(*common.Envelope, BlockAttestations_BlockAttestationsServer) error -} - -// UnimplementedBlockAttestationsServer can be embedded to have forward compatible implementations. -type UnimplementedBlockAttestationsServer struct { -} - -func (*UnimplementedBlockAttestationsServer) BlockAttestations(req *common.Envelope, srv BlockAttestations_BlockAttestationsServer) error { - return status.Errorf(codes.Unimplemented, "method BlockAttestations not implemented") -} - -func RegisterBlockAttestationsServer(s *grpc.Server, srv BlockAttestationsServer) { - s.RegisterService(&_BlockAttestations_serviceDesc, srv) -} - -func _BlockAttestations_BlockAttestations_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(common.Envelope) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(BlockAttestationsServer).BlockAttestations(m, &blockAttestationsBlockAttestationsServer{stream}) -} - -type BlockAttestations_BlockAttestationsServer interface { - Send(*BlockAttestationResponse) error - grpc.ServerStream -} - -type blockAttestationsBlockAttestationsServer struct { - grpc.ServerStream -} - -func (x *blockAttestationsBlockAttestationsServer) Send(m *BlockAttestationResponse) error { - return x.ServerStream.SendMsg(m) -} - -var _BlockAttestations_serviceDesc = grpc.ServiceDesc{ - ServiceName: "orderer.BlockAttestations", - HandlerType: (*BlockAttestationsServer)(nil), - Methods: []grpc.MethodDesc{}, - Streams: []grpc.StreamDesc{ - { - StreamName: "BlockAttestations", - Handler: _BlockAttestations_BlockAttestations_Handler, - ServerStreams: true, - }, - }, - Metadata: "orderer/blockattestation.proto", -} diff --git a/vendor/github.com/hyperledger/fabric-protos-go/orderer/cluster.pb.go b/vendor/github.com/hyperledger/fabric-protos-go/orderer/cluster.pb.go deleted file mode 100644 index 7a7566a192d..00000000000 --- a/vendor/github.com/hyperledger/fabric-protos-go/orderer/cluster.pb.go +++ /dev/null @@ -1,506 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: orderer/cluster.proto - -package orderer - -import ( - context "context" - fmt "fmt" - proto "github.com/golang/protobuf/proto" - common "github.com/hyperledger/fabric-protos-go/common" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - math "math" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package - -// StepRequest wraps a message that is sent to a cluster member. -type StepRequest struct { - // Types that are valid to be assigned to Payload: - // - // *StepRequest_ConsensusRequest - // *StepRequest_SubmitRequest - Payload isStepRequest_Payload `protobuf_oneof:"payload"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *StepRequest) Reset() { *m = StepRequest{} } -func (m *StepRequest) String() string { return proto.CompactTextString(m) } -func (*StepRequest) ProtoMessage() {} -func (*StepRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_e3b50707fd3a71f2, []int{0} -} - -func (m *StepRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_StepRequest.Unmarshal(m, b) -} -func (m *StepRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_StepRequest.Marshal(b, m, deterministic) -} -func (m *StepRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_StepRequest.Merge(m, src) -} -func (m *StepRequest) XXX_Size() int { - return xxx_messageInfo_StepRequest.Size(m) -} -func (m *StepRequest) XXX_DiscardUnknown() { - xxx_messageInfo_StepRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_StepRequest proto.InternalMessageInfo - -type isStepRequest_Payload interface { - isStepRequest_Payload() -} - -type StepRequest_ConsensusRequest struct { - ConsensusRequest *ConsensusRequest `protobuf:"bytes,1,opt,name=consensus_request,json=consensusRequest,proto3,oneof"` -} - -type StepRequest_SubmitRequest struct { - SubmitRequest *SubmitRequest `protobuf:"bytes,2,opt,name=submit_request,json=submitRequest,proto3,oneof"` -} - -func (*StepRequest_ConsensusRequest) isStepRequest_Payload() {} - -func (*StepRequest_SubmitRequest) isStepRequest_Payload() {} - -func (m *StepRequest) GetPayload() isStepRequest_Payload { - if m != nil { - return m.Payload - } - return nil -} - -func (m *StepRequest) GetConsensusRequest() *ConsensusRequest { - if x, ok := m.GetPayload().(*StepRequest_ConsensusRequest); ok { - return x.ConsensusRequest - } - return nil -} - -func (m *StepRequest) GetSubmitRequest() *SubmitRequest { - if x, ok := m.GetPayload().(*StepRequest_SubmitRequest); ok { - return x.SubmitRequest - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*StepRequest) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*StepRequest_ConsensusRequest)(nil), - (*StepRequest_SubmitRequest)(nil), - } -} - -// StepResponse is a message received from a cluster member. -type StepResponse struct { - // Types that are valid to be assigned to Payload: - // - // *StepResponse_SubmitRes - Payload isStepResponse_Payload `protobuf_oneof:"payload"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *StepResponse) Reset() { *m = StepResponse{} } -func (m *StepResponse) String() string { return proto.CompactTextString(m) } -func (*StepResponse) ProtoMessage() {} -func (*StepResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_e3b50707fd3a71f2, []int{1} -} - -func (m *StepResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_StepResponse.Unmarshal(m, b) -} -func (m *StepResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_StepResponse.Marshal(b, m, deterministic) -} -func (m *StepResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_StepResponse.Merge(m, src) -} -func (m *StepResponse) XXX_Size() int { - return xxx_messageInfo_StepResponse.Size(m) -} -func (m *StepResponse) XXX_DiscardUnknown() { - xxx_messageInfo_StepResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_StepResponse proto.InternalMessageInfo - -type isStepResponse_Payload interface { - isStepResponse_Payload() -} - -type StepResponse_SubmitRes struct { - SubmitRes *SubmitResponse `protobuf:"bytes,1,opt,name=submit_res,json=submitRes,proto3,oneof"` -} - -func (*StepResponse_SubmitRes) isStepResponse_Payload() {} - -func (m *StepResponse) GetPayload() isStepResponse_Payload { - if m != nil { - return m.Payload - } - return nil -} - -func (m *StepResponse) GetSubmitRes() *SubmitResponse { - if x, ok := m.GetPayload().(*StepResponse_SubmitRes); ok { - return x.SubmitRes - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*StepResponse) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*StepResponse_SubmitRes)(nil), - } -} - -// ConsensusRequest is a consensus specific message sent to a cluster member. -type ConsensusRequest struct { - Channel string `protobuf:"bytes,1,opt,name=channel,proto3" json:"channel,omitempty"` - Payload []byte `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"` - Metadata []byte `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ConsensusRequest) Reset() { *m = ConsensusRequest{} } -func (m *ConsensusRequest) String() string { return proto.CompactTextString(m) } -func (*ConsensusRequest) ProtoMessage() {} -func (*ConsensusRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_e3b50707fd3a71f2, []int{2} -} - -func (m *ConsensusRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ConsensusRequest.Unmarshal(m, b) -} -func (m *ConsensusRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ConsensusRequest.Marshal(b, m, deterministic) -} -func (m *ConsensusRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ConsensusRequest.Merge(m, src) -} -func (m *ConsensusRequest) XXX_Size() int { - return xxx_messageInfo_ConsensusRequest.Size(m) -} -func (m *ConsensusRequest) XXX_DiscardUnknown() { - xxx_messageInfo_ConsensusRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_ConsensusRequest proto.InternalMessageInfo - -func (m *ConsensusRequest) GetChannel() string { - if m != nil { - return m.Channel - } - return "" -} - -func (m *ConsensusRequest) GetPayload() []byte { - if m != nil { - return m.Payload - } - return nil -} - -func (m *ConsensusRequest) GetMetadata() []byte { - if m != nil { - return m.Metadata - } - return nil -} - -// SubmitRequest wraps a transaction to be sent for ordering. -type SubmitRequest struct { - Channel string `protobuf:"bytes,1,opt,name=channel,proto3" json:"channel,omitempty"` - // last_validation_seq denotes the last - // configuration sequence at which the - // sender validated this message. - LastValidationSeq uint64 `protobuf:"varint,2,opt,name=last_validation_seq,json=lastValidationSeq,proto3" json:"last_validation_seq,omitempty"` - // content is the fabric transaction - // that is forwarded to the cluster member. - Payload *common.Envelope `protobuf:"bytes,3,opt,name=payload,proto3" json:"payload,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SubmitRequest) Reset() { *m = SubmitRequest{} } -func (m *SubmitRequest) String() string { return proto.CompactTextString(m) } -func (*SubmitRequest) ProtoMessage() {} -func (*SubmitRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_e3b50707fd3a71f2, []int{3} -} - -func (m *SubmitRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SubmitRequest.Unmarshal(m, b) -} -func (m *SubmitRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SubmitRequest.Marshal(b, m, deterministic) -} -func (m *SubmitRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_SubmitRequest.Merge(m, src) -} -func (m *SubmitRequest) XXX_Size() int { - return xxx_messageInfo_SubmitRequest.Size(m) -} -func (m *SubmitRequest) XXX_DiscardUnknown() { - xxx_messageInfo_SubmitRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_SubmitRequest proto.InternalMessageInfo - -func (m *SubmitRequest) GetChannel() string { - if m != nil { - return m.Channel - } - return "" -} - -func (m *SubmitRequest) GetLastValidationSeq() uint64 { - if m != nil { - return m.LastValidationSeq - } - return 0 -} - -func (m *SubmitRequest) GetPayload() *common.Envelope { - if m != nil { - return m.Payload - } - return nil -} - -// SubmitResponse returns a success -// or failure status to the sender. -type SubmitResponse struct { - Channel string `protobuf:"bytes,1,opt,name=channel,proto3" json:"channel,omitempty"` - // Status code, which may be used to programatically respond to success/failure. - Status common.Status `protobuf:"varint,2,opt,name=status,proto3,enum=common.Status" json:"status,omitempty"` - // Info string which may contain additional information about the returned status. - Info string `protobuf:"bytes,3,opt,name=info,proto3" json:"info,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SubmitResponse) Reset() { *m = SubmitResponse{} } -func (m *SubmitResponse) String() string { return proto.CompactTextString(m) } -func (*SubmitResponse) ProtoMessage() {} -func (*SubmitResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_e3b50707fd3a71f2, []int{4} -} - -func (m *SubmitResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SubmitResponse.Unmarshal(m, b) -} -func (m *SubmitResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SubmitResponse.Marshal(b, m, deterministic) -} -func (m *SubmitResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_SubmitResponse.Merge(m, src) -} -func (m *SubmitResponse) XXX_Size() int { - return xxx_messageInfo_SubmitResponse.Size(m) -} -func (m *SubmitResponse) XXX_DiscardUnknown() { - xxx_messageInfo_SubmitResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_SubmitResponse proto.InternalMessageInfo - -func (m *SubmitResponse) GetChannel() string { - if m != nil { - return m.Channel - } - return "" -} - -func (m *SubmitResponse) GetStatus() common.Status { - if m != nil { - return m.Status - } - return common.Status_UNKNOWN -} - -func (m *SubmitResponse) GetInfo() string { - if m != nil { - return m.Info - } - return "" -} - -func init() { - proto.RegisterType((*StepRequest)(nil), "orderer.StepRequest") - proto.RegisterType((*StepResponse)(nil), "orderer.StepResponse") - proto.RegisterType((*ConsensusRequest)(nil), "orderer.ConsensusRequest") - proto.RegisterType((*SubmitRequest)(nil), "orderer.SubmitRequest") - proto.RegisterType((*SubmitResponse)(nil), "orderer.SubmitResponse") -} - -func init() { proto.RegisterFile("orderer/cluster.proto", fileDescriptor_e3b50707fd3a71f2) } - -var fileDescriptor_e3b50707fd3a71f2 = []byte{ - // 418 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x52, 0xc1, 0x6a, 0xdb, 0x40, - 0x10, 0x8d, 0x1a, 0x13, 0x57, 0x93, 0x44, 0x38, 0x9b, 0xa6, 0x75, 0x7d, 0x2a, 0x82, 0x96, 0x50, - 0x88, 0x54, 0xdc, 0x43, 0x7b, 0x2b, 0x38, 0x14, 0x7c, 0x5e, 0x41, 0x29, 0xbd, 0x98, 0x95, 0x34, - 0x96, 0x05, 0xd2, 0xae, 0xbc, 0xbb, 0x0a, 0xe4, 0x03, 0xfa, 0x25, 0xfd, 0xd1, 0xa2, 0xdd, 0x95, - 0xe4, 0x38, 0x90, 0x93, 0x34, 0xef, 0xcd, 0xbc, 0x79, 0xb3, 0x33, 0x70, 0x23, 0x64, 0x8e, 0x12, - 0x65, 0x9c, 0x55, 0xad, 0xd2, 0x28, 0xa3, 0x46, 0x0a, 0x2d, 0xc8, 0xd4, 0xc1, 0x8b, 0xeb, 0x4c, - 0xd4, 0xb5, 0xe0, 0xb1, 0xfd, 0x58, 0x36, 0xfc, 0xe7, 0xc1, 0x79, 0xa2, 0xb1, 0xa1, 0xb8, 0x6f, - 0x51, 0x69, 0xb2, 0x86, 0xab, 0x4c, 0x70, 0x85, 0x5c, 0xb5, 0x6a, 0x23, 0x2d, 0x38, 0xf7, 0x3e, - 0x78, 0xb7, 0xe7, 0xcb, 0xf7, 0x91, 0x53, 0x8a, 0xee, 0xfb, 0x0c, 0x57, 0xb5, 0x3e, 0xa1, 0xb3, - 0xec, 0x08, 0x23, 0x3f, 0x20, 0x50, 0x6d, 0x5a, 0x97, 0x7a, 0x90, 0x79, 0x65, 0x64, 0xde, 0x0e, - 0x32, 0x89, 0xa1, 0x47, 0x8d, 0x4b, 0x75, 0x08, 0xac, 0x7c, 0x98, 0x36, 0xec, 0xb1, 0x12, 0x2c, - 0x0f, 0x13, 0xb8, 0xb0, 0x26, 0x55, 0xd3, 0xb5, 0x21, 0xdf, 0x01, 0x06, 0x6d, 0xe5, 0xec, 0xbd, - 0x7b, 0xa6, 0x6b, 0x93, 0xd7, 0x27, 0xd4, 0xef, 0x85, 0xd5, 0xa1, 0x68, 0x0a, 0xb3, 0xe3, 0x41, - 0xc8, 0x1c, 0xa6, 0xd9, 0x8e, 0x71, 0x8e, 0x95, 0x51, 0xf5, 0x69, 0x1f, 0x76, 0x8c, 0x2b, 0x34, - 0x73, 0x5c, 0xd0, 0x3e, 0x24, 0x0b, 0x78, 0x5d, 0xa3, 0x66, 0x39, 0xd3, 0x6c, 0x7e, 0x6a, 0xa8, - 0x21, 0x0e, 0xff, 0x7a, 0x70, 0xf9, 0x64, 0xcc, 0x17, 0x3a, 0x44, 0x70, 0x5d, 0x31, 0xa5, 0x37, - 0x0f, 0xac, 0x2a, 0x73, 0xa6, 0x4b, 0xc1, 0x37, 0x0a, 0xf7, 0xa6, 0xdb, 0x84, 0x5e, 0x75, 0xd4, - 0xaf, 0x81, 0x49, 0x70, 0x4f, 0x3e, 0x8f, 0x8e, 0x4e, 0xcd, 0x0b, 0xcc, 0x22, 0xb7, 0xda, 0x9f, - 0xfc, 0x01, 0x2b, 0xd1, 0xe0, 0xe0, 0x31, 0xdc, 0x42, 0xf0, 0xf4, 0x55, 0x5e, 0xf0, 0xf1, 0x09, - 0xce, 0x94, 0x66, 0xba, 0x55, 0xa6, 0x75, 0xb0, 0x0c, 0x7a, 0xd9, 0xc4, 0xa0, 0xd4, 0xb1, 0x84, - 0xc0, 0xa4, 0xe4, 0x5b, 0x61, 0x9a, 0xfb, 0xd4, 0xfc, 0x2f, 0x57, 0x30, 0xbd, 0xb7, 0xd7, 0x47, - 0xbe, 0xc1, 0xa4, 0xdb, 0x19, 0x79, 0x33, 0xee, 0x65, 0xbc, 0xb3, 0xc5, 0xcd, 0x11, 0x6a, 0x5d, - 0xdd, 0x7a, 0x5f, 0xbc, 0xd5, 0x6f, 0xf8, 0x28, 0x64, 0x11, 0xed, 0x1e, 0x1b, 0x94, 0x15, 0xe6, - 0x05, 0xca, 0x68, 0xcb, 0x52, 0x59, 0x66, 0xf6, 0x64, 0x55, 0x5f, 0xf9, 0x27, 0x2e, 0x4a, 0xbd, - 0x6b, 0xd3, 0xce, 0x5e, 0x7c, 0x90, 0x1d, 0xdb, 0xec, 0x3b, 0x9b, 0x7d, 0x57, 0x88, 0xd8, 0x15, - 0xa4, 0x67, 0x06, 0xfa, 0xfa, 0x3f, 0x00, 0x00, 0xff, 0xff, 0xe2, 0xed, 0x23, 0xd0, 0x2a, 0x03, - 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// ClusterClient is the client API for Cluster service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type ClusterClient interface { - // Step passes an implementation-specific message to another cluster member. - Step(ctx context.Context, opts ...grpc.CallOption) (Cluster_StepClient, error) -} - -type clusterClient struct { - cc *grpc.ClientConn -} - -func NewClusterClient(cc *grpc.ClientConn) ClusterClient { - return &clusterClient{cc} -} - -func (c *clusterClient) Step(ctx context.Context, opts ...grpc.CallOption) (Cluster_StepClient, error) { - stream, err := c.cc.NewStream(ctx, &_Cluster_serviceDesc.Streams[0], "/orderer.Cluster/Step", opts...) - if err != nil { - return nil, err - } - x := &clusterStepClient{stream} - return x, nil -} - -type Cluster_StepClient interface { - Send(*StepRequest) error - Recv() (*StepResponse, error) - grpc.ClientStream -} - -type clusterStepClient struct { - grpc.ClientStream -} - -func (x *clusterStepClient) Send(m *StepRequest) error { - return x.ClientStream.SendMsg(m) -} - -func (x *clusterStepClient) Recv() (*StepResponse, error) { - m := new(StepResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -// ClusterServer is the server API for Cluster service. -type ClusterServer interface { - // Step passes an implementation-specific message to another cluster member. - Step(Cluster_StepServer) error -} - -// UnimplementedClusterServer can be embedded to have forward compatible implementations. -type UnimplementedClusterServer struct { -} - -func (*UnimplementedClusterServer) Step(srv Cluster_StepServer) error { - return status.Errorf(codes.Unimplemented, "method Step not implemented") -} - -func RegisterClusterServer(s *grpc.Server, srv ClusterServer) { - s.RegisterService(&_Cluster_serviceDesc, srv) -} - -func _Cluster_Step_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(ClusterServer).Step(&clusterStepServer{stream}) -} - -type Cluster_StepServer interface { - Send(*StepResponse) error - Recv() (*StepRequest, error) - grpc.ServerStream -} - -type clusterStepServer struct { - grpc.ServerStream -} - -func (x *clusterStepServer) Send(m *StepResponse) error { - return x.ServerStream.SendMsg(m) -} - -func (x *clusterStepServer) Recv() (*StepRequest, error) { - m := new(StepRequest) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -var _Cluster_serviceDesc = grpc.ServiceDesc{ - ServiceName: "orderer.Cluster", - HandlerType: (*ClusterServer)(nil), - Methods: []grpc.MethodDesc{}, - Streams: []grpc.StreamDesc{ - { - StreamName: "Step", - Handler: _Cluster_Step_Handler, - ServerStreams: true, - ClientStreams: true, - }, - }, - Metadata: "orderer/cluster.proto", -} diff --git a/vendor/github.com/hyperledger/fabric-protos-go/orderer/clusterserver.pb.go b/vendor/github.com/hyperledger/fabric-protos-go/orderer/clusterserver.pb.go deleted file mode 100644 index ca2730d0d67..00000000000 --- a/vendor/github.com/hyperledger/fabric-protos-go/orderer/clusterserver.pb.go +++ /dev/null @@ -1,622 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: orderer/clusterserver.proto - -package orderer - -import ( - context "context" - fmt "fmt" - proto "github.com/golang/protobuf/proto" - common "github.com/hyperledger/fabric-protos-go/common" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" - math "math" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package - -// ClusterNodeServiceStepRequest wraps a message that is sent to a cluster member. -type ClusterNodeServiceStepRequest struct { - // Types that are valid to be assigned to Payload: - // - // *ClusterNodeServiceStepRequest_NodeConrequest - // *ClusterNodeServiceStepRequest_NodeTranrequest - // *ClusterNodeServiceStepRequest_NodeAuthrequest - Payload isClusterNodeServiceStepRequest_Payload `protobuf_oneof:"payload"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ClusterNodeServiceStepRequest) Reset() { *m = ClusterNodeServiceStepRequest{} } -func (m *ClusterNodeServiceStepRequest) String() string { return proto.CompactTextString(m) } -func (*ClusterNodeServiceStepRequest) ProtoMessage() {} -func (*ClusterNodeServiceStepRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_ce2573c2284b220f, []int{0} -} - -func (m *ClusterNodeServiceStepRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ClusterNodeServiceStepRequest.Unmarshal(m, b) -} -func (m *ClusterNodeServiceStepRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ClusterNodeServiceStepRequest.Marshal(b, m, deterministic) -} -func (m *ClusterNodeServiceStepRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ClusterNodeServiceStepRequest.Merge(m, src) -} -func (m *ClusterNodeServiceStepRequest) XXX_Size() int { - return xxx_messageInfo_ClusterNodeServiceStepRequest.Size(m) -} -func (m *ClusterNodeServiceStepRequest) XXX_DiscardUnknown() { - xxx_messageInfo_ClusterNodeServiceStepRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_ClusterNodeServiceStepRequest proto.InternalMessageInfo - -type isClusterNodeServiceStepRequest_Payload interface { - isClusterNodeServiceStepRequest_Payload() -} - -type ClusterNodeServiceStepRequest_NodeConrequest struct { - NodeConrequest *NodeConsensusRequest `protobuf:"bytes,1,opt,name=node_conrequest,json=nodeConrequest,proto3,oneof"` -} - -type ClusterNodeServiceStepRequest_NodeTranrequest struct { - NodeTranrequest *NodeTransactionOrderRequest `protobuf:"bytes,2,opt,name=node_tranrequest,json=nodeTranrequest,proto3,oneof"` -} - -type ClusterNodeServiceStepRequest_NodeAuthrequest struct { - NodeAuthrequest *NodeAuthRequest `protobuf:"bytes,3,opt,name=node_authrequest,json=nodeAuthrequest,proto3,oneof"` -} - -func (*ClusterNodeServiceStepRequest_NodeConrequest) isClusterNodeServiceStepRequest_Payload() {} - -func (*ClusterNodeServiceStepRequest_NodeTranrequest) isClusterNodeServiceStepRequest_Payload() {} - -func (*ClusterNodeServiceStepRequest_NodeAuthrequest) isClusterNodeServiceStepRequest_Payload() {} - -func (m *ClusterNodeServiceStepRequest) GetPayload() isClusterNodeServiceStepRequest_Payload { - if m != nil { - return m.Payload - } - return nil -} - -func (m *ClusterNodeServiceStepRequest) GetNodeConrequest() *NodeConsensusRequest { - if x, ok := m.GetPayload().(*ClusterNodeServiceStepRequest_NodeConrequest); ok { - return x.NodeConrequest - } - return nil -} - -func (m *ClusterNodeServiceStepRequest) GetNodeTranrequest() *NodeTransactionOrderRequest { - if x, ok := m.GetPayload().(*ClusterNodeServiceStepRequest_NodeTranrequest); ok { - return x.NodeTranrequest - } - return nil -} - -func (m *ClusterNodeServiceStepRequest) GetNodeAuthrequest() *NodeAuthRequest { - if x, ok := m.GetPayload().(*ClusterNodeServiceStepRequest_NodeAuthrequest); ok { - return x.NodeAuthrequest - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*ClusterNodeServiceStepRequest) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*ClusterNodeServiceStepRequest_NodeConrequest)(nil), - (*ClusterNodeServiceStepRequest_NodeTranrequest)(nil), - (*ClusterNodeServiceStepRequest_NodeAuthrequest)(nil), - } -} - -// ClusterNodeServiceStepResponse is a message received from a cluster member. -type ClusterNodeServiceStepResponse struct { - // Types that are valid to be assigned to Payload: - // - // *ClusterNodeServiceStepResponse_TranorderRes - Payload isClusterNodeServiceStepResponse_Payload `protobuf_oneof:"payload"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ClusterNodeServiceStepResponse) Reset() { *m = ClusterNodeServiceStepResponse{} } -func (m *ClusterNodeServiceStepResponse) String() string { return proto.CompactTextString(m) } -func (*ClusterNodeServiceStepResponse) ProtoMessage() {} -func (*ClusterNodeServiceStepResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_ce2573c2284b220f, []int{1} -} - -func (m *ClusterNodeServiceStepResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ClusterNodeServiceStepResponse.Unmarshal(m, b) -} -func (m *ClusterNodeServiceStepResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ClusterNodeServiceStepResponse.Marshal(b, m, deterministic) -} -func (m *ClusterNodeServiceStepResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ClusterNodeServiceStepResponse.Merge(m, src) -} -func (m *ClusterNodeServiceStepResponse) XXX_Size() int { - return xxx_messageInfo_ClusterNodeServiceStepResponse.Size(m) -} -func (m *ClusterNodeServiceStepResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ClusterNodeServiceStepResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_ClusterNodeServiceStepResponse proto.InternalMessageInfo - -type isClusterNodeServiceStepResponse_Payload interface { - isClusterNodeServiceStepResponse_Payload() -} - -type ClusterNodeServiceStepResponse_TranorderRes struct { - TranorderRes *TransactionOrderResponse `protobuf:"bytes,1,opt,name=tranorder_res,json=tranorderRes,proto3,oneof"` -} - -func (*ClusterNodeServiceStepResponse_TranorderRes) isClusterNodeServiceStepResponse_Payload() {} - -func (m *ClusterNodeServiceStepResponse) GetPayload() isClusterNodeServiceStepResponse_Payload { - if m != nil { - return m.Payload - } - return nil -} - -func (m *ClusterNodeServiceStepResponse) GetTranorderRes() *TransactionOrderResponse { - if x, ok := m.GetPayload().(*ClusterNodeServiceStepResponse_TranorderRes); ok { - return x.TranorderRes - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*ClusterNodeServiceStepResponse) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*ClusterNodeServiceStepResponse_TranorderRes)(nil), - } -} - -// NodeConsensusRequest is a consensus specific message sent to a cluster member. -type NodeConsensusRequest struct { - Payload []byte `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"` - Metadata []byte `protobuf:"bytes,2,opt,name=metadata,proto3" json:"metadata,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *NodeConsensusRequest) Reset() { *m = NodeConsensusRequest{} } -func (m *NodeConsensusRequest) String() string { return proto.CompactTextString(m) } -func (*NodeConsensusRequest) ProtoMessage() {} -func (*NodeConsensusRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_ce2573c2284b220f, []int{2} -} - -func (m *NodeConsensusRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_NodeConsensusRequest.Unmarshal(m, b) -} -func (m *NodeConsensusRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_NodeConsensusRequest.Marshal(b, m, deterministic) -} -func (m *NodeConsensusRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_NodeConsensusRequest.Merge(m, src) -} -func (m *NodeConsensusRequest) XXX_Size() int { - return xxx_messageInfo_NodeConsensusRequest.Size(m) -} -func (m *NodeConsensusRequest) XXX_DiscardUnknown() { - xxx_messageInfo_NodeConsensusRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_NodeConsensusRequest proto.InternalMessageInfo - -func (m *NodeConsensusRequest) GetPayload() []byte { - if m != nil { - return m.Payload - } - return nil -} - -func (m *NodeConsensusRequest) GetMetadata() []byte { - if m != nil { - return m.Metadata - } - return nil -} - -// NodeTransactionOrderRequest wraps a transaction to be sent for ordering. -type NodeTransactionOrderRequest struct { - // last_validation_seq denotes the last configuration sequence at which the - // sender validated this message. - LastValidationSeq uint64 `protobuf:"varint,1,opt,name=last_validation_seq,json=lastValidationSeq,proto3" json:"last_validation_seq,omitempty"` - // content is the fabric transaction - // that is forwarded to the cluster member. - Payload *common.Envelope `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *NodeTransactionOrderRequest) Reset() { *m = NodeTransactionOrderRequest{} } -func (m *NodeTransactionOrderRequest) String() string { return proto.CompactTextString(m) } -func (*NodeTransactionOrderRequest) ProtoMessage() {} -func (*NodeTransactionOrderRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_ce2573c2284b220f, []int{3} -} - -func (m *NodeTransactionOrderRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_NodeTransactionOrderRequest.Unmarshal(m, b) -} -func (m *NodeTransactionOrderRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_NodeTransactionOrderRequest.Marshal(b, m, deterministic) -} -func (m *NodeTransactionOrderRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_NodeTransactionOrderRequest.Merge(m, src) -} -func (m *NodeTransactionOrderRequest) XXX_Size() int { - return xxx_messageInfo_NodeTransactionOrderRequest.Size(m) -} -func (m *NodeTransactionOrderRequest) XXX_DiscardUnknown() { - xxx_messageInfo_NodeTransactionOrderRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_NodeTransactionOrderRequest proto.InternalMessageInfo - -func (m *NodeTransactionOrderRequest) GetLastValidationSeq() uint64 { - if m != nil { - return m.LastValidationSeq - } - return 0 -} - -func (m *NodeTransactionOrderRequest) GetPayload() *common.Envelope { - if m != nil { - return m.Payload - } - return nil -} - -// TransactionOrderResponse returns a success -// or failure status to the sender. -type TransactionOrderResponse struct { - Channel string `protobuf:"bytes,1,opt,name=channel,proto3" json:"channel,omitempty"` - TxId string `protobuf:"bytes,2,opt,name=tx_id,json=txId,proto3" json:"tx_id,omitempty"` - // Status code, which may be used to programatically respond to success/failure. - Status common.Status `protobuf:"varint,3,opt,name=status,proto3,enum=common.Status" json:"status,omitempty"` - // Info string which may contain additional information about the returned status. - Info string `protobuf:"bytes,4,opt,name=info,proto3" json:"info,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *TransactionOrderResponse) Reset() { *m = TransactionOrderResponse{} } -func (m *TransactionOrderResponse) String() string { return proto.CompactTextString(m) } -func (*TransactionOrderResponse) ProtoMessage() {} -func (*TransactionOrderResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_ce2573c2284b220f, []int{4} -} - -func (m *TransactionOrderResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_TransactionOrderResponse.Unmarshal(m, b) -} -func (m *TransactionOrderResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_TransactionOrderResponse.Marshal(b, m, deterministic) -} -func (m *TransactionOrderResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_TransactionOrderResponse.Merge(m, src) -} -func (m *TransactionOrderResponse) XXX_Size() int { - return xxx_messageInfo_TransactionOrderResponse.Size(m) -} -func (m *TransactionOrderResponse) XXX_DiscardUnknown() { - xxx_messageInfo_TransactionOrderResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_TransactionOrderResponse proto.InternalMessageInfo - -func (m *TransactionOrderResponse) GetChannel() string { - if m != nil { - return m.Channel - } - return "" -} - -func (m *TransactionOrderResponse) GetTxId() string { - if m != nil { - return m.TxId - } - return "" -} - -func (m *TransactionOrderResponse) GetStatus() common.Status { - if m != nil { - return m.Status - } - return common.Status_UNKNOWN -} - -func (m *TransactionOrderResponse) GetInfo() string { - if m != nil { - return m.Info - } - return "" -} - -// NodeAuthRequest for authenticate the stream -// between the cluster members -type NodeAuthRequest struct { - // version represents the fields on which the signature is computed - Version uint32 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` - // signature is verifiable using the initiator's public key - Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` - // timestamp indicates the freshness of the request; expected to be within the margin - // of the responsder's local time - Timestamp *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - // from_id is the numerical identifier of the initiator of the connection - FromId uint64 `protobuf:"varint,4,opt,name=from_id,json=fromId,proto3" json:"from_id,omitempty"` - // to_id is the numerical identifier of the node that is being connected to - ToId uint64 `protobuf:"varint,5,opt,name=to_id,json=toId,proto3" json:"to_id,omitempty"` - // session_binding is verifiable using application level protocol - SessionBinding []byte `protobuf:"bytes,6,opt,name=session_binding,json=sessionBinding,proto3" json:"session_binding,omitempty"` - Channel string `protobuf:"bytes,7,opt,name=channel,proto3" json:"channel,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *NodeAuthRequest) Reset() { *m = NodeAuthRequest{} } -func (m *NodeAuthRequest) String() string { return proto.CompactTextString(m) } -func (*NodeAuthRequest) ProtoMessage() {} -func (*NodeAuthRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_ce2573c2284b220f, []int{5} -} - -func (m *NodeAuthRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_NodeAuthRequest.Unmarshal(m, b) -} -func (m *NodeAuthRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_NodeAuthRequest.Marshal(b, m, deterministic) -} -func (m *NodeAuthRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_NodeAuthRequest.Merge(m, src) -} -func (m *NodeAuthRequest) XXX_Size() int { - return xxx_messageInfo_NodeAuthRequest.Size(m) -} -func (m *NodeAuthRequest) XXX_DiscardUnknown() { - xxx_messageInfo_NodeAuthRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_NodeAuthRequest proto.InternalMessageInfo - -func (m *NodeAuthRequest) GetVersion() uint32 { - if m != nil { - return m.Version - } - return 0 -} - -func (m *NodeAuthRequest) GetSignature() []byte { - if m != nil { - return m.Signature - } - return nil -} - -func (m *NodeAuthRequest) GetTimestamp() *timestamppb.Timestamp { - if m != nil { - return m.Timestamp - } - return nil -} - -func (m *NodeAuthRequest) GetFromId() uint64 { - if m != nil { - return m.FromId - } - return 0 -} - -func (m *NodeAuthRequest) GetToId() uint64 { - if m != nil { - return m.ToId - } - return 0 -} - -func (m *NodeAuthRequest) GetSessionBinding() []byte { - if m != nil { - return m.SessionBinding - } - return nil -} - -func (m *NodeAuthRequest) GetChannel() string { - if m != nil { - return m.Channel - } - return "" -} - -func init() { - proto.RegisterType((*ClusterNodeServiceStepRequest)(nil), "orderer.ClusterNodeServiceStepRequest") - proto.RegisterType((*ClusterNodeServiceStepResponse)(nil), "orderer.ClusterNodeServiceStepResponse") - proto.RegisterType((*NodeConsensusRequest)(nil), "orderer.NodeConsensusRequest") - proto.RegisterType((*NodeTransactionOrderRequest)(nil), "orderer.NodeTransactionOrderRequest") - proto.RegisterType((*TransactionOrderResponse)(nil), "orderer.TransactionOrderResponse") - proto.RegisterType((*NodeAuthRequest)(nil), "orderer.NodeAuthRequest") -} - -func init() { proto.RegisterFile("orderer/clusterserver.proto", fileDescriptor_ce2573c2284b220f) } - -var fileDescriptor_ce2573c2284b220f = []byte{ - // 619 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x53, 0x5d, 0x6f, 0xd3, 0x3c, - 0x14, 0x5e, 0xf7, 0x66, 0xed, 0x5b, 0xb3, 0x75, 0xc3, 0x43, 0xa2, 0xea, 0x18, 0x1f, 0x15, 0x6c, - 0x13, 0xd2, 0x12, 0x34, 0x6e, 0xb8, 0xdd, 0xa6, 0x49, 0x9d, 0x84, 0x40, 0xb8, 0x13, 0x42, 0x70, - 0x51, 0xb9, 0xc9, 0x69, 0x6a, 0x29, 0xb1, 0x53, 0xdb, 0xa9, 0xb6, 0x1f, 0xc0, 0x2d, 0xbf, 0x96, - 0x1f, 0x80, 0xfc, 0x91, 0x64, 0x1f, 0x6c, 0x5c, 0x25, 0xe7, 0x39, 0xe7, 0x3c, 0xcf, 0xf1, 0xe3, - 0x63, 0xb4, 0x23, 0x64, 0x02, 0x12, 0x64, 0x14, 0x67, 0xa5, 0xd2, 0x20, 0x15, 0xc8, 0x25, 0xc8, - 0xb0, 0x90, 0x42, 0x0b, 0xdc, 0xf1, 0xc9, 0xc1, 0x76, 0x2c, 0xf2, 0x5c, 0xf0, 0xc8, 0x7d, 0x5c, - 0x76, 0xf0, 0x22, 0x15, 0x22, 0xcd, 0x20, 0xb2, 0xd1, 0xb4, 0x9c, 0x45, 0x9a, 0xe5, 0xa0, 0x34, - 0xcd, 0x0b, 0x57, 0x30, 0xfc, 0xb5, 0x8a, 0x76, 0x4f, 0x1d, 0xed, 0x27, 0x91, 0xc0, 0x18, 0xe4, - 0x92, 0xc5, 0x30, 0xd6, 0x50, 0x10, 0x58, 0x94, 0xa0, 0x34, 0x1e, 0xa1, 0x4d, 0x2e, 0x12, 0x98, - 0xc4, 0x82, 0x4b, 0x07, 0xf5, 0x5b, 0x2f, 0x5b, 0x07, 0x8f, 0x8e, 0x76, 0x43, 0x2f, 0x1d, 0x9a, - 0xce, 0x53, 0xc1, 0x15, 0x70, 0x55, 0x2a, 0xdf, 0x37, 0x5a, 0x21, 0x3d, 0xee, 0x70, 0xdf, 0x86, - 0xbf, 0xa0, 0x2d, 0xcb, 0xa4, 0x25, 0xad, 0xa9, 0x56, 0x2d, 0xd5, 0xeb, 0x1b, 0x54, 0x17, 0x92, - 0x72, 0x45, 0x63, 0xcd, 0x04, 0xff, 0x6c, 0xe0, 0x86, 0xd1, 0x4e, 0x72, 0xd1, 0xb4, 0xe3, 0x33, - 0x4f, 0x49, 0x4b, 0x3d, 0xaf, 0x28, 0xff, 0xb3, 0x94, 0xfd, 0x1b, 0x94, 0xc7, 0xa5, 0x9e, 0xdf, - 0xa2, 0x39, 0x6e, 0x5a, 0x4e, 0xba, 0xa8, 0x53, 0xd0, 0xab, 0x4c, 0xd0, 0x64, 0x58, 0xa2, 0xe7, - 0xf7, 0xf9, 0xa1, 0x0a, 0x73, 0x46, 0x3c, 0x42, 0x1b, 0xe6, 0x04, 0x96, 0x7e, 0x22, 0x41, 0x79, - 0x3b, 0x5e, 0xd5, 0x82, 0x77, 0xe7, 0x77, 0x9d, 0xa3, 0x15, 0xb2, 0x5e, 0x77, 0x12, 0x50, 0xd7, - 0x65, 0x3f, 0xa2, 0x27, 0x7f, 0x73, 0x11, 0xf7, 0xeb, 0x12, 0x2b, 0xb3, 0x4e, 0xaa, 0x10, 0x0f, - 0xd0, 0xff, 0x39, 0x68, 0x9a, 0x50, 0x4d, 0xad, 0x8b, 0xeb, 0xa4, 0x8e, 0x87, 0x57, 0x68, 0xe7, - 0x01, 0x23, 0x71, 0x88, 0xb6, 0x33, 0xaa, 0xf4, 0x64, 0x49, 0x33, 0x96, 0x50, 0x93, 0x9e, 0x28, - 0x58, 0x58, 0x81, 0x80, 0x3c, 0x36, 0xa9, 0xaf, 0x75, 0x66, 0x0c, 0x0b, 0xfc, 0xb6, 0x19, 0xc2, - 0xdd, 0xd7, 0x56, 0xe8, 0xb7, 0xec, 0x8c, 0x2f, 0x21, 0x13, 0x05, 0xd4, 0x63, 0x0d, 0x7f, 0xb6, - 0x50, 0xff, 0x3e, 0x03, 0xcc, 0x69, 0xe2, 0x39, 0xe5, 0x1c, 0x32, 0x2b, 0xd6, 0x25, 0x55, 0x88, - 0xb7, 0xd1, 0x9a, 0xbe, 0x9c, 0x30, 0x27, 0xd0, 0x25, 0x81, 0xbe, 0x3c, 0x4f, 0xf0, 0x1e, 0x6a, - 0x2b, 0x4d, 0x75, 0xa9, 0xec, 0x9d, 0xf6, 0x8e, 0x7a, 0x95, 0xec, 0xd8, 0xa2, 0xc4, 0x67, 0x31, - 0x46, 0x01, 0xe3, 0x33, 0xd1, 0x0f, 0x5c, 0xaf, 0xf9, 0x1f, 0xfe, 0x6e, 0xa1, 0xcd, 0x5b, 0x37, - 0x6f, 0xe4, 0x97, 0x20, 0x15, 0x13, 0xdc, 0xca, 0x6f, 0x90, 0x2a, 0xc4, 0xcf, 0x50, 0x57, 0xb1, - 0x94, 0x53, 0x5d, 0x4a, 0xf0, 0x6e, 0x36, 0x00, 0xfe, 0x80, 0xba, 0xf5, 0xbb, 0xf1, 0xeb, 0x35, - 0x08, 0xdd, 0xcb, 0x0a, 0xab, 0x97, 0x15, 0x5e, 0x54, 0x15, 0xa4, 0x29, 0xc6, 0x4f, 0x51, 0x67, - 0x26, 0x45, 0x6e, 0x0e, 0x16, 0x58, 0x77, 0xdb, 0x26, 0x3c, 0x4f, 0xec, 0x79, 0x85, 0x81, 0xd7, - 0x2c, 0x1c, 0x68, 0x71, 0x9e, 0xe0, 0x7d, 0xb4, 0xa9, 0x40, 0x99, 0x81, 0x26, 0x53, 0xc6, 0x13, - 0xc6, 0xd3, 0x7e, 0xdb, 0xce, 0xd2, 0xf3, 0xf0, 0x89, 0x43, 0xaf, 0xfb, 0xd8, 0xb9, 0xe1, 0xe3, - 0xd1, 0x02, 0xe1, 0xbb, 0xeb, 0x8b, 0x7f, 0xa0, 0xc0, 0xac, 0x30, 0xde, 0xab, 0x77, 0xf4, 0xc1, - 0x37, 0x3f, 0xd8, 0xff, 0x67, 0x9d, 0xbb, 0xd0, 0x83, 0xd6, 0xbb, 0xd6, 0xc9, 0x37, 0xf4, 0x46, - 0xc8, 0x34, 0x9c, 0x5f, 0x15, 0x20, 0x33, 0x48, 0x52, 0x90, 0xe1, 0x8c, 0x4e, 0x25, 0x8b, 0x9d, - 0x37, 0xaa, 0xe2, 0xfa, 0x1e, 0xa5, 0x4c, 0xcf, 0xcb, 0xa9, 0xb9, 0xc4, 0xe8, 0x5a, 0x75, 0xe4, - 0xaa, 0x0f, 0x5d, 0xf5, 0x61, 0x2a, 0x22, 0xdf, 0x30, 0x6d, 0x5b, 0xe8, 0xfd, 0x9f, 0x00, 0x00, - 0x00, 0xff, 0xff, 0xd4, 0x82, 0x41, 0x47, 0x01, 0x05, 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// ClusterNodeServiceClient is the client API for ClusterNodeService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type ClusterNodeServiceClient interface { - // Step passes an implementation-specific message to another cluster member. - Step(ctx context.Context, opts ...grpc.CallOption) (ClusterNodeService_StepClient, error) -} - -type clusterNodeServiceClient struct { - cc *grpc.ClientConn -} - -func NewClusterNodeServiceClient(cc *grpc.ClientConn) ClusterNodeServiceClient { - return &clusterNodeServiceClient{cc} -} - -func (c *clusterNodeServiceClient) Step(ctx context.Context, opts ...grpc.CallOption) (ClusterNodeService_StepClient, error) { - stream, err := c.cc.NewStream(ctx, &_ClusterNodeService_serviceDesc.Streams[0], "/orderer.ClusterNodeService/Step", opts...) - if err != nil { - return nil, err - } - x := &clusterNodeServiceStepClient{stream} - return x, nil -} - -type ClusterNodeService_StepClient interface { - Send(*ClusterNodeServiceStepRequest) error - Recv() (*ClusterNodeServiceStepResponse, error) - grpc.ClientStream -} - -type clusterNodeServiceStepClient struct { - grpc.ClientStream -} - -func (x *clusterNodeServiceStepClient) Send(m *ClusterNodeServiceStepRequest) error { - return x.ClientStream.SendMsg(m) -} - -func (x *clusterNodeServiceStepClient) Recv() (*ClusterNodeServiceStepResponse, error) { - m := new(ClusterNodeServiceStepResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -// ClusterNodeServiceServer is the server API for ClusterNodeService service. -type ClusterNodeServiceServer interface { - // Step passes an implementation-specific message to another cluster member. - Step(ClusterNodeService_StepServer) error -} - -// UnimplementedClusterNodeServiceServer can be embedded to have forward compatible implementations. -type UnimplementedClusterNodeServiceServer struct { -} - -func (*UnimplementedClusterNodeServiceServer) Step(srv ClusterNodeService_StepServer) error { - return status.Errorf(codes.Unimplemented, "method Step not implemented") -} - -func RegisterClusterNodeServiceServer(s *grpc.Server, srv ClusterNodeServiceServer) { - s.RegisterService(&_ClusterNodeService_serviceDesc, srv) -} - -func _ClusterNodeService_Step_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(ClusterNodeServiceServer).Step(&clusterNodeServiceStepServer{stream}) -} - -type ClusterNodeService_StepServer interface { - Send(*ClusterNodeServiceStepResponse) error - Recv() (*ClusterNodeServiceStepRequest, error) - grpc.ServerStream -} - -type clusterNodeServiceStepServer struct { - grpc.ServerStream -} - -func (x *clusterNodeServiceStepServer) Send(m *ClusterNodeServiceStepResponse) error { - return x.ServerStream.SendMsg(m) -} - -func (x *clusterNodeServiceStepServer) Recv() (*ClusterNodeServiceStepRequest, error) { - m := new(ClusterNodeServiceStepRequest) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -var _ClusterNodeService_serviceDesc = grpc.ServiceDesc{ - ServiceName: "orderer.ClusterNodeService", - HandlerType: (*ClusterNodeServiceServer)(nil), - Methods: []grpc.MethodDesc{}, - Streams: []grpc.StreamDesc{ - { - StreamName: "Step", - Handler: _ClusterNodeService_Step_Handler, - ServerStreams: true, - ClientStreams: true, - }, - }, - Metadata: "orderer/clusterserver.proto", -} diff --git a/vendor/github.com/hyperledger/fabric-protos-go/orderer/configuration.pb.go b/vendor/github.com/hyperledger/fabric-protos-go/orderer/configuration.pb.go deleted file mode 100644 index 7671f4fea0f..00000000000 --- a/vendor/github.com/hyperledger/fabric-protos-go/orderer/configuration.pb.go +++ /dev/null @@ -1,335 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: orderer/configuration.proto - -package orderer - -import ( - fmt "fmt" - proto "github.com/golang/protobuf/proto" - math "math" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package - -// State defines the orderer mode of operation, typically for consensus-type migration. -// NORMAL is during normal operation, when consensus-type migration is not, and can not, take place. -// MAINTENANCE is when the consensus-type can be changed. -type ConsensusType_State int32 - -const ( - ConsensusType_STATE_NORMAL ConsensusType_State = 0 - ConsensusType_STATE_MAINTENANCE ConsensusType_State = 1 -) - -var ConsensusType_State_name = map[int32]string{ - 0: "STATE_NORMAL", - 1: "STATE_MAINTENANCE", -} - -var ConsensusType_State_value = map[string]int32{ - "STATE_NORMAL": 0, - "STATE_MAINTENANCE": 1, -} - -func (x ConsensusType_State) String() string { - return proto.EnumName(ConsensusType_State_name, int32(x)) -} - -func (ConsensusType_State) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_bcce68f21316dd30, []int{0, 0} -} - -type ConsensusType struct { - // The consensus type: "solo" or "etcdraft". - Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` - // Opaque metadata, dependent on the consensus type. - Metadata []byte `protobuf:"bytes,2,opt,name=metadata,proto3" json:"metadata,omitempty"` - // The state signals the ordering service to go into maintenance mode, typically for consensus-type migration. - State ConsensusType_State `protobuf:"varint,3,opt,name=state,proto3,enum=orderer.ConsensusType_State" json:"state,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ConsensusType) Reset() { *m = ConsensusType{} } -func (m *ConsensusType) String() string { return proto.CompactTextString(m) } -func (*ConsensusType) ProtoMessage() {} -func (*ConsensusType) Descriptor() ([]byte, []int) { - return fileDescriptor_bcce68f21316dd30, []int{0} -} - -func (m *ConsensusType) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ConsensusType.Unmarshal(m, b) -} -func (m *ConsensusType) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ConsensusType.Marshal(b, m, deterministic) -} -func (m *ConsensusType) XXX_Merge(src proto.Message) { - xxx_messageInfo_ConsensusType.Merge(m, src) -} -func (m *ConsensusType) XXX_Size() int { - return xxx_messageInfo_ConsensusType.Size(m) -} -func (m *ConsensusType) XXX_DiscardUnknown() { - xxx_messageInfo_ConsensusType.DiscardUnknown(m) -} - -var xxx_messageInfo_ConsensusType proto.InternalMessageInfo - -func (m *ConsensusType) GetType() string { - if m != nil { - return m.Type - } - return "" -} - -func (m *ConsensusType) GetMetadata() []byte { - if m != nil { - return m.Metadata - } - return nil -} - -func (m *ConsensusType) GetState() ConsensusType_State { - if m != nil { - return m.State - } - return ConsensusType_STATE_NORMAL -} - -type BatchSize struct { - // Simply specified as number of messages for now, in the future - // we may want to allow this to be specified by size in bytes - MaxMessageCount uint32 `protobuf:"varint,1,opt,name=max_message_count,json=maxMessageCount,proto3" json:"max_message_count,omitempty"` - // The byte count of the serialized messages in a batch cannot - // exceed this value. - AbsoluteMaxBytes uint32 `protobuf:"varint,2,opt,name=absolute_max_bytes,json=absoluteMaxBytes,proto3" json:"absolute_max_bytes,omitempty"` - // The byte count of the serialized messages in a batch should not - // exceed this value. - PreferredMaxBytes uint32 `protobuf:"varint,3,opt,name=preferred_max_bytes,json=preferredMaxBytes,proto3" json:"preferred_max_bytes,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *BatchSize) Reset() { *m = BatchSize{} } -func (m *BatchSize) String() string { return proto.CompactTextString(m) } -func (*BatchSize) ProtoMessage() {} -func (*BatchSize) Descriptor() ([]byte, []int) { - return fileDescriptor_bcce68f21316dd30, []int{1} -} - -func (m *BatchSize) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_BatchSize.Unmarshal(m, b) -} -func (m *BatchSize) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_BatchSize.Marshal(b, m, deterministic) -} -func (m *BatchSize) XXX_Merge(src proto.Message) { - xxx_messageInfo_BatchSize.Merge(m, src) -} -func (m *BatchSize) XXX_Size() int { - return xxx_messageInfo_BatchSize.Size(m) -} -func (m *BatchSize) XXX_DiscardUnknown() { - xxx_messageInfo_BatchSize.DiscardUnknown(m) -} - -var xxx_messageInfo_BatchSize proto.InternalMessageInfo - -func (m *BatchSize) GetMaxMessageCount() uint32 { - if m != nil { - return m.MaxMessageCount - } - return 0 -} - -func (m *BatchSize) GetAbsoluteMaxBytes() uint32 { - if m != nil { - return m.AbsoluteMaxBytes - } - return 0 -} - -func (m *BatchSize) GetPreferredMaxBytes() uint32 { - if m != nil { - return m.PreferredMaxBytes - } - return 0 -} - -type BatchTimeout struct { - // Any duration string parseable by ParseDuration(): - // https://golang.org/pkg/time/#ParseDuration - Timeout string `protobuf:"bytes,1,opt,name=timeout,proto3" json:"timeout,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *BatchTimeout) Reset() { *m = BatchTimeout{} } -func (m *BatchTimeout) String() string { return proto.CompactTextString(m) } -func (*BatchTimeout) ProtoMessage() {} -func (*BatchTimeout) Descriptor() ([]byte, []int) { - return fileDescriptor_bcce68f21316dd30, []int{2} -} - -func (m *BatchTimeout) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_BatchTimeout.Unmarshal(m, b) -} -func (m *BatchTimeout) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_BatchTimeout.Marshal(b, m, deterministic) -} -func (m *BatchTimeout) XXX_Merge(src proto.Message) { - xxx_messageInfo_BatchTimeout.Merge(m, src) -} -func (m *BatchTimeout) XXX_Size() int { - return xxx_messageInfo_BatchTimeout.Size(m) -} -func (m *BatchTimeout) XXX_DiscardUnknown() { - xxx_messageInfo_BatchTimeout.DiscardUnknown(m) -} - -var xxx_messageInfo_BatchTimeout proto.InternalMessageInfo - -func (m *BatchTimeout) GetTimeout() string { - if m != nil { - return m.Timeout - } - return "" -} - -// Carries a list of bootstrap brokers, i.e. this is not the exclusive set of -// brokers an ordering service -// -// Deprecated: Do not use. -type KafkaBrokers struct { - // Each broker here should be identified using the (IP|host):port notation, - // e.g. 127.0.0.1:7050, or localhost:7050 are valid entries - Brokers []string `protobuf:"bytes,1,rep,name=brokers,proto3" json:"brokers,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *KafkaBrokers) Reset() { *m = KafkaBrokers{} } -func (m *KafkaBrokers) String() string { return proto.CompactTextString(m) } -func (*KafkaBrokers) ProtoMessage() {} -func (*KafkaBrokers) Descriptor() ([]byte, []int) { - return fileDescriptor_bcce68f21316dd30, []int{3} -} - -func (m *KafkaBrokers) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_KafkaBrokers.Unmarshal(m, b) -} -func (m *KafkaBrokers) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_KafkaBrokers.Marshal(b, m, deterministic) -} -func (m *KafkaBrokers) XXX_Merge(src proto.Message) { - xxx_messageInfo_KafkaBrokers.Merge(m, src) -} -func (m *KafkaBrokers) XXX_Size() int { - return xxx_messageInfo_KafkaBrokers.Size(m) -} -func (m *KafkaBrokers) XXX_DiscardUnknown() { - xxx_messageInfo_KafkaBrokers.DiscardUnknown(m) -} - -var xxx_messageInfo_KafkaBrokers proto.InternalMessageInfo - -func (m *KafkaBrokers) GetBrokers() []string { - if m != nil { - return m.Brokers - } - return nil -} - -// ChannelRestrictions is the mssage which conveys restrictions on channel creation for an orderer -type ChannelRestrictions struct { - MaxCount uint64 `protobuf:"varint,1,opt,name=max_count,json=maxCount,proto3" json:"max_count,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ChannelRestrictions) Reset() { *m = ChannelRestrictions{} } -func (m *ChannelRestrictions) String() string { return proto.CompactTextString(m) } -func (*ChannelRestrictions) ProtoMessage() {} -func (*ChannelRestrictions) Descriptor() ([]byte, []int) { - return fileDescriptor_bcce68f21316dd30, []int{4} -} - -func (m *ChannelRestrictions) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ChannelRestrictions.Unmarshal(m, b) -} -func (m *ChannelRestrictions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ChannelRestrictions.Marshal(b, m, deterministic) -} -func (m *ChannelRestrictions) XXX_Merge(src proto.Message) { - xxx_messageInfo_ChannelRestrictions.Merge(m, src) -} -func (m *ChannelRestrictions) XXX_Size() int { - return xxx_messageInfo_ChannelRestrictions.Size(m) -} -func (m *ChannelRestrictions) XXX_DiscardUnknown() { - xxx_messageInfo_ChannelRestrictions.DiscardUnknown(m) -} - -var xxx_messageInfo_ChannelRestrictions proto.InternalMessageInfo - -func (m *ChannelRestrictions) GetMaxCount() uint64 { - if m != nil { - return m.MaxCount - } - return 0 -} - -func init() { - proto.RegisterEnum("orderer.ConsensusType_State", ConsensusType_State_name, ConsensusType_State_value) - proto.RegisterType((*ConsensusType)(nil), "orderer.ConsensusType") - proto.RegisterType((*BatchSize)(nil), "orderer.BatchSize") - proto.RegisterType((*BatchTimeout)(nil), "orderer.BatchTimeout") - proto.RegisterType((*KafkaBrokers)(nil), "orderer.KafkaBrokers") - proto.RegisterType((*ChannelRestrictions)(nil), "orderer.ChannelRestrictions") -} - -func init() { proto.RegisterFile("orderer/configuration.proto", fileDescriptor_bcce68f21316dd30) } - -var fileDescriptor_bcce68f21316dd30 = []byte{ - // 413 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x91, 0xc1, 0x6a, 0xdb, 0x40, - 0x10, 0x86, 0xbb, 0x71, 0xd2, 0xc4, 0x83, 0xdd, 0xda, 0x1b, 0x0a, 0xa2, 0xe9, 0xc1, 0x08, 0x0a, - 0xa6, 0x24, 0x52, 0x71, 0x6f, 0xbd, 0xd9, 0xc6, 0x87, 0xd2, 0xda, 0x85, 0xb5, 0x0e, 0xa5, 0x17, - 0x33, 0x92, 0xc7, 0xb2, 0x88, 0xa5, 0x15, 0xbb, 0x2b, 0xb0, 0xfb, 0x1e, 0x7d, 0x84, 0xbe, 0x67, - 0xd9, 0x5d, 0x39, 0x4d, 0x6f, 0xf3, 0xff, 0xf3, 0xed, 0x30, 0xb3, 0x3f, 0xdc, 0x49, 0xb5, 0x25, - 0x45, 0x2a, 0xce, 0x64, 0xb5, 0x2b, 0xf2, 0x46, 0xa1, 0x29, 0x64, 0x15, 0xd5, 0x4a, 0x1a, 0xc9, - 0xaf, 0xdb, 0x66, 0xf8, 0x87, 0x41, 0x7f, 0x2e, 0x2b, 0x4d, 0x95, 0x6e, 0x74, 0x72, 0xaa, 0x89, - 0x73, 0xb8, 0x34, 0xa7, 0x9a, 0x02, 0x36, 0x62, 0xe3, 0xae, 0x70, 0x35, 0x7f, 0x0b, 0x37, 0x25, - 0x19, 0xdc, 0xa2, 0xc1, 0xe0, 0x62, 0xc4, 0xc6, 0x3d, 0xf1, 0xa4, 0xf9, 0x04, 0xae, 0xb4, 0x41, - 0x43, 0x41, 0x67, 0xc4, 0xc6, 0xaf, 0x26, 0xef, 0xa2, 0x76, 0x74, 0xf4, 0xdf, 0xd8, 0x68, 0x6d, - 0x19, 0xe1, 0xd1, 0xf0, 0x23, 0x5c, 0x39, 0xcd, 0x07, 0xd0, 0x5b, 0x27, 0xd3, 0x64, 0xb1, 0x59, - 0x7d, 0x17, 0xcb, 0xe9, 0xb7, 0xc1, 0x0b, 0xfe, 0x06, 0x86, 0xde, 0x59, 0x4e, 0xbf, 0xac, 0x92, - 0xc5, 0x6a, 0xba, 0x9a, 0x2f, 0x06, 0x2c, 0xfc, 0xcd, 0xa0, 0x3b, 0x43, 0x93, 0xed, 0xd7, 0xc5, - 0x2f, 0xe2, 0x1f, 0x60, 0x58, 0xe2, 0x71, 0x53, 0x92, 0xd6, 0x98, 0xd3, 0x26, 0x93, 0x4d, 0x65, - 0xdc, 0xc2, 0x7d, 0xf1, 0xba, 0xc4, 0xe3, 0xd2, 0xfb, 0x73, 0x6b, 0xf3, 0x7b, 0xe0, 0x98, 0x6a, - 0x79, 0x68, 0x0c, 0x6d, 0xec, 0xa3, 0xf4, 0x64, 0x48, 0xbb, 0x2b, 0xfa, 0x62, 0x70, 0xee, 0x2c, - 0xf1, 0x38, 0xb3, 0x3e, 0x8f, 0xe0, 0xb6, 0x56, 0xb4, 0x23, 0xa5, 0x68, 0xfb, 0x0c, 0xef, 0x38, - 0x7c, 0xf8, 0xd4, 0x3a, 0xf3, 0xe1, 0x18, 0x7a, 0x6e, 0xad, 0xa4, 0x28, 0x49, 0x36, 0x86, 0x07, - 0x70, 0x6d, 0x7c, 0xd9, 0x7e, 0xe0, 0x59, 0x86, 0xf7, 0xd0, 0xfb, 0x8a, 0xbb, 0x47, 0x9c, 0x29, - 0xf9, 0x48, 0x4a, 0x5b, 0x32, 0xf5, 0x65, 0xc0, 0x46, 0x1d, 0x4b, 0xb6, 0xf2, 0xf3, 0x45, 0xc0, - 0xc2, 0x09, 0xdc, 0xce, 0xf7, 0x58, 0x55, 0x74, 0x10, 0xa4, 0x8d, 0x2a, 0x32, 0x1b, 0x9e, 0xe6, - 0x77, 0xd0, 0xb5, 0x4b, 0xfd, 0x3b, 0xf8, 0x52, 0xdc, 0x94, 0x78, 0x74, 0x97, 0xce, 0x7e, 0xc0, - 0x7b, 0xa9, 0xf2, 0x68, 0x7f, 0xaa, 0x49, 0x1d, 0x68, 0x9b, 0x93, 0x8a, 0x76, 0x98, 0xaa, 0x22, - 0xf3, 0xa1, 0xeb, 0x73, 0x32, 0x3f, 0xe3, 0xbc, 0x30, 0xfb, 0x26, 0x8d, 0x32, 0x59, 0xc6, 0xcf, - 0xe8, 0xd8, 0xd3, 0x0f, 0x9e, 0x7e, 0xc8, 0x65, 0xdc, 0x3e, 0x48, 0x5f, 0x3a, 0xeb, 0xd3, 0xdf, - 0x00, 0x00, 0x00, 0xff, 0xff, 0xc7, 0x40, 0x87, 0xa9, 0x54, 0x02, 0x00, 0x00, -} diff --git a/vendor/github.com/hyperledger/fabric-protos-go/orderer/etcdraft/configuration.pb.go b/vendor/github.com/hyperledger/fabric-protos-go/orderer/etcdraft/configuration.pb.go deleted file mode 100644 index 355c88a734e..00000000000 --- a/vendor/github.com/hyperledger/fabric-protos-go/orderer/etcdraft/configuration.pb.go +++ /dev/null @@ -1,247 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: orderer/etcdraft/configuration.proto - -package etcdraft - -import ( - fmt "fmt" - proto "github.com/golang/protobuf/proto" - math "math" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package - -// ConfigMetadata is serialized and set as the value of ConsensusType.Metadata in -// a channel configuration when the ConsensusType.Type is set "etcdraft". -type ConfigMetadata struct { - Consenters []*Consenter `protobuf:"bytes,1,rep,name=consenters,proto3" json:"consenters,omitempty"` - Options *Options `protobuf:"bytes,2,opt,name=options,proto3" json:"options,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ConfigMetadata) Reset() { *m = ConfigMetadata{} } -func (m *ConfigMetadata) String() string { return proto.CompactTextString(m) } -func (*ConfigMetadata) ProtoMessage() {} -func (*ConfigMetadata) Descriptor() ([]byte, []int) { - return fileDescriptor_6f12d215c949b072, []int{0} -} - -func (m *ConfigMetadata) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ConfigMetadata.Unmarshal(m, b) -} -func (m *ConfigMetadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ConfigMetadata.Marshal(b, m, deterministic) -} -func (m *ConfigMetadata) XXX_Merge(src proto.Message) { - xxx_messageInfo_ConfigMetadata.Merge(m, src) -} -func (m *ConfigMetadata) XXX_Size() int { - return xxx_messageInfo_ConfigMetadata.Size(m) -} -func (m *ConfigMetadata) XXX_DiscardUnknown() { - xxx_messageInfo_ConfigMetadata.DiscardUnknown(m) -} - -var xxx_messageInfo_ConfigMetadata proto.InternalMessageInfo - -func (m *ConfigMetadata) GetConsenters() []*Consenter { - if m != nil { - return m.Consenters - } - return nil -} - -func (m *ConfigMetadata) GetOptions() *Options { - if m != nil { - return m.Options - } - return nil -} - -// Consenter represents a consenting node (i.e. replica). -type Consenter struct { - Host string `protobuf:"bytes,1,opt,name=host,proto3" json:"host,omitempty"` - Port uint32 `protobuf:"varint,2,opt,name=port,proto3" json:"port,omitempty"` - ClientTlsCert []byte `protobuf:"bytes,3,opt,name=client_tls_cert,json=clientTlsCert,proto3" json:"client_tls_cert,omitempty"` - ServerTlsCert []byte `protobuf:"bytes,4,opt,name=server_tls_cert,json=serverTlsCert,proto3" json:"server_tls_cert,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Consenter) Reset() { *m = Consenter{} } -func (m *Consenter) String() string { return proto.CompactTextString(m) } -func (*Consenter) ProtoMessage() {} -func (*Consenter) Descriptor() ([]byte, []int) { - return fileDescriptor_6f12d215c949b072, []int{1} -} - -func (m *Consenter) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Consenter.Unmarshal(m, b) -} -func (m *Consenter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Consenter.Marshal(b, m, deterministic) -} -func (m *Consenter) XXX_Merge(src proto.Message) { - xxx_messageInfo_Consenter.Merge(m, src) -} -func (m *Consenter) XXX_Size() int { - return xxx_messageInfo_Consenter.Size(m) -} -func (m *Consenter) XXX_DiscardUnknown() { - xxx_messageInfo_Consenter.DiscardUnknown(m) -} - -var xxx_messageInfo_Consenter proto.InternalMessageInfo - -func (m *Consenter) GetHost() string { - if m != nil { - return m.Host - } - return "" -} - -func (m *Consenter) GetPort() uint32 { - if m != nil { - return m.Port - } - return 0 -} - -func (m *Consenter) GetClientTlsCert() []byte { - if m != nil { - return m.ClientTlsCert - } - return nil -} - -func (m *Consenter) GetServerTlsCert() []byte { - if m != nil { - return m.ServerTlsCert - } - return nil -} - -// Options to be specified for all the etcd/raft nodes. These can be modified on a -// per-channel basis. -type Options struct { - TickInterval string `protobuf:"bytes,1,opt,name=tick_interval,json=tickInterval,proto3" json:"tick_interval,omitempty"` - ElectionTick uint32 `protobuf:"varint,2,opt,name=election_tick,json=electionTick,proto3" json:"election_tick,omitempty"` - HeartbeatTick uint32 `protobuf:"varint,3,opt,name=heartbeat_tick,json=heartbeatTick,proto3" json:"heartbeat_tick,omitempty"` - MaxInflightBlocks uint32 `protobuf:"varint,4,opt,name=max_inflight_blocks,json=maxInflightBlocks,proto3" json:"max_inflight_blocks,omitempty"` - // Take snapshot when cumulative data exceeds certain size in bytes. - SnapshotIntervalSize uint32 `protobuf:"varint,5,opt,name=snapshot_interval_size,json=snapshotIntervalSize,proto3" json:"snapshot_interval_size,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Options) Reset() { *m = Options{} } -func (m *Options) String() string { return proto.CompactTextString(m) } -func (*Options) ProtoMessage() {} -func (*Options) Descriptor() ([]byte, []int) { - return fileDescriptor_6f12d215c949b072, []int{2} -} - -func (m *Options) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Options.Unmarshal(m, b) -} -func (m *Options) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Options.Marshal(b, m, deterministic) -} -func (m *Options) XXX_Merge(src proto.Message) { - xxx_messageInfo_Options.Merge(m, src) -} -func (m *Options) XXX_Size() int { - return xxx_messageInfo_Options.Size(m) -} -func (m *Options) XXX_DiscardUnknown() { - xxx_messageInfo_Options.DiscardUnknown(m) -} - -var xxx_messageInfo_Options proto.InternalMessageInfo - -func (m *Options) GetTickInterval() string { - if m != nil { - return m.TickInterval - } - return "" -} - -func (m *Options) GetElectionTick() uint32 { - if m != nil { - return m.ElectionTick - } - return 0 -} - -func (m *Options) GetHeartbeatTick() uint32 { - if m != nil { - return m.HeartbeatTick - } - return 0 -} - -func (m *Options) GetMaxInflightBlocks() uint32 { - if m != nil { - return m.MaxInflightBlocks - } - return 0 -} - -func (m *Options) GetSnapshotIntervalSize() uint32 { - if m != nil { - return m.SnapshotIntervalSize - } - return 0 -} - -func init() { - proto.RegisterType((*ConfigMetadata)(nil), "etcdraft.ConfigMetadata") - proto.RegisterType((*Consenter)(nil), "etcdraft.Consenter") - proto.RegisterType((*Options)(nil), "etcdraft.Options") -} - -func init() { - proto.RegisterFile("orderer/etcdraft/configuration.proto", fileDescriptor_6f12d215c949b072) -} - -var fileDescriptor_6f12d215c949b072 = []byte{ - // 392 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x5c, 0x92, 0x4f, 0x6b, 0xdc, 0x30, - 0x10, 0xc5, 0x71, 0x37, 0x6d, 0x1a, 0x65, 0x9d, 0x12, 0xa5, 0x14, 0x1f, 0xcd, 0xf6, 0x0f, 0x86, - 0x12, 0x19, 0x92, 0x1e, 0x7a, 0xce, 0x9e, 0x72, 0x28, 0x05, 0x37, 0xa7, 0x5e, 0x8c, 0x2c, 0x8f, - 0x6d, 0x75, 0xb5, 0x96, 0x19, 0x4d, 0x42, 0x9a, 0x6b, 0xbf, 0x68, 0x3f, 0x4a, 0xb1, 0x64, 0x3b, - 0x4b, 0x6f, 0xc3, 0x7b, 0xbf, 0x37, 0x7a, 0xa0, 0x61, 0x1f, 0x2c, 0xd6, 0x80, 0x80, 0x39, 0x90, - 0xaa, 0x51, 0x36, 0x94, 0x2b, 0xdb, 0x37, 0xba, 0xbd, 0x47, 0x49, 0xda, 0xf6, 0x62, 0x40, 0x4b, - 0x96, 0xbf, 0x9e, 0xdd, 0x0d, 0xb2, 0xb3, 0xad, 0x07, 0xbe, 0x01, 0xc9, 0x5a, 0x92, 0xe4, 0xd7, - 0x8c, 0x29, 0xdb, 0x3b, 0xe8, 0x09, 0xd0, 0x25, 0x51, 0xba, 0xca, 0x4e, 0xaf, 0x2e, 0xc4, 0x1c, - 0x10, 0xdb, 0xd9, 0x2b, 0x0e, 0x30, 0xfe, 0x99, 0x1d, 0xdb, 0x61, 0x7c, 0xc0, 0x25, 0x2f, 0xd2, - 0x28, 0x3b, 0xbd, 0x3a, 0x7f, 0x4e, 0x7c, 0x0f, 0x46, 0x31, 0x13, 0x9b, 0x3f, 0x11, 0x3b, 0x59, - 0xd6, 0x70, 0xce, 0x8e, 0x3a, 0xeb, 0x28, 0x89, 0xd2, 0x28, 0x3b, 0x29, 0xfc, 0x3c, 0x6a, 0x83, - 0x45, 0xf2, 0xbb, 0xe2, 0xc2, 0xcf, 0xfc, 0x13, 0x7b, 0xa3, 0x8c, 0x86, 0x9e, 0x4a, 0x32, 0xae, - 0x54, 0x80, 0x94, 0xac, 0xd2, 0x28, 0x5b, 0x17, 0x71, 0x90, 0xef, 0x8c, 0xdb, 0x42, 0xe0, 0x1c, - 0xe0, 0x03, 0xe0, 0x33, 0x77, 0x14, 0xb8, 0x20, 0x4f, 0xdc, 0xe6, 0x6f, 0xc4, 0x8e, 0xa7, 0x6a, - 0xfc, 0x3d, 0x8b, 0x49, 0xab, 0x5d, 0xa9, 0xc7, 0x46, 0x0f, 0xd2, 0x4c, 0x65, 0xd6, 0xa3, 0x78, - 0x3b, 0x69, 0x23, 0x04, 0x06, 0xd4, 0x98, 0x28, 0x47, 0x63, 0x6a, 0xb7, 0x9e, 0xc5, 0x3b, 0xad, - 0x76, 0xfc, 0x23, 0x3b, 0xeb, 0x40, 0x22, 0x55, 0x20, 0x29, 0x50, 0x2b, 0x4f, 0xc5, 0x8b, 0xea, - 0x31, 0xc1, 0x2e, 0xf6, 0xf2, 0xb1, 0xd4, 0x7d, 0x63, 0x74, 0xdb, 0x51, 0x59, 0x19, 0xab, 0x76, - 0xce, 0x17, 0x8d, 0x8b, 0xf3, 0xbd, 0x7c, 0xbc, 0x9d, 0x9c, 0x1b, 0x6f, 0xf0, 0x2f, 0xec, 0x9d, - 0xeb, 0xe5, 0xe0, 0x3a, 0x4b, 0x4b, 0xc9, 0xd2, 0xe9, 0x27, 0x48, 0x5e, 0xfa, 0xc8, 0xdb, 0xd9, - 0x9d, 0xdb, 0xfe, 0xd0, 0x4f, 0x70, 0xf3, 0x8b, 0x09, 0x8b, 0xad, 0xe8, 0x7e, 0x0f, 0x80, 0x06, - 0xea, 0x16, 0x50, 0x34, 0xb2, 0x42, 0xad, 0xc2, 0x19, 0x38, 0x31, 0x1d, 0xcb, 0xf2, 0x57, 0x3f, - 0xbf, 0xb6, 0x9a, 0xba, 0xfb, 0x4a, 0x28, 0xbb, 0xcf, 0x0f, 0x62, 0x79, 0x88, 0x5d, 0x86, 0xd8, - 0x65, 0x6b, 0xf3, 0xff, 0xcf, 0xac, 0x7a, 0xe5, 0xbd, 0xeb, 0x7f, 0x01, 0x00, 0x00, 0xff, 0xff, - 0x25, 0x12, 0x78, 0xc2, 0x81, 0x02, 0x00, 0x00, -} diff --git a/vendor/github.com/hyperledger/fabric-protos-go/orderer/etcdraft/metadata.pb.go b/vendor/github.com/hyperledger/fabric-protos-go/orderer/etcdraft/metadata.pb.go deleted file mode 100644 index 9eead96883c..00000000000 --- a/vendor/github.com/hyperledger/fabric-protos-go/orderer/etcdraft/metadata.pb.go +++ /dev/null @@ -1,152 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: orderer/etcdraft/metadata.proto - -package etcdraft - -import ( - fmt "fmt" - proto "github.com/golang/protobuf/proto" - math "math" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package - -// BlockMetadata stores data used by the Raft OSNs when -// coordinating with each other, to be serialized into -// block meta dta field and used after failres and restarts. -type BlockMetadata struct { - // Maintains a mapping between the cluster's OSNs - // and their Raft IDs. - ConsenterIds []uint64 `protobuf:"varint,1,rep,packed,name=consenter_ids,json=consenterIds,proto3" json:"consenter_ids,omitempty"` - // Carries the Raft ID value that will be assigned - // to the next OSN that will join this cluster. - NextConsenterId uint64 `protobuf:"varint,2,opt,name=next_consenter_id,json=nextConsenterId,proto3" json:"next_consenter_id,omitempty"` - // Index of etcd/raft entry for current block. - RaftIndex uint64 `protobuf:"varint,3,opt,name=raft_index,json=raftIndex,proto3" json:"raft_index,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *BlockMetadata) Reset() { *m = BlockMetadata{} } -func (m *BlockMetadata) String() string { return proto.CompactTextString(m) } -func (*BlockMetadata) ProtoMessage() {} -func (*BlockMetadata) Descriptor() ([]byte, []int) { - return fileDescriptor_6d0323e5051228ea, []int{0} -} - -func (m *BlockMetadata) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_BlockMetadata.Unmarshal(m, b) -} -func (m *BlockMetadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_BlockMetadata.Marshal(b, m, deterministic) -} -func (m *BlockMetadata) XXX_Merge(src proto.Message) { - xxx_messageInfo_BlockMetadata.Merge(m, src) -} -func (m *BlockMetadata) XXX_Size() int { - return xxx_messageInfo_BlockMetadata.Size(m) -} -func (m *BlockMetadata) XXX_DiscardUnknown() { - xxx_messageInfo_BlockMetadata.DiscardUnknown(m) -} - -var xxx_messageInfo_BlockMetadata proto.InternalMessageInfo - -func (m *BlockMetadata) GetConsenterIds() []uint64 { - if m != nil { - return m.ConsenterIds - } - return nil -} - -func (m *BlockMetadata) GetNextConsenterId() uint64 { - if m != nil { - return m.NextConsenterId - } - return 0 -} - -func (m *BlockMetadata) GetRaftIndex() uint64 { - if m != nil { - return m.RaftIndex - } - return 0 -} - -// ClusterMetadata encapsulates metadata that is exchanged among cluster nodes -type ClusterMetadata struct { - // Indicates active nodes in cluster that are reacheable by Raft leader - ActiveNodes []uint64 `protobuf:"varint,1,rep,packed,name=active_nodes,json=activeNodes,proto3" json:"active_nodes,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ClusterMetadata) Reset() { *m = ClusterMetadata{} } -func (m *ClusterMetadata) String() string { return proto.CompactTextString(m) } -func (*ClusterMetadata) ProtoMessage() {} -func (*ClusterMetadata) Descriptor() ([]byte, []int) { - return fileDescriptor_6d0323e5051228ea, []int{1} -} - -func (m *ClusterMetadata) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ClusterMetadata.Unmarshal(m, b) -} -func (m *ClusterMetadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ClusterMetadata.Marshal(b, m, deterministic) -} -func (m *ClusterMetadata) XXX_Merge(src proto.Message) { - xxx_messageInfo_ClusterMetadata.Merge(m, src) -} -func (m *ClusterMetadata) XXX_Size() int { - return xxx_messageInfo_ClusterMetadata.Size(m) -} -func (m *ClusterMetadata) XXX_DiscardUnknown() { - xxx_messageInfo_ClusterMetadata.DiscardUnknown(m) -} - -var xxx_messageInfo_ClusterMetadata proto.InternalMessageInfo - -func (m *ClusterMetadata) GetActiveNodes() []uint64 { - if m != nil { - return m.ActiveNodes - } - return nil -} - -func init() { - proto.RegisterType((*BlockMetadata)(nil), "etcdraft.BlockMetadata") - proto.RegisterType((*ClusterMetadata)(nil), "etcdraft.ClusterMetadata") -} - -func init() { proto.RegisterFile("orderer/etcdraft/metadata.proto", fileDescriptor_6d0323e5051228ea) } - -var fileDescriptor_6d0323e5051228ea = []byte{ - // 244 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x5c, 0x90, 0xbf, 0x4f, 0x32, 0x41, - 0x10, 0x86, 0xc3, 0x07, 0xf9, 0xa2, 0x23, 0x84, 0x78, 0xd5, 0x35, 0x46, 0xc4, 0x86, 0x98, 0xb0, - 0x5b, 0x68, 0x61, 0x0d, 0x15, 0x85, 0x16, 0x94, 0x36, 0x97, 0xbd, 0xdd, 0xe1, 0x58, 0x3d, 0x76, - 0xc8, 0xec, 0x60, 0xb0, 0xf2, 0x5f, 0x37, 0xcb, 0x71, 0x48, 0x6c, 0x9f, 0xf7, 0x79, 0x33, 0x3f, - 0xe0, 0x96, 0xd8, 0x21, 0x23, 0x6b, 0x14, 0xeb, 0xd8, 0xac, 0x44, 0x6f, 0x50, 0x8c, 0x33, 0x62, - 0xd4, 0x96, 0x49, 0x28, 0xbb, 0x68, 0x83, 0xf1, 0x37, 0x0c, 0x66, 0x35, 0xd9, 0x8f, 0x97, 0xa3, - 0x90, 0xdd, 0xc3, 0xc0, 0x52, 0x88, 0x18, 0x04, 0xb9, 0xf0, 0x2e, 0xe6, 0x9d, 0x51, 0x77, 0xd2, - 0x5b, 0xf6, 0x4f, 0x70, 0xe1, 0x62, 0xf6, 0x00, 0xd7, 0x01, 0xf7, 0x52, 0x9c, 0x9b, 0xf9, 0xbf, - 0x51, 0x67, 0xd2, 0x5b, 0x0e, 0x53, 0x30, 0xff, 0x95, 0xb3, 0x1b, 0x80, 0x34, 0xa9, 0xf0, 0xc1, - 0xe1, 0x3e, 0xef, 0x1e, 0xa4, 0xcb, 0x44, 0x16, 0x09, 0x8c, 0x9f, 0x60, 0x38, 0xaf, 0x77, 0x51, - 0x90, 0x4f, 0x2b, 0xdc, 0x41, 0xdf, 0x58, 0xf1, 0x9f, 0x58, 0x04, 0x72, 0xd8, 0x6e, 0x70, 0xd5, - 0xb0, 0xd7, 0x84, 0x66, 0xef, 0xa0, 0x88, 0x2b, 0xb5, 0xfe, 0xda, 0x22, 0xd7, 0xe8, 0x2a, 0x64, - 0xb5, 0x32, 0x25, 0x7b, 0xdb, 0x1c, 0x18, 0xd5, 0xf1, 0x03, 0xaa, 0x3d, 0xf4, 0xed, 0xb9, 0xf2, - 0xb2, 0xde, 0x95, 0xca, 0xd2, 0x46, 0x9f, 0xd5, 0x74, 0x53, 0x9b, 0x36, 0xb5, 0x69, 0x45, 0xfa, - 0xef, 0xef, 0xca, 0xff, 0x87, 0xec, 0xf1, 0x27, 0x00, 0x00, 0xff, 0xff, 0xcf, 0xbd, 0xfc, 0x44, - 0x56, 0x01, 0x00, 0x00, -} diff --git a/vendor/github.com/hyperledger/fabric-protos-go/orderer/smartbft/configuration.pb.go b/vendor/github.com/hyperledger/fabric-protos-go/orderer/smartbft/configuration.pb.go deleted file mode 100644 index e34db04081f..00000000000 --- a/vendor/github.com/hyperledger/fabric-protos-go/orderer/smartbft/configuration.pb.go +++ /dev/null @@ -1,278 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: orderer/smartbft/configuration.proto - -package smartbft - -import ( - fmt "fmt" - proto "github.com/golang/protobuf/proto" - math "math" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package - -type Options_Rotation int32 - -const ( - Options_ROTATION_UNSPECIFIED Options_Rotation = 0 - Options_ROTATION_OFF Options_Rotation = 1 - Options_ROTATION_ON Options_Rotation = 2 -) - -var Options_Rotation_name = map[int32]string{ - 0: "ROTATION_UNSPECIFIED", - 1: "ROTATION_OFF", - 2: "ROTATION_ON", -} - -var Options_Rotation_value = map[string]int32{ - "ROTATION_UNSPECIFIED": 0, - "ROTATION_OFF": 1, - "ROTATION_ON": 2, -} - -func (x Options_Rotation) String() string { - return proto.EnumName(Options_Rotation_name, int32(x)) -} - -func (Options_Rotation) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_a8a81ac5a2771ff3, []int{0, 0} -} - -// Options to be specified for all the smartbft nodes. These can be modified on a -// per-channel basis. -type Options struct { - RequestBatchMaxCount uint64 `protobuf:"varint,1,opt,name=request_batch_max_count,json=requestBatchMaxCount,proto3" json:"request_batch_max_count,omitempty"` - RequestBatchMaxBytes uint64 `protobuf:"varint,2,opt,name=request_batch_max_bytes,json=requestBatchMaxBytes,proto3" json:"request_batch_max_bytes,omitempty"` - RequestBatchMaxInterval string `protobuf:"bytes,3,opt,name=request_batch_max_interval,json=requestBatchMaxInterval,proto3" json:"request_batch_max_interval,omitempty"` - IncomingMessageBufferSize uint64 `protobuf:"varint,4,opt,name=incoming_message_buffer_size,json=incomingMessageBufferSize,proto3" json:"incoming_message_buffer_size,omitempty"` - RequestPoolSize uint64 `protobuf:"varint,5,opt,name=request_pool_size,json=requestPoolSize,proto3" json:"request_pool_size,omitempty"` - RequestForwardTimeout string `protobuf:"bytes,6,opt,name=request_forward_timeout,json=requestForwardTimeout,proto3" json:"request_forward_timeout,omitempty"` - RequestComplainTimeout string `protobuf:"bytes,7,opt,name=request_complain_timeout,json=requestComplainTimeout,proto3" json:"request_complain_timeout,omitempty"` - RequestAutoRemoveTimeout string `protobuf:"bytes,8,opt,name=request_auto_remove_timeout,json=requestAutoRemoveTimeout,proto3" json:"request_auto_remove_timeout,omitempty"` - RequestMaxBytes uint64 `protobuf:"varint,9,opt,name=request_max_bytes,json=requestMaxBytes,proto3" json:"request_max_bytes,omitempty"` - ViewChangeResendInterval string `protobuf:"bytes,10,opt,name=view_change_resend_interval,json=viewChangeResendInterval,proto3" json:"view_change_resend_interval,omitempty"` - ViewChangeTimeout string `protobuf:"bytes,11,opt,name=view_change_timeout,json=viewChangeTimeout,proto3" json:"view_change_timeout,omitempty"` - LeaderHeartbeatTimeout string `protobuf:"bytes,12,opt,name=leader_heartbeat_timeout,json=leaderHeartbeatTimeout,proto3" json:"leader_heartbeat_timeout,omitempty"` - LeaderHeartbeatCount uint64 `protobuf:"varint,13,opt,name=leader_heartbeat_count,json=leaderHeartbeatCount,proto3" json:"leader_heartbeat_count,omitempty"` - CollectTimeout string `protobuf:"bytes,14,opt,name=collect_timeout,json=collectTimeout,proto3" json:"collect_timeout,omitempty"` - SyncOnStart bool `protobuf:"varint,15,opt,name=sync_on_start,json=syncOnStart,proto3" json:"sync_on_start,omitempty"` - SpeedUpViewChange bool `protobuf:"varint,16,opt,name=speed_up_view_change,json=speedUpViewChange,proto3" json:"speed_up_view_change,omitempty"` - LeaderRotation Options_Rotation `protobuf:"varint,17,opt,name=leader_rotation,json=leaderRotation,proto3,enum=orderer.smartbft.Options_Rotation" json:"leader_rotation,omitempty"` - DecisionsPerLeader uint64 `protobuf:"varint,18,opt,name=decisions_per_leader,json=decisionsPerLeader,proto3" json:"decisions_per_leader,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Options) Reset() { *m = Options{} } -func (m *Options) String() string { return proto.CompactTextString(m) } -func (*Options) ProtoMessage() {} -func (*Options) Descriptor() ([]byte, []int) { - return fileDescriptor_a8a81ac5a2771ff3, []int{0} -} - -func (m *Options) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Options.Unmarshal(m, b) -} -func (m *Options) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Options.Marshal(b, m, deterministic) -} -func (m *Options) XXX_Merge(src proto.Message) { - xxx_messageInfo_Options.Merge(m, src) -} -func (m *Options) XXX_Size() int { - return xxx_messageInfo_Options.Size(m) -} -func (m *Options) XXX_DiscardUnknown() { - xxx_messageInfo_Options.DiscardUnknown(m) -} - -var xxx_messageInfo_Options proto.InternalMessageInfo - -func (m *Options) GetRequestBatchMaxCount() uint64 { - if m != nil { - return m.RequestBatchMaxCount - } - return 0 -} - -func (m *Options) GetRequestBatchMaxBytes() uint64 { - if m != nil { - return m.RequestBatchMaxBytes - } - return 0 -} - -func (m *Options) GetRequestBatchMaxInterval() string { - if m != nil { - return m.RequestBatchMaxInterval - } - return "" -} - -func (m *Options) GetIncomingMessageBufferSize() uint64 { - if m != nil { - return m.IncomingMessageBufferSize - } - return 0 -} - -func (m *Options) GetRequestPoolSize() uint64 { - if m != nil { - return m.RequestPoolSize - } - return 0 -} - -func (m *Options) GetRequestForwardTimeout() string { - if m != nil { - return m.RequestForwardTimeout - } - return "" -} - -func (m *Options) GetRequestComplainTimeout() string { - if m != nil { - return m.RequestComplainTimeout - } - return "" -} - -func (m *Options) GetRequestAutoRemoveTimeout() string { - if m != nil { - return m.RequestAutoRemoveTimeout - } - return "" -} - -func (m *Options) GetRequestMaxBytes() uint64 { - if m != nil { - return m.RequestMaxBytes - } - return 0 -} - -func (m *Options) GetViewChangeResendInterval() string { - if m != nil { - return m.ViewChangeResendInterval - } - return "" -} - -func (m *Options) GetViewChangeTimeout() string { - if m != nil { - return m.ViewChangeTimeout - } - return "" -} - -func (m *Options) GetLeaderHeartbeatTimeout() string { - if m != nil { - return m.LeaderHeartbeatTimeout - } - return "" -} - -func (m *Options) GetLeaderHeartbeatCount() uint64 { - if m != nil { - return m.LeaderHeartbeatCount - } - return 0 -} - -func (m *Options) GetCollectTimeout() string { - if m != nil { - return m.CollectTimeout - } - return "" -} - -func (m *Options) GetSyncOnStart() bool { - if m != nil { - return m.SyncOnStart - } - return false -} - -func (m *Options) GetSpeedUpViewChange() bool { - if m != nil { - return m.SpeedUpViewChange - } - return false -} - -func (m *Options) GetLeaderRotation() Options_Rotation { - if m != nil { - return m.LeaderRotation - } - return Options_ROTATION_UNSPECIFIED -} - -func (m *Options) GetDecisionsPerLeader() uint64 { - if m != nil { - return m.DecisionsPerLeader - } - return 0 -} - -func init() { - proto.RegisterEnum("orderer.smartbft.Options_Rotation", Options_Rotation_name, Options_Rotation_value) - proto.RegisterType((*Options)(nil), "orderer.smartbft.Options") -} - -func init() { - proto.RegisterFile("orderer/smartbft/configuration.proto", fileDescriptor_a8a81ac5a2771ff3) -} - -var fileDescriptor_a8a81ac5a2771ff3 = []byte{ - // 615 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x94, 0x5d, 0x6f, 0xd3, 0x30, - 0x14, 0x86, 0xe9, 0x18, 0x5b, 0xe7, 0x6d, 0xfd, 0x08, 0x65, 0x0b, 0x8c, 0x8b, 0xaa, 0x42, 0xa2, - 0xe2, 0x22, 0x41, 0xc0, 0x10, 0x12, 0x9a, 0xd0, 0x5a, 0x56, 0xa8, 0x60, 0xeb, 0x94, 0x6d, 0x5c, - 0x70, 0x63, 0x39, 0xc9, 0x69, 0x6a, 0x29, 0x89, 0x83, 0xed, 0xec, 0xeb, 0xef, 0xf0, 0x47, 0x51, - 0xec, 0x38, 0x2d, 0xed, 0x2e, 0xe3, 0xe7, 0x7d, 0x72, 0x7c, 0xe2, 0xe3, 0xa0, 0x57, 0x8c, 0x87, - 0xc0, 0x81, 0xbb, 0x22, 0x21, 0x5c, 0xfa, 0x53, 0xe9, 0x06, 0x2c, 0x9d, 0xd2, 0x28, 0xe7, 0x44, - 0x52, 0x96, 0x3a, 0x19, 0x67, 0x92, 0x59, 0xad, 0x32, 0xe5, 0x98, 0x54, 0xef, 0x6f, 0x1d, 0x6d, - 0x4e, 0xb2, 0x22, 0x22, 0xac, 0x43, 0xb4, 0xcf, 0xe1, 0x4f, 0x0e, 0x42, 0x62, 0x9f, 0xc8, 0x60, - 0x86, 0x13, 0x72, 0x8b, 0x03, 0x96, 0xa7, 0xd2, 0xae, 0x75, 0x6b, 0xfd, 0x75, 0xaf, 0x53, 0xe2, - 0x41, 0x41, 0x4f, 0xc9, 0xed, 0xb0, 0x60, 0x0f, 0x6b, 0xfe, 0x9d, 0x04, 0x61, 0xaf, 0x3d, 0xa8, - 0x0d, 0x0a, 0x66, 0x7d, 0x46, 0x2f, 0x56, 0x35, 0x9a, 0x4a, 0xe0, 0xd7, 0x24, 0xb6, 0x1f, 0x77, - 0x6b, 0xfd, 0x2d, 0x6f, 0x7f, 0xc9, 0x1c, 0x97, 0xd8, 0xfa, 0x82, 0x5e, 0xd2, 0x34, 0x60, 0x09, - 0x4d, 0x23, 0x9c, 0x80, 0x10, 0x24, 0x02, 0xec, 0xe7, 0xd3, 0x29, 0x70, 0x2c, 0xe8, 0x3d, 0xd8, - 0xeb, 0xaa, 0xf0, 0x73, 0x93, 0x39, 0xd5, 0x91, 0x81, 0x4a, 0x5c, 0xd0, 0x7b, 0xb0, 0xde, 0xa0, - 0xb6, 0xa9, 0x9e, 0x31, 0x16, 0x6b, 0xeb, 0x89, 0xb2, 0x9a, 0x25, 0x38, 0x67, 0x2c, 0x56, 0xd9, - 0x8f, 0xf3, 0x06, 0xa7, 0x8c, 0xdf, 0x10, 0x1e, 0x62, 0x49, 0x13, 0x60, 0xb9, 0xb4, 0x37, 0xd4, - 0x36, 0x9f, 0x95, 0x78, 0xa4, 0xe9, 0xa5, 0x86, 0xd6, 0x27, 0x64, 0x1b, 0x2f, 0x60, 0x49, 0x16, - 0x13, 0x9a, 0x56, 0xe2, 0xa6, 0x12, 0xf7, 0x4a, 0x3e, 0x2c, 0xb1, 0x31, 0x8f, 0xd0, 0x81, 0x31, - 0x49, 0x2e, 0x19, 0xe6, 0x90, 0xb0, 0x6b, 0xa8, 0xe4, 0xba, 0x92, 0xcd, 0xcb, 0x8f, 0x73, 0xc9, - 0x3c, 0x15, 0x30, 0xfa, 0x42, 0x73, 0xf3, 0xb3, 0xd8, 0xfa, 0xaf, 0xb9, 0xea, 0x18, 0x8e, 0xd0, - 0xc1, 0x35, 0x85, 0x1b, 0x1c, 0xcc, 0x48, 0x1a, 0x01, 0xe6, 0x20, 0x20, 0x0d, 0xe7, 0xe7, 0x80, - 0x74, 0xa9, 0x22, 0x32, 0x54, 0x09, 0x4f, 0x05, 0xaa, 0x83, 0x70, 0xd0, 0xd3, 0x45, 0xdd, 0xec, - 0x70, 0x5b, 0x69, 0xed, 0xb9, 0xb6, 0xf0, 0x4d, 0x62, 0x20, 0x21, 0x70, 0x3c, 0x83, 0x62, 0x04, - 0x81, 0xc8, 0x4a, 0xda, 0xd1, 0xdf, 0x44, 0xf3, 0xef, 0x06, 0x1b, 0xf3, 0x03, 0xda, 0x5b, 0x31, - 0xf5, 0x70, 0xee, 0xea, 0x29, 0x5b, 0xf2, 0xf4, 0x70, 0xbe, 0x46, 0xcd, 0x80, 0xc5, 0x31, 0x04, - 0xf3, 0x32, 0x0d, 0x55, 0xa6, 0x51, 0x2e, 0x9b, 0xd7, 0xf7, 0xd0, 0xae, 0xb8, 0x4b, 0x03, 0xcc, - 0x52, 0x2c, 0x24, 0xe1, 0xd2, 0x6e, 0x76, 0x6b, 0xfd, 0xba, 0xb7, 0x5d, 0x2c, 0x4e, 0xd2, 0x8b, - 0x62, 0xc9, 0x72, 0x51, 0x47, 0x64, 0x00, 0x21, 0xce, 0x33, 0xbc, 0xd0, 0xb5, 0xdd, 0x52, 0xd1, - 0xb6, 0x62, 0x57, 0xd9, 0xaf, 0xaa, 0x69, 0xeb, 0x07, 0x6a, 0x96, 0x7b, 0xe6, 0x4c, 0xaa, 0x8b, - 0x68, 0xb7, 0xbb, 0xb5, 0x7e, 0xe3, 0x5d, 0xcf, 0x59, 0xbe, 0x89, 0x4e, 0x79, 0x0b, 0x1d, 0xaf, - 0x4c, 0x7a, 0x0d, 0xad, 0x9a, 0x67, 0xeb, 0x2d, 0xea, 0x84, 0x10, 0x50, 0x51, 0xa4, 0x70, 0x06, - 0x1c, 0x6b, 0x6e, 0x5b, 0xaa, 0x7d, 0xab, 0x62, 0xe7, 0xc0, 0x7f, 0x2a, 0xd2, 0xfb, 0x86, 0xea, - 0x95, 0x6d, 0xa3, 0x8e, 0x37, 0xb9, 0x3c, 0xbe, 0x1c, 0x4f, 0xce, 0xf0, 0xd5, 0xd9, 0xc5, 0xf9, - 0xc9, 0x70, 0x3c, 0x1a, 0x9f, 0x7c, 0x6d, 0x3d, 0xb2, 0x5a, 0x68, 0xa7, 0x22, 0x93, 0xd1, 0xa8, - 0x55, 0xb3, 0x9a, 0x68, 0x7b, 0xbe, 0x72, 0xd6, 0x5a, 0x1b, 0x44, 0xc8, 0x61, 0x3c, 0x72, 0x66, - 0x77, 0x19, 0xf0, 0x18, 0xc2, 0x08, 0xb8, 0x33, 0x25, 0x3e, 0xa7, 0x81, 0xfe, 0xaf, 0x88, 0x95, - 0x6e, 0x7e, 0x1f, 0x46, 0x54, 0xce, 0x72, 0xdf, 0x09, 0x58, 0xe2, 0x2e, 0x68, 0xae, 0xd6, 0x5c, - 0xad, 0xb9, 0xcb, 0x3f, 0x2d, 0x7f, 0x43, 0x81, 0xf7, 0xff, 0x02, 0x00, 0x00, 0xff, 0xff, 0x01, - 0x59, 0x5f, 0x15, 0xcf, 0x04, 0x00, 0x00, -} diff --git a/vendor/github.com/hyperledger/fabric-protos-go/peer/chaincode.pb.go b/vendor/github.com/hyperledger/fabric-protos-go/peer/chaincode.pb.go deleted file mode 100644 index 8774385c21a..00000000000 --- a/vendor/github.com/hyperledger/fabric-protos-go/peer/chaincode.pb.go +++ /dev/null @@ -1,599 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: peer/chaincode.proto - -package peer - -import ( - fmt "fmt" - proto "github.com/golang/protobuf/proto" - common "github.com/hyperledger/fabric-protos-go/common" - math "math" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package - -type ChaincodeSpec_Type int32 - -const ( - ChaincodeSpec_UNDEFINED ChaincodeSpec_Type = 0 - ChaincodeSpec_GOLANG ChaincodeSpec_Type = 1 - ChaincodeSpec_NODE ChaincodeSpec_Type = 2 - ChaincodeSpec_CAR ChaincodeSpec_Type = 3 - ChaincodeSpec_JAVA ChaincodeSpec_Type = 4 -) - -var ChaincodeSpec_Type_name = map[int32]string{ - 0: "UNDEFINED", - 1: "GOLANG", - 2: "NODE", - 3: "CAR", - 4: "JAVA", -} - -var ChaincodeSpec_Type_value = map[string]int32{ - "UNDEFINED": 0, - "GOLANG": 1, - "NODE": 2, - "CAR": 3, - "JAVA": 4, -} - -func (x ChaincodeSpec_Type) String() string { - return proto.EnumName(ChaincodeSpec_Type_name, int32(x)) -} - -func (ChaincodeSpec_Type) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_202814c635ff5fee, []int{2, 0} -} - -// ChaincodeID contains the path as specified by the deploy transaction -// that created it as well as the hashCode that is generated by the -// system for the path. From the user level (ie, CLI, REST API and so on) -// deploy transaction is expected to provide the path and other requests -// are expected to provide the hashCode. The other value will be ignored. -// Internally, the structure could contain both values. For instance, the -// hashCode will be set when first generated using the path -type ChaincodeID struct { - // deploy transaction will use the path - Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` - // all other requests will use the name (really a hashcode) generated by - // the deploy transaction - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - // user friendly version name for the chaincode - Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ChaincodeID) Reset() { *m = ChaincodeID{} } -func (m *ChaincodeID) String() string { return proto.CompactTextString(m) } -func (*ChaincodeID) ProtoMessage() {} -func (*ChaincodeID) Descriptor() ([]byte, []int) { - return fileDescriptor_202814c635ff5fee, []int{0} -} - -func (m *ChaincodeID) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ChaincodeID.Unmarshal(m, b) -} -func (m *ChaincodeID) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ChaincodeID.Marshal(b, m, deterministic) -} -func (m *ChaincodeID) XXX_Merge(src proto.Message) { - xxx_messageInfo_ChaincodeID.Merge(m, src) -} -func (m *ChaincodeID) XXX_Size() int { - return xxx_messageInfo_ChaincodeID.Size(m) -} -func (m *ChaincodeID) XXX_DiscardUnknown() { - xxx_messageInfo_ChaincodeID.DiscardUnknown(m) -} - -var xxx_messageInfo_ChaincodeID proto.InternalMessageInfo - -func (m *ChaincodeID) GetPath() string { - if m != nil { - return m.Path - } - return "" -} - -func (m *ChaincodeID) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *ChaincodeID) GetVersion() string { - if m != nil { - return m.Version - } - return "" -} - -// Carries the chaincode function and its arguments. -// UnmarshalJSON in transaction.go converts the string-based REST/JSON input to -// the []byte-based current ChaincodeInput structure. -type ChaincodeInput struct { - Args [][]byte `protobuf:"bytes,1,rep,name=args,proto3" json:"args,omitempty"` - Decorations map[string][]byte `protobuf:"bytes,2,rep,name=decorations,proto3" json:"decorations,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - // is_init is used for the application to signal that an invocation is to be routed - // to the legacy 'Init' function for compatibility with chaincodes which handled - // Init in the old way. New applications should manage their initialized state - // themselves. - IsInit bool `protobuf:"varint,3,opt,name=is_init,json=isInit,proto3" json:"is_init,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ChaincodeInput) Reset() { *m = ChaincodeInput{} } -func (m *ChaincodeInput) String() string { return proto.CompactTextString(m) } -func (*ChaincodeInput) ProtoMessage() {} -func (*ChaincodeInput) Descriptor() ([]byte, []int) { - return fileDescriptor_202814c635ff5fee, []int{1} -} - -func (m *ChaincodeInput) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ChaincodeInput.Unmarshal(m, b) -} -func (m *ChaincodeInput) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ChaincodeInput.Marshal(b, m, deterministic) -} -func (m *ChaincodeInput) XXX_Merge(src proto.Message) { - xxx_messageInfo_ChaincodeInput.Merge(m, src) -} -func (m *ChaincodeInput) XXX_Size() int { - return xxx_messageInfo_ChaincodeInput.Size(m) -} -func (m *ChaincodeInput) XXX_DiscardUnknown() { - xxx_messageInfo_ChaincodeInput.DiscardUnknown(m) -} - -var xxx_messageInfo_ChaincodeInput proto.InternalMessageInfo - -func (m *ChaincodeInput) GetArgs() [][]byte { - if m != nil { - return m.Args - } - return nil -} - -func (m *ChaincodeInput) GetDecorations() map[string][]byte { - if m != nil { - return m.Decorations - } - return nil -} - -func (m *ChaincodeInput) GetIsInit() bool { - if m != nil { - return m.IsInit - } - return false -} - -// Carries the chaincode specification. This is the actual metadata required for -// defining a chaincode. -type ChaincodeSpec struct { - Type ChaincodeSpec_Type `protobuf:"varint,1,opt,name=type,proto3,enum=protos.ChaincodeSpec_Type" json:"type,omitempty"` - ChaincodeId *ChaincodeID `protobuf:"bytes,2,opt,name=chaincode_id,json=chaincodeId,proto3" json:"chaincode_id,omitempty"` - Input *ChaincodeInput `protobuf:"bytes,3,opt,name=input,proto3" json:"input,omitempty"` - Timeout int32 `protobuf:"varint,4,opt,name=timeout,proto3" json:"timeout,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ChaincodeSpec) Reset() { *m = ChaincodeSpec{} } -func (m *ChaincodeSpec) String() string { return proto.CompactTextString(m) } -func (*ChaincodeSpec) ProtoMessage() {} -func (*ChaincodeSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_202814c635ff5fee, []int{2} -} - -func (m *ChaincodeSpec) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ChaincodeSpec.Unmarshal(m, b) -} -func (m *ChaincodeSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ChaincodeSpec.Marshal(b, m, deterministic) -} -func (m *ChaincodeSpec) XXX_Merge(src proto.Message) { - xxx_messageInfo_ChaincodeSpec.Merge(m, src) -} -func (m *ChaincodeSpec) XXX_Size() int { - return xxx_messageInfo_ChaincodeSpec.Size(m) -} -func (m *ChaincodeSpec) XXX_DiscardUnknown() { - xxx_messageInfo_ChaincodeSpec.DiscardUnknown(m) -} - -var xxx_messageInfo_ChaincodeSpec proto.InternalMessageInfo - -func (m *ChaincodeSpec) GetType() ChaincodeSpec_Type { - if m != nil { - return m.Type - } - return ChaincodeSpec_UNDEFINED -} - -func (m *ChaincodeSpec) GetChaincodeId() *ChaincodeID { - if m != nil { - return m.ChaincodeId - } - return nil -} - -func (m *ChaincodeSpec) GetInput() *ChaincodeInput { - if m != nil { - return m.Input - } - return nil -} - -func (m *ChaincodeSpec) GetTimeout() int32 { - if m != nil { - return m.Timeout - } - return 0 -} - -// Specify the deployment of a chaincode. -// TODO: Define `codePackage`. -type ChaincodeDeploymentSpec struct { - ChaincodeSpec *ChaincodeSpec `protobuf:"bytes,1,opt,name=chaincode_spec,json=chaincodeSpec,proto3" json:"chaincode_spec,omitempty"` - CodePackage []byte `protobuf:"bytes,3,opt,name=code_package,json=codePackage,proto3" json:"code_package,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ChaincodeDeploymentSpec) Reset() { *m = ChaincodeDeploymentSpec{} } -func (m *ChaincodeDeploymentSpec) String() string { return proto.CompactTextString(m) } -func (*ChaincodeDeploymentSpec) ProtoMessage() {} -func (*ChaincodeDeploymentSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_202814c635ff5fee, []int{3} -} - -func (m *ChaincodeDeploymentSpec) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ChaincodeDeploymentSpec.Unmarshal(m, b) -} -func (m *ChaincodeDeploymentSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ChaincodeDeploymentSpec.Marshal(b, m, deterministic) -} -func (m *ChaincodeDeploymentSpec) XXX_Merge(src proto.Message) { - xxx_messageInfo_ChaincodeDeploymentSpec.Merge(m, src) -} -func (m *ChaincodeDeploymentSpec) XXX_Size() int { - return xxx_messageInfo_ChaincodeDeploymentSpec.Size(m) -} -func (m *ChaincodeDeploymentSpec) XXX_DiscardUnknown() { - xxx_messageInfo_ChaincodeDeploymentSpec.DiscardUnknown(m) -} - -var xxx_messageInfo_ChaincodeDeploymentSpec proto.InternalMessageInfo - -func (m *ChaincodeDeploymentSpec) GetChaincodeSpec() *ChaincodeSpec { - if m != nil { - return m.ChaincodeSpec - } - return nil -} - -func (m *ChaincodeDeploymentSpec) GetCodePackage() []byte { - if m != nil { - return m.CodePackage - } - return nil -} - -// Carries the chaincode function and its arguments. -type ChaincodeInvocationSpec struct { - ChaincodeSpec *ChaincodeSpec `protobuf:"bytes,1,opt,name=chaincode_spec,json=chaincodeSpec,proto3" json:"chaincode_spec,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ChaincodeInvocationSpec) Reset() { *m = ChaincodeInvocationSpec{} } -func (m *ChaincodeInvocationSpec) String() string { return proto.CompactTextString(m) } -func (*ChaincodeInvocationSpec) ProtoMessage() {} -func (*ChaincodeInvocationSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_202814c635ff5fee, []int{4} -} - -func (m *ChaincodeInvocationSpec) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ChaincodeInvocationSpec.Unmarshal(m, b) -} -func (m *ChaincodeInvocationSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ChaincodeInvocationSpec.Marshal(b, m, deterministic) -} -func (m *ChaincodeInvocationSpec) XXX_Merge(src proto.Message) { - xxx_messageInfo_ChaincodeInvocationSpec.Merge(m, src) -} -func (m *ChaincodeInvocationSpec) XXX_Size() int { - return xxx_messageInfo_ChaincodeInvocationSpec.Size(m) -} -func (m *ChaincodeInvocationSpec) XXX_DiscardUnknown() { - xxx_messageInfo_ChaincodeInvocationSpec.DiscardUnknown(m) -} - -var xxx_messageInfo_ChaincodeInvocationSpec proto.InternalMessageInfo - -func (m *ChaincodeInvocationSpec) GetChaincodeSpec() *ChaincodeSpec { - if m != nil { - return m.ChaincodeSpec - } - return nil -} - -// LifecycleEvent is used as the payload of the chaincode event emitted by LSCC -type LifecycleEvent struct { - ChaincodeName string `protobuf:"bytes,1,opt,name=chaincode_name,json=chaincodeName,proto3" json:"chaincode_name,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *LifecycleEvent) Reset() { *m = LifecycleEvent{} } -func (m *LifecycleEvent) String() string { return proto.CompactTextString(m) } -func (*LifecycleEvent) ProtoMessage() {} -func (*LifecycleEvent) Descriptor() ([]byte, []int) { - return fileDescriptor_202814c635ff5fee, []int{5} -} - -func (m *LifecycleEvent) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_LifecycleEvent.Unmarshal(m, b) -} -func (m *LifecycleEvent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_LifecycleEvent.Marshal(b, m, deterministic) -} -func (m *LifecycleEvent) XXX_Merge(src proto.Message) { - xxx_messageInfo_LifecycleEvent.Merge(m, src) -} -func (m *LifecycleEvent) XXX_Size() int { - return xxx_messageInfo_LifecycleEvent.Size(m) -} -func (m *LifecycleEvent) XXX_DiscardUnknown() { - xxx_messageInfo_LifecycleEvent.DiscardUnknown(m) -} - -var xxx_messageInfo_LifecycleEvent proto.InternalMessageInfo - -func (m *LifecycleEvent) GetChaincodeName() string { - if m != nil { - return m.ChaincodeName - } - return "" -} - -// CDSData is data stored in the LSCC on instantiation of a CC -// for CDSPackage. This needs to be serialized for ChaincodeData -// hence the protobuf format -type CDSData struct { - Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` - Metadatahash []byte `protobuf:"bytes,2,opt,name=metadatahash,proto3" json:"metadatahash,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CDSData) Reset() { *m = CDSData{} } -func (m *CDSData) String() string { return proto.CompactTextString(m) } -func (*CDSData) ProtoMessage() {} -func (*CDSData) Descriptor() ([]byte, []int) { - return fileDescriptor_202814c635ff5fee, []int{6} -} - -func (m *CDSData) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CDSData.Unmarshal(m, b) -} -func (m *CDSData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CDSData.Marshal(b, m, deterministic) -} -func (m *CDSData) XXX_Merge(src proto.Message) { - xxx_messageInfo_CDSData.Merge(m, src) -} -func (m *CDSData) XXX_Size() int { - return xxx_messageInfo_CDSData.Size(m) -} -func (m *CDSData) XXX_DiscardUnknown() { - xxx_messageInfo_CDSData.DiscardUnknown(m) -} - -var xxx_messageInfo_CDSData proto.InternalMessageInfo - -func (m *CDSData) GetHash() []byte { - if m != nil { - return m.Hash - } - return nil -} - -func (m *CDSData) GetMetadatahash() []byte { - if m != nil { - return m.Metadatahash - } - return nil -} - -// ChaincodeData defines the datastructure for chaincodes to be serialized by proto -// Type provides an additional check by directing to use a specific package after instantiation -// Data is Type specific (see CDSPackage and SignedCDSPackage) -type ChaincodeData struct { - // Name of the chaincode - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // Version of the chaincode - Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` - // Escc for the chaincode instance - Escc string `protobuf:"bytes,3,opt,name=escc,proto3" json:"escc,omitempty"` - // Vscc for the chaincode instance - Vscc string `protobuf:"bytes,4,opt,name=vscc,proto3" json:"vscc,omitempty"` - // Policy endorsement policy for the chaincode instance - Policy *common.SignaturePolicyEnvelope `protobuf:"bytes,5,opt,name=policy,proto3" json:"policy,omitempty"` - // Data data specific to the package - Data []byte `protobuf:"bytes,6,opt,name=data,proto3" json:"data,omitempty"` - // Id of the chaincode that's the unique fingerprint for the CC This is not - // currently used anywhere but serves as a good eyecatcher - Id []byte `protobuf:"bytes,7,opt,name=id,proto3" json:"id,omitempty"` - // InstantiationPolicy for the chaincode - InstantiationPolicy *common.SignaturePolicyEnvelope `protobuf:"bytes,8,opt,name=instantiation_policy,json=instantiationPolicy,proto3" json:"instantiation_policy,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ChaincodeData) Reset() { *m = ChaincodeData{} } -func (m *ChaincodeData) String() string { return proto.CompactTextString(m) } -func (*ChaincodeData) ProtoMessage() {} -func (*ChaincodeData) Descriptor() ([]byte, []int) { - return fileDescriptor_202814c635ff5fee, []int{7} -} - -func (m *ChaincodeData) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ChaincodeData.Unmarshal(m, b) -} -func (m *ChaincodeData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ChaincodeData.Marshal(b, m, deterministic) -} -func (m *ChaincodeData) XXX_Merge(src proto.Message) { - xxx_messageInfo_ChaincodeData.Merge(m, src) -} -func (m *ChaincodeData) XXX_Size() int { - return xxx_messageInfo_ChaincodeData.Size(m) -} -func (m *ChaincodeData) XXX_DiscardUnknown() { - xxx_messageInfo_ChaincodeData.DiscardUnknown(m) -} - -var xxx_messageInfo_ChaincodeData proto.InternalMessageInfo - -func (m *ChaincodeData) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *ChaincodeData) GetVersion() string { - if m != nil { - return m.Version - } - return "" -} - -func (m *ChaincodeData) GetEscc() string { - if m != nil { - return m.Escc - } - return "" -} - -func (m *ChaincodeData) GetVscc() string { - if m != nil { - return m.Vscc - } - return "" -} - -func (m *ChaincodeData) GetPolicy() *common.SignaturePolicyEnvelope { - if m != nil { - return m.Policy - } - return nil -} - -func (m *ChaincodeData) GetData() []byte { - if m != nil { - return m.Data - } - return nil -} - -func (m *ChaincodeData) GetId() []byte { - if m != nil { - return m.Id - } - return nil -} - -func (m *ChaincodeData) GetInstantiationPolicy() *common.SignaturePolicyEnvelope { - if m != nil { - return m.InstantiationPolicy - } - return nil -} - -func init() { - proto.RegisterEnum("protos.ChaincodeSpec_Type", ChaincodeSpec_Type_name, ChaincodeSpec_Type_value) - proto.RegisterType((*ChaincodeID)(nil), "protos.ChaincodeID") - proto.RegisterType((*ChaincodeInput)(nil), "protos.ChaincodeInput") - proto.RegisterMapType((map[string][]byte)(nil), "protos.ChaincodeInput.DecorationsEntry") - proto.RegisterType((*ChaincodeSpec)(nil), "protos.ChaincodeSpec") - proto.RegisterType((*ChaincodeDeploymentSpec)(nil), "protos.ChaincodeDeploymentSpec") - proto.RegisterType((*ChaincodeInvocationSpec)(nil), "protos.ChaincodeInvocationSpec") - proto.RegisterType((*LifecycleEvent)(nil), "protos.LifecycleEvent") - proto.RegisterType((*CDSData)(nil), "protos.CDSData") - proto.RegisterType((*ChaincodeData)(nil), "protos.ChaincodeData") -} - -func init() { proto.RegisterFile("peer/chaincode.proto", fileDescriptor_202814c635ff5fee) } - -var fileDescriptor_202814c635ff5fee = []byte{ - // 712 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x54, 0xcb, 0x6e, 0xeb, 0x36, - 0x10, 0xad, 0x64, 0xf9, 0x11, 0xca, 0x31, 0x54, 0x26, 0x69, 0x84, 0x6c, 0xea, 0x0a, 0x28, 0xea, - 0x45, 0x22, 0x03, 0x2e, 0xd0, 0x14, 0x45, 0x11, 0xc0, 0x8d, 0xdc, 0xc0, 0x41, 0xe0, 0x04, 0x4c, - 0xdb, 0x45, 0x37, 0x06, 0x43, 0x8d, 0x65, 0x22, 0x36, 0x25, 0x48, 0xb4, 0x50, 0xfd, 0x48, 0xd7, - 0xfd, 0x9c, 0xfe, 0xd5, 0xbd, 0x20, 0xe9, 0xe7, 0x4d, 0x16, 0x17, 0xb8, 0x2b, 0x8d, 0x0e, 0xcf, - 0x3c, 0xce, 0x90, 0x33, 0xe8, 0x34, 0x03, 0xc8, 0xfb, 0x6c, 0x4e, 0xb9, 0x60, 0x69, 0x0c, 0x61, - 0x96, 0xa7, 0x32, 0xc5, 0x0d, 0xfd, 0x29, 0x2e, 0xce, 0x58, 0xba, 0x5c, 0xa6, 0xa2, 0x9f, 0xa5, - 0x0b, 0xce, 0x38, 0x14, 0xe6, 0x38, 0x78, 0x44, 0xee, 0xed, 0xc6, 0x63, 0x1c, 0x61, 0x8c, 0x9c, - 0x8c, 0xca, 0xb9, 0x6f, 0x75, 0xad, 0xde, 0x11, 0xd1, 0xb6, 0xc2, 0x04, 0x5d, 0x82, 0x6f, 0x1b, - 0x4c, 0xd9, 0xd8, 0x47, 0xcd, 0x12, 0xf2, 0x82, 0xa7, 0xc2, 0xaf, 0x69, 0x78, 0xf3, 0x1b, 0xfc, - 0x6f, 0xa1, 0xce, 0x2e, 0xa2, 0xc8, 0x56, 0x52, 0x05, 0xa0, 0x79, 0x52, 0xf8, 0x56, 0xb7, 0xd6, - 0x6b, 0x13, 0x6d, 0xe3, 0x31, 0x72, 0x63, 0x60, 0x69, 0x4e, 0x25, 0x4f, 0x45, 0xe1, 0xdb, 0xdd, - 0x5a, 0xcf, 0x1d, 0xfc, 0x60, 0x8a, 0x2a, 0xc2, 0xc3, 0x00, 0x61, 0xb4, 0x63, 0x8e, 0x84, 0xcc, - 0x2b, 0xb2, 0xef, 0x8b, 0xcf, 0x51, 0x93, 0x17, 0x53, 0x2e, 0xb8, 0xd4, 0xb5, 0xb4, 0x48, 0x83, - 0x17, 0x63, 0xc1, 0xe5, 0xc5, 0x0d, 0xf2, 0x3e, 0xf5, 0xc4, 0x1e, 0xaa, 0xbd, 0x42, 0xb5, 0xd6, - 0xa7, 0x4c, 0x7c, 0x8a, 0xea, 0x25, 0x5d, 0xac, 0x8c, 0xbe, 0x36, 0x31, 0x3f, 0xbf, 0xd8, 0x3f, - 0x5b, 0xc1, 0x07, 0x0b, 0x1d, 0x6f, 0x2b, 0x79, 0xce, 0x80, 0xe1, 0x10, 0x39, 0xb2, 0xca, 0x40, - 0xbb, 0x77, 0x06, 0x17, 0x6f, 0xca, 0x55, 0xa4, 0xf0, 0x8f, 0x2a, 0x03, 0xa2, 0x79, 0xf8, 0x27, - 0xd4, 0xde, 0xde, 0xc7, 0x94, 0xc7, 0x3a, 0x85, 0x3b, 0x38, 0x79, 0x2b, 0x33, 0x22, 0xee, 0x96, - 0x38, 0x8e, 0xf1, 0x25, 0xaa, 0x73, 0xa5, 0x5c, 0x0b, 0x72, 0x07, 0xdf, 0xbc, 0xdf, 0x17, 0x62, - 0x48, 0xea, 0x32, 0x24, 0x5f, 0x42, 0xba, 0x92, 0xbe, 0xd3, 0xb5, 0x7a, 0x75, 0xb2, 0xf9, 0x0d, - 0x6e, 0x90, 0xa3, 0xaa, 0xc1, 0xc7, 0xe8, 0xe8, 0xcf, 0x49, 0x34, 0xfa, 0x7d, 0x3c, 0x19, 0x45, - 0xde, 0x57, 0x18, 0xa1, 0xc6, 0xdd, 0xe3, 0xc3, 0x70, 0x72, 0xe7, 0x59, 0xb8, 0x85, 0x9c, 0xc9, - 0x63, 0x34, 0xf2, 0x6c, 0xdc, 0x44, 0xb5, 0xdb, 0x21, 0xf1, 0x6a, 0x0a, 0xba, 0x1f, 0xfe, 0x35, - 0xf4, 0x9c, 0xe0, 0x3f, 0x0b, 0x9d, 0x6f, 0x73, 0x46, 0x90, 0x2d, 0xd2, 0x6a, 0x09, 0x42, 0xea, - 0x5e, 0xfc, 0x8a, 0x3a, 0x3b, 0x6d, 0x45, 0x06, 0x4c, 0x77, 0xc5, 0x1d, 0x9c, 0xbd, 0xdb, 0x15, - 0x72, 0xcc, 0x0e, 0x3a, 0xf9, 0x1d, 0x6a, 0x6b, 0xc7, 0x8c, 0xb2, 0x57, 0x9a, 0x80, 0x16, 0xda, - 0x26, 0xae, 0xc2, 0x9e, 0x0c, 0x74, 0xef, 0xb4, 0x6c, 0xaf, 0x76, 0xef, 0xb4, 0x1c, 0xaf, 0x4e, - 0x3a, 0x30, 0x9b, 0x01, 0x93, 0xbc, 0x84, 0x69, 0x4c, 0x25, 0x90, 0x16, 0xfc, 0x03, 0x6c, 0x0a, - 0xa2, 0x0c, 0xb2, 0xbd, 0x0a, 0xc7, 0xa2, 0x4c, 0x99, 0xbe, 0xed, 0x2f, 0xaf, 0xd0, 0xa4, 0x27, - 0x5f, 0xf3, 0x78, 0x9a, 0x80, 0x00, 0xf3, 0x88, 0xa6, 0x74, 0x91, 0x04, 0xd7, 0xa8, 0xf3, 0xc0, - 0x67, 0xc0, 0x2a, 0xb6, 0x80, 0x51, 0x09, 0x42, 0xe2, 0xef, 0xf7, 0x13, 0xe9, 0x59, 0x31, 0xef, - 0x6b, 0x17, 0x71, 0x42, 0x97, 0x10, 0x0c, 0x51, 0xf3, 0x36, 0x7a, 0x8e, 0xa8, 0xa4, 0x6a, 0x24, - 0xe6, 0xb4, 0x30, 0x73, 0xd6, 0x26, 0xda, 0xc6, 0x01, 0x6a, 0x2f, 0x41, 0xd2, 0x98, 0x4a, 0xaa, - 0xcf, 0xcc, 0x7b, 0x3c, 0xc0, 0x82, 0x7f, 0xed, 0xbd, 0x27, 0xb9, 0x89, 0xb4, 0x97, 0xf1, 0xcd, - 0x74, 0xda, 0x07, 0xd3, 0xa9, 0xd8, 0x50, 0x30, 0xb6, 0x1e, 0x5a, 0x6d, 0x2b, 0xac, 0x54, 0x98, - 0x63, 0x30, 0x65, 0xe3, 0x6b, 0xd4, 0xd0, 0x8b, 0xa2, 0xf2, 0xeb, 0xba, 0x65, 0xdf, 0x86, 0x66, - 0x7d, 0x84, 0xcf, 0x3c, 0x11, 0x54, 0xae, 0x72, 0x78, 0xd2, 0xc7, 0x23, 0x51, 0xc2, 0x22, 0xcd, - 0x80, 0xac, 0xe9, 0x2a, 0x98, 0x2a, 0xd6, 0x6f, 0x18, 0x61, 0xca, 0xc6, 0x1d, 0x64, 0xf3, 0xd8, - 0x6f, 0x6a, 0xc4, 0xe6, 0x31, 0x26, 0xe8, 0x94, 0x8b, 0x42, 0x52, 0x21, 0xb9, 0xe9, 0xea, 0x3a, - 0x55, 0xeb, 0xf3, 0x52, 0x9d, 0x1c, 0x38, 0x9b, 0xc3, 0xdf, 0x08, 0x0a, 0xd2, 0x3c, 0x09, 0xe7, - 0x55, 0x06, 0xf9, 0x02, 0xe2, 0x04, 0xf2, 0x70, 0x46, 0x5f, 0x72, 0xce, 0x36, 0x77, 0xad, 0x96, - 0xe3, 0xdf, 0x97, 0x09, 0x97, 0xf3, 0xd5, 0x8b, 0xca, 0xd0, 0xdf, 0xa3, 0xf6, 0x0d, 0xf5, 0xca, - 0x50, 0xaf, 0x92, 0xb4, 0xaf, 0xd8, 0x2f, 0x66, 0x75, 0xfe, 0xf8, 0x31, 0x00, 0x00, 0xff, 0xff, - 0x4e, 0xcb, 0x76, 0xde, 0x59, 0x05, 0x00, 0x00, -} diff --git a/vendor/github.com/hyperledger/fabric-protos-go/peer/chaincode_event.pb.go b/vendor/github.com/hyperledger/fabric-protos-go/peer/chaincode_event.pb.go deleted file mode 100644 index b7d5354e0aa..00000000000 --- a/vendor/github.com/hyperledger/fabric-protos-go/peer/chaincode_event.pb.go +++ /dev/null @@ -1,110 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: peer/chaincode_event.proto - -package peer - -import ( - fmt "fmt" - proto "github.com/golang/protobuf/proto" - math "math" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package - -// ChaincodeEvent is used for events and registrations that are specific to chaincode -// string type - "chaincode" -type ChaincodeEvent struct { - ChaincodeId string `protobuf:"bytes,1,opt,name=chaincode_id,json=chaincodeId,proto3" json:"chaincode_id,omitempty"` - TxId string `protobuf:"bytes,2,opt,name=tx_id,json=txId,proto3" json:"tx_id,omitempty"` - EventName string `protobuf:"bytes,3,opt,name=event_name,json=eventName,proto3" json:"event_name,omitempty"` - Payload []byte `protobuf:"bytes,4,opt,name=payload,proto3" json:"payload,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ChaincodeEvent) Reset() { *m = ChaincodeEvent{} } -func (m *ChaincodeEvent) String() string { return proto.CompactTextString(m) } -func (*ChaincodeEvent) ProtoMessage() {} -func (*ChaincodeEvent) Descriptor() ([]byte, []int) { - return fileDescriptor_e11f3d5e149f14fa, []int{0} -} - -func (m *ChaincodeEvent) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ChaincodeEvent.Unmarshal(m, b) -} -func (m *ChaincodeEvent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ChaincodeEvent.Marshal(b, m, deterministic) -} -func (m *ChaincodeEvent) XXX_Merge(src proto.Message) { - xxx_messageInfo_ChaincodeEvent.Merge(m, src) -} -func (m *ChaincodeEvent) XXX_Size() int { - return xxx_messageInfo_ChaincodeEvent.Size(m) -} -func (m *ChaincodeEvent) XXX_DiscardUnknown() { - xxx_messageInfo_ChaincodeEvent.DiscardUnknown(m) -} - -var xxx_messageInfo_ChaincodeEvent proto.InternalMessageInfo - -func (m *ChaincodeEvent) GetChaincodeId() string { - if m != nil { - return m.ChaincodeId - } - return "" -} - -func (m *ChaincodeEvent) GetTxId() string { - if m != nil { - return m.TxId - } - return "" -} - -func (m *ChaincodeEvent) GetEventName() string { - if m != nil { - return m.EventName - } - return "" -} - -func (m *ChaincodeEvent) GetPayload() []byte { - if m != nil { - return m.Payload - } - return nil -} - -func init() { - proto.RegisterType((*ChaincodeEvent)(nil), "protos.ChaincodeEvent") -} - -func init() { proto.RegisterFile("peer/chaincode_event.proto", fileDescriptor_e11f3d5e149f14fa) } - -var fileDescriptor_e11f3d5e149f14fa = []byte{ - // 221 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x2a, 0x48, 0x4d, 0x2d, - 0xd2, 0x4f, 0xce, 0x48, 0xcc, 0xcc, 0x4b, 0xce, 0x4f, 0x49, 0x8d, 0x4f, 0x2d, 0x4b, 0xcd, 0x2b, - 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x03, 0x53, 0xc5, 0x4a, 0x8d, 0x8c, 0x5c, 0x7c, - 0xce, 0x30, 0x15, 0xae, 0x20, 0x05, 0x42, 0x8a, 0x5c, 0x3c, 0x08, 0x3d, 0x99, 0x29, 0x12, 0x8c, - 0x0a, 0x8c, 0x1a, 0x9c, 0x41, 0xdc, 0x70, 0x31, 0xcf, 0x14, 0x21, 0x61, 0x2e, 0xd6, 0x92, 0x0a, - 0x90, 0x1c, 0x13, 0x58, 0x8e, 0xa5, 0xa4, 0xc2, 0x33, 0x45, 0x48, 0x96, 0x8b, 0x0b, 0x6c, 0x43, - 0x7c, 0x5e, 0x62, 0x6e, 0xaa, 0x04, 0x33, 0x58, 0x86, 0x13, 0x2c, 0xe2, 0x97, 0x98, 0x9b, 0x2a, - 0x24, 0xc1, 0xc5, 0x5e, 0x90, 0x58, 0x99, 0x93, 0x9f, 0x98, 0x22, 0xc1, 0xa2, 0xc0, 0xa8, 0xc1, - 0x13, 0x04, 0xe3, 0x3a, 0x65, 0x72, 0x29, 0xe5, 0x17, 0xa5, 0xeb, 0x65, 0x54, 0x16, 0xa4, 0x16, - 0xe5, 0xa4, 0xa6, 0xa4, 0xa7, 0x16, 0xe9, 0xa5, 0x25, 0x26, 0x15, 0x65, 0x26, 0x43, 0xdc, 0x5a, - 0xac, 0x07, 0xf2, 0x87, 0x93, 0x28, 0xaa, 0x33, 0x03, 0x12, 0x93, 0xb3, 0x13, 0xd3, 0x53, 0xa3, - 0x74, 0xd2, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92, 0xf3, 0x73, 0xf5, 0x91, 0x4c, 0xd0, 0x87, - 0x98, 0xa0, 0x0b, 0x31, 0x41, 0x37, 0x3d, 0x5f, 0x1f, 0x64, 0x48, 0x12, 0xc4, 0xdb, 0xc6, 0x80, - 0x00, 0x00, 0x00, 0xff, 0xff, 0xf1, 0xe0, 0xae, 0xf8, 0x1b, 0x01, 0x00, 0x00, -} diff --git a/vendor/github.com/hyperledger/fabric-protos-go/peer/chaincode_shim.pb.go b/vendor/github.com/hyperledger/fabric-protos-go/peer/chaincode_shim.pb.go deleted file mode 100644 index 5cf84bda7f2..00000000000 --- a/vendor/github.com/hyperledger/fabric-protos-go/peer/chaincode_shim.pb.go +++ /dev/null @@ -1,1363 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: peer/chaincode_shim.proto - -package peer - -import ( - context "context" - fmt "fmt" - proto "github.com/golang/protobuf/proto" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" - math "math" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package - -type ChaincodeMessage_Type int32 - -const ( - ChaincodeMessage_UNDEFINED ChaincodeMessage_Type = 0 - ChaincodeMessage_REGISTER ChaincodeMessage_Type = 1 - ChaincodeMessage_REGISTERED ChaincodeMessage_Type = 2 - ChaincodeMessage_INIT ChaincodeMessage_Type = 3 - ChaincodeMessage_READY ChaincodeMessage_Type = 4 - ChaincodeMessage_TRANSACTION ChaincodeMessage_Type = 5 - ChaincodeMessage_COMPLETED ChaincodeMessage_Type = 6 - ChaincodeMessage_ERROR ChaincodeMessage_Type = 7 - ChaincodeMessage_GET_STATE ChaincodeMessage_Type = 8 - ChaincodeMessage_PUT_STATE ChaincodeMessage_Type = 9 - ChaincodeMessage_DEL_STATE ChaincodeMessage_Type = 10 - ChaincodeMessage_INVOKE_CHAINCODE ChaincodeMessage_Type = 11 - ChaincodeMessage_RESPONSE ChaincodeMessage_Type = 13 - ChaincodeMessage_GET_STATE_BY_RANGE ChaincodeMessage_Type = 14 - ChaincodeMessage_GET_QUERY_RESULT ChaincodeMessage_Type = 15 - ChaincodeMessage_QUERY_STATE_NEXT ChaincodeMessage_Type = 16 - ChaincodeMessage_QUERY_STATE_CLOSE ChaincodeMessage_Type = 17 - ChaincodeMessage_KEEPALIVE ChaincodeMessage_Type = 18 - ChaincodeMessage_GET_HISTORY_FOR_KEY ChaincodeMessage_Type = 19 - ChaincodeMessage_GET_STATE_METADATA ChaincodeMessage_Type = 20 - ChaincodeMessage_PUT_STATE_METADATA ChaincodeMessage_Type = 21 - ChaincodeMessage_GET_PRIVATE_DATA_HASH ChaincodeMessage_Type = 22 - ChaincodeMessage_PURGE_PRIVATE_DATA ChaincodeMessage_Type = 23 -) - -var ChaincodeMessage_Type_name = map[int32]string{ - 0: "UNDEFINED", - 1: "REGISTER", - 2: "REGISTERED", - 3: "INIT", - 4: "READY", - 5: "TRANSACTION", - 6: "COMPLETED", - 7: "ERROR", - 8: "GET_STATE", - 9: "PUT_STATE", - 10: "DEL_STATE", - 11: "INVOKE_CHAINCODE", - 13: "RESPONSE", - 14: "GET_STATE_BY_RANGE", - 15: "GET_QUERY_RESULT", - 16: "QUERY_STATE_NEXT", - 17: "QUERY_STATE_CLOSE", - 18: "KEEPALIVE", - 19: "GET_HISTORY_FOR_KEY", - 20: "GET_STATE_METADATA", - 21: "PUT_STATE_METADATA", - 22: "GET_PRIVATE_DATA_HASH", - 23: "PURGE_PRIVATE_DATA", -} - -var ChaincodeMessage_Type_value = map[string]int32{ - "UNDEFINED": 0, - "REGISTER": 1, - "REGISTERED": 2, - "INIT": 3, - "READY": 4, - "TRANSACTION": 5, - "COMPLETED": 6, - "ERROR": 7, - "GET_STATE": 8, - "PUT_STATE": 9, - "DEL_STATE": 10, - "INVOKE_CHAINCODE": 11, - "RESPONSE": 13, - "GET_STATE_BY_RANGE": 14, - "GET_QUERY_RESULT": 15, - "QUERY_STATE_NEXT": 16, - "QUERY_STATE_CLOSE": 17, - "KEEPALIVE": 18, - "GET_HISTORY_FOR_KEY": 19, - "GET_STATE_METADATA": 20, - "PUT_STATE_METADATA": 21, - "GET_PRIVATE_DATA_HASH": 22, - "PURGE_PRIVATE_DATA": 23, -} - -func (x ChaincodeMessage_Type) String() string { - return proto.EnumName(ChaincodeMessage_Type_name, int32(x)) -} - -func (ChaincodeMessage_Type) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_e5819fec16c96da2, []int{0, 0} -} - -type ChaincodeMessage struct { - Type ChaincodeMessage_Type `protobuf:"varint,1,opt,name=type,proto3,enum=protos.ChaincodeMessage_Type" json:"type,omitempty"` - Timestamp *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - Payload []byte `protobuf:"bytes,3,opt,name=payload,proto3" json:"payload,omitempty"` - Txid string `protobuf:"bytes,4,opt,name=txid,proto3" json:"txid,omitempty"` - Proposal *SignedProposal `protobuf:"bytes,5,opt,name=proposal,proto3" json:"proposal,omitempty"` - // event emitted by chaincode. Used only with Init or Invoke. - // This event is then stored (currently) - // with Block.NonHashData.TransactionResult - ChaincodeEvent *ChaincodeEvent `protobuf:"bytes,6,opt,name=chaincode_event,json=chaincodeEvent,proto3" json:"chaincode_event,omitempty"` - // channel id - ChannelId string `protobuf:"bytes,7,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ChaincodeMessage) Reset() { *m = ChaincodeMessage{} } -func (m *ChaincodeMessage) String() string { return proto.CompactTextString(m) } -func (*ChaincodeMessage) ProtoMessage() {} -func (*ChaincodeMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_e5819fec16c96da2, []int{0} -} - -func (m *ChaincodeMessage) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ChaincodeMessage.Unmarshal(m, b) -} -func (m *ChaincodeMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ChaincodeMessage.Marshal(b, m, deterministic) -} -func (m *ChaincodeMessage) XXX_Merge(src proto.Message) { - xxx_messageInfo_ChaincodeMessage.Merge(m, src) -} -func (m *ChaincodeMessage) XXX_Size() int { - return xxx_messageInfo_ChaincodeMessage.Size(m) -} -func (m *ChaincodeMessage) XXX_DiscardUnknown() { - xxx_messageInfo_ChaincodeMessage.DiscardUnknown(m) -} - -var xxx_messageInfo_ChaincodeMessage proto.InternalMessageInfo - -func (m *ChaincodeMessage) GetType() ChaincodeMessage_Type { - if m != nil { - return m.Type - } - return ChaincodeMessage_UNDEFINED -} - -func (m *ChaincodeMessage) GetTimestamp() *timestamppb.Timestamp { - if m != nil { - return m.Timestamp - } - return nil -} - -func (m *ChaincodeMessage) GetPayload() []byte { - if m != nil { - return m.Payload - } - return nil -} - -func (m *ChaincodeMessage) GetTxid() string { - if m != nil { - return m.Txid - } - return "" -} - -func (m *ChaincodeMessage) GetProposal() *SignedProposal { - if m != nil { - return m.Proposal - } - return nil -} - -func (m *ChaincodeMessage) GetChaincodeEvent() *ChaincodeEvent { - if m != nil { - return m.ChaincodeEvent - } - return nil -} - -func (m *ChaincodeMessage) GetChannelId() string { - if m != nil { - return m.ChannelId - } - return "" -} - -// GetState is the payload of a ChaincodeMessage. It contains a key which -// is to be fetched from the ledger. If the collection is specified, the key -// would be fetched from the collection (i.e., private state) -type GetState struct { - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - Collection string `protobuf:"bytes,2,opt,name=collection,proto3" json:"collection,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetState) Reset() { *m = GetState{} } -func (m *GetState) String() string { return proto.CompactTextString(m) } -func (*GetState) ProtoMessage() {} -func (*GetState) Descriptor() ([]byte, []int) { - return fileDescriptor_e5819fec16c96da2, []int{1} -} - -func (m *GetState) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetState.Unmarshal(m, b) -} -func (m *GetState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetState.Marshal(b, m, deterministic) -} -func (m *GetState) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetState.Merge(m, src) -} -func (m *GetState) XXX_Size() int { - return xxx_messageInfo_GetState.Size(m) -} -func (m *GetState) XXX_DiscardUnknown() { - xxx_messageInfo_GetState.DiscardUnknown(m) -} - -var xxx_messageInfo_GetState proto.InternalMessageInfo - -func (m *GetState) GetKey() string { - if m != nil { - return m.Key - } - return "" -} - -func (m *GetState) GetCollection() string { - if m != nil { - return m.Collection - } - return "" -} - -type GetStateMetadata struct { - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - Collection string `protobuf:"bytes,2,opt,name=collection,proto3" json:"collection,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetStateMetadata) Reset() { *m = GetStateMetadata{} } -func (m *GetStateMetadata) String() string { return proto.CompactTextString(m) } -func (*GetStateMetadata) ProtoMessage() {} -func (*GetStateMetadata) Descriptor() ([]byte, []int) { - return fileDescriptor_e5819fec16c96da2, []int{2} -} - -func (m *GetStateMetadata) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetStateMetadata.Unmarshal(m, b) -} -func (m *GetStateMetadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetStateMetadata.Marshal(b, m, deterministic) -} -func (m *GetStateMetadata) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetStateMetadata.Merge(m, src) -} -func (m *GetStateMetadata) XXX_Size() int { - return xxx_messageInfo_GetStateMetadata.Size(m) -} -func (m *GetStateMetadata) XXX_DiscardUnknown() { - xxx_messageInfo_GetStateMetadata.DiscardUnknown(m) -} - -var xxx_messageInfo_GetStateMetadata proto.InternalMessageInfo - -func (m *GetStateMetadata) GetKey() string { - if m != nil { - return m.Key - } - return "" -} - -func (m *GetStateMetadata) GetCollection() string { - if m != nil { - return m.Collection - } - return "" -} - -// PutState is the payload of a ChaincodeMessage. It contains a key and value -// which needs to be written to the transaction's write set. If the collection is -// specified, the key and value would be written to the transaction's private -// write set. -type PutState struct { - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` - Collection string `protobuf:"bytes,3,opt,name=collection,proto3" json:"collection,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *PutState) Reset() { *m = PutState{} } -func (m *PutState) String() string { return proto.CompactTextString(m) } -func (*PutState) ProtoMessage() {} -func (*PutState) Descriptor() ([]byte, []int) { - return fileDescriptor_e5819fec16c96da2, []int{3} -} - -func (m *PutState) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_PutState.Unmarshal(m, b) -} -func (m *PutState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_PutState.Marshal(b, m, deterministic) -} -func (m *PutState) XXX_Merge(src proto.Message) { - xxx_messageInfo_PutState.Merge(m, src) -} -func (m *PutState) XXX_Size() int { - return xxx_messageInfo_PutState.Size(m) -} -func (m *PutState) XXX_DiscardUnknown() { - xxx_messageInfo_PutState.DiscardUnknown(m) -} - -var xxx_messageInfo_PutState proto.InternalMessageInfo - -func (m *PutState) GetKey() string { - if m != nil { - return m.Key - } - return "" -} - -func (m *PutState) GetValue() []byte { - if m != nil { - return m.Value - } - return nil -} - -func (m *PutState) GetCollection() string { - if m != nil { - return m.Collection - } - return "" -} - -type PutStateMetadata struct { - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - Collection string `protobuf:"bytes,3,opt,name=collection,proto3" json:"collection,omitempty"` - Metadata *StateMetadata `protobuf:"bytes,4,opt,name=metadata,proto3" json:"metadata,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *PutStateMetadata) Reset() { *m = PutStateMetadata{} } -func (m *PutStateMetadata) String() string { return proto.CompactTextString(m) } -func (*PutStateMetadata) ProtoMessage() {} -func (*PutStateMetadata) Descriptor() ([]byte, []int) { - return fileDescriptor_e5819fec16c96da2, []int{4} -} - -func (m *PutStateMetadata) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_PutStateMetadata.Unmarshal(m, b) -} -func (m *PutStateMetadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_PutStateMetadata.Marshal(b, m, deterministic) -} -func (m *PutStateMetadata) XXX_Merge(src proto.Message) { - xxx_messageInfo_PutStateMetadata.Merge(m, src) -} -func (m *PutStateMetadata) XXX_Size() int { - return xxx_messageInfo_PutStateMetadata.Size(m) -} -func (m *PutStateMetadata) XXX_DiscardUnknown() { - xxx_messageInfo_PutStateMetadata.DiscardUnknown(m) -} - -var xxx_messageInfo_PutStateMetadata proto.InternalMessageInfo - -func (m *PutStateMetadata) GetKey() string { - if m != nil { - return m.Key - } - return "" -} - -func (m *PutStateMetadata) GetCollection() string { - if m != nil { - return m.Collection - } - return "" -} - -func (m *PutStateMetadata) GetMetadata() *StateMetadata { - if m != nil { - return m.Metadata - } - return nil -} - -// DelState is the payload of a ChaincodeMessage. It contains a key which -// needs to be recorded in the transaction's write set as a delete operation. -// If the collection is specified, the key needs to be recorded in the -// transaction's private write set as a delete operation. -type DelState struct { - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - Collection string `protobuf:"bytes,2,opt,name=collection,proto3" json:"collection,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DelState) Reset() { *m = DelState{} } -func (m *DelState) String() string { return proto.CompactTextString(m) } -func (*DelState) ProtoMessage() {} -func (*DelState) Descriptor() ([]byte, []int) { - return fileDescriptor_e5819fec16c96da2, []int{5} -} - -func (m *DelState) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DelState.Unmarshal(m, b) -} -func (m *DelState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DelState.Marshal(b, m, deterministic) -} -func (m *DelState) XXX_Merge(src proto.Message) { - xxx_messageInfo_DelState.Merge(m, src) -} -func (m *DelState) XXX_Size() int { - return xxx_messageInfo_DelState.Size(m) -} -func (m *DelState) XXX_DiscardUnknown() { - xxx_messageInfo_DelState.DiscardUnknown(m) -} - -var xxx_messageInfo_DelState proto.InternalMessageInfo - -func (m *DelState) GetKey() string { - if m != nil { - return m.Key - } - return "" -} - -func (m *DelState) GetCollection() string { - if m != nil { - return m.Collection - } - return "" -} - -type PurgePrivateState struct { - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - Collection string `protobuf:"bytes,2,opt,name=collection,proto3" json:"collection,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *PurgePrivateState) Reset() { *m = PurgePrivateState{} } -func (m *PurgePrivateState) String() string { return proto.CompactTextString(m) } -func (*PurgePrivateState) ProtoMessage() {} -func (*PurgePrivateState) Descriptor() ([]byte, []int) { - return fileDescriptor_e5819fec16c96da2, []int{6} -} - -func (m *PurgePrivateState) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_PurgePrivateState.Unmarshal(m, b) -} -func (m *PurgePrivateState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_PurgePrivateState.Marshal(b, m, deterministic) -} -func (m *PurgePrivateState) XXX_Merge(src proto.Message) { - xxx_messageInfo_PurgePrivateState.Merge(m, src) -} -func (m *PurgePrivateState) XXX_Size() int { - return xxx_messageInfo_PurgePrivateState.Size(m) -} -func (m *PurgePrivateState) XXX_DiscardUnknown() { - xxx_messageInfo_PurgePrivateState.DiscardUnknown(m) -} - -var xxx_messageInfo_PurgePrivateState proto.InternalMessageInfo - -func (m *PurgePrivateState) GetKey() string { - if m != nil { - return m.Key - } - return "" -} - -func (m *PurgePrivateState) GetCollection() string { - if m != nil { - return m.Collection - } - return "" -} - -// GetStateByRange is the payload of a ChaincodeMessage. It contains a start key and -// a end key required to execute range query. If the collection is specified, -// the range query needs to be executed on the private data. The metadata hold -// the byte representation of QueryMetadata. -type GetStateByRange struct { - StartKey string `protobuf:"bytes,1,opt,name=startKey,proto3" json:"startKey,omitempty"` - EndKey string `protobuf:"bytes,2,opt,name=endKey,proto3" json:"endKey,omitempty"` - Collection string `protobuf:"bytes,3,opt,name=collection,proto3" json:"collection,omitempty"` - Metadata []byte `protobuf:"bytes,4,opt,name=metadata,proto3" json:"metadata,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetStateByRange) Reset() { *m = GetStateByRange{} } -func (m *GetStateByRange) String() string { return proto.CompactTextString(m) } -func (*GetStateByRange) ProtoMessage() {} -func (*GetStateByRange) Descriptor() ([]byte, []int) { - return fileDescriptor_e5819fec16c96da2, []int{7} -} - -func (m *GetStateByRange) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetStateByRange.Unmarshal(m, b) -} -func (m *GetStateByRange) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetStateByRange.Marshal(b, m, deterministic) -} -func (m *GetStateByRange) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetStateByRange.Merge(m, src) -} -func (m *GetStateByRange) XXX_Size() int { - return xxx_messageInfo_GetStateByRange.Size(m) -} -func (m *GetStateByRange) XXX_DiscardUnknown() { - xxx_messageInfo_GetStateByRange.DiscardUnknown(m) -} - -var xxx_messageInfo_GetStateByRange proto.InternalMessageInfo - -func (m *GetStateByRange) GetStartKey() string { - if m != nil { - return m.StartKey - } - return "" -} - -func (m *GetStateByRange) GetEndKey() string { - if m != nil { - return m.EndKey - } - return "" -} - -func (m *GetStateByRange) GetCollection() string { - if m != nil { - return m.Collection - } - return "" -} - -func (m *GetStateByRange) GetMetadata() []byte { - if m != nil { - return m.Metadata - } - return nil -} - -// GetQueryResult is the payload of a ChaincodeMessage. It contains a query -// string in the form that is supported by the underlying state database. -// If the collection is specified, the query needs to be executed on the -// private data. The metadata hold the byte representation of QueryMetadata. -type GetQueryResult struct { - Query string `protobuf:"bytes,1,opt,name=query,proto3" json:"query,omitempty"` - Collection string `protobuf:"bytes,2,opt,name=collection,proto3" json:"collection,omitempty"` - Metadata []byte `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetQueryResult) Reset() { *m = GetQueryResult{} } -func (m *GetQueryResult) String() string { return proto.CompactTextString(m) } -func (*GetQueryResult) ProtoMessage() {} -func (*GetQueryResult) Descriptor() ([]byte, []int) { - return fileDescriptor_e5819fec16c96da2, []int{8} -} - -func (m *GetQueryResult) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetQueryResult.Unmarshal(m, b) -} -func (m *GetQueryResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetQueryResult.Marshal(b, m, deterministic) -} -func (m *GetQueryResult) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetQueryResult.Merge(m, src) -} -func (m *GetQueryResult) XXX_Size() int { - return xxx_messageInfo_GetQueryResult.Size(m) -} -func (m *GetQueryResult) XXX_DiscardUnknown() { - xxx_messageInfo_GetQueryResult.DiscardUnknown(m) -} - -var xxx_messageInfo_GetQueryResult proto.InternalMessageInfo - -func (m *GetQueryResult) GetQuery() string { - if m != nil { - return m.Query - } - return "" -} - -func (m *GetQueryResult) GetCollection() string { - if m != nil { - return m.Collection - } - return "" -} - -func (m *GetQueryResult) GetMetadata() []byte { - if m != nil { - return m.Metadata - } - return nil -} - -// QueryMetadata is the metadata of a GetStateByRange and GetQueryResult. -// It contains a pageSize which denotes the number of records to be fetched -// and a bookmark. -type QueryMetadata struct { - PageSize int32 `protobuf:"varint,1,opt,name=pageSize,proto3" json:"pageSize,omitempty"` - Bookmark string `protobuf:"bytes,2,opt,name=bookmark,proto3" json:"bookmark,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *QueryMetadata) Reset() { *m = QueryMetadata{} } -func (m *QueryMetadata) String() string { return proto.CompactTextString(m) } -func (*QueryMetadata) ProtoMessage() {} -func (*QueryMetadata) Descriptor() ([]byte, []int) { - return fileDescriptor_e5819fec16c96da2, []int{9} -} - -func (m *QueryMetadata) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_QueryMetadata.Unmarshal(m, b) -} -func (m *QueryMetadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_QueryMetadata.Marshal(b, m, deterministic) -} -func (m *QueryMetadata) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryMetadata.Merge(m, src) -} -func (m *QueryMetadata) XXX_Size() int { - return xxx_messageInfo_QueryMetadata.Size(m) -} -func (m *QueryMetadata) XXX_DiscardUnknown() { - xxx_messageInfo_QueryMetadata.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryMetadata proto.InternalMessageInfo - -func (m *QueryMetadata) GetPageSize() int32 { - if m != nil { - return m.PageSize - } - return 0 -} - -func (m *QueryMetadata) GetBookmark() string { - if m != nil { - return m.Bookmark - } - return "" -} - -// GetHistoryForKey is the payload of a ChaincodeMessage. It contains a key -// for which the historical values need to be retrieved. -type GetHistoryForKey struct { - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetHistoryForKey) Reset() { *m = GetHistoryForKey{} } -func (m *GetHistoryForKey) String() string { return proto.CompactTextString(m) } -func (*GetHistoryForKey) ProtoMessage() {} -func (*GetHistoryForKey) Descriptor() ([]byte, []int) { - return fileDescriptor_e5819fec16c96da2, []int{10} -} - -func (m *GetHistoryForKey) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetHistoryForKey.Unmarshal(m, b) -} -func (m *GetHistoryForKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetHistoryForKey.Marshal(b, m, deterministic) -} -func (m *GetHistoryForKey) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetHistoryForKey.Merge(m, src) -} -func (m *GetHistoryForKey) XXX_Size() int { - return xxx_messageInfo_GetHistoryForKey.Size(m) -} -func (m *GetHistoryForKey) XXX_DiscardUnknown() { - xxx_messageInfo_GetHistoryForKey.DiscardUnknown(m) -} - -var xxx_messageInfo_GetHistoryForKey proto.InternalMessageInfo - -func (m *GetHistoryForKey) GetKey() string { - if m != nil { - return m.Key - } - return "" -} - -type QueryStateNext struct { - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *QueryStateNext) Reset() { *m = QueryStateNext{} } -func (m *QueryStateNext) String() string { return proto.CompactTextString(m) } -func (*QueryStateNext) ProtoMessage() {} -func (*QueryStateNext) Descriptor() ([]byte, []int) { - return fileDescriptor_e5819fec16c96da2, []int{11} -} - -func (m *QueryStateNext) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_QueryStateNext.Unmarshal(m, b) -} -func (m *QueryStateNext) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_QueryStateNext.Marshal(b, m, deterministic) -} -func (m *QueryStateNext) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryStateNext.Merge(m, src) -} -func (m *QueryStateNext) XXX_Size() int { - return xxx_messageInfo_QueryStateNext.Size(m) -} -func (m *QueryStateNext) XXX_DiscardUnknown() { - xxx_messageInfo_QueryStateNext.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryStateNext proto.InternalMessageInfo - -func (m *QueryStateNext) GetId() string { - if m != nil { - return m.Id - } - return "" -} - -type QueryStateClose struct { - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *QueryStateClose) Reset() { *m = QueryStateClose{} } -func (m *QueryStateClose) String() string { return proto.CompactTextString(m) } -func (*QueryStateClose) ProtoMessage() {} -func (*QueryStateClose) Descriptor() ([]byte, []int) { - return fileDescriptor_e5819fec16c96da2, []int{12} -} - -func (m *QueryStateClose) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_QueryStateClose.Unmarshal(m, b) -} -func (m *QueryStateClose) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_QueryStateClose.Marshal(b, m, deterministic) -} -func (m *QueryStateClose) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryStateClose.Merge(m, src) -} -func (m *QueryStateClose) XXX_Size() int { - return xxx_messageInfo_QueryStateClose.Size(m) -} -func (m *QueryStateClose) XXX_DiscardUnknown() { - xxx_messageInfo_QueryStateClose.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryStateClose proto.InternalMessageInfo - -func (m *QueryStateClose) GetId() string { - if m != nil { - return m.Id - } - return "" -} - -// QueryResultBytes hold the byte representation of a record returned by the peer. -type QueryResultBytes struct { - ResultBytes []byte `protobuf:"bytes,1,opt,name=resultBytes,proto3" json:"resultBytes,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *QueryResultBytes) Reset() { *m = QueryResultBytes{} } -func (m *QueryResultBytes) String() string { return proto.CompactTextString(m) } -func (*QueryResultBytes) ProtoMessage() {} -func (*QueryResultBytes) Descriptor() ([]byte, []int) { - return fileDescriptor_e5819fec16c96da2, []int{13} -} - -func (m *QueryResultBytes) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_QueryResultBytes.Unmarshal(m, b) -} -func (m *QueryResultBytes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_QueryResultBytes.Marshal(b, m, deterministic) -} -func (m *QueryResultBytes) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryResultBytes.Merge(m, src) -} -func (m *QueryResultBytes) XXX_Size() int { - return xxx_messageInfo_QueryResultBytes.Size(m) -} -func (m *QueryResultBytes) XXX_DiscardUnknown() { - xxx_messageInfo_QueryResultBytes.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryResultBytes proto.InternalMessageInfo - -func (m *QueryResultBytes) GetResultBytes() []byte { - if m != nil { - return m.ResultBytes - } - return nil -} - -// QueryResponse is returned by the peer as a result of a GetStateByRange, -// GetQueryResult, and GetHistoryForKey. It holds a bunch of records in -// results field, a flag to denote whether more results need to be fetched from -// the peer in has_more field, transaction id in id field, and a QueryResponseMetadata -// in metadata field. -type QueryResponse struct { - Results []*QueryResultBytes `protobuf:"bytes,1,rep,name=results,proto3" json:"results,omitempty"` - HasMore bool `protobuf:"varint,2,opt,name=has_more,json=hasMore,proto3" json:"has_more,omitempty"` - Id string `protobuf:"bytes,3,opt,name=id,proto3" json:"id,omitempty"` - Metadata []byte `protobuf:"bytes,4,opt,name=metadata,proto3" json:"metadata,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *QueryResponse) Reset() { *m = QueryResponse{} } -func (m *QueryResponse) String() string { return proto.CompactTextString(m) } -func (*QueryResponse) ProtoMessage() {} -func (*QueryResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_e5819fec16c96da2, []int{14} -} - -func (m *QueryResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_QueryResponse.Unmarshal(m, b) -} -func (m *QueryResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_QueryResponse.Marshal(b, m, deterministic) -} -func (m *QueryResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryResponse.Merge(m, src) -} -func (m *QueryResponse) XXX_Size() int { - return xxx_messageInfo_QueryResponse.Size(m) -} -func (m *QueryResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryResponse proto.InternalMessageInfo - -func (m *QueryResponse) GetResults() []*QueryResultBytes { - if m != nil { - return m.Results - } - return nil -} - -func (m *QueryResponse) GetHasMore() bool { - if m != nil { - return m.HasMore - } - return false -} - -func (m *QueryResponse) GetId() string { - if m != nil { - return m.Id - } - return "" -} - -func (m *QueryResponse) GetMetadata() []byte { - if m != nil { - return m.Metadata - } - return nil -} - -// QueryResponseMetadata is the metadata of a QueryResponse. It contains a count -// which denotes the number of records fetched from the ledger and a bookmark. -type QueryResponseMetadata struct { - FetchedRecordsCount int32 `protobuf:"varint,1,opt,name=fetched_records_count,json=fetchedRecordsCount,proto3" json:"fetched_records_count,omitempty"` - Bookmark string `protobuf:"bytes,2,opt,name=bookmark,proto3" json:"bookmark,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *QueryResponseMetadata) Reset() { *m = QueryResponseMetadata{} } -func (m *QueryResponseMetadata) String() string { return proto.CompactTextString(m) } -func (*QueryResponseMetadata) ProtoMessage() {} -func (*QueryResponseMetadata) Descriptor() ([]byte, []int) { - return fileDescriptor_e5819fec16c96da2, []int{15} -} - -func (m *QueryResponseMetadata) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_QueryResponseMetadata.Unmarshal(m, b) -} -func (m *QueryResponseMetadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_QueryResponseMetadata.Marshal(b, m, deterministic) -} -func (m *QueryResponseMetadata) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryResponseMetadata.Merge(m, src) -} -func (m *QueryResponseMetadata) XXX_Size() int { - return xxx_messageInfo_QueryResponseMetadata.Size(m) -} -func (m *QueryResponseMetadata) XXX_DiscardUnknown() { - xxx_messageInfo_QueryResponseMetadata.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryResponseMetadata proto.InternalMessageInfo - -func (m *QueryResponseMetadata) GetFetchedRecordsCount() int32 { - if m != nil { - return m.FetchedRecordsCount - } - return 0 -} - -func (m *QueryResponseMetadata) GetBookmark() string { - if m != nil { - return m.Bookmark - } - return "" -} - -type StateMetadata struct { - Metakey string `protobuf:"bytes,1,opt,name=metakey,proto3" json:"metakey,omitempty"` - Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *StateMetadata) Reset() { *m = StateMetadata{} } -func (m *StateMetadata) String() string { return proto.CompactTextString(m) } -func (*StateMetadata) ProtoMessage() {} -func (*StateMetadata) Descriptor() ([]byte, []int) { - return fileDescriptor_e5819fec16c96da2, []int{16} -} - -func (m *StateMetadata) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_StateMetadata.Unmarshal(m, b) -} -func (m *StateMetadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_StateMetadata.Marshal(b, m, deterministic) -} -func (m *StateMetadata) XXX_Merge(src proto.Message) { - xxx_messageInfo_StateMetadata.Merge(m, src) -} -func (m *StateMetadata) XXX_Size() int { - return xxx_messageInfo_StateMetadata.Size(m) -} -func (m *StateMetadata) XXX_DiscardUnknown() { - xxx_messageInfo_StateMetadata.DiscardUnknown(m) -} - -var xxx_messageInfo_StateMetadata proto.InternalMessageInfo - -func (m *StateMetadata) GetMetakey() string { - if m != nil { - return m.Metakey - } - return "" -} - -func (m *StateMetadata) GetValue() []byte { - if m != nil { - return m.Value - } - return nil -} - -type StateMetadataResult struct { - Entries []*StateMetadata `protobuf:"bytes,1,rep,name=entries,proto3" json:"entries,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *StateMetadataResult) Reset() { *m = StateMetadataResult{} } -func (m *StateMetadataResult) String() string { return proto.CompactTextString(m) } -func (*StateMetadataResult) ProtoMessage() {} -func (*StateMetadataResult) Descriptor() ([]byte, []int) { - return fileDescriptor_e5819fec16c96da2, []int{17} -} - -func (m *StateMetadataResult) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_StateMetadataResult.Unmarshal(m, b) -} -func (m *StateMetadataResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_StateMetadataResult.Marshal(b, m, deterministic) -} -func (m *StateMetadataResult) XXX_Merge(src proto.Message) { - xxx_messageInfo_StateMetadataResult.Merge(m, src) -} -func (m *StateMetadataResult) XXX_Size() int { - return xxx_messageInfo_StateMetadataResult.Size(m) -} -func (m *StateMetadataResult) XXX_DiscardUnknown() { - xxx_messageInfo_StateMetadataResult.DiscardUnknown(m) -} - -var xxx_messageInfo_StateMetadataResult proto.InternalMessageInfo - -func (m *StateMetadataResult) GetEntries() []*StateMetadata { - if m != nil { - return m.Entries - } - return nil -} - -func init() { - proto.RegisterEnum("protos.ChaincodeMessage_Type", ChaincodeMessage_Type_name, ChaincodeMessage_Type_value) - proto.RegisterType((*ChaincodeMessage)(nil), "protos.ChaincodeMessage") - proto.RegisterType((*GetState)(nil), "protos.GetState") - proto.RegisterType((*GetStateMetadata)(nil), "protos.GetStateMetadata") - proto.RegisterType((*PutState)(nil), "protos.PutState") - proto.RegisterType((*PutStateMetadata)(nil), "protos.PutStateMetadata") - proto.RegisterType((*DelState)(nil), "protos.DelState") - proto.RegisterType((*PurgePrivateState)(nil), "protos.PurgePrivateState") - proto.RegisterType((*GetStateByRange)(nil), "protos.GetStateByRange") - proto.RegisterType((*GetQueryResult)(nil), "protos.GetQueryResult") - proto.RegisterType((*QueryMetadata)(nil), "protos.QueryMetadata") - proto.RegisterType((*GetHistoryForKey)(nil), "protos.GetHistoryForKey") - proto.RegisterType((*QueryStateNext)(nil), "protos.QueryStateNext") - proto.RegisterType((*QueryStateClose)(nil), "protos.QueryStateClose") - proto.RegisterType((*QueryResultBytes)(nil), "protos.QueryResultBytes") - proto.RegisterType((*QueryResponse)(nil), "protos.QueryResponse") - proto.RegisterType((*QueryResponseMetadata)(nil), "protos.QueryResponseMetadata") - proto.RegisterType((*StateMetadata)(nil), "protos.StateMetadata") - proto.RegisterType((*StateMetadataResult)(nil), "protos.StateMetadataResult") -} - -func init() { proto.RegisterFile("peer/chaincode_shim.proto", fileDescriptor_e5819fec16c96da2) } - -var fileDescriptor_e5819fec16c96da2 = []byte{ - // 1068 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0xcf, 0x72, 0xe2, 0xc6, - 0x13, 0xfe, 0x61, 0x8c, 0x11, 0x8d, 0x8d, 0x67, 0xc7, 0x8b, 0x97, 0xa5, 0x6a, 0x7f, 0x21, 0x54, - 0x0e, 0x1c, 0xb2, 0x90, 0x25, 0x39, 0xe4, 0x90, 0xaa, 0x2d, 0x19, 0xc6, 0x98, 0xb2, 0x2d, 0xd8, - 0x91, 0xec, 0x8a, 0x73, 0x51, 0x09, 0x69, 0x56, 0xa8, 0x16, 0x34, 0x8a, 0x34, 0x6c, 0x96, 0xdc, - 0x72, 0xcd, 0xa3, 0xe4, 0xe1, 0xf2, 0x0c, 0xa9, 0xd1, 0x3f, 0x03, 0x8e, 0x77, 0x53, 0x3e, 0xc1, - 0xd7, 0xfd, 0xf5, 0xd7, 0x3d, 0xdd, 0xd3, 0xaa, 0x81, 0x97, 0x01, 0x63, 0x61, 0xcf, 0x9e, 0x5b, - 0x9e, 0x6f, 0x73, 0x87, 0x99, 0xd1, 0xdc, 0x5b, 0x76, 0x83, 0x90, 0x0b, 0x8e, 0x0f, 0xe2, 0x9f, - 0xa8, 0xd9, 0xdc, 0xa1, 0xb0, 0x8f, 0xcc, 0x17, 0x09, 0xa7, 0x79, 0x12, 0xfb, 0x82, 0x90, 0x07, - 0x3c, 0xb2, 0x16, 0xa9, 0xf1, 0x2b, 0x97, 0x73, 0x77, 0xc1, 0x7a, 0x31, 0x9a, 0xad, 0xde, 0xf7, - 0x84, 0xb7, 0x64, 0x91, 0xb0, 0x96, 0x41, 0x42, 0x68, 0xff, 0x5d, 0x02, 0x34, 0xc8, 0xf4, 0xae, - 0x59, 0x14, 0x59, 0x2e, 0xc3, 0x6f, 0x60, 0x5f, 0xac, 0x03, 0xd6, 0x28, 0xb4, 0x0a, 0x9d, 0x5a, - 0xff, 0x55, 0x42, 0x8d, 0xba, 0xbb, 0xbc, 0xae, 0xb1, 0x0e, 0x18, 0x8d, 0xa9, 0xf8, 0x47, 0xa8, - 0xe4, 0xd2, 0x8d, 0xbd, 0x56, 0xa1, 0x53, 0xed, 0x37, 0xbb, 0x49, 0xf2, 0x6e, 0x96, 0xbc, 0x6b, - 0x64, 0x0c, 0x7a, 0x4f, 0xc6, 0x0d, 0x28, 0x07, 0xd6, 0x7a, 0xc1, 0x2d, 0xa7, 0x51, 0x6c, 0x15, - 0x3a, 0x87, 0x34, 0x83, 0x18, 0xc3, 0xbe, 0xf8, 0xe4, 0x39, 0x8d, 0xfd, 0x56, 0xa1, 0x53, 0xa1, - 0xf1, 0x7f, 0xdc, 0x07, 0x25, 0x3b, 0x62, 0xa3, 0x14, 0xa7, 0x39, 0xcd, 0xca, 0xd3, 0x3d, 0xd7, - 0x67, 0xce, 0x34, 0xf5, 0xd2, 0x9c, 0x87, 0xdf, 0xc2, 0xf1, 0x4e, 0xcb, 0x1a, 0x07, 0xdb, 0xa1, - 0xf9, 0xc9, 0x88, 0xf4, 0xd2, 0x9a, 0xbd, 0x85, 0xf1, 0x2b, 0x00, 0x7b, 0x6e, 0xf9, 0x3e, 0x5b, - 0x98, 0x9e, 0xd3, 0x28, 0xc7, 0xe5, 0x54, 0x52, 0xcb, 0xd8, 0x69, 0xff, 0x55, 0x84, 0x7d, 0xd9, - 0x0a, 0x7c, 0x04, 0x95, 0x1b, 0x6d, 0x48, 0xce, 0xc7, 0x1a, 0x19, 0xa2, 0xff, 0xe1, 0x43, 0x50, - 0x28, 0x19, 0x8d, 0x75, 0x83, 0x50, 0x54, 0xc0, 0x35, 0x80, 0x0c, 0x91, 0x21, 0xda, 0xc3, 0x0a, - 0xec, 0x8f, 0xb5, 0xb1, 0x81, 0x8a, 0xb8, 0x02, 0x25, 0x4a, 0xd4, 0xe1, 0x1d, 0xda, 0xc7, 0xc7, - 0x50, 0x35, 0xa8, 0xaa, 0xe9, 0xea, 0xc0, 0x18, 0x4f, 0x34, 0x54, 0x92, 0x92, 0x83, 0xc9, 0xf5, - 0xf4, 0x8a, 0x18, 0x64, 0x88, 0x0e, 0x24, 0x95, 0x50, 0x3a, 0xa1, 0xa8, 0x2c, 0x3d, 0x23, 0x62, - 0x98, 0xba, 0xa1, 0x1a, 0x04, 0x29, 0x12, 0x4e, 0x6f, 0x32, 0x58, 0x91, 0x70, 0x48, 0xae, 0x52, - 0x08, 0xf8, 0x39, 0xa0, 0xb1, 0x76, 0x3b, 0xb9, 0x24, 0xe6, 0xe0, 0x42, 0x1d, 0x6b, 0x83, 0xc9, - 0x90, 0xa0, 0x6a, 0x52, 0xa0, 0x3e, 0x9d, 0x68, 0x3a, 0x41, 0x47, 0xf8, 0x14, 0x70, 0x2e, 0x68, - 0x9e, 0xdd, 0x99, 0x54, 0xd5, 0x46, 0x04, 0xd5, 0x64, 0xac, 0xb4, 0xbf, 0xbb, 0x21, 0xf4, 0xce, - 0xa4, 0x44, 0xbf, 0xb9, 0x32, 0xd0, 0xb1, 0xb4, 0x26, 0x96, 0x84, 0xaf, 0x91, 0x9f, 0x0d, 0x84, - 0x70, 0x1d, 0x9e, 0x6d, 0x5a, 0x07, 0x57, 0x13, 0x9d, 0xa0, 0x67, 0xb2, 0x9a, 0x4b, 0x42, 0xa6, - 0xea, 0xd5, 0xf8, 0x96, 0x20, 0x8c, 0x5f, 0xc0, 0x89, 0x54, 0xbc, 0x18, 0xeb, 0xc6, 0x84, 0xde, - 0x99, 0xe7, 0x13, 0x6a, 0x5e, 0x92, 0x3b, 0x74, 0xb2, 0x5d, 0xc2, 0x35, 0x31, 0xd4, 0xa1, 0x6a, - 0xa8, 0xe8, 0xb9, 0xb4, 0xe7, 0x87, 0xbb, 0xb7, 0xd7, 0xf1, 0x4b, 0xa8, 0x4b, 0xfe, 0x94, 0x8e, - 0x6f, 0xa5, 0x47, 0x5a, 0xcd, 0x0b, 0x55, 0xbf, 0x40, 0xa7, 0x49, 0x08, 0x1d, 0x91, 0x2d, 0x27, - 0x7a, 0xd1, 0xfe, 0x09, 0x94, 0x11, 0x13, 0xba, 0xb0, 0x04, 0xc3, 0x08, 0x8a, 0x1f, 0xd8, 0x3a, - 0xbe, 0xe6, 0x15, 0x2a, 0xff, 0xe2, 0xff, 0x03, 0xd8, 0x7c, 0xb1, 0x60, 0xb6, 0xf0, 0xb8, 0x1f, - 0xdf, 0xe3, 0x0a, 0xdd, 0xb0, 0xb4, 0x87, 0x80, 0xb2, 0xe8, 0x6b, 0x26, 0x2c, 0xc7, 0x12, 0xd6, - 0x13, 0x54, 0x28, 0x28, 0xd3, 0xd5, 0xa3, 0x35, 0x3c, 0x87, 0xd2, 0x47, 0x6b, 0xb1, 0x62, 0x71, - 0xe0, 0x21, 0x4d, 0xc0, 0x8e, 0x66, 0xf1, 0x81, 0xe6, 0x6f, 0x80, 0x32, 0xcd, 0xff, 0x5c, 0xd9, - 0x03, 0x15, 0xfc, 0x06, 0x94, 0x65, 0x1a, 0x1d, 0xaf, 0x5d, 0xb5, 0x5f, 0xcf, 0xd7, 0x6b, 0x53, - 0x9a, 0xe6, 0x34, 0xd9, 0xd0, 0x21, 0x5b, 0x3c, 0xb5, 0xa1, 0x04, 0x9e, 0x4d, 0x57, 0xa1, 0xcb, - 0xa6, 0xa1, 0xf7, 0xd1, 0x12, 0xec, 0xa9, 0x32, 0x7f, 0x14, 0xe0, 0x38, 0x1b, 0xcc, 0xd9, 0x9a, - 0x5a, 0xbe, 0xcb, 0x70, 0x13, 0x94, 0x48, 0x58, 0xa1, 0xb8, 0xcc, 0xa5, 0x72, 0x8c, 0x4f, 0xe1, - 0x80, 0xf9, 0x8e, 0xf4, 0x24, 0x5a, 0x29, 0xfa, 0x62, 0x7f, 0x9a, 0x3b, 0xfd, 0x39, 0xdc, 0x68, - 0xc4, 0x0c, 0x6a, 0x23, 0x26, 0xde, 0xad, 0x58, 0xb8, 0xa6, 0x2c, 0x5a, 0x2d, 0x84, 0x9c, 0xe4, - 0xaf, 0x12, 0xa6, 0xe9, 0x13, 0xf0, 0xa5, 0xb3, 0x6c, 0xe5, 0x28, 0xee, 0xe4, 0x18, 0xc1, 0x51, - 0x9c, 0x20, 0x1f, 0x71, 0x13, 0x94, 0xc0, 0x72, 0x99, 0xee, 0xfd, 0x9e, 0x7c, 0xae, 0x4b, 0x34, - 0xc7, 0xd2, 0x37, 0xe3, 0xfc, 0xc3, 0xd2, 0x0a, 0x3f, 0xa4, 0x69, 0x72, 0xdc, 0xfe, 0x26, 0xbe, - 0xc8, 0x17, 0x5e, 0x24, 0x78, 0xb8, 0x3e, 0xe7, 0xa1, 0x3c, 0xfc, 0x83, 0xb6, 0xb7, 0x5b, 0x50, - 0x8b, 0xd3, 0xc5, 0x7d, 0xd5, 0xd8, 0x27, 0x81, 0x6b, 0xb0, 0xe7, 0x39, 0x29, 0x65, 0xcf, 0x73, - 0xda, 0x5f, 0xc3, 0xf1, 0x3d, 0x63, 0xb0, 0xe0, 0x11, 0x7b, 0x40, 0xf9, 0x01, 0xd0, 0x46, 0x53, - 0xce, 0xd6, 0x82, 0x45, 0xb8, 0x05, 0xd5, 0xf0, 0x1e, 0xc6, 0xe4, 0x43, 0xba, 0x69, 0x6a, 0xff, - 0x59, 0x48, 0x8f, 0x4a, 0x59, 0x14, 0x70, 0x3f, 0x62, 0xb8, 0x0f, 0xe5, 0x84, 0x20, 0xf9, 0xc5, - 0x4e, 0xb5, 0xdf, 0xc8, 0xae, 0xe6, 0xae, 0x3c, 0xcd, 0x88, 0xf8, 0x25, 0x28, 0x73, 0x2b, 0x32, - 0x97, 0x3c, 0x4c, 0xd6, 0x49, 0xa1, 0xe5, 0xb9, 0x15, 0x5d, 0xf3, 0x30, 0x2b, 0xb3, 0x98, 0x95, - 0xf9, 0xd9, 0xd1, 0xba, 0x50, 0xdf, 0xaa, 0x25, 0x6f, 0x7f, 0x1f, 0xea, 0xef, 0x99, 0xb0, 0xe7, - 0xcc, 0x31, 0x43, 0x66, 0xf3, 0xd0, 0x89, 0x4c, 0x9b, 0xaf, 0x7c, 0x91, 0xce, 0xe2, 0x24, 0x75, - 0xd2, 0xc4, 0x37, 0x90, 0xae, 0xcf, 0x8e, 0xe5, 0x2d, 0x1c, 0x6d, 0xaf, 0x70, 0x03, 0xca, 0xb2, - 0x8a, 0xfb, 0xb9, 0x64, 0xf0, 0xdf, 0x3f, 0x13, 0xed, 0x73, 0x38, 0xd9, 0x5e, 0xd4, 0xe4, 0x26, - 0xf6, 0xa0, 0xcc, 0x7c, 0x11, 0x7a, 0x2c, 0xeb, 0xdd, 0x23, 0x6b, 0x9d, 0xb1, 0xfa, 0xb7, 0x1b, - 0xcf, 0x02, 0x7d, 0x15, 0x04, 0x3c, 0x14, 0xf8, 0x0c, 0x14, 0xca, 0x5c, 0x2f, 0x12, 0x2c, 0xc4, - 0x8d, 0xc7, 0x1e, 0x05, 0xcd, 0x47, 0x3d, 0x9d, 0xc2, 0x77, 0x85, 0xbe, 0x06, 0x95, 0xdc, 0x8e, - 0x55, 0x28, 0x0f, 0xb8, 0xef, 0x33, 0x5b, 0x3c, 0x55, 0xef, 0x8c, 0x42, 0x9b, 0x87, 0x6e, 0x77, - 0xbe, 0x0e, 0x58, 0xb8, 0x60, 0x8e, 0xcb, 0xc2, 0xee, 0x7b, 0x6b, 0x16, 0x7a, 0x76, 0x16, 0x25, - 0x5f, 0x45, 0xbf, 0x7c, 0xeb, 0x7a, 0x62, 0xbe, 0x9a, 0x75, 0x6d, 0xbe, 0xec, 0x6d, 0x50, 0x7b, - 0x09, 0xf5, 0x75, 0x42, 0x7d, 0xed, 0xf2, 0x9e, 0x64, 0xcf, 0x92, 0xd7, 0xd6, 0xf7, 0xff, 0x04, - 0x00, 0x00, 0xff, 0xff, 0xea, 0xa6, 0x7b, 0x03, 0x91, 0x09, 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// ChaincodeSupportClient is the client API for ChaincodeSupport service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type ChaincodeSupportClient interface { - Register(ctx context.Context, opts ...grpc.CallOption) (ChaincodeSupport_RegisterClient, error) -} - -type chaincodeSupportClient struct { - cc *grpc.ClientConn -} - -func NewChaincodeSupportClient(cc *grpc.ClientConn) ChaincodeSupportClient { - return &chaincodeSupportClient{cc} -} - -func (c *chaincodeSupportClient) Register(ctx context.Context, opts ...grpc.CallOption) (ChaincodeSupport_RegisterClient, error) { - stream, err := c.cc.NewStream(ctx, &_ChaincodeSupport_serviceDesc.Streams[0], "/protos.ChaincodeSupport/Register", opts...) - if err != nil { - return nil, err - } - x := &chaincodeSupportRegisterClient{stream} - return x, nil -} - -type ChaincodeSupport_RegisterClient interface { - Send(*ChaincodeMessage) error - Recv() (*ChaincodeMessage, error) - grpc.ClientStream -} - -type chaincodeSupportRegisterClient struct { - grpc.ClientStream -} - -func (x *chaincodeSupportRegisterClient) Send(m *ChaincodeMessage) error { - return x.ClientStream.SendMsg(m) -} - -func (x *chaincodeSupportRegisterClient) Recv() (*ChaincodeMessage, error) { - m := new(ChaincodeMessage) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -// ChaincodeSupportServer is the server API for ChaincodeSupport service. -type ChaincodeSupportServer interface { - Register(ChaincodeSupport_RegisterServer) error -} - -// UnimplementedChaincodeSupportServer can be embedded to have forward compatible implementations. -type UnimplementedChaincodeSupportServer struct { -} - -func (*UnimplementedChaincodeSupportServer) Register(srv ChaincodeSupport_RegisterServer) error { - return status.Errorf(codes.Unimplemented, "method Register not implemented") -} - -func RegisterChaincodeSupportServer(s *grpc.Server, srv ChaincodeSupportServer) { - s.RegisterService(&_ChaincodeSupport_serviceDesc, srv) -} - -func _ChaincodeSupport_Register_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(ChaincodeSupportServer).Register(&chaincodeSupportRegisterServer{stream}) -} - -type ChaincodeSupport_RegisterServer interface { - Send(*ChaincodeMessage) error - Recv() (*ChaincodeMessage, error) - grpc.ServerStream -} - -type chaincodeSupportRegisterServer struct { - grpc.ServerStream -} - -func (x *chaincodeSupportRegisterServer) Send(m *ChaincodeMessage) error { - return x.ServerStream.SendMsg(m) -} - -func (x *chaincodeSupportRegisterServer) Recv() (*ChaincodeMessage, error) { - m := new(ChaincodeMessage) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -var _ChaincodeSupport_serviceDesc = grpc.ServiceDesc{ - ServiceName: "protos.ChaincodeSupport", - HandlerType: (*ChaincodeSupportServer)(nil), - Methods: []grpc.MethodDesc{}, - Streams: []grpc.StreamDesc{ - { - StreamName: "Register", - Handler: _ChaincodeSupport_Register_Handler, - ServerStreams: true, - ClientStreams: true, - }, - }, - Metadata: "peer/chaincode_shim.proto", -} - -// ChaincodeClient is the client API for Chaincode service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type ChaincodeClient interface { - Connect(ctx context.Context, opts ...grpc.CallOption) (Chaincode_ConnectClient, error) -} - -type chaincodeClient struct { - cc *grpc.ClientConn -} - -func NewChaincodeClient(cc *grpc.ClientConn) ChaincodeClient { - return &chaincodeClient{cc} -} - -func (c *chaincodeClient) Connect(ctx context.Context, opts ...grpc.CallOption) (Chaincode_ConnectClient, error) { - stream, err := c.cc.NewStream(ctx, &_Chaincode_serviceDesc.Streams[0], "/protos.Chaincode/Connect", opts...) - if err != nil { - return nil, err - } - x := &chaincodeConnectClient{stream} - return x, nil -} - -type Chaincode_ConnectClient interface { - Send(*ChaincodeMessage) error - Recv() (*ChaincodeMessage, error) - grpc.ClientStream -} - -type chaincodeConnectClient struct { - grpc.ClientStream -} - -func (x *chaincodeConnectClient) Send(m *ChaincodeMessage) error { - return x.ClientStream.SendMsg(m) -} - -func (x *chaincodeConnectClient) Recv() (*ChaincodeMessage, error) { - m := new(ChaincodeMessage) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -// ChaincodeServer is the server API for Chaincode service. -type ChaincodeServer interface { - Connect(Chaincode_ConnectServer) error -} - -// UnimplementedChaincodeServer can be embedded to have forward compatible implementations. -type UnimplementedChaincodeServer struct { -} - -func (*UnimplementedChaincodeServer) Connect(srv Chaincode_ConnectServer) error { - return status.Errorf(codes.Unimplemented, "method Connect not implemented") -} - -func RegisterChaincodeServer(s *grpc.Server, srv ChaincodeServer) { - s.RegisterService(&_Chaincode_serviceDesc, srv) -} - -func _Chaincode_Connect_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(ChaincodeServer).Connect(&chaincodeConnectServer{stream}) -} - -type Chaincode_ConnectServer interface { - Send(*ChaincodeMessage) error - Recv() (*ChaincodeMessage, error) - grpc.ServerStream -} - -type chaincodeConnectServer struct { - grpc.ServerStream -} - -func (x *chaincodeConnectServer) Send(m *ChaincodeMessage) error { - return x.ServerStream.SendMsg(m) -} - -func (x *chaincodeConnectServer) Recv() (*ChaincodeMessage, error) { - m := new(ChaincodeMessage) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -var _Chaincode_serviceDesc = grpc.ServiceDesc{ - ServiceName: "protos.Chaincode", - HandlerType: (*ChaincodeServer)(nil), - Methods: []grpc.MethodDesc{}, - Streams: []grpc.StreamDesc{ - { - StreamName: "Connect", - Handler: _Chaincode_Connect_Handler, - ServerStreams: true, - ClientStreams: true, - }, - }, - Metadata: "peer/chaincode_shim.proto", -} diff --git a/vendor/github.com/hyperledger/fabric-protos-go/peer/collection.pb.go b/vendor/github.com/hyperledger/fabric-protos-go/peer/collection.pb.go deleted file mode 100644 index a36a1841885..00000000000 --- a/vendor/github.com/hyperledger/fabric-protos-go/peer/collection.pb.go +++ /dev/null @@ -1,366 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: peer/collection.proto - -package peer - -import ( - fmt "fmt" - proto "github.com/golang/protobuf/proto" - common "github.com/hyperledger/fabric-protos-go/common" - math "math" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package - -// CollectionConfigPackage represents an array of CollectionConfig -// messages; the extra struct is required because repeated oneof is -// forbidden by the protobuf syntax -type CollectionConfigPackage struct { - Config []*CollectionConfig `protobuf:"bytes,1,rep,name=config,proto3" json:"config,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CollectionConfigPackage) Reset() { *m = CollectionConfigPackage{} } -func (m *CollectionConfigPackage) String() string { return proto.CompactTextString(m) } -func (*CollectionConfigPackage) ProtoMessage() {} -func (*CollectionConfigPackage) Descriptor() ([]byte, []int) { - return fileDescriptor_d8182e05ac5917d8, []int{0} -} - -func (m *CollectionConfigPackage) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CollectionConfigPackage.Unmarshal(m, b) -} -func (m *CollectionConfigPackage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CollectionConfigPackage.Marshal(b, m, deterministic) -} -func (m *CollectionConfigPackage) XXX_Merge(src proto.Message) { - xxx_messageInfo_CollectionConfigPackage.Merge(m, src) -} -func (m *CollectionConfigPackage) XXX_Size() int { - return xxx_messageInfo_CollectionConfigPackage.Size(m) -} -func (m *CollectionConfigPackage) XXX_DiscardUnknown() { - xxx_messageInfo_CollectionConfigPackage.DiscardUnknown(m) -} - -var xxx_messageInfo_CollectionConfigPackage proto.InternalMessageInfo - -func (m *CollectionConfigPackage) GetConfig() []*CollectionConfig { - if m != nil { - return m.Config - } - return nil -} - -// CollectionConfig defines the configuration of a collection object; -// it currently contains a single, static type. -// Dynamic collections are deferred. -type CollectionConfig struct { - // Types that are valid to be assigned to Payload: - // - // *CollectionConfig_StaticCollectionConfig - Payload isCollectionConfig_Payload `protobuf_oneof:"payload"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CollectionConfig) Reset() { *m = CollectionConfig{} } -func (m *CollectionConfig) String() string { return proto.CompactTextString(m) } -func (*CollectionConfig) ProtoMessage() {} -func (*CollectionConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_d8182e05ac5917d8, []int{1} -} - -func (m *CollectionConfig) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CollectionConfig.Unmarshal(m, b) -} -func (m *CollectionConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CollectionConfig.Marshal(b, m, deterministic) -} -func (m *CollectionConfig) XXX_Merge(src proto.Message) { - xxx_messageInfo_CollectionConfig.Merge(m, src) -} -func (m *CollectionConfig) XXX_Size() int { - return xxx_messageInfo_CollectionConfig.Size(m) -} -func (m *CollectionConfig) XXX_DiscardUnknown() { - xxx_messageInfo_CollectionConfig.DiscardUnknown(m) -} - -var xxx_messageInfo_CollectionConfig proto.InternalMessageInfo - -type isCollectionConfig_Payload interface { - isCollectionConfig_Payload() -} - -type CollectionConfig_StaticCollectionConfig struct { - StaticCollectionConfig *StaticCollectionConfig `protobuf:"bytes,1,opt,name=static_collection_config,json=staticCollectionConfig,proto3,oneof"` -} - -func (*CollectionConfig_StaticCollectionConfig) isCollectionConfig_Payload() {} - -func (m *CollectionConfig) GetPayload() isCollectionConfig_Payload { - if m != nil { - return m.Payload - } - return nil -} - -func (m *CollectionConfig) GetStaticCollectionConfig() *StaticCollectionConfig { - if x, ok := m.GetPayload().(*CollectionConfig_StaticCollectionConfig); ok { - return x.StaticCollectionConfig - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*CollectionConfig) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*CollectionConfig_StaticCollectionConfig)(nil), - } -} - -// StaticCollectionConfig constitutes the configuration parameters of a -// static collection object. Static collections are collections that are -// known at chaincode instantiation time, and that cannot be changed. -// Dynamic collections are deferred. -type StaticCollectionConfig struct { - // the name of the collection inside the denoted chaincode - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // a reference to a policy residing / managed in the config block - // to define which orgs have access to this collection’s private data - MemberOrgsPolicy *CollectionPolicyConfig `protobuf:"bytes,2,opt,name=member_orgs_policy,json=memberOrgsPolicy,proto3" json:"member_orgs_policy,omitempty"` - // The minimum number of peers private data will be sent to upon - // endorsement. The endorsement would fail if dissemination to at least - // this number of peers is not achieved. - RequiredPeerCount int32 `protobuf:"varint,3,opt,name=required_peer_count,json=requiredPeerCount,proto3" json:"required_peer_count,omitempty"` - // The maximum number of peers that private data will be sent to - // upon endorsement. This number has to be bigger than required_peer_count. - MaximumPeerCount int32 `protobuf:"varint,4,opt,name=maximum_peer_count,json=maximumPeerCount,proto3" json:"maximum_peer_count,omitempty"` - // The number of blocks after which the collection data expires. - // For instance if the value is set to 10, a key last modified by block number 100 - // will be purged at block number 111. A zero value is treated same as MaxUint64 - BlockToLive uint64 `protobuf:"varint,5,opt,name=block_to_live,json=blockToLive,proto3" json:"block_to_live,omitempty"` - // The member only read access denotes whether only collection member clients - // can read the private data (if set to true), or even non members can - // read the data (if set to false, for example if you want to implement more granular - // access logic in the chaincode) - MemberOnlyRead bool `protobuf:"varint,6,opt,name=member_only_read,json=memberOnlyRead,proto3" json:"member_only_read,omitempty"` - // The member only write access denotes whether only collection member clients - // can write the private data (if set to true), or even non members can - // write the data (if set to false, for example if you want to implement more granular - // access logic in the chaincode) - MemberOnlyWrite bool `protobuf:"varint,7,opt,name=member_only_write,json=memberOnlyWrite,proto3" json:"member_only_write,omitempty"` - // a reference to a policy residing / managed in the config block - // to define the endorsement policy for this collection - EndorsementPolicy *ApplicationPolicy `protobuf:"bytes,8,opt,name=endorsement_policy,json=endorsementPolicy,proto3" json:"endorsement_policy,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *StaticCollectionConfig) Reset() { *m = StaticCollectionConfig{} } -func (m *StaticCollectionConfig) String() string { return proto.CompactTextString(m) } -func (*StaticCollectionConfig) ProtoMessage() {} -func (*StaticCollectionConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_d8182e05ac5917d8, []int{2} -} - -func (m *StaticCollectionConfig) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_StaticCollectionConfig.Unmarshal(m, b) -} -func (m *StaticCollectionConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_StaticCollectionConfig.Marshal(b, m, deterministic) -} -func (m *StaticCollectionConfig) XXX_Merge(src proto.Message) { - xxx_messageInfo_StaticCollectionConfig.Merge(m, src) -} -func (m *StaticCollectionConfig) XXX_Size() int { - return xxx_messageInfo_StaticCollectionConfig.Size(m) -} -func (m *StaticCollectionConfig) XXX_DiscardUnknown() { - xxx_messageInfo_StaticCollectionConfig.DiscardUnknown(m) -} - -var xxx_messageInfo_StaticCollectionConfig proto.InternalMessageInfo - -func (m *StaticCollectionConfig) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *StaticCollectionConfig) GetMemberOrgsPolicy() *CollectionPolicyConfig { - if m != nil { - return m.MemberOrgsPolicy - } - return nil -} - -func (m *StaticCollectionConfig) GetRequiredPeerCount() int32 { - if m != nil { - return m.RequiredPeerCount - } - return 0 -} - -func (m *StaticCollectionConfig) GetMaximumPeerCount() int32 { - if m != nil { - return m.MaximumPeerCount - } - return 0 -} - -func (m *StaticCollectionConfig) GetBlockToLive() uint64 { - if m != nil { - return m.BlockToLive - } - return 0 -} - -func (m *StaticCollectionConfig) GetMemberOnlyRead() bool { - if m != nil { - return m.MemberOnlyRead - } - return false -} - -func (m *StaticCollectionConfig) GetMemberOnlyWrite() bool { - if m != nil { - return m.MemberOnlyWrite - } - return false -} - -func (m *StaticCollectionConfig) GetEndorsementPolicy() *ApplicationPolicy { - if m != nil { - return m.EndorsementPolicy - } - return nil -} - -// Collection policy configuration. Initially, the configuration can only -// contain a SignaturePolicy. In the future, the SignaturePolicy may be a -// more general Policy. Instead of containing the actual policy, the -// configuration may in the future contain a string reference to a policy. -type CollectionPolicyConfig struct { - // Types that are valid to be assigned to Payload: - // - // *CollectionPolicyConfig_SignaturePolicy - Payload isCollectionPolicyConfig_Payload `protobuf_oneof:"payload"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CollectionPolicyConfig) Reset() { *m = CollectionPolicyConfig{} } -func (m *CollectionPolicyConfig) String() string { return proto.CompactTextString(m) } -func (*CollectionPolicyConfig) ProtoMessage() {} -func (*CollectionPolicyConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_d8182e05ac5917d8, []int{3} -} - -func (m *CollectionPolicyConfig) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CollectionPolicyConfig.Unmarshal(m, b) -} -func (m *CollectionPolicyConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CollectionPolicyConfig.Marshal(b, m, deterministic) -} -func (m *CollectionPolicyConfig) XXX_Merge(src proto.Message) { - xxx_messageInfo_CollectionPolicyConfig.Merge(m, src) -} -func (m *CollectionPolicyConfig) XXX_Size() int { - return xxx_messageInfo_CollectionPolicyConfig.Size(m) -} -func (m *CollectionPolicyConfig) XXX_DiscardUnknown() { - xxx_messageInfo_CollectionPolicyConfig.DiscardUnknown(m) -} - -var xxx_messageInfo_CollectionPolicyConfig proto.InternalMessageInfo - -type isCollectionPolicyConfig_Payload interface { - isCollectionPolicyConfig_Payload() -} - -type CollectionPolicyConfig_SignaturePolicy struct { - SignaturePolicy *common.SignaturePolicyEnvelope `protobuf:"bytes,1,opt,name=signature_policy,json=signaturePolicy,proto3,oneof"` -} - -func (*CollectionPolicyConfig_SignaturePolicy) isCollectionPolicyConfig_Payload() {} - -func (m *CollectionPolicyConfig) GetPayload() isCollectionPolicyConfig_Payload { - if m != nil { - return m.Payload - } - return nil -} - -func (m *CollectionPolicyConfig) GetSignaturePolicy() *common.SignaturePolicyEnvelope { - if x, ok := m.GetPayload().(*CollectionPolicyConfig_SignaturePolicy); ok { - return x.SignaturePolicy - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*CollectionPolicyConfig) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*CollectionPolicyConfig_SignaturePolicy)(nil), - } -} - -func init() { - proto.RegisterType((*CollectionConfigPackage)(nil), "protos.CollectionConfigPackage") - proto.RegisterType((*CollectionConfig)(nil), "protos.CollectionConfig") - proto.RegisterType((*StaticCollectionConfig)(nil), "protos.StaticCollectionConfig") - proto.RegisterType((*CollectionPolicyConfig)(nil), "protos.CollectionPolicyConfig") -} - -func init() { proto.RegisterFile("peer/collection.proto", fileDescriptor_d8182e05ac5917d8) } - -var fileDescriptor_d8182e05ac5917d8 = []byte{ - // 479 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x93, 0xd1, 0x6a, 0xdb, 0x3e, - 0x18, 0xc5, 0x9b, 0x7f, 0xd2, 0xb4, 0x55, 0xf8, 0xaf, 0x89, 0x46, 0x33, 0xaf, 0x17, 0x5b, 0xf0, - 0x95, 0x19, 0xad, 0x33, 0xba, 0x27, 0x58, 0xc3, 0x20, 0xb0, 0xc0, 0x82, 0x3a, 0x18, 0xf4, 0xc6, - 0x28, 0xf2, 0x57, 0x57, 0x54, 0x96, 0x5c, 0x49, 0xce, 0xe6, 0x77, 0xd9, 0xc3, 0x0e, 0x4b, 0x71, - 0xed, 0x86, 0x5c, 0x25, 0x9c, 0xf3, 0x3b, 0x9f, 0x3e, 0x1d, 0x64, 0x74, 0x51, 0x00, 0xe8, 0x39, - 0x53, 0x42, 0x00, 0xb3, 0x5c, 0xc9, 0xb8, 0xd0, 0xca, 0x2a, 0x3c, 0x74, 0x3f, 0xe6, 0xf2, 0x82, - 0xa9, 0x3c, 0x57, 0x72, 0x5e, 0x28, 0xc1, 0x19, 0x07, 0xe3, 0xed, 0xcb, 0x89, 0x4b, 0x39, 0xb1, - 0xf2, 0x52, 0xf8, 0x1d, 0xbd, 0x5b, 0xbc, 0x4c, 0x59, 0x28, 0xf9, 0xc0, 0xb3, 0x35, 0x65, 0x4f, - 0x34, 0x03, 0xfc, 0x19, 0x0d, 0x99, 0x13, 0x82, 0xde, 0xac, 0x1f, 0x8d, 0x6e, 0x02, 0x1f, 0x31, - 0xf1, 0x7e, 0x80, 0xec, 0xb8, 0xb0, 0x42, 0xe3, 0x7d, 0x0f, 0xdf, 0xa3, 0xc0, 0x58, 0x6a, 0x39, - 0x4b, 0xda, 0x6d, 0x93, 0x97, 0xb9, 0xbd, 0x68, 0x74, 0xf3, 0xa1, 0x99, 0x7b, 0xe7, 0xb8, 0xfd, - 0x09, 0xcb, 0x23, 0x32, 0x35, 0x07, 0x9d, 0xdb, 0x33, 0x74, 0x52, 0xd0, 0x4a, 0x28, 0x9a, 0x86, - 0x7f, 0xfb, 0x68, 0x7a, 0x38, 0x8f, 0x31, 0x1a, 0x48, 0x9a, 0x83, 0x3b, 0xed, 0x8c, 0xb8, 0xff, - 0x78, 0x85, 0x70, 0x0e, 0xf9, 0x06, 0x74, 0xa2, 0x74, 0x66, 0x12, 0x5f, 0x49, 0xf0, 0xdf, 0xeb, - 0x7d, 0xda, 0x49, 0x6b, 0xe7, 0xef, 0x6e, 0x3b, 0xf6, 0xc9, 0x1f, 0x3a, 0x33, 0x5e, 0xc7, 0x31, - 0x7a, 0xab, 0xe1, 0xb9, 0xe4, 0x1a, 0xd2, 0xa4, 0xae, 0x38, 0x61, 0xaa, 0x94, 0x36, 0xe8, 0xcf, - 0x7a, 0xd1, 0x31, 0x99, 0x34, 0xd6, 0x1a, 0x40, 0x2f, 0x6a, 0x03, 0x5f, 0x21, 0x9c, 0xd3, 0x3f, - 0x3c, 0x2f, 0xf3, 0x2e, 0x3e, 0x70, 0xf8, 0x78, 0xe7, 0xb4, 0x74, 0x88, 0xfe, 0xdf, 0x08, 0xc5, - 0x9e, 0x12, 0xab, 0x12, 0xc1, 0xb7, 0x10, 0x1c, 0xcf, 0x7a, 0xd1, 0x80, 0x8c, 0x9c, 0xf8, 0x53, - 0xad, 0xf8, 0x16, 0x70, 0x84, 0xc6, 0xcd, 0x7d, 0xa4, 0xa8, 0x12, 0x0d, 0x34, 0x0d, 0x86, 0xb3, - 0x5e, 0x74, 0x4a, 0xde, 0xec, 0xb6, 0x95, 0xa2, 0x22, 0x40, 0x53, 0xfc, 0x09, 0x4d, 0xba, 0xe4, - 0x6f, 0xcd, 0x2d, 0x04, 0x27, 0x0e, 0x3d, 0x6f, 0xd1, 0x5f, 0xb5, 0x8c, 0x97, 0x08, 0x83, 0x4c, - 0x95, 0x36, 0x90, 0x83, 0xb4, 0x4d, 0x4b, 0xa7, 0xae, 0xa5, 0xf7, 0x4d, 0x4b, 0x5f, 0x8b, 0x42, - 0x70, 0x46, 0xdb, 0x9a, 0xc8, 0xa4, 0x13, 0xf2, 0x52, 0xf8, 0x8c, 0xa6, 0x87, 0xdb, 0xc4, 0x2b, - 0x34, 0x36, 0x3c, 0x93, 0xd4, 0x96, 0x1a, 0x9a, 0x13, 0xfc, 0xbb, 0xf8, 0x18, 0xfb, 0x57, 0x1c, - 0xdf, 0x35, 0xbe, 0x0f, 0x7e, 0x93, 0x5b, 0x10, 0xaa, 0x80, 0xe5, 0x11, 0x39, 0x37, 0xaf, 0xad, - 0xce, 0x8b, 0xb8, 0x25, 0x28, 0x54, 0x3a, 0x8b, 0x1f, 0xab, 0x02, 0xb4, 0x80, 0x34, 0x03, 0x1d, - 0x3f, 0xd0, 0x8d, 0xe6, 0xac, 0x59, 0xbc, 0xae, 0xfe, 0xfe, 0x2a, 0xe3, 0xf6, 0xb1, 0xdc, 0xd4, - 0x47, 0xcd, 0x3b, 0xe8, 0xdc, 0xa3, 0xd7, 0x1e, 0xbd, 0xce, 0xd4, 0xbc, 0xa6, 0x37, 0xfe, 0xfb, - 0xfa, 0xf2, 0x2f, 0x00, 0x00, 0xff, 0xff, 0x4e, 0x67, 0x04, 0x1f, 0x7f, 0x03, 0x00, 0x00, -} diff --git a/vendor/github.com/hyperledger/fabric-protos-go/peer/configuration.pb.go b/vendor/github.com/hyperledger/fabric-protos-go/peer/configuration.pb.go deleted file mode 100644 index c85f2c0a9b3..00000000000 --- a/vendor/github.com/hyperledger/fabric-protos-go/peer/configuration.pb.go +++ /dev/null @@ -1,225 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: peer/configuration.proto - -package peer - -import ( - fmt "fmt" - proto "github.com/golang/protobuf/proto" - math "math" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package - -// AnchorPeers simply represents list of anchor peers which is used in ConfigurationItem -type AnchorPeers struct { - AnchorPeers []*AnchorPeer `protobuf:"bytes,1,rep,name=anchor_peers,json=anchorPeers,proto3" json:"anchor_peers,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *AnchorPeers) Reset() { *m = AnchorPeers{} } -func (m *AnchorPeers) String() string { return proto.CompactTextString(m) } -func (*AnchorPeers) ProtoMessage() {} -func (*AnchorPeers) Descriptor() ([]byte, []int) { - return fileDescriptor_4978ae8738390a60, []int{0} -} - -func (m *AnchorPeers) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_AnchorPeers.Unmarshal(m, b) -} -func (m *AnchorPeers) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_AnchorPeers.Marshal(b, m, deterministic) -} -func (m *AnchorPeers) XXX_Merge(src proto.Message) { - xxx_messageInfo_AnchorPeers.Merge(m, src) -} -func (m *AnchorPeers) XXX_Size() int { - return xxx_messageInfo_AnchorPeers.Size(m) -} -func (m *AnchorPeers) XXX_DiscardUnknown() { - xxx_messageInfo_AnchorPeers.DiscardUnknown(m) -} - -var xxx_messageInfo_AnchorPeers proto.InternalMessageInfo - -func (m *AnchorPeers) GetAnchorPeers() []*AnchorPeer { - if m != nil { - return m.AnchorPeers - } - return nil -} - -// AnchorPeer message structure which provides information about anchor peer, it includes host name, -// port number and peer certificate. -type AnchorPeer struct { - Host string `protobuf:"bytes,1,opt,name=host,proto3" json:"host,omitempty"` - Port int32 `protobuf:"varint,2,opt,name=port,proto3" json:"port,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *AnchorPeer) Reset() { *m = AnchorPeer{} } -func (m *AnchorPeer) String() string { return proto.CompactTextString(m) } -func (*AnchorPeer) ProtoMessage() {} -func (*AnchorPeer) Descriptor() ([]byte, []int) { - return fileDescriptor_4978ae8738390a60, []int{1} -} - -func (m *AnchorPeer) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_AnchorPeer.Unmarshal(m, b) -} -func (m *AnchorPeer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_AnchorPeer.Marshal(b, m, deterministic) -} -func (m *AnchorPeer) XXX_Merge(src proto.Message) { - xxx_messageInfo_AnchorPeer.Merge(m, src) -} -func (m *AnchorPeer) XXX_Size() int { - return xxx_messageInfo_AnchorPeer.Size(m) -} -func (m *AnchorPeer) XXX_DiscardUnknown() { - xxx_messageInfo_AnchorPeer.DiscardUnknown(m) -} - -var xxx_messageInfo_AnchorPeer proto.InternalMessageInfo - -func (m *AnchorPeer) GetHost() string { - if m != nil { - return m.Host - } - return "" -} - -func (m *AnchorPeer) GetPort() int32 { - if m != nil { - return m.Port - } - return 0 -} - -// APIResource represents an API resource in the peer whose ACL -// is determined by the policy_ref field -type APIResource struct { - PolicyRef string `protobuf:"bytes,1,opt,name=policy_ref,json=policyRef,proto3" json:"policy_ref,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *APIResource) Reset() { *m = APIResource{} } -func (m *APIResource) String() string { return proto.CompactTextString(m) } -func (*APIResource) ProtoMessage() {} -func (*APIResource) Descriptor() ([]byte, []int) { - return fileDescriptor_4978ae8738390a60, []int{2} -} - -func (m *APIResource) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_APIResource.Unmarshal(m, b) -} -func (m *APIResource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_APIResource.Marshal(b, m, deterministic) -} -func (m *APIResource) XXX_Merge(src proto.Message) { - xxx_messageInfo_APIResource.Merge(m, src) -} -func (m *APIResource) XXX_Size() int { - return xxx_messageInfo_APIResource.Size(m) -} -func (m *APIResource) XXX_DiscardUnknown() { - xxx_messageInfo_APIResource.DiscardUnknown(m) -} - -var xxx_messageInfo_APIResource proto.InternalMessageInfo - -func (m *APIResource) GetPolicyRef() string { - if m != nil { - return m.PolicyRef - } - return "" -} - -// ACLs provides mappings for resources in a channel. APIResource encapsulates -// reference to a policy used to determine ACL for the resource -type ACLs struct { - Acls map[string]*APIResource `protobuf:"bytes,1,rep,name=acls,proto3" json:"acls,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ACLs) Reset() { *m = ACLs{} } -func (m *ACLs) String() string { return proto.CompactTextString(m) } -func (*ACLs) ProtoMessage() {} -func (*ACLs) Descriptor() ([]byte, []int) { - return fileDescriptor_4978ae8738390a60, []int{3} -} - -func (m *ACLs) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ACLs.Unmarshal(m, b) -} -func (m *ACLs) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ACLs.Marshal(b, m, deterministic) -} -func (m *ACLs) XXX_Merge(src proto.Message) { - xxx_messageInfo_ACLs.Merge(m, src) -} -func (m *ACLs) XXX_Size() int { - return xxx_messageInfo_ACLs.Size(m) -} -func (m *ACLs) XXX_DiscardUnknown() { - xxx_messageInfo_ACLs.DiscardUnknown(m) -} - -var xxx_messageInfo_ACLs proto.InternalMessageInfo - -func (m *ACLs) GetAcls() map[string]*APIResource { - if m != nil { - return m.Acls - } - return nil -} - -func init() { - proto.RegisterType((*AnchorPeers)(nil), "protos.AnchorPeers") - proto.RegisterType((*AnchorPeer)(nil), "protos.AnchorPeer") - proto.RegisterType((*APIResource)(nil), "protos.APIResource") - proto.RegisterType((*ACLs)(nil), "protos.ACLs") - proto.RegisterMapType((map[string]*APIResource)(nil), "protos.ACLs.AclsEntry") -} - -func init() { proto.RegisterFile("peer/configuration.proto", fileDescriptor_4978ae8738390a60) } - -var fileDescriptor_4978ae8738390a60 = []byte{ - // 296 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x4c, 0x91, 0xcd, 0x4b, 0xc3, 0x40, - 0x10, 0xc5, 0x49, 0x3f, 0x84, 0x4e, 0x3c, 0xc8, 0x0a, 0x12, 0x04, 0xa1, 0xe4, 0x54, 0xa5, 0x4d, - 0xa0, 0x2a, 0x88, 0xb7, 0x58, 0x3d, 0x08, 0x3d, 0x94, 0x3d, 0x7a, 0x29, 0xe9, 0x3a, 0xf9, 0xc0, - 0x98, 0x09, 0xb3, 0x89, 0x90, 0x9b, 0x7f, 0xba, 0x64, 0xb7, 0x4d, 0x3c, 0xed, 0xdb, 0xb7, 0xbf, - 0x37, 0x3c, 0x76, 0xc0, 0xab, 0x10, 0x39, 0x54, 0x54, 0x26, 0x79, 0xda, 0x70, 0x5c, 0xe7, 0x54, - 0x06, 0x15, 0x53, 0x4d, 0xe2, 0xcc, 0x1c, 0xda, 0x7f, 0x05, 0x37, 0x2a, 0x55, 0x46, 0xbc, 0x43, - 0x64, 0x2d, 0x1e, 0xe1, 0x3c, 0x36, 0xd7, 0x7d, 0x97, 0xd4, 0x9e, 0x33, 0x1f, 0x2f, 0xdc, 0xb5, - 0xb0, 0x21, 0x1d, 0x0c, 0xa8, 0x74, 0xe3, 0x21, 0xe6, 0x3f, 0x00, 0x0c, 0x4f, 0x42, 0xc0, 0x24, - 0x23, 0x5d, 0x7b, 0xce, 0xdc, 0x59, 0xcc, 0xa4, 0xd1, 0x9d, 0x57, 0x11, 0xd7, 0xde, 0x68, 0xee, - 0x2c, 0xa6, 0xd2, 0x68, 0x7f, 0x09, 0x6e, 0xb4, 0x7b, 0x97, 0xa8, 0xa9, 0x61, 0x85, 0xe2, 0x06, - 0xa0, 0xa2, 0x22, 0x57, 0xed, 0x9e, 0x31, 0x39, 0x86, 0x67, 0xd6, 0x91, 0x98, 0xf8, 0xbf, 0x0e, - 0x4c, 0xa2, 0xcd, 0x56, 0x8b, 0x3b, 0x98, 0xc4, 0xaa, 0x38, 0x75, 0xbb, 0xea, 0xbb, 0x6d, 0xb6, - 0x3a, 0x88, 0x54, 0xa1, 0xdf, 0xca, 0x9a, 0x5b, 0x69, 0x98, 0xeb, 0x2d, 0xcc, 0x7a, 0x4b, 0x5c, - 0xc0, 0xf8, 0x0b, 0xdb, 0xe3, 0xe4, 0x4e, 0x8a, 0x5b, 0x98, 0xfe, 0xc4, 0x45, 0x83, 0xa6, 0x96, - 0xbb, 0xbe, 0xec, 0x67, 0x0d, 0xb5, 0xa4, 0x25, 0x9e, 0x47, 0x4f, 0xce, 0x8b, 0x04, 0x9f, 0x38, - 0x0d, 0xb2, 0xb6, 0x42, 0x2e, 0xf0, 0x33, 0x45, 0x0e, 0x92, 0xf8, 0xc0, 0xb9, 0x3a, 0xe5, 0xba, - 0x4f, 0xfb, 0x58, 0xa6, 0x79, 0x9d, 0x35, 0x87, 0x40, 0xd1, 0x77, 0xf8, 0x0f, 0x0d, 0x2d, 0xba, - 0xb2, 0xe8, 0x2a, 0xa5, 0xb0, 0xa3, 0x0f, 0x76, 0x11, 0xf7, 0x7f, 0x01, 0x00, 0x00, 0xff, 0xff, - 0x10, 0x49, 0xdc, 0x44, 0xab, 0x01, 0x00, 0x00, -} diff --git a/vendor/github.com/hyperledger/fabric-protos-go/peer/events.pb.go b/vendor/github.com/hyperledger/fabric-protos-go/peer/events.pb.go deleted file mode 100644 index a4dee92aff4..00000000000 --- a/vendor/github.com/hyperledger/fabric-protos-go/peer/events.pb.go +++ /dev/null @@ -1,744 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: peer/events.proto - -package peer - -import ( - context "context" - fmt "fmt" - proto "github.com/golang/protobuf/proto" - common "github.com/hyperledger/fabric-protos-go/common" - rwset "github.com/hyperledger/fabric-protos-go/ledger/rwset" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - math "math" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package - -// FilteredBlock is a minimal set of information about a block -type FilteredBlock struct { - ChannelId string `protobuf:"bytes,1,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` - Number uint64 `protobuf:"varint,2,opt,name=number,proto3" json:"number,omitempty"` - FilteredTransactions []*FilteredTransaction `protobuf:"bytes,4,rep,name=filtered_transactions,json=filteredTransactions,proto3" json:"filtered_transactions,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *FilteredBlock) Reset() { *m = FilteredBlock{} } -func (m *FilteredBlock) String() string { return proto.CompactTextString(m) } -func (*FilteredBlock) ProtoMessage() {} -func (*FilteredBlock) Descriptor() ([]byte, []int) { - return fileDescriptor_5eedcc5fab2714e6, []int{0} -} - -func (m *FilteredBlock) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_FilteredBlock.Unmarshal(m, b) -} -func (m *FilteredBlock) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_FilteredBlock.Marshal(b, m, deterministic) -} -func (m *FilteredBlock) XXX_Merge(src proto.Message) { - xxx_messageInfo_FilteredBlock.Merge(m, src) -} -func (m *FilteredBlock) XXX_Size() int { - return xxx_messageInfo_FilteredBlock.Size(m) -} -func (m *FilteredBlock) XXX_DiscardUnknown() { - xxx_messageInfo_FilteredBlock.DiscardUnknown(m) -} - -var xxx_messageInfo_FilteredBlock proto.InternalMessageInfo - -func (m *FilteredBlock) GetChannelId() string { - if m != nil { - return m.ChannelId - } - return "" -} - -func (m *FilteredBlock) GetNumber() uint64 { - if m != nil { - return m.Number - } - return 0 -} - -func (m *FilteredBlock) GetFilteredTransactions() []*FilteredTransaction { - if m != nil { - return m.FilteredTransactions - } - return nil -} - -// FilteredTransaction is a minimal set of information about a transaction -// within a block -type FilteredTransaction struct { - Txid string `protobuf:"bytes,1,opt,name=txid,proto3" json:"txid,omitempty"` - Type common.HeaderType `protobuf:"varint,2,opt,name=type,proto3,enum=common.HeaderType" json:"type,omitempty"` - TxValidationCode TxValidationCode `protobuf:"varint,3,opt,name=tx_validation_code,json=txValidationCode,proto3,enum=protos.TxValidationCode" json:"tx_validation_code,omitempty"` - // Types that are valid to be assigned to Data: - // - // *FilteredTransaction_TransactionActions - Data isFilteredTransaction_Data `protobuf_oneof:"Data"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *FilteredTransaction) Reset() { *m = FilteredTransaction{} } -func (m *FilteredTransaction) String() string { return proto.CompactTextString(m) } -func (*FilteredTransaction) ProtoMessage() {} -func (*FilteredTransaction) Descriptor() ([]byte, []int) { - return fileDescriptor_5eedcc5fab2714e6, []int{1} -} - -func (m *FilteredTransaction) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_FilteredTransaction.Unmarshal(m, b) -} -func (m *FilteredTransaction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_FilteredTransaction.Marshal(b, m, deterministic) -} -func (m *FilteredTransaction) XXX_Merge(src proto.Message) { - xxx_messageInfo_FilteredTransaction.Merge(m, src) -} -func (m *FilteredTransaction) XXX_Size() int { - return xxx_messageInfo_FilteredTransaction.Size(m) -} -func (m *FilteredTransaction) XXX_DiscardUnknown() { - xxx_messageInfo_FilteredTransaction.DiscardUnknown(m) -} - -var xxx_messageInfo_FilteredTransaction proto.InternalMessageInfo - -func (m *FilteredTransaction) GetTxid() string { - if m != nil { - return m.Txid - } - return "" -} - -func (m *FilteredTransaction) GetType() common.HeaderType { - if m != nil { - return m.Type - } - return common.HeaderType_MESSAGE -} - -func (m *FilteredTransaction) GetTxValidationCode() TxValidationCode { - if m != nil { - return m.TxValidationCode - } - return TxValidationCode_VALID -} - -type isFilteredTransaction_Data interface { - isFilteredTransaction_Data() -} - -type FilteredTransaction_TransactionActions struct { - TransactionActions *FilteredTransactionActions `protobuf:"bytes,4,opt,name=transaction_actions,json=transactionActions,proto3,oneof"` -} - -func (*FilteredTransaction_TransactionActions) isFilteredTransaction_Data() {} - -func (m *FilteredTransaction) GetData() isFilteredTransaction_Data { - if m != nil { - return m.Data - } - return nil -} - -func (m *FilteredTransaction) GetTransactionActions() *FilteredTransactionActions { - if x, ok := m.GetData().(*FilteredTransaction_TransactionActions); ok { - return x.TransactionActions - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*FilteredTransaction) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*FilteredTransaction_TransactionActions)(nil), - } -} - -// FilteredTransactionActions is a wrapper for array of TransactionAction -// message from regular block -type FilteredTransactionActions struct { - ChaincodeActions []*FilteredChaincodeAction `protobuf:"bytes,1,rep,name=chaincode_actions,json=chaincodeActions,proto3" json:"chaincode_actions,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *FilteredTransactionActions) Reset() { *m = FilteredTransactionActions{} } -func (m *FilteredTransactionActions) String() string { return proto.CompactTextString(m) } -func (*FilteredTransactionActions) ProtoMessage() {} -func (*FilteredTransactionActions) Descriptor() ([]byte, []int) { - return fileDescriptor_5eedcc5fab2714e6, []int{2} -} - -func (m *FilteredTransactionActions) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_FilteredTransactionActions.Unmarshal(m, b) -} -func (m *FilteredTransactionActions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_FilteredTransactionActions.Marshal(b, m, deterministic) -} -func (m *FilteredTransactionActions) XXX_Merge(src proto.Message) { - xxx_messageInfo_FilteredTransactionActions.Merge(m, src) -} -func (m *FilteredTransactionActions) XXX_Size() int { - return xxx_messageInfo_FilteredTransactionActions.Size(m) -} -func (m *FilteredTransactionActions) XXX_DiscardUnknown() { - xxx_messageInfo_FilteredTransactionActions.DiscardUnknown(m) -} - -var xxx_messageInfo_FilteredTransactionActions proto.InternalMessageInfo - -func (m *FilteredTransactionActions) GetChaincodeActions() []*FilteredChaincodeAction { - if m != nil { - return m.ChaincodeActions - } - return nil -} - -// FilteredChaincodeAction is a minimal set of information about an action -// within a transaction -type FilteredChaincodeAction struct { - ChaincodeEvent *ChaincodeEvent `protobuf:"bytes,1,opt,name=chaincode_event,json=chaincodeEvent,proto3" json:"chaincode_event,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *FilteredChaincodeAction) Reset() { *m = FilteredChaincodeAction{} } -func (m *FilteredChaincodeAction) String() string { return proto.CompactTextString(m) } -func (*FilteredChaincodeAction) ProtoMessage() {} -func (*FilteredChaincodeAction) Descriptor() ([]byte, []int) { - return fileDescriptor_5eedcc5fab2714e6, []int{3} -} - -func (m *FilteredChaincodeAction) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_FilteredChaincodeAction.Unmarshal(m, b) -} -func (m *FilteredChaincodeAction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_FilteredChaincodeAction.Marshal(b, m, deterministic) -} -func (m *FilteredChaincodeAction) XXX_Merge(src proto.Message) { - xxx_messageInfo_FilteredChaincodeAction.Merge(m, src) -} -func (m *FilteredChaincodeAction) XXX_Size() int { - return xxx_messageInfo_FilteredChaincodeAction.Size(m) -} -func (m *FilteredChaincodeAction) XXX_DiscardUnknown() { - xxx_messageInfo_FilteredChaincodeAction.DiscardUnknown(m) -} - -var xxx_messageInfo_FilteredChaincodeAction proto.InternalMessageInfo - -func (m *FilteredChaincodeAction) GetChaincodeEvent() *ChaincodeEvent { - if m != nil { - return m.ChaincodeEvent - } - return nil -} - -// BlockAndPrivateData contains Block and a map from tx_seq_in_block to rwset.TxPvtReadWriteSet -type BlockAndPrivateData struct { - Block *common.Block `protobuf:"bytes,1,opt,name=block,proto3" json:"block,omitempty"` - // map from tx_seq_in_block to rwset.TxPvtReadWriteSet - PrivateDataMap map[uint64]*rwset.TxPvtReadWriteSet `protobuf:"bytes,2,rep,name=private_data_map,json=privateDataMap,proto3" json:"private_data_map,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *BlockAndPrivateData) Reset() { *m = BlockAndPrivateData{} } -func (m *BlockAndPrivateData) String() string { return proto.CompactTextString(m) } -func (*BlockAndPrivateData) ProtoMessage() {} -func (*BlockAndPrivateData) Descriptor() ([]byte, []int) { - return fileDescriptor_5eedcc5fab2714e6, []int{4} -} - -func (m *BlockAndPrivateData) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_BlockAndPrivateData.Unmarshal(m, b) -} -func (m *BlockAndPrivateData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_BlockAndPrivateData.Marshal(b, m, deterministic) -} -func (m *BlockAndPrivateData) XXX_Merge(src proto.Message) { - xxx_messageInfo_BlockAndPrivateData.Merge(m, src) -} -func (m *BlockAndPrivateData) XXX_Size() int { - return xxx_messageInfo_BlockAndPrivateData.Size(m) -} -func (m *BlockAndPrivateData) XXX_DiscardUnknown() { - xxx_messageInfo_BlockAndPrivateData.DiscardUnknown(m) -} - -var xxx_messageInfo_BlockAndPrivateData proto.InternalMessageInfo - -func (m *BlockAndPrivateData) GetBlock() *common.Block { - if m != nil { - return m.Block - } - return nil -} - -func (m *BlockAndPrivateData) GetPrivateDataMap() map[uint64]*rwset.TxPvtReadWriteSet { - if m != nil { - return m.PrivateDataMap - } - return nil -} - -// DeliverResponse -type DeliverResponse struct { - // Types that are valid to be assigned to Type: - // - // *DeliverResponse_Status - // *DeliverResponse_Block - // *DeliverResponse_FilteredBlock - // *DeliverResponse_BlockAndPrivateData - Type isDeliverResponse_Type `protobuf_oneof:"Type"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *DeliverResponse) Reset() { *m = DeliverResponse{} } -func (m *DeliverResponse) String() string { return proto.CompactTextString(m) } -func (*DeliverResponse) ProtoMessage() {} -func (*DeliverResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_5eedcc5fab2714e6, []int{5} -} - -func (m *DeliverResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_DeliverResponse.Unmarshal(m, b) -} -func (m *DeliverResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_DeliverResponse.Marshal(b, m, deterministic) -} -func (m *DeliverResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_DeliverResponse.Merge(m, src) -} -func (m *DeliverResponse) XXX_Size() int { - return xxx_messageInfo_DeliverResponse.Size(m) -} -func (m *DeliverResponse) XXX_DiscardUnknown() { - xxx_messageInfo_DeliverResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_DeliverResponse proto.InternalMessageInfo - -type isDeliverResponse_Type interface { - isDeliverResponse_Type() -} - -type DeliverResponse_Status struct { - Status common.Status `protobuf:"varint,1,opt,name=status,proto3,enum=common.Status,oneof"` -} - -type DeliverResponse_Block struct { - Block *common.Block `protobuf:"bytes,2,opt,name=block,proto3,oneof"` -} - -type DeliverResponse_FilteredBlock struct { - FilteredBlock *FilteredBlock `protobuf:"bytes,3,opt,name=filtered_block,json=filteredBlock,proto3,oneof"` -} - -type DeliverResponse_BlockAndPrivateData struct { - BlockAndPrivateData *BlockAndPrivateData `protobuf:"bytes,4,opt,name=block_and_private_data,json=blockAndPrivateData,proto3,oneof"` -} - -func (*DeliverResponse_Status) isDeliverResponse_Type() {} - -func (*DeliverResponse_Block) isDeliverResponse_Type() {} - -func (*DeliverResponse_FilteredBlock) isDeliverResponse_Type() {} - -func (*DeliverResponse_BlockAndPrivateData) isDeliverResponse_Type() {} - -func (m *DeliverResponse) GetType() isDeliverResponse_Type { - if m != nil { - return m.Type - } - return nil -} - -func (m *DeliverResponse) GetStatus() common.Status { - if x, ok := m.GetType().(*DeliverResponse_Status); ok { - return x.Status - } - return common.Status_UNKNOWN -} - -func (m *DeliverResponse) GetBlock() *common.Block { - if x, ok := m.GetType().(*DeliverResponse_Block); ok { - return x.Block - } - return nil -} - -func (m *DeliverResponse) GetFilteredBlock() *FilteredBlock { - if x, ok := m.GetType().(*DeliverResponse_FilteredBlock); ok { - return x.FilteredBlock - } - return nil -} - -func (m *DeliverResponse) GetBlockAndPrivateData() *BlockAndPrivateData { - if x, ok := m.GetType().(*DeliverResponse_BlockAndPrivateData); ok { - return x.BlockAndPrivateData - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*DeliverResponse) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*DeliverResponse_Status)(nil), - (*DeliverResponse_Block)(nil), - (*DeliverResponse_FilteredBlock)(nil), - (*DeliverResponse_BlockAndPrivateData)(nil), - } -} - -func init() { - proto.RegisterType((*FilteredBlock)(nil), "protos.FilteredBlock") - proto.RegisterType((*FilteredTransaction)(nil), "protos.FilteredTransaction") - proto.RegisterType((*FilteredTransactionActions)(nil), "protos.FilteredTransactionActions") - proto.RegisterType((*FilteredChaincodeAction)(nil), "protos.FilteredChaincodeAction") - proto.RegisterType((*BlockAndPrivateData)(nil), "protos.BlockAndPrivateData") - proto.RegisterMapType((map[uint64]*rwset.TxPvtReadWriteSet)(nil), "protos.BlockAndPrivateData.PrivateDataMapEntry") - proto.RegisterType((*DeliverResponse)(nil), "protos.DeliverResponse") -} - -func init() { proto.RegisterFile("peer/events.proto", fileDescriptor_5eedcc5fab2714e6) } - -var fileDescriptor_5eedcc5fab2714e6 = []byte{ - // 700 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0x4d, 0x6f, 0xda, 0x4a, - 0x14, 0xc5, 0x40, 0x78, 0xca, 0x45, 0x10, 0x32, 0xbc, 0x10, 0x8b, 0xe8, 0xe9, 0x45, 0x7e, 0x7a, - 0x15, 0x8b, 0xc6, 0x54, 0x74, 0x53, 0x65, 0xd1, 0x2a, 0xe4, 0x43, 0x44, 0x6a, 0x25, 0x34, 0xa1, - 0x8d, 0x9a, 0x2e, 0xac, 0xc1, 0xbe, 0x80, 0x1b, 0x63, 0x5b, 0xf6, 0x40, 0xe1, 0x9f, 0xf4, 0x87, - 0xf5, 0x97, 0x74, 0xd5, 0x55, 0x55, 0x79, 0xc6, 0xc3, 0x57, 0x48, 0xa4, 0x6c, 0xec, 0xf1, 0xbd, - 0xe7, 0x9c, 0x3b, 0xf7, 0xf8, 0xce, 0xc0, 0x7e, 0x88, 0x18, 0x35, 0x71, 0x8a, 0x3e, 0x8f, 0xcd, - 0x30, 0x0a, 0x78, 0x40, 0x0a, 0xe2, 0x15, 0xd7, 0xab, 0x76, 0x30, 0x1e, 0x07, 0x7e, 0x53, 0xbe, - 0x64, 0xb2, 0xae, 0x7b, 0xe8, 0x0c, 0x31, 0x6a, 0x46, 0xdf, 0x62, 0xe4, 0xf2, 0x99, 0x66, 0xea, - 0x42, 0xc9, 0x1e, 0x31, 0xd7, 0xb7, 0x03, 0x07, 0x2d, 0xa1, 0x99, 0xe6, 0x6a, 0x22, 0xc7, 0x23, - 0xe6, 0xc7, 0xcc, 0xe6, 0xae, 0x52, 0x33, 0xbe, 0x6b, 0x50, 0xba, 0x72, 0x3d, 0x8e, 0x11, 0x3a, - 0x6d, 0x2f, 0xb0, 0xef, 0xc9, 0x3f, 0x00, 0xf6, 0x88, 0xf9, 0x3e, 0x7a, 0x96, 0xeb, 0xe8, 0xda, - 0xb1, 0xd6, 0xd8, 0xa5, 0xbb, 0x69, 0xe4, 0xda, 0x21, 0x35, 0x28, 0xf8, 0x93, 0x71, 0x1f, 0x23, - 0x3d, 0x7b, 0xac, 0x35, 0xf2, 0x34, 0xfd, 0x22, 0x5d, 0x38, 0x18, 0xa4, 0x3a, 0xd6, 0x4a, 0x99, - 0x58, 0xcf, 0x1f, 0xe7, 0x1a, 0xc5, 0xd6, 0x91, 0xac, 0x17, 0x9b, 0xaa, 0x58, 0x6f, 0x89, 0xa1, - 0x7f, 0x0f, 0x1e, 0x06, 0x63, 0xe3, 0x97, 0x06, 0xd5, 0x2d, 0x68, 0x42, 0x20, 0xcf, 0x67, 0x8b, - 0xad, 0x89, 0x35, 0x79, 0x01, 0x79, 0x3e, 0x0f, 0x51, 0xec, 0xa9, 0xdc, 0x22, 0x66, 0xea, 0x58, - 0x07, 0x99, 0x83, 0x51, 0x6f, 0x1e, 0x22, 0x15, 0x79, 0x72, 0x05, 0x84, 0xcf, 0xac, 0x29, 0xf3, - 0x5c, 0x87, 0x25, 0x62, 0x56, 0x62, 0x94, 0x9e, 0x13, 0x2c, 0x5d, 0x6d, 0xb1, 0x37, 0xfb, 0xb4, - 0x00, 0x9c, 0x07, 0x0e, 0xd2, 0x0a, 0xdf, 0x88, 0x90, 0x8f, 0x50, 0x5d, 0x69, 0xd2, 0x5a, 0xf6, - 0xaa, 0x35, 0x8a, 0x2d, 0xe3, 0x89, 0x5e, 0xcf, 0x24, 0xb2, 0x93, 0xa1, 0x84, 0x3f, 0x88, 0xb6, - 0x0b, 0x90, 0xbf, 0x60, 0x9c, 0x19, 0x5f, 0xa1, 0xfe, 0x38, 0x97, 0xbc, 0x87, 0xfd, 0xe5, 0x4f, - 0x56, 0xa5, 0x35, 0x61, 0xf3, 0xbf, 0x9b, 0xa5, 0xcf, 0x15, 0x50, 0x92, 0x69, 0xc5, 0x5e, 0x0f, - 0xc4, 0xc6, 0x1d, 0x1c, 0x3e, 0x02, 0x26, 0xef, 0x60, 0x6f, 0x63, 0x9a, 0x84, 0xe9, 0xc5, 0x56, - 0x4d, 0x95, 0x59, 0x30, 0x2e, 0x93, 0x2c, 0x2d, 0xdb, 0x6b, 0xdf, 0xc6, 0x4f, 0x0d, 0xaa, 0x62, - 0xaa, 0xce, 0x7c, 0xa7, 0x1b, 0xb9, 0x53, 0xc6, 0x31, 0xe9, 0x8f, 0xfc, 0x07, 0x3b, 0xfd, 0x24, - 0x9c, 0xca, 0x95, 0xd4, 0xff, 0x12, 0x58, 0x2a, 0x73, 0xe4, 0x33, 0x54, 0x42, 0xc9, 0xb1, 0x1c, - 0xc6, 0x99, 0x35, 0x66, 0xa1, 0x9e, 0x15, 0x5d, 0x36, 0x55, 0xf9, 0x2d, 0xda, 0xe6, 0xca, 0xfa, - 0x03, 0x0b, 0x2f, 0x7d, 0x1e, 0xcd, 0x69, 0x39, 0x5c, 0x0b, 0xd6, 0xbf, 0x40, 0x75, 0x0b, 0x8c, - 0x54, 0x20, 0x77, 0x8f, 0x73, 0xb1, 0xa9, 0x3c, 0x4d, 0x96, 0xc4, 0x84, 0x9d, 0x29, 0xf3, 0x26, - 0x72, 0xb0, 0x8a, 0x2d, 0xdd, 0x94, 0xe7, 0xad, 0x37, 0xeb, 0x4e, 0x39, 0x45, 0xe6, 0xdc, 0x46, - 0x2e, 0xc7, 0x1b, 0xe4, 0x54, 0xc2, 0x4e, 0xb3, 0x6f, 0x34, 0xe3, 0xb7, 0x06, 0x7b, 0x17, 0xe8, - 0xb9, 0x53, 0x8c, 0x28, 0xc6, 0x61, 0xe0, 0xc7, 0x48, 0x1a, 0x50, 0x88, 0x39, 0xe3, 0x93, 0x58, - 0x88, 0x97, 0x5b, 0x65, 0xd5, 0xf1, 0x8d, 0x88, 0x76, 0x32, 0x34, 0xcd, 0x93, 0xff, 0x95, 0x35, - 0xd9, 0x2d, 0xd6, 0x74, 0x32, 0xca, 0x9c, 0xb7, 0x50, 0x5e, 0x1c, 0x37, 0x89, 0xcf, 0x09, 0xfc, - 0xc1, 0xe6, 0x00, 0x28, 0x5e, 0x69, 0xb0, 0x76, 0xca, 0x29, 0xd4, 0x04, 0xcd, 0x62, 0xbe, 0x63, - 0xad, 0xda, 0x9c, 0xce, 0xf0, 0xd1, 0x13, 0x16, 0x77, 0x32, 0xb4, 0xda, 0x7f, 0x18, 0x4e, 0xa6, - 0x37, 0x39, 0x6a, 0xad, 0x1f, 0x1a, 0xfc, 0x95, 0x1a, 0x40, 0x4e, 0x97, 0xcb, 0x8a, 0x6a, 0xe5, - 0xd2, 0x9f, 0xa2, 0x17, 0x84, 0x58, 0x3f, 0x54, 0x45, 0x36, 0xec, 0x32, 0x32, 0x0d, 0xed, 0x95, - 0x46, 0xda, 0x0b, 0x1f, 0x55, 0x33, 0xcf, 0xd7, 0xb8, 0x86, 0x5a, 0x9a, 0xb8, 0x75, 0xf9, 0x68, - 0x75, 0x06, 0x9f, 0x2b, 0xd5, 0x66, 0x60, 0x04, 0xd1, 0xd0, 0x1c, 0xcd, 0x43, 0x8c, 0xe4, 0x1d, - 0x6c, 0x0e, 0x58, 0x3f, 0x72, 0x6d, 0x45, 0x4b, 0xae, 0xd8, 0x76, 0x49, 0x4c, 0x7e, 0xdc, 0x65, - 0xf6, 0x3d, 0x1b, 0xe2, 0xdd, 0xcb, 0xa1, 0xcb, 0x47, 0x93, 0x7e, 0x52, 0xab, 0xb9, 0xc2, 0x6c, - 0x4a, 0xe6, 0x89, 0x64, 0x9e, 0x0c, 0x83, 0x66, 0x42, 0xee, 0xcb, 0x8b, 0xff, 0xf5, 0x9f, 0x00, - 0x00, 0x00, 0xff, 0xff, 0xe9, 0x5f, 0xb5, 0x2a, 0x14, 0x06, 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// DeliverClient is the client API for Deliver service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type DeliverClient interface { - // Deliver first requires an Envelope of type ab.DELIVER_SEEK_INFO with - // Payload data as a marshaled orderer.SeekInfo message, - // then a stream of block replies is received - Deliver(ctx context.Context, opts ...grpc.CallOption) (Deliver_DeliverClient, error) - // DeliverFiltered first requires an Envelope of type ab.DELIVER_SEEK_INFO with - // Payload data as a marshaled orderer.SeekInfo message, - // then a stream of **filtered** block replies is received - DeliverFiltered(ctx context.Context, opts ...grpc.CallOption) (Deliver_DeliverFilteredClient, error) - // DeliverWithPrivateData first requires an Envelope of type ab.DELIVER_SEEK_INFO with - // Payload data as a marshaled orderer.SeekInfo message, - // then a stream of block and private data replies is received - DeliverWithPrivateData(ctx context.Context, opts ...grpc.CallOption) (Deliver_DeliverWithPrivateDataClient, error) -} - -type deliverClient struct { - cc *grpc.ClientConn -} - -func NewDeliverClient(cc *grpc.ClientConn) DeliverClient { - return &deliverClient{cc} -} - -func (c *deliverClient) Deliver(ctx context.Context, opts ...grpc.CallOption) (Deliver_DeliverClient, error) { - stream, err := c.cc.NewStream(ctx, &_Deliver_serviceDesc.Streams[0], "/protos.Deliver/Deliver", opts...) - if err != nil { - return nil, err - } - x := &deliverDeliverClient{stream} - return x, nil -} - -type Deliver_DeliverClient interface { - Send(*common.Envelope) error - Recv() (*DeliverResponse, error) - grpc.ClientStream -} - -type deliverDeliverClient struct { - grpc.ClientStream -} - -func (x *deliverDeliverClient) Send(m *common.Envelope) error { - return x.ClientStream.SendMsg(m) -} - -func (x *deliverDeliverClient) Recv() (*DeliverResponse, error) { - m := new(DeliverResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *deliverClient) DeliverFiltered(ctx context.Context, opts ...grpc.CallOption) (Deliver_DeliverFilteredClient, error) { - stream, err := c.cc.NewStream(ctx, &_Deliver_serviceDesc.Streams[1], "/protos.Deliver/DeliverFiltered", opts...) - if err != nil { - return nil, err - } - x := &deliverDeliverFilteredClient{stream} - return x, nil -} - -type Deliver_DeliverFilteredClient interface { - Send(*common.Envelope) error - Recv() (*DeliverResponse, error) - grpc.ClientStream -} - -type deliverDeliverFilteredClient struct { - grpc.ClientStream -} - -func (x *deliverDeliverFilteredClient) Send(m *common.Envelope) error { - return x.ClientStream.SendMsg(m) -} - -func (x *deliverDeliverFilteredClient) Recv() (*DeliverResponse, error) { - m := new(DeliverResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *deliverClient) DeliverWithPrivateData(ctx context.Context, opts ...grpc.CallOption) (Deliver_DeliverWithPrivateDataClient, error) { - stream, err := c.cc.NewStream(ctx, &_Deliver_serviceDesc.Streams[2], "/protos.Deliver/DeliverWithPrivateData", opts...) - if err != nil { - return nil, err - } - x := &deliverDeliverWithPrivateDataClient{stream} - return x, nil -} - -type Deliver_DeliverWithPrivateDataClient interface { - Send(*common.Envelope) error - Recv() (*DeliverResponse, error) - grpc.ClientStream -} - -type deliverDeliverWithPrivateDataClient struct { - grpc.ClientStream -} - -func (x *deliverDeliverWithPrivateDataClient) Send(m *common.Envelope) error { - return x.ClientStream.SendMsg(m) -} - -func (x *deliverDeliverWithPrivateDataClient) Recv() (*DeliverResponse, error) { - m := new(DeliverResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -// DeliverServer is the server API for Deliver service. -type DeliverServer interface { - // Deliver first requires an Envelope of type ab.DELIVER_SEEK_INFO with - // Payload data as a marshaled orderer.SeekInfo message, - // then a stream of block replies is received - Deliver(Deliver_DeliverServer) error - // DeliverFiltered first requires an Envelope of type ab.DELIVER_SEEK_INFO with - // Payload data as a marshaled orderer.SeekInfo message, - // then a stream of **filtered** block replies is received - DeliverFiltered(Deliver_DeliverFilteredServer) error - // DeliverWithPrivateData first requires an Envelope of type ab.DELIVER_SEEK_INFO with - // Payload data as a marshaled orderer.SeekInfo message, - // then a stream of block and private data replies is received - DeliverWithPrivateData(Deliver_DeliverWithPrivateDataServer) error -} - -// UnimplementedDeliverServer can be embedded to have forward compatible implementations. -type UnimplementedDeliverServer struct { -} - -func (*UnimplementedDeliverServer) Deliver(srv Deliver_DeliverServer) error { - return status.Errorf(codes.Unimplemented, "method Deliver not implemented") -} -func (*UnimplementedDeliverServer) DeliverFiltered(srv Deliver_DeliverFilteredServer) error { - return status.Errorf(codes.Unimplemented, "method DeliverFiltered not implemented") -} -func (*UnimplementedDeliverServer) DeliverWithPrivateData(srv Deliver_DeliverWithPrivateDataServer) error { - return status.Errorf(codes.Unimplemented, "method DeliverWithPrivateData not implemented") -} - -func RegisterDeliverServer(s *grpc.Server, srv DeliverServer) { - s.RegisterService(&_Deliver_serviceDesc, srv) -} - -func _Deliver_Deliver_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(DeliverServer).Deliver(&deliverDeliverServer{stream}) -} - -type Deliver_DeliverServer interface { - Send(*DeliverResponse) error - Recv() (*common.Envelope, error) - grpc.ServerStream -} - -type deliverDeliverServer struct { - grpc.ServerStream -} - -func (x *deliverDeliverServer) Send(m *DeliverResponse) error { - return x.ServerStream.SendMsg(m) -} - -func (x *deliverDeliverServer) Recv() (*common.Envelope, error) { - m := new(common.Envelope) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func _Deliver_DeliverFiltered_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(DeliverServer).DeliverFiltered(&deliverDeliverFilteredServer{stream}) -} - -type Deliver_DeliverFilteredServer interface { - Send(*DeliverResponse) error - Recv() (*common.Envelope, error) - grpc.ServerStream -} - -type deliverDeliverFilteredServer struct { - grpc.ServerStream -} - -func (x *deliverDeliverFilteredServer) Send(m *DeliverResponse) error { - return x.ServerStream.SendMsg(m) -} - -func (x *deliverDeliverFilteredServer) Recv() (*common.Envelope, error) { - m := new(common.Envelope) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func _Deliver_DeliverWithPrivateData_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(DeliverServer).DeliverWithPrivateData(&deliverDeliverWithPrivateDataServer{stream}) -} - -type Deliver_DeliverWithPrivateDataServer interface { - Send(*DeliverResponse) error - Recv() (*common.Envelope, error) - grpc.ServerStream -} - -type deliverDeliverWithPrivateDataServer struct { - grpc.ServerStream -} - -func (x *deliverDeliverWithPrivateDataServer) Send(m *DeliverResponse) error { - return x.ServerStream.SendMsg(m) -} - -func (x *deliverDeliverWithPrivateDataServer) Recv() (*common.Envelope, error) { - m := new(common.Envelope) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -var _Deliver_serviceDesc = grpc.ServiceDesc{ - ServiceName: "protos.Deliver", - HandlerType: (*DeliverServer)(nil), - Methods: []grpc.MethodDesc{}, - Streams: []grpc.StreamDesc{ - { - StreamName: "Deliver", - Handler: _Deliver_Deliver_Handler, - ServerStreams: true, - ClientStreams: true, - }, - { - StreamName: "DeliverFiltered", - Handler: _Deliver_DeliverFiltered_Handler, - ServerStreams: true, - ClientStreams: true, - }, - { - StreamName: "DeliverWithPrivateData", - Handler: _Deliver_DeliverWithPrivateData_Handler, - ServerStreams: true, - ClientStreams: true, - }, - }, - Metadata: "peer/events.proto", -} diff --git a/vendor/github.com/hyperledger/fabric-protos-go/peer/lifecycle/chaincode_definition.pb.go b/vendor/github.com/hyperledger/fabric-protos-go/peer/lifecycle/chaincode_definition.pb.go deleted file mode 100644 index c2020261832..00000000000 --- a/vendor/github.com/hyperledger/fabric-protos-go/peer/lifecycle/chaincode_definition.pb.go +++ /dev/null @@ -1,158 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: peer/lifecycle/chaincode_definition.proto - -package lifecycle - -import ( - fmt "fmt" - proto "github.com/golang/protobuf/proto" - math "math" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package - -// ChaincodeEndorsementInfo is (most) everything the peer needs to know in order -// to execute a chaincode -type ChaincodeEndorsementInfo struct { - Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` - InitRequired bool `protobuf:"varint,2,opt,name=init_required,json=initRequired,proto3" json:"init_required,omitempty"` - EndorsementPlugin string `protobuf:"bytes,3,opt,name=endorsement_plugin,json=endorsementPlugin,proto3" json:"endorsement_plugin,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ChaincodeEndorsementInfo) Reset() { *m = ChaincodeEndorsementInfo{} } -func (m *ChaincodeEndorsementInfo) String() string { return proto.CompactTextString(m) } -func (*ChaincodeEndorsementInfo) ProtoMessage() {} -func (*ChaincodeEndorsementInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_f0faa93bbd697c66, []int{0} -} - -func (m *ChaincodeEndorsementInfo) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ChaincodeEndorsementInfo.Unmarshal(m, b) -} -func (m *ChaincodeEndorsementInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ChaincodeEndorsementInfo.Marshal(b, m, deterministic) -} -func (m *ChaincodeEndorsementInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_ChaincodeEndorsementInfo.Merge(m, src) -} -func (m *ChaincodeEndorsementInfo) XXX_Size() int { - return xxx_messageInfo_ChaincodeEndorsementInfo.Size(m) -} -func (m *ChaincodeEndorsementInfo) XXX_DiscardUnknown() { - xxx_messageInfo_ChaincodeEndorsementInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_ChaincodeEndorsementInfo proto.InternalMessageInfo - -func (m *ChaincodeEndorsementInfo) GetVersion() string { - if m != nil { - return m.Version - } - return "" -} - -func (m *ChaincodeEndorsementInfo) GetInitRequired() bool { - if m != nil { - return m.InitRequired - } - return false -} - -func (m *ChaincodeEndorsementInfo) GetEndorsementPlugin() string { - if m != nil { - return m.EndorsementPlugin - } - return "" -} - -// ValidationInfo is (most) everything the peer needs to know in order -// to validate a transaction -type ChaincodeValidationInfo struct { - ValidationPlugin string `protobuf:"bytes,1,opt,name=validation_plugin,json=validationPlugin,proto3" json:"validation_plugin,omitempty"` - ValidationParameter []byte `protobuf:"bytes,2,opt,name=validation_parameter,json=validationParameter,proto3" json:"validation_parameter,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ChaincodeValidationInfo) Reset() { *m = ChaincodeValidationInfo{} } -func (m *ChaincodeValidationInfo) String() string { return proto.CompactTextString(m) } -func (*ChaincodeValidationInfo) ProtoMessage() {} -func (*ChaincodeValidationInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_f0faa93bbd697c66, []int{1} -} - -func (m *ChaincodeValidationInfo) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ChaincodeValidationInfo.Unmarshal(m, b) -} -func (m *ChaincodeValidationInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ChaincodeValidationInfo.Marshal(b, m, deterministic) -} -func (m *ChaincodeValidationInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_ChaincodeValidationInfo.Merge(m, src) -} -func (m *ChaincodeValidationInfo) XXX_Size() int { - return xxx_messageInfo_ChaincodeValidationInfo.Size(m) -} -func (m *ChaincodeValidationInfo) XXX_DiscardUnknown() { - xxx_messageInfo_ChaincodeValidationInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_ChaincodeValidationInfo proto.InternalMessageInfo - -func (m *ChaincodeValidationInfo) GetValidationPlugin() string { - if m != nil { - return m.ValidationPlugin - } - return "" -} - -func (m *ChaincodeValidationInfo) GetValidationParameter() []byte { - if m != nil { - return m.ValidationParameter - } - return nil -} - -func init() { - proto.RegisterType((*ChaincodeEndorsementInfo)(nil), "lifecycle.ChaincodeEndorsementInfo") - proto.RegisterType((*ChaincodeValidationInfo)(nil), "lifecycle.ChaincodeValidationInfo") -} - -func init() { - proto.RegisterFile("peer/lifecycle/chaincode_definition.proto", fileDescriptor_f0faa93bbd697c66) -} - -var fileDescriptor_f0faa93bbd697c66 = []byte{ - // 275 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x91, 0x4f, 0x4b, 0xb5, 0x40, - 0x14, 0xc6, 0xf1, 0x7d, 0xa1, 0xba, 0xc3, 0x0d, 0xba, 0x53, 0x90, 0xcb, 0xcb, 0x6d, 0x73, 0xa3, - 0x1c, 0x89, 0xa0, 0x0f, 0x50, 0xb4, 0x68, 0x17, 0x2e, 0x5a, 0xb4, 0x91, 0x71, 0xe6, 0xa8, 0x07, - 0x74, 0x8e, 0x1d, 0xf5, 0x82, 0xdf, 0xa0, 0x8f, 0x1d, 0x6a, 0x7a, 0x6d, 0x39, 0xe7, 0xf9, 0xc3, - 0x8f, 0x67, 0xc4, 0x6d, 0x05, 0xc0, 0x61, 0x81, 0x29, 0x98, 0xce, 0x14, 0x10, 0x9a, 0x5c, 0xa3, - 0x33, 0x64, 0x21, 0xb6, 0x90, 0xa2, 0xc3, 0x06, 0xc9, 0xa9, 0x8a, 0xa9, 0x21, 0xb9, 0x9a, 0x5d, - 0xbb, 0x6f, 0x4f, 0xf8, 0x2f, 0x93, 0xf3, 0xd5, 0x59, 0xe2, 0x1a, 0x4a, 0x70, 0xcd, 0x9b, 0x4b, - 0x49, 0xfa, 0xe2, 0xf4, 0x00, 0x5c, 0x23, 0x39, 0xdf, 0xdb, 0x7a, 0xfb, 0x55, 0x34, 0x3d, 0xe5, - 0x8d, 0x38, 0xef, 0x2b, 0x63, 0x86, 0xaf, 0x16, 0x19, 0xac, 0xff, 0x6f, 0xeb, 0xed, 0xcf, 0xa2, - 0x75, 0x7f, 0x8c, 0x7e, 0x6f, 0x32, 0x10, 0x12, 0x8e, 0x8d, 0x71, 0x55, 0xb4, 0x19, 0x3a, 0xff, - 0xff, 0xd0, 0xb4, 0x59, 0x28, 0xef, 0x83, 0xb0, 0xeb, 0xc4, 0xf5, 0x4c, 0xf2, 0xa1, 0x0b, 0xb4, - 0xba, 0x47, 0x1e, 0x40, 0xee, 0xc4, 0xe6, 0x30, 0x5f, 0xa6, 0xa2, 0x11, 0xe9, 0xe2, 0x28, 0x8c, - 0x3d, 0xf2, 0x41, 0x5c, 0x2d, 0xcd, 0x9a, 0x75, 0x09, 0x0d, 0xf0, 0x80, 0xb8, 0x8e, 0x2e, 0x17, - 0xfe, 0x49, 0x7a, 0x4e, 0xc5, 0x3d, 0x71, 0xa6, 0xf2, 0xae, 0x02, 0x2e, 0xc0, 0x66, 0xc0, 0x2a, - 0xd5, 0x09, 0xa3, 0x19, 0x07, 0xab, 0x55, 0xbf, 0xad, 0x9a, 0x57, 0xfb, 0x7c, 0xca, 0xb0, 0xc9, - 0xdb, 0x44, 0x19, 0x2a, 0xc3, 0x45, 0x28, 0x1c, 0x43, 0xc1, 0x18, 0x0a, 0x32, 0x0a, 0xff, 0xfe, - 0x49, 0x72, 0x32, 0x28, 0x8f, 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xd6, 0x94, 0x68, 0xee, 0xac, - 0x01, 0x00, 0x00, -} diff --git a/vendor/github.com/hyperledger/fabric-protos-go/peer/lifecycle/db.pb.go b/vendor/github.com/hyperledger/fabric-protos-go/peer/lifecycle/db.pb.go deleted file mode 100644 index dd036199943..00000000000 --- a/vendor/github.com/hyperledger/fabric-protos-go/peer/lifecycle/db.pb.go +++ /dev/null @@ -1,194 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: peer/lifecycle/db.proto - -package lifecycle - -import ( - fmt "fmt" - proto "github.com/golang/protobuf/proto" - math "math" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package - -// StateMetadata describes the keys in a namespace. It is necessary because -// in collections, range scans are not possible during transactions which -// write. Therefore we must track the keys in our namespace ourselves. -type StateMetadata struct { - Datatype string `protobuf:"bytes,1,opt,name=datatype,proto3" json:"datatype,omitempty"` - Fields []string `protobuf:"bytes,2,rep,name=fields,proto3" json:"fields,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *StateMetadata) Reset() { *m = StateMetadata{} } -func (m *StateMetadata) String() string { return proto.CompactTextString(m) } -func (*StateMetadata) ProtoMessage() {} -func (*StateMetadata) Descriptor() ([]byte, []int) { - return fileDescriptor_389b29a8aaf0aebb, []int{0} -} - -func (m *StateMetadata) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_StateMetadata.Unmarshal(m, b) -} -func (m *StateMetadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_StateMetadata.Marshal(b, m, deterministic) -} -func (m *StateMetadata) XXX_Merge(src proto.Message) { - xxx_messageInfo_StateMetadata.Merge(m, src) -} -func (m *StateMetadata) XXX_Size() int { - return xxx_messageInfo_StateMetadata.Size(m) -} -func (m *StateMetadata) XXX_DiscardUnknown() { - xxx_messageInfo_StateMetadata.DiscardUnknown(m) -} - -var xxx_messageInfo_StateMetadata proto.InternalMessageInfo - -func (m *StateMetadata) GetDatatype() string { - if m != nil { - return m.Datatype - } - return "" -} - -func (m *StateMetadata) GetFields() []string { - if m != nil { - return m.Fields - } - return nil -} - -// StateData encodes a particular field of a datatype -type StateData struct { - // Types that are valid to be assigned to Type: - // - // *StateData_Int64 - // *StateData_Bytes - // *StateData_String_ - Type isStateData_Type `protobuf_oneof:"Type"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *StateData) Reset() { *m = StateData{} } -func (m *StateData) String() string { return proto.CompactTextString(m) } -func (*StateData) ProtoMessage() {} -func (*StateData) Descriptor() ([]byte, []int) { - return fileDescriptor_389b29a8aaf0aebb, []int{1} -} - -func (m *StateData) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_StateData.Unmarshal(m, b) -} -func (m *StateData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_StateData.Marshal(b, m, deterministic) -} -func (m *StateData) XXX_Merge(src proto.Message) { - xxx_messageInfo_StateData.Merge(m, src) -} -func (m *StateData) XXX_Size() int { - return xxx_messageInfo_StateData.Size(m) -} -func (m *StateData) XXX_DiscardUnknown() { - xxx_messageInfo_StateData.DiscardUnknown(m) -} - -var xxx_messageInfo_StateData proto.InternalMessageInfo - -type isStateData_Type interface { - isStateData_Type() -} - -type StateData_Int64 struct { - Int64 int64 `protobuf:"varint,1,opt,name=Int64,proto3,oneof"` -} - -type StateData_Bytes struct { - Bytes []byte `protobuf:"bytes,2,opt,name=Bytes,proto3,oneof"` -} - -type StateData_String_ struct { - String_ string `protobuf:"bytes,3,opt,name=String,proto3,oneof"` -} - -func (*StateData_Int64) isStateData_Type() {} - -func (*StateData_Bytes) isStateData_Type() {} - -func (*StateData_String_) isStateData_Type() {} - -func (m *StateData) GetType() isStateData_Type { - if m != nil { - return m.Type - } - return nil -} - -func (m *StateData) GetInt64() int64 { - if x, ok := m.GetType().(*StateData_Int64); ok { - return x.Int64 - } - return 0 -} - -func (m *StateData) GetBytes() []byte { - if x, ok := m.GetType().(*StateData_Bytes); ok { - return x.Bytes - } - return nil -} - -func (m *StateData) GetString_() string { - if x, ok := m.GetType().(*StateData_String_); ok { - return x.String_ - } - return "" -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*StateData) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*StateData_Int64)(nil), - (*StateData_Bytes)(nil), - (*StateData_String_)(nil), - } -} - -func init() { - proto.RegisterType((*StateMetadata)(nil), "lifecycle.StateMetadata") - proto.RegisterType((*StateData)(nil), "lifecycle.StateData") -} - -func init() { proto.RegisterFile("peer/lifecycle/db.proto", fileDescriptor_389b29a8aaf0aebb) } - -var fileDescriptor_389b29a8aaf0aebb = []byte{ - // 235 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x90, 0xb1, 0x4e, 0xc3, 0x30, - 0x14, 0x45, 0x1b, 0x02, 0x11, 0x79, 0x82, 0x25, 0x43, 0x89, 0x98, 0xaa, 0x4e, 0x19, 0xa8, 0x3d, - 0x80, 0xfa, 0x01, 0x81, 0xa1, 0x0c, 0x2c, 0x29, 0x13, 0x12, 0x83, 0x93, 0xbc, 0xb8, 0x96, 0x4c, - 0x6d, 0xb9, 0x8f, 0xc1, 0x7f, 0x8f, 0x6c, 0x57, 0x11, 0x9d, 0xac, 0x73, 0xad, 0x73, 0xad, 0x6b, - 0x78, 0xb0, 0x88, 0x8e, 0x6b, 0x35, 0xe1, 0xe0, 0x07, 0x8d, 0x7c, 0xec, 0x99, 0x75, 0x86, 0x4c, - 0x55, 0xce, 0xd9, 0xfa, 0x15, 0xee, 0xf7, 0x24, 0x08, 0x3f, 0x90, 0xc4, 0x28, 0x48, 0x54, 0x8f, - 0x70, 0x1b, 0x4e, 0xf2, 0x16, 0xeb, 0x6c, 0x95, 0x35, 0x65, 0x37, 0x73, 0xb5, 0x84, 0x62, 0x52, - 0xa8, 0xc7, 0x53, 0x7d, 0xb5, 0xca, 0x9b, 0xb2, 0x3b, 0xd3, 0xfa, 0x1b, 0xca, 0x58, 0xf2, 0x16, - 0x0a, 0x96, 0x70, 0xf3, 0x7e, 0xa4, 0xed, 0x4b, 0xb4, 0xf3, 0xdd, 0xa2, 0x4b, 0x18, 0xf2, 0xd6, - 0x13, 0x06, 0x37, 0x6b, 0xee, 0x42, 0x1e, 0xb1, 0xaa, 0xa1, 0xd8, 0x93, 0x53, 0x47, 0x59, 0xe7, - 0xe1, 0xb9, 0xdd, 0xa2, 0x3b, 0x73, 0x5b, 0xc0, 0xf5, 0xa7, 0xb7, 0xd8, 0x4e, 0xf0, 0x64, 0x9c, - 0x64, 0x07, 0x6f, 0xd1, 0x69, 0x1c, 0x25, 0x3a, 0x36, 0x89, 0xde, 0xa9, 0x21, 0xcd, 0x39, 0xb1, - 0xb0, 0x93, 0xcd, 0x9b, 0xbe, 0xb6, 0x52, 0xd1, 0xe1, 0xb7, 0x67, 0x83, 0xf9, 0xe1, 0xff, 0x24, - 0x9e, 0xa4, 0x4d, 0x92, 0x36, 0xd2, 0xf0, 0xcb, 0xff, 0xe9, 0x8b, 0x78, 0xf3, 0xfc, 0x17, 0x00, - 0x00, 0xff, 0xff, 0xc6, 0xbc, 0x63, 0x86, 0x38, 0x01, 0x00, 0x00, -} diff --git a/vendor/github.com/hyperledger/fabric-protos-go/peer/lifecycle/lifecycle.pb.go b/vendor/github.com/hyperledger/fabric-protos-go/peer/lifecycle/lifecycle.pb.go deleted file mode 100644 index b2717fa5614..00000000000 --- a/vendor/github.com/hyperledger/fabric-protos-go/peer/lifecycle/lifecycle.pb.go +++ /dev/null @@ -1,1984 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: peer/lifecycle/lifecycle.proto - -package lifecycle - -import ( - fmt "fmt" - proto "github.com/golang/protobuf/proto" - peer "github.com/hyperledger/fabric-protos-go/peer" - math "math" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package - -// InstallChaincodeArgs is the message used as the argument to -// '_lifecycle.InstallChaincode'. -type InstallChaincodeArgs struct { - ChaincodeInstallPackage []byte `protobuf:"bytes,1,opt,name=chaincode_install_package,json=chaincodeInstallPackage,proto3" json:"chaincode_install_package,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *InstallChaincodeArgs) Reset() { *m = InstallChaincodeArgs{} } -func (m *InstallChaincodeArgs) String() string { return proto.CompactTextString(m) } -func (*InstallChaincodeArgs) ProtoMessage() {} -func (*InstallChaincodeArgs) Descriptor() ([]byte, []int) { - return fileDescriptor_6625a5b20951add3, []int{0} -} - -func (m *InstallChaincodeArgs) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_InstallChaincodeArgs.Unmarshal(m, b) -} -func (m *InstallChaincodeArgs) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_InstallChaincodeArgs.Marshal(b, m, deterministic) -} -func (m *InstallChaincodeArgs) XXX_Merge(src proto.Message) { - xxx_messageInfo_InstallChaincodeArgs.Merge(m, src) -} -func (m *InstallChaincodeArgs) XXX_Size() int { - return xxx_messageInfo_InstallChaincodeArgs.Size(m) -} -func (m *InstallChaincodeArgs) XXX_DiscardUnknown() { - xxx_messageInfo_InstallChaincodeArgs.DiscardUnknown(m) -} - -var xxx_messageInfo_InstallChaincodeArgs proto.InternalMessageInfo - -func (m *InstallChaincodeArgs) GetChaincodeInstallPackage() []byte { - if m != nil { - return m.ChaincodeInstallPackage - } - return nil -} - -// InstallChaincodeArgs is the message returned by -// '_lifecycle.InstallChaincode'. -type InstallChaincodeResult struct { - PackageId string `protobuf:"bytes,1,opt,name=package_id,json=packageId,proto3" json:"package_id,omitempty"` - Label string `protobuf:"bytes,2,opt,name=label,proto3" json:"label,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *InstallChaincodeResult) Reset() { *m = InstallChaincodeResult{} } -func (m *InstallChaincodeResult) String() string { return proto.CompactTextString(m) } -func (*InstallChaincodeResult) ProtoMessage() {} -func (*InstallChaincodeResult) Descriptor() ([]byte, []int) { - return fileDescriptor_6625a5b20951add3, []int{1} -} - -func (m *InstallChaincodeResult) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_InstallChaincodeResult.Unmarshal(m, b) -} -func (m *InstallChaincodeResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_InstallChaincodeResult.Marshal(b, m, deterministic) -} -func (m *InstallChaincodeResult) XXX_Merge(src proto.Message) { - xxx_messageInfo_InstallChaincodeResult.Merge(m, src) -} -func (m *InstallChaincodeResult) XXX_Size() int { - return xxx_messageInfo_InstallChaincodeResult.Size(m) -} -func (m *InstallChaincodeResult) XXX_DiscardUnknown() { - xxx_messageInfo_InstallChaincodeResult.DiscardUnknown(m) -} - -var xxx_messageInfo_InstallChaincodeResult proto.InternalMessageInfo - -func (m *InstallChaincodeResult) GetPackageId() string { - if m != nil { - return m.PackageId - } - return "" -} - -func (m *InstallChaincodeResult) GetLabel() string { - if m != nil { - return m.Label - } - return "" -} - -// QueryInstalledChaincodeArgs is the message used as arguments -// '_lifecycle.QueryInstalledChaincode' -type QueryInstalledChaincodeArgs struct { - PackageId string `protobuf:"bytes,1,opt,name=package_id,json=packageId,proto3" json:"package_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *QueryInstalledChaincodeArgs) Reset() { *m = QueryInstalledChaincodeArgs{} } -func (m *QueryInstalledChaincodeArgs) String() string { return proto.CompactTextString(m) } -func (*QueryInstalledChaincodeArgs) ProtoMessage() {} -func (*QueryInstalledChaincodeArgs) Descriptor() ([]byte, []int) { - return fileDescriptor_6625a5b20951add3, []int{2} -} - -func (m *QueryInstalledChaincodeArgs) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_QueryInstalledChaincodeArgs.Unmarshal(m, b) -} -func (m *QueryInstalledChaincodeArgs) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_QueryInstalledChaincodeArgs.Marshal(b, m, deterministic) -} -func (m *QueryInstalledChaincodeArgs) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryInstalledChaincodeArgs.Merge(m, src) -} -func (m *QueryInstalledChaincodeArgs) XXX_Size() int { - return xxx_messageInfo_QueryInstalledChaincodeArgs.Size(m) -} -func (m *QueryInstalledChaincodeArgs) XXX_DiscardUnknown() { - xxx_messageInfo_QueryInstalledChaincodeArgs.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryInstalledChaincodeArgs proto.InternalMessageInfo - -func (m *QueryInstalledChaincodeArgs) GetPackageId() string { - if m != nil { - return m.PackageId - } - return "" -} - -// QueryInstalledChaincodeResult is the message returned by -// '_lifecycle.QueryInstalledChaincode' -type QueryInstalledChaincodeResult struct { - PackageId string `protobuf:"bytes,1,opt,name=package_id,json=packageId,proto3" json:"package_id,omitempty"` - Label string `protobuf:"bytes,2,opt,name=label,proto3" json:"label,omitempty"` - References map[string]*QueryInstalledChaincodeResult_References `protobuf:"bytes,3,rep,name=references,proto3" json:"references,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *QueryInstalledChaincodeResult) Reset() { *m = QueryInstalledChaincodeResult{} } -func (m *QueryInstalledChaincodeResult) String() string { return proto.CompactTextString(m) } -func (*QueryInstalledChaincodeResult) ProtoMessage() {} -func (*QueryInstalledChaincodeResult) Descriptor() ([]byte, []int) { - return fileDescriptor_6625a5b20951add3, []int{3} -} - -func (m *QueryInstalledChaincodeResult) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_QueryInstalledChaincodeResult.Unmarshal(m, b) -} -func (m *QueryInstalledChaincodeResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_QueryInstalledChaincodeResult.Marshal(b, m, deterministic) -} -func (m *QueryInstalledChaincodeResult) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryInstalledChaincodeResult.Merge(m, src) -} -func (m *QueryInstalledChaincodeResult) XXX_Size() int { - return xxx_messageInfo_QueryInstalledChaincodeResult.Size(m) -} -func (m *QueryInstalledChaincodeResult) XXX_DiscardUnknown() { - xxx_messageInfo_QueryInstalledChaincodeResult.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryInstalledChaincodeResult proto.InternalMessageInfo - -func (m *QueryInstalledChaincodeResult) GetPackageId() string { - if m != nil { - return m.PackageId - } - return "" -} - -func (m *QueryInstalledChaincodeResult) GetLabel() string { - if m != nil { - return m.Label - } - return "" -} - -func (m *QueryInstalledChaincodeResult) GetReferences() map[string]*QueryInstalledChaincodeResult_References { - if m != nil { - return m.References - } - return nil -} - -type QueryInstalledChaincodeResult_References struct { - Chaincodes []*QueryInstalledChaincodeResult_Chaincode `protobuf:"bytes,1,rep,name=chaincodes,proto3" json:"chaincodes,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *QueryInstalledChaincodeResult_References) Reset() { - *m = QueryInstalledChaincodeResult_References{} -} -func (m *QueryInstalledChaincodeResult_References) String() string { return proto.CompactTextString(m) } -func (*QueryInstalledChaincodeResult_References) ProtoMessage() {} -func (*QueryInstalledChaincodeResult_References) Descriptor() ([]byte, []int) { - return fileDescriptor_6625a5b20951add3, []int{3, 1} -} - -func (m *QueryInstalledChaincodeResult_References) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_QueryInstalledChaincodeResult_References.Unmarshal(m, b) -} -func (m *QueryInstalledChaincodeResult_References) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_QueryInstalledChaincodeResult_References.Marshal(b, m, deterministic) -} -func (m *QueryInstalledChaincodeResult_References) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryInstalledChaincodeResult_References.Merge(m, src) -} -func (m *QueryInstalledChaincodeResult_References) XXX_Size() int { - return xxx_messageInfo_QueryInstalledChaincodeResult_References.Size(m) -} -func (m *QueryInstalledChaincodeResult_References) XXX_DiscardUnknown() { - xxx_messageInfo_QueryInstalledChaincodeResult_References.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryInstalledChaincodeResult_References proto.InternalMessageInfo - -func (m *QueryInstalledChaincodeResult_References) GetChaincodes() []*QueryInstalledChaincodeResult_Chaincode { - if m != nil { - return m.Chaincodes - } - return nil -} - -type QueryInstalledChaincodeResult_Chaincode struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *QueryInstalledChaincodeResult_Chaincode) Reset() { - *m = QueryInstalledChaincodeResult_Chaincode{} -} -func (m *QueryInstalledChaincodeResult_Chaincode) String() string { return proto.CompactTextString(m) } -func (*QueryInstalledChaincodeResult_Chaincode) ProtoMessage() {} -func (*QueryInstalledChaincodeResult_Chaincode) Descriptor() ([]byte, []int) { - return fileDescriptor_6625a5b20951add3, []int{3, 2} -} - -func (m *QueryInstalledChaincodeResult_Chaincode) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_QueryInstalledChaincodeResult_Chaincode.Unmarshal(m, b) -} -func (m *QueryInstalledChaincodeResult_Chaincode) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_QueryInstalledChaincodeResult_Chaincode.Marshal(b, m, deterministic) -} -func (m *QueryInstalledChaincodeResult_Chaincode) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryInstalledChaincodeResult_Chaincode.Merge(m, src) -} -func (m *QueryInstalledChaincodeResult_Chaincode) XXX_Size() int { - return xxx_messageInfo_QueryInstalledChaincodeResult_Chaincode.Size(m) -} -func (m *QueryInstalledChaincodeResult_Chaincode) XXX_DiscardUnknown() { - xxx_messageInfo_QueryInstalledChaincodeResult_Chaincode.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryInstalledChaincodeResult_Chaincode proto.InternalMessageInfo - -func (m *QueryInstalledChaincodeResult_Chaincode) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *QueryInstalledChaincodeResult_Chaincode) GetVersion() string { - if m != nil { - return m.Version - } - return "" -} - -// GetInstalledChaincodePackageArgs is the message used as the argument to -// '_lifecycle.GetInstalledChaincodePackage'. -type GetInstalledChaincodePackageArgs struct { - PackageId string `protobuf:"bytes,1,opt,name=package_id,json=packageId,proto3" json:"package_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetInstalledChaincodePackageArgs) Reset() { *m = GetInstalledChaincodePackageArgs{} } -func (m *GetInstalledChaincodePackageArgs) String() string { return proto.CompactTextString(m) } -func (*GetInstalledChaincodePackageArgs) ProtoMessage() {} -func (*GetInstalledChaincodePackageArgs) Descriptor() ([]byte, []int) { - return fileDescriptor_6625a5b20951add3, []int{4} -} - -func (m *GetInstalledChaincodePackageArgs) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetInstalledChaincodePackageArgs.Unmarshal(m, b) -} -func (m *GetInstalledChaincodePackageArgs) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetInstalledChaincodePackageArgs.Marshal(b, m, deterministic) -} -func (m *GetInstalledChaincodePackageArgs) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetInstalledChaincodePackageArgs.Merge(m, src) -} -func (m *GetInstalledChaincodePackageArgs) XXX_Size() int { - return xxx_messageInfo_GetInstalledChaincodePackageArgs.Size(m) -} -func (m *GetInstalledChaincodePackageArgs) XXX_DiscardUnknown() { - xxx_messageInfo_GetInstalledChaincodePackageArgs.DiscardUnknown(m) -} - -var xxx_messageInfo_GetInstalledChaincodePackageArgs proto.InternalMessageInfo - -func (m *GetInstalledChaincodePackageArgs) GetPackageId() string { - if m != nil { - return m.PackageId - } - return "" -} - -// GetInstalledChaincodePackageResult is the message returned by -// '_lifecycle.GetInstalledChaincodePackage'. -type GetInstalledChaincodePackageResult struct { - ChaincodeInstallPackage []byte `protobuf:"bytes,1,opt,name=chaincode_install_package,json=chaincodeInstallPackage,proto3" json:"chaincode_install_package,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *GetInstalledChaincodePackageResult) Reset() { *m = GetInstalledChaincodePackageResult{} } -func (m *GetInstalledChaincodePackageResult) String() string { return proto.CompactTextString(m) } -func (*GetInstalledChaincodePackageResult) ProtoMessage() {} -func (*GetInstalledChaincodePackageResult) Descriptor() ([]byte, []int) { - return fileDescriptor_6625a5b20951add3, []int{5} -} - -func (m *GetInstalledChaincodePackageResult) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetInstalledChaincodePackageResult.Unmarshal(m, b) -} -func (m *GetInstalledChaincodePackageResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetInstalledChaincodePackageResult.Marshal(b, m, deterministic) -} -func (m *GetInstalledChaincodePackageResult) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetInstalledChaincodePackageResult.Merge(m, src) -} -func (m *GetInstalledChaincodePackageResult) XXX_Size() int { - return xxx_messageInfo_GetInstalledChaincodePackageResult.Size(m) -} -func (m *GetInstalledChaincodePackageResult) XXX_DiscardUnknown() { - xxx_messageInfo_GetInstalledChaincodePackageResult.DiscardUnknown(m) -} - -var xxx_messageInfo_GetInstalledChaincodePackageResult proto.InternalMessageInfo - -func (m *GetInstalledChaincodePackageResult) GetChaincodeInstallPackage() []byte { - if m != nil { - return m.ChaincodeInstallPackage - } - return nil -} - -// QueryInstalledChaincodesArgs currently is an empty argument to -// '_lifecycle.QueryInstalledChaincodes'. In the future, it may be -// extended to have parameters. -type QueryInstalledChaincodesArgs struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *QueryInstalledChaincodesArgs) Reset() { *m = QueryInstalledChaincodesArgs{} } -func (m *QueryInstalledChaincodesArgs) String() string { return proto.CompactTextString(m) } -func (*QueryInstalledChaincodesArgs) ProtoMessage() {} -func (*QueryInstalledChaincodesArgs) Descriptor() ([]byte, []int) { - return fileDescriptor_6625a5b20951add3, []int{6} -} - -func (m *QueryInstalledChaincodesArgs) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_QueryInstalledChaincodesArgs.Unmarshal(m, b) -} -func (m *QueryInstalledChaincodesArgs) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_QueryInstalledChaincodesArgs.Marshal(b, m, deterministic) -} -func (m *QueryInstalledChaincodesArgs) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryInstalledChaincodesArgs.Merge(m, src) -} -func (m *QueryInstalledChaincodesArgs) XXX_Size() int { - return xxx_messageInfo_QueryInstalledChaincodesArgs.Size(m) -} -func (m *QueryInstalledChaincodesArgs) XXX_DiscardUnknown() { - xxx_messageInfo_QueryInstalledChaincodesArgs.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryInstalledChaincodesArgs proto.InternalMessageInfo - -// QueryInstalledChaincodesResult is the message returned by -// '_lifecycle.QueryInstalledChaincodes'. It returns a list of installed -// chaincodes, including a map of channel name to chaincode name and version -// pairs of chaincode definitions that reference this chaincode package. -type QueryInstalledChaincodesResult struct { - InstalledChaincodes []*QueryInstalledChaincodesResult_InstalledChaincode `protobuf:"bytes,1,rep,name=installed_chaincodes,json=installedChaincodes,proto3" json:"installed_chaincodes,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *QueryInstalledChaincodesResult) Reset() { *m = QueryInstalledChaincodesResult{} } -func (m *QueryInstalledChaincodesResult) String() string { return proto.CompactTextString(m) } -func (*QueryInstalledChaincodesResult) ProtoMessage() {} -func (*QueryInstalledChaincodesResult) Descriptor() ([]byte, []int) { - return fileDescriptor_6625a5b20951add3, []int{7} -} - -func (m *QueryInstalledChaincodesResult) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_QueryInstalledChaincodesResult.Unmarshal(m, b) -} -func (m *QueryInstalledChaincodesResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_QueryInstalledChaincodesResult.Marshal(b, m, deterministic) -} -func (m *QueryInstalledChaincodesResult) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryInstalledChaincodesResult.Merge(m, src) -} -func (m *QueryInstalledChaincodesResult) XXX_Size() int { - return xxx_messageInfo_QueryInstalledChaincodesResult.Size(m) -} -func (m *QueryInstalledChaincodesResult) XXX_DiscardUnknown() { - xxx_messageInfo_QueryInstalledChaincodesResult.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryInstalledChaincodesResult proto.InternalMessageInfo - -func (m *QueryInstalledChaincodesResult) GetInstalledChaincodes() []*QueryInstalledChaincodesResult_InstalledChaincode { - if m != nil { - return m.InstalledChaincodes - } - return nil -} - -type QueryInstalledChaincodesResult_InstalledChaincode struct { - PackageId string `protobuf:"bytes,1,opt,name=package_id,json=packageId,proto3" json:"package_id,omitempty"` - Label string `protobuf:"bytes,2,opt,name=label,proto3" json:"label,omitempty"` - References map[string]*QueryInstalledChaincodesResult_References `protobuf:"bytes,3,rep,name=references,proto3" json:"references,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *QueryInstalledChaincodesResult_InstalledChaincode) Reset() { - *m = QueryInstalledChaincodesResult_InstalledChaincode{} -} -func (m *QueryInstalledChaincodesResult_InstalledChaincode) String() string { - return proto.CompactTextString(m) -} -func (*QueryInstalledChaincodesResult_InstalledChaincode) ProtoMessage() {} -func (*QueryInstalledChaincodesResult_InstalledChaincode) Descriptor() ([]byte, []int) { - return fileDescriptor_6625a5b20951add3, []int{7, 0} -} - -func (m *QueryInstalledChaincodesResult_InstalledChaincode) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_QueryInstalledChaincodesResult_InstalledChaincode.Unmarshal(m, b) -} -func (m *QueryInstalledChaincodesResult_InstalledChaincode) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_QueryInstalledChaincodesResult_InstalledChaincode.Marshal(b, m, deterministic) -} -func (m *QueryInstalledChaincodesResult_InstalledChaincode) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryInstalledChaincodesResult_InstalledChaincode.Merge(m, src) -} -func (m *QueryInstalledChaincodesResult_InstalledChaincode) XXX_Size() int { - return xxx_messageInfo_QueryInstalledChaincodesResult_InstalledChaincode.Size(m) -} -func (m *QueryInstalledChaincodesResult_InstalledChaincode) XXX_DiscardUnknown() { - xxx_messageInfo_QueryInstalledChaincodesResult_InstalledChaincode.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryInstalledChaincodesResult_InstalledChaincode proto.InternalMessageInfo - -func (m *QueryInstalledChaincodesResult_InstalledChaincode) GetPackageId() string { - if m != nil { - return m.PackageId - } - return "" -} - -func (m *QueryInstalledChaincodesResult_InstalledChaincode) GetLabel() string { - if m != nil { - return m.Label - } - return "" -} - -func (m *QueryInstalledChaincodesResult_InstalledChaincode) GetReferences() map[string]*QueryInstalledChaincodesResult_References { - if m != nil { - return m.References - } - return nil -} - -type QueryInstalledChaincodesResult_References struct { - Chaincodes []*QueryInstalledChaincodesResult_Chaincode `protobuf:"bytes,1,rep,name=chaincodes,proto3" json:"chaincodes,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *QueryInstalledChaincodesResult_References) Reset() { - *m = QueryInstalledChaincodesResult_References{} -} -func (m *QueryInstalledChaincodesResult_References) String() string { - return proto.CompactTextString(m) -} -func (*QueryInstalledChaincodesResult_References) ProtoMessage() {} -func (*QueryInstalledChaincodesResult_References) Descriptor() ([]byte, []int) { - return fileDescriptor_6625a5b20951add3, []int{7, 1} -} - -func (m *QueryInstalledChaincodesResult_References) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_QueryInstalledChaincodesResult_References.Unmarshal(m, b) -} -func (m *QueryInstalledChaincodesResult_References) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_QueryInstalledChaincodesResult_References.Marshal(b, m, deterministic) -} -func (m *QueryInstalledChaincodesResult_References) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryInstalledChaincodesResult_References.Merge(m, src) -} -func (m *QueryInstalledChaincodesResult_References) XXX_Size() int { - return xxx_messageInfo_QueryInstalledChaincodesResult_References.Size(m) -} -func (m *QueryInstalledChaincodesResult_References) XXX_DiscardUnknown() { - xxx_messageInfo_QueryInstalledChaincodesResult_References.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryInstalledChaincodesResult_References proto.InternalMessageInfo - -func (m *QueryInstalledChaincodesResult_References) GetChaincodes() []*QueryInstalledChaincodesResult_Chaincode { - if m != nil { - return m.Chaincodes - } - return nil -} - -type QueryInstalledChaincodesResult_Chaincode struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *QueryInstalledChaincodesResult_Chaincode) Reset() { - *m = QueryInstalledChaincodesResult_Chaincode{} -} -func (m *QueryInstalledChaincodesResult_Chaincode) String() string { return proto.CompactTextString(m) } -func (*QueryInstalledChaincodesResult_Chaincode) ProtoMessage() {} -func (*QueryInstalledChaincodesResult_Chaincode) Descriptor() ([]byte, []int) { - return fileDescriptor_6625a5b20951add3, []int{7, 2} -} - -func (m *QueryInstalledChaincodesResult_Chaincode) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_QueryInstalledChaincodesResult_Chaincode.Unmarshal(m, b) -} -func (m *QueryInstalledChaincodesResult_Chaincode) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_QueryInstalledChaincodesResult_Chaincode.Marshal(b, m, deterministic) -} -func (m *QueryInstalledChaincodesResult_Chaincode) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryInstalledChaincodesResult_Chaincode.Merge(m, src) -} -func (m *QueryInstalledChaincodesResult_Chaincode) XXX_Size() int { - return xxx_messageInfo_QueryInstalledChaincodesResult_Chaincode.Size(m) -} -func (m *QueryInstalledChaincodesResult_Chaincode) XXX_DiscardUnknown() { - xxx_messageInfo_QueryInstalledChaincodesResult_Chaincode.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryInstalledChaincodesResult_Chaincode proto.InternalMessageInfo - -func (m *QueryInstalledChaincodesResult_Chaincode) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *QueryInstalledChaincodesResult_Chaincode) GetVersion() string { - if m != nil { - return m.Version - } - return "" -} - -// ApproveChaincodeDefinitionForMyOrgArgs is the message used as arguments to -// `_lifecycle.ApproveChaincodeDefinitionForMyOrg`. -type ApproveChaincodeDefinitionForMyOrgArgs struct { - Sequence int64 `protobuf:"varint,1,opt,name=sequence,proto3" json:"sequence,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"` - EndorsementPlugin string `protobuf:"bytes,4,opt,name=endorsement_plugin,json=endorsementPlugin,proto3" json:"endorsement_plugin,omitempty"` - ValidationPlugin string `protobuf:"bytes,5,opt,name=validation_plugin,json=validationPlugin,proto3" json:"validation_plugin,omitempty"` - ValidationParameter []byte `protobuf:"bytes,6,opt,name=validation_parameter,json=validationParameter,proto3" json:"validation_parameter,omitempty"` - Collections *peer.CollectionConfigPackage `protobuf:"bytes,7,opt,name=collections,proto3" json:"collections,omitempty"` - InitRequired bool `protobuf:"varint,8,opt,name=init_required,json=initRequired,proto3" json:"init_required,omitempty"` - Source *ChaincodeSource `protobuf:"bytes,9,opt,name=source,proto3" json:"source,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ApproveChaincodeDefinitionForMyOrgArgs) Reset() { - *m = ApproveChaincodeDefinitionForMyOrgArgs{} -} -func (m *ApproveChaincodeDefinitionForMyOrgArgs) String() string { return proto.CompactTextString(m) } -func (*ApproveChaincodeDefinitionForMyOrgArgs) ProtoMessage() {} -func (*ApproveChaincodeDefinitionForMyOrgArgs) Descriptor() ([]byte, []int) { - return fileDescriptor_6625a5b20951add3, []int{8} -} - -func (m *ApproveChaincodeDefinitionForMyOrgArgs) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ApproveChaincodeDefinitionForMyOrgArgs.Unmarshal(m, b) -} -func (m *ApproveChaincodeDefinitionForMyOrgArgs) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ApproveChaincodeDefinitionForMyOrgArgs.Marshal(b, m, deterministic) -} -func (m *ApproveChaincodeDefinitionForMyOrgArgs) XXX_Merge(src proto.Message) { - xxx_messageInfo_ApproveChaincodeDefinitionForMyOrgArgs.Merge(m, src) -} -func (m *ApproveChaincodeDefinitionForMyOrgArgs) XXX_Size() int { - return xxx_messageInfo_ApproveChaincodeDefinitionForMyOrgArgs.Size(m) -} -func (m *ApproveChaincodeDefinitionForMyOrgArgs) XXX_DiscardUnknown() { - xxx_messageInfo_ApproveChaincodeDefinitionForMyOrgArgs.DiscardUnknown(m) -} - -var xxx_messageInfo_ApproveChaincodeDefinitionForMyOrgArgs proto.InternalMessageInfo - -func (m *ApproveChaincodeDefinitionForMyOrgArgs) GetSequence() int64 { - if m != nil { - return m.Sequence - } - return 0 -} - -func (m *ApproveChaincodeDefinitionForMyOrgArgs) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *ApproveChaincodeDefinitionForMyOrgArgs) GetVersion() string { - if m != nil { - return m.Version - } - return "" -} - -func (m *ApproveChaincodeDefinitionForMyOrgArgs) GetEndorsementPlugin() string { - if m != nil { - return m.EndorsementPlugin - } - return "" -} - -func (m *ApproveChaincodeDefinitionForMyOrgArgs) GetValidationPlugin() string { - if m != nil { - return m.ValidationPlugin - } - return "" -} - -func (m *ApproveChaincodeDefinitionForMyOrgArgs) GetValidationParameter() []byte { - if m != nil { - return m.ValidationParameter - } - return nil -} - -func (m *ApproveChaincodeDefinitionForMyOrgArgs) GetCollections() *peer.CollectionConfigPackage { - if m != nil { - return m.Collections - } - return nil -} - -func (m *ApproveChaincodeDefinitionForMyOrgArgs) GetInitRequired() bool { - if m != nil { - return m.InitRequired - } - return false -} - -func (m *ApproveChaincodeDefinitionForMyOrgArgs) GetSource() *ChaincodeSource { - if m != nil { - return m.Source - } - return nil -} - -type ChaincodeSource struct { - // Types that are valid to be assigned to Type: - // - // *ChaincodeSource_Unavailable_ - // *ChaincodeSource_LocalPackage - Type isChaincodeSource_Type `protobuf_oneof:"Type"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ChaincodeSource) Reset() { *m = ChaincodeSource{} } -func (m *ChaincodeSource) String() string { return proto.CompactTextString(m) } -func (*ChaincodeSource) ProtoMessage() {} -func (*ChaincodeSource) Descriptor() ([]byte, []int) { - return fileDescriptor_6625a5b20951add3, []int{9} -} - -func (m *ChaincodeSource) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ChaincodeSource.Unmarshal(m, b) -} -func (m *ChaincodeSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ChaincodeSource.Marshal(b, m, deterministic) -} -func (m *ChaincodeSource) XXX_Merge(src proto.Message) { - xxx_messageInfo_ChaincodeSource.Merge(m, src) -} -func (m *ChaincodeSource) XXX_Size() int { - return xxx_messageInfo_ChaincodeSource.Size(m) -} -func (m *ChaincodeSource) XXX_DiscardUnknown() { - xxx_messageInfo_ChaincodeSource.DiscardUnknown(m) -} - -var xxx_messageInfo_ChaincodeSource proto.InternalMessageInfo - -type isChaincodeSource_Type interface { - isChaincodeSource_Type() -} - -type ChaincodeSource_Unavailable_ struct { - Unavailable *ChaincodeSource_Unavailable `protobuf:"bytes,1,opt,name=unavailable,proto3,oneof"` -} - -type ChaincodeSource_LocalPackage struct { - LocalPackage *ChaincodeSource_Local `protobuf:"bytes,2,opt,name=local_package,json=localPackage,proto3,oneof"` -} - -func (*ChaincodeSource_Unavailable_) isChaincodeSource_Type() {} - -func (*ChaincodeSource_LocalPackage) isChaincodeSource_Type() {} - -func (m *ChaincodeSource) GetType() isChaincodeSource_Type { - if m != nil { - return m.Type - } - return nil -} - -func (m *ChaincodeSource) GetUnavailable() *ChaincodeSource_Unavailable { - if x, ok := m.GetType().(*ChaincodeSource_Unavailable_); ok { - return x.Unavailable - } - return nil -} - -func (m *ChaincodeSource) GetLocalPackage() *ChaincodeSource_Local { - if x, ok := m.GetType().(*ChaincodeSource_LocalPackage); ok { - return x.LocalPackage - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*ChaincodeSource) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*ChaincodeSource_Unavailable_)(nil), - (*ChaincodeSource_LocalPackage)(nil), - } -} - -type ChaincodeSource_Unavailable struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ChaincodeSource_Unavailable) Reset() { *m = ChaincodeSource_Unavailable{} } -func (m *ChaincodeSource_Unavailable) String() string { return proto.CompactTextString(m) } -func (*ChaincodeSource_Unavailable) ProtoMessage() {} -func (*ChaincodeSource_Unavailable) Descriptor() ([]byte, []int) { - return fileDescriptor_6625a5b20951add3, []int{9, 0} -} - -func (m *ChaincodeSource_Unavailable) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ChaincodeSource_Unavailable.Unmarshal(m, b) -} -func (m *ChaincodeSource_Unavailable) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ChaincodeSource_Unavailable.Marshal(b, m, deterministic) -} -func (m *ChaincodeSource_Unavailable) XXX_Merge(src proto.Message) { - xxx_messageInfo_ChaincodeSource_Unavailable.Merge(m, src) -} -func (m *ChaincodeSource_Unavailable) XXX_Size() int { - return xxx_messageInfo_ChaincodeSource_Unavailable.Size(m) -} -func (m *ChaincodeSource_Unavailable) XXX_DiscardUnknown() { - xxx_messageInfo_ChaincodeSource_Unavailable.DiscardUnknown(m) -} - -var xxx_messageInfo_ChaincodeSource_Unavailable proto.InternalMessageInfo - -type ChaincodeSource_Local struct { - PackageId string `protobuf:"bytes,1,opt,name=package_id,json=packageId,proto3" json:"package_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ChaincodeSource_Local) Reset() { *m = ChaincodeSource_Local{} } -func (m *ChaincodeSource_Local) String() string { return proto.CompactTextString(m) } -func (*ChaincodeSource_Local) ProtoMessage() {} -func (*ChaincodeSource_Local) Descriptor() ([]byte, []int) { - return fileDescriptor_6625a5b20951add3, []int{9, 1} -} - -func (m *ChaincodeSource_Local) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ChaincodeSource_Local.Unmarshal(m, b) -} -func (m *ChaincodeSource_Local) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ChaincodeSource_Local.Marshal(b, m, deterministic) -} -func (m *ChaincodeSource_Local) XXX_Merge(src proto.Message) { - xxx_messageInfo_ChaincodeSource_Local.Merge(m, src) -} -func (m *ChaincodeSource_Local) XXX_Size() int { - return xxx_messageInfo_ChaincodeSource_Local.Size(m) -} -func (m *ChaincodeSource_Local) XXX_DiscardUnknown() { - xxx_messageInfo_ChaincodeSource_Local.DiscardUnknown(m) -} - -var xxx_messageInfo_ChaincodeSource_Local proto.InternalMessageInfo - -func (m *ChaincodeSource_Local) GetPackageId() string { - if m != nil { - return m.PackageId - } - return "" -} - -// ApproveChaincodeDefinitionForMyOrgResult is the message returned by -// `_lifecycle.ApproveChaincodeDefinitionForMyOrg`. Currently it returns -// nothing, but may be extended in the future. -type ApproveChaincodeDefinitionForMyOrgResult struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ApproveChaincodeDefinitionForMyOrgResult) Reset() { - *m = ApproveChaincodeDefinitionForMyOrgResult{} -} -func (m *ApproveChaincodeDefinitionForMyOrgResult) String() string { return proto.CompactTextString(m) } -func (*ApproveChaincodeDefinitionForMyOrgResult) ProtoMessage() {} -func (*ApproveChaincodeDefinitionForMyOrgResult) Descriptor() ([]byte, []int) { - return fileDescriptor_6625a5b20951add3, []int{10} -} - -func (m *ApproveChaincodeDefinitionForMyOrgResult) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ApproveChaincodeDefinitionForMyOrgResult.Unmarshal(m, b) -} -func (m *ApproveChaincodeDefinitionForMyOrgResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ApproveChaincodeDefinitionForMyOrgResult.Marshal(b, m, deterministic) -} -func (m *ApproveChaincodeDefinitionForMyOrgResult) XXX_Merge(src proto.Message) { - xxx_messageInfo_ApproveChaincodeDefinitionForMyOrgResult.Merge(m, src) -} -func (m *ApproveChaincodeDefinitionForMyOrgResult) XXX_Size() int { - return xxx_messageInfo_ApproveChaincodeDefinitionForMyOrgResult.Size(m) -} -func (m *ApproveChaincodeDefinitionForMyOrgResult) XXX_DiscardUnknown() { - xxx_messageInfo_ApproveChaincodeDefinitionForMyOrgResult.DiscardUnknown(m) -} - -var xxx_messageInfo_ApproveChaincodeDefinitionForMyOrgResult proto.InternalMessageInfo - -// CommitChaincodeDefinitionArgs is the message used as arguments to -// `_lifecycle.CommitChaincodeDefinition`. -type CommitChaincodeDefinitionArgs struct { - Sequence int64 `protobuf:"varint,1,opt,name=sequence,proto3" json:"sequence,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"` - EndorsementPlugin string `protobuf:"bytes,4,opt,name=endorsement_plugin,json=endorsementPlugin,proto3" json:"endorsement_plugin,omitempty"` - ValidationPlugin string `protobuf:"bytes,5,opt,name=validation_plugin,json=validationPlugin,proto3" json:"validation_plugin,omitempty"` - ValidationParameter []byte `protobuf:"bytes,6,opt,name=validation_parameter,json=validationParameter,proto3" json:"validation_parameter,omitempty"` - Collections *peer.CollectionConfigPackage `protobuf:"bytes,7,opt,name=collections,proto3" json:"collections,omitempty"` - InitRequired bool `protobuf:"varint,8,opt,name=init_required,json=initRequired,proto3" json:"init_required,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CommitChaincodeDefinitionArgs) Reset() { *m = CommitChaincodeDefinitionArgs{} } -func (m *CommitChaincodeDefinitionArgs) String() string { return proto.CompactTextString(m) } -func (*CommitChaincodeDefinitionArgs) ProtoMessage() {} -func (*CommitChaincodeDefinitionArgs) Descriptor() ([]byte, []int) { - return fileDescriptor_6625a5b20951add3, []int{11} -} - -func (m *CommitChaincodeDefinitionArgs) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CommitChaincodeDefinitionArgs.Unmarshal(m, b) -} -func (m *CommitChaincodeDefinitionArgs) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CommitChaincodeDefinitionArgs.Marshal(b, m, deterministic) -} -func (m *CommitChaincodeDefinitionArgs) XXX_Merge(src proto.Message) { - xxx_messageInfo_CommitChaincodeDefinitionArgs.Merge(m, src) -} -func (m *CommitChaincodeDefinitionArgs) XXX_Size() int { - return xxx_messageInfo_CommitChaincodeDefinitionArgs.Size(m) -} -func (m *CommitChaincodeDefinitionArgs) XXX_DiscardUnknown() { - xxx_messageInfo_CommitChaincodeDefinitionArgs.DiscardUnknown(m) -} - -var xxx_messageInfo_CommitChaincodeDefinitionArgs proto.InternalMessageInfo - -func (m *CommitChaincodeDefinitionArgs) GetSequence() int64 { - if m != nil { - return m.Sequence - } - return 0 -} - -func (m *CommitChaincodeDefinitionArgs) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *CommitChaincodeDefinitionArgs) GetVersion() string { - if m != nil { - return m.Version - } - return "" -} - -func (m *CommitChaincodeDefinitionArgs) GetEndorsementPlugin() string { - if m != nil { - return m.EndorsementPlugin - } - return "" -} - -func (m *CommitChaincodeDefinitionArgs) GetValidationPlugin() string { - if m != nil { - return m.ValidationPlugin - } - return "" -} - -func (m *CommitChaincodeDefinitionArgs) GetValidationParameter() []byte { - if m != nil { - return m.ValidationParameter - } - return nil -} - -func (m *CommitChaincodeDefinitionArgs) GetCollections() *peer.CollectionConfigPackage { - if m != nil { - return m.Collections - } - return nil -} - -func (m *CommitChaincodeDefinitionArgs) GetInitRequired() bool { - if m != nil { - return m.InitRequired - } - return false -} - -// CommitChaincodeDefinitionResult is the message returned by -// `_lifecycle.CommitChaincodeDefinition`. Currently it returns -// nothing, but may be extended in the future. -type CommitChaincodeDefinitionResult struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CommitChaincodeDefinitionResult) Reset() { *m = CommitChaincodeDefinitionResult{} } -func (m *CommitChaincodeDefinitionResult) String() string { return proto.CompactTextString(m) } -func (*CommitChaincodeDefinitionResult) ProtoMessage() {} -func (*CommitChaincodeDefinitionResult) Descriptor() ([]byte, []int) { - return fileDescriptor_6625a5b20951add3, []int{12} -} - -func (m *CommitChaincodeDefinitionResult) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CommitChaincodeDefinitionResult.Unmarshal(m, b) -} -func (m *CommitChaincodeDefinitionResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CommitChaincodeDefinitionResult.Marshal(b, m, deterministic) -} -func (m *CommitChaincodeDefinitionResult) XXX_Merge(src proto.Message) { - xxx_messageInfo_CommitChaincodeDefinitionResult.Merge(m, src) -} -func (m *CommitChaincodeDefinitionResult) XXX_Size() int { - return xxx_messageInfo_CommitChaincodeDefinitionResult.Size(m) -} -func (m *CommitChaincodeDefinitionResult) XXX_DiscardUnknown() { - xxx_messageInfo_CommitChaincodeDefinitionResult.DiscardUnknown(m) -} - -var xxx_messageInfo_CommitChaincodeDefinitionResult proto.InternalMessageInfo - -// CheckCommitReadinessArgs is the message used as arguments to -// `_lifecycle.CheckCommitReadiness`. -type CheckCommitReadinessArgs struct { - Sequence int64 `protobuf:"varint,1,opt,name=sequence,proto3" json:"sequence,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"` - EndorsementPlugin string `protobuf:"bytes,4,opt,name=endorsement_plugin,json=endorsementPlugin,proto3" json:"endorsement_plugin,omitempty"` - ValidationPlugin string `protobuf:"bytes,5,opt,name=validation_plugin,json=validationPlugin,proto3" json:"validation_plugin,omitempty"` - ValidationParameter []byte `protobuf:"bytes,6,opt,name=validation_parameter,json=validationParameter,proto3" json:"validation_parameter,omitempty"` - Collections *peer.CollectionConfigPackage `protobuf:"bytes,7,opt,name=collections,proto3" json:"collections,omitempty"` - InitRequired bool `protobuf:"varint,8,opt,name=init_required,json=initRequired,proto3" json:"init_required,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CheckCommitReadinessArgs) Reset() { *m = CheckCommitReadinessArgs{} } -func (m *CheckCommitReadinessArgs) String() string { return proto.CompactTextString(m) } -func (*CheckCommitReadinessArgs) ProtoMessage() {} -func (*CheckCommitReadinessArgs) Descriptor() ([]byte, []int) { - return fileDescriptor_6625a5b20951add3, []int{13} -} - -func (m *CheckCommitReadinessArgs) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CheckCommitReadinessArgs.Unmarshal(m, b) -} -func (m *CheckCommitReadinessArgs) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CheckCommitReadinessArgs.Marshal(b, m, deterministic) -} -func (m *CheckCommitReadinessArgs) XXX_Merge(src proto.Message) { - xxx_messageInfo_CheckCommitReadinessArgs.Merge(m, src) -} -func (m *CheckCommitReadinessArgs) XXX_Size() int { - return xxx_messageInfo_CheckCommitReadinessArgs.Size(m) -} -func (m *CheckCommitReadinessArgs) XXX_DiscardUnknown() { - xxx_messageInfo_CheckCommitReadinessArgs.DiscardUnknown(m) -} - -var xxx_messageInfo_CheckCommitReadinessArgs proto.InternalMessageInfo - -func (m *CheckCommitReadinessArgs) GetSequence() int64 { - if m != nil { - return m.Sequence - } - return 0 -} - -func (m *CheckCommitReadinessArgs) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *CheckCommitReadinessArgs) GetVersion() string { - if m != nil { - return m.Version - } - return "" -} - -func (m *CheckCommitReadinessArgs) GetEndorsementPlugin() string { - if m != nil { - return m.EndorsementPlugin - } - return "" -} - -func (m *CheckCommitReadinessArgs) GetValidationPlugin() string { - if m != nil { - return m.ValidationPlugin - } - return "" -} - -func (m *CheckCommitReadinessArgs) GetValidationParameter() []byte { - if m != nil { - return m.ValidationParameter - } - return nil -} - -func (m *CheckCommitReadinessArgs) GetCollections() *peer.CollectionConfigPackage { - if m != nil { - return m.Collections - } - return nil -} - -func (m *CheckCommitReadinessArgs) GetInitRequired() bool { - if m != nil { - return m.InitRequired - } - return false -} - -// CheckCommitReadinessResult is the message returned by -// `_lifecycle.CheckCommitReadiness`. It returns a map of -// orgs to their approval (true/false) for the definition -// supplied as args. Additionally, it returns a map of -// parameter mismatches between each organization's -// approved definition and the definition supplied as args. -type CheckCommitReadinessResult struct { - Approvals map[string]bool `protobuf:"bytes,1,rep,name=approvals,proto3" json:"approvals,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` - Mismatches map[string]*CheckCommitReadinessResult_Mismatches `protobuf:"bytes,2,rep,name=mismatches,proto3" json:"mismatches,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CheckCommitReadinessResult) Reset() { *m = CheckCommitReadinessResult{} } -func (m *CheckCommitReadinessResult) String() string { return proto.CompactTextString(m) } -func (*CheckCommitReadinessResult) ProtoMessage() {} -func (*CheckCommitReadinessResult) Descriptor() ([]byte, []int) { - return fileDescriptor_6625a5b20951add3, []int{14} -} - -func (m *CheckCommitReadinessResult) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CheckCommitReadinessResult.Unmarshal(m, b) -} -func (m *CheckCommitReadinessResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CheckCommitReadinessResult.Marshal(b, m, deterministic) -} -func (m *CheckCommitReadinessResult) XXX_Merge(src proto.Message) { - xxx_messageInfo_CheckCommitReadinessResult.Merge(m, src) -} -func (m *CheckCommitReadinessResult) XXX_Size() int { - return xxx_messageInfo_CheckCommitReadinessResult.Size(m) -} -func (m *CheckCommitReadinessResult) XXX_DiscardUnknown() { - xxx_messageInfo_CheckCommitReadinessResult.DiscardUnknown(m) -} - -var xxx_messageInfo_CheckCommitReadinessResult proto.InternalMessageInfo - -func (m *CheckCommitReadinessResult) GetApprovals() map[string]bool { - if m != nil { - return m.Approvals - } - return nil -} - -func (m *CheckCommitReadinessResult) GetMismatches() map[string]*CheckCommitReadinessResult_Mismatches { - if m != nil { - return m.Mismatches - } - return nil -} - -type CheckCommitReadinessResult_Mismatches struct { - Items []string `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CheckCommitReadinessResult_Mismatches) Reset() { *m = CheckCommitReadinessResult_Mismatches{} } -func (m *CheckCommitReadinessResult_Mismatches) String() string { return proto.CompactTextString(m) } -func (*CheckCommitReadinessResult_Mismatches) ProtoMessage() {} -func (*CheckCommitReadinessResult_Mismatches) Descriptor() ([]byte, []int) { - return fileDescriptor_6625a5b20951add3, []int{14, 1} -} - -func (m *CheckCommitReadinessResult_Mismatches) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CheckCommitReadinessResult_Mismatches.Unmarshal(m, b) -} -func (m *CheckCommitReadinessResult_Mismatches) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CheckCommitReadinessResult_Mismatches.Marshal(b, m, deterministic) -} -func (m *CheckCommitReadinessResult_Mismatches) XXX_Merge(src proto.Message) { - xxx_messageInfo_CheckCommitReadinessResult_Mismatches.Merge(m, src) -} -func (m *CheckCommitReadinessResult_Mismatches) XXX_Size() int { - return xxx_messageInfo_CheckCommitReadinessResult_Mismatches.Size(m) -} -func (m *CheckCommitReadinessResult_Mismatches) XXX_DiscardUnknown() { - xxx_messageInfo_CheckCommitReadinessResult_Mismatches.DiscardUnknown(m) -} - -var xxx_messageInfo_CheckCommitReadinessResult_Mismatches proto.InternalMessageInfo - -func (m *CheckCommitReadinessResult_Mismatches) GetItems() []string { - if m != nil { - return m.Items - } - return nil -} - -// QueryApprovedChaincodeDefinitionArgs is the message used as arguments to -// `_lifecycle.QueryApprovedChaincodeDefinition`. -type QueryApprovedChaincodeDefinitionArgs struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Sequence int64 `protobuf:"varint,2,opt,name=sequence,proto3" json:"sequence,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *QueryApprovedChaincodeDefinitionArgs) Reset() { *m = QueryApprovedChaincodeDefinitionArgs{} } -func (m *QueryApprovedChaincodeDefinitionArgs) String() string { return proto.CompactTextString(m) } -func (*QueryApprovedChaincodeDefinitionArgs) ProtoMessage() {} -func (*QueryApprovedChaincodeDefinitionArgs) Descriptor() ([]byte, []int) { - return fileDescriptor_6625a5b20951add3, []int{15} -} - -func (m *QueryApprovedChaincodeDefinitionArgs) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_QueryApprovedChaincodeDefinitionArgs.Unmarshal(m, b) -} -func (m *QueryApprovedChaincodeDefinitionArgs) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_QueryApprovedChaincodeDefinitionArgs.Marshal(b, m, deterministic) -} -func (m *QueryApprovedChaincodeDefinitionArgs) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryApprovedChaincodeDefinitionArgs.Merge(m, src) -} -func (m *QueryApprovedChaincodeDefinitionArgs) XXX_Size() int { - return xxx_messageInfo_QueryApprovedChaincodeDefinitionArgs.Size(m) -} -func (m *QueryApprovedChaincodeDefinitionArgs) XXX_DiscardUnknown() { - xxx_messageInfo_QueryApprovedChaincodeDefinitionArgs.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryApprovedChaincodeDefinitionArgs proto.InternalMessageInfo - -func (m *QueryApprovedChaincodeDefinitionArgs) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *QueryApprovedChaincodeDefinitionArgs) GetSequence() int64 { - if m != nil { - return m.Sequence - } - return 0 -} - -// QueryApprovedChaincodeDefinitionResult is the message returned by -// `_lifecycle.QueryApprovedChaincodeDefinition`. -type QueryApprovedChaincodeDefinitionResult struct { - Sequence int64 `protobuf:"varint,1,opt,name=sequence,proto3" json:"sequence,omitempty"` - Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` - EndorsementPlugin string `protobuf:"bytes,3,opt,name=endorsement_plugin,json=endorsementPlugin,proto3" json:"endorsement_plugin,omitempty"` - ValidationPlugin string `protobuf:"bytes,4,opt,name=validation_plugin,json=validationPlugin,proto3" json:"validation_plugin,omitempty"` - ValidationParameter []byte `protobuf:"bytes,5,opt,name=validation_parameter,json=validationParameter,proto3" json:"validation_parameter,omitempty"` - Collections *peer.CollectionConfigPackage `protobuf:"bytes,6,opt,name=collections,proto3" json:"collections,omitempty"` - InitRequired bool `protobuf:"varint,7,opt,name=init_required,json=initRequired,proto3" json:"init_required,omitempty"` - Source *ChaincodeSource `protobuf:"bytes,8,opt,name=source,proto3" json:"source,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *QueryApprovedChaincodeDefinitionResult) Reset() { - *m = QueryApprovedChaincodeDefinitionResult{} -} -func (m *QueryApprovedChaincodeDefinitionResult) String() string { return proto.CompactTextString(m) } -func (*QueryApprovedChaincodeDefinitionResult) ProtoMessage() {} -func (*QueryApprovedChaincodeDefinitionResult) Descriptor() ([]byte, []int) { - return fileDescriptor_6625a5b20951add3, []int{16} -} - -func (m *QueryApprovedChaincodeDefinitionResult) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_QueryApprovedChaincodeDefinitionResult.Unmarshal(m, b) -} -func (m *QueryApprovedChaincodeDefinitionResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_QueryApprovedChaincodeDefinitionResult.Marshal(b, m, deterministic) -} -func (m *QueryApprovedChaincodeDefinitionResult) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryApprovedChaincodeDefinitionResult.Merge(m, src) -} -func (m *QueryApprovedChaincodeDefinitionResult) XXX_Size() int { - return xxx_messageInfo_QueryApprovedChaincodeDefinitionResult.Size(m) -} -func (m *QueryApprovedChaincodeDefinitionResult) XXX_DiscardUnknown() { - xxx_messageInfo_QueryApprovedChaincodeDefinitionResult.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryApprovedChaincodeDefinitionResult proto.InternalMessageInfo - -func (m *QueryApprovedChaincodeDefinitionResult) GetSequence() int64 { - if m != nil { - return m.Sequence - } - return 0 -} - -func (m *QueryApprovedChaincodeDefinitionResult) GetVersion() string { - if m != nil { - return m.Version - } - return "" -} - -func (m *QueryApprovedChaincodeDefinitionResult) GetEndorsementPlugin() string { - if m != nil { - return m.EndorsementPlugin - } - return "" -} - -func (m *QueryApprovedChaincodeDefinitionResult) GetValidationPlugin() string { - if m != nil { - return m.ValidationPlugin - } - return "" -} - -func (m *QueryApprovedChaincodeDefinitionResult) GetValidationParameter() []byte { - if m != nil { - return m.ValidationParameter - } - return nil -} - -func (m *QueryApprovedChaincodeDefinitionResult) GetCollections() *peer.CollectionConfigPackage { - if m != nil { - return m.Collections - } - return nil -} - -func (m *QueryApprovedChaincodeDefinitionResult) GetInitRequired() bool { - if m != nil { - return m.InitRequired - } - return false -} - -func (m *QueryApprovedChaincodeDefinitionResult) GetSource() *ChaincodeSource { - if m != nil { - return m.Source - } - return nil -} - -// QueryApprovedChaincodeDefinitionsArgs is the message used as arguments to -// `_lifecycle.QueryApprovedChaincodeDefinitions`. -type QueryApprovedChaincodeDefinitionsArgs struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *QueryApprovedChaincodeDefinitionsArgs) Reset() { *m = QueryApprovedChaincodeDefinitionsArgs{} } -func (m *QueryApprovedChaincodeDefinitionsArgs) String() string { return proto.CompactTextString(m) } -func (*QueryApprovedChaincodeDefinitionsArgs) ProtoMessage() {} -func (*QueryApprovedChaincodeDefinitionsArgs) Descriptor() ([]byte, []int) { - return fileDescriptor_6625a5b20951add3, []int{17} -} - -func (m *QueryApprovedChaincodeDefinitionsArgs) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_QueryApprovedChaincodeDefinitionsArgs.Unmarshal(m, b) -} -func (m *QueryApprovedChaincodeDefinitionsArgs) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_QueryApprovedChaincodeDefinitionsArgs.Marshal(b, m, deterministic) -} -func (m *QueryApprovedChaincodeDefinitionsArgs) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryApprovedChaincodeDefinitionsArgs.Merge(m, src) -} -func (m *QueryApprovedChaincodeDefinitionsArgs) XXX_Size() int { - return xxx_messageInfo_QueryApprovedChaincodeDefinitionsArgs.Size(m) -} -func (m *QueryApprovedChaincodeDefinitionsArgs) XXX_DiscardUnknown() { - xxx_messageInfo_QueryApprovedChaincodeDefinitionsArgs.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryApprovedChaincodeDefinitionsArgs proto.InternalMessageInfo - -// QueryApprovedChaincodeDefinitionsResult is the message returned by -// `_lifecycle.QueryApprovedChaincodeDefinitions`. -type QueryApprovedChaincodeDefinitionsResult struct { - ApprovedChaincodeDefinitions []*QueryApprovedChaincodeDefinitionsResult_ApprovedChaincodeDefinition `protobuf:"bytes,1,rep,name=approved_chaincode_definitions,json=approvedChaincodeDefinitions,proto3" json:"approved_chaincode_definitions,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *QueryApprovedChaincodeDefinitionsResult) Reset() { - *m = QueryApprovedChaincodeDefinitionsResult{} -} -func (m *QueryApprovedChaincodeDefinitionsResult) String() string { return proto.CompactTextString(m) } -func (*QueryApprovedChaincodeDefinitionsResult) ProtoMessage() {} -func (*QueryApprovedChaincodeDefinitionsResult) Descriptor() ([]byte, []int) { - return fileDescriptor_6625a5b20951add3, []int{18} -} - -func (m *QueryApprovedChaincodeDefinitionsResult) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_QueryApprovedChaincodeDefinitionsResult.Unmarshal(m, b) -} -func (m *QueryApprovedChaincodeDefinitionsResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_QueryApprovedChaincodeDefinitionsResult.Marshal(b, m, deterministic) -} -func (m *QueryApprovedChaincodeDefinitionsResult) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryApprovedChaincodeDefinitionsResult.Merge(m, src) -} -func (m *QueryApprovedChaincodeDefinitionsResult) XXX_Size() int { - return xxx_messageInfo_QueryApprovedChaincodeDefinitionsResult.Size(m) -} -func (m *QueryApprovedChaincodeDefinitionsResult) XXX_DiscardUnknown() { - xxx_messageInfo_QueryApprovedChaincodeDefinitionsResult.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryApprovedChaincodeDefinitionsResult proto.InternalMessageInfo - -func (m *QueryApprovedChaincodeDefinitionsResult) GetApprovedChaincodeDefinitions() []*QueryApprovedChaincodeDefinitionsResult_ApprovedChaincodeDefinition { - if m != nil { - return m.ApprovedChaincodeDefinitions - } - return nil -} - -type QueryApprovedChaincodeDefinitionsResult_ApprovedChaincodeDefinition struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Sequence int64 `protobuf:"varint,2,opt,name=sequence,proto3" json:"sequence,omitempty"` - Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"` - EndorsementPlugin string `protobuf:"bytes,4,opt,name=endorsement_plugin,json=endorsementPlugin,proto3" json:"endorsement_plugin,omitempty"` - ValidationPlugin string `protobuf:"bytes,5,opt,name=validation_plugin,json=validationPlugin,proto3" json:"validation_plugin,omitempty"` - ValidationParameter []byte `protobuf:"bytes,6,opt,name=validation_parameter,json=validationParameter,proto3" json:"validation_parameter,omitempty"` - Collections *peer.CollectionConfigPackage `protobuf:"bytes,7,opt,name=collections,proto3" json:"collections,omitempty"` - InitRequired bool `protobuf:"varint,8,opt,name=init_required,json=initRequired,proto3" json:"init_required,omitempty"` - Source *ChaincodeSource `protobuf:"bytes,9,opt,name=source,proto3" json:"source,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *QueryApprovedChaincodeDefinitionsResult_ApprovedChaincodeDefinition) Reset() { - *m = QueryApprovedChaincodeDefinitionsResult_ApprovedChaincodeDefinition{} -} -func (m *QueryApprovedChaincodeDefinitionsResult_ApprovedChaincodeDefinition) String() string { - return proto.CompactTextString(m) -} -func (*QueryApprovedChaincodeDefinitionsResult_ApprovedChaincodeDefinition) ProtoMessage() {} -func (*QueryApprovedChaincodeDefinitionsResult_ApprovedChaincodeDefinition) Descriptor() ([]byte, []int) { - return fileDescriptor_6625a5b20951add3, []int{18, 0} -} - -func (m *QueryApprovedChaincodeDefinitionsResult_ApprovedChaincodeDefinition) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_QueryApprovedChaincodeDefinitionsResult_ApprovedChaincodeDefinition.Unmarshal(m, b) -} -func (m *QueryApprovedChaincodeDefinitionsResult_ApprovedChaincodeDefinition) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_QueryApprovedChaincodeDefinitionsResult_ApprovedChaincodeDefinition.Marshal(b, m, deterministic) -} -func (m *QueryApprovedChaincodeDefinitionsResult_ApprovedChaincodeDefinition) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryApprovedChaincodeDefinitionsResult_ApprovedChaincodeDefinition.Merge(m, src) -} -func (m *QueryApprovedChaincodeDefinitionsResult_ApprovedChaincodeDefinition) XXX_Size() int { - return xxx_messageInfo_QueryApprovedChaincodeDefinitionsResult_ApprovedChaincodeDefinition.Size(m) -} -func (m *QueryApprovedChaincodeDefinitionsResult_ApprovedChaincodeDefinition) XXX_DiscardUnknown() { - xxx_messageInfo_QueryApprovedChaincodeDefinitionsResult_ApprovedChaincodeDefinition.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryApprovedChaincodeDefinitionsResult_ApprovedChaincodeDefinition proto.InternalMessageInfo - -func (m *QueryApprovedChaincodeDefinitionsResult_ApprovedChaincodeDefinition) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *QueryApprovedChaincodeDefinitionsResult_ApprovedChaincodeDefinition) GetSequence() int64 { - if m != nil { - return m.Sequence - } - return 0 -} - -func (m *QueryApprovedChaincodeDefinitionsResult_ApprovedChaincodeDefinition) GetVersion() string { - if m != nil { - return m.Version - } - return "" -} - -func (m *QueryApprovedChaincodeDefinitionsResult_ApprovedChaincodeDefinition) GetEndorsementPlugin() string { - if m != nil { - return m.EndorsementPlugin - } - return "" -} - -func (m *QueryApprovedChaincodeDefinitionsResult_ApprovedChaincodeDefinition) GetValidationPlugin() string { - if m != nil { - return m.ValidationPlugin - } - return "" -} - -func (m *QueryApprovedChaincodeDefinitionsResult_ApprovedChaincodeDefinition) GetValidationParameter() []byte { - if m != nil { - return m.ValidationParameter - } - return nil -} - -func (m *QueryApprovedChaincodeDefinitionsResult_ApprovedChaincodeDefinition) GetCollections() *peer.CollectionConfigPackage { - if m != nil { - return m.Collections - } - return nil -} - -func (m *QueryApprovedChaincodeDefinitionsResult_ApprovedChaincodeDefinition) GetInitRequired() bool { - if m != nil { - return m.InitRequired - } - return false -} - -func (m *QueryApprovedChaincodeDefinitionsResult_ApprovedChaincodeDefinition) GetSource() *ChaincodeSource { - if m != nil { - return m.Source - } - return nil -} - -// QueryChaincodeDefinitionArgs is the message used as arguments to -// `_lifecycle.QueryChaincodeDefinition`. -type QueryChaincodeDefinitionArgs struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *QueryChaincodeDefinitionArgs) Reset() { *m = QueryChaincodeDefinitionArgs{} } -func (m *QueryChaincodeDefinitionArgs) String() string { return proto.CompactTextString(m) } -func (*QueryChaincodeDefinitionArgs) ProtoMessage() {} -func (*QueryChaincodeDefinitionArgs) Descriptor() ([]byte, []int) { - return fileDescriptor_6625a5b20951add3, []int{19} -} - -func (m *QueryChaincodeDefinitionArgs) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_QueryChaincodeDefinitionArgs.Unmarshal(m, b) -} -func (m *QueryChaincodeDefinitionArgs) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_QueryChaincodeDefinitionArgs.Marshal(b, m, deterministic) -} -func (m *QueryChaincodeDefinitionArgs) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryChaincodeDefinitionArgs.Merge(m, src) -} -func (m *QueryChaincodeDefinitionArgs) XXX_Size() int { - return xxx_messageInfo_QueryChaincodeDefinitionArgs.Size(m) -} -func (m *QueryChaincodeDefinitionArgs) XXX_DiscardUnknown() { - xxx_messageInfo_QueryChaincodeDefinitionArgs.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryChaincodeDefinitionArgs proto.InternalMessageInfo - -func (m *QueryChaincodeDefinitionArgs) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -// QueryChaincodeDefinitionResult is the message returned by -// `_lifecycle.QueryChaincodeDefinition`. -type QueryChaincodeDefinitionResult struct { - Sequence int64 `protobuf:"varint,1,opt,name=sequence,proto3" json:"sequence,omitempty"` - Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` - EndorsementPlugin string `protobuf:"bytes,3,opt,name=endorsement_plugin,json=endorsementPlugin,proto3" json:"endorsement_plugin,omitempty"` - ValidationPlugin string `protobuf:"bytes,4,opt,name=validation_plugin,json=validationPlugin,proto3" json:"validation_plugin,omitempty"` - ValidationParameter []byte `protobuf:"bytes,5,opt,name=validation_parameter,json=validationParameter,proto3" json:"validation_parameter,omitempty"` - Collections *peer.CollectionConfigPackage `protobuf:"bytes,6,opt,name=collections,proto3" json:"collections,omitempty"` - InitRequired bool `protobuf:"varint,7,opt,name=init_required,json=initRequired,proto3" json:"init_required,omitempty"` - Approvals map[string]bool `protobuf:"bytes,8,rep,name=approvals,proto3" json:"approvals,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *QueryChaincodeDefinitionResult) Reset() { *m = QueryChaincodeDefinitionResult{} } -func (m *QueryChaincodeDefinitionResult) String() string { return proto.CompactTextString(m) } -func (*QueryChaincodeDefinitionResult) ProtoMessage() {} -func (*QueryChaincodeDefinitionResult) Descriptor() ([]byte, []int) { - return fileDescriptor_6625a5b20951add3, []int{20} -} - -func (m *QueryChaincodeDefinitionResult) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_QueryChaincodeDefinitionResult.Unmarshal(m, b) -} -func (m *QueryChaincodeDefinitionResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_QueryChaincodeDefinitionResult.Marshal(b, m, deterministic) -} -func (m *QueryChaincodeDefinitionResult) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryChaincodeDefinitionResult.Merge(m, src) -} -func (m *QueryChaincodeDefinitionResult) XXX_Size() int { - return xxx_messageInfo_QueryChaincodeDefinitionResult.Size(m) -} -func (m *QueryChaincodeDefinitionResult) XXX_DiscardUnknown() { - xxx_messageInfo_QueryChaincodeDefinitionResult.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryChaincodeDefinitionResult proto.InternalMessageInfo - -func (m *QueryChaincodeDefinitionResult) GetSequence() int64 { - if m != nil { - return m.Sequence - } - return 0 -} - -func (m *QueryChaincodeDefinitionResult) GetVersion() string { - if m != nil { - return m.Version - } - return "" -} - -func (m *QueryChaincodeDefinitionResult) GetEndorsementPlugin() string { - if m != nil { - return m.EndorsementPlugin - } - return "" -} - -func (m *QueryChaincodeDefinitionResult) GetValidationPlugin() string { - if m != nil { - return m.ValidationPlugin - } - return "" -} - -func (m *QueryChaincodeDefinitionResult) GetValidationParameter() []byte { - if m != nil { - return m.ValidationParameter - } - return nil -} - -func (m *QueryChaincodeDefinitionResult) GetCollections() *peer.CollectionConfigPackage { - if m != nil { - return m.Collections - } - return nil -} - -func (m *QueryChaincodeDefinitionResult) GetInitRequired() bool { - if m != nil { - return m.InitRequired - } - return false -} - -func (m *QueryChaincodeDefinitionResult) GetApprovals() map[string]bool { - if m != nil { - return m.Approvals - } - return nil -} - -// QueryChaincodeDefinitionsArgs is the message used as arguments to -// `_lifecycle.QueryChaincodeDefinitions`. -type QueryChaincodeDefinitionsArgs struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *QueryChaincodeDefinitionsArgs) Reset() { *m = QueryChaincodeDefinitionsArgs{} } -func (m *QueryChaincodeDefinitionsArgs) String() string { return proto.CompactTextString(m) } -func (*QueryChaincodeDefinitionsArgs) ProtoMessage() {} -func (*QueryChaincodeDefinitionsArgs) Descriptor() ([]byte, []int) { - return fileDescriptor_6625a5b20951add3, []int{21} -} - -func (m *QueryChaincodeDefinitionsArgs) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_QueryChaincodeDefinitionsArgs.Unmarshal(m, b) -} -func (m *QueryChaincodeDefinitionsArgs) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_QueryChaincodeDefinitionsArgs.Marshal(b, m, deterministic) -} -func (m *QueryChaincodeDefinitionsArgs) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryChaincodeDefinitionsArgs.Merge(m, src) -} -func (m *QueryChaincodeDefinitionsArgs) XXX_Size() int { - return xxx_messageInfo_QueryChaincodeDefinitionsArgs.Size(m) -} -func (m *QueryChaincodeDefinitionsArgs) XXX_DiscardUnknown() { - xxx_messageInfo_QueryChaincodeDefinitionsArgs.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryChaincodeDefinitionsArgs proto.InternalMessageInfo - -// QueryChaincodeDefinitionsResult is the message returned by -// `_lifecycle.QueryChaincodeDefinitions`. -type QueryChaincodeDefinitionsResult struct { - ChaincodeDefinitions []*QueryChaincodeDefinitionsResult_ChaincodeDefinition `protobuf:"bytes,1,rep,name=chaincode_definitions,json=chaincodeDefinitions,proto3" json:"chaincode_definitions,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *QueryChaincodeDefinitionsResult) Reset() { *m = QueryChaincodeDefinitionsResult{} } -func (m *QueryChaincodeDefinitionsResult) String() string { return proto.CompactTextString(m) } -func (*QueryChaincodeDefinitionsResult) ProtoMessage() {} -func (*QueryChaincodeDefinitionsResult) Descriptor() ([]byte, []int) { - return fileDescriptor_6625a5b20951add3, []int{22} -} - -func (m *QueryChaincodeDefinitionsResult) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_QueryChaincodeDefinitionsResult.Unmarshal(m, b) -} -func (m *QueryChaincodeDefinitionsResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_QueryChaincodeDefinitionsResult.Marshal(b, m, deterministic) -} -func (m *QueryChaincodeDefinitionsResult) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryChaincodeDefinitionsResult.Merge(m, src) -} -func (m *QueryChaincodeDefinitionsResult) XXX_Size() int { - return xxx_messageInfo_QueryChaincodeDefinitionsResult.Size(m) -} -func (m *QueryChaincodeDefinitionsResult) XXX_DiscardUnknown() { - xxx_messageInfo_QueryChaincodeDefinitionsResult.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryChaincodeDefinitionsResult proto.InternalMessageInfo - -func (m *QueryChaincodeDefinitionsResult) GetChaincodeDefinitions() []*QueryChaincodeDefinitionsResult_ChaincodeDefinition { - if m != nil { - return m.ChaincodeDefinitions - } - return nil -} - -type QueryChaincodeDefinitionsResult_ChaincodeDefinition struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Sequence int64 `protobuf:"varint,2,opt,name=sequence,proto3" json:"sequence,omitempty"` - Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"` - EndorsementPlugin string `protobuf:"bytes,4,opt,name=endorsement_plugin,json=endorsementPlugin,proto3" json:"endorsement_plugin,omitempty"` - ValidationPlugin string `protobuf:"bytes,5,opt,name=validation_plugin,json=validationPlugin,proto3" json:"validation_plugin,omitempty"` - ValidationParameter []byte `protobuf:"bytes,6,opt,name=validation_parameter,json=validationParameter,proto3" json:"validation_parameter,omitempty"` - Collections *peer.CollectionConfigPackage `protobuf:"bytes,7,opt,name=collections,proto3" json:"collections,omitempty"` - InitRequired bool `protobuf:"varint,8,opt,name=init_required,json=initRequired,proto3" json:"init_required,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *QueryChaincodeDefinitionsResult_ChaincodeDefinition) Reset() { - *m = QueryChaincodeDefinitionsResult_ChaincodeDefinition{} -} -func (m *QueryChaincodeDefinitionsResult_ChaincodeDefinition) String() string { - return proto.CompactTextString(m) -} -func (*QueryChaincodeDefinitionsResult_ChaincodeDefinition) ProtoMessage() {} -func (*QueryChaincodeDefinitionsResult_ChaincodeDefinition) Descriptor() ([]byte, []int) { - return fileDescriptor_6625a5b20951add3, []int{22, 0} -} - -func (m *QueryChaincodeDefinitionsResult_ChaincodeDefinition) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_QueryChaincodeDefinitionsResult_ChaincodeDefinition.Unmarshal(m, b) -} -func (m *QueryChaincodeDefinitionsResult_ChaincodeDefinition) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_QueryChaincodeDefinitionsResult_ChaincodeDefinition.Marshal(b, m, deterministic) -} -func (m *QueryChaincodeDefinitionsResult_ChaincodeDefinition) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryChaincodeDefinitionsResult_ChaincodeDefinition.Merge(m, src) -} -func (m *QueryChaincodeDefinitionsResult_ChaincodeDefinition) XXX_Size() int { - return xxx_messageInfo_QueryChaincodeDefinitionsResult_ChaincodeDefinition.Size(m) -} -func (m *QueryChaincodeDefinitionsResult_ChaincodeDefinition) XXX_DiscardUnknown() { - xxx_messageInfo_QueryChaincodeDefinitionsResult_ChaincodeDefinition.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryChaincodeDefinitionsResult_ChaincodeDefinition proto.InternalMessageInfo - -func (m *QueryChaincodeDefinitionsResult_ChaincodeDefinition) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *QueryChaincodeDefinitionsResult_ChaincodeDefinition) GetSequence() int64 { - if m != nil { - return m.Sequence - } - return 0 -} - -func (m *QueryChaincodeDefinitionsResult_ChaincodeDefinition) GetVersion() string { - if m != nil { - return m.Version - } - return "" -} - -func (m *QueryChaincodeDefinitionsResult_ChaincodeDefinition) GetEndorsementPlugin() string { - if m != nil { - return m.EndorsementPlugin - } - return "" -} - -func (m *QueryChaincodeDefinitionsResult_ChaincodeDefinition) GetValidationPlugin() string { - if m != nil { - return m.ValidationPlugin - } - return "" -} - -func (m *QueryChaincodeDefinitionsResult_ChaincodeDefinition) GetValidationParameter() []byte { - if m != nil { - return m.ValidationParameter - } - return nil -} - -func (m *QueryChaincodeDefinitionsResult_ChaincodeDefinition) GetCollections() *peer.CollectionConfigPackage { - if m != nil { - return m.Collections - } - return nil -} - -func (m *QueryChaincodeDefinitionsResult_ChaincodeDefinition) GetInitRequired() bool { - if m != nil { - return m.InitRequired - } - return false -} - -func init() { - proto.RegisterType((*InstallChaincodeArgs)(nil), "lifecycle.InstallChaincodeArgs") - proto.RegisterType((*InstallChaincodeResult)(nil), "lifecycle.InstallChaincodeResult") - proto.RegisterType((*QueryInstalledChaincodeArgs)(nil), "lifecycle.QueryInstalledChaincodeArgs") - proto.RegisterType((*QueryInstalledChaincodeResult)(nil), "lifecycle.QueryInstalledChaincodeResult") - proto.RegisterMapType((map[string]*QueryInstalledChaincodeResult_References)(nil), "lifecycle.QueryInstalledChaincodeResult.ReferencesEntry") - proto.RegisterType((*QueryInstalledChaincodeResult_References)(nil), "lifecycle.QueryInstalledChaincodeResult.References") - proto.RegisterType((*QueryInstalledChaincodeResult_Chaincode)(nil), "lifecycle.QueryInstalledChaincodeResult.Chaincode") - proto.RegisterType((*GetInstalledChaincodePackageArgs)(nil), "lifecycle.GetInstalledChaincodePackageArgs") - proto.RegisterType((*GetInstalledChaincodePackageResult)(nil), "lifecycle.GetInstalledChaincodePackageResult") - proto.RegisterType((*QueryInstalledChaincodesArgs)(nil), "lifecycle.QueryInstalledChaincodesArgs") - proto.RegisterType((*QueryInstalledChaincodesResult)(nil), "lifecycle.QueryInstalledChaincodesResult") - proto.RegisterType((*QueryInstalledChaincodesResult_InstalledChaincode)(nil), "lifecycle.QueryInstalledChaincodesResult.InstalledChaincode") - proto.RegisterMapType((map[string]*QueryInstalledChaincodesResult_References)(nil), "lifecycle.QueryInstalledChaincodesResult.InstalledChaincode.ReferencesEntry") - proto.RegisterType((*QueryInstalledChaincodesResult_References)(nil), "lifecycle.QueryInstalledChaincodesResult.References") - proto.RegisterType((*QueryInstalledChaincodesResult_Chaincode)(nil), "lifecycle.QueryInstalledChaincodesResult.Chaincode") - proto.RegisterType((*ApproveChaincodeDefinitionForMyOrgArgs)(nil), "lifecycle.ApproveChaincodeDefinitionForMyOrgArgs") - proto.RegisterType((*ChaincodeSource)(nil), "lifecycle.ChaincodeSource") - proto.RegisterType((*ChaincodeSource_Unavailable)(nil), "lifecycle.ChaincodeSource.Unavailable") - proto.RegisterType((*ChaincodeSource_Local)(nil), "lifecycle.ChaincodeSource.Local") - proto.RegisterType((*ApproveChaincodeDefinitionForMyOrgResult)(nil), "lifecycle.ApproveChaincodeDefinitionForMyOrgResult") - proto.RegisterType((*CommitChaincodeDefinitionArgs)(nil), "lifecycle.CommitChaincodeDefinitionArgs") - proto.RegisterType((*CommitChaincodeDefinitionResult)(nil), "lifecycle.CommitChaincodeDefinitionResult") - proto.RegisterType((*CheckCommitReadinessArgs)(nil), "lifecycle.CheckCommitReadinessArgs") - proto.RegisterType((*CheckCommitReadinessResult)(nil), "lifecycle.CheckCommitReadinessResult") - proto.RegisterMapType((map[string]bool)(nil), "lifecycle.CheckCommitReadinessResult.ApprovalsEntry") - proto.RegisterMapType((map[string]*CheckCommitReadinessResult_Mismatches)(nil), "lifecycle.CheckCommitReadinessResult.MismatchesEntry") - proto.RegisterType((*CheckCommitReadinessResult_Mismatches)(nil), "lifecycle.CheckCommitReadinessResult.Mismatches") - proto.RegisterType((*QueryApprovedChaincodeDefinitionArgs)(nil), "lifecycle.QueryApprovedChaincodeDefinitionArgs") - proto.RegisterType((*QueryApprovedChaincodeDefinitionResult)(nil), "lifecycle.QueryApprovedChaincodeDefinitionResult") - proto.RegisterType((*QueryApprovedChaincodeDefinitionsArgs)(nil), "lifecycle.QueryApprovedChaincodeDefinitionsArgs") - proto.RegisterType((*QueryApprovedChaincodeDefinitionsResult)(nil), "lifecycle.QueryApprovedChaincodeDefinitionsResult") - proto.RegisterType((*QueryApprovedChaincodeDefinitionsResult_ApprovedChaincodeDefinition)(nil), "lifecycle.QueryApprovedChaincodeDefinitionsResult.ApprovedChaincodeDefinition") - proto.RegisterType((*QueryChaincodeDefinitionArgs)(nil), "lifecycle.QueryChaincodeDefinitionArgs") - proto.RegisterType((*QueryChaincodeDefinitionResult)(nil), "lifecycle.QueryChaincodeDefinitionResult") - proto.RegisterMapType((map[string]bool)(nil), "lifecycle.QueryChaincodeDefinitionResult.ApprovalsEntry") - proto.RegisterType((*QueryChaincodeDefinitionsArgs)(nil), "lifecycle.QueryChaincodeDefinitionsArgs") - proto.RegisterType((*QueryChaincodeDefinitionsResult)(nil), "lifecycle.QueryChaincodeDefinitionsResult") - proto.RegisterType((*QueryChaincodeDefinitionsResult_ChaincodeDefinition)(nil), "lifecycle.QueryChaincodeDefinitionsResult.ChaincodeDefinition") -} - -func init() { proto.RegisterFile("peer/lifecycle/lifecycle.proto", fileDescriptor_6625a5b20951add3) } - -var fileDescriptor_6625a5b20951add3 = []byte{ - // 1126 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x58, 0x5f, 0x6f, 0xdb, 0x54, - 0x14, 0x5f, 0xe2, 0xb4, 0x4d, 0x4e, 0x5a, 0xba, 0xdd, 0x66, 0x60, 0xbc, 0xf5, 0x0f, 0x06, 0xba, - 0x0a, 0xa8, 0x0b, 0xe9, 0x40, 0x63, 0xaa, 0x90, 0xba, 0xc2, 0xb6, 0x4e, 0x2b, 0x0c, 0x8f, 0x4d, - 0x88, 0x97, 0xec, 0xd6, 0x3e, 0x49, 0xaf, 0xea, 0xd8, 0xd9, 0xb5, 0x53, 0x29, 0x1f, 0x81, 0x57, - 0xc4, 0x13, 0x12, 0xdf, 0x80, 0xef, 0xc0, 0xa7, 0x80, 0x17, 0x24, 0x84, 0x84, 0x78, 0xe6, 0x2b, - 0x4c, 0xb9, 0xbe, 0xb1, 0x9d, 0xd6, 0x76, 0x92, 0x35, 0x8f, 0x79, 0xb3, 0x7d, 0x7e, 0xe7, 0x77, - 0xee, 0xbd, 0xe7, 0xfc, 0xce, 0xb1, 0x0d, 0x6b, 0x1d, 0x44, 0xbe, 0xe3, 0xb0, 0x26, 0x5a, 0x3d, - 0xcb, 0xc1, 0xf8, 0xca, 0xe8, 0x70, 0x2f, 0xf0, 0x48, 0x25, 0x7a, 0xa0, 0x5d, 0x17, 0x50, 0xcb, - 0x73, 0x1c, 0xb4, 0x02, 0xe6, 0xb9, 0x21, 0x42, 0x37, 0xa1, 0x76, 0xe8, 0xfa, 0x01, 0x75, 0x9c, - 0x83, 0x13, 0xca, 0x5c, 0xcb, 0xb3, 0x71, 0x9f, 0xb7, 0x7c, 0x72, 0x17, 0xde, 0xb6, 0x06, 0x0f, - 0x1a, 0x2c, 0x44, 0x34, 0x3a, 0xd4, 0x3a, 0xa5, 0x2d, 0x54, 0x0b, 0x1b, 0x85, 0xad, 0x45, 0xf3, - 0xad, 0x08, 0x20, 0x19, 0x9e, 0x84, 0x66, 0xfd, 0x08, 0xde, 0x3c, 0xcf, 0x69, 0xa2, 0xdf, 0x75, - 0x02, 0xb2, 0x0a, 0x20, 0x39, 0x1a, 0xcc, 0x16, 0x34, 0x15, 0xb3, 0x22, 0x9f, 0x1c, 0xda, 0xa4, - 0x06, 0x73, 0x0e, 0x3d, 0x46, 0x47, 0x2d, 0x0a, 0x4b, 0x78, 0xa3, 0xef, 0xc1, 0x8d, 0x6f, 0xbb, - 0xc8, 0x7b, 0x92, 0x13, 0xed, 0xe1, 0x95, 0xe6, 0x73, 0xea, 0xbf, 0x2b, 0xb0, 0x9a, 0xe1, 0x7e, - 0x89, 0x45, 0x91, 0xef, 0x01, 0x38, 0x36, 0x91, 0xa3, 0x6b, 0xa1, 0xaf, 0x2a, 0x1b, 0xca, 0x56, - 0xb5, 0x7e, 0xc7, 0x88, 0xcf, 0x3f, 0x37, 0xa4, 0x61, 0x46, 0xae, 0x5f, 0xb9, 0x01, 0xef, 0x99, - 0x09, 0x2e, 0x8d, 0xc3, 0xf2, 0x39, 0x33, 0xb9, 0x0a, 0xca, 0x29, 0xf6, 0xe4, 0xd2, 0xfa, 0x97, - 0xe4, 0x10, 0xe6, 0xce, 0xa8, 0xd3, 0x45, 0xb1, 0xa8, 0x6a, 0x7d, 0xf7, 0x35, 0x22, 0x9b, 0x21, - 0xc3, 0xdd, 0xe2, 0x9d, 0x82, 0xf6, 0x02, 0x20, 0x36, 0x10, 0x13, 0x20, 0x4a, 0xad, 0xaf, 0x16, - 0xc4, 0xde, 0xea, 0x63, 0x47, 0x88, 0xef, 0x13, 0x2c, 0xda, 0xe7, 0x50, 0x89, 0x0c, 0x84, 0x40, - 0xc9, 0xa5, 0x6d, 0x94, 0x1b, 0x12, 0xd7, 0x44, 0x85, 0x85, 0x33, 0xe4, 0x3e, 0xf3, 0x5c, 0x79, - 0xd0, 0x83, 0x5b, 0x7d, 0x1f, 0x36, 0x1e, 0x60, 0x70, 0x31, 0x9e, 0x2c, 0xb7, 0x71, 0x8a, 0xe0, - 0x05, 0xe8, 0x79, 0x14, 0xb2, 0x10, 0x2e, 0x53, 0xf3, 0x6b, 0x70, 0x33, 0xe3, 0x58, 0xfc, 0xfe, - 0x02, 0xf5, 0xbf, 0x4b, 0xb0, 0x96, 0x05, 0x90, 0xe1, 0x3d, 0xa8, 0xb1, 0x81, 0xb1, 0x71, 0x21, - 0x01, 0x7b, 0xa3, 0x13, 0x20, 0x89, 0x8c, 0x94, 0xd4, 0xac, 0xb0, 0x8b, 0x68, 0xed, 0xb7, 0x22, - 0x90, 0x8b, 0xd8, 0xd7, 0xd3, 0x83, 0x93, 0xa2, 0x87, 0xc7, 0x97, 0x59, 0x72, 0xae, 0x46, 0xfc, - 0x71, 0x34, 0xf2, 0x68, 0x58, 0x23, 0xb7, 0xc7, 0x5f, 0x4d, 0xba, 0x48, 0xe8, 0x90, 0x48, 0x9e, - 0xa6, 0x88, 0x64, 0x77, 0xfc, 0x10, 0x53, 0x57, 0xc9, 0xaf, 0x0a, 0x6c, 0xee, 0x77, 0x3a, 0xdc, - 0x3b, 0xc3, 0x88, 0xe2, 0x4b, 0x6c, 0x32, 0x97, 0xf5, 0xbb, 0xfd, 0x7d, 0x8f, 0x1f, 0xf5, 0xbe, - 0xe1, 0x2d, 0x21, 0x16, 0x0d, 0xca, 0x3e, 0xbe, 0xec, 0xf6, 0xf7, 0x21, 0xc8, 0x15, 0x33, 0xba, - 0x8f, 0x82, 0x16, 0xd3, 0x83, 0x2a, 0x43, 0x41, 0xc9, 0x36, 0x10, 0x74, 0x6d, 0x8f, 0xfb, 0xd8, - 0x46, 0x37, 0x68, 0x74, 0x9c, 0x6e, 0x8b, 0xb9, 0x6a, 0x49, 0x80, 0xae, 0x25, 0x2c, 0x4f, 0x84, - 0x81, 0x7c, 0x08, 0xd7, 0xce, 0xa8, 0xc3, 0x6c, 0xda, 0x5f, 0xd2, 0x00, 0x3d, 0x27, 0xd0, 0x57, - 0x63, 0x83, 0x04, 0x7f, 0x02, 0xb5, 0x24, 0x98, 0x72, 0xda, 0xc6, 0x00, 0xb9, 0x3a, 0x2f, 0x84, - 0xb8, 0x92, 0xc0, 0x0f, 0x4c, 0x64, 0x1f, 0xaa, 0xf1, 0x80, 0xf3, 0xd5, 0x05, 0x91, 0xf7, 0xf5, - 0x70, 0xd2, 0xf9, 0xc6, 0x41, 0x64, 0x3a, 0xf0, 0xdc, 0x26, 0x6b, 0x0d, 0xc4, 0x9f, 0xf4, 0x21, - 0xef, 0xc2, 0x52, 0xff, 0xc8, 0x1a, 0x1c, 0x5f, 0x76, 0x19, 0x47, 0x5b, 0x2d, 0x6f, 0x14, 0xb6, - 0xca, 0xe6, 0x62, 0xff, 0xa1, 0x29, 0x9f, 0x91, 0x3a, 0xcc, 0xfb, 0x5e, 0x97, 0x5b, 0xa8, 0x56, - 0x44, 0x08, 0x2d, 0x91, 0xf7, 0xe8, 0xf0, 0x9f, 0x0a, 0x84, 0x29, 0x91, 0xfa, 0x7f, 0x05, 0x58, - 0x3e, 0x67, 0x23, 0x8f, 0xa0, 0xda, 0x75, 0xe9, 0x19, 0x65, 0x0e, 0x3d, 0x76, 0xc2, 0x5c, 0x54, - 0xeb, 0x9b, 0xd9, 0x64, 0xc6, 0xb3, 0x18, 0xfd, 0xf0, 0x8a, 0x99, 0x74, 0x26, 0x0f, 0x60, 0xc9, - 0xf1, 0x2c, 0x1a, 0x37, 0xac, 0xb0, 0xea, 0x37, 0x72, 0xd8, 0x1e, 0xf7, 0xf1, 0x0f, 0xaf, 0x98, - 0x8b, 0xc2, 0x51, 0x1e, 0x87, 0xb6, 0x04, 0xd5, 0x44, 0x18, 0x6d, 0x13, 0xe6, 0x04, 0x6e, 0x44, - 0x5b, 0xb8, 0x37, 0x0f, 0xa5, 0xef, 0x7a, 0x1d, 0xd4, 0x3f, 0x80, 0xad, 0xd1, 0x65, 0x18, 0x8a, - 0x40, 0xff, 0xa7, 0x08, 0xab, 0x07, 0x5e, 0xbb, 0xcd, 0x82, 0x14, 0xec, 0xac, 0x54, 0xa7, 0x50, - 0xaa, 0xfa, 0x3b, 0xb0, 0x9e, 0x79, 0xc2, 0x32, 0x0b, 0x7f, 0x15, 0x41, 0x3d, 0x38, 0x41, 0xeb, - 0x34, 0x04, 0x9a, 0x48, 0x6d, 0xe6, 0xa2, 0xef, 0xcf, 0x12, 0x30, 0x8d, 0x04, 0xfc, 0xa2, 0x80, - 0x96, 0x76, 0xba, 0x72, 0xe8, 0x9b, 0x50, 0xa1, 0x42, 0x2e, 0xd4, 0x19, 0x4c, 0x91, 0xdb, 0x43, - 0x92, 0xcd, 0xf2, 0x34, 0xf6, 0x07, 0x6e, 0xe1, 0x78, 0x8c, 0x69, 0xc8, 0x33, 0x80, 0x36, 0xf3, - 0xdb, 0x34, 0xb0, 0x4e, 0xd0, 0x57, 0x8b, 0x82, 0xf4, 0xd3, 0xf1, 0x48, 0x8f, 0x22, 0x3f, 0x39, - 0x74, 0x63, 0x22, 0x6d, 0x0f, 0xde, 0x18, 0x8e, 0x99, 0x32, 0x73, 0x6b, 0xc9, 0x99, 0x5b, 0x4e, - 0x4e, 0x4f, 0x1d, 0x20, 0x26, 0xef, 0xe3, 0x58, 0x80, 0xed, 0x70, 0xcb, 0x15, 0x33, 0xbc, 0xd1, - 0x3c, 0x58, 0x3e, 0xb7, 0x80, 0x94, 0x10, 0xf7, 0x87, 0xc7, 0xfa, 0xc7, 0x93, 0x6e, 0x2c, 0xb1, - 0x28, 0xfd, 0x39, 0xbc, 0x27, 0xe6, 0xb4, 0xec, 0x58, 0x76, 0x56, 0x1b, 0x4a, 0x1b, 0xc5, 0x49, - 0x65, 0x14, 0x87, 0x95, 0xa1, 0xff, 0xa8, 0xc0, 0xe6, 0x28, 0x62, 0x59, 0x00, 0x79, 0x02, 0xcb, - 0x9c, 0xf6, 0x19, 0x62, 0x52, 0x26, 0x12, 0x53, 0x69, 0x42, 0x31, 0xcd, 0x8d, 0x2d, 0xa6, 0xf9, - 0x69, 0x88, 0x69, 0x21, 0x77, 0xf0, 0x96, 0xc7, 0x1e, 0xbc, 0xb7, 0xe0, 0xfd, 0x51, 0xa9, 0x08, - 0x5f, 0xd1, 0xff, 0x28, 0xc1, 0xad, 0x91, 0x48, 0x99, 0xb5, 0x9f, 0x0b, 0xb0, 0x46, 0x25, 0x2c, - 0x7e, 0x57, 0x6f, 0xd8, 0x31, 0x50, 0x8a, 0xf9, 0xeb, 0xf3, 0xaf, 0x84, 0xa3, 0xc9, 0x8d, 0xbc, - 0xa2, 0xb9, 0x49, 0x73, 0xfc, 0xb5, 0x9f, 0x14, 0xb8, 0x91, 0xe3, 0x3d, 0x69, 0x1d, 0xcf, 0xba, - 0xf9, 0x34, 0xde, 0xfc, 0xea, 0xf2, 0xd3, 0x70, 0x82, 0xe6, 0xa2, 0xff, 0xab, 0xc8, 0xcf, 0xc5, - 0x59, 0xe3, 0x98, 0x4a, 0xe3, 0x78, 0x9e, 0x1c, 0xb3, 0xe5, 0xf4, 0xbf, 0x35, 0x99, 0x47, 0x9d, - 0x3d, 0x6a, 0x2f, 0x37, 0x13, 0xf5, 0x75, 0xf9, 0x6b, 0x2a, 0xb3, 0x25, 0xfd, 0xaf, 0xc0, 0x7a, - 0x26, 0x42, 0xd6, 0x81, 0x0f, 0xd7, 0xf3, 0x1a, 0xd0, 0x17, 0x63, 0x6c, 0xf3, 0xc2, 0x47, 0x69, - 0xe2, 0x04, 0x6a, 0x56, 0x5a, 0xa3, 0xf9, 0xb3, 0x08, 0x2b, 0xb3, 0x06, 0x33, 0xfd, 0x06, 0x73, - 0xaf, 0x09, 0x1f, 0x79, 0xbc, 0x65, 0x9c, 0xf4, 0x3a, 0xc8, 0x1d, 0xb4, 0x5b, 0xc8, 0x8d, 0x26, - 0x3d, 0xe6, 0xcc, 0x1a, 0x84, 0xea, 0x20, 0xf2, 0x38, 0xa5, 0x3f, 0x7c, 0xd6, 0x62, 0xc1, 0x49, - 0xf7, 0xd8, 0xb0, 0xbc, 0xf6, 0x4e, 0xc2, 0x69, 0x27, 0x74, 0xda, 0x0e, 0x9d, 0xb6, 0x5b, 0xde, - 0xce, 0xf0, 0x9f, 0xe2, 0xe3, 0x79, 0x61, 0xd9, 0x7d, 0x15, 0x00, 0x00, 0xff, 0xff, 0xfa, 0x49, - 0xc3, 0x8f, 0x42, 0x16, 0x00, 0x00, -} diff --git a/vendor/github.com/hyperledger/fabric-protos-go/peer/peer.pb.go b/vendor/github.com/hyperledger/fabric-protos-go/peer/peer.pb.go deleted file mode 100644 index 0446f11bb87..00000000000 --- a/vendor/github.com/hyperledger/fabric-protos-go/peer/peer.pb.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: peer/peer.proto - -package peer - -import ( - context "context" - fmt "fmt" - proto "github.com/golang/protobuf/proto" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - math "math" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package - -func init() { proto.RegisterFile("peer/peer.proto", fileDescriptor_c302117fbb08ad42) } - -var fileDescriptor_c302117fbb08ad42 = []byte{ - // 177 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x8f, 0xb1, 0x0a, 0xc2, 0x30, - 0x10, 0x86, 0x37, 0x91, 0x2c, 0x85, 0x0a, 0x22, 0xc5, 0xc9, 0xd9, 0xa6, 0xa0, 0x6f, 0xa0, 0x38, - 0x5b, 0xea, 0xe6, 0x22, 0x6d, 0x73, 0xa6, 0x81, 0x9a, 0x0b, 0x77, 0x75, 0xf0, 0xed, 0xa5, 0xbd, - 0x06, 0x74, 0x49, 0xe0, 0xfb, 0xbf, 0x3b, 0xee, 0x57, 0x49, 0x00, 0xa0, 0x62, 0x7c, 0x74, 0x20, - 0x1c, 0x30, 0x5d, 0x4c, 0x1f, 0x67, 0x2b, 0x09, 0x08, 0x03, 0x72, 0xdd, 0x4b, 0x98, 0x6d, 0xff, - 0xe0, 0x83, 0x80, 0x03, 0x7a, 0x06, 0x49, 0x0f, 0x57, 0xb5, 0xbc, 0x78, 0x83, 0xc4, 0x40, 0xe9, - 0x59, 0x25, 0x25, 0x61, 0x0b, 0xcc, 0xe5, 0x6c, 0xa7, 0x6b, 0xd1, 0x58, 0xdf, 0x9c, 0xf5, 0x60, - 0x22, 0xcf, 0x36, 0x91, 0x47, 0x52, 0xcd, 0x6b, 0x4f, 0x95, 0xda, 0x21, 0x59, 0xdd, 0x7d, 0x02, - 0x50, 0x0f, 0xc6, 0x02, 0xe9, 0x67, 0xdd, 0x90, 0x6b, 0xe3, 0xc4, 0x78, 0xce, 0x7d, 0x6f, 0xdd, - 0xd0, 0xbd, 0x1b, 0xdd, 0xe2, 0xab, 0xf8, 0x51, 0x0b, 0x51, 0x73, 0x51, 0x73, 0x8b, 0x53, 0xcb, - 0x46, 0xfa, 0x1d, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0xd5, 0x12, 0xef, 0x66, 0xf9, 0x00, 0x00, - 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// EndorserClient is the client API for Endorser service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type EndorserClient interface { - ProcessProposal(ctx context.Context, in *SignedProposal, opts ...grpc.CallOption) (*ProposalResponse, error) -} - -type endorserClient struct { - cc *grpc.ClientConn -} - -func NewEndorserClient(cc *grpc.ClientConn) EndorserClient { - return &endorserClient{cc} -} - -func (c *endorserClient) ProcessProposal(ctx context.Context, in *SignedProposal, opts ...grpc.CallOption) (*ProposalResponse, error) { - out := new(ProposalResponse) - err := c.cc.Invoke(ctx, "/protos.Endorser/ProcessProposal", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// EndorserServer is the server API for Endorser service. -type EndorserServer interface { - ProcessProposal(context.Context, *SignedProposal) (*ProposalResponse, error) -} - -// UnimplementedEndorserServer can be embedded to have forward compatible implementations. -type UnimplementedEndorserServer struct { -} - -func (*UnimplementedEndorserServer) ProcessProposal(ctx context.Context, req *SignedProposal) (*ProposalResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ProcessProposal not implemented") -} - -func RegisterEndorserServer(s *grpc.Server, srv EndorserServer) { - s.RegisterService(&_Endorser_serviceDesc, srv) -} - -func _Endorser_ProcessProposal_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SignedProposal) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(EndorserServer).ProcessProposal(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/protos.Endorser/ProcessProposal", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(EndorserServer).ProcessProposal(ctx, req.(*SignedProposal)) - } - return interceptor(ctx, in, info, handler) -} - -var _Endorser_serviceDesc = grpc.ServiceDesc{ - ServiceName: "protos.Endorser", - HandlerType: (*EndorserServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "ProcessProposal", - Handler: _Endorser_ProcessProposal_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "peer/peer.proto", -} diff --git a/vendor/github.com/hyperledger/fabric-protos-go/peer/policy.pb.go b/vendor/github.com/hyperledger/fabric-protos-go/peer/policy.pb.go deleted file mode 100644 index 23f414ce61a..00000000000 --- a/vendor/github.com/hyperledger/fabric-protos-go/peer/policy.pb.go +++ /dev/null @@ -1,131 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: peer/policy.proto - -package peer - -import ( - fmt "fmt" - proto "github.com/golang/protobuf/proto" - common "github.com/hyperledger/fabric-protos-go/common" - math "math" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package - -// ApplicationPolicy captures the diffenrent policy types that -// are set and evaluted at the application level. -type ApplicationPolicy struct { - // Types that are valid to be assigned to Type: - // - // *ApplicationPolicy_SignaturePolicy - // *ApplicationPolicy_ChannelConfigPolicyReference - Type isApplicationPolicy_Type `protobuf_oneof:"Type"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ApplicationPolicy) Reset() { *m = ApplicationPolicy{} } -func (m *ApplicationPolicy) String() string { return proto.CompactTextString(m) } -func (*ApplicationPolicy) ProtoMessage() {} -func (*ApplicationPolicy) Descriptor() ([]byte, []int) { - return fileDescriptor_17aa1dd1e55c3e19, []int{0} -} - -func (m *ApplicationPolicy) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ApplicationPolicy.Unmarshal(m, b) -} -func (m *ApplicationPolicy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ApplicationPolicy.Marshal(b, m, deterministic) -} -func (m *ApplicationPolicy) XXX_Merge(src proto.Message) { - xxx_messageInfo_ApplicationPolicy.Merge(m, src) -} -func (m *ApplicationPolicy) XXX_Size() int { - return xxx_messageInfo_ApplicationPolicy.Size(m) -} -func (m *ApplicationPolicy) XXX_DiscardUnknown() { - xxx_messageInfo_ApplicationPolicy.DiscardUnknown(m) -} - -var xxx_messageInfo_ApplicationPolicy proto.InternalMessageInfo - -type isApplicationPolicy_Type interface { - isApplicationPolicy_Type() -} - -type ApplicationPolicy_SignaturePolicy struct { - SignaturePolicy *common.SignaturePolicyEnvelope `protobuf:"bytes,1,opt,name=signature_policy,json=signaturePolicy,proto3,oneof"` -} - -type ApplicationPolicy_ChannelConfigPolicyReference struct { - ChannelConfigPolicyReference string `protobuf:"bytes,2,opt,name=channel_config_policy_reference,json=channelConfigPolicyReference,proto3,oneof"` -} - -func (*ApplicationPolicy_SignaturePolicy) isApplicationPolicy_Type() {} - -func (*ApplicationPolicy_ChannelConfigPolicyReference) isApplicationPolicy_Type() {} - -func (m *ApplicationPolicy) GetType() isApplicationPolicy_Type { - if m != nil { - return m.Type - } - return nil -} - -func (m *ApplicationPolicy) GetSignaturePolicy() *common.SignaturePolicyEnvelope { - if x, ok := m.GetType().(*ApplicationPolicy_SignaturePolicy); ok { - return x.SignaturePolicy - } - return nil -} - -func (m *ApplicationPolicy) GetChannelConfigPolicyReference() string { - if x, ok := m.GetType().(*ApplicationPolicy_ChannelConfigPolicyReference); ok { - return x.ChannelConfigPolicyReference - } - return "" -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*ApplicationPolicy) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*ApplicationPolicy_SignaturePolicy)(nil), - (*ApplicationPolicy_ChannelConfigPolicyReference)(nil), - } -} - -func init() { - proto.RegisterType((*ApplicationPolicy)(nil), "protos.ApplicationPolicy") -} - -func init() { proto.RegisterFile("peer/policy.proto", fileDescriptor_17aa1dd1e55c3e19) } - -var fileDescriptor_17aa1dd1e55c3e19 = []byte{ - // 243 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x90, 0xc1, 0x4a, 0xc3, 0x40, - 0x10, 0x86, 0x1b, 0x91, 0x82, 0xeb, 0x41, 0x1b, 0x10, 0x8a, 0x08, 0x2d, 0x3d, 0xf5, 0x60, 0x37, - 0xa0, 0x4f, 0x60, 0x45, 0xec, 0xc1, 0x83, 0x44, 0x4f, 0x5e, 0x42, 0xb2, 0x4e, 0x36, 0x0b, 0xdb, - 0x9d, 0x61, 0x36, 0x15, 0xf2, 0x5a, 0x3e, 0xa1, 0x24, 0xd3, 0x80, 0x3d, 0xed, 0xe1, 0xfb, 0xfe, - 0x9f, 0x9d, 0x5f, 0xcd, 0x08, 0x80, 0x33, 0x42, 0xef, 0x4c, 0xa7, 0x89, 0xb1, 0xc5, 0x74, 0x3a, - 0x3c, 0xf1, 0xf6, 0xc6, 0xe0, 0x7e, 0x8f, 0x41, 0xa0, 0x83, 0x28, 0x78, 0xf5, 0x9b, 0xa8, 0xd9, - 0x13, 0x91, 0x77, 0xa6, 0x6c, 0x1d, 0x86, 0xf7, 0x21, 0x9a, 0xbe, 0xa9, 0xeb, 0xe8, 0x6c, 0x28, - 0xdb, 0x03, 0x43, 0x21, 0x75, 0xf3, 0x64, 0x99, 0xac, 0x2f, 0x1f, 0x16, 0x5a, 0x7a, 0xf4, 0xc7, - 0xc8, 0x25, 0xf2, 0x12, 0x7e, 0xc0, 0x23, 0xc1, 0x6e, 0x92, 0x5f, 0xc5, 0x53, 0x94, 0xbe, 0xaa, - 0x85, 0x69, 0xca, 0x10, 0xc0, 0x17, 0x06, 0x43, 0xed, 0xec, 0xb1, 0xb2, 0x60, 0xa8, 0x81, 0x21, - 0x18, 0x98, 0x9f, 0x2d, 0x93, 0xf5, 0xc5, 0x6e, 0x92, 0xdf, 0x1d, 0xc5, 0xe7, 0xc1, 0x93, 0x7c, - 0x3e, 0x5a, 0xdb, 0xa9, 0x3a, 0xff, 0xec, 0x08, 0xb6, 0xb9, 0x5a, 0x21, 0x5b, 0xdd, 0x74, 0x04, - 0xec, 0xe1, 0xdb, 0x02, 0xeb, 0xba, 0xac, 0xd8, 0x19, 0x39, 0x2a, 0xea, 0x7e, 0x86, 0xaf, 0x7b, - 0xeb, 0xda, 0xe6, 0x50, 0xf5, 0x1f, 0xce, 0xfe, 0xa9, 0x99, 0xa8, 0x1b, 0x51, 0x37, 0x16, 0xb3, - 0xde, 0xae, 0x64, 0xa7, 0xc7, 0xbf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x89, 0x76, 0x3a, 0x03, 0x43, - 0x01, 0x00, 0x00, -} diff --git a/vendor/github.com/hyperledger/fabric-protos-go/peer/proposal.pb.go b/vendor/github.com/hyperledger/fabric-protos-go/peer/proposal.pb.go deleted file mode 100644 index e34a4c8b8f5..00000000000 --- a/vendor/github.com/hyperledger/fabric-protos-go/peer/proposal.pb.go +++ /dev/null @@ -1,394 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: peer/proposal.proto - -package peer - -import ( - fmt "fmt" - proto "github.com/golang/protobuf/proto" - math "math" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package - -// This structure is necessary to sign the proposal which contains the header -// and the payload. Without this structure, we would have to concatenate the -// header and the payload to verify the signature, which could be expensive -// with large payload -// -// When an endorser receives a SignedProposal message, it should verify the -// signature over the proposal bytes. This verification requires the following -// steps: -// 1. Verification of the validity of the certificate that was used to produce -// the signature. The certificate will be available once proposalBytes has -// been unmarshalled to a Proposal message, and Proposal.header has been -// unmarshalled to a Header message. While this unmarshalling-before-verifying -// might not be ideal, it is unavoidable because i) the signature needs to also -// protect the signing certificate; ii) it is desirable that Header is created -// once by the client and never changed (for the sake of accountability and -// non-repudiation). Note also that it is actually impossible to conclusively -// verify the validity of the certificate included in a Proposal, because the -// proposal needs to first be endorsed and ordered with respect to certificate -// expiration transactions. Still, it is useful to pre-filter expired -// certificates at this stage. -// 2. Verification that the certificate is trusted (signed by a trusted CA) and -// that it is allowed to transact with us (with respect to some ACLs); -// 3. Verification that the signature on proposalBytes is valid; -// 4. Detect replay attacks; -type SignedProposal struct { - // The bytes of Proposal - ProposalBytes []byte `protobuf:"bytes,1,opt,name=proposal_bytes,json=proposalBytes,proto3" json:"proposal_bytes,omitempty"` - // Signaure over proposalBytes; this signature is to be verified against - // the creator identity contained in the header of the Proposal message - // marshaled as proposalBytes - Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SignedProposal) Reset() { *m = SignedProposal{} } -func (m *SignedProposal) String() string { return proto.CompactTextString(m) } -func (*SignedProposal) ProtoMessage() {} -func (*SignedProposal) Descriptor() ([]byte, []int) { - return fileDescriptor_c4dbb4372a94bd5b, []int{0} -} - -func (m *SignedProposal) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SignedProposal.Unmarshal(m, b) -} -func (m *SignedProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SignedProposal.Marshal(b, m, deterministic) -} -func (m *SignedProposal) XXX_Merge(src proto.Message) { - xxx_messageInfo_SignedProposal.Merge(m, src) -} -func (m *SignedProposal) XXX_Size() int { - return xxx_messageInfo_SignedProposal.Size(m) -} -func (m *SignedProposal) XXX_DiscardUnknown() { - xxx_messageInfo_SignedProposal.DiscardUnknown(m) -} - -var xxx_messageInfo_SignedProposal proto.InternalMessageInfo - -func (m *SignedProposal) GetProposalBytes() []byte { - if m != nil { - return m.ProposalBytes - } - return nil -} - -func (m *SignedProposal) GetSignature() []byte { - if m != nil { - return m.Signature - } - return nil -} - -// A Proposal is sent to an endorser for endorsement. The proposal contains: -// 1. A header which should be unmarshaled to a Header message. Note that -// Header is both the header of a Proposal and of a Transaction, in that i) -// both headers should be unmarshaled to this message; and ii) it is used to -// compute cryptographic hashes and signatures. The header has fields common -// to all proposals/transactions. In addition it has a type field for -// additional customization. An example of this is the ChaincodeHeaderExtension -// message used to extend the Header for type CHAINCODE. -// 2. A payload whose type depends on the header's type field. -// 3. An extension whose type depends on the header's type field. -// -// Let us see an example. For type CHAINCODE (see the Header message), -// we have the following: -// 1. The header is a Header message whose extensions field is a -// ChaincodeHeaderExtension message. -// 2. The payload is a ChaincodeProposalPayload message. -// 3. The extension is a ChaincodeAction that might be used to ask the -// endorsers to endorse a specific ChaincodeAction, thus emulating the -// submitting peer model. -type Proposal struct { - // The header of the proposal. It is the bytes of the Header - Header []byte `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` - // The payload of the proposal as defined by the type in the proposal - // header. - Payload []byte `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"` - // Optional extensions to the proposal. Its content depends on the Header's - // type field. For the type CHAINCODE, it might be the bytes of a - // ChaincodeAction message. - Extension []byte `protobuf:"bytes,3,opt,name=extension,proto3" json:"extension,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Proposal) Reset() { *m = Proposal{} } -func (m *Proposal) String() string { return proto.CompactTextString(m) } -func (*Proposal) ProtoMessage() {} -func (*Proposal) Descriptor() ([]byte, []int) { - return fileDescriptor_c4dbb4372a94bd5b, []int{1} -} - -func (m *Proposal) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Proposal.Unmarshal(m, b) -} -func (m *Proposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Proposal.Marshal(b, m, deterministic) -} -func (m *Proposal) XXX_Merge(src proto.Message) { - xxx_messageInfo_Proposal.Merge(m, src) -} -func (m *Proposal) XXX_Size() int { - return xxx_messageInfo_Proposal.Size(m) -} -func (m *Proposal) XXX_DiscardUnknown() { - xxx_messageInfo_Proposal.DiscardUnknown(m) -} - -var xxx_messageInfo_Proposal proto.InternalMessageInfo - -func (m *Proposal) GetHeader() []byte { - if m != nil { - return m.Header - } - return nil -} - -func (m *Proposal) GetPayload() []byte { - if m != nil { - return m.Payload - } - return nil -} - -func (m *Proposal) GetExtension() []byte { - if m != nil { - return m.Extension - } - return nil -} - -// ChaincodeHeaderExtension is the Header's extentions message to be used when -// the Header's type is CHAINCODE. This extensions is used to specify which -// chaincode to invoke and what should appear on the ledger. -type ChaincodeHeaderExtension struct { - // The ID of the chaincode to target. - ChaincodeId *ChaincodeID `protobuf:"bytes,2,opt,name=chaincode_id,json=chaincodeId,proto3" json:"chaincode_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ChaincodeHeaderExtension) Reset() { *m = ChaincodeHeaderExtension{} } -func (m *ChaincodeHeaderExtension) String() string { return proto.CompactTextString(m) } -func (*ChaincodeHeaderExtension) ProtoMessage() {} -func (*ChaincodeHeaderExtension) Descriptor() ([]byte, []int) { - return fileDescriptor_c4dbb4372a94bd5b, []int{2} -} - -func (m *ChaincodeHeaderExtension) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ChaincodeHeaderExtension.Unmarshal(m, b) -} -func (m *ChaincodeHeaderExtension) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ChaincodeHeaderExtension.Marshal(b, m, deterministic) -} -func (m *ChaincodeHeaderExtension) XXX_Merge(src proto.Message) { - xxx_messageInfo_ChaincodeHeaderExtension.Merge(m, src) -} -func (m *ChaincodeHeaderExtension) XXX_Size() int { - return xxx_messageInfo_ChaincodeHeaderExtension.Size(m) -} -func (m *ChaincodeHeaderExtension) XXX_DiscardUnknown() { - xxx_messageInfo_ChaincodeHeaderExtension.DiscardUnknown(m) -} - -var xxx_messageInfo_ChaincodeHeaderExtension proto.InternalMessageInfo - -func (m *ChaincodeHeaderExtension) GetChaincodeId() *ChaincodeID { - if m != nil { - return m.ChaincodeId - } - return nil -} - -// ChaincodeProposalPayload is the Proposal's payload message to be used when -// the Header's type is CHAINCODE. It contains the arguments for this -// invocation. -type ChaincodeProposalPayload struct { - // Input contains the arguments for this invocation. If this invocation - // deploys a new chaincode, ESCC/VSCC are part of this field. - // This is usually a marshaled ChaincodeInvocationSpec - Input []byte `protobuf:"bytes,1,opt,name=input,proto3" json:"input,omitempty"` - // TransientMap contains data (e.g. cryptographic material) that might be used - // to implement some form of application-level confidentiality. The contents - // of this field are supposed to always be omitted from the transaction and - // excluded from the ledger. - TransientMap map[string][]byte `protobuf:"bytes,2,rep,name=TransientMap,proto3" json:"TransientMap,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ChaincodeProposalPayload) Reset() { *m = ChaincodeProposalPayload{} } -func (m *ChaincodeProposalPayload) String() string { return proto.CompactTextString(m) } -func (*ChaincodeProposalPayload) ProtoMessage() {} -func (*ChaincodeProposalPayload) Descriptor() ([]byte, []int) { - return fileDescriptor_c4dbb4372a94bd5b, []int{3} -} - -func (m *ChaincodeProposalPayload) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ChaincodeProposalPayload.Unmarshal(m, b) -} -func (m *ChaincodeProposalPayload) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ChaincodeProposalPayload.Marshal(b, m, deterministic) -} -func (m *ChaincodeProposalPayload) XXX_Merge(src proto.Message) { - xxx_messageInfo_ChaincodeProposalPayload.Merge(m, src) -} -func (m *ChaincodeProposalPayload) XXX_Size() int { - return xxx_messageInfo_ChaincodeProposalPayload.Size(m) -} -func (m *ChaincodeProposalPayload) XXX_DiscardUnknown() { - xxx_messageInfo_ChaincodeProposalPayload.DiscardUnknown(m) -} - -var xxx_messageInfo_ChaincodeProposalPayload proto.InternalMessageInfo - -func (m *ChaincodeProposalPayload) GetInput() []byte { - if m != nil { - return m.Input - } - return nil -} - -func (m *ChaincodeProposalPayload) GetTransientMap() map[string][]byte { - if m != nil { - return m.TransientMap - } - return nil -} - -// ChaincodeAction contains the executed chaincode results, response, and event. -type ChaincodeAction struct { - // This field contains the read set and the write set produced by the - // chaincode executing this invocation. - Results []byte `protobuf:"bytes,1,opt,name=results,proto3" json:"results,omitempty"` - // This field contains the event generated by the chaincode. - // Only a single marshaled ChaincodeEvent is included. - Events []byte `protobuf:"bytes,2,opt,name=events,proto3" json:"events,omitempty"` - // This field contains the result of executing this invocation. - Response *Response `protobuf:"bytes,3,opt,name=response,proto3" json:"response,omitempty"` - // This field contains the ChaincodeID of executing this invocation. Endorser - // will set it with the ChaincodeID called by endorser while simulating proposal. - // Committer will validate the version matching with latest chaincode version. - // Adding ChaincodeID to keep version opens up the possibility of multiple - // ChaincodeAction per transaction. - ChaincodeId *ChaincodeID `protobuf:"bytes,4,opt,name=chaincode_id,json=chaincodeId,proto3" json:"chaincode_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ChaincodeAction) Reset() { *m = ChaincodeAction{} } -func (m *ChaincodeAction) String() string { return proto.CompactTextString(m) } -func (*ChaincodeAction) ProtoMessage() {} -func (*ChaincodeAction) Descriptor() ([]byte, []int) { - return fileDescriptor_c4dbb4372a94bd5b, []int{4} -} - -func (m *ChaincodeAction) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ChaincodeAction.Unmarshal(m, b) -} -func (m *ChaincodeAction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ChaincodeAction.Marshal(b, m, deterministic) -} -func (m *ChaincodeAction) XXX_Merge(src proto.Message) { - xxx_messageInfo_ChaincodeAction.Merge(m, src) -} -func (m *ChaincodeAction) XXX_Size() int { - return xxx_messageInfo_ChaincodeAction.Size(m) -} -func (m *ChaincodeAction) XXX_DiscardUnknown() { - xxx_messageInfo_ChaincodeAction.DiscardUnknown(m) -} - -var xxx_messageInfo_ChaincodeAction proto.InternalMessageInfo - -func (m *ChaincodeAction) GetResults() []byte { - if m != nil { - return m.Results - } - return nil -} - -func (m *ChaincodeAction) GetEvents() []byte { - if m != nil { - return m.Events - } - return nil -} - -func (m *ChaincodeAction) GetResponse() *Response { - if m != nil { - return m.Response - } - return nil -} - -func (m *ChaincodeAction) GetChaincodeId() *ChaincodeID { - if m != nil { - return m.ChaincodeId - } - return nil -} - -func init() { - proto.RegisterType((*SignedProposal)(nil), "protos.SignedProposal") - proto.RegisterType((*Proposal)(nil), "protos.Proposal") - proto.RegisterType((*ChaincodeHeaderExtension)(nil), "protos.ChaincodeHeaderExtension") - proto.RegisterType((*ChaincodeProposalPayload)(nil), "protos.ChaincodeProposalPayload") - proto.RegisterMapType((map[string][]byte)(nil), "protos.ChaincodeProposalPayload.TransientMapEntry") - proto.RegisterType((*ChaincodeAction)(nil), "protos.ChaincodeAction") -} - -func init() { proto.RegisterFile("peer/proposal.proto", fileDescriptor_c4dbb4372a94bd5b) } - -var fileDescriptor_c4dbb4372a94bd5b = []byte{ - // 462 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x53, 0xcf, 0x6b, 0xdb, 0x30, - 0x18, 0xc5, 0x69, 0x9b, 0xa6, 0x5f, 0xb2, 0xd6, 0x75, 0xcb, 0x30, 0xa1, 0x87, 0x62, 0x18, 0xf4, - 0xd0, 0x3a, 0x90, 0xc1, 0x18, 0xbb, 0x8c, 0x65, 0x2b, 0xac, 0x83, 0x41, 0xf1, 0x7e, 0x1c, 0x7a, - 0x09, 0xb2, 0xfd, 0xcd, 0x11, 0xf1, 0x24, 0x21, 0xc9, 0x61, 0xfe, 0xf3, 0x76, 0xdc, 0x7f, 0x35, - 0x64, 0x49, 0x6e, 0xba, 0x5c, 0x76, 0x4a, 0xbe, 0x1f, 0xef, 0xe9, 0x3d, 0x3d, 0x19, 0xce, 0x04, - 0xa2, 0x9c, 0x09, 0xc9, 0x05, 0x57, 0xa4, 0x4e, 0x85, 0xe4, 0x9a, 0x47, 0xc3, 0xee, 0x47, 0x4d, - 0xcf, 0xbb, 0x61, 0xb1, 0x22, 0x94, 0x15, 0xbc, 0x44, 0x3b, 0x9d, 0x5e, 0x3c, 0x81, 0x2c, 0x25, - 0x2a, 0xc1, 0x99, 0x72, 0xd3, 0xe4, 0x1b, 0x1c, 0x7f, 0xa1, 0x15, 0xc3, 0xf2, 0xde, 0x2d, 0x44, - 0x2f, 0xe0, 0xb8, 0x5f, 0xce, 0x5b, 0x8d, 0x2a, 0x0e, 0x2e, 0x83, 0xab, 0x49, 0xf6, 0xcc, 0x77, - 0x17, 0xa6, 0x19, 0x5d, 0xc0, 0x91, 0xa2, 0x15, 0x23, 0xba, 0x91, 0x18, 0x0f, 0xba, 0x8d, 0xc7, - 0x46, 0xf2, 0x00, 0xa3, 0x9e, 0xf0, 0x39, 0x0c, 0x57, 0x48, 0x4a, 0x94, 0x8e, 0xc8, 0x55, 0x51, - 0x0c, 0x87, 0x82, 0xb4, 0x35, 0x27, 0xa5, 0xc3, 0xfb, 0xd2, 0x70, 0xe3, 0x2f, 0x8d, 0x4c, 0x51, - 0xce, 0xe2, 0x3d, 0xcb, 0xdd, 0x37, 0x92, 0x35, 0xc4, 0xef, 0xbd, 0xc7, 0x8f, 0x1d, 0xd5, 0xad, - 0x9f, 0x45, 0xaf, 0x60, 0xd2, 0xfb, 0x5f, 0x52, 0x4b, 0x3c, 0x9e, 0x9f, 0x59, 0xb3, 0x2a, 0xed, - 0x71, 0x77, 0x1f, 0xb2, 0x71, 0xbf, 0x78, 0x57, 0x7e, 0xda, 0x1f, 0x05, 0xe1, 0x20, 0x3b, 0x75, - 0x02, 0x96, 0x1b, 0xaa, 0x72, 0x5a, 0x53, 0xdd, 0x26, 0x7f, 0x82, 0xad, 0xd3, 0xbc, 0xa5, 0x7b, - 0xa7, 0xf3, 0x1c, 0x0e, 0x28, 0x13, 0x8d, 0x76, 0xc6, 0x6c, 0x11, 0x7d, 0x87, 0xc9, 0x57, 0x49, - 0x98, 0xa2, 0xc8, 0xf4, 0x67, 0x22, 0xe2, 0xc1, 0xe5, 0xde, 0xd5, 0x78, 0x3e, 0xdf, 0xd1, 0xf0, - 0x0f, 0x5b, 0xba, 0x0d, 0xba, 0x65, 0x5a, 0xb6, 0xd9, 0x13, 0x9e, 0xe9, 0x5b, 0x38, 0xdd, 0x59, - 0x89, 0x42, 0xd8, 0x5b, 0x63, 0xdb, 0x09, 0x38, 0xca, 0xcc, 0x5f, 0x23, 0x6a, 0x43, 0xea, 0xc6, - 0x87, 0x62, 0x8b, 0x37, 0x83, 0xd7, 0x41, 0xf2, 0x3b, 0x80, 0x93, 0xfe, 0xf4, 0x77, 0x85, 0x36, - 0x17, 0x16, 0xc3, 0xa1, 0x44, 0xd5, 0xd4, 0xda, 0xc7, 0xec, 0x4b, 0x13, 0x1b, 0x6e, 0x90, 0x69, - 0xe5, 0x88, 0x5c, 0x15, 0x5d, 0xc3, 0xc8, 0xbf, 0xa1, 0x2e, 0x9b, 0xf1, 0x3c, 0xf4, 0xd6, 0x32, - 0xd7, 0xcf, 0xfa, 0x8d, 0x9d, 0x40, 0xf6, 0xff, 0x3b, 0x90, 0x83, 0x70, 0x98, 0x85, 0x9a, 0xaf, - 0x91, 0x2d, 0xb9, 0x40, 0x49, 0x8c, 0x5c, 0xb5, 0x28, 0x20, 0xe1, 0xb2, 0x4a, 0x57, 0xad, 0x40, - 0x59, 0x63, 0x59, 0xa1, 0x4c, 0x7f, 0x90, 0x5c, 0xd2, 0xc2, 0x33, 0x9a, 0xd7, 0xbe, 0x38, 0x79, - 0xbc, 0xdb, 0x62, 0x4d, 0x2a, 0x7c, 0xb8, 0xae, 0xa8, 0x5e, 0x35, 0x79, 0x5a, 0xf0, 0x9f, 0xb3, - 0x2d, 0xec, 0xcc, 0x62, 0x6f, 0x2c, 0xf6, 0xa6, 0xe2, 0x33, 0x03, 0xcf, 0xed, 0x07, 0xf5, 0xf2, - 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xe5, 0xf4, 0xc9, 0x9a, 0x6e, 0x03, 0x00, 0x00, -} diff --git a/vendor/github.com/hyperledger/fabric-protos-go/peer/proposal_response.pb.go b/vendor/github.com/hyperledger/fabric-protos-go/peer/proposal_response.pb.go deleted file mode 100644 index 23bcec37da7..00000000000 --- a/vendor/github.com/hyperledger/fabric-protos-go/peer/proposal_response.pb.go +++ /dev/null @@ -1,478 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: peer/proposal_response.proto - -package peer - -import ( - fmt "fmt" - proto "github.com/golang/protobuf/proto" - common "github.com/hyperledger/fabric-protos-go/common" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" - math "math" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package - -// A ProposalResponse is returned from an endorser to the proposal submitter. -// The idea is that this message contains the endorser's response to the -// request of a client to perform an action over a chaincode (or more -// generically on the ledger); the response might be success/error (conveyed in -// the Response field) together with a description of the action and a -// signature over it by that endorser. If a sufficient number of distinct -// endorsers agree on the same action and produce signature to that effect, a -// transaction can be generated and sent for ordering. -type ProposalResponse struct { - // Version indicates message protocol version - Version int32 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` - // Timestamp is the time that the message - // was created as defined by the sender - Timestamp *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - // A response message indicating whether the - // endorsement of the action was successful - Response *Response `protobuf:"bytes,4,opt,name=response,proto3" json:"response,omitempty"` - // The payload of response. It is the bytes of ProposalResponsePayload - Payload []byte `protobuf:"bytes,5,opt,name=payload,proto3" json:"payload,omitempty"` - // The endorsement of the proposal, basically - // the endorser's signature over the payload - Endorsement *Endorsement `protobuf:"bytes,6,opt,name=endorsement,proto3" json:"endorsement,omitempty"` - // The chaincode interest derived from simulating the proposal. - Interest *ChaincodeInterest `protobuf:"bytes,7,opt,name=interest,proto3" json:"interest,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ProposalResponse) Reset() { *m = ProposalResponse{} } -func (m *ProposalResponse) String() string { return proto.CompactTextString(m) } -func (*ProposalResponse) ProtoMessage() {} -func (*ProposalResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_2ed51030656d961a, []int{0} -} - -func (m *ProposalResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ProposalResponse.Unmarshal(m, b) -} -func (m *ProposalResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ProposalResponse.Marshal(b, m, deterministic) -} -func (m *ProposalResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ProposalResponse.Merge(m, src) -} -func (m *ProposalResponse) XXX_Size() int { - return xxx_messageInfo_ProposalResponse.Size(m) -} -func (m *ProposalResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ProposalResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_ProposalResponse proto.InternalMessageInfo - -func (m *ProposalResponse) GetVersion() int32 { - if m != nil { - return m.Version - } - return 0 -} - -func (m *ProposalResponse) GetTimestamp() *timestamppb.Timestamp { - if m != nil { - return m.Timestamp - } - return nil -} - -func (m *ProposalResponse) GetResponse() *Response { - if m != nil { - return m.Response - } - return nil -} - -func (m *ProposalResponse) GetPayload() []byte { - if m != nil { - return m.Payload - } - return nil -} - -func (m *ProposalResponse) GetEndorsement() *Endorsement { - if m != nil { - return m.Endorsement - } - return nil -} - -func (m *ProposalResponse) GetInterest() *ChaincodeInterest { - if m != nil { - return m.Interest - } - return nil -} - -// A response with a representation similar to an HTTP response that can -// be used within another message. -type Response struct { - // A status code that should follow the HTTP status codes. - Status int32 `protobuf:"varint,1,opt,name=status,proto3" json:"status,omitempty"` - // A message associated with the response code. - Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` - // A payload that can be used to include metadata with this response. - Payload []byte `protobuf:"bytes,3,opt,name=payload,proto3" json:"payload,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Response) Reset() { *m = Response{} } -func (m *Response) String() string { return proto.CompactTextString(m) } -func (*Response) ProtoMessage() {} -func (*Response) Descriptor() ([]byte, []int) { - return fileDescriptor_2ed51030656d961a, []int{1} -} - -func (m *Response) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Response.Unmarshal(m, b) -} -func (m *Response) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Response.Marshal(b, m, deterministic) -} -func (m *Response) XXX_Merge(src proto.Message) { - xxx_messageInfo_Response.Merge(m, src) -} -func (m *Response) XXX_Size() int { - return xxx_messageInfo_Response.Size(m) -} -func (m *Response) XXX_DiscardUnknown() { - xxx_messageInfo_Response.DiscardUnknown(m) -} - -var xxx_messageInfo_Response proto.InternalMessageInfo - -func (m *Response) GetStatus() int32 { - if m != nil { - return m.Status - } - return 0 -} - -func (m *Response) GetMessage() string { - if m != nil { - return m.Message - } - return "" -} - -func (m *Response) GetPayload() []byte { - if m != nil { - return m.Payload - } - return nil -} - -// ProposalResponsePayload is the payload of a proposal response. This message -// is the "bridge" between the client's request and the endorser's action in -// response to that request. Concretely, for chaincodes, it contains a hashed -// representation of the proposal (proposalHash) and a representation of the -// chaincode state changes and events inside the extension field. -type ProposalResponsePayload struct { - // Hash of the proposal that triggered this response. The hash is used to - // link a response with its proposal, both for bookeeping purposes on an - // asynchronous system and for security reasons (accountability, - // non-repudiation). The hash usually covers the entire Proposal message - // (byte-by-byte). - ProposalHash []byte `protobuf:"bytes,1,opt,name=proposal_hash,json=proposalHash,proto3" json:"proposal_hash,omitempty"` - // Extension should be unmarshaled to a type-specific message. The type of - // the extension in any proposal response depends on the type of the proposal - // that the client selected when the proposal was initially sent out. In - // particular, this information is stored in the type field of a Header. For - // chaincode, it's a ChaincodeAction message - Extension []byte `protobuf:"bytes,2,opt,name=extension,proto3" json:"extension,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ProposalResponsePayload) Reset() { *m = ProposalResponsePayload{} } -func (m *ProposalResponsePayload) String() string { return proto.CompactTextString(m) } -func (*ProposalResponsePayload) ProtoMessage() {} -func (*ProposalResponsePayload) Descriptor() ([]byte, []int) { - return fileDescriptor_2ed51030656d961a, []int{2} -} - -func (m *ProposalResponsePayload) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ProposalResponsePayload.Unmarshal(m, b) -} -func (m *ProposalResponsePayload) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ProposalResponsePayload.Marshal(b, m, deterministic) -} -func (m *ProposalResponsePayload) XXX_Merge(src proto.Message) { - xxx_messageInfo_ProposalResponsePayload.Merge(m, src) -} -func (m *ProposalResponsePayload) XXX_Size() int { - return xxx_messageInfo_ProposalResponsePayload.Size(m) -} -func (m *ProposalResponsePayload) XXX_DiscardUnknown() { - xxx_messageInfo_ProposalResponsePayload.DiscardUnknown(m) -} - -var xxx_messageInfo_ProposalResponsePayload proto.InternalMessageInfo - -func (m *ProposalResponsePayload) GetProposalHash() []byte { - if m != nil { - return m.ProposalHash - } - return nil -} - -func (m *ProposalResponsePayload) GetExtension() []byte { - if m != nil { - return m.Extension - } - return nil -} - -// An endorsement is a signature of an endorser over a proposal response. By -// producing an endorsement message, an endorser implicitly "approves" that -// proposal response and the actions contained therein. When enough -// endorsements have been collected, a transaction can be generated out of a -// set of proposal responses. Note that this message only contains an identity -// and a signature but no signed payload. This is intentional because -// endorsements are supposed to be collected in a transaction, and they are all -// expected to endorse a single proposal response/action (many endorsements -// over a single proposal response) -type Endorsement struct { - // Identity of the endorser (e.g. its certificate) - Endorser []byte `protobuf:"bytes,1,opt,name=endorser,proto3" json:"endorser,omitempty"` - // Signature of the payload included in ProposalResponse concatenated with - // the endorser's certificate; ie, sign(ProposalResponse.payload + endorser) - Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Endorsement) Reset() { *m = Endorsement{} } -func (m *Endorsement) String() string { return proto.CompactTextString(m) } -func (*Endorsement) ProtoMessage() {} -func (*Endorsement) Descriptor() ([]byte, []int) { - return fileDescriptor_2ed51030656d961a, []int{3} -} - -func (m *Endorsement) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Endorsement.Unmarshal(m, b) -} -func (m *Endorsement) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Endorsement.Marshal(b, m, deterministic) -} -func (m *Endorsement) XXX_Merge(src proto.Message) { - xxx_messageInfo_Endorsement.Merge(m, src) -} -func (m *Endorsement) XXX_Size() int { - return xxx_messageInfo_Endorsement.Size(m) -} -func (m *Endorsement) XXX_DiscardUnknown() { - xxx_messageInfo_Endorsement.DiscardUnknown(m) -} - -var xxx_messageInfo_Endorsement proto.InternalMessageInfo - -func (m *Endorsement) GetEndorser() []byte { - if m != nil { - return m.Endorser - } - return nil -} - -func (m *Endorsement) GetSignature() []byte { - if m != nil { - return m.Signature - } - return nil -} - -// ChaincodeInterest defines an interest about an endorsement -// for a specific single chaincode invocation. -// Multiple chaincodes indicate chaincode to chaincode invocations. -type ChaincodeInterest struct { - Chaincodes []*ChaincodeCall `protobuf:"bytes,1,rep,name=chaincodes,proto3" json:"chaincodes,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ChaincodeInterest) Reset() { *m = ChaincodeInterest{} } -func (m *ChaincodeInterest) String() string { return proto.CompactTextString(m) } -func (*ChaincodeInterest) ProtoMessage() {} -func (*ChaincodeInterest) Descriptor() ([]byte, []int) { - return fileDescriptor_2ed51030656d961a, []int{4} -} - -func (m *ChaincodeInterest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ChaincodeInterest.Unmarshal(m, b) -} -func (m *ChaincodeInterest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ChaincodeInterest.Marshal(b, m, deterministic) -} -func (m *ChaincodeInterest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ChaincodeInterest.Merge(m, src) -} -func (m *ChaincodeInterest) XXX_Size() int { - return xxx_messageInfo_ChaincodeInterest.Size(m) -} -func (m *ChaincodeInterest) XXX_DiscardUnknown() { - xxx_messageInfo_ChaincodeInterest.DiscardUnknown(m) -} - -var xxx_messageInfo_ChaincodeInterest proto.InternalMessageInfo - -func (m *ChaincodeInterest) GetChaincodes() []*ChaincodeCall { - if m != nil { - return m.Chaincodes - } - return nil -} - -// ChaincodeCall defines a call to a chaincode. -// It may have collections that are related to the chaincode -type ChaincodeCall struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - CollectionNames []string `protobuf:"bytes,2,rep,name=collection_names,json=collectionNames,proto3" json:"collection_names,omitempty"` - NoPrivateReads bool `protobuf:"varint,3,opt,name=no_private_reads,json=noPrivateReads,proto3" json:"no_private_reads,omitempty"` - NoPublicWrites bool `protobuf:"varint,4,opt,name=no_public_writes,json=noPublicWrites,proto3" json:"no_public_writes,omitempty"` - // The set of signature policies associated with states in the write-set - // that have state-based endorsement policies. - KeyPolicies []*common.SignaturePolicyEnvelope `protobuf:"bytes,5,rep,name=key_policies,json=keyPolicies,proto3" json:"key_policies,omitempty"` - // Indicates we wish to ignore the namespace endorsement policy - DisregardNamespacePolicy bool `protobuf:"varint,6,opt,name=disregard_namespace_policy,json=disregardNamespacePolicy,proto3" json:"disregard_namespace_policy,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ChaincodeCall) Reset() { *m = ChaincodeCall{} } -func (m *ChaincodeCall) String() string { return proto.CompactTextString(m) } -func (*ChaincodeCall) ProtoMessage() {} -func (*ChaincodeCall) Descriptor() ([]byte, []int) { - return fileDescriptor_2ed51030656d961a, []int{5} -} - -func (m *ChaincodeCall) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ChaincodeCall.Unmarshal(m, b) -} -func (m *ChaincodeCall) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ChaincodeCall.Marshal(b, m, deterministic) -} -func (m *ChaincodeCall) XXX_Merge(src proto.Message) { - xxx_messageInfo_ChaincodeCall.Merge(m, src) -} -func (m *ChaincodeCall) XXX_Size() int { - return xxx_messageInfo_ChaincodeCall.Size(m) -} -func (m *ChaincodeCall) XXX_DiscardUnknown() { - xxx_messageInfo_ChaincodeCall.DiscardUnknown(m) -} - -var xxx_messageInfo_ChaincodeCall proto.InternalMessageInfo - -func (m *ChaincodeCall) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *ChaincodeCall) GetCollectionNames() []string { - if m != nil { - return m.CollectionNames - } - return nil -} - -func (m *ChaincodeCall) GetNoPrivateReads() bool { - if m != nil { - return m.NoPrivateReads - } - return false -} - -func (m *ChaincodeCall) GetNoPublicWrites() bool { - if m != nil { - return m.NoPublicWrites - } - return false -} - -func (m *ChaincodeCall) GetKeyPolicies() []*common.SignaturePolicyEnvelope { - if m != nil { - return m.KeyPolicies - } - return nil -} - -func (m *ChaincodeCall) GetDisregardNamespacePolicy() bool { - if m != nil { - return m.DisregardNamespacePolicy - } - return false -} - -func init() { - proto.RegisterType((*ProposalResponse)(nil), "protos.ProposalResponse") - proto.RegisterType((*Response)(nil), "protos.Response") - proto.RegisterType((*ProposalResponsePayload)(nil), "protos.ProposalResponsePayload") - proto.RegisterType((*Endorsement)(nil), "protos.Endorsement") - proto.RegisterType((*ChaincodeInterest)(nil), "protos.ChaincodeInterest") - proto.RegisterType((*ChaincodeCall)(nil), "protos.ChaincodeCall") -} - -func init() { proto.RegisterFile("peer/proposal_response.proto", fileDescriptor_2ed51030656d961a) } - -var fileDescriptor_2ed51030656d961a = []byte{ - // 591 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x54, 0xdd, 0x6b, 0xdb, 0x3e, - 0x14, 0x25, 0xe9, 0x57, 0x72, 0x93, 0xfe, 0x7e, 0x99, 0x46, 0x37, 0x2f, 0x14, 0x1a, 0xbc, 0x97, - 0x0c, 0x5a, 0x1b, 0x3a, 0x0a, 0x7b, 0xd8, 0x53, 0x4b, 0xd9, 0xc7, 0x43, 0x09, 0xda, 0xd8, 0x60, - 0x0c, 0x82, 0x62, 0xdf, 0x3a, 0x22, 0xb6, 0x64, 0x24, 0x25, 0x9b, 0xff, 0x97, 0x3d, 0xee, 0x0f, - 0x1d, 0x96, 0x2c, 0x27, 0x5d, 0xf7, 0x64, 0xdf, 0xa3, 0x73, 0xcf, 0xbd, 0xf7, 0xe8, 0x03, 0x4e, - 0x4b, 0x44, 0x15, 0x97, 0x4a, 0x96, 0x52, 0xb3, 0x7c, 0xae, 0x50, 0x97, 0x52, 0x68, 0x8c, 0x4a, - 0x25, 0x8d, 0x24, 0x87, 0xf6, 0xa3, 0xc7, 0x67, 0x99, 0x94, 0x59, 0x8e, 0xb1, 0x0d, 0x17, 0xeb, - 0xfb, 0xd8, 0xf0, 0x02, 0xb5, 0x61, 0x45, 0xe9, 0x88, 0xe3, 0x93, 0x44, 0x16, 0x85, 0x14, 0x71, - 0x29, 0x73, 0x9e, 0x70, 0xd4, 0x0e, 0x0e, 0x7f, 0x75, 0x61, 0x34, 0x6b, 0xb4, 0x69, 0x23, 0x4d, - 0x02, 0x38, 0xda, 0xa0, 0xd2, 0x5c, 0x8a, 0xa0, 0x33, 0xe9, 0x4c, 0x0f, 0xa8, 0x0f, 0xc9, 0x1b, - 0xe8, 0xb7, 0xc2, 0x41, 0x77, 0xd2, 0x99, 0x0e, 0x2e, 0xc7, 0x91, 0x2b, 0x1d, 0xf9, 0xd2, 0xd1, - 0x67, 0xcf, 0xa0, 0x5b, 0x32, 0x39, 0x87, 0x9e, 0x6f, 0x3d, 0xd8, 0xb7, 0x89, 0x23, 0x97, 0xa1, - 0x23, 0x5f, 0x97, 0xb6, 0x8c, 0xba, 0x83, 0x92, 0x55, 0xb9, 0x64, 0x69, 0x70, 0x30, 0xe9, 0x4c, - 0x87, 0xd4, 0x87, 0xe4, 0x0a, 0x06, 0x28, 0x52, 0xa9, 0x34, 0x16, 0x28, 0x4c, 0x70, 0x68, 0xa5, - 0x9e, 0x7a, 0xa9, 0xdb, 0xed, 0x12, 0xdd, 0xe5, 0x91, 0x2b, 0xe8, 0x71, 0x61, 0x50, 0xa1, 0x36, - 0xc1, 0x91, 0xcd, 0x79, 0xe1, 0x73, 0x6e, 0x96, 0x8c, 0x8b, 0x44, 0xa6, 0xf8, 0xa1, 0x21, 0xd0, - 0x96, 0x1a, 0x7e, 0x81, 0x5e, 0xeb, 0xca, 0x33, 0x38, 0xd4, 0x86, 0x99, 0xb5, 0x6e, 0x4c, 0x69, - 0xa2, 0xba, 0xd7, 0x02, 0xb5, 0x66, 0x19, 0x5a, 0x47, 0xfa, 0xd4, 0x87, 0xbb, 0x53, 0xec, 0x3d, - 0x98, 0x22, 0xfc, 0x0e, 0xcf, 0xff, 0x76, 0x7d, 0xd6, 0x0c, 0xf8, 0x12, 0x8e, 0xdb, 0xcd, 0x5e, - 0x32, 0xbd, 0xb4, 0xd5, 0x86, 0x74, 0xe8, 0xc1, 0xf7, 0x4c, 0x2f, 0xc9, 0x29, 0xf4, 0xf1, 0xa7, - 0x41, 0x61, 0xf7, 0xa8, 0x6b, 0x09, 0x5b, 0x20, 0x7c, 0x07, 0x83, 0x1d, 0x23, 0xc8, 0x18, 0x7a, - 0x8d, 0x15, 0xaa, 0x11, 0x6b, 0xe3, 0x5a, 0x48, 0xf3, 0x4c, 0x30, 0xb3, 0x56, 0xe8, 0x85, 0x5a, - 0x20, 0xfc, 0x08, 0x4f, 0x1e, 0xb9, 0x43, 0xae, 0x00, 0x12, 0x0f, 0xd6, 0x5e, 0xec, 0x4d, 0x07, - 0x97, 0x27, 0x8f, 0xcc, 0xbc, 0x61, 0x79, 0x4e, 0x77, 0x88, 0xe1, 0xef, 0x2e, 0x1c, 0x3f, 0x58, - 0x25, 0x04, 0xf6, 0x05, 0x2b, 0xd0, 0xf6, 0xd4, 0xa7, 0xf6, 0x9f, 0xbc, 0x82, 0x51, 0x22, 0xf3, - 0x1c, 0x13, 0xc3, 0xa5, 0x98, 0xd7, 0x90, 0x0e, 0xba, 0x93, 0xbd, 0x69, 0x9f, 0xfe, 0xbf, 0xc5, - 0xef, 0x6a, 0x98, 0x4c, 0x61, 0x24, 0xe4, 0xbc, 0x54, 0x7c, 0xc3, 0x0c, 0xce, 0x15, 0xb2, 0x54, - 0x5b, 0x9b, 0x7b, 0xf4, 0x3f, 0x21, 0x67, 0x0e, 0xa6, 0x35, 0xea, 0x99, 0xeb, 0x45, 0xce, 0x93, - 0xf9, 0x0f, 0xc5, 0x0d, 0x6a, 0x7b, 0x06, 0x1d, 0xd3, 0xc2, 0x5f, 0x2d, 0x4a, 0xae, 0x61, 0xb8, - 0xc2, 0x6a, 0xee, 0x2f, 0x49, 0x70, 0x60, 0xa7, 0x3b, 0x8b, 0xdc, 0xe5, 0x89, 0x3e, 0x79, 0x67, - 0x66, 0x35, 0xa1, 0xba, 0x15, 0x1b, 0xcc, 0x65, 0x89, 0x74, 0xb0, 0xc2, 0x6a, 0xd6, 0xe4, 0x90, - 0xb7, 0x30, 0x4e, 0xb9, 0x56, 0x98, 0x31, 0x95, 0xba, 0x09, 0x4a, 0x96, 0xa0, 0xd3, 0xac, 0xec, - 0x81, 0xed, 0xd1, 0xa0, 0x65, 0xdc, 0x79, 0x82, 0x93, 0xbc, 0x5e, 0x41, 0x28, 0x55, 0x16, 0x2d, - 0xab, 0x12, 0x55, 0x8e, 0x69, 0x86, 0x2a, 0xba, 0x67, 0x0b, 0xc5, 0x13, 0xef, 0x70, 0xfd, 0x1c, - 0x5c, 0xff, 0xe3, 0xf4, 0x24, 0x2b, 0x96, 0xe1, 0xb7, 0xf3, 0x8c, 0x9b, 0xe5, 0x7a, 0x51, 0x37, - 0x1c, 0xef, 0x68, 0xc4, 0x4e, 0xe3, 0xc2, 0x69, 0x5c, 0x64, 0x32, 0xae, 0x65, 0x16, 0xee, 0xf5, - 0x78, 0xfd, 0x27, 0x00, 0x00, 0xff, 0xff, 0x6d, 0x2e, 0xf7, 0xb3, 0x64, 0x04, 0x00, 0x00, -} diff --git a/vendor/github.com/hyperledger/fabric-protos-go/peer/query.pb.go b/vendor/github.com/hyperledger/fabric-protos-go/peer/query.pb.go deleted file mode 100644 index ae38ca3e80d..00000000000 --- a/vendor/github.com/hyperledger/fabric-protos-go/peer/query.pb.go +++ /dev/null @@ -1,334 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: peer/query.proto - -package peer - -import ( - fmt "fmt" - proto "github.com/golang/protobuf/proto" - math "math" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package - -// ChaincodeQueryResponse returns information about each chaincode that pertains -// to a query in lscc.go, such as GetChaincodes (returns all chaincodes -// instantiated on a channel), and GetInstalledChaincodes (returns all chaincodes -// installed on a peer) -type ChaincodeQueryResponse struct { - Chaincodes []*ChaincodeInfo `protobuf:"bytes,1,rep,name=chaincodes,proto3" json:"chaincodes,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ChaincodeQueryResponse) Reset() { *m = ChaincodeQueryResponse{} } -func (m *ChaincodeQueryResponse) String() string { return proto.CompactTextString(m) } -func (*ChaincodeQueryResponse) ProtoMessage() {} -func (*ChaincodeQueryResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d45bcf7fe2423301, []int{0} -} - -func (m *ChaincodeQueryResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ChaincodeQueryResponse.Unmarshal(m, b) -} -func (m *ChaincodeQueryResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ChaincodeQueryResponse.Marshal(b, m, deterministic) -} -func (m *ChaincodeQueryResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ChaincodeQueryResponse.Merge(m, src) -} -func (m *ChaincodeQueryResponse) XXX_Size() int { - return xxx_messageInfo_ChaincodeQueryResponse.Size(m) -} -func (m *ChaincodeQueryResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ChaincodeQueryResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_ChaincodeQueryResponse proto.InternalMessageInfo - -func (m *ChaincodeQueryResponse) GetChaincodes() []*ChaincodeInfo { - if m != nil { - return m.Chaincodes - } - return nil -} - -// ChaincodeInfo contains general information about an installed/instantiated -// chaincode -type ChaincodeInfo struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` - // the path as specified by the install/instantiate transaction - Path string `protobuf:"bytes,3,opt,name=path,proto3" json:"path,omitempty"` - // the chaincode function upon instantiation and its arguments. This will be - // blank if the query is returning information about installed chaincodes. - Input string `protobuf:"bytes,4,opt,name=input,proto3" json:"input,omitempty"` - // the name of the ESCC for this chaincode. This will be - // blank if the query is returning information about installed chaincodes. - Escc string `protobuf:"bytes,5,opt,name=escc,proto3" json:"escc,omitempty"` - // the name of the VSCC for this chaincode. This will be - // blank if the query is returning information about installed chaincodes. - Vscc string `protobuf:"bytes,6,opt,name=vscc,proto3" json:"vscc,omitempty"` - // the chaincode unique id. - // computed as: H( - // - // H(name || version) || - // H(CodePackage) - // ) - Id []byte `protobuf:"bytes,7,opt,name=id,proto3" json:"id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ChaincodeInfo) Reset() { *m = ChaincodeInfo{} } -func (m *ChaincodeInfo) String() string { return proto.CompactTextString(m) } -func (*ChaincodeInfo) ProtoMessage() {} -func (*ChaincodeInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_d45bcf7fe2423301, []int{1} -} - -func (m *ChaincodeInfo) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ChaincodeInfo.Unmarshal(m, b) -} -func (m *ChaincodeInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ChaincodeInfo.Marshal(b, m, deterministic) -} -func (m *ChaincodeInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_ChaincodeInfo.Merge(m, src) -} -func (m *ChaincodeInfo) XXX_Size() int { - return xxx_messageInfo_ChaincodeInfo.Size(m) -} -func (m *ChaincodeInfo) XXX_DiscardUnknown() { - xxx_messageInfo_ChaincodeInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_ChaincodeInfo proto.InternalMessageInfo - -func (m *ChaincodeInfo) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *ChaincodeInfo) GetVersion() string { - if m != nil { - return m.Version - } - return "" -} - -func (m *ChaincodeInfo) GetPath() string { - if m != nil { - return m.Path - } - return "" -} - -func (m *ChaincodeInfo) GetInput() string { - if m != nil { - return m.Input - } - return "" -} - -func (m *ChaincodeInfo) GetEscc() string { - if m != nil { - return m.Escc - } - return "" -} - -func (m *ChaincodeInfo) GetVscc() string { - if m != nil { - return m.Vscc - } - return "" -} - -func (m *ChaincodeInfo) GetId() []byte { - if m != nil { - return m.Id - } - return nil -} - -// ChannelQueryResponse returns information about each channel that pertains -// to a query in lscc.go, such as GetChannels (returns all channels for a -// given peer) -type ChannelQueryResponse struct { - Channels []*ChannelInfo `protobuf:"bytes,1,rep,name=channels,proto3" json:"channels,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ChannelQueryResponse) Reset() { *m = ChannelQueryResponse{} } -func (m *ChannelQueryResponse) String() string { return proto.CompactTextString(m) } -func (*ChannelQueryResponse) ProtoMessage() {} -func (*ChannelQueryResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d45bcf7fe2423301, []int{2} -} - -func (m *ChannelQueryResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ChannelQueryResponse.Unmarshal(m, b) -} -func (m *ChannelQueryResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ChannelQueryResponse.Marshal(b, m, deterministic) -} -func (m *ChannelQueryResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ChannelQueryResponse.Merge(m, src) -} -func (m *ChannelQueryResponse) XXX_Size() int { - return xxx_messageInfo_ChannelQueryResponse.Size(m) -} -func (m *ChannelQueryResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ChannelQueryResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_ChannelQueryResponse proto.InternalMessageInfo - -func (m *ChannelQueryResponse) GetChannels() []*ChannelInfo { - if m != nil { - return m.Channels - } - return nil -} - -// ChannelInfo contains general information about channels -type ChannelInfo struct { - ChannelId string `protobuf:"bytes,1,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ChannelInfo) Reset() { *m = ChannelInfo{} } -func (m *ChannelInfo) String() string { return proto.CompactTextString(m) } -func (*ChannelInfo) ProtoMessage() {} -func (*ChannelInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_d45bcf7fe2423301, []int{3} -} - -func (m *ChannelInfo) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ChannelInfo.Unmarshal(m, b) -} -func (m *ChannelInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ChannelInfo.Marshal(b, m, deterministic) -} -func (m *ChannelInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_ChannelInfo.Merge(m, src) -} -func (m *ChannelInfo) XXX_Size() int { - return xxx_messageInfo_ChannelInfo.Size(m) -} -func (m *ChannelInfo) XXX_DiscardUnknown() { - xxx_messageInfo_ChannelInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_ChannelInfo proto.InternalMessageInfo - -func (m *ChannelInfo) GetChannelId() string { - if m != nil { - return m.ChannelId - } - return "" -} - -// JoinBySnapshotStatus contains information about whether or a JoinBySnapshot operation -// is in progress and the related bootstrap dir if it is running. -type JoinBySnapshotStatus struct { - InProgress bool `protobuf:"varint,1,opt,name=in_progress,json=inProgress,proto3" json:"in_progress,omitempty"` - BootstrappingSnapshotDir string `protobuf:"bytes,2,opt,name=bootstrapping_snapshot_dir,json=bootstrappingSnapshotDir,proto3" json:"bootstrapping_snapshot_dir,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *JoinBySnapshotStatus) Reset() { *m = JoinBySnapshotStatus{} } -func (m *JoinBySnapshotStatus) String() string { return proto.CompactTextString(m) } -func (*JoinBySnapshotStatus) ProtoMessage() {} -func (*JoinBySnapshotStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_d45bcf7fe2423301, []int{4} -} - -func (m *JoinBySnapshotStatus) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_JoinBySnapshotStatus.Unmarshal(m, b) -} -func (m *JoinBySnapshotStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_JoinBySnapshotStatus.Marshal(b, m, deterministic) -} -func (m *JoinBySnapshotStatus) XXX_Merge(src proto.Message) { - xxx_messageInfo_JoinBySnapshotStatus.Merge(m, src) -} -func (m *JoinBySnapshotStatus) XXX_Size() int { - return xxx_messageInfo_JoinBySnapshotStatus.Size(m) -} -func (m *JoinBySnapshotStatus) XXX_DiscardUnknown() { - xxx_messageInfo_JoinBySnapshotStatus.DiscardUnknown(m) -} - -var xxx_messageInfo_JoinBySnapshotStatus proto.InternalMessageInfo - -func (m *JoinBySnapshotStatus) GetInProgress() bool { - if m != nil { - return m.InProgress - } - return false -} - -func (m *JoinBySnapshotStatus) GetBootstrappingSnapshotDir() string { - if m != nil { - return m.BootstrappingSnapshotDir - } - return "" -} - -func init() { - proto.RegisterType((*ChaincodeQueryResponse)(nil), "protos.ChaincodeQueryResponse") - proto.RegisterType((*ChaincodeInfo)(nil), "protos.ChaincodeInfo") - proto.RegisterType((*ChannelQueryResponse)(nil), "protos.ChannelQueryResponse") - proto.RegisterType((*ChannelInfo)(nil), "protos.ChannelInfo") - proto.RegisterType((*JoinBySnapshotStatus)(nil), "protos.JoinBySnapshotStatus") -} - -func init() { proto.RegisterFile("peer/query.proto", fileDescriptor_d45bcf7fe2423301) } - -var fileDescriptor_d45bcf7fe2423301 = []byte{ - // 366 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x92, 0xcf, 0x6a, 0xe3, 0x30, - 0x10, 0x87, 0x71, 0xfe, 0x67, 0xb2, 0xbb, 0x2c, 0x6a, 0x5a, 0x44, 0xa1, 0x34, 0xf8, 0x94, 0x43, - 0x62, 0x43, 0x4b, 0x6f, 0x3d, 0x25, 0x85, 0x92, 0x5e, 0xda, 0x3a, 0xb7, 0x5e, 0x8c, 0x6c, 0x2b, - 0xb6, 0x20, 0x91, 0x54, 0x49, 0x0e, 0xe4, 0x69, 0xfa, 0xaa, 0x45, 0x96, 0x1d, 0x9c, 0x93, 0x67, - 0xbe, 0xf9, 0xc6, 0xe2, 0x27, 0x04, 0xff, 0x25, 0xa5, 0x2a, 0xfc, 0x2e, 0xa9, 0x3a, 0x05, 0x52, - 0x09, 0x23, 0xd0, 0xa0, 0xfa, 0x68, 0xff, 0x1d, 0x6e, 0xd6, 0x05, 0x61, 0x3c, 0x15, 0x19, 0xfd, - 0xb4, 0xf3, 0x88, 0x6a, 0x29, 0xb8, 0xa6, 0xe8, 0x09, 0x20, 0x6d, 0x26, 0x1a, 0x7b, 0xb3, 0xee, - 0x7c, 0xf2, 0x70, 0xed, 0xb6, 0x75, 0x70, 0xde, 0xd9, 0xf0, 0x9d, 0x88, 0x5a, 0xa2, 0xff, 0xe3, - 0xc1, 0xdf, 0x8b, 0x29, 0x42, 0xd0, 0xe3, 0xe4, 0x40, 0xb1, 0x37, 0xf3, 0xe6, 0xe3, 0xa8, 0xaa, - 0x11, 0x86, 0xe1, 0x91, 0x2a, 0xcd, 0x04, 0xc7, 0x9d, 0x0a, 0x37, 0xad, 0xb5, 0x25, 0x31, 0x05, - 0xee, 0x3a, 0xdb, 0xd6, 0x68, 0x0a, 0x7d, 0xc6, 0x65, 0x69, 0x70, 0xaf, 0x82, 0xae, 0xb1, 0x26, - 0xd5, 0x69, 0x8a, 0xfb, 0xce, 0xb4, 0xb5, 0x65, 0x47, 0xcb, 0x06, 0x8e, 0xd9, 0x1a, 0xfd, 0x83, - 0x0e, 0xcb, 0xf0, 0x70, 0xe6, 0xcd, 0xff, 0x44, 0x1d, 0x96, 0xf9, 0xaf, 0x30, 0x5d, 0x17, 0x84, - 0x73, 0xba, 0xbf, 0x0c, 0x1c, 0xc2, 0x28, 0x75, 0xbc, 0x89, 0x7b, 0xd5, 0x8a, 0x6b, 0x79, 0x15, - 0xf6, 0x2c, 0xf9, 0x0b, 0x98, 0xb4, 0x06, 0xe8, 0xae, 0xba, 0x30, 0xdb, 0xc6, 0x2c, 0xab, 0xd3, - 0x8e, 0x6b, 0xb2, 0xc9, 0xfc, 0x12, 0xa6, 0x6f, 0x82, 0xf1, 0xd5, 0x69, 0xcb, 0x89, 0xd4, 0x85, - 0x30, 0x5b, 0x43, 0x4c, 0xa9, 0xd1, 0x3d, 0x4c, 0x18, 0x8f, 0xa5, 0x12, 0xb9, 0xa2, 0x5a, 0x57, - 0x7b, 0xa3, 0x08, 0x18, 0xff, 0xa8, 0x09, 0x7a, 0x86, 0xdb, 0x44, 0x08, 0xa3, 0x8d, 0x22, 0x52, - 0x32, 0x9e, 0xc7, 0xba, 0xfe, 0x41, 0x9c, 0x31, 0x55, 0x5f, 0x1f, 0xbe, 0x30, 0x9a, 0x13, 0x5e, - 0x98, 0x5a, 0x45, 0xe0, 0x0b, 0x95, 0x07, 0xc5, 0x49, 0x52, 0xb5, 0xa7, 0x59, 0x4e, 0x55, 0xb0, - 0x23, 0x89, 0x62, 0x69, 0x93, 0xcd, 0x3e, 0x8d, 0xaf, 0x45, 0xce, 0x4c, 0x51, 0x26, 0x41, 0x2a, - 0x0e, 0x61, 0x4b, 0x0d, 0x9d, 0xba, 0x74, 0xea, 0x32, 0x17, 0xa1, 0xb5, 0x13, 0xf7, 0x78, 0x1e, - 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x2c, 0x43, 0x94, 0x8d, 0x57, 0x02, 0x00, 0x00, -} diff --git a/vendor/github.com/hyperledger/fabric-protos-go/peer/resources.pb.go b/vendor/github.com/hyperledger/fabric-protos-go/peer/resources.pb.go deleted file mode 100644 index abd54c9be73..00000000000 --- a/vendor/github.com/hyperledger/fabric-protos-go/peer/resources.pb.go +++ /dev/null @@ -1,292 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: peer/resources.proto - -package peer - -import ( - fmt "fmt" - proto "github.com/golang/protobuf/proto" - common "github.com/hyperledger/fabric-protos-go/common" - math "math" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package - -// ChaincodeIdentifier identifies a piece of chaincode. For a peer to accept invocations of -// this chaincode, the hash of the installed code must match, as must the version string -// included with the install command. -type ChaincodeIdentifier struct { - Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` - Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ChaincodeIdentifier) Reset() { *m = ChaincodeIdentifier{} } -func (m *ChaincodeIdentifier) String() string { return proto.CompactTextString(m) } -func (*ChaincodeIdentifier) ProtoMessage() {} -func (*ChaincodeIdentifier) Descriptor() ([]byte, []int) { - return fileDescriptor_4991d8496920b696, []int{0} -} - -func (m *ChaincodeIdentifier) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ChaincodeIdentifier.Unmarshal(m, b) -} -func (m *ChaincodeIdentifier) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ChaincodeIdentifier.Marshal(b, m, deterministic) -} -func (m *ChaincodeIdentifier) XXX_Merge(src proto.Message) { - xxx_messageInfo_ChaincodeIdentifier.Merge(m, src) -} -func (m *ChaincodeIdentifier) XXX_Size() int { - return xxx_messageInfo_ChaincodeIdentifier.Size(m) -} -func (m *ChaincodeIdentifier) XXX_DiscardUnknown() { - xxx_messageInfo_ChaincodeIdentifier.DiscardUnknown(m) -} - -var xxx_messageInfo_ChaincodeIdentifier proto.InternalMessageInfo - -func (m *ChaincodeIdentifier) GetHash() []byte { - if m != nil { - return m.Hash - } - return nil -} - -func (m *ChaincodeIdentifier) GetVersion() string { - if m != nil { - return m.Version - } - return "" -} - -// ChaincodeValidation instructs the peer how transactions for this chaincode should be -// validated. The only validation mechanism which ships with fabric today is the standard -// 'vscc' validation mechanism. This built in validation method utilizes an endorsement policy -// which checks that a sufficient number of signatures have been included. The 'arguement' -// field encodes any parameters required by the validation implementation. -type ChaincodeValidation struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Argument []byte `protobuf:"bytes,2,opt,name=argument,proto3" json:"argument,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ChaincodeValidation) Reset() { *m = ChaincodeValidation{} } -func (m *ChaincodeValidation) String() string { return proto.CompactTextString(m) } -func (*ChaincodeValidation) ProtoMessage() {} -func (*ChaincodeValidation) Descriptor() ([]byte, []int) { - return fileDescriptor_4991d8496920b696, []int{1} -} - -func (m *ChaincodeValidation) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ChaincodeValidation.Unmarshal(m, b) -} -func (m *ChaincodeValidation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ChaincodeValidation.Marshal(b, m, deterministic) -} -func (m *ChaincodeValidation) XXX_Merge(src proto.Message) { - xxx_messageInfo_ChaincodeValidation.Merge(m, src) -} -func (m *ChaincodeValidation) XXX_Size() int { - return xxx_messageInfo_ChaincodeValidation.Size(m) -} -func (m *ChaincodeValidation) XXX_DiscardUnknown() { - xxx_messageInfo_ChaincodeValidation.DiscardUnknown(m) -} - -var xxx_messageInfo_ChaincodeValidation proto.InternalMessageInfo - -func (m *ChaincodeValidation) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *ChaincodeValidation) GetArgument() []byte { - if m != nil { - return m.Argument - } - return nil -} - -// VSCCArgs is passed (marshaled) as a parameter to the VSCC imlementation via the -// argument field of the ChaincodeValidation message. -type VSCCArgs struct { - EndorsementPolicyRef string `protobuf:"bytes,1,opt,name=endorsement_policy_ref,json=endorsementPolicyRef,proto3" json:"endorsement_policy_ref,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *VSCCArgs) Reset() { *m = VSCCArgs{} } -func (m *VSCCArgs) String() string { return proto.CompactTextString(m) } -func (*VSCCArgs) ProtoMessage() {} -func (*VSCCArgs) Descriptor() ([]byte, []int) { - return fileDescriptor_4991d8496920b696, []int{2} -} - -func (m *VSCCArgs) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_VSCCArgs.Unmarshal(m, b) -} -func (m *VSCCArgs) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_VSCCArgs.Marshal(b, m, deterministic) -} -func (m *VSCCArgs) XXX_Merge(src proto.Message) { - xxx_messageInfo_VSCCArgs.Merge(m, src) -} -func (m *VSCCArgs) XXX_Size() int { - return xxx_messageInfo_VSCCArgs.Size(m) -} -func (m *VSCCArgs) XXX_DiscardUnknown() { - xxx_messageInfo_VSCCArgs.DiscardUnknown(m) -} - -var xxx_messageInfo_VSCCArgs proto.InternalMessageInfo - -func (m *VSCCArgs) GetEndorsementPolicyRef() string { - if m != nil { - return m.EndorsementPolicyRef - } - return "" -} - -// ChaincodeEndorsement instructs the peer how transactions should be endorsed. The only -// endorsement mechanism which ships with the fabric today is the standard 'escc' mechanism. -// This code simply simulates the proposal to generate a RW set, then signs the result -// using the peer's local signing identity. -type ChaincodeEndorsement struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ChaincodeEndorsement) Reset() { *m = ChaincodeEndorsement{} } -func (m *ChaincodeEndorsement) String() string { return proto.CompactTextString(m) } -func (*ChaincodeEndorsement) ProtoMessage() {} -func (*ChaincodeEndorsement) Descriptor() ([]byte, []int) { - return fileDescriptor_4991d8496920b696, []int{3} -} - -func (m *ChaincodeEndorsement) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ChaincodeEndorsement.Unmarshal(m, b) -} -func (m *ChaincodeEndorsement) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ChaincodeEndorsement.Marshal(b, m, deterministic) -} -func (m *ChaincodeEndorsement) XXX_Merge(src proto.Message) { - xxx_messageInfo_ChaincodeEndorsement.Merge(m, src) -} -func (m *ChaincodeEndorsement) XXX_Size() int { - return xxx_messageInfo_ChaincodeEndorsement.Size(m) -} -func (m *ChaincodeEndorsement) XXX_DiscardUnknown() { - xxx_messageInfo_ChaincodeEndorsement.DiscardUnknown(m) -} - -var xxx_messageInfo_ChaincodeEndorsement proto.InternalMessageInfo - -func (m *ChaincodeEndorsement) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -// ConfigTree encapsulates channel and resources configuration of a channel. -// Both configurations are represented as common.Config -type ConfigTree struct { - ChannelConfig *common.Config `protobuf:"bytes,1,opt,name=channel_config,json=channelConfig,proto3" json:"channel_config,omitempty"` - ResourcesConfig *common.Config `protobuf:"bytes,2,opt,name=resources_config,json=resourcesConfig,proto3" json:"resources_config,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ConfigTree) Reset() { *m = ConfigTree{} } -func (m *ConfigTree) String() string { return proto.CompactTextString(m) } -func (*ConfigTree) ProtoMessage() {} -func (*ConfigTree) Descriptor() ([]byte, []int) { - return fileDescriptor_4991d8496920b696, []int{4} -} - -func (m *ConfigTree) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ConfigTree.Unmarshal(m, b) -} -func (m *ConfigTree) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ConfigTree.Marshal(b, m, deterministic) -} -func (m *ConfigTree) XXX_Merge(src proto.Message) { - xxx_messageInfo_ConfigTree.Merge(m, src) -} -func (m *ConfigTree) XXX_Size() int { - return xxx_messageInfo_ConfigTree.Size(m) -} -func (m *ConfigTree) XXX_DiscardUnknown() { - xxx_messageInfo_ConfigTree.DiscardUnknown(m) -} - -var xxx_messageInfo_ConfigTree proto.InternalMessageInfo - -func (m *ConfigTree) GetChannelConfig() *common.Config { - if m != nil { - return m.ChannelConfig - } - return nil -} - -func (m *ConfigTree) GetResourcesConfig() *common.Config { - if m != nil { - return m.ResourcesConfig - } - return nil -} - -func init() { - proto.RegisterType((*ChaincodeIdentifier)(nil), "protos.ChaincodeIdentifier") - proto.RegisterType((*ChaincodeValidation)(nil), "protos.ChaincodeValidation") - proto.RegisterType((*VSCCArgs)(nil), "protos.VSCCArgs") - proto.RegisterType((*ChaincodeEndorsement)(nil), "protos.ChaincodeEndorsement") - proto.RegisterType((*ConfigTree)(nil), "protos.ConfigTree") -} - -func init() { proto.RegisterFile("peer/resources.proto", fileDescriptor_4991d8496920b696) } - -var fileDescriptor_4991d8496920b696 = []byte{ - // 327 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x91, 0x3f, 0x4f, 0xc3, 0x30, - 0x10, 0xc5, 0xd5, 0x0a, 0x41, 0x6b, 0x4a, 0x41, 0xa6, 0xa0, 0xaa, 0x53, 0x95, 0xa9, 0x42, 0x34, - 0x91, 0xf8, 0x33, 0xb0, 0x01, 0x51, 0x07, 0x36, 0x64, 0x50, 0x07, 0x96, 0xca, 0x75, 0x2e, 0x8e, - 0xa5, 0xc4, 0x8e, 0xce, 0x29, 0xa2, 0x0b, 0x9f, 0x1d, 0xc5, 0x6e, 0x43, 0x86, 0x4e, 0xbe, 0xf3, - 0xfb, 0xdd, 0xd3, 0xe9, 0x1d, 0x19, 0x95, 0x00, 0x18, 0x21, 0x58, 0xb3, 0x41, 0x01, 0x36, 0x2c, - 0xd1, 0x54, 0x86, 0x1e, 0xbb, 0xc7, 0x4e, 0xae, 0x84, 0x29, 0x0a, 0xa3, 0x23, 0x61, 0x74, 0xaa, - 0x64, 0xf5, 0xe3, 0xe5, 0x20, 0x26, 0x97, 0x71, 0xc6, 0x95, 0x16, 0x26, 0x81, 0xb7, 0x04, 0x74, - 0xa5, 0x52, 0x05, 0x48, 0x29, 0x39, 0xca, 0xb8, 0xcd, 0xc6, 0x9d, 0x69, 0x67, 0x36, 0x60, 0xae, - 0xa6, 0x63, 0x72, 0xf2, 0x0d, 0x68, 0x95, 0xd1, 0xe3, 0xee, 0xb4, 0x33, 0xeb, 0xb3, 0x7d, 0x1b, - 0x2c, 0x5a, 0x26, 0x4b, 0x9e, 0xab, 0x84, 0x57, 0xca, 0xe8, 0xda, 0x44, 0xf3, 0x02, 0x9c, 0x49, - 0x9f, 0xb9, 0x9a, 0x4e, 0x48, 0x8f, 0xa3, 0xdc, 0x14, 0xa0, 0x2b, 0xe7, 0x32, 0x60, 0x4d, 0x1f, - 0x3c, 0x93, 0xde, 0xf2, 0x23, 0x8e, 0x5f, 0x50, 0x5a, 0xfa, 0x40, 0xae, 0x41, 0x27, 0x06, 0x2d, - 0xd4, 0xd2, 0xaa, 0x34, 0xb9, 0x12, 0xdb, 0x15, 0x42, 0xba, 0x73, 0x1b, 0xb5, 0xd4, 0x77, 0x27, - 0x32, 0x48, 0x83, 0x1b, 0x32, 0x6a, 0x16, 0x59, 0xfc, 0x03, 0x87, 0x36, 0x09, 0x7e, 0x09, 0x89, - 0x5d, 0x16, 0x9f, 0x08, 0x40, 0x1f, 0xc9, 0x50, 0x64, 0x5c, 0x6b, 0xc8, 0x57, 0x3e, 0x21, 0xc7, - 0x9e, 0xde, 0x0d, 0x43, 0x9f, 0x5b, 0xe8, 0x59, 0x76, 0xb6, 0xa3, 0x7c, 0x4b, 0x9f, 0xc8, 0x45, - 0x13, 0xf8, 0x7e, 0xb0, 0x7b, 0x70, 0xf0, 0xbc, 0xe1, 0xfc, 0xc7, 0x2b, 0x23, 0x81, 0x41, 0x19, - 0x66, 0xdb, 0x12, 0x30, 0x87, 0x44, 0x02, 0x86, 0x29, 0x5f, 0xa3, 0x12, 0xfe, 0x32, 0x36, 0xac, - 0xcf, 0xf9, 0x75, 0x2b, 0x55, 0x95, 0x6d, 0xd6, 0xb5, 0x59, 0xd4, 0x42, 0x23, 0x8f, 0xce, 0x3d, - 0x3a, 0x97, 0x26, 0xaa, 0xe9, 0xb5, 0x3f, 0xf6, 0xfd, 0x5f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xae, - 0x32, 0x27, 0x0c, 0x0b, 0x02, 0x00, 0x00, -} diff --git a/vendor/github.com/hyperledger/fabric-protos-go/peer/signed_cc_dep_spec.pb.go b/vendor/github.com/hyperledger/fabric-protos-go/peer/signed_cc_dep_spec.pb.go deleted file mode 100644 index 460d8bafe68..00000000000 --- a/vendor/github.com/hyperledger/fabric-protos-go/peer/signed_cc_dep_spec.pb.go +++ /dev/null @@ -1,112 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: peer/signed_cc_dep_spec.proto - -package peer - -import ( - fmt "fmt" - proto "github.com/golang/protobuf/proto" - math "math" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package - -// SignedChaincodeDeploymentSpec carries the CDS along with endorsements -type SignedChaincodeDeploymentSpec struct { - // This is the bytes of the ChaincodeDeploymentSpec - ChaincodeDeploymentSpec []byte `protobuf:"bytes,1,opt,name=chaincode_deployment_spec,json=chaincodeDeploymentSpec,proto3" json:"chaincode_deployment_spec,omitempty"` - // This is the instantiation policy which is identical in structure - // to endorsement policy. This policy is checked by the VSCC at commit - // time on the instantiation (all peers will get the same policy as it - // will be part of the LSCC instantation record and will be part of the - // hash as well) - InstantiationPolicy []byte `protobuf:"bytes,2,opt,name=instantiation_policy,json=instantiationPolicy,proto3" json:"instantiation_policy,omitempty"` - // The endorsements of the above deployment spec, the owner's signature over - // chaincode_deployment_spec and Endorsement.endorser. - OwnerEndorsements []*Endorsement `protobuf:"bytes,3,rep,name=owner_endorsements,json=ownerEndorsements,proto3" json:"owner_endorsements,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SignedChaincodeDeploymentSpec) Reset() { *m = SignedChaincodeDeploymentSpec{} } -func (m *SignedChaincodeDeploymentSpec) String() string { return proto.CompactTextString(m) } -func (*SignedChaincodeDeploymentSpec) ProtoMessage() {} -func (*SignedChaincodeDeploymentSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_e007a7c0644e7e6f, []int{0} -} - -func (m *SignedChaincodeDeploymentSpec) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SignedChaincodeDeploymentSpec.Unmarshal(m, b) -} -func (m *SignedChaincodeDeploymentSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SignedChaincodeDeploymentSpec.Marshal(b, m, deterministic) -} -func (m *SignedChaincodeDeploymentSpec) XXX_Merge(src proto.Message) { - xxx_messageInfo_SignedChaincodeDeploymentSpec.Merge(m, src) -} -func (m *SignedChaincodeDeploymentSpec) XXX_Size() int { - return xxx_messageInfo_SignedChaincodeDeploymentSpec.Size(m) -} -func (m *SignedChaincodeDeploymentSpec) XXX_DiscardUnknown() { - xxx_messageInfo_SignedChaincodeDeploymentSpec.DiscardUnknown(m) -} - -var xxx_messageInfo_SignedChaincodeDeploymentSpec proto.InternalMessageInfo - -func (m *SignedChaincodeDeploymentSpec) GetChaincodeDeploymentSpec() []byte { - if m != nil { - return m.ChaincodeDeploymentSpec - } - return nil -} - -func (m *SignedChaincodeDeploymentSpec) GetInstantiationPolicy() []byte { - if m != nil { - return m.InstantiationPolicy - } - return nil -} - -func (m *SignedChaincodeDeploymentSpec) GetOwnerEndorsements() []*Endorsement { - if m != nil { - return m.OwnerEndorsements - } - return nil -} - -func init() { - proto.RegisterType((*SignedChaincodeDeploymentSpec)(nil), "protos.SignedChaincodeDeploymentSpec") -} - -func init() { proto.RegisterFile("peer/signed_cc_dep_spec.proto", fileDescriptor_e007a7c0644e7e6f) } - -var fileDescriptor_e007a7c0644e7e6f = []byte{ - // 258 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x90, 0x41, 0x4b, 0xf3, 0x40, - 0x10, 0x86, 0xc9, 0x57, 0xf8, 0x0e, 0xab, 0x17, 0x53, 0xc1, 0x28, 0x16, 0x4a, 0x4f, 0x3d, 0xd8, - 0x04, 0xf5, 0xe6, 0xb1, 0xea, 0x5d, 0xd2, 0x9b, 0x97, 0x25, 0x99, 0x8c, 0xc9, 0x42, 0xba, 0x33, - 0xcc, 0xac, 0x48, 0xfe, 0xa6, 0xbf, 0x48, 0xb2, 0xb1, 0x58, 0x0f, 0x9e, 0x16, 0xf6, 0x79, 0xde, - 0x99, 0xe1, 0x35, 0x0b, 0x46, 0x94, 0x42, 0x5d, 0xeb, 0xb1, 0xb1, 0x00, 0xb6, 0x41, 0xb6, 0xca, - 0x08, 0x39, 0x0b, 0x05, 0x4a, 0xff, 0xc7, 0x47, 0xaf, 0xae, 0xa3, 0xc6, 0x42, 0x4c, 0x5a, 0xf5, - 0x56, 0x50, 0x99, 0xbc, 0xe2, 0x64, 0xad, 0x3e, 0x13, 0xb3, 0xd8, 0xc5, 0x11, 0x8f, 0x5d, 0xe5, - 0x3c, 0x50, 0x83, 0x4f, 0xc8, 0x3d, 0x0d, 0x7b, 0xf4, 0x61, 0xc7, 0x08, 0xe9, 0x83, 0xb9, 0x84, - 0x03, 0x1a, 0x77, 0x7c, 0xb3, 0xb8, 0x2a, 0x4b, 0x96, 0xc9, 0xfa, 0xb4, 0xbc, 0x80, 0x3f, 0xb2, - 0xb7, 0xe6, 0xdc, 0x79, 0x0d, 0x95, 0x0f, 0xae, 0x0a, 0x8e, 0xbc, 0x65, 0xea, 0x1d, 0x0c, 0xd9, - 0xbf, 0x18, 0x9b, 0xff, 0x62, 0x2f, 0x11, 0xa5, 0x5b, 0x93, 0xd2, 0x87, 0x47, 0xb1, 0xe8, 0x1b, - 0x12, 0xc5, 0x71, 0x96, 0x66, 0xb3, 0xe5, 0x6c, 0x7d, 0x72, 0x37, 0x9f, 0x8e, 0xd6, 0xfc, 0xf9, - 0x87, 0x95, 0x67, 0x51, 0x3f, 0xfa, 0xd1, 0x6d, 0x69, 0x56, 0x24, 0x6d, 0xde, 0x0d, 0x8c, 0xd2, - 0x63, 0xd3, 0xa2, 0xe4, 0x6f, 0x55, 0x2d, 0x0e, 0x0e, 0xf9, 0xb1, 0x92, 0xd7, 0x9b, 0xd6, 0x85, - 0xee, 0xbd, 0xce, 0x81, 0xf6, 0xc5, 0x91, 0x5a, 0x4c, 0xea, 0x66, 0x52, 0x37, 0x2d, 0x15, 0xa3, - 0x5d, 0x4f, 0x75, 0xde, 0x7f, 0x05, 0x00, 0x00, 0xff, 0xff, 0xa0, 0xc6, 0x22, 0xdb, 0x76, 0x01, - 0x00, 0x00, -} diff --git a/vendor/github.com/hyperledger/fabric-protos-go/peer/snapshot.pb.go b/vendor/github.com/hyperledger/fabric-protos-go/peer/snapshot.pb.go deleted file mode 100644 index f8612a082f2..00000000000 --- a/vendor/github.com/hyperledger/fabric-protos-go/peer/snapshot.pb.go +++ /dev/null @@ -1,422 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: peer/snapshot.proto - -package peer - -import ( - context "context" - fmt "fmt" - proto "github.com/golang/protobuf/proto" - common "github.com/hyperledger/fabric-protos-go/common" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - emptypb "google.golang.org/protobuf/types/known/emptypb" - math "math" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package - -// SnapshotRequest contains information for a generate/cancel snapshot request -type SnapshotRequest struct { - // The signature header that contains creator identity and nonce - SignatureHeader *common.SignatureHeader `protobuf:"bytes,1,opt,name=signature_header,json=signatureHeader,proto3" json:"signature_header,omitempty"` - // The channel ID - ChannelId string `protobuf:"bytes,2,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` - // The block number to generate a snapshot - BlockNumber uint64 `protobuf:"varint,3,opt,name=block_number,json=blockNumber,proto3" json:"block_number,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SnapshotRequest) Reset() { *m = SnapshotRequest{} } -func (m *SnapshotRequest) String() string { return proto.CompactTextString(m) } -func (*SnapshotRequest) ProtoMessage() {} -func (*SnapshotRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_d05a247df97d1516, []int{0} -} - -func (m *SnapshotRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SnapshotRequest.Unmarshal(m, b) -} -func (m *SnapshotRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SnapshotRequest.Marshal(b, m, deterministic) -} -func (m *SnapshotRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_SnapshotRequest.Merge(m, src) -} -func (m *SnapshotRequest) XXX_Size() int { - return xxx_messageInfo_SnapshotRequest.Size(m) -} -func (m *SnapshotRequest) XXX_DiscardUnknown() { - xxx_messageInfo_SnapshotRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_SnapshotRequest proto.InternalMessageInfo - -func (m *SnapshotRequest) GetSignatureHeader() *common.SignatureHeader { - if m != nil { - return m.SignatureHeader - } - return nil -} - -func (m *SnapshotRequest) GetChannelId() string { - if m != nil { - return m.ChannelId - } - return "" -} - -func (m *SnapshotRequest) GetBlockNumber() uint64 { - if m != nil { - return m.BlockNumber - } - return 0 -} - -// SnapshotQuery contains information for a query snapshot request -type SnapshotQuery struct { - // The signature header that contains creator identity and nonce - SignatureHeader *common.SignatureHeader `protobuf:"bytes,1,opt,name=signature_header,json=signatureHeader,proto3" json:"signature_header,omitempty"` - // The channel ID - ChannelId string `protobuf:"bytes,2,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SnapshotQuery) Reset() { *m = SnapshotQuery{} } -func (m *SnapshotQuery) String() string { return proto.CompactTextString(m) } -func (*SnapshotQuery) ProtoMessage() {} -func (*SnapshotQuery) Descriptor() ([]byte, []int) { - return fileDescriptor_d05a247df97d1516, []int{1} -} - -func (m *SnapshotQuery) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SnapshotQuery.Unmarshal(m, b) -} -func (m *SnapshotQuery) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SnapshotQuery.Marshal(b, m, deterministic) -} -func (m *SnapshotQuery) XXX_Merge(src proto.Message) { - xxx_messageInfo_SnapshotQuery.Merge(m, src) -} -func (m *SnapshotQuery) XXX_Size() int { - return xxx_messageInfo_SnapshotQuery.Size(m) -} -func (m *SnapshotQuery) XXX_DiscardUnknown() { - xxx_messageInfo_SnapshotQuery.DiscardUnknown(m) -} - -var xxx_messageInfo_SnapshotQuery proto.InternalMessageInfo - -func (m *SnapshotQuery) GetSignatureHeader() *common.SignatureHeader { - if m != nil { - return m.SignatureHeader - } - return nil -} - -func (m *SnapshotQuery) GetChannelId() string { - if m != nil { - return m.ChannelId - } - return "" -} - -// SignedSnapshotRequest contains marshalled request bytes and signature -type SignedSnapshotRequest struct { - // The bytes of SnapshotRequest or SnapshotQuery - Request []byte `protobuf:"bytes,1,opt,name=request,proto3" json:"request,omitempty"` - // Signaure over request bytes; this signature is to be verified against the client identity - Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SignedSnapshotRequest) Reset() { *m = SignedSnapshotRequest{} } -func (m *SignedSnapshotRequest) String() string { return proto.CompactTextString(m) } -func (*SignedSnapshotRequest) ProtoMessage() {} -func (*SignedSnapshotRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_d05a247df97d1516, []int{2} -} - -func (m *SignedSnapshotRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SignedSnapshotRequest.Unmarshal(m, b) -} -func (m *SignedSnapshotRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SignedSnapshotRequest.Marshal(b, m, deterministic) -} -func (m *SignedSnapshotRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_SignedSnapshotRequest.Merge(m, src) -} -func (m *SignedSnapshotRequest) XXX_Size() int { - return xxx_messageInfo_SignedSnapshotRequest.Size(m) -} -func (m *SignedSnapshotRequest) XXX_DiscardUnknown() { - xxx_messageInfo_SignedSnapshotRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_SignedSnapshotRequest proto.InternalMessageInfo - -func (m *SignedSnapshotRequest) GetRequest() []byte { - if m != nil { - return m.Request - } - return nil -} - -func (m *SignedSnapshotRequest) GetSignature() []byte { - if m != nil { - return m.Signature - } - return nil -} - -// QueryPendingSnapshotsResponse specifies the response payload of a query pending snapshots request -type QueryPendingSnapshotsResponse struct { - BlockNumbers []uint64 `protobuf:"varint,1,rep,packed,name=block_numbers,json=blockNumbers,proto3" json:"block_numbers,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *QueryPendingSnapshotsResponse) Reset() { *m = QueryPendingSnapshotsResponse{} } -func (m *QueryPendingSnapshotsResponse) String() string { return proto.CompactTextString(m) } -func (*QueryPendingSnapshotsResponse) ProtoMessage() {} -func (*QueryPendingSnapshotsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d05a247df97d1516, []int{3} -} - -func (m *QueryPendingSnapshotsResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_QueryPendingSnapshotsResponse.Unmarshal(m, b) -} -func (m *QueryPendingSnapshotsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_QueryPendingSnapshotsResponse.Marshal(b, m, deterministic) -} -func (m *QueryPendingSnapshotsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryPendingSnapshotsResponse.Merge(m, src) -} -func (m *QueryPendingSnapshotsResponse) XXX_Size() int { - return xxx_messageInfo_QueryPendingSnapshotsResponse.Size(m) -} -func (m *QueryPendingSnapshotsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryPendingSnapshotsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryPendingSnapshotsResponse proto.InternalMessageInfo - -func (m *QueryPendingSnapshotsResponse) GetBlockNumbers() []uint64 { - if m != nil { - return m.BlockNumbers - } - return nil -} - -func init() { - proto.RegisterType((*SnapshotRequest)(nil), "protos.SnapshotRequest") - proto.RegisterType((*SnapshotQuery)(nil), "protos.SnapshotQuery") - proto.RegisterType((*SignedSnapshotRequest)(nil), "protos.SignedSnapshotRequest") - proto.RegisterType((*QueryPendingSnapshotsResponse)(nil), "protos.QueryPendingSnapshotsResponse") -} - -func init() { proto.RegisterFile("peer/snapshot.proto", fileDescriptor_d05a247df97d1516) } - -var fileDescriptor_d05a247df97d1516 = []byte{ - // 398 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x53, 0xcb, 0x8e, 0xd3, 0x30, - 0x14, 0x9d, 0x30, 0xa3, 0x61, 0x7a, 0x27, 0x55, 0x91, 0x2b, 0x20, 0x2a, 0x54, 0x0a, 0x41, 0x48, - 0x59, 0x50, 0x47, 0x2a, 0x5f, 0x40, 0x0b, 0x02, 0x36, 0x3c, 0xdc, 0x05, 0x12, 0x9b, 0x2a, 0x8f, - 0x5b, 0x27, 0x22, 0xb1, 0x83, 0x9d, 0x2c, 0xfa, 0x25, 0x7c, 0x24, 0x3f, 0x81, 0x62, 0xd7, 0x10, - 0x10, 0x02, 0x89, 0xc5, 0xac, 0x1c, 0x9f, 0x7b, 0x7c, 0x7c, 0x72, 0x7c, 0x2f, 0xcc, 0x5b, 0x44, - 0x95, 0x68, 0x91, 0xb6, 0xba, 0x94, 0x1d, 0x6d, 0x95, 0xec, 0x24, 0xb9, 0x34, 0x8b, 0x5e, 0x3c, - 0xe0, 0x52, 0xf2, 0x1a, 0x13, 0xb3, 0xcd, 0xfa, 0x43, 0x82, 0x4d, 0xdb, 0x1d, 0x2d, 0x69, 0x31, - 0xcf, 0x65, 0xd3, 0x48, 0x91, 0xd8, 0xc5, 0x82, 0xd1, 0x57, 0x0f, 0x66, 0xbb, 0x93, 0x18, 0xc3, - 0x2f, 0x3d, 0xea, 0x8e, 0x6c, 0xe0, 0x8e, 0xae, 0xb8, 0x48, 0xbb, 0x5e, 0xe1, 0xbe, 0xc4, 0xb4, - 0x40, 0x15, 0x78, 0xa1, 0x17, 0x5f, 0xaf, 0xef, 0xd3, 0xd3, 0xe1, 0x9d, 0xab, 0xbf, 0x36, 0x65, - 0x36, 0xd3, 0xbf, 0x02, 0x64, 0x09, 0x90, 0x97, 0xa9, 0x10, 0x58, 0xef, 0xab, 0x22, 0xb8, 0x15, - 0x7a, 0xf1, 0x84, 0x4d, 0x4e, 0xc8, 0x9b, 0x82, 0x3c, 0x02, 0x3f, 0xab, 0x65, 0xfe, 0x79, 0x2f, - 0xfa, 0x26, 0x43, 0x15, 0x9c, 0x87, 0x5e, 0x7c, 0xc1, 0xae, 0x0d, 0xf6, 0xd6, 0x40, 0x91, 0x82, - 0xa9, 0x33, 0xf6, 0xa1, 0x47, 0x75, 0xbc, 0x01, 0x5b, 0xd1, 0x3b, 0xb8, 0x3b, 0x48, 0x60, 0xf1, - 0x7b, 0x24, 0x01, 0xdc, 0x56, 0xf6, 0xd3, 0x5c, 0xe9, 0x33, 0xb7, 0x25, 0x0f, 0x61, 0xf2, 0xe3, - 0x12, 0x23, 0xe8, 0xb3, 0x9f, 0x40, 0xf4, 0x02, 0x96, 0xc6, 0xfc, 0x7b, 0x14, 0x45, 0x25, 0xb8, - 0x93, 0xd5, 0x0c, 0x75, 0x2b, 0x85, 0x46, 0xf2, 0x18, 0xa6, 0xe3, 0x20, 0x74, 0xe0, 0x85, 0xe7, - 0xf1, 0x05, 0xf3, 0x47, 0x49, 0xe8, 0xf5, 0x37, 0x0f, 0xae, 0xdc, 0x51, 0xb2, 0x85, 0xab, 0x57, - 0x28, 0x50, 0xa5, 0x1d, 0x92, 0xa5, 0x7d, 0x45, 0x4d, 0xff, 0xe8, 0x7a, 0x71, 0x8f, 0xda, 0x7e, - 0xa0, 0xae, 0x1f, 0xe8, 0xcb, 0xa1, 0x1f, 0xa2, 0x33, 0xf2, 0x1c, 0x2e, 0xb7, 0xa9, 0xc8, 0xb1, - 0xfe, 0x7f, 0x89, 0x8f, 0x30, 0x1d, 0xff, 0x9a, 0xfe, 0x97, 0xd2, 0x13, 0x57, 0xfe, 0x6b, 0x20, - 0xd1, 0xd9, 0x86, 0x41, 0x24, 0x15, 0xa7, 0xe5, 0xb1, 0x45, 0x55, 0x63, 0xc1, 0x51, 0xd1, 0x43, - 0x9a, 0xa9, 0x2a, 0x77, 0x02, 0xc3, 0x04, 0x7c, 0x7a, 0xca, 0xab, 0xae, 0xec, 0xb3, 0xe1, 0xe5, - 0x93, 0x11, 0x35, 0xb1, 0xd4, 0x95, 0xa5, 0xae, 0xb8, 0x4c, 0x06, 0x76, 0x66, 0x07, 0xe4, 0xd9, - 0xf7, 0x00, 0x00, 0x00, 0xff, 0xff, 0x2f, 0x39, 0x38, 0xb5, 0x3e, 0x03, 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// SnapshotClient is the client API for Snapshot service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type SnapshotClient interface { - // Generate a snapshot reqeust. SignedSnapshotRequest contains marshalled bytes for SnaphostRequest - Generate(ctx context.Context, in *SignedSnapshotRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) - // Cancel a snapshot reqeust. SignedSnapshotRequest contains marshalled bytes for SnaphostRequest - Cancel(ctx context.Context, in *SignedSnapshotRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) - // Query pending snapshots query. SignedSnapshotRequest contains marshalled bytes for SnaphostQuery - QueryPendings(ctx context.Context, in *SignedSnapshotRequest, opts ...grpc.CallOption) (*QueryPendingSnapshotsResponse, error) -} - -type snapshotClient struct { - cc *grpc.ClientConn -} - -func NewSnapshotClient(cc *grpc.ClientConn) SnapshotClient { - return &snapshotClient{cc} -} - -func (c *snapshotClient) Generate(ctx context.Context, in *SignedSnapshotRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { - out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, "/protos.Snapshot/Generate", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *snapshotClient) Cancel(ctx context.Context, in *SignedSnapshotRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { - out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, "/protos.Snapshot/Cancel", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *snapshotClient) QueryPendings(ctx context.Context, in *SignedSnapshotRequest, opts ...grpc.CallOption) (*QueryPendingSnapshotsResponse, error) { - out := new(QueryPendingSnapshotsResponse) - err := c.cc.Invoke(ctx, "/protos.Snapshot/QueryPendings", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// SnapshotServer is the server API for Snapshot service. -type SnapshotServer interface { - // Generate a snapshot reqeust. SignedSnapshotRequest contains marshalled bytes for SnaphostRequest - Generate(context.Context, *SignedSnapshotRequest) (*emptypb.Empty, error) - // Cancel a snapshot reqeust. SignedSnapshotRequest contains marshalled bytes for SnaphostRequest - Cancel(context.Context, *SignedSnapshotRequest) (*emptypb.Empty, error) - // Query pending snapshots query. SignedSnapshotRequest contains marshalled bytes for SnaphostQuery - QueryPendings(context.Context, *SignedSnapshotRequest) (*QueryPendingSnapshotsResponse, error) -} - -// UnimplementedSnapshotServer can be embedded to have forward compatible implementations. -type UnimplementedSnapshotServer struct { -} - -func (*UnimplementedSnapshotServer) Generate(ctx context.Context, req *SignedSnapshotRequest) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method Generate not implemented") -} -func (*UnimplementedSnapshotServer) Cancel(ctx context.Context, req *SignedSnapshotRequest) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method Cancel not implemented") -} -func (*UnimplementedSnapshotServer) QueryPendings(ctx context.Context, req *SignedSnapshotRequest) (*QueryPendingSnapshotsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method QueryPendings not implemented") -} - -func RegisterSnapshotServer(s *grpc.Server, srv SnapshotServer) { - s.RegisterService(&_Snapshot_serviceDesc, srv) -} - -func _Snapshot_Generate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SignedSnapshotRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(SnapshotServer).Generate(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/protos.Snapshot/Generate", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(SnapshotServer).Generate(ctx, req.(*SignedSnapshotRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Snapshot_Cancel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SignedSnapshotRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(SnapshotServer).Cancel(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/protos.Snapshot/Cancel", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(SnapshotServer).Cancel(ctx, req.(*SignedSnapshotRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Snapshot_QueryPendings_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SignedSnapshotRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(SnapshotServer).QueryPendings(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/protos.Snapshot/QueryPendings", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(SnapshotServer).QueryPendings(ctx, req.(*SignedSnapshotRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Snapshot_serviceDesc = grpc.ServiceDesc{ - ServiceName: "protos.Snapshot", - HandlerType: (*SnapshotServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Generate", - Handler: _Snapshot_Generate_Handler, - }, - { - MethodName: "Cancel", - Handler: _Snapshot_Cancel_Handler, - }, - { - MethodName: "QueryPendings", - Handler: _Snapshot_QueryPendings_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "peer/snapshot.proto", -} diff --git a/vendor/github.com/hyperledger/fabric-protos-go/peer/transaction.pb.go b/vendor/github.com/hyperledger/fabric-protos-go/peer/transaction.pb.go deleted file mode 100644 index 47b879cf352..00000000000 --- a/vendor/github.com/hyperledger/fabric-protos-go/peer/transaction.pb.go +++ /dev/null @@ -1,494 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: peer/transaction.proto - -package peer - -import ( - fmt "fmt" - proto "github.com/golang/protobuf/proto" - common "github.com/hyperledger/fabric-protos-go/common" - math "math" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package - -type TxValidationCode int32 - -const ( - TxValidationCode_VALID TxValidationCode = 0 - TxValidationCode_NIL_ENVELOPE TxValidationCode = 1 - TxValidationCode_BAD_PAYLOAD TxValidationCode = 2 - TxValidationCode_BAD_COMMON_HEADER TxValidationCode = 3 - TxValidationCode_BAD_CREATOR_SIGNATURE TxValidationCode = 4 - TxValidationCode_INVALID_ENDORSER_TRANSACTION TxValidationCode = 5 - TxValidationCode_INVALID_CONFIG_TRANSACTION TxValidationCode = 6 - TxValidationCode_UNSUPPORTED_TX_PAYLOAD TxValidationCode = 7 - TxValidationCode_BAD_PROPOSAL_TXID TxValidationCode = 8 - TxValidationCode_DUPLICATE_TXID TxValidationCode = 9 - TxValidationCode_ENDORSEMENT_POLICY_FAILURE TxValidationCode = 10 - TxValidationCode_MVCC_READ_CONFLICT TxValidationCode = 11 - TxValidationCode_PHANTOM_READ_CONFLICT TxValidationCode = 12 - TxValidationCode_UNKNOWN_TX_TYPE TxValidationCode = 13 - TxValidationCode_TARGET_CHAIN_NOT_FOUND TxValidationCode = 14 - TxValidationCode_MARSHAL_TX_ERROR TxValidationCode = 15 - TxValidationCode_NIL_TXACTION TxValidationCode = 16 - TxValidationCode_EXPIRED_CHAINCODE TxValidationCode = 17 - TxValidationCode_CHAINCODE_VERSION_CONFLICT TxValidationCode = 18 - TxValidationCode_BAD_HEADER_EXTENSION TxValidationCode = 19 - TxValidationCode_BAD_CHANNEL_HEADER TxValidationCode = 20 - TxValidationCode_BAD_RESPONSE_PAYLOAD TxValidationCode = 21 - TxValidationCode_BAD_RWSET TxValidationCode = 22 - TxValidationCode_ILLEGAL_WRITESET TxValidationCode = 23 - TxValidationCode_INVALID_WRITESET TxValidationCode = 24 - TxValidationCode_INVALID_CHAINCODE TxValidationCode = 25 - TxValidationCode_NOT_VALIDATED TxValidationCode = 254 - TxValidationCode_INVALID_OTHER_REASON TxValidationCode = 255 -) - -var TxValidationCode_name = map[int32]string{ - 0: "VALID", - 1: "NIL_ENVELOPE", - 2: "BAD_PAYLOAD", - 3: "BAD_COMMON_HEADER", - 4: "BAD_CREATOR_SIGNATURE", - 5: "INVALID_ENDORSER_TRANSACTION", - 6: "INVALID_CONFIG_TRANSACTION", - 7: "UNSUPPORTED_TX_PAYLOAD", - 8: "BAD_PROPOSAL_TXID", - 9: "DUPLICATE_TXID", - 10: "ENDORSEMENT_POLICY_FAILURE", - 11: "MVCC_READ_CONFLICT", - 12: "PHANTOM_READ_CONFLICT", - 13: "UNKNOWN_TX_TYPE", - 14: "TARGET_CHAIN_NOT_FOUND", - 15: "MARSHAL_TX_ERROR", - 16: "NIL_TXACTION", - 17: "EXPIRED_CHAINCODE", - 18: "CHAINCODE_VERSION_CONFLICT", - 19: "BAD_HEADER_EXTENSION", - 20: "BAD_CHANNEL_HEADER", - 21: "BAD_RESPONSE_PAYLOAD", - 22: "BAD_RWSET", - 23: "ILLEGAL_WRITESET", - 24: "INVALID_WRITESET", - 25: "INVALID_CHAINCODE", - 254: "NOT_VALIDATED", - 255: "INVALID_OTHER_REASON", -} - -var TxValidationCode_value = map[string]int32{ - "VALID": 0, - "NIL_ENVELOPE": 1, - "BAD_PAYLOAD": 2, - "BAD_COMMON_HEADER": 3, - "BAD_CREATOR_SIGNATURE": 4, - "INVALID_ENDORSER_TRANSACTION": 5, - "INVALID_CONFIG_TRANSACTION": 6, - "UNSUPPORTED_TX_PAYLOAD": 7, - "BAD_PROPOSAL_TXID": 8, - "DUPLICATE_TXID": 9, - "ENDORSEMENT_POLICY_FAILURE": 10, - "MVCC_READ_CONFLICT": 11, - "PHANTOM_READ_CONFLICT": 12, - "UNKNOWN_TX_TYPE": 13, - "TARGET_CHAIN_NOT_FOUND": 14, - "MARSHAL_TX_ERROR": 15, - "NIL_TXACTION": 16, - "EXPIRED_CHAINCODE": 17, - "CHAINCODE_VERSION_CONFLICT": 18, - "BAD_HEADER_EXTENSION": 19, - "BAD_CHANNEL_HEADER": 20, - "BAD_RESPONSE_PAYLOAD": 21, - "BAD_RWSET": 22, - "ILLEGAL_WRITESET": 23, - "INVALID_WRITESET": 24, - "INVALID_CHAINCODE": 25, - "NOT_VALIDATED": 254, - "INVALID_OTHER_REASON": 255, -} - -func (x TxValidationCode) String() string { - return proto.EnumName(TxValidationCode_name, int32(x)) -} - -func (TxValidationCode) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_25804bbfb0752368, []int{0} -} - -// Reserved entries in the key-level metadata map -type MetaDataKeys int32 - -const ( - MetaDataKeys_VALIDATION_PARAMETER MetaDataKeys = 0 - MetaDataKeys_VALIDATION_PARAMETER_V2 MetaDataKeys = 1 -) - -var MetaDataKeys_name = map[int32]string{ - 0: "VALIDATION_PARAMETER", - 1: "VALIDATION_PARAMETER_V2", -} - -var MetaDataKeys_value = map[string]int32{ - "VALIDATION_PARAMETER": 0, - "VALIDATION_PARAMETER_V2": 1, -} - -func (x MetaDataKeys) String() string { - return proto.EnumName(MetaDataKeys_name, int32(x)) -} - -func (MetaDataKeys) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_25804bbfb0752368, []int{1} -} - -// ProcessedTransaction wraps an Envelope that includes a transaction along with an indication -// of whether the transaction was validated or invalidated by committing peer. -// The use case is that GetTransactionByID API needs to retrieve the transaction Envelope -// from block storage, and return it to a client, and indicate whether the transaction -// was validated or invalidated by committing peer. So that the originally submitted -// transaction Envelope is not modified, the ProcessedTransaction wrapper is returned. -type ProcessedTransaction struct { - // An Envelope which includes a processed transaction - TransactionEnvelope *common.Envelope `protobuf:"bytes,1,opt,name=transactionEnvelope,proto3" json:"transactionEnvelope,omitempty"` - // An indication of whether the transaction was validated or invalidated by committing peer - ValidationCode int32 `protobuf:"varint,2,opt,name=validationCode,proto3" json:"validationCode,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ProcessedTransaction) Reset() { *m = ProcessedTransaction{} } -func (m *ProcessedTransaction) String() string { return proto.CompactTextString(m) } -func (*ProcessedTransaction) ProtoMessage() {} -func (*ProcessedTransaction) Descriptor() ([]byte, []int) { - return fileDescriptor_25804bbfb0752368, []int{0} -} - -func (m *ProcessedTransaction) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ProcessedTransaction.Unmarshal(m, b) -} -func (m *ProcessedTransaction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ProcessedTransaction.Marshal(b, m, deterministic) -} -func (m *ProcessedTransaction) XXX_Merge(src proto.Message) { - xxx_messageInfo_ProcessedTransaction.Merge(m, src) -} -func (m *ProcessedTransaction) XXX_Size() int { - return xxx_messageInfo_ProcessedTransaction.Size(m) -} -func (m *ProcessedTransaction) XXX_DiscardUnknown() { - xxx_messageInfo_ProcessedTransaction.DiscardUnknown(m) -} - -var xxx_messageInfo_ProcessedTransaction proto.InternalMessageInfo - -func (m *ProcessedTransaction) GetTransactionEnvelope() *common.Envelope { - if m != nil { - return m.TransactionEnvelope - } - return nil -} - -func (m *ProcessedTransaction) GetValidationCode() int32 { - if m != nil { - return m.ValidationCode - } - return 0 -} - -// The transaction to be sent to the ordering service. A transaction contains -// one or more TransactionAction. Each TransactionAction binds a proposal to -// potentially multiple actions. The transaction is atomic meaning that either -// all actions in the transaction will be committed or none will. Note that -// while a Transaction might include more than one Header, the Header.creator -// field must be the same in each. -// A single client is free to issue a number of independent Proposal, each with -// their header (Header) and request payload (ChaincodeProposalPayload). Each -// proposal is independently endorsed generating an action -// (ProposalResponsePayload) with one signature per Endorser. Any number of -// independent proposals (and their action) might be included in a transaction -// to ensure that they are treated atomically. -type Transaction struct { - // The payload is an array of TransactionAction. An array is necessary to - // accommodate multiple actions per transaction - Actions []*TransactionAction `protobuf:"bytes,1,rep,name=actions,proto3" json:"actions,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Transaction) Reset() { *m = Transaction{} } -func (m *Transaction) String() string { return proto.CompactTextString(m) } -func (*Transaction) ProtoMessage() {} -func (*Transaction) Descriptor() ([]byte, []int) { - return fileDescriptor_25804bbfb0752368, []int{1} -} - -func (m *Transaction) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Transaction.Unmarshal(m, b) -} -func (m *Transaction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Transaction.Marshal(b, m, deterministic) -} -func (m *Transaction) XXX_Merge(src proto.Message) { - xxx_messageInfo_Transaction.Merge(m, src) -} -func (m *Transaction) XXX_Size() int { - return xxx_messageInfo_Transaction.Size(m) -} -func (m *Transaction) XXX_DiscardUnknown() { - xxx_messageInfo_Transaction.DiscardUnknown(m) -} - -var xxx_messageInfo_Transaction proto.InternalMessageInfo - -func (m *Transaction) GetActions() []*TransactionAction { - if m != nil { - return m.Actions - } - return nil -} - -// TransactionAction binds a proposal to its action. The type field in the -// header dictates the type of action to be applied to the ledger. -type TransactionAction struct { - // The header of the proposal action, which is the proposal header - Header []byte `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` - // The payload of the action as defined by the type in the header For - // chaincode, it's the bytes of ChaincodeActionPayload - Payload []byte `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *TransactionAction) Reset() { *m = TransactionAction{} } -func (m *TransactionAction) String() string { return proto.CompactTextString(m) } -func (*TransactionAction) ProtoMessage() {} -func (*TransactionAction) Descriptor() ([]byte, []int) { - return fileDescriptor_25804bbfb0752368, []int{2} -} - -func (m *TransactionAction) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_TransactionAction.Unmarshal(m, b) -} -func (m *TransactionAction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_TransactionAction.Marshal(b, m, deterministic) -} -func (m *TransactionAction) XXX_Merge(src proto.Message) { - xxx_messageInfo_TransactionAction.Merge(m, src) -} -func (m *TransactionAction) XXX_Size() int { - return xxx_messageInfo_TransactionAction.Size(m) -} -func (m *TransactionAction) XXX_DiscardUnknown() { - xxx_messageInfo_TransactionAction.DiscardUnknown(m) -} - -var xxx_messageInfo_TransactionAction proto.InternalMessageInfo - -func (m *TransactionAction) GetHeader() []byte { - if m != nil { - return m.Header - } - return nil -} - -func (m *TransactionAction) GetPayload() []byte { - if m != nil { - return m.Payload - } - return nil -} - -// ChaincodeActionPayload is the message to be used for the TransactionAction's -// payload when the Header's type is set to CHAINCODE. It carries the -// chaincodeProposalPayload and an endorsed action to apply to the ledger. -type ChaincodeActionPayload struct { - // This field contains the bytes of the ChaincodeProposalPayload message from - // the original invocation (essentially the arguments) after the application - // of the visibility function. The main visibility modes are "full" (the - // entire ChaincodeProposalPayload message is included here), "hash" (only - // the hash of the ChaincodeProposalPayload message is included) or - // "nothing". This field will be used to check the consistency of - // ProposalResponsePayload.proposalHash. For the CHAINCODE type, - // ProposalResponsePayload.proposalHash is supposed to be H(ProposalHeader || - // f(ChaincodeProposalPayload)) where f is the visibility function. - ChaincodeProposalPayload []byte `protobuf:"bytes,1,opt,name=chaincode_proposal_payload,json=chaincodeProposalPayload,proto3" json:"chaincode_proposal_payload,omitempty"` - // The list of actions to apply to the ledger - Action *ChaincodeEndorsedAction `protobuf:"bytes,2,opt,name=action,proto3" json:"action,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ChaincodeActionPayload) Reset() { *m = ChaincodeActionPayload{} } -func (m *ChaincodeActionPayload) String() string { return proto.CompactTextString(m) } -func (*ChaincodeActionPayload) ProtoMessage() {} -func (*ChaincodeActionPayload) Descriptor() ([]byte, []int) { - return fileDescriptor_25804bbfb0752368, []int{3} -} - -func (m *ChaincodeActionPayload) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ChaincodeActionPayload.Unmarshal(m, b) -} -func (m *ChaincodeActionPayload) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ChaincodeActionPayload.Marshal(b, m, deterministic) -} -func (m *ChaincodeActionPayload) XXX_Merge(src proto.Message) { - xxx_messageInfo_ChaincodeActionPayload.Merge(m, src) -} -func (m *ChaincodeActionPayload) XXX_Size() int { - return xxx_messageInfo_ChaincodeActionPayload.Size(m) -} -func (m *ChaincodeActionPayload) XXX_DiscardUnknown() { - xxx_messageInfo_ChaincodeActionPayload.DiscardUnknown(m) -} - -var xxx_messageInfo_ChaincodeActionPayload proto.InternalMessageInfo - -func (m *ChaincodeActionPayload) GetChaincodeProposalPayload() []byte { - if m != nil { - return m.ChaincodeProposalPayload - } - return nil -} - -func (m *ChaincodeActionPayload) GetAction() *ChaincodeEndorsedAction { - if m != nil { - return m.Action - } - return nil -} - -// ChaincodeEndorsedAction carries information about the endorsement of a -// specific proposal -type ChaincodeEndorsedAction struct { - // This is the bytes of the ProposalResponsePayload message signed by the - // endorsers. Recall that for the CHAINCODE type, the - // ProposalResponsePayload's extenstion field carries a ChaincodeAction - ProposalResponsePayload []byte `protobuf:"bytes,1,opt,name=proposal_response_payload,json=proposalResponsePayload,proto3" json:"proposal_response_payload,omitempty"` - // The endorsement of the proposal, basically the endorser's signature over - // proposalResponsePayload - Endorsements []*Endorsement `protobuf:"bytes,2,rep,name=endorsements,proto3" json:"endorsements,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ChaincodeEndorsedAction) Reset() { *m = ChaincodeEndorsedAction{} } -func (m *ChaincodeEndorsedAction) String() string { return proto.CompactTextString(m) } -func (*ChaincodeEndorsedAction) ProtoMessage() {} -func (*ChaincodeEndorsedAction) Descriptor() ([]byte, []int) { - return fileDescriptor_25804bbfb0752368, []int{4} -} - -func (m *ChaincodeEndorsedAction) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ChaincodeEndorsedAction.Unmarshal(m, b) -} -func (m *ChaincodeEndorsedAction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ChaincodeEndorsedAction.Marshal(b, m, deterministic) -} -func (m *ChaincodeEndorsedAction) XXX_Merge(src proto.Message) { - xxx_messageInfo_ChaincodeEndorsedAction.Merge(m, src) -} -func (m *ChaincodeEndorsedAction) XXX_Size() int { - return xxx_messageInfo_ChaincodeEndorsedAction.Size(m) -} -func (m *ChaincodeEndorsedAction) XXX_DiscardUnknown() { - xxx_messageInfo_ChaincodeEndorsedAction.DiscardUnknown(m) -} - -var xxx_messageInfo_ChaincodeEndorsedAction proto.InternalMessageInfo - -func (m *ChaincodeEndorsedAction) GetProposalResponsePayload() []byte { - if m != nil { - return m.ProposalResponsePayload - } - return nil -} - -func (m *ChaincodeEndorsedAction) GetEndorsements() []*Endorsement { - if m != nil { - return m.Endorsements - } - return nil -} - -func init() { - proto.RegisterEnum("protos.TxValidationCode", TxValidationCode_name, TxValidationCode_value) - proto.RegisterEnum("protos.MetaDataKeys", MetaDataKeys_name, MetaDataKeys_value) - proto.RegisterType((*ProcessedTransaction)(nil), "protos.ProcessedTransaction") - proto.RegisterType((*Transaction)(nil), "protos.Transaction") - proto.RegisterType((*TransactionAction)(nil), "protos.TransactionAction") - proto.RegisterType((*ChaincodeActionPayload)(nil), "protos.ChaincodeActionPayload") - proto.RegisterType((*ChaincodeEndorsedAction)(nil), "protos.ChaincodeEndorsedAction") -} - -func init() { proto.RegisterFile("peer/transaction.proto", fileDescriptor_25804bbfb0752368) } - -var fileDescriptor_25804bbfb0752368 = []byte{ - // 838 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x54, 0x5d, 0x6f, 0x22, 0x37, - 0x14, 0xdd, 0xc9, 0x36, 0x49, 0x63, 0x48, 0xe2, 0x18, 0x42, 0x80, 0xae, 0xda, 0x88, 0x87, 0x2a, - 0x5a, 0x75, 0x41, 0xca, 0x3e, 0x54, 0xaa, 0xfa, 0x62, 0x66, 0x6e, 0xc2, 0x68, 0x07, 0x7b, 0xe4, - 0x31, 0x84, 0xf4, 0xc5, 0x9a, 0x80, 0x97, 0xa0, 0x12, 0x06, 0xcd, 0xd0, 0x55, 0xf3, 0xda, 0x1f, - 0xd0, 0xfe, 0x90, 0xfe, 0xc7, 0xb6, 0xf2, 0x7c, 0x85, 0x64, 0xb7, 0x2f, 0x18, 0x9f, 0x73, 0xee, - 0xbd, 0xe7, 0xde, 0xab, 0x31, 0x6a, 0xac, 0xb5, 0x8e, 0x7b, 0x9b, 0x38, 0x5c, 0x25, 0xe1, 0x74, - 0xb3, 0x88, 0x56, 0xdd, 0x75, 0x1c, 0x6d, 0x22, 0xb2, 0x97, 0x1e, 0x49, 0xfb, 0x4d, 0xca, 0xaf, - 0xe3, 0x68, 0x1d, 0x25, 0xe1, 0x52, 0xc5, 0x3a, 0x59, 0x47, 0xab, 0x44, 0x67, 0xaa, 0x76, 0x6d, - 0x1a, 0x3d, 0x3c, 0x44, 0xab, 0x5e, 0x76, 0x64, 0x60, 0xe7, 0x0f, 0x0b, 0xd5, 0xfd, 0x38, 0x9a, - 0xea, 0x24, 0xd1, 0x33, 0xf9, 0x94, 0x99, 0xf4, 0x51, 0x6d, 0xab, 0x10, 0xac, 0x3e, 0xe9, 0x65, - 0xb4, 0xd6, 0x4d, 0xeb, 0xdc, 0xba, 0xa8, 0x5c, 0xe2, 0x6e, 0x9e, 0xa4, 0xc0, 0xc5, 0x97, 0xc4, - 0xe4, 0x7b, 0x74, 0xf4, 0x29, 0x5c, 0x2e, 0x66, 0xa1, 0x41, 0xed, 0x68, 0xa6, 0x9b, 0x3b, 0xe7, - 0xd6, 0xc5, 0xae, 0x78, 0x81, 0x76, 0xfa, 0xa8, 0xb2, 0x5d, 0xfa, 0x3d, 0xda, 0xcf, 0xfe, 0x25, - 0x4d, 0xeb, 0xfc, 0xf5, 0x45, 0xe5, 0xb2, 0x95, 0x99, 0x4d, 0xba, 0x5b, 0x2a, 0x9a, 0xfe, 0x8a, - 0x42, 0xd9, 0x01, 0x74, 0xf2, 0x19, 0x4b, 0x1a, 0x68, 0xef, 0x5e, 0x87, 0x33, 0x1d, 0xa7, 0xbe, - 0xab, 0x22, 0xbf, 0x91, 0x26, 0xda, 0x5f, 0x87, 0x8f, 0xcb, 0x28, 0x9c, 0xa5, 0x8e, 0xaa, 0xa2, - 0xb8, 0x76, 0xfe, 0xb2, 0x50, 0xc3, 0xbe, 0x0f, 0x17, 0xab, 0x69, 0x34, 0xd3, 0x59, 0x16, 0x3f, - 0xa3, 0xc8, 0xcf, 0xa8, 0x3d, 0x2d, 0x18, 0x55, 0x0e, 0xb9, 0xc8, 0x93, 0x15, 0x68, 0x96, 0x0a, - 0x3f, 0x17, 0x14, 0xd1, 0x3f, 0xa2, 0xbd, 0xcc, 0x5a, 0x5a, 0xb1, 0x72, 0xf9, 0x5d, 0xd1, 0x53, - 0x59, 0x0d, 0x56, 0xb3, 0x28, 0x4e, 0xf4, 0x2c, 0xef, 0x2c, 0x97, 0x77, 0xfe, 0xb4, 0xd0, 0xd9, - 0xff, 0x68, 0xc8, 0x4f, 0xa8, 0xf5, 0xd9, 0xb6, 0x5f, 0x38, 0x3a, 0x2b, 0x04, 0x22, 0xe7, 0x9f, - 0x0c, 0x55, 0x75, 0x96, 0xed, 0x41, 0xaf, 0x36, 0x49, 0x73, 0x27, 0x1d, 0x75, 0xad, 0xb0, 0x05, - 0x4f, 0x9c, 0x78, 0x26, 0x7c, 0xfb, 0xf7, 0x2e, 0xc2, 0xf2, 0xf7, 0xf1, 0xb3, 0x15, 0x92, 0x03, - 0xb4, 0x3b, 0xa6, 0x9e, 0xeb, 0xe0, 0x57, 0x04, 0xa3, 0x2a, 0x73, 0x3d, 0x05, 0x6c, 0x0c, 0x1e, - 0xf7, 0x01, 0x5b, 0xe4, 0x18, 0x55, 0xfa, 0xd4, 0x51, 0x3e, 0xbd, 0xf5, 0x38, 0x75, 0xf0, 0x0e, - 0x39, 0x45, 0x27, 0x06, 0xb0, 0xf9, 0x70, 0xc8, 0x99, 0x1a, 0x00, 0x75, 0x40, 0xe0, 0xd7, 0xa4, - 0x85, 0x4e, 0x53, 0x58, 0x00, 0x95, 0x5c, 0xa8, 0xc0, 0xbd, 0x66, 0x54, 0x8e, 0x04, 0xe0, 0xaf, - 0xc8, 0x39, 0x7a, 0xe3, 0xb2, 0xb4, 0x82, 0x02, 0xe6, 0x70, 0x11, 0x80, 0x50, 0x52, 0x50, 0x16, - 0x50, 0x5b, 0xba, 0x9c, 0xe1, 0x5d, 0xf2, 0x2d, 0x6a, 0x17, 0x0a, 0x9b, 0xb3, 0x2b, 0xf7, 0xfa, - 0x19, 0xbf, 0x47, 0xda, 0xa8, 0x31, 0x62, 0xc1, 0xc8, 0xf7, 0xb9, 0x90, 0xe0, 0x28, 0x39, 0x29, - 0xfd, 0xec, 0x17, 0x7e, 0x7c, 0xc1, 0x7d, 0x1e, 0x50, 0x4f, 0xc9, 0x89, 0xeb, 0xe0, 0xaf, 0x09, - 0x41, 0x47, 0xce, 0xc8, 0xf7, 0x5c, 0x9b, 0x4a, 0xc8, 0xb0, 0x03, 0x53, 0x26, 0x37, 0x30, 0x04, - 0x26, 0x95, 0xcf, 0x3d, 0xd7, 0xbe, 0x55, 0x57, 0xd4, 0xf5, 0x8c, 0x51, 0x44, 0x1a, 0x88, 0x0c, - 0xc7, 0xb6, 0xad, 0x04, 0xd0, 0xcc, 0x88, 0xe7, 0xda, 0x12, 0x57, 0x4c, 0x6f, 0xfe, 0x80, 0x32, - 0xc9, 0x87, 0x2f, 0xa8, 0x2a, 0xa9, 0xa1, 0xe3, 0x11, 0xfb, 0xc0, 0xf8, 0x0d, 0x33, 0xae, 0xe4, - 0xad, 0x0f, 0xf8, 0xd0, 0xd8, 0x95, 0x54, 0x5c, 0x83, 0x54, 0xf6, 0x80, 0xba, 0x4c, 0x31, 0x2e, - 0xd5, 0x15, 0x1f, 0x31, 0x07, 0x1f, 0x91, 0x3a, 0xc2, 0x43, 0x2a, 0x82, 0x41, 0xea, 0x54, 0x81, - 0x10, 0x5c, 0xe0, 0xe3, 0x62, 0xee, 0x72, 0x92, 0xb7, 0x8c, 0x4d, 0x5b, 0x30, 0xf1, 0x5d, 0x01, - 0x4e, 0x96, 0xc4, 0xe6, 0x0e, 0xe0, 0x13, 0xd3, 0x42, 0x79, 0x55, 0x63, 0x10, 0x81, 0xcb, 0xd9, - 0x93, 0x1f, 0x42, 0x9a, 0xa8, 0x6e, 0xa6, 0x91, 0xad, 0x45, 0xc1, 0x44, 0x02, 0x33, 0x12, 0x5c, - 0x33, 0xcd, 0xa5, 0x0b, 0x1a, 0x50, 0xc6, 0xc0, 0x2b, 0x16, 0x57, 0x2f, 0x22, 0x04, 0x04, 0x3e, - 0x67, 0x01, 0x94, 0x93, 0x3d, 0x25, 0x87, 0xe8, 0x20, 0x65, 0x6e, 0x02, 0x90, 0xb8, 0x61, 0x9c, - 0xbb, 0x9e, 0x07, 0xd7, 0xd4, 0x53, 0x37, 0xc2, 0x95, 0x60, 0xd0, 0xb3, 0x14, 0xcd, 0x57, 0x57, - 0xa2, 0x4d, 0xe3, 0xbe, 0x5c, 0x68, 0xe9, 0xbe, 0x45, 0x08, 0x3a, 0x34, 0xb3, 0x48, 0x09, 0x2a, - 0xc1, 0xc1, 0xff, 0x58, 0xa4, 0x85, 0xea, 0x85, 0x94, 0xcb, 0x01, 0x08, 0x33, 0xe2, 0x80, 0x33, - 0xfc, 0xaf, 0xf5, 0x16, 0x50, 0x75, 0xa8, 0x37, 0xa1, 0x13, 0x6e, 0xc2, 0x0f, 0xfa, 0x31, 0x31, - 0x56, 0xf3, 0x50, 0xd3, 0xb5, 0x4f, 0x05, 0x1d, 0x82, 0x04, 0x81, 0x5f, 0x91, 0x6f, 0xd0, 0xd9, - 0x97, 0x18, 0x35, 0xbe, 0xc4, 0x56, 0xff, 0x23, 0xea, 0x44, 0xf1, 0xbc, 0x7b, 0xff, 0xb8, 0xd6, - 0xf1, 0x52, 0xcf, 0xe6, 0x3a, 0xee, 0x7e, 0x0c, 0xef, 0xe2, 0xc5, 0xb4, 0xf8, 0x5e, 0xcc, 0xd3, - 0xdb, 0x27, 0x5b, 0x4f, 0x90, 0x1f, 0x4e, 0x7f, 0x0d, 0xe7, 0xfa, 0x97, 0x1f, 0xe6, 0x8b, 0xcd, - 0xfd, 0x6f, 0x77, 0xe6, 0xc5, 0xec, 0x6d, 0x85, 0xf7, 0xb2, 0xf0, 0x77, 0x59, 0xf8, 0xbb, 0x79, - 0xd4, 0x33, 0x19, 0xee, 0xb2, 0xa7, 0xfc, 0xfd, 0x7f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xa8, 0xb6, - 0xfa, 0xa9, 0xeb, 0x05, 0x00, 0x00, -} diff --git a/vendor/github.com/hyperledger/fabric-protos-go/transientstore/transientstore.pb.go b/vendor/github.com/hyperledger/fabric-protos-go/transientstore/transientstore.pb.go deleted file mode 100644 index 4ce03f518b9..00000000000 --- a/vendor/github.com/hyperledger/fabric-protos-go/transientstore/transientstore.pb.go +++ /dev/null @@ -1,114 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: transientstore/transientstore.proto - -package transientstore - -import ( - fmt "fmt" - proto "github.com/golang/protobuf/proto" - rwset "github.com/hyperledger/fabric-protos-go/ledger/rwset" - peer "github.com/hyperledger/fabric-protos-go/peer" - math "math" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package - -// TxPvtReadWriteSetWithConfigInfo encapsulates the transaction's private -// read-write set and additional information about the configurations such as -// the latest collection config when the transaction is simulated -type TxPvtReadWriteSetWithConfigInfo struct { - EndorsedAt uint64 `protobuf:"varint,1,opt,name=endorsed_at,json=endorsedAt,proto3" json:"endorsed_at,omitempty"` - PvtRwset *rwset.TxPvtReadWriteSet `protobuf:"bytes,2,opt,name=pvt_rwset,json=pvtRwset,proto3" json:"pvt_rwset,omitempty"` - CollectionConfigs map[string]*peer.CollectionConfigPackage `protobuf:"bytes,3,rep,name=collection_configs,json=collectionConfigs,proto3" json:"collection_configs,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *TxPvtReadWriteSetWithConfigInfo) Reset() { *m = TxPvtReadWriteSetWithConfigInfo{} } -func (m *TxPvtReadWriteSetWithConfigInfo) String() string { return proto.CompactTextString(m) } -func (*TxPvtReadWriteSetWithConfigInfo) ProtoMessage() {} -func (*TxPvtReadWriteSetWithConfigInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_fca243668b157b9e, []int{0} -} - -func (m *TxPvtReadWriteSetWithConfigInfo) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_TxPvtReadWriteSetWithConfigInfo.Unmarshal(m, b) -} -func (m *TxPvtReadWriteSetWithConfigInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_TxPvtReadWriteSetWithConfigInfo.Marshal(b, m, deterministic) -} -func (m *TxPvtReadWriteSetWithConfigInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_TxPvtReadWriteSetWithConfigInfo.Merge(m, src) -} -func (m *TxPvtReadWriteSetWithConfigInfo) XXX_Size() int { - return xxx_messageInfo_TxPvtReadWriteSetWithConfigInfo.Size(m) -} -func (m *TxPvtReadWriteSetWithConfigInfo) XXX_DiscardUnknown() { - xxx_messageInfo_TxPvtReadWriteSetWithConfigInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_TxPvtReadWriteSetWithConfigInfo proto.InternalMessageInfo - -func (m *TxPvtReadWriteSetWithConfigInfo) GetEndorsedAt() uint64 { - if m != nil { - return m.EndorsedAt - } - return 0 -} - -func (m *TxPvtReadWriteSetWithConfigInfo) GetPvtRwset() *rwset.TxPvtReadWriteSet { - if m != nil { - return m.PvtRwset - } - return nil -} - -func (m *TxPvtReadWriteSetWithConfigInfo) GetCollectionConfigs() map[string]*peer.CollectionConfigPackage { - if m != nil { - return m.CollectionConfigs - } - return nil -} - -func init() { - proto.RegisterType((*TxPvtReadWriteSetWithConfigInfo)(nil), "transientstore.TxPvtReadWriteSetWithConfigInfo") - proto.RegisterMapType((map[string]*peer.CollectionConfigPackage)(nil), "transientstore.TxPvtReadWriteSetWithConfigInfo.CollectionConfigsEntry") -} - -func init() { - proto.RegisterFile("transientstore/transientstore.proto", fileDescriptor_fca243668b157b9e) -} - -var fileDescriptor_fca243668b157b9e = []byte{ - // 320 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x52, 0x41, 0x4b, 0x33, 0x31, - 0x10, 0x65, 0xdb, 0xef, 0x13, 0x9b, 0x82, 0x68, 0x40, 0x59, 0x7a, 0x69, 0xd1, 0x4b, 0x0f, 0x36, - 0x0b, 0x95, 0x8a, 0x78, 0xd3, 0xa2, 0xe0, 0xad, 0x44, 0xa1, 0xe0, 0xa5, 0xa4, 0xd9, 0xd9, 0x34, - 0x74, 0x4d, 0x96, 0x64, 0xba, 0xda, 0x5f, 0xea, 0xdf, 0x91, 0x6e, 0xac, 0xda, 0x56, 0xf0, 0x12, - 0x92, 0x37, 0xf3, 0xde, 0x9b, 0x97, 0x84, 0x9c, 0xa1, 0x13, 0xc6, 0x6b, 0x30, 0xe8, 0xd1, 0x3a, - 0x48, 0x36, 0x8f, 0xac, 0x70, 0x16, 0x2d, 0x3d, 0xd8, 0x44, 0x5b, 0x71, 0x0e, 0xa9, 0x02, 0x97, - 0xb8, 0x57, 0x0f, 0x18, 0xd6, 0xd0, 0xd9, 0x3a, 0x2e, 0x00, 0x5c, 0x22, 0x6d, 0x9e, 0x83, 0x44, - 0x6d, 0x4d, 0x80, 0x4f, 0xdf, 0x6b, 0xa4, 0xfd, 0xf4, 0x36, 0x2a, 0x91, 0x83, 0x48, 0xc7, 0x4e, - 0x23, 0x3c, 0x02, 0x8e, 0x35, 0xce, 0x86, 0xd6, 0x64, 0x5a, 0x3d, 0x98, 0xcc, 0xd2, 0x36, 0x69, - 0x82, 0x49, 0xad, 0xf3, 0x90, 0x4e, 0x04, 0xc6, 0x51, 0x27, 0xea, 0xfe, 0xe3, 0x64, 0x0d, 0xdd, - 0x20, 0x1d, 0x90, 0x46, 0x51, 0xe2, 0xa4, 0xb2, 0x8b, 0x6b, 0x9d, 0xa8, 0xdb, 0xec, 0xc7, 0x2c, - 0x98, 0xef, 0x68, 0xf3, 0xfd, 0xa2, 0x44, 0xbe, 0xaa, 0xd1, 0x05, 0xa1, 0xdf, 0xf3, 0x4c, 0x64, - 0x65, 0xe8, 0xe3, 0x7a, 0xa7, 0xde, 0x6d, 0xf6, 0xef, 0xd9, 0x56, 0xde, 0x3f, 0x86, 0x64, 0xc3, - 0x2f, 0xa5, 0x00, 0xfa, 0x3b, 0x83, 0x6e, 0xc9, 0x8f, 0xe4, 0x36, 0xde, 0x02, 0x72, 0xf2, 0x7b, - 0x33, 0x3d, 0x24, 0xf5, 0x39, 0x2c, 0xab, 0x80, 0x0d, 0xbe, 0xda, 0xd2, 0x01, 0xf9, 0x5f, 0x8a, - 0x7c, 0x01, 0x9f, 0xa9, 0xda, 0xe1, 0xd6, 0xfc, 0x8e, 0xdb, 0x48, 0xc8, 0xb9, 0x50, 0xc0, 0x43, - 0xf7, 0x75, 0xed, 0x2a, 0xba, 0xcd, 0xc8, 0xb9, 0x75, 0x8a, 0xcd, 0x96, 0x05, 0xb8, 0xf0, 0x2a, - 0x2c, 0x13, 0x53, 0xa7, 0xe5, 0x5a, 0x63, 0x33, 0xe0, 0xf3, 0xa5, 0xd2, 0x38, 0x5b, 0x4c, 0x99, - 0xb4, 0x2f, 0xc9, 0x0f, 0x52, 0x12, 0x48, 0xbd, 0x40, 0xea, 0x29, 0xbb, 0xf5, 0x11, 0xa6, 0x7b, - 0x55, 0xe5, 0xe2, 0x23, 0x00, 0x00, 0xff, 0xff, 0x71, 0x0c, 0xce, 0xd5, 0x30, 0x02, 0x00, 0x00, -} diff --git a/vendor/golang.org/x/crypto/LICENSE b/vendor/golang.org/x/crypto/LICENSE index 6a66aea5eaf..2a7cf70da6e 100644 --- a/vendor/golang.org/x/crypto/LICENSE +++ b/vendor/golang.org/x/crypto/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2009 The Go Authors. All rights reserved. +Copyright 2009 The Go Authors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are @@ -10,7 +10,7 @@ notice, this list of conditions and the following disclaimer. copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - * Neither the name of Google Inc. nor the names of its + * Neither the name of Google LLC nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. diff --git a/vendor/golang.org/x/crypto/hkdf/hkdf.go b/vendor/golang.org/x/crypto/hkdf/hkdf.go index f4ded5fee2f..3bee66294ec 100644 --- a/vendor/golang.org/x/crypto/hkdf/hkdf.go +++ b/vendor/golang.org/x/crypto/hkdf/hkdf.go @@ -8,7 +8,7 @@ // HKDF is a cryptographic key derivation function (KDF) with the goal of // expanding limited input keying material into one or more cryptographically // strong secret keys. -package hkdf // import "golang.org/x/crypto/hkdf" +package hkdf import ( "crypto/hmac" diff --git a/vendor/golang.org/x/crypto/sha3/doc.go b/vendor/golang.org/x/crypto/sha3/doc.go index decd8cf9bf7..7e023090707 100644 --- a/vendor/golang.org/x/crypto/sha3/doc.go +++ b/vendor/golang.org/x/crypto/sha3/doc.go @@ -59,4 +59,4 @@ // They produce output of the same length, with the same security strengths // against all attacks. This means, in particular, that SHA3-256 only has // 128-bit collision resistance, because its output length is 32 bytes. -package sha3 // import "golang.org/x/crypto/sha3" +package sha3 diff --git a/vendor/golang.org/x/crypto/sha3/hashes.go b/vendor/golang.org/x/crypto/sha3/hashes.go index 5eae6cb922f..c544b29e5f2 100644 --- a/vendor/golang.org/x/crypto/sha3/hashes.go +++ b/vendor/golang.org/x/crypto/sha3/hashes.go @@ -9,6 +9,7 @@ package sha3 // bytes. import ( + "crypto" "hash" ) @@ -40,6 +41,13 @@ func New512() hash.Hash { return new512() } +func init() { + crypto.RegisterHash(crypto.SHA3_224, New224) + crypto.RegisterHash(crypto.SHA3_256, New256) + crypto.RegisterHash(crypto.SHA3_384, New384) + crypto.RegisterHash(crypto.SHA3_512, New512) +} + func new224Generic() *state { return &state{rate: 144, outputLen: 28, dsbyte: 0x06} } diff --git a/vendor/golang.org/x/crypto/sha3/keccakf_amd64.s b/vendor/golang.org/x/crypto/sha3/keccakf_amd64.s index 1f539388619..99e2f16e971 100644 --- a/vendor/golang.org/x/crypto/sha3/keccakf_amd64.s +++ b/vendor/golang.org/x/crypto/sha3/keccakf_amd64.s @@ -1,390 +1,5419 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. +// Code generated by command: go run keccakf_amd64_asm.go -out ../keccakf_amd64.s -pkg sha3. DO NOT EDIT. //go:build amd64 && !purego && gc -// This code was translated into a form compatible with 6a from the public -// domain sources at https://github.com/gvanas/KeccakCodePackage - -// Offsets in state -#define _ba (0*8) -#define _be (1*8) -#define _bi (2*8) -#define _bo (3*8) -#define _bu (4*8) -#define _ga (5*8) -#define _ge (6*8) -#define _gi (7*8) -#define _go (8*8) -#define _gu (9*8) -#define _ka (10*8) -#define _ke (11*8) -#define _ki (12*8) -#define _ko (13*8) -#define _ku (14*8) -#define _ma (15*8) -#define _me (16*8) -#define _mi (17*8) -#define _mo (18*8) -#define _mu (19*8) -#define _sa (20*8) -#define _se (21*8) -#define _si (22*8) -#define _so (23*8) -#define _su (24*8) - -// Temporary registers -#define rT1 AX - -// Round vars -#define rpState DI -#define rpStack SP - -#define rDa BX -#define rDe CX -#define rDi DX -#define rDo R8 -#define rDu R9 - -#define rBa R10 -#define rBe R11 -#define rBi R12 -#define rBo R13 -#define rBu R14 - -#define rCa SI -#define rCe BP -#define rCi rBi -#define rCo rBo -#define rCu R15 - -#define MOVQ_RBI_RCE MOVQ rBi, rCe -#define XORQ_RT1_RCA XORQ rT1, rCa -#define XORQ_RT1_RCE XORQ rT1, rCe -#define XORQ_RBA_RCU XORQ rBa, rCu -#define XORQ_RBE_RCU XORQ rBe, rCu -#define XORQ_RDU_RCU XORQ rDu, rCu -#define XORQ_RDA_RCA XORQ rDa, rCa -#define XORQ_RDE_RCE XORQ rDe, rCe - -#define mKeccakRound(iState, oState, rc, B_RBI_RCE, G_RT1_RCA, G_RT1_RCE, G_RBA_RCU, K_RT1_RCA, K_RT1_RCE, K_RBA_RCU, M_RT1_RCA, M_RT1_RCE, M_RBE_RCU, S_RDU_RCU, S_RDA_RCA, S_RDE_RCE) \ - /* Prepare round */ \ - MOVQ rCe, rDa; \ - ROLQ $1, rDa; \ - \ - MOVQ _bi(iState), rCi; \ - XORQ _gi(iState), rDi; \ - XORQ rCu, rDa; \ - XORQ _ki(iState), rCi; \ - XORQ _mi(iState), rDi; \ - XORQ rDi, rCi; \ - \ - MOVQ rCi, rDe; \ - ROLQ $1, rDe; \ - \ - MOVQ _bo(iState), rCo; \ - XORQ _go(iState), rDo; \ - XORQ rCa, rDe; \ - XORQ _ko(iState), rCo; \ - XORQ _mo(iState), rDo; \ - XORQ rDo, rCo; \ - \ - MOVQ rCo, rDi; \ - ROLQ $1, rDi; \ - \ - MOVQ rCu, rDo; \ - XORQ rCe, rDi; \ - ROLQ $1, rDo; \ - \ - MOVQ rCa, rDu; \ - XORQ rCi, rDo; \ - ROLQ $1, rDu; \ - \ - /* Result b */ \ - MOVQ _ba(iState), rBa; \ - MOVQ _ge(iState), rBe; \ - XORQ rCo, rDu; \ - MOVQ _ki(iState), rBi; \ - MOVQ _mo(iState), rBo; \ - MOVQ _su(iState), rBu; \ - XORQ rDe, rBe; \ - ROLQ $44, rBe; \ - XORQ rDi, rBi; \ - XORQ rDa, rBa; \ - ROLQ $43, rBi; \ - \ - MOVQ rBe, rCa; \ - MOVQ rc, rT1; \ - ORQ rBi, rCa; \ - XORQ rBa, rT1; \ - XORQ rT1, rCa; \ - MOVQ rCa, _ba(oState); \ - \ - XORQ rDu, rBu; \ - ROLQ $14, rBu; \ - MOVQ rBa, rCu; \ - ANDQ rBe, rCu; \ - XORQ rBu, rCu; \ - MOVQ rCu, _bu(oState); \ - \ - XORQ rDo, rBo; \ - ROLQ $21, rBo; \ - MOVQ rBo, rT1; \ - ANDQ rBu, rT1; \ - XORQ rBi, rT1; \ - MOVQ rT1, _bi(oState); \ - \ - NOTQ rBi; \ - ORQ rBa, rBu; \ - ORQ rBo, rBi; \ - XORQ rBo, rBu; \ - XORQ rBe, rBi; \ - MOVQ rBu, _bo(oState); \ - MOVQ rBi, _be(oState); \ - B_RBI_RCE; \ - \ - /* Result g */ \ - MOVQ _gu(iState), rBe; \ - XORQ rDu, rBe; \ - MOVQ _ka(iState), rBi; \ - ROLQ $20, rBe; \ - XORQ rDa, rBi; \ - ROLQ $3, rBi; \ - MOVQ _bo(iState), rBa; \ - MOVQ rBe, rT1; \ - ORQ rBi, rT1; \ - XORQ rDo, rBa; \ - MOVQ _me(iState), rBo; \ - MOVQ _si(iState), rBu; \ - ROLQ $28, rBa; \ - XORQ rBa, rT1; \ - MOVQ rT1, _ga(oState); \ - G_RT1_RCA; \ - \ - XORQ rDe, rBo; \ - ROLQ $45, rBo; \ - MOVQ rBi, rT1; \ - ANDQ rBo, rT1; \ - XORQ rBe, rT1; \ - MOVQ rT1, _ge(oState); \ - G_RT1_RCE; \ - \ - XORQ rDi, rBu; \ - ROLQ $61, rBu; \ - MOVQ rBu, rT1; \ - ORQ rBa, rT1; \ - XORQ rBo, rT1; \ - MOVQ rT1, _go(oState); \ - \ - ANDQ rBe, rBa; \ - XORQ rBu, rBa; \ - MOVQ rBa, _gu(oState); \ - NOTQ rBu; \ - G_RBA_RCU; \ - \ - ORQ rBu, rBo; \ - XORQ rBi, rBo; \ - MOVQ rBo, _gi(oState); \ - \ - /* Result k */ \ - MOVQ _be(iState), rBa; \ - MOVQ _gi(iState), rBe; \ - MOVQ _ko(iState), rBi; \ - MOVQ _mu(iState), rBo; \ - MOVQ _sa(iState), rBu; \ - XORQ rDi, rBe; \ - ROLQ $6, rBe; \ - XORQ rDo, rBi; \ - ROLQ $25, rBi; \ - MOVQ rBe, rT1; \ - ORQ rBi, rT1; \ - XORQ rDe, rBa; \ - ROLQ $1, rBa; \ - XORQ rBa, rT1; \ - MOVQ rT1, _ka(oState); \ - K_RT1_RCA; \ - \ - XORQ rDu, rBo; \ - ROLQ $8, rBo; \ - MOVQ rBi, rT1; \ - ANDQ rBo, rT1; \ - XORQ rBe, rT1; \ - MOVQ rT1, _ke(oState); \ - K_RT1_RCE; \ - \ - XORQ rDa, rBu; \ - ROLQ $18, rBu; \ - NOTQ rBo; \ - MOVQ rBo, rT1; \ - ANDQ rBu, rT1; \ - XORQ rBi, rT1; \ - MOVQ rT1, _ki(oState); \ - \ - MOVQ rBu, rT1; \ - ORQ rBa, rT1; \ - XORQ rBo, rT1; \ - MOVQ rT1, _ko(oState); \ - \ - ANDQ rBe, rBa; \ - XORQ rBu, rBa; \ - MOVQ rBa, _ku(oState); \ - K_RBA_RCU; \ - \ - /* Result m */ \ - MOVQ _ga(iState), rBe; \ - XORQ rDa, rBe; \ - MOVQ _ke(iState), rBi; \ - ROLQ $36, rBe; \ - XORQ rDe, rBi; \ - MOVQ _bu(iState), rBa; \ - ROLQ $10, rBi; \ - MOVQ rBe, rT1; \ - MOVQ _mi(iState), rBo; \ - ANDQ rBi, rT1; \ - XORQ rDu, rBa; \ - MOVQ _so(iState), rBu; \ - ROLQ $27, rBa; \ - XORQ rBa, rT1; \ - MOVQ rT1, _ma(oState); \ - M_RT1_RCA; \ - \ - XORQ rDi, rBo; \ - ROLQ $15, rBo; \ - MOVQ rBi, rT1; \ - ORQ rBo, rT1; \ - XORQ rBe, rT1; \ - MOVQ rT1, _me(oState); \ - M_RT1_RCE; \ - \ - XORQ rDo, rBu; \ - ROLQ $56, rBu; \ - NOTQ rBo; \ - MOVQ rBo, rT1; \ - ORQ rBu, rT1; \ - XORQ rBi, rT1; \ - MOVQ rT1, _mi(oState); \ - \ - ORQ rBa, rBe; \ - XORQ rBu, rBe; \ - MOVQ rBe, _mu(oState); \ - \ - ANDQ rBa, rBu; \ - XORQ rBo, rBu; \ - MOVQ rBu, _mo(oState); \ - M_RBE_RCU; \ - \ - /* Result s */ \ - MOVQ _bi(iState), rBa; \ - MOVQ _go(iState), rBe; \ - MOVQ _ku(iState), rBi; \ - XORQ rDi, rBa; \ - MOVQ _ma(iState), rBo; \ - ROLQ $62, rBa; \ - XORQ rDo, rBe; \ - MOVQ _se(iState), rBu; \ - ROLQ $55, rBe; \ - \ - XORQ rDu, rBi; \ - MOVQ rBa, rDu; \ - XORQ rDe, rBu; \ - ROLQ $2, rBu; \ - ANDQ rBe, rDu; \ - XORQ rBu, rDu; \ - MOVQ rDu, _su(oState); \ - \ - ROLQ $39, rBi; \ - S_RDU_RCU; \ - NOTQ rBe; \ - XORQ rDa, rBo; \ - MOVQ rBe, rDa; \ - ANDQ rBi, rDa; \ - XORQ rBa, rDa; \ - MOVQ rDa, _sa(oState); \ - S_RDA_RCA; \ - \ - ROLQ $41, rBo; \ - MOVQ rBi, rDe; \ - ORQ rBo, rDe; \ - XORQ rBe, rDe; \ - MOVQ rDe, _se(oState); \ - S_RDE_RCE; \ - \ - MOVQ rBo, rDi; \ - MOVQ rBu, rDo; \ - ANDQ rBu, rDi; \ - ORQ rBa, rDo; \ - XORQ rBi, rDi; \ - XORQ rBo, rDo; \ - MOVQ rDi, _si(oState); \ - MOVQ rDo, _so(oState) \ - // func keccakF1600(a *[25]uint64) -TEXT ·keccakF1600(SB), 0, $200-8 - MOVQ a+0(FP), rpState +TEXT ·keccakF1600(SB), $200-8 + MOVQ a+0(FP), DI // Convert the user state into an internal state - NOTQ _be(rpState) - NOTQ _bi(rpState) - NOTQ _go(rpState) - NOTQ _ki(rpState) - NOTQ _mi(rpState) - NOTQ _sa(rpState) + NOTQ 8(DI) + NOTQ 16(DI) + NOTQ 64(DI) + NOTQ 96(DI) + NOTQ 136(DI) + NOTQ 160(DI) // Execute the KeccakF permutation - MOVQ _ba(rpState), rCa - MOVQ _be(rpState), rCe - MOVQ _bu(rpState), rCu - - XORQ _ga(rpState), rCa - XORQ _ge(rpState), rCe - XORQ _gu(rpState), rCu - - XORQ _ka(rpState), rCa - XORQ _ke(rpState), rCe - XORQ _ku(rpState), rCu - - XORQ _ma(rpState), rCa - XORQ _me(rpState), rCe - XORQ _mu(rpState), rCu - - XORQ _sa(rpState), rCa - XORQ _se(rpState), rCe - MOVQ _si(rpState), rDi - MOVQ _so(rpState), rDo - XORQ _su(rpState), rCu - - mKeccakRound(rpState, rpStack, $0x0000000000000001, MOVQ_RBI_RCE, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBE_RCU, XORQ_RDU_RCU, XORQ_RDA_RCA, XORQ_RDE_RCE) - mKeccakRound(rpStack, rpState, $0x0000000000008082, MOVQ_RBI_RCE, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBE_RCU, XORQ_RDU_RCU, XORQ_RDA_RCA, XORQ_RDE_RCE) - mKeccakRound(rpState, rpStack, $0x800000000000808a, MOVQ_RBI_RCE, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBE_RCU, XORQ_RDU_RCU, XORQ_RDA_RCA, XORQ_RDE_RCE) - mKeccakRound(rpStack, rpState, $0x8000000080008000, MOVQ_RBI_RCE, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBE_RCU, XORQ_RDU_RCU, XORQ_RDA_RCA, XORQ_RDE_RCE) - mKeccakRound(rpState, rpStack, $0x000000000000808b, MOVQ_RBI_RCE, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBE_RCU, XORQ_RDU_RCU, XORQ_RDA_RCA, XORQ_RDE_RCE) - mKeccakRound(rpStack, rpState, $0x0000000080000001, MOVQ_RBI_RCE, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBE_RCU, XORQ_RDU_RCU, XORQ_RDA_RCA, XORQ_RDE_RCE) - mKeccakRound(rpState, rpStack, $0x8000000080008081, MOVQ_RBI_RCE, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBE_RCU, XORQ_RDU_RCU, XORQ_RDA_RCA, XORQ_RDE_RCE) - mKeccakRound(rpStack, rpState, $0x8000000000008009, MOVQ_RBI_RCE, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBE_RCU, XORQ_RDU_RCU, XORQ_RDA_RCA, XORQ_RDE_RCE) - mKeccakRound(rpState, rpStack, $0x000000000000008a, MOVQ_RBI_RCE, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBE_RCU, XORQ_RDU_RCU, XORQ_RDA_RCA, XORQ_RDE_RCE) - mKeccakRound(rpStack, rpState, $0x0000000000000088, MOVQ_RBI_RCE, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBE_RCU, XORQ_RDU_RCU, XORQ_RDA_RCA, XORQ_RDE_RCE) - mKeccakRound(rpState, rpStack, $0x0000000080008009, MOVQ_RBI_RCE, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBE_RCU, XORQ_RDU_RCU, XORQ_RDA_RCA, XORQ_RDE_RCE) - mKeccakRound(rpStack, rpState, $0x000000008000000a, MOVQ_RBI_RCE, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBE_RCU, XORQ_RDU_RCU, XORQ_RDA_RCA, XORQ_RDE_RCE) - mKeccakRound(rpState, rpStack, $0x000000008000808b, MOVQ_RBI_RCE, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBE_RCU, XORQ_RDU_RCU, XORQ_RDA_RCA, XORQ_RDE_RCE) - mKeccakRound(rpStack, rpState, $0x800000000000008b, MOVQ_RBI_RCE, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBE_RCU, XORQ_RDU_RCU, XORQ_RDA_RCA, XORQ_RDE_RCE) - mKeccakRound(rpState, rpStack, $0x8000000000008089, MOVQ_RBI_RCE, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBE_RCU, XORQ_RDU_RCU, XORQ_RDA_RCA, XORQ_RDE_RCE) - mKeccakRound(rpStack, rpState, $0x8000000000008003, MOVQ_RBI_RCE, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBE_RCU, XORQ_RDU_RCU, XORQ_RDA_RCA, XORQ_RDE_RCE) - mKeccakRound(rpState, rpStack, $0x8000000000008002, MOVQ_RBI_RCE, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBE_RCU, XORQ_RDU_RCU, XORQ_RDA_RCA, XORQ_RDE_RCE) - mKeccakRound(rpStack, rpState, $0x8000000000000080, MOVQ_RBI_RCE, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBE_RCU, XORQ_RDU_RCU, XORQ_RDA_RCA, XORQ_RDE_RCE) - mKeccakRound(rpState, rpStack, $0x000000000000800a, MOVQ_RBI_RCE, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBE_RCU, XORQ_RDU_RCU, XORQ_RDA_RCA, XORQ_RDE_RCE) - mKeccakRound(rpStack, rpState, $0x800000008000000a, MOVQ_RBI_RCE, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBE_RCU, XORQ_RDU_RCU, XORQ_RDA_RCA, XORQ_RDE_RCE) - mKeccakRound(rpState, rpStack, $0x8000000080008081, MOVQ_RBI_RCE, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBE_RCU, XORQ_RDU_RCU, XORQ_RDA_RCA, XORQ_RDE_RCE) - mKeccakRound(rpStack, rpState, $0x8000000000008080, MOVQ_RBI_RCE, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBE_RCU, XORQ_RDU_RCU, XORQ_RDA_RCA, XORQ_RDE_RCE) - mKeccakRound(rpState, rpStack, $0x0000000080000001, MOVQ_RBI_RCE, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBA_RCU, XORQ_RT1_RCA, XORQ_RT1_RCE, XORQ_RBE_RCU, XORQ_RDU_RCU, XORQ_RDA_RCA, XORQ_RDE_RCE) - mKeccakRound(rpStack, rpState, $0x8000000080008008, NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP, NOP) + MOVQ (DI), SI + MOVQ 8(DI), BP + MOVQ 32(DI), R15 + XORQ 40(DI), SI + XORQ 48(DI), BP + XORQ 72(DI), R15 + XORQ 80(DI), SI + XORQ 88(DI), BP + XORQ 112(DI), R15 + XORQ 120(DI), SI + XORQ 128(DI), BP + XORQ 152(DI), R15 + XORQ 160(DI), SI + XORQ 168(DI), BP + MOVQ 176(DI), DX + MOVQ 184(DI), R8 + XORQ 192(DI), R15 - // Revert the internal state to the user state - NOTQ _be(rpState) - NOTQ _bi(rpState) - NOTQ _go(rpState) - NOTQ _ki(rpState) - NOTQ _mi(rpState) - NOTQ _sa(rpState) + // Prepare round + MOVQ BP, BX + ROLQ $0x01, BX + MOVQ 16(DI), R12 + XORQ 56(DI), DX + XORQ R15, BX + XORQ 96(DI), R12 + XORQ 136(DI), DX + XORQ DX, R12 + MOVQ R12, CX + ROLQ $0x01, CX + MOVQ 24(DI), R13 + XORQ 64(DI), R8 + XORQ SI, CX + XORQ 104(DI), R13 + XORQ 144(DI), R8 + XORQ R8, R13 + MOVQ R13, DX + ROLQ $0x01, DX + MOVQ R15, R8 + XORQ BP, DX + ROLQ $0x01, R8 + MOVQ SI, R9 + XORQ R12, R8 + ROLQ $0x01, R9 + + // Result b + MOVQ (DI), R10 + MOVQ 48(DI), R11 + XORQ R13, R9 + MOVQ 96(DI), R12 + MOVQ 144(DI), R13 + MOVQ 192(DI), R14 + XORQ CX, R11 + ROLQ $0x2c, R11 + XORQ DX, R12 + XORQ BX, R10 + ROLQ $0x2b, R12 + MOVQ R11, SI + MOVQ $0x0000000000000001, AX + ORQ R12, SI + XORQ R10, AX + XORQ AX, SI + MOVQ SI, (SP) + XORQ R9, R14 + ROLQ $0x0e, R14 + MOVQ R10, R15 + ANDQ R11, R15 + XORQ R14, R15 + MOVQ R15, 32(SP) + XORQ R8, R13 + ROLQ $0x15, R13 + MOVQ R13, AX + ANDQ R14, AX + XORQ R12, AX + MOVQ AX, 16(SP) + NOTQ R12 + ORQ R10, R14 + ORQ R13, R12 + XORQ R13, R14 + XORQ R11, R12 + MOVQ R14, 24(SP) + MOVQ R12, 8(SP) + MOVQ R12, BP + + // Result g + MOVQ 72(DI), R11 + XORQ R9, R11 + MOVQ 80(DI), R12 + ROLQ $0x14, R11 + XORQ BX, R12 + ROLQ $0x03, R12 + MOVQ 24(DI), R10 + MOVQ R11, AX + ORQ R12, AX + XORQ R8, R10 + MOVQ 128(DI), R13 + MOVQ 176(DI), R14 + ROLQ $0x1c, R10 + XORQ R10, AX + MOVQ AX, 40(SP) + XORQ AX, SI + XORQ CX, R13 + ROLQ $0x2d, R13 + MOVQ R12, AX + ANDQ R13, AX + XORQ R11, AX + MOVQ AX, 48(SP) + XORQ AX, BP + XORQ DX, R14 + ROLQ $0x3d, R14 + MOVQ R14, AX + ORQ R10, AX + XORQ R13, AX + MOVQ AX, 64(SP) + ANDQ R11, R10 + XORQ R14, R10 + MOVQ R10, 72(SP) + NOTQ R14 + XORQ R10, R15 + ORQ R14, R13 + XORQ R12, R13 + MOVQ R13, 56(SP) + + // Result k + MOVQ 8(DI), R10 + MOVQ 56(DI), R11 + MOVQ 104(DI), R12 + MOVQ 152(DI), R13 + MOVQ 160(DI), R14 + XORQ DX, R11 + ROLQ $0x06, R11 + XORQ R8, R12 + ROLQ $0x19, R12 + MOVQ R11, AX + ORQ R12, AX + XORQ CX, R10 + ROLQ $0x01, R10 + XORQ R10, AX + MOVQ AX, 80(SP) + XORQ AX, SI + XORQ R9, R13 + ROLQ $0x08, R13 + MOVQ R12, AX + ANDQ R13, AX + XORQ R11, AX + MOVQ AX, 88(SP) + XORQ AX, BP + XORQ BX, R14 + ROLQ $0x12, R14 + NOTQ R13 + MOVQ R13, AX + ANDQ R14, AX + XORQ R12, AX + MOVQ AX, 96(SP) + MOVQ R14, AX + ORQ R10, AX + XORQ R13, AX + MOVQ AX, 104(SP) + ANDQ R11, R10 + XORQ R14, R10 + MOVQ R10, 112(SP) + XORQ R10, R15 + + // Result m + MOVQ 40(DI), R11 + XORQ BX, R11 + MOVQ 88(DI), R12 + ROLQ $0x24, R11 + XORQ CX, R12 + MOVQ 32(DI), R10 + ROLQ $0x0a, R12 + MOVQ R11, AX + MOVQ 136(DI), R13 + ANDQ R12, AX + XORQ R9, R10 + MOVQ 184(DI), R14 + ROLQ $0x1b, R10 + XORQ R10, AX + MOVQ AX, 120(SP) + XORQ AX, SI + XORQ DX, R13 + ROLQ $0x0f, R13 + MOVQ R12, AX + ORQ R13, AX + XORQ R11, AX + MOVQ AX, 128(SP) + XORQ AX, BP + XORQ R8, R14 + ROLQ $0x38, R14 + NOTQ R13 + MOVQ R13, AX + ORQ R14, AX + XORQ R12, AX + MOVQ AX, 136(SP) + ORQ R10, R11 + XORQ R14, R11 + MOVQ R11, 152(SP) + ANDQ R10, R14 + XORQ R13, R14 + MOVQ R14, 144(SP) + XORQ R11, R15 + + // Result s + MOVQ 16(DI), R10 + MOVQ 64(DI), R11 + MOVQ 112(DI), R12 + XORQ DX, R10 + MOVQ 120(DI), R13 + ROLQ $0x3e, R10 + XORQ R8, R11 + MOVQ 168(DI), R14 + ROLQ $0x37, R11 + XORQ R9, R12 + MOVQ R10, R9 + XORQ CX, R14 + ROLQ $0x02, R14 + ANDQ R11, R9 + XORQ R14, R9 + MOVQ R9, 192(SP) + ROLQ $0x27, R12 + XORQ R9, R15 + NOTQ R11 + XORQ BX, R13 + MOVQ R11, BX + ANDQ R12, BX + XORQ R10, BX + MOVQ BX, 160(SP) + XORQ BX, SI + ROLQ $0x29, R13 + MOVQ R12, CX + ORQ R13, CX + XORQ R11, CX + MOVQ CX, 168(SP) + XORQ CX, BP + MOVQ R13, DX + MOVQ R14, R8 + ANDQ R14, DX + ORQ R10, R8 + XORQ R12, DX + XORQ R13, R8 + MOVQ DX, 176(SP) + MOVQ R8, 184(SP) + + // Prepare round + MOVQ BP, BX + ROLQ $0x01, BX + MOVQ 16(SP), R12 + XORQ 56(SP), DX + XORQ R15, BX + XORQ 96(SP), R12 + XORQ 136(SP), DX + XORQ DX, R12 + MOVQ R12, CX + ROLQ $0x01, CX + MOVQ 24(SP), R13 + XORQ 64(SP), R8 + XORQ SI, CX + XORQ 104(SP), R13 + XORQ 144(SP), R8 + XORQ R8, R13 + MOVQ R13, DX + ROLQ $0x01, DX + MOVQ R15, R8 + XORQ BP, DX + ROLQ $0x01, R8 + MOVQ SI, R9 + XORQ R12, R8 + ROLQ $0x01, R9 + + // Result b + MOVQ (SP), R10 + MOVQ 48(SP), R11 + XORQ R13, R9 + MOVQ 96(SP), R12 + MOVQ 144(SP), R13 + MOVQ 192(SP), R14 + XORQ CX, R11 + ROLQ $0x2c, R11 + XORQ DX, R12 + XORQ BX, R10 + ROLQ $0x2b, R12 + MOVQ R11, SI + MOVQ $0x0000000000008082, AX + ORQ R12, SI + XORQ R10, AX + XORQ AX, SI + MOVQ SI, (DI) + XORQ R9, R14 + ROLQ $0x0e, R14 + MOVQ R10, R15 + ANDQ R11, R15 + XORQ R14, R15 + MOVQ R15, 32(DI) + XORQ R8, R13 + ROLQ $0x15, R13 + MOVQ R13, AX + ANDQ R14, AX + XORQ R12, AX + MOVQ AX, 16(DI) + NOTQ R12 + ORQ R10, R14 + ORQ R13, R12 + XORQ R13, R14 + XORQ R11, R12 + MOVQ R14, 24(DI) + MOVQ R12, 8(DI) + MOVQ R12, BP + + // Result g + MOVQ 72(SP), R11 + XORQ R9, R11 + MOVQ 80(SP), R12 + ROLQ $0x14, R11 + XORQ BX, R12 + ROLQ $0x03, R12 + MOVQ 24(SP), R10 + MOVQ R11, AX + ORQ R12, AX + XORQ R8, R10 + MOVQ 128(SP), R13 + MOVQ 176(SP), R14 + ROLQ $0x1c, R10 + XORQ R10, AX + MOVQ AX, 40(DI) + XORQ AX, SI + XORQ CX, R13 + ROLQ $0x2d, R13 + MOVQ R12, AX + ANDQ R13, AX + XORQ R11, AX + MOVQ AX, 48(DI) + XORQ AX, BP + XORQ DX, R14 + ROLQ $0x3d, R14 + MOVQ R14, AX + ORQ R10, AX + XORQ R13, AX + MOVQ AX, 64(DI) + ANDQ R11, R10 + XORQ R14, R10 + MOVQ R10, 72(DI) + NOTQ R14 + XORQ R10, R15 + ORQ R14, R13 + XORQ R12, R13 + MOVQ R13, 56(DI) + + // Result k + MOVQ 8(SP), R10 + MOVQ 56(SP), R11 + MOVQ 104(SP), R12 + MOVQ 152(SP), R13 + MOVQ 160(SP), R14 + XORQ DX, R11 + ROLQ $0x06, R11 + XORQ R8, R12 + ROLQ $0x19, R12 + MOVQ R11, AX + ORQ R12, AX + XORQ CX, R10 + ROLQ $0x01, R10 + XORQ R10, AX + MOVQ AX, 80(DI) + XORQ AX, SI + XORQ R9, R13 + ROLQ $0x08, R13 + MOVQ R12, AX + ANDQ R13, AX + XORQ R11, AX + MOVQ AX, 88(DI) + XORQ AX, BP + XORQ BX, R14 + ROLQ $0x12, R14 + NOTQ R13 + MOVQ R13, AX + ANDQ R14, AX + XORQ R12, AX + MOVQ AX, 96(DI) + MOVQ R14, AX + ORQ R10, AX + XORQ R13, AX + MOVQ AX, 104(DI) + ANDQ R11, R10 + XORQ R14, R10 + MOVQ R10, 112(DI) + XORQ R10, R15 + + // Result m + MOVQ 40(SP), R11 + XORQ BX, R11 + MOVQ 88(SP), R12 + ROLQ $0x24, R11 + XORQ CX, R12 + MOVQ 32(SP), R10 + ROLQ $0x0a, R12 + MOVQ R11, AX + MOVQ 136(SP), R13 + ANDQ R12, AX + XORQ R9, R10 + MOVQ 184(SP), R14 + ROLQ $0x1b, R10 + XORQ R10, AX + MOVQ AX, 120(DI) + XORQ AX, SI + XORQ DX, R13 + ROLQ $0x0f, R13 + MOVQ R12, AX + ORQ R13, AX + XORQ R11, AX + MOVQ AX, 128(DI) + XORQ AX, BP + XORQ R8, R14 + ROLQ $0x38, R14 + NOTQ R13 + MOVQ R13, AX + ORQ R14, AX + XORQ R12, AX + MOVQ AX, 136(DI) + ORQ R10, R11 + XORQ R14, R11 + MOVQ R11, 152(DI) + ANDQ R10, R14 + XORQ R13, R14 + MOVQ R14, 144(DI) + XORQ R11, R15 + + // Result s + MOVQ 16(SP), R10 + MOVQ 64(SP), R11 + MOVQ 112(SP), R12 + XORQ DX, R10 + MOVQ 120(SP), R13 + ROLQ $0x3e, R10 + XORQ R8, R11 + MOVQ 168(SP), R14 + ROLQ $0x37, R11 + XORQ R9, R12 + MOVQ R10, R9 + XORQ CX, R14 + ROLQ $0x02, R14 + ANDQ R11, R9 + XORQ R14, R9 + MOVQ R9, 192(DI) + ROLQ $0x27, R12 + XORQ R9, R15 + NOTQ R11 + XORQ BX, R13 + MOVQ R11, BX + ANDQ R12, BX + XORQ R10, BX + MOVQ BX, 160(DI) + XORQ BX, SI + ROLQ $0x29, R13 + MOVQ R12, CX + ORQ R13, CX + XORQ R11, CX + MOVQ CX, 168(DI) + XORQ CX, BP + MOVQ R13, DX + MOVQ R14, R8 + ANDQ R14, DX + ORQ R10, R8 + XORQ R12, DX + XORQ R13, R8 + MOVQ DX, 176(DI) + MOVQ R8, 184(DI) + + // Prepare round + MOVQ BP, BX + ROLQ $0x01, BX + MOVQ 16(DI), R12 + XORQ 56(DI), DX + XORQ R15, BX + XORQ 96(DI), R12 + XORQ 136(DI), DX + XORQ DX, R12 + MOVQ R12, CX + ROLQ $0x01, CX + MOVQ 24(DI), R13 + XORQ 64(DI), R8 + XORQ SI, CX + XORQ 104(DI), R13 + XORQ 144(DI), R8 + XORQ R8, R13 + MOVQ R13, DX + ROLQ $0x01, DX + MOVQ R15, R8 + XORQ BP, DX + ROLQ $0x01, R8 + MOVQ SI, R9 + XORQ R12, R8 + ROLQ $0x01, R9 + + // Result b + MOVQ (DI), R10 + MOVQ 48(DI), R11 + XORQ R13, R9 + MOVQ 96(DI), R12 + MOVQ 144(DI), R13 + MOVQ 192(DI), R14 + XORQ CX, R11 + ROLQ $0x2c, R11 + XORQ DX, R12 + XORQ BX, R10 + ROLQ $0x2b, R12 + MOVQ R11, SI + MOVQ $0x800000000000808a, AX + ORQ R12, SI + XORQ R10, AX + XORQ AX, SI + MOVQ SI, (SP) + XORQ R9, R14 + ROLQ $0x0e, R14 + MOVQ R10, R15 + ANDQ R11, R15 + XORQ R14, R15 + MOVQ R15, 32(SP) + XORQ R8, R13 + ROLQ $0x15, R13 + MOVQ R13, AX + ANDQ R14, AX + XORQ R12, AX + MOVQ AX, 16(SP) + NOTQ R12 + ORQ R10, R14 + ORQ R13, R12 + XORQ R13, R14 + XORQ R11, R12 + MOVQ R14, 24(SP) + MOVQ R12, 8(SP) + MOVQ R12, BP + + // Result g + MOVQ 72(DI), R11 + XORQ R9, R11 + MOVQ 80(DI), R12 + ROLQ $0x14, R11 + XORQ BX, R12 + ROLQ $0x03, R12 + MOVQ 24(DI), R10 + MOVQ R11, AX + ORQ R12, AX + XORQ R8, R10 + MOVQ 128(DI), R13 + MOVQ 176(DI), R14 + ROLQ $0x1c, R10 + XORQ R10, AX + MOVQ AX, 40(SP) + XORQ AX, SI + XORQ CX, R13 + ROLQ $0x2d, R13 + MOVQ R12, AX + ANDQ R13, AX + XORQ R11, AX + MOVQ AX, 48(SP) + XORQ AX, BP + XORQ DX, R14 + ROLQ $0x3d, R14 + MOVQ R14, AX + ORQ R10, AX + XORQ R13, AX + MOVQ AX, 64(SP) + ANDQ R11, R10 + XORQ R14, R10 + MOVQ R10, 72(SP) + NOTQ R14 + XORQ R10, R15 + ORQ R14, R13 + XORQ R12, R13 + MOVQ R13, 56(SP) + + // Result k + MOVQ 8(DI), R10 + MOVQ 56(DI), R11 + MOVQ 104(DI), R12 + MOVQ 152(DI), R13 + MOVQ 160(DI), R14 + XORQ DX, R11 + ROLQ $0x06, R11 + XORQ R8, R12 + ROLQ $0x19, R12 + MOVQ R11, AX + ORQ R12, AX + XORQ CX, R10 + ROLQ $0x01, R10 + XORQ R10, AX + MOVQ AX, 80(SP) + XORQ AX, SI + XORQ R9, R13 + ROLQ $0x08, R13 + MOVQ R12, AX + ANDQ R13, AX + XORQ R11, AX + MOVQ AX, 88(SP) + XORQ AX, BP + XORQ BX, R14 + ROLQ $0x12, R14 + NOTQ R13 + MOVQ R13, AX + ANDQ R14, AX + XORQ R12, AX + MOVQ AX, 96(SP) + MOVQ R14, AX + ORQ R10, AX + XORQ R13, AX + MOVQ AX, 104(SP) + ANDQ R11, R10 + XORQ R14, R10 + MOVQ R10, 112(SP) + XORQ R10, R15 + + // Result m + MOVQ 40(DI), R11 + XORQ BX, R11 + MOVQ 88(DI), R12 + ROLQ $0x24, R11 + XORQ CX, R12 + MOVQ 32(DI), R10 + ROLQ $0x0a, R12 + MOVQ R11, AX + MOVQ 136(DI), R13 + ANDQ R12, AX + XORQ R9, R10 + MOVQ 184(DI), R14 + ROLQ $0x1b, R10 + XORQ R10, AX + MOVQ AX, 120(SP) + XORQ AX, SI + XORQ DX, R13 + ROLQ $0x0f, R13 + MOVQ R12, AX + ORQ R13, AX + XORQ R11, AX + MOVQ AX, 128(SP) + XORQ AX, BP + XORQ R8, R14 + ROLQ $0x38, R14 + NOTQ R13 + MOVQ R13, AX + ORQ R14, AX + XORQ R12, AX + MOVQ AX, 136(SP) + ORQ R10, R11 + XORQ R14, R11 + MOVQ R11, 152(SP) + ANDQ R10, R14 + XORQ R13, R14 + MOVQ R14, 144(SP) + XORQ R11, R15 + + // Result s + MOVQ 16(DI), R10 + MOVQ 64(DI), R11 + MOVQ 112(DI), R12 + XORQ DX, R10 + MOVQ 120(DI), R13 + ROLQ $0x3e, R10 + XORQ R8, R11 + MOVQ 168(DI), R14 + ROLQ $0x37, R11 + XORQ R9, R12 + MOVQ R10, R9 + XORQ CX, R14 + ROLQ $0x02, R14 + ANDQ R11, R9 + XORQ R14, R9 + MOVQ R9, 192(SP) + ROLQ $0x27, R12 + XORQ R9, R15 + NOTQ R11 + XORQ BX, R13 + MOVQ R11, BX + ANDQ R12, BX + XORQ R10, BX + MOVQ BX, 160(SP) + XORQ BX, SI + ROLQ $0x29, R13 + MOVQ R12, CX + ORQ R13, CX + XORQ R11, CX + MOVQ CX, 168(SP) + XORQ CX, BP + MOVQ R13, DX + MOVQ R14, R8 + ANDQ R14, DX + ORQ R10, R8 + XORQ R12, DX + XORQ R13, R8 + MOVQ DX, 176(SP) + MOVQ R8, 184(SP) + + // Prepare round + MOVQ BP, BX + ROLQ $0x01, BX + MOVQ 16(SP), R12 + XORQ 56(SP), DX + XORQ R15, BX + XORQ 96(SP), R12 + XORQ 136(SP), DX + XORQ DX, R12 + MOVQ R12, CX + ROLQ $0x01, CX + MOVQ 24(SP), R13 + XORQ 64(SP), R8 + XORQ SI, CX + XORQ 104(SP), R13 + XORQ 144(SP), R8 + XORQ R8, R13 + MOVQ R13, DX + ROLQ $0x01, DX + MOVQ R15, R8 + XORQ BP, DX + ROLQ $0x01, R8 + MOVQ SI, R9 + XORQ R12, R8 + ROLQ $0x01, R9 + + // Result b + MOVQ (SP), R10 + MOVQ 48(SP), R11 + XORQ R13, R9 + MOVQ 96(SP), R12 + MOVQ 144(SP), R13 + MOVQ 192(SP), R14 + XORQ CX, R11 + ROLQ $0x2c, R11 + XORQ DX, R12 + XORQ BX, R10 + ROLQ $0x2b, R12 + MOVQ R11, SI + MOVQ $0x8000000080008000, AX + ORQ R12, SI + XORQ R10, AX + XORQ AX, SI + MOVQ SI, (DI) + XORQ R9, R14 + ROLQ $0x0e, R14 + MOVQ R10, R15 + ANDQ R11, R15 + XORQ R14, R15 + MOVQ R15, 32(DI) + XORQ R8, R13 + ROLQ $0x15, R13 + MOVQ R13, AX + ANDQ R14, AX + XORQ R12, AX + MOVQ AX, 16(DI) + NOTQ R12 + ORQ R10, R14 + ORQ R13, R12 + XORQ R13, R14 + XORQ R11, R12 + MOVQ R14, 24(DI) + MOVQ R12, 8(DI) + MOVQ R12, BP + + // Result g + MOVQ 72(SP), R11 + XORQ R9, R11 + MOVQ 80(SP), R12 + ROLQ $0x14, R11 + XORQ BX, R12 + ROLQ $0x03, R12 + MOVQ 24(SP), R10 + MOVQ R11, AX + ORQ R12, AX + XORQ R8, R10 + MOVQ 128(SP), R13 + MOVQ 176(SP), R14 + ROLQ $0x1c, R10 + XORQ R10, AX + MOVQ AX, 40(DI) + XORQ AX, SI + XORQ CX, R13 + ROLQ $0x2d, R13 + MOVQ R12, AX + ANDQ R13, AX + XORQ R11, AX + MOVQ AX, 48(DI) + XORQ AX, BP + XORQ DX, R14 + ROLQ $0x3d, R14 + MOVQ R14, AX + ORQ R10, AX + XORQ R13, AX + MOVQ AX, 64(DI) + ANDQ R11, R10 + XORQ R14, R10 + MOVQ R10, 72(DI) + NOTQ R14 + XORQ R10, R15 + ORQ R14, R13 + XORQ R12, R13 + MOVQ R13, 56(DI) + + // Result k + MOVQ 8(SP), R10 + MOVQ 56(SP), R11 + MOVQ 104(SP), R12 + MOVQ 152(SP), R13 + MOVQ 160(SP), R14 + XORQ DX, R11 + ROLQ $0x06, R11 + XORQ R8, R12 + ROLQ $0x19, R12 + MOVQ R11, AX + ORQ R12, AX + XORQ CX, R10 + ROLQ $0x01, R10 + XORQ R10, AX + MOVQ AX, 80(DI) + XORQ AX, SI + XORQ R9, R13 + ROLQ $0x08, R13 + MOVQ R12, AX + ANDQ R13, AX + XORQ R11, AX + MOVQ AX, 88(DI) + XORQ AX, BP + XORQ BX, R14 + ROLQ $0x12, R14 + NOTQ R13 + MOVQ R13, AX + ANDQ R14, AX + XORQ R12, AX + MOVQ AX, 96(DI) + MOVQ R14, AX + ORQ R10, AX + XORQ R13, AX + MOVQ AX, 104(DI) + ANDQ R11, R10 + XORQ R14, R10 + MOVQ R10, 112(DI) + XORQ R10, R15 + + // Result m + MOVQ 40(SP), R11 + XORQ BX, R11 + MOVQ 88(SP), R12 + ROLQ $0x24, R11 + XORQ CX, R12 + MOVQ 32(SP), R10 + ROLQ $0x0a, R12 + MOVQ R11, AX + MOVQ 136(SP), R13 + ANDQ R12, AX + XORQ R9, R10 + MOVQ 184(SP), R14 + ROLQ $0x1b, R10 + XORQ R10, AX + MOVQ AX, 120(DI) + XORQ AX, SI + XORQ DX, R13 + ROLQ $0x0f, R13 + MOVQ R12, AX + ORQ R13, AX + XORQ R11, AX + MOVQ AX, 128(DI) + XORQ AX, BP + XORQ R8, R14 + ROLQ $0x38, R14 + NOTQ R13 + MOVQ R13, AX + ORQ R14, AX + XORQ R12, AX + MOVQ AX, 136(DI) + ORQ R10, R11 + XORQ R14, R11 + MOVQ R11, 152(DI) + ANDQ R10, R14 + XORQ R13, R14 + MOVQ R14, 144(DI) + XORQ R11, R15 + + // Result s + MOVQ 16(SP), R10 + MOVQ 64(SP), R11 + MOVQ 112(SP), R12 + XORQ DX, R10 + MOVQ 120(SP), R13 + ROLQ $0x3e, R10 + XORQ R8, R11 + MOVQ 168(SP), R14 + ROLQ $0x37, R11 + XORQ R9, R12 + MOVQ R10, R9 + XORQ CX, R14 + ROLQ $0x02, R14 + ANDQ R11, R9 + XORQ R14, R9 + MOVQ R9, 192(DI) + ROLQ $0x27, R12 + XORQ R9, R15 + NOTQ R11 + XORQ BX, R13 + MOVQ R11, BX + ANDQ R12, BX + XORQ R10, BX + MOVQ BX, 160(DI) + XORQ BX, SI + ROLQ $0x29, R13 + MOVQ R12, CX + ORQ R13, CX + XORQ R11, CX + MOVQ CX, 168(DI) + XORQ CX, BP + MOVQ R13, DX + MOVQ R14, R8 + ANDQ R14, DX + ORQ R10, R8 + XORQ R12, DX + XORQ R13, R8 + MOVQ DX, 176(DI) + MOVQ R8, 184(DI) + + // Prepare round + MOVQ BP, BX + ROLQ $0x01, BX + MOVQ 16(DI), R12 + XORQ 56(DI), DX + XORQ R15, BX + XORQ 96(DI), R12 + XORQ 136(DI), DX + XORQ DX, R12 + MOVQ R12, CX + ROLQ $0x01, CX + MOVQ 24(DI), R13 + XORQ 64(DI), R8 + XORQ SI, CX + XORQ 104(DI), R13 + XORQ 144(DI), R8 + XORQ R8, R13 + MOVQ R13, DX + ROLQ $0x01, DX + MOVQ R15, R8 + XORQ BP, DX + ROLQ $0x01, R8 + MOVQ SI, R9 + XORQ R12, R8 + ROLQ $0x01, R9 + + // Result b + MOVQ (DI), R10 + MOVQ 48(DI), R11 + XORQ R13, R9 + MOVQ 96(DI), R12 + MOVQ 144(DI), R13 + MOVQ 192(DI), R14 + XORQ CX, R11 + ROLQ $0x2c, R11 + XORQ DX, R12 + XORQ BX, R10 + ROLQ $0x2b, R12 + MOVQ R11, SI + MOVQ $0x000000000000808b, AX + ORQ R12, SI + XORQ R10, AX + XORQ AX, SI + MOVQ SI, (SP) + XORQ R9, R14 + ROLQ $0x0e, R14 + MOVQ R10, R15 + ANDQ R11, R15 + XORQ R14, R15 + MOVQ R15, 32(SP) + XORQ R8, R13 + ROLQ $0x15, R13 + MOVQ R13, AX + ANDQ R14, AX + XORQ R12, AX + MOVQ AX, 16(SP) + NOTQ R12 + ORQ R10, R14 + ORQ R13, R12 + XORQ R13, R14 + XORQ R11, R12 + MOVQ R14, 24(SP) + MOVQ R12, 8(SP) + MOVQ R12, BP + + // Result g + MOVQ 72(DI), R11 + XORQ R9, R11 + MOVQ 80(DI), R12 + ROLQ $0x14, R11 + XORQ BX, R12 + ROLQ $0x03, R12 + MOVQ 24(DI), R10 + MOVQ R11, AX + ORQ R12, AX + XORQ R8, R10 + MOVQ 128(DI), R13 + MOVQ 176(DI), R14 + ROLQ $0x1c, R10 + XORQ R10, AX + MOVQ AX, 40(SP) + XORQ AX, SI + XORQ CX, R13 + ROLQ $0x2d, R13 + MOVQ R12, AX + ANDQ R13, AX + XORQ R11, AX + MOVQ AX, 48(SP) + XORQ AX, BP + XORQ DX, R14 + ROLQ $0x3d, R14 + MOVQ R14, AX + ORQ R10, AX + XORQ R13, AX + MOVQ AX, 64(SP) + ANDQ R11, R10 + XORQ R14, R10 + MOVQ R10, 72(SP) + NOTQ R14 + XORQ R10, R15 + ORQ R14, R13 + XORQ R12, R13 + MOVQ R13, 56(SP) + + // Result k + MOVQ 8(DI), R10 + MOVQ 56(DI), R11 + MOVQ 104(DI), R12 + MOVQ 152(DI), R13 + MOVQ 160(DI), R14 + XORQ DX, R11 + ROLQ $0x06, R11 + XORQ R8, R12 + ROLQ $0x19, R12 + MOVQ R11, AX + ORQ R12, AX + XORQ CX, R10 + ROLQ $0x01, R10 + XORQ R10, AX + MOVQ AX, 80(SP) + XORQ AX, SI + XORQ R9, R13 + ROLQ $0x08, R13 + MOVQ R12, AX + ANDQ R13, AX + XORQ R11, AX + MOVQ AX, 88(SP) + XORQ AX, BP + XORQ BX, R14 + ROLQ $0x12, R14 + NOTQ R13 + MOVQ R13, AX + ANDQ R14, AX + XORQ R12, AX + MOVQ AX, 96(SP) + MOVQ R14, AX + ORQ R10, AX + XORQ R13, AX + MOVQ AX, 104(SP) + ANDQ R11, R10 + XORQ R14, R10 + MOVQ R10, 112(SP) + XORQ R10, R15 + + // Result m + MOVQ 40(DI), R11 + XORQ BX, R11 + MOVQ 88(DI), R12 + ROLQ $0x24, R11 + XORQ CX, R12 + MOVQ 32(DI), R10 + ROLQ $0x0a, R12 + MOVQ R11, AX + MOVQ 136(DI), R13 + ANDQ R12, AX + XORQ R9, R10 + MOVQ 184(DI), R14 + ROLQ $0x1b, R10 + XORQ R10, AX + MOVQ AX, 120(SP) + XORQ AX, SI + XORQ DX, R13 + ROLQ $0x0f, R13 + MOVQ R12, AX + ORQ R13, AX + XORQ R11, AX + MOVQ AX, 128(SP) + XORQ AX, BP + XORQ R8, R14 + ROLQ $0x38, R14 + NOTQ R13 + MOVQ R13, AX + ORQ R14, AX + XORQ R12, AX + MOVQ AX, 136(SP) + ORQ R10, R11 + XORQ R14, R11 + MOVQ R11, 152(SP) + ANDQ R10, R14 + XORQ R13, R14 + MOVQ R14, 144(SP) + XORQ R11, R15 + + // Result s + MOVQ 16(DI), R10 + MOVQ 64(DI), R11 + MOVQ 112(DI), R12 + XORQ DX, R10 + MOVQ 120(DI), R13 + ROLQ $0x3e, R10 + XORQ R8, R11 + MOVQ 168(DI), R14 + ROLQ $0x37, R11 + XORQ R9, R12 + MOVQ R10, R9 + XORQ CX, R14 + ROLQ $0x02, R14 + ANDQ R11, R9 + XORQ R14, R9 + MOVQ R9, 192(SP) + ROLQ $0x27, R12 + XORQ R9, R15 + NOTQ R11 + XORQ BX, R13 + MOVQ R11, BX + ANDQ R12, BX + XORQ R10, BX + MOVQ BX, 160(SP) + XORQ BX, SI + ROLQ $0x29, R13 + MOVQ R12, CX + ORQ R13, CX + XORQ R11, CX + MOVQ CX, 168(SP) + XORQ CX, BP + MOVQ R13, DX + MOVQ R14, R8 + ANDQ R14, DX + ORQ R10, R8 + XORQ R12, DX + XORQ R13, R8 + MOVQ DX, 176(SP) + MOVQ R8, 184(SP) + + // Prepare round + MOVQ BP, BX + ROLQ $0x01, BX + MOVQ 16(SP), R12 + XORQ 56(SP), DX + XORQ R15, BX + XORQ 96(SP), R12 + XORQ 136(SP), DX + XORQ DX, R12 + MOVQ R12, CX + ROLQ $0x01, CX + MOVQ 24(SP), R13 + XORQ 64(SP), R8 + XORQ SI, CX + XORQ 104(SP), R13 + XORQ 144(SP), R8 + XORQ R8, R13 + MOVQ R13, DX + ROLQ $0x01, DX + MOVQ R15, R8 + XORQ BP, DX + ROLQ $0x01, R8 + MOVQ SI, R9 + XORQ R12, R8 + ROLQ $0x01, R9 + + // Result b + MOVQ (SP), R10 + MOVQ 48(SP), R11 + XORQ R13, R9 + MOVQ 96(SP), R12 + MOVQ 144(SP), R13 + MOVQ 192(SP), R14 + XORQ CX, R11 + ROLQ $0x2c, R11 + XORQ DX, R12 + XORQ BX, R10 + ROLQ $0x2b, R12 + MOVQ R11, SI + MOVQ $0x0000000080000001, AX + ORQ R12, SI + XORQ R10, AX + XORQ AX, SI + MOVQ SI, (DI) + XORQ R9, R14 + ROLQ $0x0e, R14 + MOVQ R10, R15 + ANDQ R11, R15 + XORQ R14, R15 + MOVQ R15, 32(DI) + XORQ R8, R13 + ROLQ $0x15, R13 + MOVQ R13, AX + ANDQ R14, AX + XORQ R12, AX + MOVQ AX, 16(DI) + NOTQ R12 + ORQ R10, R14 + ORQ R13, R12 + XORQ R13, R14 + XORQ R11, R12 + MOVQ R14, 24(DI) + MOVQ R12, 8(DI) + MOVQ R12, BP + + // Result g + MOVQ 72(SP), R11 + XORQ R9, R11 + MOVQ 80(SP), R12 + ROLQ $0x14, R11 + XORQ BX, R12 + ROLQ $0x03, R12 + MOVQ 24(SP), R10 + MOVQ R11, AX + ORQ R12, AX + XORQ R8, R10 + MOVQ 128(SP), R13 + MOVQ 176(SP), R14 + ROLQ $0x1c, R10 + XORQ R10, AX + MOVQ AX, 40(DI) + XORQ AX, SI + XORQ CX, R13 + ROLQ $0x2d, R13 + MOVQ R12, AX + ANDQ R13, AX + XORQ R11, AX + MOVQ AX, 48(DI) + XORQ AX, BP + XORQ DX, R14 + ROLQ $0x3d, R14 + MOVQ R14, AX + ORQ R10, AX + XORQ R13, AX + MOVQ AX, 64(DI) + ANDQ R11, R10 + XORQ R14, R10 + MOVQ R10, 72(DI) + NOTQ R14 + XORQ R10, R15 + ORQ R14, R13 + XORQ R12, R13 + MOVQ R13, 56(DI) + + // Result k + MOVQ 8(SP), R10 + MOVQ 56(SP), R11 + MOVQ 104(SP), R12 + MOVQ 152(SP), R13 + MOVQ 160(SP), R14 + XORQ DX, R11 + ROLQ $0x06, R11 + XORQ R8, R12 + ROLQ $0x19, R12 + MOVQ R11, AX + ORQ R12, AX + XORQ CX, R10 + ROLQ $0x01, R10 + XORQ R10, AX + MOVQ AX, 80(DI) + XORQ AX, SI + XORQ R9, R13 + ROLQ $0x08, R13 + MOVQ R12, AX + ANDQ R13, AX + XORQ R11, AX + MOVQ AX, 88(DI) + XORQ AX, BP + XORQ BX, R14 + ROLQ $0x12, R14 + NOTQ R13 + MOVQ R13, AX + ANDQ R14, AX + XORQ R12, AX + MOVQ AX, 96(DI) + MOVQ R14, AX + ORQ R10, AX + XORQ R13, AX + MOVQ AX, 104(DI) + ANDQ R11, R10 + XORQ R14, R10 + MOVQ R10, 112(DI) + XORQ R10, R15 + + // Result m + MOVQ 40(SP), R11 + XORQ BX, R11 + MOVQ 88(SP), R12 + ROLQ $0x24, R11 + XORQ CX, R12 + MOVQ 32(SP), R10 + ROLQ $0x0a, R12 + MOVQ R11, AX + MOVQ 136(SP), R13 + ANDQ R12, AX + XORQ R9, R10 + MOVQ 184(SP), R14 + ROLQ $0x1b, R10 + XORQ R10, AX + MOVQ AX, 120(DI) + XORQ AX, SI + XORQ DX, R13 + ROLQ $0x0f, R13 + MOVQ R12, AX + ORQ R13, AX + XORQ R11, AX + MOVQ AX, 128(DI) + XORQ AX, BP + XORQ R8, R14 + ROLQ $0x38, R14 + NOTQ R13 + MOVQ R13, AX + ORQ R14, AX + XORQ R12, AX + MOVQ AX, 136(DI) + ORQ R10, R11 + XORQ R14, R11 + MOVQ R11, 152(DI) + ANDQ R10, R14 + XORQ R13, R14 + MOVQ R14, 144(DI) + XORQ R11, R15 + + // Result s + MOVQ 16(SP), R10 + MOVQ 64(SP), R11 + MOVQ 112(SP), R12 + XORQ DX, R10 + MOVQ 120(SP), R13 + ROLQ $0x3e, R10 + XORQ R8, R11 + MOVQ 168(SP), R14 + ROLQ $0x37, R11 + XORQ R9, R12 + MOVQ R10, R9 + XORQ CX, R14 + ROLQ $0x02, R14 + ANDQ R11, R9 + XORQ R14, R9 + MOVQ R9, 192(DI) + ROLQ $0x27, R12 + XORQ R9, R15 + NOTQ R11 + XORQ BX, R13 + MOVQ R11, BX + ANDQ R12, BX + XORQ R10, BX + MOVQ BX, 160(DI) + XORQ BX, SI + ROLQ $0x29, R13 + MOVQ R12, CX + ORQ R13, CX + XORQ R11, CX + MOVQ CX, 168(DI) + XORQ CX, BP + MOVQ R13, DX + MOVQ R14, R8 + ANDQ R14, DX + ORQ R10, R8 + XORQ R12, DX + XORQ R13, R8 + MOVQ DX, 176(DI) + MOVQ R8, 184(DI) + + // Prepare round + MOVQ BP, BX + ROLQ $0x01, BX + MOVQ 16(DI), R12 + XORQ 56(DI), DX + XORQ R15, BX + XORQ 96(DI), R12 + XORQ 136(DI), DX + XORQ DX, R12 + MOVQ R12, CX + ROLQ $0x01, CX + MOVQ 24(DI), R13 + XORQ 64(DI), R8 + XORQ SI, CX + XORQ 104(DI), R13 + XORQ 144(DI), R8 + XORQ R8, R13 + MOVQ R13, DX + ROLQ $0x01, DX + MOVQ R15, R8 + XORQ BP, DX + ROLQ $0x01, R8 + MOVQ SI, R9 + XORQ R12, R8 + ROLQ $0x01, R9 + + // Result b + MOVQ (DI), R10 + MOVQ 48(DI), R11 + XORQ R13, R9 + MOVQ 96(DI), R12 + MOVQ 144(DI), R13 + MOVQ 192(DI), R14 + XORQ CX, R11 + ROLQ $0x2c, R11 + XORQ DX, R12 + XORQ BX, R10 + ROLQ $0x2b, R12 + MOVQ R11, SI + MOVQ $0x8000000080008081, AX + ORQ R12, SI + XORQ R10, AX + XORQ AX, SI + MOVQ SI, (SP) + XORQ R9, R14 + ROLQ $0x0e, R14 + MOVQ R10, R15 + ANDQ R11, R15 + XORQ R14, R15 + MOVQ R15, 32(SP) + XORQ R8, R13 + ROLQ $0x15, R13 + MOVQ R13, AX + ANDQ R14, AX + XORQ R12, AX + MOVQ AX, 16(SP) + NOTQ R12 + ORQ R10, R14 + ORQ R13, R12 + XORQ R13, R14 + XORQ R11, R12 + MOVQ R14, 24(SP) + MOVQ R12, 8(SP) + MOVQ R12, BP + + // Result g + MOVQ 72(DI), R11 + XORQ R9, R11 + MOVQ 80(DI), R12 + ROLQ $0x14, R11 + XORQ BX, R12 + ROLQ $0x03, R12 + MOVQ 24(DI), R10 + MOVQ R11, AX + ORQ R12, AX + XORQ R8, R10 + MOVQ 128(DI), R13 + MOVQ 176(DI), R14 + ROLQ $0x1c, R10 + XORQ R10, AX + MOVQ AX, 40(SP) + XORQ AX, SI + XORQ CX, R13 + ROLQ $0x2d, R13 + MOVQ R12, AX + ANDQ R13, AX + XORQ R11, AX + MOVQ AX, 48(SP) + XORQ AX, BP + XORQ DX, R14 + ROLQ $0x3d, R14 + MOVQ R14, AX + ORQ R10, AX + XORQ R13, AX + MOVQ AX, 64(SP) + ANDQ R11, R10 + XORQ R14, R10 + MOVQ R10, 72(SP) + NOTQ R14 + XORQ R10, R15 + ORQ R14, R13 + XORQ R12, R13 + MOVQ R13, 56(SP) + + // Result k + MOVQ 8(DI), R10 + MOVQ 56(DI), R11 + MOVQ 104(DI), R12 + MOVQ 152(DI), R13 + MOVQ 160(DI), R14 + XORQ DX, R11 + ROLQ $0x06, R11 + XORQ R8, R12 + ROLQ $0x19, R12 + MOVQ R11, AX + ORQ R12, AX + XORQ CX, R10 + ROLQ $0x01, R10 + XORQ R10, AX + MOVQ AX, 80(SP) + XORQ AX, SI + XORQ R9, R13 + ROLQ $0x08, R13 + MOVQ R12, AX + ANDQ R13, AX + XORQ R11, AX + MOVQ AX, 88(SP) + XORQ AX, BP + XORQ BX, R14 + ROLQ $0x12, R14 + NOTQ R13 + MOVQ R13, AX + ANDQ R14, AX + XORQ R12, AX + MOVQ AX, 96(SP) + MOVQ R14, AX + ORQ R10, AX + XORQ R13, AX + MOVQ AX, 104(SP) + ANDQ R11, R10 + XORQ R14, R10 + MOVQ R10, 112(SP) + XORQ R10, R15 + + // Result m + MOVQ 40(DI), R11 + XORQ BX, R11 + MOVQ 88(DI), R12 + ROLQ $0x24, R11 + XORQ CX, R12 + MOVQ 32(DI), R10 + ROLQ $0x0a, R12 + MOVQ R11, AX + MOVQ 136(DI), R13 + ANDQ R12, AX + XORQ R9, R10 + MOVQ 184(DI), R14 + ROLQ $0x1b, R10 + XORQ R10, AX + MOVQ AX, 120(SP) + XORQ AX, SI + XORQ DX, R13 + ROLQ $0x0f, R13 + MOVQ R12, AX + ORQ R13, AX + XORQ R11, AX + MOVQ AX, 128(SP) + XORQ AX, BP + XORQ R8, R14 + ROLQ $0x38, R14 + NOTQ R13 + MOVQ R13, AX + ORQ R14, AX + XORQ R12, AX + MOVQ AX, 136(SP) + ORQ R10, R11 + XORQ R14, R11 + MOVQ R11, 152(SP) + ANDQ R10, R14 + XORQ R13, R14 + MOVQ R14, 144(SP) + XORQ R11, R15 + + // Result s + MOVQ 16(DI), R10 + MOVQ 64(DI), R11 + MOVQ 112(DI), R12 + XORQ DX, R10 + MOVQ 120(DI), R13 + ROLQ $0x3e, R10 + XORQ R8, R11 + MOVQ 168(DI), R14 + ROLQ $0x37, R11 + XORQ R9, R12 + MOVQ R10, R9 + XORQ CX, R14 + ROLQ $0x02, R14 + ANDQ R11, R9 + XORQ R14, R9 + MOVQ R9, 192(SP) + ROLQ $0x27, R12 + XORQ R9, R15 + NOTQ R11 + XORQ BX, R13 + MOVQ R11, BX + ANDQ R12, BX + XORQ R10, BX + MOVQ BX, 160(SP) + XORQ BX, SI + ROLQ $0x29, R13 + MOVQ R12, CX + ORQ R13, CX + XORQ R11, CX + MOVQ CX, 168(SP) + XORQ CX, BP + MOVQ R13, DX + MOVQ R14, R8 + ANDQ R14, DX + ORQ R10, R8 + XORQ R12, DX + XORQ R13, R8 + MOVQ DX, 176(SP) + MOVQ R8, 184(SP) + + // Prepare round + MOVQ BP, BX + ROLQ $0x01, BX + MOVQ 16(SP), R12 + XORQ 56(SP), DX + XORQ R15, BX + XORQ 96(SP), R12 + XORQ 136(SP), DX + XORQ DX, R12 + MOVQ R12, CX + ROLQ $0x01, CX + MOVQ 24(SP), R13 + XORQ 64(SP), R8 + XORQ SI, CX + XORQ 104(SP), R13 + XORQ 144(SP), R8 + XORQ R8, R13 + MOVQ R13, DX + ROLQ $0x01, DX + MOVQ R15, R8 + XORQ BP, DX + ROLQ $0x01, R8 + MOVQ SI, R9 + XORQ R12, R8 + ROLQ $0x01, R9 + + // Result b + MOVQ (SP), R10 + MOVQ 48(SP), R11 + XORQ R13, R9 + MOVQ 96(SP), R12 + MOVQ 144(SP), R13 + MOVQ 192(SP), R14 + XORQ CX, R11 + ROLQ $0x2c, R11 + XORQ DX, R12 + XORQ BX, R10 + ROLQ $0x2b, R12 + MOVQ R11, SI + MOVQ $0x8000000000008009, AX + ORQ R12, SI + XORQ R10, AX + XORQ AX, SI + MOVQ SI, (DI) + XORQ R9, R14 + ROLQ $0x0e, R14 + MOVQ R10, R15 + ANDQ R11, R15 + XORQ R14, R15 + MOVQ R15, 32(DI) + XORQ R8, R13 + ROLQ $0x15, R13 + MOVQ R13, AX + ANDQ R14, AX + XORQ R12, AX + MOVQ AX, 16(DI) + NOTQ R12 + ORQ R10, R14 + ORQ R13, R12 + XORQ R13, R14 + XORQ R11, R12 + MOVQ R14, 24(DI) + MOVQ R12, 8(DI) + MOVQ R12, BP + + // Result g + MOVQ 72(SP), R11 + XORQ R9, R11 + MOVQ 80(SP), R12 + ROLQ $0x14, R11 + XORQ BX, R12 + ROLQ $0x03, R12 + MOVQ 24(SP), R10 + MOVQ R11, AX + ORQ R12, AX + XORQ R8, R10 + MOVQ 128(SP), R13 + MOVQ 176(SP), R14 + ROLQ $0x1c, R10 + XORQ R10, AX + MOVQ AX, 40(DI) + XORQ AX, SI + XORQ CX, R13 + ROLQ $0x2d, R13 + MOVQ R12, AX + ANDQ R13, AX + XORQ R11, AX + MOVQ AX, 48(DI) + XORQ AX, BP + XORQ DX, R14 + ROLQ $0x3d, R14 + MOVQ R14, AX + ORQ R10, AX + XORQ R13, AX + MOVQ AX, 64(DI) + ANDQ R11, R10 + XORQ R14, R10 + MOVQ R10, 72(DI) + NOTQ R14 + XORQ R10, R15 + ORQ R14, R13 + XORQ R12, R13 + MOVQ R13, 56(DI) + + // Result k + MOVQ 8(SP), R10 + MOVQ 56(SP), R11 + MOVQ 104(SP), R12 + MOVQ 152(SP), R13 + MOVQ 160(SP), R14 + XORQ DX, R11 + ROLQ $0x06, R11 + XORQ R8, R12 + ROLQ $0x19, R12 + MOVQ R11, AX + ORQ R12, AX + XORQ CX, R10 + ROLQ $0x01, R10 + XORQ R10, AX + MOVQ AX, 80(DI) + XORQ AX, SI + XORQ R9, R13 + ROLQ $0x08, R13 + MOVQ R12, AX + ANDQ R13, AX + XORQ R11, AX + MOVQ AX, 88(DI) + XORQ AX, BP + XORQ BX, R14 + ROLQ $0x12, R14 + NOTQ R13 + MOVQ R13, AX + ANDQ R14, AX + XORQ R12, AX + MOVQ AX, 96(DI) + MOVQ R14, AX + ORQ R10, AX + XORQ R13, AX + MOVQ AX, 104(DI) + ANDQ R11, R10 + XORQ R14, R10 + MOVQ R10, 112(DI) + XORQ R10, R15 + + // Result m + MOVQ 40(SP), R11 + XORQ BX, R11 + MOVQ 88(SP), R12 + ROLQ $0x24, R11 + XORQ CX, R12 + MOVQ 32(SP), R10 + ROLQ $0x0a, R12 + MOVQ R11, AX + MOVQ 136(SP), R13 + ANDQ R12, AX + XORQ R9, R10 + MOVQ 184(SP), R14 + ROLQ $0x1b, R10 + XORQ R10, AX + MOVQ AX, 120(DI) + XORQ AX, SI + XORQ DX, R13 + ROLQ $0x0f, R13 + MOVQ R12, AX + ORQ R13, AX + XORQ R11, AX + MOVQ AX, 128(DI) + XORQ AX, BP + XORQ R8, R14 + ROLQ $0x38, R14 + NOTQ R13 + MOVQ R13, AX + ORQ R14, AX + XORQ R12, AX + MOVQ AX, 136(DI) + ORQ R10, R11 + XORQ R14, R11 + MOVQ R11, 152(DI) + ANDQ R10, R14 + XORQ R13, R14 + MOVQ R14, 144(DI) + XORQ R11, R15 + + // Result s + MOVQ 16(SP), R10 + MOVQ 64(SP), R11 + MOVQ 112(SP), R12 + XORQ DX, R10 + MOVQ 120(SP), R13 + ROLQ $0x3e, R10 + XORQ R8, R11 + MOVQ 168(SP), R14 + ROLQ $0x37, R11 + XORQ R9, R12 + MOVQ R10, R9 + XORQ CX, R14 + ROLQ $0x02, R14 + ANDQ R11, R9 + XORQ R14, R9 + MOVQ R9, 192(DI) + ROLQ $0x27, R12 + XORQ R9, R15 + NOTQ R11 + XORQ BX, R13 + MOVQ R11, BX + ANDQ R12, BX + XORQ R10, BX + MOVQ BX, 160(DI) + XORQ BX, SI + ROLQ $0x29, R13 + MOVQ R12, CX + ORQ R13, CX + XORQ R11, CX + MOVQ CX, 168(DI) + XORQ CX, BP + MOVQ R13, DX + MOVQ R14, R8 + ANDQ R14, DX + ORQ R10, R8 + XORQ R12, DX + XORQ R13, R8 + MOVQ DX, 176(DI) + MOVQ R8, 184(DI) + + // Prepare round + MOVQ BP, BX + ROLQ $0x01, BX + MOVQ 16(DI), R12 + XORQ 56(DI), DX + XORQ R15, BX + XORQ 96(DI), R12 + XORQ 136(DI), DX + XORQ DX, R12 + MOVQ R12, CX + ROLQ $0x01, CX + MOVQ 24(DI), R13 + XORQ 64(DI), R8 + XORQ SI, CX + XORQ 104(DI), R13 + XORQ 144(DI), R8 + XORQ R8, R13 + MOVQ R13, DX + ROLQ $0x01, DX + MOVQ R15, R8 + XORQ BP, DX + ROLQ $0x01, R8 + MOVQ SI, R9 + XORQ R12, R8 + ROLQ $0x01, R9 + + // Result b + MOVQ (DI), R10 + MOVQ 48(DI), R11 + XORQ R13, R9 + MOVQ 96(DI), R12 + MOVQ 144(DI), R13 + MOVQ 192(DI), R14 + XORQ CX, R11 + ROLQ $0x2c, R11 + XORQ DX, R12 + XORQ BX, R10 + ROLQ $0x2b, R12 + MOVQ R11, SI + MOVQ $0x000000000000008a, AX + ORQ R12, SI + XORQ R10, AX + XORQ AX, SI + MOVQ SI, (SP) + XORQ R9, R14 + ROLQ $0x0e, R14 + MOVQ R10, R15 + ANDQ R11, R15 + XORQ R14, R15 + MOVQ R15, 32(SP) + XORQ R8, R13 + ROLQ $0x15, R13 + MOVQ R13, AX + ANDQ R14, AX + XORQ R12, AX + MOVQ AX, 16(SP) + NOTQ R12 + ORQ R10, R14 + ORQ R13, R12 + XORQ R13, R14 + XORQ R11, R12 + MOVQ R14, 24(SP) + MOVQ R12, 8(SP) + MOVQ R12, BP + + // Result g + MOVQ 72(DI), R11 + XORQ R9, R11 + MOVQ 80(DI), R12 + ROLQ $0x14, R11 + XORQ BX, R12 + ROLQ $0x03, R12 + MOVQ 24(DI), R10 + MOVQ R11, AX + ORQ R12, AX + XORQ R8, R10 + MOVQ 128(DI), R13 + MOVQ 176(DI), R14 + ROLQ $0x1c, R10 + XORQ R10, AX + MOVQ AX, 40(SP) + XORQ AX, SI + XORQ CX, R13 + ROLQ $0x2d, R13 + MOVQ R12, AX + ANDQ R13, AX + XORQ R11, AX + MOVQ AX, 48(SP) + XORQ AX, BP + XORQ DX, R14 + ROLQ $0x3d, R14 + MOVQ R14, AX + ORQ R10, AX + XORQ R13, AX + MOVQ AX, 64(SP) + ANDQ R11, R10 + XORQ R14, R10 + MOVQ R10, 72(SP) + NOTQ R14 + XORQ R10, R15 + ORQ R14, R13 + XORQ R12, R13 + MOVQ R13, 56(SP) + + // Result k + MOVQ 8(DI), R10 + MOVQ 56(DI), R11 + MOVQ 104(DI), R12 + MOVQ 152(DI), R13 + MOVQ 160(DI), R14 + XORQ DX, R11 + ROLQ $0x06, R11 + XORQ R8, R12 + ROLQ $0x19, R12 + MOVQ R11, AX + ORQ R12, AX + XORQ CX, R10 + ROLQ $0x01, R10 + XORQ R10, AX + MOVQ AX, 80(SP) + XORQ AX, SI + XORQ R9, R13 + ROLQ $0x08, R13 + MOVQ R12, AX + ANDQ R13, AX + XORQ R11, AX + MOVQ AX, 88(SP) + XORQ AX, BP + XORQ BX, R14 + ROLQ $0x12, R14 + NOTQ R13 + MOVQ R13, AX + ANDQ R14, AX + XORQ R12, AX + MOVQ AX, 96(SP) + MOVQ R14, AX + ORQ R10, AX + XORQ R13, AX + MOVQ AX, 104(SP) + ANDQ R11, R10 + XORQ R14, R10 + MOVQ R10, 112(SP) + XORQ R10, R15 + + // Result m + MOVQ 40(DI), R11 + XORQ BX, R11 + MOVQ 88(DI), R12 + ROLQ $0x24, R11 + XORQ CX, R12 + MOVQ 32(DI), R10 + ROLQ $0x0a, R12 + MOVQ R11, AX + MOVQ 136(DI), R13 + ANDQ R12, AX + XORQ R9, R10 + MOVQ 184(DI), R14 + ROLQ $0x1b, R10 + XORQ R10, AX + MOVQ AX, 120(SP) + XORQ AX, SI + XORQ DX, R13 + ROLQ $0x0f, R13 + MOVQ R12, AX + ORQ R13, AX + XORQ R11, AX + MOVQ AX, 128(SP) + XORQ AX, BP + XORQ R8, R14 + ROLQ $0x38, R14 + NOTQ R13 + MOVQ R13, AX + ORQ R14, AX + XORQ R12, AX + MOVQ AX, 136(SP) + ORQ R10, R11 + XORQ R14, R11 + MOVQ R11, 152(SP) + ANDQ R10, R14 + XORQ R13, R14 + MOVQ R14, 144(SP) + XORQ R11, R15 + + // Result s + MOVQ 16(DI), R10 + MOVQ 64(DI), R11 + MOVQ 112(DI), R12 + XORQ DX, R10 + MOVQ 120(DI), R13 + ROLQ $0x3e, R10 + XORQ R8, R11 + MOVQ 168(DI), R14 + ROLQ $0x37, R11 + XORQ R9, R12 + MOVQ R10, R9 + XORQ CX, R14 + ROLQ $0x02, R14 + ANDQ R11, R9 + XORQ R14, R9 + MOVQ R9, 192(SP) + ROLQ $0x27, R12 + XORQ R9, R15 + NOTQ R11 + XORQ BX, R13 + MOVQ R11, BX + ANDQ R12, BX + XORQ R10, BX + MOVQ BX, 160(SP) + XORQ BX, SI + ROLQ $0x29, R13 + MOVQ R12, CX + ORQ R13, CX + XORQ R11, CX + MOVQ CX, 168(SP) + XORQ CX, BP + MOVQ R13, DX + MOVQ R14, R8 + ANDQ R14, DX + ORQ R10, R8 + XORQ R12, DX + XORQ R13, R8 + MOVQ DX, 176(SP) + MOVQ R8, 184(SP) + + // Prepare round + MOVQ BP, BX + ROLQ $0x01, BX + MOVQ 16(SP), R12 + XORQ 56(SP), DX + XORQ R15, BX + XORQ 96(SP), R12 + XORQ 136(SP), DX + XORQ DX, R12 + MOVQ R12, CX + ROLQ $0x01, CX + MOVQ 24(SP), R13 + XORQ 64(SP), R8 + XORQ SI, CX + XORQ 104(SP), R13 + XORQ 144(SP), R8 + XORQ R8, R13 + MOVQ R13, DX + ROLQ $0x01, DX + MOVQ R15, R8 + XORQ BP, DX + ROLQ $0x01, R8 + MOVQ SI, R9 + XORQ R12, R8 + ROLQ $0x01, R9 + + // Result b + MOVQ (SP), R10 + MOVQ 48(SP), R11 + XORQ R13, R9 + MOVQ 96(SP), R12 + MOVQ 144(SP), R13 + MOVQ 192(SP), R14 + XORQ CX, R11 + ROLQ $0x2c, R11 + XORQ DX, R12 + XORQ BX, R10 + ROLQ $0x2b, R12 + MOVQ R11, SI + MOVQ $0x0000000000000088, AX + ORQ R12, SI + XORQ R10, AX + XORQ AX, SI + MOVQ SI, (DI) + XORQ R9, R14 + ROLQ $0x0e, R14 + MOVQ R10, R15 + ANDQ R11, R15 + XORQ R14, R15 + MOVQ R15, 32(DI) + XORQ R8, R13 + ROLQ $0x15, R13 + MOVQ R13, AX + ANDQ R14, AX + XORQ R12, AX + MOVQ AX, 16(DI) + NOTQ R12 + ORQ R10, R14 + ORQ R13, R12 + XORQ R13, R14 + XORQ R11, R12 + MOVQ R14, 24(DI) + MOVQ R12, 8(DI) + MOVQ R12, BP + + // Result g + MOVQ 72(SP), R11 + XORQ R9, R11 + MOVQ 80(SP), R12 + ROLQ $0x14, R11 + XORQ BX, R12 + ROLQ $0x03, R12 + MOVQ 24(SP), R10 + MOVQ R11, AX + ORQ R12, AX + XORQ R8, R10 + MOVQ 128(SP), R13 + MOVQ 176(SP), R14 + ROLQ $0x1c, R10 + XORQ R10, AX + MOVQ AX, 40(DI) + XORQ AX, SI + XORQ CX, R13 + ROLQ $0x2d, R13 + MOVQ R12, AX + ANDQ R13, AX + XORQ R11, AX + MOVQ AX, 48(DI) + XORQ AX, BP + XORQ DX, R14 + ROLQ $0x3d, R14 + MOVQ R14, AX + ORQ R10, AX + XORQ R13, AX + MOVQ AX, 64(DI) + ANDQ R11, R10 + XORQ R14, R10 + MOVQ R10, 72(DI) + NOTQ R14 + XORQ R10, R15 + ORQ R14, R13 + XORQ R12, R13 + MOVQ R13, 56(DI) + + // Result k + MOVQ 8(SP), R10 + MOVQ 56(SP), R11 + MOVQ 104(SP), R12 + MOVQ 152(SP), R13 + MOVQ 160(SP), R14 + XORQ DX, R11 + ROLQ $0x06, R11 + XORQ R8, R12 + ROLQ $0x19, R12 + MOVQ R11, AX + ORQ R12, AX + XORQ CX, R10 + ROLQ $0x01, R10 + XORQ R10, AX + MOVQ AX, 80(DI) + XORQ AX, SI + XORQ R9, R13 + ROLQ $0x08, R13 + MOVQ R12, AX + ANDQ R13, AX + XORQ R11, AX + MOVQ AX, 88(DI) + XORQ AX, BP + XORQ BX, R14 + ROLQ $0x12, R14 + NOTQ R13 + MOVQ R13, AX + ANDQ R14, AX + XORQ R12, AX + MOVQ AX, 96(DI) + MOVQ R14, AX + ORQ R10, AX + XORQ R13, AX + MOVQ AX, 104(DI) + ANDQ R11, R10 + XORQ R14, R10 + MOVQ R10, 112(DI) + XORQ R10, R15 + + // Result m + MOVQ 40(SP), R11 + XORQ BX, R11 + MOVQ 88(SP), R12 + ROLQ $0x24, R11 + XORQ CX, R12 + MOVQ 32(SP), R10 + ROLQ $0x0a, R12 + MOVQ R11, AX + MOVQ 136(SP), R13 + ANDQ R12, AX + XORQ R9, R10 + MOVQ 184(SP), R14 + ROLQ $0x1b, R10 + XORQ R10, AX + MOVQ AX, 120(DI) + XORQ AX, SI + XORQ DX, R13 + ROLQ $0x0f, R13 + MOVQ R12, AX + ORQ R13, AX + XORQ R11, AX + MOVQ AX, 128(DI) + XORQ AX, BP + XORQ R8, R14 + ROLQ $0x38, R14 + NOTQ R13 + MOVQ R13, AX + ORQ R14, AX + XORQ R12, AX + MOVQ AX, 136(DI) + ORQ R10, R11 + XORQ R14, R11 + MOVQ R11, 152(DI) + ANDQ R10, R14 + XORQ R13, R14 + MOVQ R14, 144(DI) + XORQ R11, R15 + + // Result s + MOVQ 16(SP), R10 + MOVQ 64(SP), R11 + MOVQ 112(SP), R12 + XORQ DX, R10 + MOVQ 120(SP), R13 + ROLQ $0x3e, R10 + XORQ R8, R11 + MOVQ 168(SP), R14 + ROLQ $0x37, R11 + XORQ R9, R12 + MOVQ R10, R9 + XORQ CX, R14 + ROLQ $0x02, R14 + ANDQ R11, R9 + XORQ R14, R9 + MOVQ R9, 192(DI) + ROLQ $0x27, R12 + XORQ R9, R15 + NOTQ R11 + XORQ BX, R13 + MOVQ R11, BX + ANDQ R12, BX + XORQ R10, BX + MOVQ BX, 160(DI) + XORQ BX, SI + ROLQ $0x29, R13 + MOVQ R12, CX + ORQ R13, CX + XORQ R11, CX + MOVQ CX, 168(DI) + XORQ CX, BP + MOVQ R13, DX + MOVQ R14, R8 + ANDQ R14, DX + ORQ R10, R8 + XORQ R12, DX + XORQ R13, R8 + MOVQ DX, 176(DI) + MOVQ R8, 184(DI) + + // Prepare round + MOVQ BP, BX + ROLQ $0x01, BX + MOVQ 16(DI), R12 + XORQ 56(DI), DX + XORQ R15, BX + XORQ 96(DI), R12 + XORQ 136(DI), DX + XORQ DX, R12 + MOVQ R12, CX + ROLQ $0x01, CX + MOVQ 24(DI), R13 + XORQ 64(DI), R8 + XORQ SI, CX + XORQ 104(DI), R13 + XORQ 144(DI), R8 + XORQ R8, R13 + MOVQ R13, DX + ROLQ $0x01, DX + MOVQ R15, R8 + XORQ BP, DX + ROLQ $0x01, R8 + MOVQ SI, R9 + XORQ R12, R8 + ROLQ $0x01, R9 + + // Result b + MOVQ (DI), R10 + MOVQ 48(DI), R11 + XORQ R13, R9 + MOVQ 96(DI), R12 + MOVQ 144(DI), R13 + MOVQ 192(DI), R14 + XORQ CX, R11 + ROLQ $0x2c, R11 + XORQ DX, R12 + XORQ BX, R10 + ROLQ $0x2b, R12 + MOVQ R11, SI + MOVQ $0x0000000080008009, AX + ORQ R12, SI + XORQ R10, AX + XORQ AX, SI + MOVQ SI, (SP) + XORQ R9, R14 + ROLQ $0x0e, R14 + MOVQ R10, R15 + ANDQ R11, R15 + XORQ R14, R15 + MOVQ R15, 32(SP) + XORQ R8, R13 + ROLQ $0x15, R13 + MOVQ R13, AX + ANDQ R14, AX + XORQ R12, AX + MOVQ AX, 16(SP) + NOTQ R12 + ORQ R10, R14 + ORQ R13, R12 + XORQ R13, R14 + XORQ R11, R12 + MOVQ R14, 24(SP) + MOVQ R12, 8(SP) + MOVQ R12, BP + + // Result g + MOVQ 72(DI), R11 + XORQ R9, R11 + MOVQ 80(DI), R12 + ROLQ $0x14, R11 + XORQ BX, R12 + ROLQ $0x03, R12 + MOVQ 24(DI), R10 + MOVQ R11, AX + ORQ R12, AX + XORQ R8, R10 + MOVQ 128(DI), R13 + MOVQ 176(DI), R14 + ROLQ $0x1c, R10 + XORQ R10, AX + MOVQ AX, 40(SP) + XORQ AX, SI + XORQ CX, R13 + ROLQ $0x2d, R13 + MOVQ R12, AX + ANDQ R13, AX + XORQ R11, AX + MOVQ AX, 48(SP) + XORQ AX, BP + XORQ DX, R14 + ROLQ $0x3d, R14 + MOVQ R14, AX + ORQ R10, AX + XORQ R13, AX + MOVQ AX, 64(SP) + ANDQ R11, R10 + XORQ R14, R10 + MOVQ R10, 72(SP) + NOTQ R14 + XORQ R10, R15 + ORQ R14, R13 + XORQ R12, R13 + MOVQ R13, 56(SP) + + // Result k + MOVQ 8(DI), R10 + MOVQ 56(DI), R11 + MOVQ 104(DI), R12 + MOVQ 152(DI), R13 + MOVQ 160(DI), R14 + XORQ DX, R11 + ROLQ $0x06, R11 + XORQ R8, R12 + ROLQ $0x19, R12 + MOVQ R11, AX + ORQ R12, AX + XORQ CX, R10 + ROLQ $0x01, R10 + XORQ R10, AX + MOVQ AX, 80(SP) + XORQ AX, SI + XORQ R9, R13 + ROLQ $0x08, R13 + MOVQ R12, AX + ANDQ R13, AX + XORQ R11, AX + MOVQ AX, 88(SP) + XORQ AX, BP + XORQ BX, R14 + ROLQ $0x12, R14 + NOTQ R13 + MOVQ R13, AX + ANDQ R14, AX + XORQ R12, AX + MOVQ AX, 96(SP) + MOVQ R14, AX + ORQ R10, AX + XORQ R13, AX + MOVQ AX, 104(SP) + ANDQ R11, R10 + XORQ R14, R10 + MOVQ R10, 112(SP) + XORQ R10, R15 + + // Result m + MOVQ 40(DI), R11 + XORQ BX, R11 + MOVQ 88(DI), R12 + ROLQ $0x24, R11 + XORQ CX, R12 + MOVQ 32(DI), R10 + ROLQ $0x0a, R12 + MOVQ R11, AX + MOVQ 136(DI), R13 + ANDQ R12, AX + XORQ R9, R10 + MOVQ 184(DI), R14 + ROLQ $0x1b, R10 + XORQ R10, AX + MOVQ AX, 120(SP) + XORQ AX, SI + XORQ DX, R13 + ROLQ $0x0f, R13 + MOVQ R12, AX + ORQ R13, AX + XORQ R11, AX + MOVQ AX, 128(SP) + XORQ AX, BP + XORQ R8, R14 + ROLQ $0x38, R14 + NOTQ R13 + MOVQ R13, AX + ORQ R14, AX + XORQ R12, AX + MOVQ AX, 136(SP) + ORQ R10, R11 + XORQ R14, R11 + MOVQ R11, 152(SP) + ANDQ R10, R14 + XORQ R13, R14 + MOVQ R14, 144(SP) + XORQ R11, R15 + + // Result s + MOVQ 16(DI), R10 + MOVQ 64(DI), R11 + MOVQ 112(DI), R12 + XORQ DX, R10 + MOVQ 120(DI), R13 + ROLQ $0x3e, R10 + XORQ R8, R11 + MOVQ 168(DI), R14 + ROLQ $0x37, R11 + XORQ R9, R12 + MOVQ R10, R9 + XORQ CX, R14 + ROLQ $0x02, R14 + ANDQ R11, R9 + XORQ R14, R9 + MOVQ R9, 192(SP) + ROLQ $0x27, R12 + XORQ R9, R15 + NOTQ R11 + XORQ BX, R13 + MOVQ R11, BX + ANDQ R12, BX + XORQ R10, BX + MOVQ BX, 160(SP) + XORQ BX, SI + ROLQ $0x29, R13 + MOVQ R12, CX + ORQ R13, CX + XORQ R11, CX + MOVQ CX, 168(SP) + XORQ CX, BP + MOVQ R13, DX + MOVQ R14, R8 + ANDQ R14, DX + ORQ R10, R8 + XORQ R12, DX + XORQ R13, R8 + MOVQ DX, 176(SP) + MOVQ R8, 184(SP) + + // Prepare round + MOVQ BP, BX + ROLQ $0x01, BX + MOVQ 16(SP), R12 + XORQ 56(SP), DX + XORQ R15, BX + XORQ 96(SP), R12 + XORQ 136(SP), DX + XORQ DX, R12 + MOVQ R12, CX + ROLQ $0x01, CX + MOVQ 24(SP), R13 + XORQ 64(SP), R8 + XORQ SI, CX + XORQ 104(SP), R13 + XORQ 144(SP), R8 + XORQ R8, R13 + MOVQ R13, DX + ROLQ $0x01, DX + MOVQ R15, R8 + XORQ BP, DX + ROLQ $0x01, R8 + MOVQ SI, R9 + XORQ R12, R8 + ROLQ $0x01, R9 + + // Result b + MOVQ (SP), R10 + MOVQ 48(SP), R11 + XORQ R13, R9 + MOVQ 96(SP), R12 + MOVQ 144(SP), R13 + MOVQ 192(SP), R14 + XORQ CX, R11 + ROLQ $0x2c, R11 + XORQ DX, R12 + XORQ BX, R10 + ROLQ $0x2b, R12 + MOVQ R11, SI + MOVQ $0x000000008000000a, AX + ORQ R12, SI + XORQ R10, AX + XORQ AX, SI + MOVQ SI, (DI) + XORQ R9, R14 + ROLQ $0x0e, R14 + MOVQ R10, R15 + ANDQ R11, R15 + XORQ R14, R15 + MOVQ R15, 32(DI) + XORQ R8, R13 + ROLQ $0x15, R13 + MOVQ R13, AX + ANDQ R14, AX + XORQ R12, AX + MOVQ AX, 16(DI) + NOTQ R12 + ORQ R10, R14 + ORQ R13, R12 + XORQ R13, R14 + XORQ R11, R12 + MOVQ R14, 24(DI) + MOVQ R12, 8(DI) + MOVQ R12, BP + + // Result g + MOVQ 72(SP), R11 + XORQ R9, R11 + MOVQ 80(SP), R12 + ROLQ $0x14, R11 + XORQ BX, R12 + ROLQ $0x03, R12 + MOVQ 24(SP), R10 + MOVQ R11, AX + ORQ R12, AX + XORQ R8, R10 + MOVQ 128(SP), R13 + MOVQ 176(SP), R14 + ROLQ $0x1c, R10 + XORQ R10, AX + MOVQ AX, 40(DI) + XORQ AX, SI + XORQ CX, R13 + ROLQ $0x2d, R13 + MOVQ R12, AX + ANDQ R13, AX + XORQ R11, AX + MOVQ AX, 48(DI) + XORQ AX, BP + XORQ DX, R14 + ROLQ $0x3d, R14 + MOVQ R14, AX + ORQ R10, AX + XORQ R13, AX + MOVQ AX, 64(DI) + ANDQ R11, R10 + XORQ R14, R10 + MOVQ R10, 72(DI) + NOTQ R14 + XORQ R10, R15 + ORQ R14, R13 + XORQ R12, R13 + MOVQ R13, 56(DI) + + // Result k + MOVQ 8(SP), R10 + MOVQ 56(SP), R11 + MOVQ 104(SP), R12 + MOVQ 152(SP), R13 + MOVQ 160(SP), R14 + XORQ DX, R11 + ROLQ $0x06, R11 + XORQ R8, R12 + ROLQ $0x19, R12 + MOVQ R11, AX + ORQ R12, AX + XORQ CX, R10 + ROLQ $0x01, R10 + XORQ R10, AX + MOVQ AX, 80(DI) + XORQ AX, SI + XORQ R9, R13 + ROLQ $0x08, R13 + MOVQ R12, AX + ANDQ R13, AX + XORQ R11, AX + MOVQ AX, 88(DI) + XORQ AX, BP + XORQ BX, R14 + ROLQ $0x12, R14 + NOTQ R13 + MOVQ R13, AX + ANDQ R14, AX + XORQ R12, AX + MOVQ AX, 96(DI) + MOVQ R14, AX + ORQ R10, AX + XORQ R13, AX + MOVQ AX, 104(DI) + ANDQ R11, R10 + XORQ R14, R10 + MOVQ R10, 112(DI) + XORQ R10, R15 + + // Result m + MOVQ 40(SP), R11 + XORQ BX, R11 + MOVQ 88(SP), R12 + ROLQ $0x24, R11 + XORQ CX, R12 + MOVQ 32(SP), R10 + ROLQ $0x0a, R12 + MOVQ R11, AX + MOVQ 136(SP), R13 + ANDQ R12, AX + XORQ R9, R10 + MOVQ 184(SP), R14 + ROLQ $0x1b, R10 + XORQ R10, AX + MOVQ AX, 120(DI) + XORQ AX, SI + XORQ DX, R13 + ROLQ $0x0f, R13 + MOVQ R12, AX + ORQ R13, AX + XORQ R11, AX + MOVQ AX, 128(DI) + XORQ AX, BP + XORQ R8, R14 + ROLQ $0x38, R14 + NOTQ R13 + MOVQ R13, AX + ORQ R14, AX + XORQ R12, AX + MOVQ AX, 136(DI) + ORQ R10, R11 + XORQ R14, R11 + MOVQ R11, 152(DI) + ANDQ R10, R14 + XORQ R13, R14 + MOVQ R14, 144(DI) + XORQ R11, R15 + + // Result s + MOVQ 16(SP), R10 + MOVQ 64(SP), R11 + MOVQ 112(SP), R12 + XORQ DX, R10 + MOVQ 120(SP), R13 + ROLQ $0x3e, R10 + XORQ R8, R11 + MOVQ 168(SP), R14 + ROLQ $0x37, R11 + XORQ R9, R12 + MOVQ R10, R9 + XORQ CX, R14 + ROLQ $0x02, R14 + ANDQ R11, R9 + XORQ R14, R9 + MOVQ R9, 192(DI) + ROLQ $0x27, R12 + XORQ R9, R15 + NOTQ R11 + XORQ BX, R13 + MOVQ R11, BX + ANDQ R12, BX + XORQ R10, BX + MOVQ BX, 160(DI) + XORQ BX, SI + ROLQ $0x29, R13 + MOVQ R12, CX + ORQ R13, CX + XORQ R11, CX + MOVQ CX, 168(DI) + XORQ CX, BP + MOVQ R13, DX + MOVQ R14, R8 + ANDQ R14, DX + ORQ R10, R8 + XORQ R12, DX + XORQ R13, R8 + MOVQ DX, 176(DI) + MOVQ R8, 184(DI) + // Prepare round + MOVQ BP, BX + ROLQ $0x01, BX + MOVQ 16(DI), R12 + XORQ 56(DI), DX + XORQ R15, BX + XORQ 96(DI), R12 + XORQ 136(DI), DX + XORQ DX, R12 + MOVQ R12, CX + ROLQ $0x01, CX + MOVQ 24(DI), R13 + XORQ 64(DI), R8 + XORQ SI, CX + XORQ 104(DI), R13 + XORQ 144(DI), R8 + XORQ R8, R13 + MOVQ R13, DX + ROLQ $0x01, DX + MOVQ R15, R8 + XORQ BP, DX + ROLQ $0x01, R8 + MOVQ SI, R9 + XORQ R12, R8 + ROLQ $0x01, R9 + + // Result b + MOVQ (DI), R10 + MOVQ 48(DI), R11 + XORQ R13, R9 + MOVQ 96(DI), R12 + MOVQ 144(DI), R13 + MOVQ 192(DI), R14 + XORQ CX, R11 + ROLQ $0x2c, R11 + XORQ DX, R12 + XORQ BX, R10 + ROLQ $0x2b, R12 + MOVQ R11, SI + MOVQ $0x000000008000808b, AX + ORQ R12, SI + XORQ R10, AX + XORQ AX, SI + MOVQ SI, (SP) + XORQ R9, R14 + ROLQ $0x0e, R14 + MOVQ R10, R15 + ANDQ R11, R15 + XORQ R14, R15 + MOVQ R15, 32(SP) + XORQ R8, R13 + ROLQ $0x15, R13 + MOVQ R13, AX + ANDQ R14, AX + XORQ R12, AX + MOVQ AX, 16(SP) + NOTQ R12 + ORQ R10, R14 + ORQ R13, R12 + XORQ R13, R14 + XORQ R11, R12 + MOVQ R14, 24(SP) + MOVQ R12, 8(SP) + MOVQ R12, BP + + // Result g + MOVQ 72(DI), R11 + XORQ R9, R11 + MOVQ 80(DI), R12 + ROLQ $0x14, R11 + XORQ BX, R12 + ROLQ $0x03, R12 + MOVQ 24(DI), R10 + MOVQ R11, AX + ORQ R12, AX + XORQ R8, R10 + MOVQ 128(DI), R13 + MOVQ 176(DI), R14 + ROLQ $0x1c, R10 + XORQ R10, AX + MOVQ AX, 40(SP) + XORQ AX, SI + XORQ CX, R13 + ROLQ $0x2d, R13 + MOVQ R12, AX + ANDQ R13, AX + XORQ R11, AX + MOVQ AX, 48(SP) + XORQ AX, BP + XORQ DX, R14 + ROLQ $0x3d, R14 + MOVQ R14, AX + ORQ R10, AX + XORQ R13, AX + MOVQ AX, 64(SP) + ANDQ R11, R10 + XORQ R14, R10 + MOVQ R10, 72(SP) + NOTQ R14 + XORQ R10, R15 + ORQ R14, R13 + XORQ R12, R13 + MOVQ R13, 56(SP) + + // Result k + MOVQ 8(DI), R10 + MOVQ 56(DI), R11 + MOVQ 104(DI), R12 + MOVQ 152(DI), R13 + MOVQ 160(DI), R14 + XORQ DX, R11 + ROLQ $0x06, R11 + XORQ R8, R12 + ROLQ $0x19, R12 + MOVQ R11, AX + ORQ R12, AX + XORQ CX, R10 + ROLQ $0x01, R10 + XORQ R10, AX + MOVQ AX, 80(SP) + XORQ AX, SI + XORQ R9, R13 + ROLQ $0x08, R13 + MOVQ R12, AX + ANDQ R13, AX + XORQ R11, AX + MOVQ AX, 88(SP) + XORQ AX, BP + XORQ BX, R14 + ROLQ $0x12, R14 + NOTQ R13 + MOVQ R13, AX + ANDQ R14, AX + XORQ R12, AX + MOVQ AX, 96(SP) + MOVQ R14, AX + ORQ R10, AX + XORQ R13, AX + MOVQ AX, 104(SP) + ANDQ R11, R10 + XORQ R14, R10 + MOVQ R10, 112(SP) + XORQ R10, R15 + + // Result m + MOVQ 40(DI), R11 + XORQ BX, R11 + MOVQ 88(DI), R12 + ROLQ $0x24, R11 + XORQ CX, R12 + MOVQ 32(DI), R10 + ROLQ $0x0a, R12 + MOVQ R11, AX + MOVQ 136(DI), R13 + ANDQ R12, AX + XORQ R9, R10 + MOVQ 184(DI), R14 + ROLQ $0x1b, R10 + XORQ R10, AX + MOVQ AX, 120(SP) + XORQ AX, SI + XORQ DX, R13 + ROLQ $0x0f, R13 + MOVQ R12, AX + ORQ R13, AX + XORQ R11, AX + MOVQ AX, 128(SP) + XORQ AX, BP + XORQ R8, R14 + ROLQ $0x38, R14 + NOTQ R13 + MOVQ R13, AX + ORQ R14, AX + XORQ R12, AX + MOVQ AX, 136(SP) + ORQ R10, R11 + XORQ R14, R11 + MOVQ R11, 152(SP) + ANDQ R10, R14 + XORQ R13, R14 + MOVQ R14, 144(SP) + XORQ R11, R15 + + // Result s + MOVQ 16(DI), R10 + MOVQ 64(DI), R11 + MOVQ 112(DI), R12 + XORQ DX, R10 + MOVQ 120(DI), R13 + ROLQ $0x3e, R10 + XORQ R8, R11 + MOVQ 168(DI), R14 + ROLQ $0x37, R11 + XORQ R9, R12 + MOVQ R10, R9 + XORQ CX, R14 + ROLQ $0x02, R14 + ANDQ R11, R9 + XORQ R14, R9 + MOVQ R9, 192(SP) + ROLQ $0x27, R12 + XORQ R9, R15 + NOTQ R11 + XORQ BX, R13 + MOVQ R11, BX + ANDQ R12, BX + XORQ R10, BX + MOVQ BX, 160(SP) + XORQ BX, SI + ROLQ $0x29, R13 + MOVQ R12, CX + ORQ R13, CX + XORQ R11, CX + MOVQ CX, 168(SP) + XORQ CX, BP + MOVQ R13, DX + MOVQ R14, R8 + ANDQ R14, DX + ORQ R10, R8 + XORQ R12, DX + XORQ R13, R8 + MOVQ DX, 176(SP) + MOVQ R8, 184(SP) + + // Prepare round + MOVQ BP, BX + ROLQ $0x01, BX + MOVQ 16(SP), R12 + XORQ 56(SP), DX + XORQ R15, BX + XORQ 96(SP), R12 + XORQ 136(SP), DX + XORQ DX, R12 + MOVQ R12, CX + ROLQ $0x01, CX + MOVQ 24(SP), R13 + XORQ 64(SP), R8 + XORQ SI, CX + XORQ 104(SP), R13 + XORQ 144(SP), R8 + XORQ R8, R13 + MOVQ R13, DX + ROLQ $0x01, DX + MOVQ R15, R8 + XORQ BP, DX + ROLQ $0x01, R8 + MOVQ SI, R9 + XORQ R12, R8 + ROLQ $0x01, R9 + + // Result b + MOVQ (SP), R10 + MOVQ 48(SP), R11 + XORQ R13, R9 + MOVQ 96(SP), R12 + MOVQ 144(SP), R13 + MOVQ 192(SP), R14 + XORQ CX, R11 + ROLQ $0x2c, R11 + XORQ DX, R12 + XORQ BX, R10 + ROLQ $0x2b, R12 + MOVQ R11, SI + MOVQ $0x800000000000008b, AX + ORQ R12, SI + XORQ R10, AX + XORQ AX, SI + MOVQ SI, (DI) + XORQ R9, R14 + ROLQ $0x0e, R14 + MOVQ R10, R15 + ANDQ R11, R15 + XORQ R14, R15 + MOVQ R15, 32(DI) + XORQ R8, R13 + ROLQ $0x15, R13 + MOVQ R13, AX + ANDQ R14, AX + XORQ R12, AX + MOVQ AX, 16(DI) + NOTQ R12 + ORQ R10, R14 + ORQ R13, R12 + XORQ R13, R14 + XORQ R11, R12 + MOVQ R14, 24(DI) + MOVQ R12, 8(DI) + MOVQ R12, BP + + // Result g + MOVQ 72(SP), R11 + XORQ R9, R11 + MOVQ 80(SP), R12 + ROLQ $0x14, R11 + XORQ BX, R12 + ROLQ $0x03, R12 + MOVQ 24(SP), R10 + MOVQ R11, AX + ORQ R12, AX + XORQ R8, R10 + MOVQ 128(SP), R13 + MOVQ 176(SP), R14 + ROLQ $0x1c, R10 + XORQ R10, AX + MOVQ AX, 40(DI) + XORQ AX, SI + XORQ CX, R13 + ROLQ $0x2d, R13 + MOVQ R12, AX + ANDQ R13, AX + XORQ R11, AX + MOVQ AX, 48(DI) + XORQ AX, BP + XORQ DX, R14 + ROLQ $0x3d, R14 + MOVQ R14, AX + ORQ R10, AX + XORQ R13, AX + MOVQ AX, 64(DI) + ANDQ R11, R10 + XORQ R14, R10 + MOVQ R10, 72(DI) + NOTQ R14 + XORQ R10, R15 + ORQ R14, R13 + XORQ R12, R13 + MOVQ R13, 56(DI) + + // Result k + MOVQ 8(SP), R10 + MOVQ 56(SP), R11 + MOVQ 104(SP), R12 + MOVQ 152(SP), R13 + MOVQ 160(SP), R14 + XORQ DX, R11 + ROLQ $0x06, R11 + XORQ R8, R12 + ROLQ $0x19, R12 + MOVQ R11, AX + ORQ R12, AX + XORQ CX, R10 + ROLQ $0x01, R10 + XORQ R10, AX + MOVQ AX, 80(DI) + XORQ AX, SI + XORQ R9, R13 + ROLQ $0x08, R13 + MOVQ R12, AX + ANDQ R13, AX + XORQ R11, AX + MOVQ AX, 88(DI) + XORQ AX, BP + XORQ BX, R14 + ROLQ $0x12, R14 + NOTQ R13 + MOVQ R13, AX + ANDQ R14, AX + XORQ R12, AX + MOVQ AX, 96(DI) + MOVQ R14, AX + ORQ R10, AX + XORQ R13, AX + MOVQ AX, 104(DI) + ANDQ R11, R10 + XORQ R14, R10 + MOVQ R10, 112(DI) + XORQ R10, R15 + + // Result m + MOVQ 40(SP), R11 + XORQ BX, R11 + MOVQ 88(SP), R12 + ROLQ $0x24, R11 + XORQ CX, R12 + MOVQ 32(SP), R10 + ROLQ $0x0a, R12 + MOVQ R11, AX + MOVQ 136(SP), R13 + ANDQ R12, AX + XORQ R9, R10 + MOVQ 184(SP), R14 + ROLQ $0x1b, R10 + XORQ R10, AX + MOVQ AX, 120(DI) + XORQ AX, SI + XORQ DX, R13 + ROLQ $0x0f, R13 + MOVQ R12, AX + ORQ R13, AX + XORQ R11, AX + MOVQ AX, 128(DI) + XORQ AX, BP + XORQ R8, R14 + ROLQ $0x38, R14 + NOTQ R13 + MOVQ R13, AX + ORQ R14, AX + XORQ R12, AX + MOVQ AX, 136(DI) + ORQ R10, R11 + XORQ R14, R11 + MOVQ R11, 152(DI) + ANDQ R10, R14 + XORQ R13, R14 + MOVQ R14, 144(DI) + XORQ R11, R15 + + // Result s + MOVQ 16(SP), R10 + MOVQ 64(SP), R11 + MOVQ 112(SP), R12 + XORQ DX, R10 + MOVQ 120(SP), R13 + ROLQ $0x3e, R10 + XORQ R8, R11 + MOVQ 168(SP), R14 + ROLQ $0x37, R11 + XORQ R9, R12 + MOVQ R10, R9 + XORQ CX, R14 + ROLQ $0x02, R14 + ANDQ R11, R9 + XORQ R14, R9 + MOVQ R9, 192(DI) + ROLQ $0x27, R12 + XORQ R9, R15 + NOTQ R11 + XORQ BX, R13 + MOVQ R11, BX + ANDQ R12, BX + XORQ R10, BX + MOVQ BX, 160(DI) + XORQ BX, SI + ROLQ $0x29, R13 + MOVQ R12, CX + ORQ R13, CX + XORQ R11, CX + MOVQ CX, 168(DI) + XORQ CX, BP + MOVQ R13, DX + MOVQ R14, R8 + ANDQ R14, DX + ORQ R10, R8 + XORQ R12, DX + XORQ R13, R8 + MOVQ DX, 176(DI) + MOVQ R8, 184(DI) + + // Prepare round + MOVQ BP, BX + ROLQ $0x01, BX + MOVQ 16(DI), R12 + XORQ 56(DI), DX + XORQ R15, BX + XORQ 96(DI), R12 + XORQ 136(DI), DX + XORQ DX, R12 + MOVQ R12, CX + ROLQ $0x01, CX + MOVQ 24(DI), R13 + XORQ 64(DI), R8 + XORQ SI, CX + XORQ 104(DI), R13 + XORQ 144(DI), R8 + XORQ R8, R13 + MOVQ R13, DX + ROLQ $0x01, DX + MOVQ R15, R8 + XORQ BP, DX + ROLQ $0x01, R8 + MOVQ SI, R9 + XORQ R12, R8 + ROLQ $0x01, R9 + + // Result b + MOVQ (DI), R10 + MOVQ 48(DI), R11 + XORQ R13, R9 + MOVQ 96(DI), R12 + MOVQ 144(DI), R13 + MOVQ 192(DI), R14 + XORQ CX, R11 + ROLQ $0x2c, R11 + XORQ DX, R12 + XORQ BX, R10 + ROLQ $0x2b, R12 + MOVQ R11, SI + MOVQ $0x8000000000008089, AX + ORQ R12, SI + XORQ R10, AX + XORQ AX, SI + MOVQ SI, (SP) + XORQ R9, R14 + ROLQ $0x0e, R14 + MOVQ R10, R15 + ANDQ R11, R15 + XORQ R14, R15 + MOVQ R15, 32(SP) + XORQ R8, R13 + ROLQ $0x15, R13 + MOVQ R13, AX + ANDQ R14, AX + XORQ R12, AX + MOVQ AX, 16(SP) + NOTQ R12 + ORQ R10, R14 + ORQ R13, R12 + XORQ R13, R14 + XORQ R11, R12 + MOVQ R14, 24(SP) + MOVQ R12, 8(SP) + MOVQ R12, BP + + // Result g + MOVQ 72(DI), R11 + XORQ R9, R11 + MOVQ 80(DI), R12 + ROLQ $0x14, R11 + XORQ BX, R12 + ROLQ $0x03, R12 + MOVQ 24(DI), R10 + MOVQ R11, AX + ORQ R12, AX + XORQ R8, R10 + MOVQ 128(DI), R13 + MOVQ 176(DI), R14 + ROLQ $0x1c, R10 + XORQ R10, AX + MOVQ AX, 40(SP) + XORQ AX, SI + XORQ CX, R13 + ROLQ $0x2d, R13 + MOVQ R12, AX + ANDQ R13, AX + XORQ R11, AX + MOVQ AX, 48(SP) + XORQ AX, BP + XORQ DX, R14 + ROLQ $0x3d, R14 + MOVQ R14, AX + ORQ R10, AX + XORQ R13, AX + MOVQ AX, 64(SP) + ANDQ R11, R10 + XORQ R14, R10 + MOVQ R10, 72(SP) + NOTQ R14 + XORQ R10, R15 + ORQ R14, R13 + XORQ R12, R13 + MOVQ R13, 56(SP) + + // Result k + MOVQ 8(DI), R10 + MOVQ 56(DI), R11 + MOVQ 104(DI), R12 + MOVQ 152(DI), R13 + MOVQ 160(DI), R14 + XORQ DX, R11 + ROLQ $0x06, R11 + XORQ R8, R12 + ROLQ $0x19, R12 + MOVQ R11, AX + ORQ R12, AX + XORQ CX, R10 + ROLQ $0x01, R10 + XORQ R10, AX + MOVQ AX, 80(SP) + XORQ AX, SI + XORQ R9, R13 + ROLQ $0x08, R13 + MOVQ R12, AX + ANDQ R13, AX + XORQ R11, AX + MOVQ AX, 88(SP) + XORQ AX, BP + XORQ BX, R14 + ROLQ $0x12, R14 + NOTQ R13 + MOVQ R13, AX + ANDQ R14, AX + XORQ R12, AX + MOVQ AX, 96(SP) + MOVQ R14, AX + ORQ R10, AX + XORQ R13, AX + MOVQ AX, 104(SP) + ANDQ R11, R10 + XORQ R14, R10 + MOVQ R10, 112(SP) + XORQ R10, R15 + + // Result m + MOVQ 40(DI), R11 + XORQ BX, R11 + MOVQ 88(DI), R12 + ROLQ $0x24, R11 + XORQ CX, R12 + MOVQ 32(DI), R10 + ROLQ $0x0a, R12 + MOVQ R11, AX + MOVQ 136(DI), R13 + ANDQ R12, AX + XORQ R9, R10 + MOVQ 184(DI), R14 + ROLQ $0x1b, R10 + XORQ R10, AX + MOVQ AX, 120(SP) + XORQ AX, SI + XORQ DX, R13 + ROLQ $0x0f, R13 + MOVQ R12, AX + ORQ R13, AX + XORQ R11, AX + MOVQ AX, 128(SP) + XORQ AX, BP + XORQ R8, R14 + ROLQ $0x38, R14 + NOTQ R13 + MOVQ R13, AX + ORQ R14, AX + XORQ R12, AX + MOVQ AX, 136(SP) + ORQ R10, R11 + XORQ R14, R11 + MOVQ R11, 152(SP) + ANDQ R10, R14 + XORQ R13, R14 + MOVQ R14, 144(SP) + XORQ R11, R15 + + // Result s + MOVQ 16(DI), R10 + MOVQ 64(DI), R11 + MOVQ 112(DI), R12 + XORQ DX, R10 + MOVQ 120(DI), R13 + ROLQ $0x3e, R10 + XORQ R8, R11 + MOVQ 168(DI), R14 + ROLQ $0x37, R11 + XORQ R9, R12 + MOVQ R10, R9 + XORQ CX, R14 + ROLQ $0x02, R14 + ANDQ R11, R9 + XORQ R14, R9 + MOVQ R9, 192(SP) + ROLQ $0x27, R12 + XORQ R9, R15 + NOTQ R11 + XORQ BX, R13 + MOVQ R11, BX + ANDQ R12, BX + XORQ R10, BX + MOVQ BX, 160(SP) + XORQ BX, SI + ROLQ $0x29, R13 + MOVQ R12, CX + ORQ R13, CX + XORQ R11, CX + MOVQ CX, 168(SP) + XORQ CX, BP + MOVQ R13, DX + MOVQ R14, R8 + ANDQ R14, DX + ORQ R10, R8 + XORQ R12, DX + XORQ R13, R8 + MOVQ DX, 176(SP) + MOVQ R8, 184(SP) + + // Prepare round + MOVQ BP, BX + ROLQ $0x01, BX + MOVQ 16(SP), R12 + XORQ 56(SP), DX + XORQ R15, BX + XORQ 96(SP), R12 + XORQ 136(SP), DX + XORQ DX, R12 + MOVQ R12, CX + ROLQ $0x01, CX + MOVQ 24(SP), R13 + XORQ 64(SP), R8 + XORQ SI, CX + XORQ 104(SP), R13 + XORQ 144(SP), R8 + XORQ R8, R13 + MOVQ R13, DX + ROLQ $0x01, DX + MOVQ R15, R8 + XORQ BP, DX + ROLQ $0x01, R8 + MOVQ SI, R9 + XORQ R12, R8 + ROLQ $0x01, R9 + + // Result b + MOVQ (SP), R10 + MOVQ 48(SP), R11 + XORQ R13, R9 + MOVQ 96(SP), R12 + MOVQ 144(SP), R13 + MOVQ 192(SP), R14 + XORQ CX, R11 + ROLQ $0x2c, R11 + XORQ DX, R12 + XORQ BX, R10 + ROLQ $0x2b, R12 + MOVQ R11, SI + MOVQ $0x8000000000008003, AX + ORQ R12, SI + XORQ R10, AX + XORQ AX, SI + MOVQ SI, (DI) + XORQ R9, R14 + ROLQ $0x0e, R14 + MOVQ R10, R15 + ANDQ R11, R15 + XORQ R14, R15 + MOVQ R15, 32(DI) + XORQ R8, R13 + ROLQ $0x15, R13 + MOVQ R13, AX + ANDQ R14, AX + XORQ R12, AX + MOVQ AX, 16(DI) + NOTQ R12 + ORQ R10, R14 + ORQ R13, R12 + XORQ R13, R14 + XORQ R11, R12 + MOVQ R14, 24(DI) + MOVQ R12, 8(DI) + MOVQ R12, BP + + // Result g + MOVQ 72(SP), R11 + XORQ R9, R11 + MOVQ 80(SP), R12 + ROLQ $0x14, R11 + XORQ BX, R12 + ROLQ $0x03, R12 + MOVQ 24(SP), R10 + MOVQ R11, AX + ORQ R12, AX + XORQ R8, R10 + MOVQ 128(SP), R13 + MOVQ 176(SP), R14 + ROLQ $0x1c, R10 + XORQ R10, AX + MOVQ AX, 40(DI) + XORQ AX, SI + XORQ CX, R13 + ROLQ $0x2d, R13 + MOVQ R12, AX + ANDQ R13, AX + XORQ R11, AX + MOVQ AX, 48(DI) + XORQ AX, BP + XORQ DX, R14 + ROLQ $0x3d, R14 + MOVQ R14, AX + ORQ R10, AX + XORQ R13, AX + MOVQ AX, 64(DI) + ANDQ R11, R10 + XORQ R14, R10 + MOVQ R10, 72(DI) + NOTQ R14 + XORQ R10, R15 + ORQ R14, R13 + XORQ R12, R13 + MOVQ R13, 56(DI) + + // Result k + MOVQ 8(SP), R10 + MOVQ 56(SP), R11 + MOVQ 104(SP), R12 + MOVQ 152(SP), R13 + MOVQ 160(SP), R14 + XORQ DX, R11 + ROLQ $0x06, R11 + XORQ R8, R12 + ROLQ $0x19, R12 + MOVQ R11, AX + ORQ R12, AX + XORQ CX, R10 + ROLQ $0x01, R10 + XORQ R10, AX + MOVQ AX, 80(DI) + XORQ AX, SI + XORQ R9, R13 + ROLQ $0x08, R13 + MOVQ R12, AX + ANDQ R13, AX + XORQ R11, AX + MOVQ AX, 88(DI) + XORQ AX, BP + XORQ BX, R14 + ROLQ $0x12, R14 + NOTQ R13 + MOVQ R13, AX + ANDQ R14, AX + XORQ R12, AX + MOVQ AX, 96(DI) + MOVQ R14, AX + ORQ R10, AX + XORQ R13, AX + MOVQ AX, 104(DI) + ANDQ R11, R10 + XORQ R14, R10 + MOVQ R10, 112(DI) + XORQ R10, R15 + + // Result m + MOVQ 40(SP), R11 + XORQ BX, R11 + MOVQ 88(SP), R12 + ROLQ $0x24, R11 + XORQ CX, R12 + MOVQ 32(SP), R10 + ROLQ $0x0a, R12 + MOVQ R11, AX + MOVQ 136(SP), R13 + ANDQ R12, AX + XORQ R9, R10 + MOVQ 184(SP), R14 + ROLQ $0x1b, R10 + XORQ R10, AX + MOVQ AX, 120(DI) + XORQ AX, SI + XORQ DX, R13 + ROLQ $0x0f, R13 + MOVQ R12, AX + ORQ R13, AX + XORQ R11, AX + MOVQ AX, 128(DI) + XORQ AX, BP + XORQ R8, R14 + ROLQ $0x38, R14 + NOTQ R13 + MOVQ R13, AX + ORQ R14, AX + XORQ R12, AX + MOVQ AX, 136(DI) + ORQ R10, R11 + XORQ R14, R11 + MOVQ R11, 152(DI) + ANDQ R10, R14 + XORQ R13, R14 + MOVQ R14, 144(DI) + XORQ R11, R15 + + // Result s + MOVQ 16(SP), R10 + MOVQ 64(SP), R11 + MOVQ 112(SP), R12 + XORQ DX, R10 + MOVQ 120(SP), R13 + ROLQ $0x3e, R10 + XORQ R8, R11 + MOVQ 168(SP), R14 + ROLQ $0x37, R11 + XORQ R9, R12 + MOVQ R10, R9 + XORQ CX, R14 + ROLQ $0x02, R14 + ANDQ R11, R9 + XORQ R14, R9 + MOVQ R9, 192(DI) + ROLQ $0x27, R12 + XORQ R9, R15 + NOTQ R11 + XORQ BX, R13 + MOVQ R11, BX + ANDQ R12, BX + XORQ R10, BX + MOVQ BX, 160(DI) + XORQ BX, SI + ROLQ $0x29, R13 + MOVQ R12, CX + ORQ R13, CX + XORQ R11, CX + MOVQ CX, 168(DI) + XORQ CX, BP + MOVQ R13, DX + MOVQ R14, R8 + ANDQ R14, DX + ORQ R10, R8 + XORQ R12, DX + XORQ R13, R8 + MOVQ DX, 176(DI) + MOVQ R8, 184(DI) + + // Prepare round + MOVQ BP, BX + ROLQ $0x01, BX + MOVQ 16(DI), R12 + XORQ 56(DI), DX + XORQ R15, BX + XORQ 96(DI), R12 + XORQ 136(DI), DX + XORQ DX, R12 + MOVQ R12, CX + ROLQ $0x01, CX + MOVQ 24(DI), R13 + XORQ 64(DI), R8 + XORQ SI, CX + XORQ 104(DI), R13 + XORQ 144(DI), R8 + XORQ R8, R13 + MOVQ R13, DX + ROLQ $0x01, DX + MOVQ R15, R8 + XORQ BP, DX + ROLQ $0x01, R8 + MOVQ SI, R9 + XORQ R12, R8 + ROLQ $0x01, R9 + + // Result b + MOVQ (DI), R10 + MOVQ 48(DI), R11 + XORQ R13, R9 + MOVQ 96(DI), R12 + MOVQ 144(DI), R13 + MOVQ 192(DI), R14 + XORQ CX, R11 + ROLQ $0x2c, R11 + XORQ DX, R12 + XORQ BX, R10 + ROLQ $0x2b, R12 + MOVQ R11, SI + MOVQ $0x8000000000008002, AX + ORQ R12, SI + XORQ R10, AX + XORQ AX, SI + MOVQ SI, (SP) + XORQ R9, R14 + ROLQ $0x0e, R14 + MOVQ R10, R15 + ANDQ R11, R15 + XORQ R14, R15 + MOVQ R15, 32(SP) + XORQ R8, R13 + ROLQ $0x15, R13 + MOVQ R13, AX + ANDQ R14, AX + XORQ R12, AX + MOVQ AX, 16(SP) + NOTQ R12 + ORQ R10, R14 + ORQ R13, R12 + XORQ R13, R14 + XORQ R11, R12 + MOVQ R14, 24(SP) + MOVQ R12, 8(SP) + MOVQ R12, BP + + // Result g + MOVQ 72(DI), R11 + XORQ R9, R11 + MOVQ 80(DI), R12 + ROLQ $0x14, R11 + XORQ BX, R12 + ROLQ $0x03, R12 + MOVQ 24(DI), R10 + MOVQ R11, AX + ORQ R12, AX + XORQ R8, R10 + MOVQ 128(DI), R13 + MOVQ 176(DI), R14 + ROLQ $0x1c, R10 + XORQ R10, AX + MOVQ AX, 40(SP) + XORQ AX, SI + XORQ CX, R13 + ROLQ $0x2d, R13 + MOVQ R12, AX + ANDQ R13, AX + XORQ R11, AX + MOVQ AX, 48(SP) + XORQ AX, BP + XORQ DX, R14 + ROLQ $0x3d, R14 + MOVQ R14, AX + ORQ R10, AX + XORQ R13, AX + MOVQ AX, 64(SP) + ANDQ R11, R10 + XORQ R14, R10 + MOVQ R10, 72(SP) + NOTQ R14 + XORQ R10, R15 + ORQ R14, R13 + XORQ R12, R13 + MOVQ R13, 56(SP) + + // Result k + MOVQ 8(DI), R10 + MOVQ 56(DI), R11 + MOVQ 104(DI), R12 + MOVQ 152(DI), R13 + MOVQ 160(DI), R14 + XORQ DX, R11 + ROLQ $0x06, R11 + XORQ R8, R12 + ROLQ $0x19, R12 + MOVQ R11, AX + ORQ R12, AX + XORQ CX, R10 + ROLQ $0x01, R10 + XORQ R10, AX + MOVQ AX, 80(SP) + XORQ AX, SI + XORQ R9, R13 + ROLQ $0x08, R13 + MOVQ R12, AX + ANDQ R13, AX + XORQ R11, AX + MOVQ AX, 88(SP) + XORQ AX, BP + XORQ BX, R14 + ROLQ $0x12, R14 + NOTQ R13 + MOVQ R13, AX + ANDQ R14, AX + XORQ R12, AX + MOVQ AX, 96(SP) + MOVQ R14, AX + ORQ R10, AX + XORQ R13, AX + MOVQ AX, 104(SP) + ANDQ R11, R10 + XORQ R14, R10 + MOVQ R10, 112(SP) + XORQ R10, R15 + + // Result m + MOVQ 40(DI), R11 + XORQ BX, R11 + MOVQ 88(DI), R12 + ROLQ $0x24, R11 + XORQ CX, R12 + MOVQ 32(DI), R10 + ROLQ $0x0a, R12 + MOVQ R11, AX + MOVQ 136(DI), R13 + ANDQ R12, AX + XORQ R9, R10 + MOVQ 184(DI), R14 + ROLQ $0x1b, R10 + XORQ R10, AX + MOVQ AX, 120(SP) + XORQ AX, SI + XORQ DX, R13 + ROLQ $0x0f, R13 + MOVQ R12, AX + ORQ R13, AX + XORQ R11, AX + MOVQ AX, 128(SP) + XORQ AX, BP + XORQ R8, R14 + ROLQ $0x38, R14 + NOTQ R13 + MOVQ R13, AX + ORQ R14, AX + XORQ R12, AX + MOVQ AX, 136(SP) + ORQ R10, R11 + XORQ R14, R11 + MOVQ R11, 152(SP) + ANDQ R10, R14 + XORQ R13, R14 + MOVQ R14, 144(SP) + XORQ R11, R15 + + // Result s + MOVQ 16(DI), R10 + MOVQ 64(DI), R11 + MOVQ 112(DI), R12 + XORQ DX, R10 + MOVQ 120(DI), R13 + ROLQ $0x3e, R10 + XORQ R8, R11 + MOVQ 168(DI), R14 + ROLQ $0x37, R11 + XORQ R9, R12 + MOVQ R10, R9 + XORQ CX, R14 + ROLQ $0x02, R14 + ANDQ R11, R9 + XORQ R14, R9 + MOVQ R9, 192(SP) + ROLQ $0x27, R12 + XORQ R9, R15 + NOTQ R11 + XORQ BX, R13 + MOVQ R11, BX + ANDQ R12, BX + XORQ R10, BX + MOVQ BX, 160(SP) + XORQ BX, SI + ROLQ $0x29, R13 + MOVQ R12, CX + ORQ R13, CX + XORQ R11, CX + MOVQ CX, 168(SP) + XORQ CX, BP + MOVQ R13, DX + MOVQ R14, R8 + ANDQ R14, DX + ORQ R10, R8 + XORQ R12, DX + XORQ R13, R8 + MOVQ DX, 176(SP) + MOVQ R8, 184(SP) + + // Prepare round + MOVQ BP, BX + ROLQ $0x01, BX + MOVQ 16(SP), R12 + XORQ 56(SP), DX + XORQ R15, BX + XORQ 96(SP), R12 + XORQ 136(SP), DX + XORQ DX, R12 + MOVQ R12, CX + ROLQ $0x01, CX + MOVQ 24(SP), R13 + XORQ 64(SP), R8 + XORQ SI, CX + XORQ 104(SP), R13 + XORQ 144(SP), R8 + XORQ R8, R13 + MOVQ R13, DX + ROLQ $0x01, DX + MOVQ R15, R8 + XORQ BP, DX + ROLQ $0x01, R8 + MOVQ SI, R9 + XORQ R12, R8 + ROLQ $0x01, R9 + + // Result b + MOVQ (SP), R10 + MOVQ 48(SP), R11 + XORQ R13, R9 + MOVQ 96(SP), R12 + MOVQ 144(SP), R13 + MOVQ 192(SP), R14 + XORQ CX, R11 + ROLQ $0x2c, R11 + XORQ DX, R12 + XORQ BX, R10 + ROLQ $0x2b, R12 + MOVQ R11, SI + MOVQ $0x8000000000000080, AX + ORQ R12, SI + XORQ R10, AX + XORQ AX, SI + MOVQ SI, (DI) + XORQ R9, R14 + ROLQ $0x0e, R14 + MOVQ R10, R15 + ANDQ R11, R15 + XORQ R14, R15 + MOVQ R15, 32(DI) + XORQ R8, R13 + ROLQ $0x15, R13 + MOVQ R13, AX + ANDQ R14, AX + XORQ R12, AX + MOVQ AX, 16(DI) + NOTQ R12 + ORQ R10, R14 + ORQ R13, R12 + XORQ R13, R14 + XORQ R11, R12 + MOVQ R14, 24(DI) + MOVQ R12, 8(DI) + MOVQ R12, BP + + // Result g + MOVQ 72(SP), R11 + XORQ R9, R11 + MOVQ 80(SP), R12 + ROLQ $0x14, R11 + XORQ BX, R12 + ROLQ $0x03, R12 + MOVQ 24(SP), R10 + MOVQ R11, AX + ORQ R12, AX + XORQ R8, R10 + MOVQ 128(SP), R13 + MOVQ 176(SP), R14 + ROLQ $0x1c, R10 + XORQ R10, AX + MOVQ AX, 40(DI) + XORQ AX, SI + XORQ CX, R13 + ROLQ $0x2d, R13 + MOVQ R12, AX + ANDQ R13, AX + XORQ R11, AX + MOVQ AX, 48(DI) + XORQ AX, BP + XORQ DX, R14 + ROLQ $0x3d, R14 + MOVQ R14, AX + ORQ R10, AX + XORQ R13, AX + MOVQ AX, 64(DI) + ANDQ R11, R10 + XORQ R14, R10 + MOVQ R10, 72(DI) + NOTQ R14 + XORQ R10, R15 + ORQ R14, R13 + XORQ R12, R13 + MOVQ R13, 56(DI) + + // Result k + MOVQ 8(SP), R10 + MOVQ 56(SP), R11 + MOVQ 104(SP), R12 + MOVQ 152(SP), R13 + MOVQ 160(SP), R14 + XORQ DX, R11 + ROLQ $0x06, R11 + XORQ R8, R12 + ROLQ $0x19, R12 + MOVQ R11, AX + ORQ R12, AX + XORQ CX, R10 + ROLQ $0x01, R10 + XORQ R10, AX + MOVQ AX, 80(DI) + XORQ AX, SI + XORQ R9, R13 + ROLQ $0x08, R13 + MOVQ R12, AX + ANDQ R13, AX + XORQ R11, AX + MOVQ AX, 88(DI) + XORQ AX, BP + XORQ BX, R14 + ROLQ $0x12, R14 + NOTQ R13 + MOVQ R13, AX + ANDQ R14, AX + XORQ R12, AX + MOVQ AX, 96(DI) + MOVQ R14, AX + ORQ R10, AX + XORQ R13, AX + MOVQ AX, 104(DI) + ANDQ R11, R10 + XORQ R14, R10 + MOVQ R10, 112(DI) + XORQ R10, R15 + + // Result m + MOVQ 40(SP), R11 + XORQ BX, R11 + MOVQ 88(SP), R12 + ROLQ $0x24, R11 + XORQ CX, R12 + MOVQ 32(SP), R10 + ROLQ $0x0a, R12 + MOVQ R11, AX + MOVQ 136(SP), R13 + ANDQ R12, AX + XORQ R9, R10 + MOVQ 184(SP), R14 + ROLQ $0x1b, R10 + XORQ R10, AX + MOVQ AX, 120(DI) + XORQ AX, SI + XORQ DX, R13 + ROLQ $0x0f, R13 + MOVQ R12, AX + ORQ R13, AX + XORQ R11, AX + MOVQ AX, 128(DI) + XORQ AX, BP + XORQ R8, R14 + ROLQ $0x38, R14 + NOTQ R13 + MOVQ R13, AX + ORQ R14, AX + XORQ R12, AX + MOVQ AX, 136(DI) + ORQ R10, R11 + XORQ R14, R11 + MOVQ R11, 152(DI) + ANDQ R10, R14 + XORQ R13, R14 + MOVQ R14, 144(DI) + XORQ R11, R15 + + // Result s + MOVQ 16(SP), R10 + MOVQ 64(SP), R11 + MOVQ 112(SP), R12 + XORQ DX, R10 + MOVQ 120(SP), R13 + ROLQ $0x3e, R10 + XORQ R8, R11 + MOVQ 168(SP), R14 + ROLQ $0x37, R11 + XORQ R9, R12 + MOVQ R10, R9 + XORQ CX, R14 + ROLQ $0x02, R14 + ANDQ R11, R9 + XORQ R14, R9 + MOVQ R9, 192(DI) + ROLQ $0x27, R12 + XORQ R9, R15 + NOTQ R11 + XORQ BX, R13 + MOVQ R11, BX + ANDQ R12, BX + XORQ R10, BX + MOVQ BX, 160(DI) + XORQ BX, SI + ROLQ $0x29, R13 + MOVQ R12, CX + ORQ R13, CX + XORQ R11, CX + MOVQ CX, 168(DI) + XORQ CX, BP + MOVQ R13, DX + MOVQ R14, R8 + ANDQ R14, DX + ORQ R10, R8 + XORQ R12, DX + XORQ R13, R8 + MOVQ DX, 176(DI) + MOVQ R8, 184(DI) + + // Prepare round + MOVQ BP, BX + ROLQ $0x01, BX + MOVQ 16(DI), R12 + XORQ 56(DI), DX + XORQ R15, BX + XORQ 96(DI), R12 + XORQ 136(DI), DX + XORQ DX, R12 + MOVQ R12, CX + ROLQ $0x01, CX + MOVQ 24(DI), R13 + XORQ 64(DI), R8 + XORQ SI, CX + XORQ 104(DI), R13 + XORQ 144(DI), R8 + XORQ R8, R13 + MOVQ R13, DX + ROLQ $0x01, DX + MOVQ R15, R8 + XORQ BP, DX + ROLQ $0x01, R8 + MOVQ SI, R9 + XORQ R12, R8 + ROLQ $0x01, R9 + + // Result b + MOVQ (DI), R10 + MOVQ 48(DI), R11 + XORQ R13, R9 + MOVQ 96(DI), R12 + MOVQ 144(DI), R13 + MOVQ 192(DI), R14 + XORQ CX, R11 + ROLQ $0x2c, R11 + XORQ DX, R12 + XORQ BX, R10 + ROLQ $0x2b, R12 + MOVQ R11, SI + MOVQ $0x000000000000800a, AX + ORQ R12, SI + XORQ R10, AX + XORQ AX, SI + MOVQ SI, (SP) + XORQ R9, R14 + ROLQ $0x0e, R14 + MOVQ R10, R15 + ANDQ R11, R15 + XORQ R14, R15 + MOVQ R15, 32(SP) + XORQ R8, R13 + ROLQ $0x15, R13 + MOVQ R13, AX + ANDQ R14, AX + XORQ R12, AX + MOVQ AX, 16(SP) + NOTQ R12 + ORQ R10, R14 + ORQ R13, R12 + XORQ R13, R14 + XORQ R11, R12 + MOVQ R14, 24(SP) + MOVQ R12, 8(SP) + MOVQ R12, BP + + // Result g + MOVQ 72(DI), R11 + XORQ R9, R11 + MOVQ 80(DI), R12 + ROLQ $0x14, R11 + XORQ BX, R12 + ROLQ $0x03, R12 + MOVQ 24(DI), R10 + MOVQ R11, AX + ORQ R12, AX + XORQ R8, R10 + MOVQ 128(DI), R13 + MOVQ 176(DI), R14 + ROLQ $0x1c, R10 + XORQ R10, AX + MOVQ AX, 40(SP) + XORQ AX, SI + XORQ CX, R13 + ROLQ $0x2d, R13 + MOVQ R12, AX + ANDQ R13, AX + XORQ R11, AX + MOVQ AX, 48(SP) + XORQ AX, BP + XORQ DX, R14 + ROLQ $0x3d, R14 + MOVQ R14, AX + ORQ R10, AX + XORQ R13, AX + MOVQ AX, 64(SP) + ANDQ R11, R10 + XORQ R14, R10 + MOVQ R10, 72(SP) + NOTQ R14 + XORQ R10, R15 + ORQ R14, R13 + XORQ R12, R13 + MOVQ R13, 56(SP) + + // Result k + MOVQ 8(DI), R10 + MOVQ 56(DI), R11 + MOVQ 104(DI), R12 + MOVQ 152(DI), R13 + MOVQ 160(DI), R14 + XORQ DX, R11 + ROLQ $0x06, R11 + XORQ R8, R12 + ROLQ $0x19, R12 + MOVQ R11, AX + ORQ R12, AX + XORQ CX, R10 + ROLQ $0x01, R10 + XORQ R10, AX + MOVQ AX, 80(SP) + XORQ AX, SI + XORQ R9, R13 + ROLQ $0x08, R13 + MOVQ R12, AX + ANDQ R13, AX + XORQ R11, AX + MOVQ AX, 88(SP) + XORQ AX, BP + XORQ BX, R14 + ROLQ $0x12, R14 + NOTQ R13 + MOVQ R13, AX + ANDQ R14, AX + XORQ R12, AX + MOVQ AX, 96(SP) + MOVQ R14, AX + ORQ R10, AX + XORQ R13, AX + MOVQ AX, 104(SP) + ANDQ R11, R10 + XORQ R14, R10 + MOVQ R10, 112(SP) + XORQ R10, R15 + + // Result m + MOVQ 40(DI), R11 + XORQ BX, R11 + MOVQ 88(DI), R12 + ROLQ $0x24, R11 + XORQ CX, R12 + MOVQ 32(DI), R10 + ROLQ $0x0a, R12 + MOVQ R11, AX + MOVQ 136(DI), R13 + ANDQ R12, AX + XORQ R9, R10 + MOVQ 184(DI), R14 + ROLQ $0x1b, R10 + XORQ R10, AX + MOVQ AX, 120(SP) + XORQ AX, SI + XORQ DX, R13 + ROLQ $0x0f, R13 + MOVQ R12, AX + ORQ R13, AX + XORQ R11, AX + MOVQ AX, 128(SP) + XORQ AX, BP + XORQ R8, R14 + ROLQ $0x38, R14 + NOTQ R13 + MOVQ R13, AX + ORQ R14, AX + XORQ R12, AX + MOVQ AX, 136(SP) + ORQ R10, R11 + XORQ R14, R11 + MOVQ R11, 152(SP) + ANDQ R10, R14 + XORQ R13, R14 + MOVQ R14, 144(SP) + XORQ R11, R15 + + // Result s + MOVQ 16(DI), R10 + MOVQ 64(DI), R11 + MOVQ 112(DI), R12 + XORQ DX, R10 + MOVQ 120(DI), R13 + ROLQ $0x3e, R10 + XORQ R8, R11 + MOVQ 168(DI), R14 + ROLQ $0x37, R11 + XORQ R9, R12 + MOVQ R10, R9 + XORQ CX, R14 + ROLQ $0x02, R14 + ANDQ R11, R9 + XORQ R14, R9 + MOVQ R9, 192(SP) + ROLQ $0x27, R12 + XORQ R9, R15 + NOTQ R11 + XORQ BX, R13 + MOVQ R11, BX + ANDQ R12, BX + XORQ R10, BX + MOVQ BX, 160(SP) + XORQ BX, SI + ROLQ $0x29, R13 + MOVQ R12, CX + ORQ R13, CX + XORQ R11, CX + MOVQ CX, 168(SP) + XORQ CX, BP + MOVQ R13, DX + MOVQ R14, R8 + ANDQ R14, DX + ORQ R10, R8 + XORQ R12, DX + XORQ R13, R8 + MOVQ DX, 176(SP) + MOVQ R8, 184(SP) + + // Prepare round + MOVQ BP, BX + ROLQ $0x01, BX + MOVQ 16(SP), R12 + XORQ 56(SP), DX + XORQ R15, BX + XORQ 96(SP), R12 + XORQ 136(SP), DX + XORQ DX, R12 + MOVQ R12, CX + ROLQ $0x01, CX + MOVQ 24(SP), R13 + XORQ 64(SP), R8 + XORQ SI, CX + XORQ 104(SP), R13 + XORQ 144(SP), R8 + XORQ R8, R13 + MOVQ R13, DX + ROLQ $0x01, DX + MOVQ R15, R8 + XORQ BP, DX + ROLQ $0x01, R8 + MOVQ SI, R9 + XORQ R12, R8 + ROLQ $0x01, R9 + + // Result b + MOVQ (SP), R10 + MOVQ 48(SP), R11 + XORQ R13, R9 + MOVQ 96(SP), R12 + MOVQ 144(SP), R13 + MOVQ 192(SP), R14 + XORQ CX, R11 + ROLQ $0x2c, R11 + XORQ DX, R12 + XORQ BX, R10 + ROLQ $0x2b, R12 + MOVQ R11, SI + MOVQ $0x800000008000000a, AX + ORQ R12, SI + XORQ R10, AX + XORQ AX, SI + MOVQ SI, (DI) + XORQ R9, R14 + ROLQ $0x0e, R14 + MOVQ R10, R15 + ANDQ R11, R15 + XORQ R14, R15 + MOVQ R15, 32(DI) + XORQ R8, R13 + ROLQ $0x15, R13 + MOVQ R13, AX + ANDQ R14, AX + XORQ R12, AX + MOVQ AX, 16(DI) + NOTQ R12 + ORQ R10, R14 + ORQ R13, R12 + XORQ R13, R14 + XORQ R11, R12 + MOVQ R14, 24(DI) + MOVQ R12, 8(DI) + MOVQ R12, BP + + // Result g + MOVQ 72(SP), R11 + XORQ R9, R11 + MOVQ 80(SP), R12 + ROLQ $0x14, R11 + XORQ BX, R12 + ROLQ $0x03, R12 + MOVQ 24(SP), R10 + MOVQ R11, AX + ORQ R12, AX + XORQ R8, R10 + MOVQ 128(SP), R13 + MOVQ 176(SP), R14 + ROLQ $0x1c, R10 + XORQ R10, AX + MOVQ AX, 40(DI) + XORQ AX, SI + XORQ CX, R13 + ROLQ $0x2d, R13 + MOVQ R12, AX + ANDQ R13, AX + XORQ R11, AX + MOVQ AX, 48(DI) + XORQ AX, BP + XORQ DX, R14 + ROLQ $0x3d, R14 + MOVQ R14, AX + ORQ R10, AX + XORQ R13, AX + MOVQ AX, 64(DI) + ANDQ R11, R10 + XORQ R14, R10 + MOVQ R10, 72(DI) + NOTQ R14 + XORQ R10, R15 + ORQ R14, R13 + XORQ R12, R13 + MOVQ R13, 56(DI) + + // Result k + MOVQ 8(SP), R10 + MOVQ 56(SP), R11 + MOVQ 104(SP), R12 + MOVQ 152(SP), R13 + MOVQ 160(SP), R14 + XORQ DX, R11 + ROLQ $0x06, R11 + XORQ R8, R12 + ROLQ $0x19, R12 + MOVQ R11, AX + ORQ R12, AX + XORQ CX, R10 + ROLQ $0x01, R10 + XORQ R10, AX + MOVQ AX, 80(DI) + XORQ AX, SI + XORQ R9, R13 + ROLQ $0x08, R13 + MOVQ R12, AX + ANDQ R13, AX + XORQ R11, AX + MOVQ AX, 88(DI) + XORQ AX, BP + XORQ BX, R14 + ROLQ $0x12, R14 + NOTQ R13 + MOVQ R13, AX + ANDQ R14, AX + XORQ R12, AX + MOVQ AX, 96(DI) + MOVQ R14, AX + ORQ R10, AX + XORQ R13, AX + MOVQ AX, 104(DI) + ANDQ R11, R10 + XORQ R14, R10 + MOVQ R10, 112(DI) + XORQ R10, R15 + + // Result m + MOVQ 40(SP), R11 + XORQ BX, R11 + MOVQ 88(SP), R12 + ROLQ $0x24, R11 + XORQ CX, R12 + MOVQ 32(SP), R10 + ROLQ $0x0a, R12 + MOVQ R11, AX + MOVQ 136(SP), R13 + ANDQ R12, AX + XORQ R9, R10 + MOVQ 184(SP), R14 + ROLQ $0x1b, R10 + XORQ R10, AX + MOVQ AX, 120(DI) + XORQ AX, SI + XORQ DX, R13 + ROLQ $0x0f, R13 + MOVQ R12, AX + ORQ R13, AX + XORQ R11, AX + MOVQ AX, 128(DI) + XORQ AX, BP + XORQ R8, R14 + ROLQ $0x38, R14 + NOTQ R13 + MOVQ R13, AX + ORQ R14, AX + XORQ R12, AX + MOVQ AX, 136(DI) + ORQ R10, R11 + XORQ R14, R11 + MOVQ R11, 152(DI) + ANDQ R10, R14 + XORQ R13, R14 + MOVQ R14, 144(DI) + XORQ R11, R15 + + // Result s + MOVQ 16(SP), R10 + MOVQ 64(SP), R11 + MOVQ 112(SP), R12 + XORQ DX, R10 + MOVQ 120(SP), R13 + ROLQ $0x3e, R10 + XORQ R8, R11 + MOVQ 168(SP), R14 + ROLQ $0x37, R11 + XORQ R9, R12 + MOVQ R10, R9 + XORQ CX, R14 + ROLQ $0x02, R14 + ANDQ R11, R9 + XORQ R14, R9 + MOVQ R9, 192(DI) + ROLQ $0x27, R12 + XORQ R9, R15 + NOTQ R11 + XORQ BX, R13 + MOVQ R11, BX + ANDQ R12, BX + XORQ R10, BX + MOVQ BX, 160(DI) + XORQ BX, SI + ROLQ $0x29, R13 + MOVQ R12, CX + ORQ R13, CX + XORQ R11, CX + MOVQ CX, 168(DI) + XORQ CX, BP + MOVQ R13, DX + MOVQ R14, R8 + ANDQ R14, DX + ORQ R10, R8 + XORQ R12, DX + XORQ R13, R8 + MOVQ DX, 176(DI) + MOVQ R8, 184(DI) + + // Prepare round + MOVQ BP, BX + ROLQ $0x01, BX + MOVQ 16(DI), R12 + XORQ 56(DI), DX + XORQ R15, BX + XORQ 96(DI), R12 + XORQ 136(DI), DX + XORQ DX, R12 + MOVQ R12, CX + ROLQ $0x01, CX + MOVQ 24(DI), R13 + XORQ 64(DI), R8 + XORQ SI, CX + XORQ 104(DI), R13 + XORQ 144(DI), R8 + XORQ R8, R13 + MOVQ R13, DX + ROLQ $0x01, DX + MOVQ R15, R8 + XORQ BP, DX + ROLQ $0x01, R8 + MOVQ SI, R9 + XORQ R12, R8 + ROLQ $0x01, R9 + + // Result b + MOVQ (DI), R10 + MOVQ 48(DI), R11 + XORQ R13, R9 + MOVQ 96(DI), R12 + MOVQ 144(DI), R13 + MOVQ 192(DI), R14 + XORQ CX, R11 + ROLQ $0x2c, R11 + XORQ DX, R12 + XORQ BX, R10 + ROLQ $0x2b, R12 + MOVQ R11, SI + MOVQ $0x8000000080008081, AX + ORQ R12, SI + XORQ R10, AX + XORQ AX, SI + MOVQ SI, (SP) + XORQ R9, R14 + ROLQ $0x0e, R14 + MOVQ R10, R15 + ANDQ R11, R15 + XORQ R14, R15 + MOVQ R15, 32(SP) + XORQ R8, R13 + ROLQ $0x15, R13 + MOVQ R13, AX + ANDQ R14, AX + XORQ R12, AX + MOVQ AX, 16(SP) + NOTQ R12 + ORQ R10, R14 + ORQ R13, R12 + XORQ R13, R14 + XORQ R11, R12 + MOVQ R14, 24(SP) + MOVQ R12, 8(SP) + MOVQ R12, BP + + // Result g + MOVQ 72(DI), R11 + XORQ R9, R11 + MOVQ 80(DI), R12 + ROLQ $0x14, R11 + XORQ BX, R12 + ROLQ $0x03, R12 + MOVQ 24(DI), R10 + MOVQ R11, AX + ORQ R12, AX + XORQ R8, R10 + MOVQ 128(DI), R13 + MOVQ 176(DI), R14 + ROLQ $0x1c, R10 + XORQ R10, AX + MOVQ AX, 40(SP) + XORQ AX, SI + XORQ CX, R13 + ROLQ $0x2d, R13 + MOVQ R12, AX + ANDQ R13, AX + XORQ R11, AX + MOVQ AX, 48(SP) + XORQ AX, BP + XORQ DX, R14 + ROLQ $0x3d, R14 + MOVQ R14, AX + ORQ R10, AX + XORQ R13, AX + MOVQ AX, 64(SP) + ANDQ R11, R10 + XORQ R14, R10 + MOVQ R10, 72(SP) + NOTQ R14 + XORQ R10, R15 + ORQ R14, R13 + XORQ R12, R13 + MOVQ R13, 56(SP) + + // Result k + MOVQ 8(DI), R10 + MOVQ 56(DI), R11 + MOVQ 104(DI), R12 + MOVQ 152(DI), R13 + MOVQ 160(DI), R14 + XORQ DX, R11 + ROLQ $0x06, R11 + XORQ R8, R12 + ROLQ $0x19, R12 + MOVQ R11, AX + ORQ R12, AX + XORQ CX, R10 + ROLQ $0x01, R10 + XORQ R10, AX + MOVQ AX, 80(SP) + XORQ AX, SI + XORQ R9, R13 + ROLQ $0x08, R13 + MOVQ R12, AX + ANDQ R13, AX + XORQ R11, AX + MOVQ AX, 88(SP) + XORQ AX, BP + XORQ BX, R14 + ROLQ $0x12, R14 + NOTQ R13 + MOVQ R13, AX + ANDQ R14, AX + XORQ R12, AX + MOVQ AX, 96(SP) + MOVQ R14, AX + ORQ R10, AX + XORQ R13, AX + MOVQ AX, 104(SP) + ANDQ R11, R10 + XORQ R14, R10 + MOVQ R10, 112(SP) + XORQ R10, R15 + + // Result m + MOVQ 40(DI), R11 + XORQ BX, R11 + MOVQ 88(DI), R12 + ROLQ $0x24, R11 + XORQ CX, R12 + MOVQ 32(DI), R10 + ROLQ $0x0a, R12 + MOVQ R11, AX + MOVQ 136(DI), R13 + ANDQ R12, AX + XORQ R9, R10 + MOVQ 184(DI), R14 + ROLQ $0x1b, R10 + XORQ R10, AX + MOVQ AX, 120(SP) + XORQ AX, SI + XORQ DX, R13 + ROLQ $0x0f, R13 + MOVQ R12, AX + ORQ R13, AX + XORQ R11, AX + MOVQ AX, 128(SP) + XORQ AX, BP + XORQ R8, R14 + ROLQ $0x38, R14 + NOTQ R13 + MOVQ R13, AX + ORQ R14, AX + XORQ R12, AX + MOVQ AX, 136(SP) + ORQ R10, R11 + XORQ R14, R11 + MOVQ R11, 152(SP) + ANDQ R10, R14 + XORQ R13, R14 + MOVQ R14, 144(SP) + XORQ R11, R15 + + // Result s + MOVQ 16(DI), R10 + MOVQ 64(DI), R11 + MOVQ 112(DI), R12 + XORQ DX, R10 + MOVQ 120(DI), R13 + ROLQ $0x3e, R10 + XORQ R8, R11 + MOVQ 168(DI), R14 + ROLQ $0x37, R11 + XORQ R9, R12 + MOVQ R10, R9 + XORQ CX, R14 + ROLQ $0x02, R14 + ANDQ R11, R9 + XORQ R14, R9 + MOVQ R9, 192(SP) + ROLQ $0x27, R12 + XORQ R9, R15 + NOTQ R11 + XORQ BX, R13 + MOVQ R11, BX + ANDQ R12, BX + XORQ R10, BX + MOVQ BX, 160(SP) + XORQ BX, SI + ROLQ $0x29, R13 + MOVQ R12, CX + ORQ R13, CX + XORQ R11, CX + MOVQ CX, 168(SP) + XORQ CX, BP + MOVQ R13, DX + MOVQ R14, R8 + ANDQ R14, DX + ORQ R10, R8 + XORQ R12, DX + XORQ R13, R8 + MOVQ DX, 176(SP) + MOVQ R8, 184(SP) + + // Prepare round + MOVQ BP, BX + ROLQ $0x01, BX + MOVQ 16(SP), R12 + XORQ 56(SP), DX + XORQ R15, BX + XORQ 96(SP), R12 + XORQ 136(SP), DX + XORQ DX, R12 + MOVQ R12, CX + ROLQ $0x01, CX + MOVQ 24(SP), R13 + XORQ 64(SP), R8 + XORQ SI, CX + XORQ 104(SP), R13 + XORQ 144(SP), R8 + XORQ R8, R13 + MOVQ R13, DX + ROLQ $0x01, DX + MOVQ R15, R8 + XORQ BP, DX + ROLQ $0x01, R8 + MOVQ SI, R9 + XORQ R12, R8 + ROLQ $0x01, R9 + + // Result b + MOVQ (SP), R10 + MOVQ 48(SP), R11 + XORQ R13, R9 + MOVQ 96(SP), R12 + MOVQ 144(SP), R13 + MOVQ 192(SP), R14 + XORQ CX, R11 + ROLQ $0x2c, R11 + XORQ DX, R12 + XORQ BX, R10 + ROLQ $0x2b, R12 + MOVQ R11, SI + MOVQ $0x8000000000008080, AX + ORQ R12, SI + XORQ R10, AX + XORQ AX, SI + MOVQ SI, (DI) + XORQ R9, R14 + ROLQ $0x0e, R14 + MOVQ R10, R15 + ANDQ R11, R15 + XORQ R14, R15 + MOVQ R15, 32(DI) + XORQ R8, R13 + ROLQ $0x15, R13 + MOVQ R13, AX + ANDQ R14, AX + XORQ R12, AX + MOVQ AX, 16(DI) + NOTQ R12 + ORQ R10, R14 + ORQ R13, R12 + XORQ R13, R14 + XORQ R11, R12 + MOVQ R14, 24(DI) + MOVQ R12, 8(DI) + MOVQ R12, BP + + // Result g + MOVQ 72(SP), R11 + XORQ R9, R11 + MOVQ 80(SP), R12 + ROLQ $0x14, R11 + XORQ BX, R12 + ROLQ $0x03, R12 + MOVQ 24(SP), R10 + MOVQ R11, AX + ORQ R12, AX + XORQ R8, R10 + MOVQ 128(SP), R13 + MOVQ 176(SP), R14 + ROLQ $0x1c, R10 + XORQ R10, AX + MOVQ AX, 40(DI) + XORQ AX, SI + XORQ CX, R13 + ROLQ $0x2d, R13 + MOVQ R12, AX + ANDQ R13, AX + XORQ R11, AX + MOVQ AX, 48(DI) + XORQ AX, BP + XORQ DX, R14 + ROLQ $0x3d, R14 + MOVQ R14, AX + ORQ R10, AX + XORQ R13, AX + MOVQ AX, 64(DI) + ANDQ R11, R10 + XORQ R14, R10 + MOVQ R10, 72(DI) + NOTQ R14 + XORQ R10, R15 + ORQ R14, R13 + XORQ R12, R13 + MOVQ R13, 56(DI) + + // Result k + MOVQ 8(SP), R10 + MOVQ 56(SP), R11 + MOVQ 104(SP), R12 + MOVQ 152(SP), R13 + MOVQ 160(SP), R14 + XORQ DX, R11 + ROLQ $0x06, R11 + XORQ R8, R12 + ROLQ $0x19, R12 + MOVQ R11, AX + ORQ R12, AX + XORQ CX, R10 + ROLQ $0x01, R10 + XORQ R10, AX + MOVQ AX, 80(DI) + XORQ AX, SI + XORQ R9, R13 + ROLQ $0x08, R13 + MOVQ R12, AX + ANDQ R13, AX + XORQ R11, AX + MOVQ AX, 88(DI) + XORQ AX, BP + XORQ BX, R14 + ROLQ $0x12, R14 + NOTQ R13 + MOVQ R13, AX + ANDQ R14, AX + XORQ R12, AX + MOVQ AX, 96(DI) + MOVQ R14, AX + ORQ R10, AX + XORQ R13, AX + MOVQ AX, 104(DI) + ANDQ R11, R10 + XORQ R14, R10 + MOVQ R10, 112(DI) + XORQ R10, R15 + + // Result m + MOVQ 40(SP), R11 + XORQ BX, R11 + MOVQ 88(SP), R12 + ROLQ $0x24, R11 + XORQ CX, R12 + MOVQ 32(SP), R10 + ROLQ $0x0a, R12 + MOVQ R11, AX + MOVQ 136(SP), R13 + ANDQ R12, AX + XORQ R9, R10 + MOVQ 184(SP), R14 + ROLQ $0x1b, R10 + XORQ R10, AX + MOVQ AX, 120(DI) + XORQ AX, SI + XORQ DX, R13 + ROLQ $0x0f, R13 + MOVQ R12, AX + ORQ R13, AX + XORQ R11, AX + MOVQ AX, 128(DI) + XORQ AX, BP + XORQ R8, R14 + ROLQ $0x38, R14 + NOTQ R13 + MOVQ R13, AX + ORQ R14, AX + XORQ R12, AX + MOVQ AX, 136(DI) + ORQ R10, R11 + XORQ R14, R11 + MOVQ R11, 152(DI) + ANDQ R10, R14 + XORQ R13, R14 + MOVQ R14, 144(DI) + XORQ R11, R15 + + // Result s + MOVQ 16(SP), R10 + MOVQ 64(SP), R11 + MOVQ 112(SP), R12 + XORQ DX, R10 + MOVQ 120(SP), R13 + ROLQ $0x3e, R10 + XORQ R8, R11 + MOVQ 168(SP), R14 + ROLQ $0x37, R11 + XORQ R9, R12 + MOVQ R10, R9 + XORQ CX, R14 + ROLQ $0x02, R14 + ANDQ R11, R9 + XORQ R14, R9 + MOVQ R9, 192(DI) + ROLQ $0x27, R12 + XORQ R9, R15 + NOTQ R11 + XORQ BX, R13 + MOVQ R11, BX + ANDQ R12, BX + XORQ R10, BX + MOVQ BX, 160(DI) + XORQ BX, SI + ROLQ $0x29, R13 + MOVQ R12, CX + ORQ R13, CX + XORQ R11, CX + MOVQ CX, 168(DI) + XORQ CX, BP + MOVQ R13, DX + MOVQ R14, R8 + ANDQ R14, DX + ORQ R10, R8 + XORQ R12, DX + XORQ R13, R8 + MOVQ DX, 176(DI) + MOVQ R8, 184(DI) + + // Prepare round + MOVQ BP, BX + ROLQ $0x01, BX + MOVQ 16(DI), R12 + XORQ 56(DI), DX + XORQ R15, BX + XORQ 96(DI), R12 + XORQ 136(DI), DX + XORQ DX, R12 + MOVQ R12, CX + ROLQ $0x01, CX + MOVQ 24(DI), R13 + XORQ 64(DI), R8 + XORQ SI, CX + XORQ 104(DI), R13 + XORQ 144(DI), R8 + XORQ R8, R13 + MOVQ R13, DX + ROLQ $0x01, DX + MOVQ R15, R8 + XORQ BP, DX + ROLQ $0x01, R8 + MOVQ SI, R9 + XORQ R12, R8 + ROLQ $0x01, R9 + + // Result b + MOVQ (DI), R10 + MOVQ 48(DI), R11 + XORQ R13, R9 + MOVQ 96(DI), R12 + MOVQ 144(DI), R13 + MOVQ 192(DI), R14 + XORQ CX, R11 + ROLQ $0x2c, R11 + XORQ DX, R12 + XORQ BX, R10 + ROLQ $0x2b, R12 + MOVQ R11, SI + MOVQ $0x0000000080000001, AX + ORQ R12, SI + XORQ R10, AX + XORQ AX, SI + MOVQ SI, (SP) + XORQ R9, R14 + ROLQ $0x0e, R14 + MOVQ R10, R15 + ANDQ R11, R15 + XORQ R14, R15 + MOVQ R15, 32(SP) + XORQ R8, R13 + ROLQ $0x15, R13 + MOVQ R13, AX + ANDQ R14, AX + XORQ R12, AX + MOVQ AX, 16(SP) + NOTQ R12 + ORQ R10, R14 + ORQ R13, R12 + XORQ R13, R14 + XORQ R11, R12 + MOVQ R14, 24(SP) + MOVQ R12, 8(SP) + MOVQ R12, BP + + // Result g + MOVQ 72(DI), R11 + XORQ R9, R11 + MOVQ 80(DI), R12 + ROLQ $0x14, R11 + XORQ BX, R12 + ROLQ $0x03, R12 + MOVQ 24(DI), R10 + MOVQ R11, AX + ORQ R12, AX + XORQ R8, R10 + MOVQ 128(DI), R13 + MOVQ 176(DI), R14 + ROLQ $0x1c, R10 + XORQ R10, AX + MOVQ AX, 40(SP) + XORQ AX, SI + XORQ CX, R13 + ROLQ $0x2d, R13 + MOVQ R12, AX + ANDQ R13, AX + XORQ R11, AX + MOVQ AX, 48(SP) + XORQ AX, BP + XORQ DX, R14 + ROLQ $0x3d, R14 + MOVQ R14, AX + ORQ R10, AX + XORQ R13, AX + MOVQ AX, 64(SP) + ANDQ R11, R10 + XORQ R14, R10 + MOVQ R10, 72(SP) + NOTQ R14 + XORQ R10, R15 + ORQ R14, R13 + XORQ R12, R13 + MOVQ R13, 56(SP) + + // Result k + MOVQ 8(DI), R10 + MOVQ 56(DI), R11 + MOVQ 104(DI), R12 + MOVQ 152(DI), R13 + MOVQ 160(DI), R14 + XORQ DX, R11 + ROLQ $0x06, R11 + XORQ R8, R12 + ROLQ $0x19, R12 + MOVQ R11, AX + ORQ R12, AX + XORQ CX, R10 + ROLQ $0x01, R10 + XORQ R10, AX + MOVQ AX, 80(SP) + XORQ AX, SI + XORQ R9, R13 + ROLQ $0x08, R13 + MOVQ R12, AX + ANDQ R13, AX + XORQ R11, AX + MOVQ AX, 88(SP) + XORQ AX, BP + XORQ BX, R14 + ROLQ $0x12, R14 + NOTQ R13 + MOVQ R13, AX + ANDQ R14, AX + XORQ R12, AX + MOVQ AX, 96(SP) + MOVQ R14, AX + ORQ R10, AX + XORQ R13, AX + MOVQ AX, 104(SP) + ANDQ R11, R10 + XORQ R14, R10 + MOVQ R10, 112(SP) + XORQ R10, R15 + + // Result m + MOVQ 40(DI), R11 + XORQ BX, R11 + MOVQ 88(DI), R12 + ROLQ $0x24, R11 + XORQ CX, R12 + MOVQ 32(DI), R10 + ROLQ $0x0a, R12 + MOVQ R11, AX + MOVQ 136(DI), R13 + ANDQ R12, AX + XORQ R9, R10 + MOVQ 184(DI), R14 + ROLQ $0x1b, R10 + XORQ R10, AX + MOVQ AX, 120(SP) + XORQ AX, SI + XORQ DX, R13 + ROLQ $0x0f, R13 + MOVQ R12, AX + ORQ R13, AX + XORQ R11, AX + MOVQ AX, 128(SP) + XORQ AX, BP + XORQ R8, R14 + ROLQ $0x38, R14 + NOTQ R13 + MOVQ R13, AX + ORQ R14, AX + XORQ R12, AX + MOVQ AX, 136(SP) + ORQ R10, R11 + XORQ R14, R11 + MOVQ R11, 152(SP) + ANDQ R10, R14 + XORQ R13, R14 + MOVQ R14, 144(SP) + XORQ R11, R15 + + // Result s + MOVQ 16(DI), R10 + MOVQ 64(DI), R11 + MOVQ 112(DI), R12 + XORQ DX, R10 + MOVQ 120(DI), R13 + ROLQ $0x3e, R10 + XORQ R8, R11 + MOVQ 168(DI), R14 + ROLQ $0x37, R11 + XORQ R9, R12 + MOVQ R10, R9 + XORQ CX, R14 + ROLQ $0x02, R14 + ANDQ R11, R9 + XORQ R14, R9 + MOVQ R9, 192(SP) + ROLQ $0x27, R12 + XORQ R9, R15 + NOTQ R11 + XORQ BX, R13 + MOVQ R11, BX + ANDQ R12, BX + XORQ R10, BX + MOVQ BX, 160(SP) + XORQ BX, SI + ROLQ $0x29, R13 + MOVQ R12, CX + ORQ R13, CX + XORQ R11, CX + MOVQ CX, 168(SP) + XORQ CX, BP + MOVQ R13, DX + MOVQ R14, R8 + ANDQ R14, DX + ORQ R10, R8 + XORQ R12, DX + XORQ R13, R8 + MOVQ DX, 176(SP) + MOVQ R8, 184(SP) + + // Prepare round + MOVQ BP, BX + ROLQ $0x01, BX + MOVQ 16(SP), R12 + XORQ 56(SP), DX + XORQ R15, BX + XORQ 96(SP), R12 + XORQ 136(SP), DX + XORQ DX, R12 + MOVQ R12, CX + ROLQ $0x01, CX + MOVQ 24(SP), R13 + XORQ 64(SP), R8 + XORQ SI, CX + XORQ 104(SP), R13 + XORQ 144(SP), R8 + XORQ R8, R13 + MOVQ R13, DX + ROLQ $0x01, DX + MOVQ R15, R8 + XORQ BP, DX + ROLQ $0x01, R8 + MOVQ SI, R9 + XORQ R12, R8 + ROLQ $0x01, R9 + + // Result b + MOVQ (SP), R10 + MOVQ 48(SP), R11 + XORQ R13, R9 + MOVQ 96(SP), R12 + MOVQ 144(SP), R13 + MOVQ 192(SP), R14 + XORQ CX, R11 + ROLQ $0x2c, R11 + XORQ DX, R12 + XORQ BX, R10 + ROLQ $0x2b, R12 + MOVQ R11, SI + MOVQ $0x8000000080008008, AX + ORQ R12, SI + XORQ R10, AX + XORQ AX, SI + MOVQ SI, (DI) + XORQ R9, R14 + ROLQ $0x0e, R14 + MOVQ R10, R15 + ANDQ R11, R15 + XORQ R14, R15 + MOVQ R15, 32(DI) + XORQ R8, R13 + ROLQ $0x15, R13 + MOVQ R13, AX + ANDQ R14, AX + XORQ R12, AX + MOVQ AX, 16(DI) + NOTQ R12 + ORQ R10, R14 + ORQ R13, R12 + XORQ R13, R14 + XORQ R11, R12 + MOVQ R14, 24(DI) + MOVQ R12, 8(DI) + NOP + + // Result g + MOVQ 72(SP), R11 + XORQ R9, R11 + MOVQ 80(SP), R12 + ROLQ $0x14, R11 + XORQ BX, R12 + ROLQ $0x03, R12 + MOVQ 24(SP), R10 + MOVQ R11, AX + ORQ R12, AX + XORQ R8, R10 + MOVQ 128(SP), R13 + MOVQ 176(SP), R14 + ROLQ $0x1c, R10 + XORQ R10, AX + MOVQ AX, 40(DI) + NOP + XORQ CX, R13 + ROLQ $0x2d, R13 + MOVQ R12, AX + ANDQ R13, AX + XORQ R11, AX + MOVQ AX, 48(DI) + NOP + XORQ DX, R14 + ROLQ $0x3d, R14 + MOVQ R14, AX + ORQ R10, AX + XORQ R13, AX + MOVQ AX, 64(DI) + ANDQ R11, R10 + XORQ R14, R10 + MOVQ R10, 72(DI) + NOTQ R14 + NOP + ORQ R14, R13 + XORQ R12, R13 + MOVQ R13, 56(DI) + + // Result k + MOVQ 8(SP), R10 + MOVQ 56(SP), R11 + MOVQ 104(SP), R12 + MOVQ 152(SP), R13 + MOVQ 160(SP), R14 + XORQ DX, R11 + ROLQ $0x06, R11 + XORQ R8, R12 + ROLQ $0x19, R12 + MOVQ R11, AX + ORQ R12, AX + XORQ CX, R10 + ROLQ $0x01, R10 + XORQ R10, AX + MOVQ AX, 80(DI) + NOP + XORQ R9, R13 + ROLQ $0x08, R13 + MOVQ R12, AX + ANDQ R13, AX + XORQ R11, AX + MOVQ AX, 88(DI) + NOP + XORQ BX, R14 + ROLQ $0x12, R14 + NOTQ R13 + MOVQ R13, AX + ANDQ R14, AX + XORQ R12, AX + MOVQ AX, 96(DI) + MOVQ R14, AX + ORQ R10, AX + XORQ R13, AX + MOVQ AX, 104(DI) + ANDQ R11, R10 + XORQ R14, R10 + MOVQ R10, 112(DI) + NOP + + // Result m + MOVQ 40(SP), R11 + XORQ BX, R11 + MOVQ 88(SP), R12 + ROLQ $0x24, R11 + XORQ CX, R12 + MOVQ 32(SP), R10 + ROLQ $0x0a, R12 + MOVQ R11, AX + MOVQ 136(SP), R13 + ANDQ R12, AX + XORQ R9, R10 + MOVQ 184(SP), R14 + ROLQ $0x1b, R10 + XORQ R10, AX + MOVQ AX, 120(DI) + NOP + XORQ DX, R13 + ROLQ $0x0f, R13 + MOVQ R12, AX + ORQ R13, AX + XORQ R11, AX + MOVQ AX, 128(DI) + NOP + XORQ R8, R14 + ROLQ $0x38, R14 + NOTQ R13 + MOVQ R13, AX + ORQ R14, AX + XORQ R12, AX + MOVQ AX, 136(DI) + ORQ R10, R11 + XORQ R14, R11 + MOVQ R11, 152(DI) + ANDQ R10, R14 + XORQ R13, R14 + MOVQ R14, 144(DI) + NOP + + // Result s + MOVQ 16(SP), R10 + MOVQ 64(SP), R11 + MOVQ 112(SP), R12 + XORQ DX, R10 + MOVQ 120(SP), R13 + ROLQ $0x3e, R10 + XORQ R8, R11 + MOVQ 168(SP), R14 + ROLQ $0x37, R11 + XORQ R9, R12 + MOVQ R10, R9 + XORQ CX, R14 + ROLQ $0x02, R14 + ANDQ R11, R9 + XORQ R14, R9 + MOVQ R9, 192(DI) + ROLQ $0x27, R12 + NOP + NOTQ R11 + XORQ BX, R13 + MOVQ R11, BX + ANDQ R12, BX + XORQ R10, BX + MOVQ BX, 160(DI) + NOP + ROLQ $0x29, R13 + MOVQ R12, CX + ORQ R13, CX + XORQ R11, CX + MOVQ CX, 168(DI) + NOP + MOVQ R13, DX + MOVQ R14, R8 + ANDQ R14, DX + ORQ R10, R8 + XORQ R12, DX + XORQ R13, R8 + MOVQ DX, 176(DI) + MOVQ R8, 184(DI) + + // Revert the internal state to the user state + NOTQ 8(DI) + NOTQ 16(DI) + NOTQ 64(DI) + NOTQ 96(DI) + NOTQ 136(DI) + NOTQ 160(DI) RET diff --git a/vendor/golang.org/x/crypto/sha3/register.go b/vendor/golang.org/x/crypto/sha3/register.go deleted file mode 100644 index addfd5049bb..00000000000 --- a/vendor/golang.org/x/crypto/sha3/register.go +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build go1.4 - -package sha3 - -import ( - "crypto" -) - -func init() { - crypto.RegisterHash(crypto.SHA3_224, New224) - crypto.RegisterHash(crypto.SHA3_256, New256) - crypto.RegisterHash(crypto.SHA3_384, New384) - crypto.RegisterHash(crypto.SHA3_512, New512) -} diff --git a/vendor/golang.org/x/mod/LICENSE b/vendor/golang.org/x/mod/LICENSE index 6a66aea5eaf..2a7cf70da6e 100644 --- a/vendor/golang.org/x/mod/LICENSE +++ b/vendor/golang.org/x/mod/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2009 The Go Authors. All rights reserved. +Copyright 2009 The Go Authors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are @@ -10,7 +10,7 @@ notice, this list of conditions and the following disclaimer. copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - * Neither the name of Google Inc. nor the names of its + * Neither the name of Google LLC nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. diff --git a/vendor/golang.org/x/net/LICENSE b/vendor/golang.org/x/net/LICENSE index 6a66aea5eaf..2a7cf70da6e 100644 --- a/vendor/golang.org/x/net/LICENSE +++ b/vendor/golang.org/x/net/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2009 The Go Authors. All rights reserved. +Copyright 2009 The Go Authors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are @@ -10,7 +10,7 @@ notice, this list of conditions and the following disclaimer. copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - * Neither the name of Google Inc. nor the names of its + * Neither the name of Google LLC nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. diff --git a/vendor/golang.org/x/net/http2/http2.go b/vendor/golang.org/x/net/http2/http2.go index 6f2df281872..003e649f30c 100644 --- a/vendor/golang.org/x/net/http2/http2.go +++ b/vendor/golang.org/x/net/http2/http2.go @@ -17,6 +17,7 @@ package http2 // import "golang.org/x/net/http2" import ( "bufio" + "context" "crypto/tls" "fmt" "io" @@ -26,6 +27,7 @@ import ( "strconv" "strings" "sync" + "time" "golang.org/x/net/http/httpguts" ) @@ -210,12 +212,6 @@ type stringWriter interface { WriteString(s string) (n int, err error) } -// A gate lets two goroutines coordinate their activities. -type gate chan struct{} - -func (g gate) Done() { g <- struct{}{} } -func (g gate) Wait() { <-g } - // A closeWaiter is like a sync.WaitGroup but only goes 1 to 0 (open to closed). type closeWaiter chan struct{} @@ -383,3 +379,14 @@ func validPseudoPath(v string) bool { // makes that struct also non-comparable, and generally doesn't add // any size (as long as it's first). type incomparable [0]func() + +// synctestGroupInterface is the methods of synctestGroup used by Server and Transport. +// It's defined as an interface here to let us keep synctestGroup entirely test-only +// and not a part of non-test builds. +type synctestGroupInterface interface { + Join() + Now() time.Time + NewTimer(d time.Duration) timer + AfterFunc(d time.Duration, f func()) timer + ContextWithTimeout(ctx context.Context, d time.Duration) (context.Context, context.CancelFunc) +} diff --git a/vendor/golang.org/x/net/http2/server.go b/vendor/golang.org/x/net/http2/server.go index c5d08108137..6c349f3ec64 100644 --- a/vendor/golang.org/x/net/http2/server.go +++ b/vendor/golang.org/x/net/http2/server.go @@ -154,6 +154,39 @@ type Server struct { // so that we don't embed a Mutex in this struct, which will make the // struct non-copyable, which might break some callers. state *serverInternalState + + // Synchronization group used for testing. + // Outside of tests, this is nil. + group synctestGroupInterface +} + +func (s *Server) markNewGoroutine() { + if s.group != nil { + s.group.Join() + } +} + +func (s *Server) now() time.Time { + if s.group != nil { + return s.group.Now() + } + return time.Now() +} + +// newTimer creates a new time.Timer, or a synthetic timer in tests. +func (s *Server) newTimer(d time.Duration) timer { + if s.group != nil { + return s.group.NewTimer(d) + } + return timeTimer{time.NewTimer(d)} +} + +// afterFunc creates a new time.AfterFunc timer, or a synthetic timer in tests. +func (s *Server) afterFunc(d time.Duration, f func()) timer { + if s.group != nil { + return s.group.AfterFunc(d, f) + } + return timeTimer{time.AfterFunc(d, f)} } func (s *Server) initialConnRecvWindowSize() int32 { @@ -400,6 +433,10 @@ func (o *ServeConnOpts) handler() http.Handler { // // The opts parameter is optional. If nil, default values are used. func (s *Server) ServeConn(c net.Conn, opts *ServeConnOpts) { + s.serveConn(c, opts, nil) +} + +func (s *Server) serveConn(c net.Conn, opts *ServeConnOpts, newf func(*serverConn)) { baseCtx, cancel := serverConnBaseContext(c, opts) defer cancel() @@ -426,6 +463,9 @@ func (s *Server) ServeConn(c net.Conn, opts *ServeConnOpts) { pushEnabled: true, sawClientPreface: opts.SawClientPreface, } + if newf != nil { + newf(sc) + } s.state.registerConn(sc) defer s.state.unregisterConn(sc) @@ -599,8 +639,8 @@ type serverConn struct { inFrameScheduleLoop bool // whether we're in the scheduleFrameWrite loop needToSendGoAway bool // we need to schedule a GOAWAY frame write goAwayCode ErrCode - shutdownTimer *time.Timer // nil until used - idleTimer *time.Timer // nil if unused + shutdownTimer timer // nil until used + idleTimer timer // nil if unused // Owned by the writeFrameAsync goroutine: headerWriteBuf bytes.Buffer @@ -649,12 +689,12 @@ type stream struct { flow outflow // limits writing from Handler to client inflow inflow // what the client is allowed to POST/etc to us state streamState - resetQueued bool // RST_STREAM queued for write; set by sc.resetStream - gotTrailerHeader bool // HEADER frame for trailers was seen - wroteHeaders bool // whether we wrote headers (not status 100) - readDeadline *time.Timer // nil if unused - writeDeadline *time.Timer // nil if unused - closeErr error // set before cw is closed + resetQueued bool // RST_STREAM queued for write; set by sc.resetStream + gotTrailerHeader bool // HEADER frame for trailers was seen + wroteHeaders bool // whether we wrote headers (not status 100) + readDeadline timer // nil if unused + writeDeadline timer // nil if unused + closeErr error // set before cw is closed trailer http.Header // accumulated trailers reqTrailer http.Header // handler's Request.Trailer @@ -811,8 +851,9 @@ type readFrameResult struct { // consumer is done with the frame. // It's run on its own goroutine. func (sc *serverConn) readFrames() { - gate := make(gate) - gateDone := gate.Done + sc.srv.markNewGoroutine() + gate := make(chan struct{}) + gateDone := func() { gate <- struct{}{} } for { f, err := sc.framer.ReadFrame() select { @@ -843,6 +884,7 @@ type frameWriteResult struct { // At most one goroutine can be running writeFrameAsync at a time per // serverConn. func (sc *serverConn) writeFrameAsync(wr FrameWriteRequest, wd *writeData) { + sc.srv.markNewGoroutine() var err error if wd == nil { err = wr.write.writeFrame(sc) @@ -922,13 +964,13 @@ func (sc *serverConn) serve() { sc.setConnState(http.StateIdle) if sc.srv.IdleTimeout > 0 { - sc.idleTimer = time.AfterFunc(sc.srv.IdleTimeout, sc.onIdleTimer) + sc.idleTimer = sc.srv.afterFunc(sc.srv.IdleTimeout, sc.onIdleTimer) defer sc.idleTimer.Stop() } go sc.readFrames() // closed by defer sc.conn.Close above - settingsTimer := time.AfterFunc(firstSettingsTimeout, sc.onSettingsTimer) + settingsTimer := sc.srv.afterFunc(firstSettingsTimeout, sc.onSettingsTimer) defer settingsTimer.Stop() loopNum := 0 @@ -1057,10 +1099,10 @@ func (sc *serverConn) readPreface() error { errc <- nil } }() - timer := time.NewTimer(prefaceTimeout) // TODO: configurable on *Server? + timer := sc.srv.newTimer(prefaceTimeout) // TODO: configurable on *Server? defer timer.Stop() select { - case <-timer.C: + case <-timer.C(): return errPrefaceTimeout case err := <-errc: if err == nil { @@ -1425,7 +1467,7 @@ func (sc *serverConn) goAway(code ErrCode) { func (sc *serverConn) shutDownIn(d time.Duration) { sc.serveG.check() - sc.shutdownTimer = time.AfterFunc(d, sc.onShutdownTimer) + sc.shutdownTimer = sc.srv.afterFunc(d, sc.onShutdownTimer) } func (sc *serverConn) resetStream(se StreamError) { @@ -1639,7 +1681,7 @@ func (sc *serverConn) closeStream(st *stream, err error) { delete(sc.streams, st.id) if len(sc.streams) == 0 { sc.setConnState(http.StateIdle) - if sc.srv.IdleTimeout > 0 { + if sc.srv.IdleTimeout > 0 && sc.idleTimer != nil { sc.idleTimer.Reset(sc.srv.IdleTimeout) } if h1ServerKeepAlivesDisabled(sc.hs) { @@ -1661,6 +1703,7 @@ func (sc *serverConn) closeStream(st *stream, err error) { } } st.closeErr = err + st.cancelCtx() st.cw.Close() // signals Handler's CloseNotifier, unblocks writes, etc sc.writeSched.CloseStream(st.id) } @@ -2021,7 +2064,7 @@ func (sc *serverConn) processHeaders(f *MetaHeadersFrame) error { // (in Go 1.8), though. That's a more sane option anyway. if sc.hs.ReadTimeout > 0 { sc.conn.SetReadDeadline(time.Time{}) - st.readDeadline = time.AfterFunc(sc.hs.ReadTimeout, st.onReadTimeout) + st.readDeadline = sc.srv.afterFunc(sc.hs.ReadTimeout, st.onReadTimeout) } return sc.scheduleHandler(id, rw, req, handler) @@ -2119,7 +2162,7 @@ func (sc *serverConn) newStream(id, pusherID uint32, state streamState) *stream st.flow.add(sc.initialStreamSendWindowSize) st.inflow.init(sc.srv.initialStreamRecvWindowSize()) if sc.hs.WriteTimeout > 0 { - st.writeDeadline = time.AfterFunc(sc.hs.WriteTimeout, st.onWriteTimeout) + st.writeDeadline = sc.srv.afterFunc(sc.hs.WriteTimeout, st.onWriteTimeout) } sc.streams[id] = st @@ -2343,6 +2386,7 @@ func (sc *serverConn) handlerDone() { // Run on its own goroutine. func (sc *serverConn) runHandler(rw *responseWriter, req *http.Request, handler func(http.ResponseWriter, *http.Request)) { + sc.srv.markNewGoroutine() defer sc.sendServeMsg(handlerDoneMsg) didPanic := true defer func() { @@ -2639,7 +2683,7 @@ func (rws *responseWriterState) writeChunk(p []byte) (n int, err error) { var date string if _, ok := rws.snapHeader["Date"]; !ok { // TODO(bradfitz): be faster here, like net/http? measure. - date = time.Now().UTC().Format(http.TimeFormat) + date = rws.conn.srv.now().UTC().Format(http.TimeFormat) } for _, v := range rws.snapHeader["Trailer"] { @@ -2761,7 +2805,7 @@ func (rws *responseWriterState) promoteUndeclaredTrailers() { func (w *responseWriter) SetReadDeadline(deadline time.Time) error { st := w.rws.stream - if !deadline.IsZero() && deadline.Before(time.Now()) { + if !deadline.IsZero() && deadline.Before(w.rws.conn.srv.now()) { // If we're setting a deadline in the past, reset the stream immediately // so writes after SetWriteDeadline returns will fail. st.onReadTimeout() @@ -2777,9 +2821,9 @@ func (w *responseWriter) SetReadDeadline(deadline time.Time) error { if deadline.IsZero() { st.readDeadline = nil } else if st.readDeadline == nil { - st.readDeadline = time.AfterFunc(deadline.Sub(time.Now()), st.onReadTimeout) + st.readDeadline = sc.srv.afterFunc(deadline.Sub(sc.srv.now()), st.onReadTimeout) } else { - st.readDeadline.Reset(deadline.Sub(time.Now())) + st.readDeadline.Reset(deadline.Sub(sc.srv.now())) } }) return nil @@ -2787,7 +2831,7 @@ func (w *responseWriter) SetReadDeadline(deadline time.Time) error { func (w *responseWriter) SetWriteDeadline(deadline time.Time) error { st := w.rws.stream - if !deadline.IsZero() && deadline.Before(time.Now()) { + if !deadline.IsZero() && deadline.Before(w.rws.conn.srv.now()) { // If we're setting a deadline in the past, reset the stream immediately // so writes after SetWriteDeadline returns will fail. st.onWriteTimeout() @@ -2803,9 +2847,9 @@ func (w *responseWriter) SetWriteDeadline(deadline time.Time) error { if deadline.IsZero() { st.writeDeadline = nil } else if st.writeDeadline == nil { - st.writeDeadline = time.AfterFunc(deadline.Sub(time.Now()), st.onWriteTimeout) + st.writeDeadline = sc.srv.afterFunc(deadline.Sub(sc.srv.now()), st.onWriteTimeout) } else { - st.writeDeadline.Reset(deadline.Sub(time.Now())) + st.writeDeadline.Reset(deadline.Sub(sc.srv.now())) } }) return nil diff --git a/vendor/golang.org/x/net/http2/testsync.go b/vendor/golang.org/x/net/http2/testsync.go deleted file mode 100644 index 61075bd16d3..00000000000 --- a/vendor/golang.org/x/net/http2/testsync.go +++ /dev/null @@ -1,331 +0,0 @@ -// Copyright 2024 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. -package http2 - -import ( - "context" - "sync" - "time" -) - -// testSyncHooks coordinates goroutines in tests. -// -// For example, a call to ClientConn.RoundTrip involves several goroutines, including: -// - the goroutine running RoundTrip; -// - the clientStream.doRequest goroutine, which writes the request; and -// - the clientStream.readLoop goroutine, which reads the response. -// -// Using testSyncHooks, a test can start a RoundTrip and identify when all these goroutines -// are blocked waiting for some condition such as reading the Request.Body or waiting for -// flow control to become available. -// -// The testSyncHooks also manage timers and synthetic time in tests. -// This permits us to, for example, start a request and cause it to time out waiting for -// response headers without resorting to time.Sleep calls. -type testSyncHooks struct { - // active/inactive act as a mutex and condition variable. - // - // - neither chan contains a value: testSyncHooks is locked. - // - active contains a value: unlocked, and at least one goroutine is not blocked - // - inactive contains a value: unlocked, and all goroutines are blocked - active chan struct{} - inactive chan struct{} - - // goroutine counts - total int // total goroutines - condwait map[*sync.Cond]int // blocked in sync.Cond.Wait - blocked []*testBlockedGoroutine // otherwise blocked - - // fake time - now time.Time - timers []*fakeTimer - - // Transport testing: Report various events. - newclientconn func(*ClientConn) - newstream func(*clientStream) -} - -// testBlockedGoroutine is a blocked goroutine. -type testBlockedGoroutine struct { - f func() bool // blocked until f returns true - ch chan struct{} // closed when unblocked -} - -func newTestSyncHooks() *testSyncHooks { - h := &testSyncHooks{ - active: make(chan struct{}, 1), - inactive: make(chan struct{}, 1), - condwait: map[*sync.Cond]int{}, - } - h.inactive <- struct{}{} - h.now = time.Date(2000, 1, 1, 0, 0, 0, 0, time.UTC) - return h -} - -// lock acquires the testSyncHooks mutex. -func (h *testSyncHooks) lock() { - select { - case <-h.active: - case <-h.inactive: - } -} - -// waitInactive waits for all goroutines to become inactive. -func (h *testSyncHooks) waitInactive() { - for { - <-h.inactive - if !h.unlock() { - break - } - } -} - -// unlock releases the testSyncHooks mutex. -// It reports whether any goroutines are active. -func (h *testSyncHooks) unlock() (active bool) { - // Look for a blocked goroutine which can be unblocked. - blocked := h.blocked[:0] - unblocked := false - for _, b := range h.blocked { - if !unblocked && b.f() { - unblocked = true - close(b.ch) - } else { - blocked = append(blocked, b) - } - } - h.blocked = blocked - - // Count goroutines blocked on condition variables. - condwait := 0 - for _, count := range h.condwait { - condwait += count - } - - if h.total > condwait+len(blocked) { - h.active <- struct{}{} - return true - } else { - h.inactive <- struct{}{} - return false - } -} - -// goRun starts a new goroutine. -func (h *testSyncHooks) goRun(f func()) { - h.lock() - h.total++ - h.unlock() - go func() { - defer func() { - h.lock() - h.total-- - h.unlock() - }() - f() - }() -} - -// blockUntil indicates that a goroutine is blocked waiting for some condition to become true. -// It waits until f returns true before proceeding. -// -// Example usage: -// -// h.blockUntil(func() bool { -// // Is the context done yet? -// select { -// case <-ctx.Done(): -// default: -// return false -// } -// return true -// }) -// // Wait for the context to become done. -// <-ctx.Done() -// -// The function f passed to blockUntil must be non-blocking and idempotent. -func (h *testSyncHooks) blockUntil(f func() bool) { - if f() { - return - } - ch := make(chan struct{}) - h.lock() - h.blocked = append(h.blocked, &testBlockedGoroutine{ - f: f, - ch: ch, - }) - h.unlock() - <-ch -} - -// broadcast is sync.Cond.Broadcast. -func (h *testSyncHooks) condBroadcast(cond *sync.Cond) { - h.lock() - delete(h.condwait, cond) - h.unlock() - cond.Broadcast() -} - -// broadcast is sync.Cond.Wait. -func (h *testSyncHooks) condWait(cond *sync.Cond) { - h.lock() - h.condwait[cond]++ - h.unlock() -} - -// newTimer creates a new fake timer. -func (h *testSyncHooks) newTimer(d time.Duration) timer { - h.lock() - defer h.unlock() - t := &fakeTimer{ - hooks: h, - when: h.now.Add(d), - c: make(chan time.Time), - } - h.timers = append(h.timers, t) - return t -} - -// afterFunc creates a new fake AfterFunc timer. -func (h *testSyncHooks) afterFunc(d time.Duration, f func()) timer { - h.lock() - defer h.unlock() - t := &fakeTimer{ - hooks: h, - when: h.now.Add(d), - f: f, - } - h.timers = append(h.timers, t) - return t -} - -func (h *testSyncHooks) contextWithTimeout(ctx context.Context, d time.Duration) (context.Context, context.CancelFunc) { - ctx, cancel := context.WithCancel(ctx) - t := h.afterFunc(d, cancel) - return ctx, func() { - t.Stop() - cancel() - } -} - -func (h *testSyncHooks) timeUntilEvent() time.Duration { - h.lock() - defer h.unlock() - var next time.Time - for _, t := range h.timers { - if next.IsZero() || t.when.Before(next) { - next = t.when - } - } - if d := next.Sub(h.now); d > 0 { - return d - } - return 0 -} - -// advance advances time and causes synthetic timers to fire. -func (h *testSyncHooks) advance(d time.Duration) { - h.lock() - defer h.unlock() - h.now = h.now.Add(d) - timers := h.timers[:0] - for _, t := range h.timers { - t := t // remove after go.mod depends on go1.22 - t.mu.Lock() - switch { - case t.when.After(h.now): - timers = append(timers, t) - case t.when.IsZero(): - // stopped timer - default: - t.when = time.Time{} - if t.c != nil { - close(t.c) - } - if t.f != nil { - h.total++ - go func() { - defer func() { - h.lock() - h.total-- - h.unlock() - }() - t.f() - }() - } - } - t.mu.Unlock() - } - h.timers = timers -} - -// A timer wraps a time.Timer, or a synthetic equivalent in tests. -// Unlike time.Timer, timer is single-use: The timer channel is closed when the timer expires. -type timer interface { - C() <-chan time.Time - Stop() bool - Reset(d time.Duration) bool -} - -// timeTimer implements timer using real time. -type timeTimer struct { - t *time.Timer - c chan time.Time -} - -// newTimeTimer creates a new timer using real time. -func newTimeTimer(d time.Duration) timer { - ch := make(chan time.Time) - t := time.AfterFunc(d, func() { - close(ch) - }) - return &timeTimer{t, ch} -} - -// newTimeAfterFunc creates an AfterFunc timer using real time. -func newTimeAfterFunc(d time.Duration, f func()) timer { - return &timeTimer{ - t: time.AfterFunc(d, f), - } -} - -func (t timeTimer) C() <-chan time.Time { return t.c } -func (t timeTimer) Stop() bool { return t.t.Stop() } -func (t timeTimer) Reset(d time.Duration) bool { return t.t.Reset(d) } - -// fakeTimer implements timer using fake time. -type fakeTimer struct { - hooks *testSyncHooks - - mu sync.Mutex - when time.Time // when the timer will fire - c chan time.Time // closed when the timer fires; mutually exclusive with f - f func() // called when the timer fires; mutually exclusive with c -} - -func (t *fakeTimer) C() <-chan time.Time { return t.c } - -func (t *fakeTimer) Stop() bool { - t.mu.Lock() - defer t.mu.Unlock() - stopped := t.when.IsZero() - t.when = time.Time{} - return stopped -} - -func (t *fakeTimer) Reset(d time.Duration) bool { - if t.c != nil || t.f == nil { - panic("fakeTimer only supports Reset on AfterFunc timers") - } - t.mu.Lock() - defer t.mu.Unlock() - t.hooks.lock() - defer t.hooks.unlock() - active := !t.when.IsZero() - t.when = t.hooks.now.Add(d) - if !active { - t.hooks.timers = append(t.hooks.timers, t) - } - return active -} diff --git a/vendor/golang.org/x/net/http2/timer.go b/vendor/golang.org/x/net/http2/timer.go new file mode 100644 index 00000000000..0b1c17b8129 --- /dev/null +++ b/vendor/golang.org/x/net/http2/timer.go @@ -0,0 +1,20 @@ +// Copyright 2024 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. +package http2 + +import "time" + +// A timer is a time.Timer, as an interface which can be replaced in tests. +type timer = interface { + C() <-chan time.Time + Reset(d time.Duration) bool + Stop() bool +} + +// timeTimer adapts a time.Timer to the timer interface. +type timeTimer struct { + *time.Timer +} + +func (t timeTimer) C() <-chan time.Time { return t.Timer.C } diff --git a/vendor/golang.org/x/net/http2/transport.go b/vendor/golang.org/x/net/http2/transport.go index 2fa49490c9d..61f511f97aa 100644 --- a/vendor/golang.org/x/net/http2/transport.go +++ b/vendor/golang.org/x/net/http2/transport.go @@ -185,7 +185,45 @@ type Transport struct { connPoolOnce sync.Once connPoolOrDef ClientConnPool // non-nil version of ConnPool - syncHooks *testSyncHooks + *transportTestHooks +} + +// Hook points used for testing. +// Outside of tests, t.transportTestHooks is nil and these all have minimal implementations. +// Inside tests, see the testSyncHooks function docs. + +type transportTestHooks struct { + newclientconn func(*ClientConn) + group synctestGroupInterface +} + +func (t *Transport) markNewGoroutine() { + if t != nil && t.transportTestHooks != nil { + t.transportTestHooks.group.Join() + } +} + +// newTimer creates a new time.Timer, or a synthetic timer in tests. +func (t *Transport) newTimer(d time.Duration) timer { + if t.transportTestHooks != nil { + return t.transportTestHooks.group.NewTimer(d) + } + return timeTimer{time.NewTimer(d)} +} + +// afterFunc creates a new time.AfterFunc timer, or a synthetic timer in tests. +func (t *Transport) afterFunc(d time.Duration, f func()) timer { + if t.transportTestHooks != nil { + return t.transportTestHooks.group.AfterFunc(d, f) + } + return timeTimer{time.AfterFunc(d, f)} +} + +func (t *Transport) contextWithTimeout(ctx context.Context, d time.Duration) (context.Context, context.CancelFunc) { + if t.transportTestHooks != nil { + return t.transportTestHooks.group.ContextWithTimeout(ctx, d) + } + return context.WithTimeout(ctx, d) } func (t *Transport) maxHeaderListSize() uint32 { @@ -352,60 +390,6 @@ type ClientConn struct { werr error // first write error that has occurred hbuf bytes.Buffer // HPACK encoder writes into this henc *hpack.Encoder - - syncHooks *testSyncHooks // can be nil -} - -// Hook points used for testing. -// Outside of tests, cc.syncHooks is nil and these all have minimal implementations. -// Inside tests, see the testSyncHooks function docs. - -// goRun starts a new goroutine. -func (cc *ClientConn) goRun(f func()) { - if cc.syncHooks != nil { - cc.syncHooks.goRun(f) - return - } - go f() -} - -// condBroadcast is cc.cond.Broadcast. -func (cc *ClientConn) condBroadcast() { - if cc.syncHooks != nil { - cc.syncHooks.condBroadcast(cc.cond) - } - cc.cond.Broadcast() -} - -// condWait is cc.cond.Wait. -func (cc *ClientConn) condWait() { - if cc.syncHooks != nil { - cc.syncHooks.condWait(cc.cond) - } - cc.cond.Wait() -} - -// newTimer creates a new time.Timer, or a synthetic timer in tests. -func (cc *ClientConn) newTimer(d time.Duration) timer { - if cc.syncHooks != nil { - return cc.syncHooks.newTimer(d) - } - return newTimeTimer(d) -} - -// afterFunc creates a new time.AfterFunc timer, or a synthetic timer in tests. -func (cc *ClientConn) afterFunc(d time.Duration, f func()) timer { - if cc.syncHooks != nil { - return cc.syncHooks.afterFunc(d, f) - } - return newTimeAfterFunc(d, f) -} - -func (cc *ClientConn) contextWithTimeout(ctx context.Context, d time.Duration) (context.Context, context.CancelFunc) { - if cc.syncHooks != nil { - return cc.syncHooks.contextWithTimeout(ctx, d) - } - return context.WithTimeout(ctx, d) } // clientStream is the state for a single HTTP/2 stream. One of these @@ -487,7 +471,7 @@ func (cs *clientStream) abortStreamLocked(err error) { // TODO(dneil): Clean up tests where cs.cc.cond is nil. if cs.cc.cond != nil { // Wake up writeRequestBody if it is waiting on flow control. - cs.cc.condBroadcast() + cs.cc.cond.Broadcast() } } @@ -497,7 +481,7 @@ func (cs *clientStream) abortRequestBodyWrite() { defer cc.mu.Unlock() if cs.reqBody != nil && cs.reqBodyClosed == nil { cs.closeReqBodyLocked() - cc.condBroadcast() + cc.cond.Broadcast() } } @@ -507,10 +491,11 @@ func (cs *clientStream) closeReqBodyLocked() { } cs.reqBodyClosed = make(chan struct{}) reqBodyClosed := cs.reqBodyClosed - cs.cc.goRun(func() { + go func() { + cs.cc.t.markNewGoroutine() cs.reqBody.Close() close(reqBodyClosed) - }) + }() } type stickyErrWriter struct { @@ -626,21 +611,7 @@ func (t *Transport) RoundTripOpt(req *http.Request, opt RoundTripOpt) (*http.Res backoff := float64(uint(1) << (uint(retry) - 1)) backoff += backoff * (0.1 * mathrand.Float64()) d := time.Second * time.Duration(backoff) - var tm timer - if t.syncHooks != nil { - tm = t.syncHooks.newTimer(d) - t.syncHooks.blockUntil(func() bool { - select { - case <-tm.C(): - case <-req.Context().Done(): - default: - return false - } - return true - }) - } else { - tm = newTimeTimer(d) - } + tm := t.newTimer(d) select { case <-tm.C(): t.vlogf("RoundTrip retrying after failure: %v", roundTripErr) @@ -725,8 +696,8 @@ func canRetryError(err error) bool { } func (t *Transport) dialClientConn(ctx context.Context, addr string, singleUse bool) (*ClientConn, error) { - if t.syncHooks != nil { - return t.newClientConn(nil, singleUse, t.syncHooks) + if t.transportTestHooks != nil { + return t.newClientConn(nil, singleUse) } host, _, err := net.SplitHostPort(addr) if err != nil { @@ -736,7 +707,7 @@ func (t *Transport) dialClientConn(ctx context.Context, addr string, singleUse b if err != nil { return nil, err } - return t.newClientConn(tconn, singleUse, nil) + return t.newClientConn(tconn, singleUse) } func (t *Transport) newTLSConfig(host string) *tls.Config { @@ -802,10 +773,10 @@ func (t *Transport) maxEncoderHeaderTableSize() uint32 { } func (t *Transport) NewClientConn(c net.Conn) (*ClientConn, error) { - return t.newClientConn(c, t.disableKeepAlives(), nil) + return t.newClientConn(c, t.disableKeepAlives()) } -func (t *Transport) newClientConn(c net.Conn, singleUse bool, hooks *testSyncHooks) (*ClientConn, error) { +func (t *Transport) newClientConn(c net.Conn, singleUse bool) (*ClientConn, error) { cc := &ClientConn{ t: t, tconn: c, @@ -820,16 +791,12 @@ func (t *Transport) newClientConn(c net.Conn, singleUse bool, hooks *testSyncHoo wantSettingsAck: true, pings: make(map[[8]byte]chan struct{}), reqHeaderMu: make(chan struct{}, 1), - syncHooks: hooks, } - if hooks != nil { - hooks.newclientconn(cc) + if t.transportTestHooks != nil { + t.markNewGoroutine() + t.transportTestHooks.newclientconn(cc) c = cc.tconn } - if d := t.idleConnTimeout(); d != 0 { - cc.idleTimeout = d - cc.idleTimer = cc.afterFunc(d, cc.onIdleTimeout) - } if VerboseLogs { t.vlogf("http2: Transport creating client conn %p to %v", cc, c.RemoteAddr()) } @@ -860,10 +827,6 @@ func (t *Transport) newClientConn(c net.Conn, singleUse bool, hooks *testSyncHoo cc.henc.SetMaxDynamicTableSizeLimit(t.maxEncoderHeaderTableSize()) cc.peerMaxHeaderTableSize = initialHeaderTableSize - if t.AllowHTTP { - cc.nextStreamID = 3 - } - if cs, ok := c.(connectionStater); ok { state := cs.ConnectionState() cc.tlsState = &state @@ -893,7 +856,13 @@ func (t *Transport) newClientConn(c net.Conn, singleUse bool, hooks *testSyncHoo return nil, cc.werr } - cc.goRun(cc.readLoop) + // Start the idle timer after the connection is fully initialized. + if d := t.idleConnTimeout(); d != 0 { + cc.idleTimeout = d + cc.idleTimer = t.afterFunc(d, cc.onIdleTimeout) + } + + go cc.readLoop() return cc, nil } @@ -901,7 +870,7 @@ func (cc *ClientConn) healthCheck() { pingTimeout := cc.t.pingTimeout() // We don't need to periodically ping in the health check, because the readLoop of ClientConn will // trigger the healthCheck again if there is no frame received. - ctx, cancel := cc.contextWithTimeout(context.Background(), pingTimeout) + ctx, cancel := cc.t.contextWithTimeout(context.Background(), pingTimeout) defer cancel() cc.vlogf("http2: Transport sending health check") err := cc.Ping(ctx) @@ -1144,7 +1113,8 @@ func (cc *ClientConn) Shutdown(ctx context.Context) error { // Wait for all in-flight streams to complete or connection to close done := make(chan struct{}) cancelled := false // guarded by cc.mu - cc.goRun(func() { + go func() { + cc.t.markNewGoroutine() cc.mu.Lock() defer cc.mu.Unlock() for { @@ -1156,9 +1126,9 @@ func (cc *ClientConn) Shutdown(ctx context.Context) error { if cancelled { break } - cc.condWait() + cc.cond.Wait() } - }) + }() shutdownEnterWaitStateHook() select { case <-done: @@ -1168,7 +1138,7 @@ func (cc *ClientConn) Shutdown(ctx context.Context) error { cc.mu.Lock() // Free the goroutine above cancelled = true - cc.condBroadcast() + cc.cond.Broadcast() cc.mu.Unlock() return ctx.Err() } @@ -1206,7 +1176,7 @@ func (cc *ClientConn) closeForError(err error) { for _, cs := range cc.streams { cs.abortStreamLocked(err) } - cc.condBroadcast() + cc.cond.Broadcast() cc.mu.Unlock() cc.closeConn() } @@ -1321,23 +1291,30 @@ func (cc *ClientConn) roundTrip(req *http.Request, streamf func(*clientStream)) respHeaderRecv: make(chan struct{}), donec: make(chan struct{}), } - cc.goRun(func() { - cs.doRequest(req) - }) + + // TODO(bradfitz): this is a copy of the logic in net/http. Unify somewhere? + if !cc.t.disableCompression() && + req.Header.Get("Accept-Encoding") == "" && + req.Header.Get("Range") == "" && + !cs.isHead { + // Request gzip only, not deflate. Deflate is ambiguous and + // not as universally supported anyway. + // See: https://zlib.net/zlib_faq.html#faq39 + // + // Note that we don't request this for HEAD requests, + // due to a bug in nginx: + // http://trac.nginx.org/nginx/ticket/358 + // https://golang.org/issue/5522 + // + // We don't request gzip if the request is for a range, since + // auto-decoding a portion of a gzipped document will just fail + // anyway. See https://golang.org/issue/8923 + cs.requestedGzip = true + } + + go cs.doRequest(req, streamf) waitDone := func() error { - if cc.syncHooks != nil { - cc.syncHooks.blockUntil(func() bool { - select { - case <-cs.donec: - case <-ctx.Done(): - case <-cs.reqCancel: - default: - return false - } - return true - }) - } select { case <-cs.donec: return nil @@ -1398,24 +1375,7 @@ func (cc *ClientConn) roundTrip(req *http.Request, streamf func(*clientStream)) return err } - if streamf != nil { - streamf(cs) - } - for { - if cc.syncHooks != nil { - cc.syncHooks.blockUntil(func() bool { - select { - case <-cs.respHeaderRecv: - case <-cs.abort: - case <-ctx.Done(): - case <-cs.reqCancel: - default: - return false - } - return true - }) - } select { case <-cs.respHeaderRecv: return handleResponseHeaders() @@ -1445,8 +1405,9 @@ func (cc *ClientConn) roundTrip(req *http.Request, streamf func(*clientStream)) // doRequest runs for the duration of the request lifetime. // // It sends the request and performs post-request cleanup (closing Request.Body, etc.). -func (cs *clientStream) doRequest(req *http.Request) { - err := cs.writeRequest(req) +func (cs *clientStream) doRequest(req *http.Request, streamf func(*clientStream)) { + cs.cc.t.markNewGoroutine() + err := cs.writeRequest(req, streamf) cs.cleanupWriteRequest(err) } @@ -1457,7 +1418,7 @@ func (cs *clientStream) doRequest(req *http.Request) { // // It returns non-nil if the request ends otherwise. // If the returned error is StreamError, the error Code may be used in resetting the stream. -func (cs *clientStream) writeRequest(req *http.Request) (err error) { +func (cs *clientStream) writeRequest(req *http.Request, streamf func(*clientStream)) (err error) { cc := cs.cc ctx := cs.ctx @@ -1471,21 +1432,6 @@ func (cs *clientStream) writeRequest(req *http.Request) (err error) { if cc.reqHeaderMu == nil { panic("RoundTrip on uninitialized ClientConn") // for tests } - var newStreamHook func(*clientStream) - if cc.syncHooks != nil { - newStreamHook = cc.syncHooks.newstream - cc.syncHooks.blockUntil(func() bool { - select { - case cc.reqHeaderMu <- struct{}{}: - <-cc.reqHeaderMu - case <-cs.reqCancel: - case <-ctx.Done(): - default: - return false - } - return true - }) - } select { case cc.reqHeaderMu <- struct{}{}: case <-cs.reqCancel: @@ -1510,28 +1456,8 @@ func (cs *clientStream) writeRequest(req *http.Request) (err error) { } cc.mu.Unlock() - if newStreamHook != nil { - newStreamHook(cs) - } - - // TODO(bradfitz): this is a copy of the logic in net/http. Unify somewhere? - if !cc.t.disableCompression() && - req.Header.Get("Accept-Encoding") == "" && - req.Header.Get("Range") == "" && - !cs.isHead { - // Request gzip only, not deflate. Deflate is ambiguous and - // not as universally supported anyway. - // See: https://zlib.net/zlib_faq.html#faq39 - // - // Note that we don't request this for HEAD requests, - // due to a bug in nginx: - // http://trac.nginx.org/nginx/ticket/358 - // https://golang.org/issue/5522 - // - // We don't request gzip if the request is for a range, since - // auto-decoding a portion of a gzipped document will just fail - // anyway. See https://golang.org/issue/8923 - cs.requestedGzip = true + if streamf != nil { + streamf(cs) } continueTimeout := cc.t.expectContinueTimeout() @@ -1594,7 +1520,7 @@ func (cs *clientStream) writeRequest(req *http.Request) (err error) { var respHeaderTimer <-chan time.Time var respHeaderRecv chan struct{} if d := cc.responseHeaderTimeout(); d != 0 { - timer := cc.newTimer(d) + timer := cc.t.newTimer(d) defer timer.Stop() respHeaderTimer = timer.C() respHeaderRecv = cs.respHeaderRecv @@ -1603,21 +1529,6 @@ func (cs *clientStream) writeRequest(req *http.Request) (err error) { // or until the request is aborted (via context, error, or otherwise), // whichever comes first. for { - if cc.syncHooks != nil { - cc.syncHooks.blockUntil(func() bool { - select { - case <-cs.peerClosed: - case <-respHeaderTimer: - case <-respHeaderRecv: - case <-cs.abort: - case <-ctx.Done(): - case <-cs.reqCancel: - default: - return false - } - return true - }) - } select { case <-cs.peerClosed: return nil @@ -1766,7 +1677,7 @@ func (cc *ClientConn) awaitOpenSlotForStreamLocked(cs *clientStream) error { return nil } cc.pendingRequests++ - cc.condWait() + cc.cond.Wait() cc.pendingRequests-- select { case <-cs.abort: @@ -2028,7 +1939,7 @@ func (cs *clientStream) awaitFlowControl(maxBytes int) (taken int32, err error) cs.flow.take(take) return take, nil } - cc.condWait() + cc.cond.Wait() } } @@ -2311,7 +2222,7 @@ func (cc *ClientConn) forgetStreamID(id uint32) { } // Wake up writeRequestBody via clientStream.awaitFlowControl and // wake up RoundTrip if there is a pending request. - cc.condBroadcast() + cc.cond.Broadcast() closeOnIdle := cc.singleUse || cc.doNotReuse || cc.t.disableKeepAlives() || cc.goAway != nil if closeOnIdle && cc.streamsReserved == 0 && len(cc.streams) == 0 { @@ -2333,6 +2244,7 @@ type clientConnReadLoop struct { // readLoop runs in its own goroutine and reads and dispatches frames. func (cc *ClientConn) readLoop() { + cc.t.markNewGoroutine() rl := &clientConnReadLoop{cc: cc} defer rl.cleanup() cc.readerErr = rl.run() @@ -2399,7 +2311,7 @@ func (rl *clientConnReadLoop) cleanup() { cs.abortStreamLocked(err) } } - cc.condBroadcast() + cc.cond.Broadcast() cc.mu.Unlock() } @@ -2436,7 +2348,7 @@ func (rl *clientConnReadLoop) run() error { readIdleTimeout := cc.t.ReadIdleTimeout var t timer if readIdleTimeout != 0 { - t = cc.afterFunc(readIdleTimeout, cc.healthCheck) + t = cc.t.afterFunc(readIdleTimeout, cc.healthCheck) } for { f, err := cc.fr.ReadFrame() @@ -3034,7 +2946,7 @@ func (rl *clientConnReadLoop) processSettingsNoWrite(f *SettingsFrame) error { for _, cs := range cc.streams { cs.flow.add(delta) } - cc.condBroadcast() + cc.cond.Broadcast() cc.initialWindowSize = s.Val case SettingHeaderTableSize: @@ -3089,7 +3001,7 @@ func (rl *clientConnReadLoop) processWindowUpdate(f *WindowUpdateFrame) error { return ConnectionError(ErrCodeFlowControl) } - cc.condBroadcast() + cc.cond.Broadcast() return nil } @@ -3133,7 +3045,8 @@ func (cc *ClientConn) Ping(ctx context.Context) error { } var pingError error errc := make(chan struct{}) - cc.goRun(func() { + go func() { + cc.t.markNewGoroutine() cc.wmu.Lock() defer cc.wmu.Unlock() if pingError = cc.fr.WritePing(false, p); pingError != nil { @@ -3144,20 +3057,7 @@ func (cc *ClientConn) Ping(ctx context.Context) error { close(errc) return } - }) - if cc.syncHooks != nil { - cc.syncHooks.blockUntil(func() bool { - select { - case <-c: - case <-errc: - case <-ctx.Done(): - case <-cc.readerDone: - default: - return false - } - return true - }) - } + }() select { case <-c: return nil diff --git a/vendor/golang.org/x/net/http2/writesched_priority.go b/vendor/golang.org/x/net/http2/writesched_priority.go index 0a242c669e2..f6783339d11 100644 --- a/vendor/golang.org/x/net/http2/writesched_priority.go +++ b/vendor/golang.org/x/net/http2/writesched_priority.go @@ -443,8 +443,8 @@ func (ws *priorityWriteScheduler) addClosedOrIdleNode(list *[]*priorityNode, max } func (ws *priorityWriteScheduler) removeNode(n *priorityNode) { - for k := n.kids; k != nil; k = k.next { - k.setParent(n.parent) + for n.kids != nil { + n.kids.setParent(n.parent) } n.setParent(nil) delete(ws.nodes, n.id) diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux.go b/vendor/golang.org/x/sys/unix/ztypes_linux.go index b102b95a0a1..7f1961b907a 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux.go @@ -3807,6 +3807,9 @@ const ( ETHTOOL_MSG_PSE_GET_REPLY = 0x25 ETHTOOL_MSG_RSS_GET_REPLY = 0x26 ETHTOOL_MSG_KERNEL_MAX = 0x2b + ETHTOOL_FLAG_COMPACT_BITSETS = 0x1 + ETHTOOL_FLAG_OMIT_REPLY = 0x2 + ETHTOOL_FLAG_STATS = 0x4 ETHTOOL_A_HEADER_UNSPEC = 0x0 ETHTOOL_A_HEADER_DEV_INDEX = 0x1 ETHTOOL_A_HEADER_DEV_NAME = 0x2 diff --git a/vendor/golang.org/x/sys/windows/types_windows.go b/vendor/golang.org/x/sys/windows/types_windows.go index 4d0c15745f8..3f03b3d57cc 100644 --- a/vendor/golang.org/x/sys/windows/types_windows.go +++ b/vendor/golang.org/x/sys/windows/types_windows.go @@ -2031,6 +2031,50 @@ const ( IF_TYPE_IEEE1394 = 144 ) +// Enum NL_PREFIX_ORIGIN for [IpAdapterUnicastAddress], see +// https://learn.microsoft.com/en-us/windows/win32/api/nldef/ne-nldef-nl_prefix_origin +const ( + IpPrefixOriginOther = 0 + IpPrefixOriginManual = 1 + IpPrefixOriginWellKnown = 2 + IpPrefixOriginDhcp = 3 + IpPrefixOriginRouterAdvertisement = 4 + IpPrefixOriginUnchanged = 1 << 4 +) + +// Enum NL_SUFFIX_ORIGIN for [IpAdapterUnicastAddress], see +// https://learn.microsoft.com/en-us/windows/win32/api/nldef/ne-nldef-nl_suffix_origin +const ( + NlsoOther = 0 + NlsoManual = 1 + NlsoWellKnown = 2 + NlsoDhcp = 3 + NlsoLinkLayerAddress = 4 + NlsoRandom = 5 + IpSuffixOriginOther = 0 + IpSuffixOriginManual = 1 + IpSuffixOriginWellKnown = 2 + IpSuffixOriginDhcp = 3 + IpSuffixOriginLinkLayerAddress = 4 + IpSuffixOriginRandom = 5 + IpSuffixOriginUnchanged = 1 << 4 +) + +// Enum NL_DAD_STATE for [IpAdapterUnicastAddress], see +// https://learn.microsoft.com/en-us/windows/win32/api/nldef/ne-nldef-nl_dad_state +const ( + NldsInvalid = 0 + NldsTentative = 1 + NldsDuplicate = 2 + NldsDeprecated = 3 + NldsPreferred = 4 + IpDadStateInvalid = 0 + IpDadStateTentative = 1 + IpDadStateDuplicate = 2 + IpDadStateDeprecated = 3 + IpDadStatePreferred = 4 +) + type SocketAddress struct { Sockaddr *syscall.RawSockaddrAny SockaddrLength int32 diff --git a/vendor/golang.org/x/tools/LICENSE b/vendor/golang.org/x/tools/LICENSE index 6a66aea5eaf..2a7cf70da6e 100644 --- a/vendor/golang.org/x/tools/LICENSE +++ b/vendor/golang.org/x/tools/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2009 The Go Authors. All rights reserved. +Copyright 2009 The Go Authors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are @@ -10,7 +10,7 @@ notice, this list of conditions and the following disclaimer. copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - * Neither the name of Google Inc. nor the names of its + * Neither the name of Google LLC nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. diff --git a/vendor/golang.org/x/tools/go/internal/packagesdriver/sizes.go b/vendor/golang.org/x/tools/go/internal/packagesdriver/sizes.go deleted file mode 100644 index 333676b7cfc..00000000000 --- a/vendor/golang.org/x/tools/go/internal/packagesdriver/sizes.go +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package packagesdriver fetches type sizes for go/packages and go/analysis. -package packagesdriver - -import ( - "context" - "fmt" - "strings" - - "golang.org/x/tools/internal/gocommand" -) - -func GetSizesForArgsGolist(ctx context.Context, inv gocommand.Invocation, gocmdRunner *gocommand.Runner) (string, string, error) { - inv.Verb = "list" - inv.Args = []string{"-f", "{{context.GOARCH}} {{context.Compiler}}", "--", "unsafe"} - stdout, stderr, friendlyErr, rawErr := gocmdRunner.RunRaw(ctx, inv) - var goarch, compiler string - if rawErr != nil { - rawErrMsg := rawErr.Error() - if strings.Contains(rawErrMsg, "cannot find main module") || - strings.Contains(rawErrMsg, "go.mod file not found") { - // User's running outside of a module. - // All bets are off. Get GOARCH and guess compiler is gc. - // TODO(matloob): Is this a problem in practice? - inv.Verb = "env" - inv.Args = []string{"GOARCH"} - envout, enverr := gocmdRunner.Run(ctx, inv) - if enverr != nil { - return "", "", enverr - } - goarch = strings.TrimSpace(envout.String()) - compiler = "gc" - } else if friendlyErr != nil { - return "", "", friendlyErr - } else { - // This should be unreachable, but be defensive - // in case RunRaw's error results are inconsistent. - return "", "", rawErr - } - } else { - fields := strings.Fields(stdout.String()) - if len(fields) < 2 { - return "", "", fmt.Errorf("could not parse GOARCH and Go compiler in format \" \":\nstdout: <<%s>>\nstderr: <<%s>>", - stdout.String(), stderr.String()) - } - goarch = fields[0] - compiler = fields[1] - } - return compiler, goarch, nil -} diff --git a/vendor/golang.org/x/tools/go/packages/doc.go b/vendor/golang.org/x/tools/go/packages/doc.go index a8d7b06ac09..3531ac8f5fc 100644 --- a/vendor/golang.org/x/tools/go/packages/doc.go +++ b/vendor/golang.org/x/tools/go/packages/doc.go @@ -198,14 +198,6 @@ Instead, ssadump no longer requests the runtime package, but seeks it among the dependencies of the user-specified packages, and emits an error if it is not found. -Overlays: The Overlay field in the Config allows providing alternate contents -for Go source files, by providing a mapping from file path to contents. -go/packages will pull in new imports added in overlay files when go/packages -is run in LoadImports mode or greater. -Overlay support for the go list driver isn't complete yet: if the file doesn't -exist on disk, it will only be recognized in an overlay if it is a non-test file -and the package would be reported even without the overlay. - Questions & Tasks - Add GOARCH/GOOS? diff --git a/vendor/golang.org/x/tools/go/packages/external.go b/vendor/golang.org/x/tools/go/packages/external.go index 4335c1eb14c..c2b4b711b59 100644 --- a/vendor/golang.org/x/tools/go/packages/external.go +++ b/vendor/golang.org/x/tools/go/packages/external.go @@ -34,8 +34,8 @@ type DriverRequest struct { // Tests specifies whether the patterns should also return test packages. Tests bool `json:"tests"` - // Overlay maps file paths (relative to the driver's working directory) to the byte contents - // of overlay files. + // Overlay maps file paths (relative to the driver's working directory) + // to the contents of overlay files (see Config.Overlay). Overlay map[string][]byte `json:"overlay"` } @@ -119,7 +119,19 @@ func findExternalDriver(cfg *Config) driver { stderr := new(bytes.Buffer) cmd := exec.CommandContext(cfg.Context, tool, words...) cmd.Dir = cfg.Dir - cmd.Env = cfg.Env + // The cwd gets resolved to the real path. On Darwin, where + // /tmp is a symlink, this breaks anything that expects the + // working directory to keep the original path, including the + // go command when dealing with modules. + // + // os.Getwd stdlib has a special feature where if the + // cwd and the PWD are the same node then it trusts + // the PWD, so by setting it in the env for the child + // process we fix up all the paths returned by the go + // command. + // + // (See similar trick in Invocation.run in ../../internal/gocommand/invoke.go) + cmd.Env = append(slicesClip(cfg.Env), "PWD="+cfg.Dir) cmd.Stdin = bytes.NewReader(req) cmd.Stdout = buf cmd.Stderr = stderr @@ -138,3 +150,7 @@ func findExternalDriver(cfg *Config) driver { return &response, nil } } + +// slicesClip removes unused capacity from the slice, returning s[:len(s):len(s)]. +// TODO(adonovan): use go1.21 slices.Clip. +func slicesClip[S ~[]E, E any](s S) S { return s[:len(s):len(s)] } diff --git a/vendor/golang.org/x/tools/go/packages/golist.go b/vendor/golang.org/x/tools/go/packages/golist.go index 22305d9c90a..1a3a5b44f5c 100644 --- a/vendor/golang.org/x/tools/go/packages/golist.go +++ b/vendor/golang.org/x/tools/go/packages/golist.go @@ -21,7 +21,6 @@ import ( "sync" "unicode" - "golang.org/x/tools/go/internal/packagesdriver" "golang.org/x/tools/internal/gocommand" "golang.org/x/tools/internal/packagesinternal" ) @@ -149,7 +148,7 @@ func goListDriver(cfg *Config, patterns ...string) (_ *DriverResponse, err error if cfg.Mode&NeedTypesSizes != 0 || cfg.Mode&NeedTypes != 0 { errCh := make(chan error) go func() { - compiler, arch, err := packagesdriver.GetSizesForArgsGolist(ctx, state.cfgInvocation(), cfg.gocmdRunner) + compiler, arch, err := getSizesForArgs(ctx, state.cfgInvocation(), cfg.gocmdRunner) response.dr.Compiler = compiler response.dr.Arch = arch errCh <- err @@ -841,6 +840,7 @@ func (state *golistState) cfgInvocation() gocommand.Invocation { Env: cfg.Env, Logf: cfg.Logf, WorkingDir: cfg.Dir, + Overlay: cfg.goListOverlayFile, } } @@ -849,26 +849,6 @@ func (state *golistState) invokeGo(verb string, args ...string) (*bytes.Buffer, cfg := state.cfg inv := state.cfgInvocation() - - // For Go versions 1.16 and above, `go list` accepts overlays directly via - // the -overlay flag. Set it, if it's available. - // - // The check for "list" is not necessarily required, but we should avoid - // getting the go version if possible. - if verb == "list" { - goVersion, err := state.getGoVersion() - if err != nil { - return nil, err - } - if goVersion >= 16 { - filename, cleanup, err := state.writeOverlays() - if err != nil { - return nil, err - } - defer cleanup() - inv.Overlay = filename - } - } inv.Verb = verb inv.Args = args gocmdRunner := cfg.gocmdRunner @@ -1015,67 +995,6 @@ func (state *golistState) invokeGo(verb string, args ...string) (*bytes.Buffer, return stdout, nil } -// OverlayJSON is the format overlay files are expected to be in. -// The Replace map maps from overlaid paths to replacement paths: -// the Go command will forward all reads trying to open -// each overlaid path to its replacement path, or consider the overlaid -// path not to exist if the replacement path is empty. -// -// From golang/go#39958. -type OverlayJSON struct { - Replace map[string]string `json:"replace,omitempty"` -} - -// writeOverlays writes out files for go list's -overlay flag, as described -// above. -func (state *golistState) writeOverlays() (filename string, cleanup func(), err error) { - // Do nothing if there are no overlays in the config. - if len(state.cfg.Overlay) == 0 { - return "", func() {}, nil - } - dir, err := os.MkdirTemp("", "gopackages-*") - if err != nil { - return "", nil, err - } - // The caller must clean up this directory, unless this function returns an - // error. - cleanup = func() { - os.RemoveAll(dir) - } - defer func() { - if err != nil { - cleanup() - } - }() - overlays := map[string]string{} - for k, v := range state.cfg.Overlay { - // Create a unique filename for the overlaid files, to avoid - // creating nested directories. - noSeparator := strings.Join(strings.Split(filepath.ToSlash(k), "/"), "") - f, err := os.CreateTemp(dir, fmt.Sprintf("*-%s", noSeparator)) - if err != nil { - return "", func() {}, err - } - if _, err := f.Write(v); err != nil { - return "", func() {}, err - } - if err := f.Close(); err != nil { - return "", func() {}, err - } - overlays[k] = f.Name() - } - b, err := json.Marshal(OverlayJSON{Replace: overlays}) - if err != nil { - return "", func() {}, err - } - // Write out the overlay file that contains the filepath mappings. - filename = filepath.Join(dir, "overlay.json") - if err := os.WriteFile(filename, b, 0665); err != nil { - return "", func() {}, err - } - return filename, cleanup, nil -} - func containsGoFile(s []string) bool { for _, f := range s { if strings.HasSuffix(f, ".go") { @@ -1104,3 +1023,44 @@ func cmdDebugStr(cmd *exec.Cmd) string { } return fmt.Sprintf("GOROOT=%v GOPATH=%v GO111MODULE=%v GOPROXY=%v PWD=%v %v", env["GOROOT"], env["GOPATH"], env["GO111MODULE"], env["GOPROXY"], env["PWD"], strings.Join(args, " ")) } + +// getSizesForArgs queries 'go list' for the appropriate +// Compiler and GOARCH arguments to pass to [types.SizesFor]. +func getSizesForArgs(ctx context.Context, inv gocommand.Invocation, gocmdRunner *gocommand.Runner) (string, string, error) { + inv.Verb = "list" + inv.Args = []string{"-f", "{{context.GOARCH}} {{context.Compiler}}", "--", "unsafe"} + stdout, stderr, friendlyErr, rawErr := gocmdRunner.RunRaw(ctx, inv) + var goarch, compiler string + if rawErr != nil { + rawErrMsg := rawErr.Error() + if strings.Contains(rawErrMsg, "cannot find main module") || + strings.Contains(rawErrMsg, "go.mod file not found") { + // User's running outside of a module. + // All bets are off. Get GOARCH and guess compiler is gc. + // TODO(matloob): Is this a problem in practice? + inv.Verb = "env" + inv.Args = []string{"GOARCH"} + envout, enverr := gocmdRunner.Run(ctx, inv) + if enverr != nil { + return "", "", enverr + } + goarch = strings.TrimSpace(envout.String()) + compiler = "gc" + } else if friendlyErr != nil { + return "", "", friendlyErr + } else { + // This should be unreachable, but be defensive + // in case RunRaw's error results are inconsistent. + return "", "", rawErr + } + } else { + fields := strings.Fields(stdout.String()) + if len(fields) < 2 { + return "", "", fmt.Errorf("could not parse GOARCH and Go compiler in format \" \":\nstdout: <<%s>>\nstderr: <<%s>>", + stdout.String(), stderr.String()) + } + goarch = fields[0] + compiler = fields[1] + } + return compiler, goarch, nil +} diff --git a/vendor/golang.org/x/tools/go/packages/packages.go b/vendor/golang.org/x/tools/go/packages/packages.go index 3ea1b3fa46d..0b6bfaff808 100644 --- a/vendor/golang.org/x/tools/go/packages/packages.go +++ b/vendor/golang.org/x/tools/go/packages/packages.go @@ -37,10 +37,19 @@ import ( // A LoadMode controls the amount of detail to return when loading. // The bits below can be combined to specify which fields should be // filled in the result packages. +// // The zero value is a special case, equivalent to combining // the NeedName, NeedFiles, and NeedCompiledGoFiles bits. +// // ID and Errors (if present) will always be filled. -// Load may return more information than requested. +// [Load] may return more information than requested. +// +// Unfortunately there are a number of open bugs related to +// interactions among the LoadMode bits: +// - https://github.com/golang/go/issues/56633 +// - https://github.com/golang/go/issues/56677 +// - https://github.com/golang/go/issues/58726 +// - https://github.com/golang/go/issues/63517 type LoadMode int const ( @@ -66,7 +75,7 @@ const ( // NeedTypes adds Types, Fset, and IllTyped. NeedTypes - // NeedSyntax adds Syntax. + // NeedSyntax adds Syntax and Fset. NeedSyntax // NeedTypesInfo adds TypesInfo. @@ -123,7 +132,14 @@ const ( // A Config specifies details about how packages should be loaded. // The zero value is a valid configuration. +// // Calls to Load do not modify this struct. +// +// TODO(adonovan): #67702: this is currently false: in fact, +// calls to [Load] do not modify the public fields of this struct, but +// may modify hidden fields, so concurrent calls to [Load] must not +// use the same Config. But perhaps we should reestablish the +// documented invariant. type Config struct { // Mode controls the level of information returned for each package. Mode LoadMode @@ -199,13 +215,23 @@ type Config struct { // setting Tests may have no effect. Tests bool - // Overlay provides a mapping of absolute file paths to file contents. - // If the file with the given path already exists, the parser will use the - // alternative file contents provided by the map. + // Overlay is a mapping from absolute file paths to file contents. + // + // For each map entry, [Load] uses the alternative file + // contents provided by the overlay mapping instead of reading + // from the file system. This mechanism can be used to enable + // editor-integrated tools to correctly analyze the contents + // of modified but unsaved buffers, for example. // - // Overlays provide incomplete support for when a given file doesn't - // already exist on disk. See the package doc above for more details. + // The overlay mapping is passed to the build system's driver + // (see "The driver protocol") so that it too can report + // consistent package metadata about unsaved files. However, + // drivers may vary in their level of support for overlays. Overlay map[string][]byte + + // goListOverlayFile is the JSON file that encodes the Overlay + // mapping, used by 'go list -overlay=...' + goListOverlayFile string } // Load loads and returns the Go packages named by the given patterns. @@ -213,6 +239,20 @@ type Config struct { // Config specifies loading options; // nil behaves the same as an empty Config. // +// The [Config.Mode] field is a set of bits that determine what kinds +// of information should be computed and returned. Modes that require +// more information tend to be slower. See [LoadMode] for details +// and important caveats. Its zero value is equivalent to +// NeedName | NeedFiles | NeedCompiledGoFiles. +// +// Each call to Load returns a new set of [Package] instances. +// The Packages and their Imports form a directed acyclic graph. +// +// If the [NeedTypes] mode flag was set, each call to Load uses a new +// [types.Importer], so [types.Object] and [types.Type] values from +// different calls to Load must not be mixed as they will have +// inconsistent notions of type identity. +// // If any of the patterns was invalid as defined by the // underlying build system, Load returns an error. // It may return an empty list of packages without an error, @@ -286,6 +326,17 @@ func defaultDriver(cfg *Config, patterns ...string) (*DriverResponse, bool, erro // (fall through) } + // go list fallback + // + // Write overlays once, as there are many calls + // to 'go list' (one per chunk plus others too). + overlay, cleanupOverlay, err := gocommand.WriteOverlays(cfg.Overlay) + if err != nil { + return nil, false, err + } + defer cleanupOverlay() + cfg.goListOverlayFile = overlay + response, err := callDriverOnChunks(goListDriver, cfg, chunks) if err != nil { return nil, false, err @@ -365,6 +416,9 @@ func mergeResponses(responses ...*DriverResponse) *DriverResponse { } // A Package describes a loaded Go package. +// +// It also defines part of the JSON schema of [DriverResponse]. +// See the package documentation for an overview. type Package struct { // ID is a unique identifier for a package, // in a syntax provided by the underlying build system. @@ -423,6 +477,13 @@ type Package struct { // to corresponding loaded Packages. Imports map[string]*Package + // Module is the module information for the package if it exists. + // + // Note: it may be missing for std and cmd; see Go issue #65816. + Module *Module + + // -- The following fields are not part of the driver JSON schema. -- + // Types provides type information for the package. // The NeedTypes LoadMode bit sets this field for packages matching the // patterns; type information for dependencies may be missing or incomplete, @@ -431,15 +492,15 @@ type Package struct { // Each call to [Load] returns a consistent set of type // symbols, as defined by the comment at [types.Identical]. // Avoid mixing type information from two or more calls to [Load]. - Types *types.Package + Types *types.Package `json:"-"` // Fset provides position information for Types, TypesInfo, and Syntax. // It is set only when Types is set. - Fset *token.FileSet + Fset *token.FileSet `json:"-"` // IllTyped indicates whether the package or any dependency contains errors. // It is set only when Types is set. - IllTyped bool + IllTyped bool `json:"-"` // Syntax is the package's syntax trees, for the files listed in CompiledGoFiles. // @@ -449,26 +510,28 @@ type Package struct { // // Syntax is kept in the same order as CompiledGoFiles, with the caveat that nils are // removed. If parsing returned nil, Syntax may be shorter than CompiledGoFiles. - Syntax []*ast.File + Syntax []*ast.File `json:"-"` // TypesInfo provides type information about the package's syntax trees. // It is set only when Syntax is set. - TypesInfo *types.Info + TypesInfo *types.Info `json:"-"` // TypesSizes provides the effective size function for types in TypesInfo. - TypesSizes types.Sizes + TypesSizes types.Sizes `json:"-"` + + // -- internal -- // forTest is the package under test, if any. forTest string // depsErrors is the DepsErrors field from the go list response, if any. depsErrors []*packagesinternal.PackageError - - // module is the module information for the package if it exists. - Module *Module } // Module provides module information for a package. +// +// It also defines part of the JSON schema of [DriverResponse]. +// See the package documentation for an overview. type Module struct { Path string // module path Version string // module version @@ -601,6 +664,7 @@ func (p *Package) UnmarshalJSON(b []byte) error { OtherFiles: flat.OtherFiles, EmbedFiles: flat.EmbedFiles, EmbedPatterns: flat.EmbedPatterns, + IgnoredFiles: flat.IgnoredFiles, ExportFile: flat.ExportFile, } if len(flat.Imports) > 0 { @@ -896,12 +960,14 @@ func (ld *loader) refine(response *DriverResponse) ([]*Package, error) { } if ld.requestedMode&NeedTypes == 0 { ld.pkgs[i].Types = nil - ld.pkgs[i].Fset = nil ld.pkgs[i].IllTyped = false } if ld.requestedMode&NeedSyntax == 0 { ld.pkgs[i].Syntax = nil } + if ld.requestedMode&NeedTypes == 0 && ld.requestedMode&NeedSyntax == 0 { + ld.pkgs[i].Fset = nil + } if ld.requestedMode&NeedTypesInfo == 0 { ld.pkgs[i].TypesInfo = nil } @@ -1434,6 +1500,10 @@ func impliedLoadMode(loadMode LoadMode) LoadMode { // All these things require knowing the import graph. loadMode |= NeedImports } + if loadMode&NeedTypes != 0 { + // Types require the GoVersion from Module. + loadMode |= NeedModule + } return loadMode } diff --git a/vendor/golang.org/x/tools/go/packages/visit.go b/vendor/golang.org/x/tools/go/packages/visit.go index a1dcc40b727..df14ffd94dc 100644 --- a/vendor/golang.org/x/tools/go/packages/visit.go +++ b/vendor/golang.org/x/tools/go/packages/visit.go @@ -49,11 +49,20 @@ func Visit(pkgs []*Package, pre func(*Package) bool, post func(*Package)) { // PrintErrors returns the number of errors printed. func PrintErrors(pkgs []*Package) int { var n int + errModules := make(map[*Module]bool) Visit(pkgs, nil, func(pkg *Package) { for _, err := range pkg.Errors { fmt.Fprintln(os.Stderr, err) n++ } + + // Print pkg.Module.Error once if present. + mod := pkg.Module + if mod != nil && mod.Error != nil && !errModules[mod] { + errModules[mod] = true + fmt.Fprintln(os.Stderr, mod.Error.Err) + n++ + } }) return n } diff --git a/vendor/golang.org/x/tools/go/types/objectpath/objectpath.go b/vendor/golang.org/x/tools/go/types/objectpath/objectpath.go index a2386c347a2..9ada177758f 100644 --- a/vendor/golang.org/x/tools/go/types/objectpath/objectpath.go +++ b/vendor/golang.org/x/tools/go/types/objectpath/objectpath.go @@ -51,7 +51,7 @@ type Path string // // PO package->object Package.Scope.Lookup // OT object->type Object.Type -// TT type->type Type.{Elem,Key,Params,Results,Underlying} [EKPRU] +// TT type->type Type.{Elem,Key,{,{,Recv}Type}Params,Results,Underlying,Rhs} [EKPRUTrCa] // TO type->object Type.{At,Field,Method,Obj} [AFMO] // // All valid paths start with a package and end at an object @@ -63,8 +63,8 @@ type Path string // - The only PO operator is Package.Scope.Lookup, which requires an identifier. // - The only OT operator is Object.Type, // which we encode as '.' because dot cannot appear in an identifier. -// - The TT operators are encoded as [EKPRUTC]; -// one of these (TypeParam) requires an integer operand, +// - The TT operators are encoded as [EKPRUTrCa]; +// two of these ({,Recv}TypeParams) require an integer operand, // which is encoded as a string of decimal digits. // - The TO operators are encoded as [AFMO]; // three of these (At,Field,Method) require an integer operand, @@ -98,19 +98,21 @@ const ( opType = '.' // .Type() (Object) // type->type operators - opElem = 'E' // .Elem() (Pointer, Slice, Array, Chan, Map) - opKey = 'K' // .Key() (Map) - opParams = 'P' // .Params() (Signature) - opResults = 'R' // .Results() (Signature) - opUnderlying = 'U' // .Underlying() (Named) - opTypeParam = 'T' // .TypeParams.At(i) (Named, Signature) - opConstraint = 'C' // .Constraint() (TypeParam) + opElem = 'E' // .Elem() (Pointer, Slice, Array, Chan, Map) + opKey = 'K' // .Key() (Map) + opParams = 'P' // .Params() (Signature) + opResults = 'R' // .Results() (Signature) + opUnderlying = 'U' // .Underlying() (Named) + opTypeParam = 'T' // .TypeParams.At(i) (Named, Signature) + opRecvTypeParam = 'r' // .RecvTypeParams.At(i) (Signature) + opConstraint = 'C' // .Constraint() (TypeParam) + opRhs = 'a' // .Rhs() (Alias) // type->object operators - opAt = 'A' // .At(i) (Tuple) - opField = 'F' // .Field(i) (Struct) - opMethod = 'M' // .Method(i) (Named or Interface; not Struct: "promoted" names are ignored) - opObj = 'O' // .Obj() (Named, TypeParam) + opAt = 'A' // .At(i) (Tuple) + opField = 'F' // .Field(i) (Struct) + opMethod = 'M' // .Method(i) (Named or Interface; not Struct: "promoted" names are ignored) + opObj = 'O' // .Obj() (Named, TypeParam) ) // For is equivalent to new(Encoder).For(obj). @@ -278,21 +280,26 @@ func (enc *Encoder) For(obj types.Object) (Path, error) { path = append(path, opType) T := o.Type() + if alias, ok := T.(*aliases.Alias); ok { + if r := findTypeParam(obj, aliases.TypeParams(alias), path, opTypeParam, nil); r != nil { + return Path(r), nil + } + if r := find(obj, aliases.Rhs(alias), append(path, opRhs), nil); r != nil { + return Path(r), nil + } - if tname.IsAlias() { - // type alias + } else if tname.IsAlias() { + // legacy alias if r := find(obj, T, path, nil); r != nil { return Path(r), nil } - } else { - if named, _ := T.(*types.Named); named != nil { - if r := findTypeParam(obj, named.TypeParams(), path, nil); r != nil { - // generic named type - return Path(r), nil - } - } + + } else if named, ok := T.(*types.Named); ok { // defined (named) type - if r := find(obj, T.Underlying(), append(path, opUnderlying), nil); r != nil { + if r := findTypeParam(obj, named.TypeParams(), path, opTypeParam, nil); r != nil { + return Path(r), nil + } + if r := find(obj, named.Underlying(), append(path, opUnderlying), nil); r != nil { return Path(r), nil } } @@ -462,7 +469,10 @@ func find(obj types.Object, T types.Type, path []byte, seen map[*types.TypeName] } return find(obj, T.Elem(), append(path, opElem), seen) case *types.Signature: - if r := findTypeParam(obj, T.TypeParams(), path, seen); r != nil { + if r := findTypeParam(obj, T.RecvTypeParams(), path, opRecvTypeParam, nil); r != nil { + return r + } + if r := findTypeParam(obj, T.TypeParams(), path, opTypeParam, seen); r != nil { return r } if r := find(obj, T.Params(), append(path, opParams), seen); r != nil { @@ -525,10 +535,10 @@ func find(obj types.Object, T types.Type, path []byte, seen map[*types.TypeName] panic(T) } -func findTypeParam(obj types.Object, list *types.TypeParamList, path []byte, seen map[*types.TypeName]bool) []byte { +func findTypeParam(obj types.Object, list *types.TypeParamList, path []byte, op byte, seen map[*types.TypeName]bool) []byte { for i := 0; i < list.Len(); i++ { tparam := list.At(i) - path2 := appendOpArg(path, opTypeParam, i) + path2 := appendOpArg(path, op, i) if r := find(obj, tparam, path2, seen); r != nil { return r } @@ -580,10 +590,10 @@ func Object(pkg *types.Package, p Path) (types.Object, error) { code := suffix[0] suffix = suffix[1:] - // Codes [AFM] have an integer operand. + // Codes [AFMTr] have an integer operand. var index int switch code { - case opAt, opField, opMethod, opTypeParam: + case opAt, opField, opMethod, opTypeParam, opRecvTypeParam: rest := strings.TrimLeft(suffix, "0123456789") numerals := suffix[:len(suffix)-len(rest)] suffix = rest @@ -653,6 +663,16 @@ func Object(pkg *types.Package, p Path) (types.Object, error) { } t = named.Underlying() + case opRhs: + if alias, ok := t.(*aliases.Alias); ok { + t = aliases.Rhs(alias) + } else if false && aliases.Enabled() { + // The Enabled check is too expensive, so for now we + // simply assume that aliases are not enabled. + // TODO(adonovan): replace with "if true {" when go1.24 is assured. + return nil, fmt.Errorf("cannot apply %q to %s (got %T, want alias)", code, t, t) + } + case opTypeParam: hasTypeParams, ok := t.(hasTypeParams) // Named, Signature if !ok { @@ -664,6 +684,17 @@ func Object(pkg *types.Package, p Path) (types.Object, error) { } t = tparams.At(index) + case opRecvTypeParam: + sig, ok := t.(*types.Signature) // Signature + if !ok { + return nil, fmt.Errorf("cannot apply %q to %s (got %T, want signature)", code, t, t) + } + rtparams := sig.RecvTypeParams() + if n := rtparams.Len(); index >= n { + return nil, fmt.Errorf("tuple index %d out of range [0-%d)", index, n) + } + t = rtparams.At(index) + case opConstraint: tparam, ok := t.(*types.TypeParam) if !ok { @@ -725,6 +756,10 @@ func Object(pkg *types.Package, p Path) (types.Object, error) { } } + if obj == nil { + panic(p) // path does not end in an object-valued operator + } + if obj.Pkg() != pkg { return nil, fmt.Errorf("path denotes %s, which belongs to a different package", obj) } diff --git a/vendor/golang.org/x/tools/internal/aliases/aliases_go121.go b/vendor/golang.org/x/tools/internal/aliases/aliases_go121.go index c027b9f315f..6652f7db0fb 100644 --- a/vendor/golang.org/x/tools/internal/aliases/aliases_go121.go +++ b/vendor/golang.org/x/tools/internal/aliases/aliases_go121.go @@ -15,10 +15,14 @@ import ( // It will never be created by go/types. type Alias struct{} -func (*Alias) String() string { panic("unreachable") } -func (*Alias) Underlying() types.Type { panic("unreachable") } -func (*Alias) Obj() *types.TypeName { panic("unreachable") } -func Rhs(alias *Alias) types.Type { panic("unreachable") } +func (*Alias) String() string { panic("unreachable") } +func (*Alias) Underlying() types.Type { panic("unreachable") } +func (*Alias) Obj() *types.TypeName { panic("unreachable") } +func Rhs(alias *Alias) types.Type { panic("unreachable") } +func TypeParams(alias *Alias) *types.TypeParamList { panic("unreachable") } +func SetTypeParams(alias *Alias, tparams []*types.TypeParam) { panic("unreachable") } +func TypeArgs(alias *Alias) *types.TypeList { panic("unreachable") } +func Origin(alias *Alias) *Alias { panic("unreachable") } // Unalias returns the type t for go <=1.21. func Unalias(t types.Type) types.Type { return t } diff --git a/vendor/golang.org/x/tools/internal/aliases/aliases_go122.go b/vendor/golang.org/x/tools/internal/aliases/aliases_go122.go index b3299548419..3ef1afeb403 100644 --- a/vendor/golang.org/x/tools/internal/aliases/aliases_go122.go +++ b/vendor/golang.org/x/tools/internal/aliases/aliases_go122.go @@ -28,6 +28,42 @@ func Rhs(alias *Alias) types.Type { return Unalias(alias) } +// TypeParams returns the type parameter list of the alias. +func TypeParams(alias *Alias) *types.TypeParamList { + if alias, ok := any(alias).(interface{ TypeParams() *types.TypeParamList }); ok { + return alias.TypeParams() // go1.23+ + } + return nil +} + +// SetTypeParams sets the type parameters of the alias type. +func SetTypeParams(alias *Alias, tparams []*types.TypeParam) { + if alias, ok := any(alias).(interface { + SetTypeParams(tparams []*types.TypeParam) + }); ok { + alias.SetTypeParams(tparams) // go1.23+ + } else if len(tparams) > 0 { + panic("cannot set type parameters of an Alias type in go1.22") + } +} + +// TypeArgs returns the type arguments used to instantiate the Alias type. +func TypeArgs(alias *Alias) *types.TypeList { + if alias, ok := any(alias).(interface{ TypeArgs() *types.TypeList }); ok { + return alias.TypeArgs() // go1.23+ + } + return nil // empty (go1.22) +} + +// Origin returns the generic Alias type of which alias is an instance. +// If alias is not an instance of a generic alias, Origin returns alias. +func Origin(alias *Alias) *Alias { + if alias, ok := any(alias).(interface{ Origin() *types.Alias }); ok { + return alias.Origin() // go1.23+ + } + return alias // not an instance of a generic alias (go1.22) +} + // Unalias is a wrapper of types.Unalias. func Unalias(t types.Type) types.Type { return types.Unalias(t) } diff --git a/vendor/golang.org/x/tools/internal/gocommand/invoke.go b/vendor/golang.org/x/tools/internal/gocommand/invoke.go index eb7a8282f9e..2e59ff8558c 100644 --- a/vendor/golang.org/x/tools/internal/gocommand/invoke.go +++ b/vendor/golang.org/x/tools/internal/gocommand/invoke.go @@ -8,12 +8,14 @@ package gocommand import ( "bytes" "context" + "encoding/json" "errors" "fmt" "io" "log" "os" "os/exec" + "path/filepath" "reflect" "regexp" "runtime" @@ -167,7 +169,9 @@ type Invocation struct { // TODO(rfindley): remove, in favor of Args. ModFile string - // If Overlay is set, the go command is invoked with -overlay=Overlay. + // Overlay is the name of the JSON overlay file that describes + // unsaved editor buffers; see [WriteOverlays]. + // If set, the go command is invoked with -overlay=Overlay. // TODO(rfindley): remove, in favor of Args. Overlay string @@ -196,12 +200,14 @@ func (i *Invocation) runWithFriendlyError(ctx context.Context, stdout, stderr io return } -func (i *Invocation) run(ctx context.Context, stdout, stderr io.Writer) error { - log := i.Logf - if log == nil { - log = func(string, ...interface{}) {} +// logf logs if i.Logf is non-nil. +func (i *Invocation) logf(format string, args ...any) { + if i.Logf != nil { + i.Logf(format, args...) } +} +func (i *Invocation) run(ctx context.Context, stdout, stderr io.Writer) error { goArgs := []string{i.Verb} appendModFile := func() { @@ -255,12 +261,15 @@ func (i *Invocation) run(ctx context.Context, stdout, stderr io.Writer) error { waitDelay.Set(reflect.ValueOf(30 * time.Second)) } - // On darwin the cwd gets resolved to the real path, which breaks anything that - // expects the working directory to keep the original path, including the + // The cwd gets resolved to the real path. On Darwin, where + // /tmp is a symlink, this breaks anything that expects the + // working directory to keep the original path, including the // go command when dealing with modules. - // The Go stdlib has a special feature where if the cwd and the PWD are the - // same node then it trusts the PWD, so by setting it in the env for the child - // process we fix up all the paths returned by the go command. + // + // os.Getwd has a special feature where if the cwd and the PWD + // are the same node then it trusts the PWD, so by setting it + // in the env for the child process we fix up all the paths + // returned by the go command. if !i.CleanEnv { cmd.Env = os.Environ() } @@ -270,7 +279,12 @@ func (i *Invocation) run(ctx context.Context, stdout, stderr io.Writer) error { cmd.Dir = i.WorkingDir } - defer func(start time.Time) { log("%s for %v", time.Since(start), cmdDebugStr(cmd)) }(time.Now()) + debugStr := cmdDebugStr(cmd) + i.logf("starting %v", debugStr) + start := time.Now() + defer func() { + i.logf("%s for %v", time.Since(start), debugStr) + }() return runCmdContext(ctx, cmd) } @@ -351,6 +365,7 @@ func runCmdContext(ctx context.Context, cmd *exec.Cmd) (err error) { } } + startTime := time.Now() err = cmd.Start() if stdoutW != nil { // The child process has inherited the pipe file, @@ -377,7 +392,7 @@ func runCmdContext(ctx context.Context, cmd *exec.Cmd) (err error) { case err := <-resChan: return err case <-timer.C: - HandleHangingGoCommand(cmd.Process) + HandleHangingGoCommand(startTime, cmd) case <-ctx.Done(): } } else { @@ -411,7 +426,7 @@ func runCmdContext(ctx context.Context, cmd *exec.Cmd) (err error) { return <-resChan } -func HandleHangingGoCommand(proc *os.Process) { +func HandleHangingGoCommand(start time.Time, cmd *exec.Cmd) { switch runtime.GOOS { case "linux", "darwin", "freebsd", "netbsd": fmt.Fprintln(os.Stderr, `DETECTED A HANGING GO COMMAND @@ -444,7 +459,7 @@ See golang/go#54461 for more details.`) panic(fmt.Sprintf("running %s: %v", listFiles, err)) } } - panic(fmt.Sprintf("detected hanging go command (pid %d): see golang/go#54461 for more details", proc.Pid)) + panic(fmt.Sprintf("detected hanging go command (golang/go#54461); waited %s\n\tcommand:%s\n\tpid:%d", time.Since(start), cmd, cmd.Process.Pid)) } func cmdDebugStr(cmd *exec.Cmd) string { @@ -468,3 +483,73 @@ func cmdDebugStr(cmd *exec.Cmd) string { } return fmt.Sprintf("GOROOT=%v GOPATH=%v GO111MODULE=%v GOPROXY=%v PWD=%v %v", env["GOROOT"], env["GOPATH"], env["GO111MODULE"], env["GOPROXY"], env["PWD"], strings.Join(args, " ")) } + +// WriteOverlays writes each value in the overlay (see the Overlay +// field of go/packages.Config) to a temporary file and returns the name +// of a JSON file describing the mapping that is suitable for the "go +// list -overlay" flag. +// +// On success, the caller must call the cleanup function exactly once +// when the files are no longer needed. +func WriteOverlays(overlay map[string][]byte) (filename string, cleanup func(), err error) { + // Do nothing if there are no overlays in the config. + if len(overlay) == 0 { + return "", func() {}, nil + } + + dir, err := os.MkdirTemp("", "gocommand-*") + if err != nil { + return "", nil, err + } + + // The caller must clean up this directory, + // unless this function returns an error. + // (The cleanup operand of each return + // statement below is ignored.) + defer func() { + cleanup = func() { + os.RemoveAll(dir) + } + if err != nil { + cleanup() + cleanup = nil + } + }() + + // Write each map entry to a temporary file. + overlays := make(map[string]string) + for k, v := range overlay { + // Use a unique basename for each file (001-foo.go), + // to avoid creating nested directories. + base := fmt.Sprintf("%d-%s", 1+len(overlays), filepath.Base(k)) + filename := filepath.Join(dir, base) + err := os.WriteFile(filename, v, 0666) + if err != nil { + return "", nil, err + } + overlays[k] = filename + } + + // Write the JSON overlay file that maps logical file names to temp files. + // + // OverlayJSON is the format overlay files are expected to be in. + // The Replace map maps from overlaid paths to replacement paths: + // the Go command will forward all reads trying to open + // each overlaid path to its replacement path, or consider the overlaid + // path not to exist if the replacement path is empty. + // + // From golang/go#39958. + type OverlayJSON struct { + Replace map[string]string `json:"replace,omitempty"` + } + b, err := json.Marshal(OverlayJSON{Replace: overlays}) + if err != nil { + return "", nil, err + } + filename = filepath.Join(dir, "overlay.json") + if err := os.WriteFile(filename, b, 0666); err != nil { + return "", nil, err + } + + return filename, nil, nil +} diff --git a/vendor/golang.org/x/tools/internal/pkgbits/decoder.go b/vendor/golang.org/x/tools/internal/pkgbits/decoder.go index 2acd85851e3..b92e8e6eb32 100644 --- a/vendor/golang.org/x/tools/internal/pkgbits/decoder.go +++ b/vendor/golang.org/x/tools/internal/pkgbits/decoder.go @@ -23,9 +23,6 @@ type PkgDecoder struct { // version is the file format version. version uint32 - // aliases determines whether types.Aliases should be created - aliases bool - // sync indicates whether the file uses sync markers. sync bool @@ -76,7 +73,6 @@ func (pr *PkgDecoder) SyncMarkers() bool { return pr.sync } func NewPkgDecoder(pkgPath, input string) PkgDecoder { pr := PkgDecoder{ pkgPath: pkgPath, - //aliases: aliases.Enabled(), } // TODO(mdempsky): Implement direct indexing of input string to diff --git a/vendor/golang.org/x/tools/internal/stdlib/manifest.go b/vendor/golang.org/x/tools/internal/stdlib/manifest.go index fd6892075ee..a928acf29fa 100644 --- a/vendor/golang.org/x/tools/internal/stdlib/manifest.go +++ b/vendor/golang.org/x/tools/internal/stdlib/manifest.go @@ -23,6 +23,7 @@ var PackageSymbols = map[string][]Symbol{ {"ErrWriteAfterClose", Var, 0}, {"ErrWriteTooLong", Var, 0}, {"FileInfoHeader", Func, 1}, + {"FileInfoNames", Type, 23}, {"Format", Type, 10}, {"FormatGNU", Const, 10}, {"FormatPAX", Const, 10}, @@ -820,6 +821,7 @@ var PackageSymbols = map[string][]Symbol{ {"(*ConnectionState).ExportKeyingMaterial", Method, 11}, {"(*Dialer).Dial", Method, 15}, {"(*Dialer).DialContext", Method, 15}, + {"(*ECHRejectionError).Error", Method, 23}, {"(*QUICConn).Close", Method, 21}, {"(*QUICConn).ConnectionState", Method, 21}, {"(*QUICConn).HandleData", Method, 21}, @@ -827,6 +829,7 @@ var PackageSymbols = map[string][]Symbol{ {"(*QUICConn).SendSessionTicket", Method, 21}, {"(*QUICConn).SetTransportParameters", Method, 21}, {"(*QUICConn).Start", Method, 21}, + {"(*QUICConn).StoreSession", Method, 23}, {"(*SessionState).Bytes", Method, 21}, {"(AlertError).Error", Method, 21}, {"(ClientAuthType).String", Method, 15}, @@ -877,6 +880,8 @@ var PackageSymbols = map[string][]Symbol{ {"Config.ClientSessionCache", Field, 3}, {"Config.CurvePreferences", Field, 3}, {"Config.DynamicRecordSizingDisabled", Field, 7}, + {"Config.EncryptedClientHelloConfigList", Field, 23}, + {"Config.EncryptedClientHelloRejectionVerify", Field, 23}, {"Config.GetCertificate", Field, 4}, {"Config.GetClientCertificate", Field, 8}, {"Config.GetConfigForClient", Field, 8}, @@ -902,6 +907,7 @@ var PackageSymbols = map[string][]Symbol{ {"ConnectionState", Type, 0}, {"ConnectionState.CipherSuite", Field, 0}, {"ConnectionState.DidResume", Field, 1}, + {"ConnectionState.ECHAccepted", Field, 23}, {"ConnectionState.HandshakeComplete", Field, 0}, {"ConnectionState.NegotiatedProtocol", Field, 0}, {"ConnectionState.NegotiatedProtocolIsMutual", Field, 0}, @@ -925,6 +931,8 @@ var PackageSymbols = map[string][]Symbol{ {"ECDSAWithP384AndSHA384", Const, 8}, {"ECDSAWithP521AndSHA512", Const, 8}, {"ECDSAWithSHA1", Const, 10}, + {"ECHRejectionError", Type, 23}, + {"ECHRejectionError.RetryConfigList", Field, 23}, {"Ed25519", Const, 13}, {"InsecureCipherSuites", Func, 14}, {"Listen", Func, 0}, @@ -943,6 +951,7 @@ var PackageSymbols = map[string][]Symbol{ {"ParseSessionState", Func, 21}, {"QUICClient", Func, 21}, {"QUICConfig", Type, 21}, + {"QUICConfig.EnableStoreSessionEvent", Field, 23}, {"QUICConfig.TLSConfig", Field, 21}, {"QUICConn", Type, 21}, {"QUICEncryptionLevel", Type, 21}, @@ -954,16 +963,20 @@ var PackageSymbols = map[string][]Symbol{ {"QUICEvent.Data", Field, 21}, {"QUICEvent.Kind", Field, 21}, {"QUICEvent.Level", Field, 21}, + {"QUICEvent.SessionState", Field, 23}, {"QUICEvent.Suite", Field, 21}, {"QUICEventKind", Type, 21}, {"QUICHandshakeDone", Const, 21}, {"QUICNoEvent", Const, 21}, {"QUICRejectedEarlyData", Const, 21}, + {"QUICResumeSession", Const, 23}, {"QUICServer", Func, 21}, {"QUICSessionTicketOptions", Type, 21}, {"QUICSessionTicketOptions.EarlyData", Field, 21}, + {"QUICSessionTicketOptions.Extra", Field, 23}, {"QUICSetReadSecret", Const, 21}, {"QUICSetWriteSecret", Const, 21}, + {"QUICStoreSession", Const, 23}, {"QUICTransportParameters", Const, 21}, {"QUICTransportParametersRequired", Const, 21}, {"QUICWriteData", Const, 21}, @@ -1036,6 +1049,8 @@ var PackageSymbols = map[string][]Symbol{ {"(*Certificate).Verify", Method, 0}, {"(*Certificate).VerifyHostname", Method, 0}, {"(*CertificateRequest).CheckSignature", Method, 5}, + {"(*OID).UnmarshalBinary", Method, 23}, + {"(*OID).UnmarshalText", Method, 23}, {"(*RevocationList).CheckSignatureFrom", Method, 19}, {"(CertificateInvalidError).Error", Method, 0}, {"(ConstraintViolationError).Error", Method, 0}, @@ -1043,6 +1058,8 @@ var PackageSymbols = map[string][]Symbol{ {"(InsecureAlgorithmError).Error", Method, 6}, {"(OID).Equal", Method, 22}, {"(OID).EqualASN1OID", Method, 22}, + {"(OID).MarshalBinary", Method, 23}, + {"(OID).MarshalText", Method, 23}, {"(OID).String", Method, 22}, {"(PublicKeyAlgorithm).String", Method, 10}, {"(SignatureAlgorithm).String", Method, 6}, @@ -1196,6 +1213,7 @@ var PackageSymbols = map[string][]Symbol{ {"ParseCertificates", Func, 0}, {"ParseDERCRL", Func, 0}, {"ParseECPrivateKey", Func, 1}, + {"ParseOID", Func, 23}, {"ParsePKCS1PrivateKey", Func, 0}, {"ParsePKCS1PublicKey", Func, 10}, {"ParsePKCS8PrivateKey", Func, 0}, @@ -2541,6 +2559,7 @@ var PackageSymbols = map[string][]Symbol{ {"PT_NOTE", Const, 0}, {"PT_NULL", Const, 0}, {"PT_OPENBSD_BOOTDATA", Const, 16}, + {"PT_OPENBSD_NOBTCFI", Const, 23}, {"PT_OPENBSD_RANDOMIZE", Const, 16}, {"PT_OPENBSD_WXNEEDED", Const, 16}, {"PT_PAX_FLAGS", Const, 16}, @@ -3620,13 +3639,16 @@ var PackageSymbols = map[string][]Symbol{ {"STT_COMMON", Const, 0}, {"STT_FILE", Const, 0}, {"STT_FUNC", Const, 0}, + {"STT_GNU_IFUNC", Const, 23}, {"STT_HIOS", Const, 0}, {"STT_HIPROC", Const, 0}, {"STT_LOOS", Const, 0}, {"STT_LOPROC", Const, 0}, {"STT_NOTYPE", Const, 0}, {"STT_OBJECT", Const, 0}, + {"STT_RELC", Const, 23}, {"STT_SECTION", Const, 0}, + {"STT_SRELC", Const, 23}, {"STT_TLS", Const, 0}, {"STV_DEFAULT", Const, 0}, {"STV_HIDDEN", Const, 0}, @@ -4544,11 +4566,14 @@ var PackageSymbols = map[string][]Symbol{ {"URLEncoding", Var, 0}, }, "encoding/binary": { + {"Append", Func, 23}, {"AppendByteOrder", Type, 19}, {"AppendUvarint", Func, 19}, {"AppendVarint", Func, 19}, {"BigEndian", Var, 0}, {"ByteOrder", Type, 0}, + {"Decode", Func, 23}, + {"Encode", Func, 23}, {"LittleEndian", Var, 0}, {"MaxVarintLen16", Const, 0}, {"MaxVarintLen32", Const, 0}, @@ -5308,6 +5333,7 @@ var PackageSymbols = map[string][]Symbol{ {"ParenExpr.Rparen", Field, 0}, {"ParenExpr.X", Field, 0}, {"Pkg", Const, 0}, + {"Preorder", Func, 23}, {"Print", Func, 0}, {"RECV", Const, 0}, {"RangeStmt", Type, 0}, @@ -5898,7 +5924,12 @@ var PackageSymbols = map[string][]Symbol{ }, "go/types": { {"(*Alias).Obj", Method, 22}, + {"(*Alias).Origin", Method, 23}, + {"(*Alias).Rhs", Method, 23}, + {"(*Alias).SetTypeParams", Method, 23}, {"(*Alias).String", Method, 22}, + {"(*Alias).TypeArgs", Method, 23}, + {"(*Alias).TypeParams", Method, 23}, {"(*Alias).Underlying", Method, 22}, {"(*ArgumentError).Error", Method, 18}, {"(*ArgumentError).Unwrap", Method, 18}, @@ -5943,6 +5974,7 @@ var PackageSymbols = map[string][]Symbol{ {"(*Func).Pkg", Method, 5}, {"(*Func).Pos", Method, 5}, {"(*Func).Scope", Method, 5}, + {"(*Func).Signature", Method, 23}, {"(*Func).String", Method, 5}, {"(*Func).Type", Method, 5}, {"(*Info).ObjectOf", Method, 5}, @@ -6992,6 +7024,12 @@ var PackageSymbols = map[string][]Symbol{ {"TempFile", Func, 0}, {"WriteFile", Func, 0}, }, + "iter": { + {"Pull", Func, 23}, + {"Pull2", Func, 23}, + {"Seq", Type, 23}, + {"Seq2", Type, 23}, + }, "log": { {"(*Logger).Fatal", Method, 0}, {"(*Logger).Fatalf", Method, 0}, @@ -7222,11 +7260,16 @@ var PackageSymbols = map[string][]Symbol{ {"Writer", Type, 0}, }, "maps": { + {"All", Func, 23}, {"Clone", Func, 21}, + {"Collect", Func, 23}, {"Copy", Func, 21}, {"DeleteFunc", Func, 21}, {"Equal", Func, 21}, {"EqualFunc", Func, 21}, + {"Insert", Func, 23}, + {"Keys", Func, 23}, + {"Values", Func, 23}, }, "math": { {"Abs", Func, 0}, @@ -7617,6 +7660,7 @@ var PackageSymbols = map[string][]Symbol{ }, "math/rand/v2": { {"(*ChaCha8).MarshalBinary", Method, 22}, + {"(*ChaCha8).Read", Method, 23}, {"(*ChaCha8).Seed", Method, 22}, {"(*ChaCha8).Uint64", Method, 22}, {"(*ChaCha8).UnmarshalBinary", Method, 22}, @@ -7636,6 +7680,7 @@ var PackageSymbols = map[string][]Symbol{ {"(*Rand).NormFloat64", Method, 22}, {"(*Rand).Perm", Method, 22}, {"(*Rand).Shuffle", Method, 22}, + {"(*Rand).Uint", Method, 23}, {"(*Rand).Uint32", Method, 22}, {"(*Rand).Uint32N", Method, 22}, {"(*Rand).Uint64", Method, 22}, @@ -7663,6 +7708,7 @@ var PackageSymbols = map[string][]Symbol{ {"Rand", Type, 22}, {"Shuffle", Func, 22}, {"Source", Type, 22}, + {"Uint", Func, 23}, {"Uint32", Func, 22}, {"Uint32N", Func, 22}, {"Uint64", Func, 22}, @@ -7743,6 +7789,7 @@ var PackageSymbols = map[string][]Symbol{ {"(*DNSError).Error", Method, 0}, {"(*DNSError).Temporary", Method, 0}, {"(*DNSError).Timeout", Method, 0}, + {"(*DNSError).Unwrap", Method, 23}, {"(*Dialer).Dial", Method, 1}, {"(*Dialer).DialContext", Method, 7}, {"(*Dialer).MultipathTCP", Method, 21}, @@ -7809,6 +7856,7 @@ var PackageSymbols = map[string][]Symbol{ {"(*TCPConn).RemoteAddr", Method, 0}, {"(*TCPConn).SetDeadline", Method, 0}, {"(*TCPConn).SetKeepAlive", Method, 0}, + {"(*TCPConn).SetKeepAliveConfig", Method, 23}, {"(*TCPConn).SetKeepAlivePeriod", Method, 2}, {"(*TCPConn).SetLinger", Method, 0}, {"(*TCPConn).SetNoDelay", Method, 0}, @@ -7922,6 +7970,7 @@ var PackageSymbols = map[string][]Symbol{ {"DNSError.IsTimeout", Field, 0}, {"DNSError.Name", Field, 0}, {"DNSError.Server", Field, 0}, + {"DNSError.UnwrapErr", Field, 23}, {"DefaultResolver", Var, 8}, {"Dial", Func, 0}, {"DialIP", Func, 0}, @@ -7937,6 +7986,7 @@ var PackageSymbols = map[string][]Symbol{ {"Dialer.DualStack", Field, 2}, {"Dialer.FallbackDelay", Field, 5}, {"Dialer.KeepAlive", Field, 3}, + {"Dialer.KeepAliveConfig", Field, 23}, {"Dialer.LocalAddr", Field, 1}, {"Dialer.Resolver", Field, 8}, {"Dialer.Timeout", Field, 1}, @@ -7989,10 +8039,16 @@ var PackageSymbols = map[string][]Symbol{ {"Interfaces", Func, 0}, {"InvalidAddrError", Type, 0}, {"JoinHostPort", Func, 0}, + {"KeepAliveConfig", Type, 23}, + {"KeepAliveConfig.Count", Field, 23}, + {"KeepAliveConfig.Enable", Field, 23}, + {"KeepAliveConfig.Idle", Field, 23}, + {"KeepAliveConfig.Interval", Field, 23}, {"Listen", Func, 0}, {"ListenConfig", Type, 11}, {"ListenConfig.Control", Field, 11}, {"ListenConfig.KeepAlive", Field, 13}, + {"ListenConfig.KeepAliveConfig", Field, 23}, {"ListenIP", Func, 0}, {"ListenMulticastUDP", Func, 0}, {"ListenPacket", Func, 0}, @@ -8081,6 +8137,7 @@ var PackageSymbols = map[string][]Symbol{ {"(*Request).Context", Method, 7}, {"(*Request).Cookie", Method, 0}, {"(*Request).Cookies", Method, 0}, + {"(*Request).CookiesNamed", Method, 23}, {"(*Request).FormFile", Method, 0}, {"(*Request).FormValue", Method, 0}, {"(*Request).MultipartReader", Method, 0}, @@ -8148,7 +8205,9 @@ var PackageSymbols = map[string][]Symbol{ {"Cookie.HttpOnly", Field, 0}, {"Cookie.MaxAge", Field, 0}, {"Cookie.Name", Field, 0}, + {"Cookie.Partitioned", Field, 23}, {"Cookie.Path", Field, 0}, + {"Cookie.Quoted", Field, 23}, {"Cookie.Raw", Field, 0}, {"Cookie.RawExpires", Field, 0}, {"Cookie.SameSite", Field, 11}, @@ -8225,7 +8284,9 @@ var PackageSymbols = map[string][]Symbol{ {"NoBody", Var, 8}, {"NotFound", Func, 0}, {"NotFoundHandler", Func, 0}, + {"ParseCookie", Func, 23}, {"ParseHTTPVersion", Func, 0}, + {"ParseSetCookie", Func, 23}, {"ParseTime", Func, 1}, {"Post", Func, 0}, {"PostForm", Func, 0}, @@ -8252,6 +8313,7 @@ var PackageSymbols = map[string][]Symbol{ {"Request.Host", Field, 0}, {"Request.Method", Field, 0}, {"Request.MultipartForm", Field, 0}, + {"Request.Pattern", Field, 23}, {"Request.PostForm", Field, 1}, {"Request.Proto", Field, 0}, {"Request.ProtoMajor", Field, 0}, @@ -8453,6 +8515,7 @@ var PackageSymbols = map[string][]Symbol{ {"DefaultRemoteAddr", Const, 0}, {"NewRecorder", Func, 0}, {"NewRequest", Func, 7}, + {"NewRequestWithContext", Func, 23}, {"NewServer", Func, 0}, {"NewTLSServer", Func, 0}, {"NewUnstartedServer", Func, 0}, @@ -8917,6 +8980,7 @@ var PackageSymbols = map[string][]Symbol{ {"Chown", Func, 0}, {"Chtimes", Func, 0}, {"Clearenv", Func, 0}, + {"CopyFS", Func, 23}, {"Create", Func, 0}, {"CreateTemp", Func, 16}, {"DevNull", Const, 0}, @@ -9150,6 +9214,7 @@ var PackageSymbols = map[string][]Symbol{ {"IsLocal", Func, 20}, {"Join", Func, 0}, {"ListSeparator", Const, 0}, + {"Localize", Func, 23}, {"Match", Func, 0}, {"Rel", Func, 0}, {"Separator", Const, 0}, @@ -9232,6 +9297,8 @@ var PackageSymbols = map[string][]Symbol{ {"(Value).Pointer", Method, 0}, {"(Value).Recv", Method, 0}, {"(Value).Send", Method, 0}, + {"(Value).Seq", Method, 23}, + {"(Value).Seq2", Method, 23}, {"(Value).Set", Method, 0}, {"(Value).SetBool", Method, 0}, {"(Value).SetBytes", Method, 0}, @@ -9314,6 +9381,7 @@ var PackageSymbols = map[string][]Symbol{ {"SelectSend", Const, 1}, {"SendDir", Const, 0}, {"Slice", Const, 0}, + {"SliceAt", Func, 23}, {"SliceHeader", Type, 0}, {"SliceHeader.Cap", Field, 0}, {"SliceHeader.Data", Field, 0}, @@ -9655,6 +9723,7 @@ var PackageSymbols = map[string][]Symbol{ {"BuildSetting", Type, 18}, {"BuildSetting.Key", Field, 18}, {"BuildSetting.Value", Field, 18}, + {"CrashOptions", Type, 23}, {"FreeOSMemory", Func, 1}, {"GCStats", Type, 1}, {"GCStats.LastGC", Field, 1}, @@ -9672,6 +9741,7 @@ var PackageSymbols = map[string][]Symbol{ {"PrintStack", Func, 0}, {"ReadBuildInfo", Func, 12}, {"ReadGCStats", Func, 1}, + {"SetCrashOutput", Func, 23}, {"SetGCPercent", Func, 1}, {"SetMaxStack", Func, 2}, {"SetMaxThreads", Func, 2}, @@ -9742,10 +9812,15 @@ var PackageSymbols = map[string][]Symbol{ {"WithRegion", Func, 11}, }, "slices": { + {"All", Func, 23}, + {"AppendSeq", Func, 23}, + {"Backward", Func, 23}, {"BinarySearch", Func, 21}, {"BinarySearchFunc", Func, 21}, + {"Chunk", Func, 23}, {"Clip", Func, 21}, {"Clone", Func, 21}, + {"Collect", Func, 23}, {"Compact", Func, 21}, {"CompactFunc", Func, 21}, {"Compare", Func, 21}, @@ -9767,11 +9842,16 @@ var PackageSymbols = map[string][]Symbol{ {"MaxFunc", Func, 21}, {"Min", Func, 21}, {"MinFunc", Func, 21}, + {"Repeat", Func, 23}, {"Replace", Func, 21}, {"Reverse", Func, 21}, {"Sort", Func, 21}, {"SortFunc", Func, 21}, {"SortStableFunc", Func, 21}, + {"Sorted", Func, 23}, + {"SortedFunc", Func, 23}, + {"SortedStableFunc", Func, 23}, + {"Values", Func, 23}, }, "sort": { {"(Float64Slice).Len", Method, 0}, @@ -9936,10 +10016,14 @@ var PackageSymbols = map[string][]Symbol{ {"TrimSpace", Func, 0}, {"TrimSuffix", Func, 1}, }, + "structs": { + {"HostLayout", Type, 23}, + }, "sync": { {"(*Cond).Broadcast", Method, 0}, {"(*Cond).Signal", Method, 0}, {"(*Cond).Wait", Method, 0}, + {"(*Map).Clear", Method, 23}, {"(*Map).CompareAndDelete", Method, 20}, {"(*Map).CompareAndSwap", Method, 20}, {"(*Map).Delete", Method, 9}, @@ -9986,13 +10070,17 @@ var PackageSymbols = map[string][]Symbol{ {"(*Bool).Store", Method, 19}, {"(*Bool).Swap", Method, 19}, {"(*Int32).Add", Method, 19}, + {"(*Int32).And", Method, 23}, {"(*Int32).CompareAndSwap", Method, 19}, {"(*Int32).Load", Method, 19}, + {"(*Int32).Or", Method, 23}, {"(*Int32).Store", Method, 19}, {"(*Int32).Swap", Method, 19}, {"(*Int64).Add", Method, 19}, + {"(*Int64).And", Method, 23}, {"(*Int64).CompareAndSwap", Method, 19}, {"(*Int64).Load", Method, 19}, + {"(*Int64).Or", Method, 23}, {"(*Int64).Store", Method, 19}, {"(*Int64).Swap", Method, 19}, {"(*Pointer).CompareAndSwap", Method, 19}, @@ -10000,18 +10088,24 @@ var PackageSymbols = map[string][]Symbol{ {"(*Pointer).Store", Method, 19}, {"(*Pointer).Swap", Method, 19}, {"(*Uint32).Add", Method, 19}, + {"(*Uint32).And", Method, 23}, {"(*Uint32).CompareAndSwap", Method, 19}, {"(*Uint32).Load", Method, 19}, + {"(*Uint32).Or", Method, 23}, {"(*Uint32).Store", Method, 19}, {"(*Uint32).Swap", Method, 19}, {"(*Uint64).Add", Method, 19}, + {"(*Uint64).And", Method, 23}, {"(*Uint64).CompareAndSwap", Method, 19}, {"(*Uint64).Load", Method, 19}, + {"(*Uint64).Or", Method, 23}, {"(*Uint64).Store", Method, 19}, {"(*Uint64).Swap", Method, 19}, {"(*Uintptr).Add", Method, 19}, + {"(*Uintptr).And", Method, 23}, {"(*Uintptr).CompareAndSwap", Method, 19}, {"(*Uintptr).Load", Method, 19}, + {"(*Uintptr).Or", Method, 23}, {"(*Uintptr).Store", Method, 19}, {"(*Uintptr).Swap", Method, 19}, {"(*Value).CompareAndSwap", Method, 17}, @@ -10023,6 +10117,11 @@ var PackageSymbols = map[string][]Symbol{ {"AddUint32", Func, 0}, {"AddUint64", Func, 0}, {"AddUintptr", Func, 0}, + {"AndInt32", Func, 23}, + {"AndInt64", Func, 23}, + {"AndUint32", Func, 23}, + {"AndUint64", Func, 23}, + {"AndUintptr", Func, 23}, {"Bool", Type, 19}, {"CompareAndSwapInt32", Func, 0}, {"CompareAndSwapInt64", Func, 0}, @@ -10038,6 +10137,11 @@ var PackageSymbols = map[string][]Symbol{ {"LoadUint32", Func, 0}, {"LoadUint64", Func, 0}, {"LoadUintptr", Func, 0}, + {"OrInt32", Func, 23}, + {"OrInt64", Func, 23}, + {"OrUint32", Func, 23}, + {"OrUint64", Func, 23}, + {"OrUintptr", Func, 23}, {"Pointer", Type, 19}, {"StoreInt32", Func, 0}, {"StoreInt64", Func, 0}, @@ -16200,6 +16304,7 @@ var PackageSymbols = map[string][]Symbol{ {"WSAEACCES", Const, 2}, {"WSAECONNABORTED", Const, 9}, {"WSAECONNRESET", Const, 3}, + {"WSAENOPROTOOPT", Const, 23}, {"WSAEnumProtocols", Func, 2}, {"WSAID_CONNECTEX", Var, 1}, {"WSAIoctl", Func, 0}, @@ -17284,6 +17389,7 @@ var PackageSymbols = map[string][]Symbol{ {"Encode", Func, 0}, {"EncodeRune", Func, 0}, {"IsSurrogate", Func, 0}, + {"RuneLen", Func, 23}, }, "unicode/utf8": { {"AppendRune", Func, 18}, @@ -17306,6 +17412,11 @@ var PackageSymbols = map[string][]Symbol{ {"ValidRune", Func, 1}, {"ValidString", Func, 0}, }, + "unique": { + {"(Handle).Value", Method, 23}, + {"Handle", Type, 23}, + {"Make", Func, 23}, + }, "unsafe": { {"Add", Func, 0}, {"Alignof", Func, 0}, diff --git a/vendor/golang.org/x/tools/internal/typesinternal/types.go b/vendor/golang.org/x/tools/internal/typesinternal/types.go index 7c77c2fbc03..83923286120 100644 --- a/vendor/golang.org/x/tools/internal/typesinternal/types.go +++ b/vendor/golang.org/x/tools/internal/typesinternal/types.go @@ -48,3 +48,18 @@ func ReadGo116ErrorData(err types.Error) (code ErrorCode, start, end token.Pos, } return ErrorCode(data[0]), token.Pos(data[1]), token.Pos(data[2]), true } + +// NameRelativeTo returns a types.Qualifier that qualifies members of +// all packages other than pkg, using only the package name. +// (By contrast, [types.RelativeTo] uses the complete package path, +// which is often excessive.) +// +// If pkg is nil, it is equivalent to [*types.Package.Name]. +func NameRelativeTo(pkg *types.Package) types.Qualifier { + return func(other *types.Package) string { + if pkg != nil && pkg == other { + return "" // same package; unqualified + } + return other.Name() + } +} diff --git a/vendor/golang.org/x/tools/internal/versions/constraint.go b/vendor/golang.org/x/tools/internal/versions/constraint.go new file mode 100644 index 00000000000..179063d4848 --- /dev/null +++ b/vendor/golang.org/x/tools/internal/versions/constraint.go @@ -0,0 +1,13 @@ +// Copyright 2024 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package versions + +import "go/build/constraint" + +// ConstraintGoVersion is constraint.GoVersion (if built with go1.21+). +// Otherwise nil. +// +// Deprecate once x/tools is after go1.21. +var ConstraintGoVersion func(x constraint.Expr) string diff --git a/vendor/golang.org/x/tools/internal/versions/constraint_go121.go b/vendor/golang.org/x/tools/internal/versions/constraint_go121.go new file mode 100644 index 00000000000..38011407d5f --- /dev/null +++ b/vendor/golang.org/x/tools/internal/versions/constraint_go121.go @@ -0,0 +1,14 @@ +// Copyright 2024 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build go1.21 +// +build go1.21 + +package versions + +import "go/build/constraint" + +func init() { + ConstraintGoVersion = constraint.GoVersion +} diff --git a/vendor/golang.org/x/tools/internal/versions/types_go122.go b/vendor/golang.org/x/tools/internal/versions/types_go122.go index e8180632a52..aac5db62c98 100644 --- a/vendor/golang.org/x/tools/internal/versions/types_go122.go +++ b/vendor/golang.org/x/tools/internal/versions/types_go122.go @@ -12,7 +12,7 @@ import ( "go/types" ) -// FileVersions returns a file's Go version. +// FileVersion returns a file's Go version. // The reported version is an unknown Future version if a // version cannot be determined. func FileVersion(info *types.Info, file *ast.File) string { diff --git a/vendor/google.golang.org/grpc/MAINTAINERS.md b/vendor/google.golang.org/grpc/MAINTAINERS.md index 6a8a07781ae..5d4096d46a0 100644 --- a/vendor/google.golang.org/grpc/MAINTAINERS.md +++ b/vendor/google.golang.org/grpc/MAINTAINERS.md @@ -9,21 +9,28 @@ for general contribution guidelines. ## Maintainers (in alphabetical order) +- [aranjans](https://github.com/aranjans), Google LLC +- [arjan-bal](https://github.com/arjan-bal), Google LLC +- [arvindbr8](https://github.com/arvindbr8), Google LLC - [atollena](https://github.com/atollena), Datadog, Inc. -- [cesarghali](https://github.com/cesarghali), Google LLC - [dfawley](https://github.com/dfawley), Google LLC - [easwars](https://github.com/easwars), Google LLC -- [menghanl](https://github.com/menghanl), Google LLC -- [srini100](https://github.com/srini100), Google LLC +- [erm-g](https://github.com/erm-g), Google LLC +- [gtcooke94](https://github.com/gtcooke94), Google LLC +- [purnesh42h](https://github.com/purnesh42h), Google LLC +- [zasweq](https://github.com/zasweq), Google LLC ## Emeritus Maintainers (in alphabetical order) -- [adelez](https://github.com/adelez), Google LLC -- [canguler](https://github.com/canguler), Google LLC -- [iamqizhao](https://github.com/iamqizhao), Google LLC -- [jadekler](https://github.com/jadekler), Google LLC -- [jtattermusch](https://github.com/jtattermusch), Google LLC -- [lyuxuan](https://github.com/lyuxuan), Google LLC -- [makmukhi](https://github.com/makmukhi), Google LLC -- [matt-kwong](https://github.com/matt-kwong), Google LLC -- [nicolasnoble](https://github.com/nicolasnoble), Google LLC -- [yongni](https://github.com/yongni), Google LLC +- [adelez](https://github.com/adelez) +- [canguler](https://github.com/canguler) +- [cesarghali](https://github.com/cesarghali) +- [iamqizhao](https://github.com/iamqizhao) +- [jeanbza](https://github.com/jeanbza) +- [jtattermusch](https://github.com/jtattermusch) +- [lyuxuan](https://github.com/lyuxuan) +- [makmukhi](https://github.com/makmukhi) +- [matt-kwong](https://github.com/matt-kwong) +- [menghanl](https://github.com/menghanl) +- [nicolasnoble](https://github.com/nicolasnoble) +- [srini100](https://github.com/srini100) +- [yongni](https://github.com/yongni) diff --git a/vendor/google.golang.org/grpc/SECURITY.md b/vendor/google.golang.org/grpc/SECURITY.md index be6e108705c..abab279379b 100644 --- a/vendor/google.golang.org/grpc/SECURITY.md +++ b/vendor/google.golang.org/grpc/SECURITY.md @@ -1,3 +1,3 @@ # Security Policy -For information on gRPC Security Policy and reporting potentional security issues, please see [gRPC CVE Process](https://github.com/grpc/proposal/blob/master/P4-grpc-cve-process.md). +For information on gRPC Security Policy and reporting potential security issues, please see [gRPC CVE Process](https://github.com/grpc/proposal/blob/master/P4-grpc-cve-process.md). diff --git a/vendor/google.golang.org/grpc/backoff/backoff.go b/vendor/google.golang.org/grpc/backoff/backoff.go index 0787d0b50ce..d7b40b7cb66 100644 --- a/vendor/google.golang.org/grpc/backoff/backoff.go +++ b/vendor/google.golang.org/grpc/backoff/backoff.go @@ -39,7 +39,7 @@ type Config struct { MaxDelay time.Duration } -// DefaultConfig is a backoff configuration with the default values specfied +// DefaultConfig is a backoff configuration with the default values specified // at https://github.com/grpc/grpc/blob/master/doc/connection-backoff.md. // // This should be useful for callers who want to configure backoff with diff --git a/vendor/google.golang.org/grpc/balancer/balancer.go b/vendor/google.golang.org/grpc/balancer/balancer.go index f391744f729..b181f386a1b 100644 --- a/vendor/google.golang.org/grpc/balancer/balancer.go +++ b/vendor/google.golang.org/grpc/balancer/balancer.go @@ -30,6 +30,7 @@ import ( "google.golang.org/grpc/channelz" "google.golang.org/grpc/connectivity" "google.golang.org/grpc/credentials" + estats "google.golang.org/grpc/experimental/stats" "google.golang.org/grpc/grpclog" "google.golang.org/grpc/internal" "google.golang.org/grpc/metadata" @@ -72,8 +73,21 @@ func unregisterForTesting(name string) { delete(m, name) } +// connectedAddress returns the connected address for a SubConnState. The +// address is only valid if the state is READY. +func connectedAddress(scs SubConnState) resolver.Address { + return scs.connectedAddress +} + +// setConnectedAddress sets the connected address for a SubConnState. +func setConnectedAddress(scs *SubConnState, addr resolver.Address) { + scs.connectedAddress = addr +} + func init() { internal.BalancerUnregister = unregisterForTesting + internal.ConnectedAddress = connectedAddress + internal.SetConnectedAddress = setConnectedAddress } // Get returns the resolver builder registered with the given name. @@ -243,6 +257,10 @@ type BuildOptions struct { // same resolver.Target as passed to the resolver. See the documentation for // the resolver.Target type for details about what it contains. Target resolver.Target + // MetricsRecorder is the metrics recorder that balancers can use to record + // metrics. Balancer implementations which do not register metrics on + // metrics registry and record on them can ignore this field. + MetricsRecorder estats.MetricsRecorder } // Builder creates a balancer. @@ -410,6 +428,9 @@ type SubConnState struct { // ConnectionError is set if the ConnectivityState is TransientFailure, // describing the reason the SubConn failed. Otherwise, it is nil. ConnectionError error + // connectedAddr contains the connected address when ConnectivityState is + // Ready. Otherwise, it is indeterminate. + connectedAddress resolver.Address } // ClientConnState describes the state of a ClientConn relevant to the diff --git a/vendor/google.golang.org/grpc/balancer/pickfirst/pickfirst.go b/vendor/google.golang.org/grpc/balancer/pickfirst/pickfirst.go index 07527603f1d..5b592f48ad9 100644 --- a/vendor/google.golang.org/grpc/balancer/pickfirst/pickfirst.go +++ b/vendor/google.golang.org/grpc/balancer/pickfirst/pickfirst.go @@ -155,7 +155,7 @@ func (b *pickfirstBalancer) UpdateClientConnState(state balancer.ClientConnState // Endpoints not set, process addresses until we migrate resolver // emissions fully to Endpoints. The top channel does wrap emitted // addresses with endpoints, however some balancers such as weighted - // target do not forwarrd the corresponding correct endpoints down/split + // target do not forward the corresponding correct endpoints down/split // endpoints properly. Once all balancers correctly forward endpoints // down, can delete this else conditional. addrs = state.ResolverState.Addresses diff --git a/vendor/google.golang.org/grpc/balancer_wrapper.go b/vendor/google.golang.org/grpc/balancer_wrapper.go index 4161fdf47a8..6561b769ebf 100644 --- a/vendor/google.golang.org/grpc/balancer_wrapper.go +++ b/vendor/google.golang.org/grpc/balancer_wrapper.go @@ -25,12 +25,15 @@ import ( "google.golang.org/grpc/balancer" "google.golang.org/grpc/connectivity" + "google.golang.org/grpc/internal" "google.golang.org/grpc/internal/balancer/gracefulswitch" "google.golang.org/grpc/internal/channelz" "google.golang.org/grpc/internal/grpcsync" "google.golang.org/grpc/resolver" ) +var setConnectedAddress = internal.SetConnectedAddress.(func(*balancer.SubConnState, resolver.Address)) + // ccBalancerWrapper sits between the ClientConn and the Balancer. // // ccBalancerWrapper implements methods corresponding to the ones on the @@ -79,6 +82,7 @@ func newCCBalancerWrapper(cc *ClientConn) *ccBalancerWrapper { CustomUserAgent: cc.dopts.copts.UserAgent, ChannelzParent: cc.channelz, Target: cc.parsedTarget, + MetricsRecorder: cc.metricsRecorderList, }, serializer: grpcsync.NewCallbackSerializer(ctx), serializerCancel: cancel, @@ -92,7 +96,7 @@ func newCCBalancerWrapper(cc *ClientConn) *ccBalancerWrapper { // it is safe to call into the balancer here. func (ccb *ccBalancerWrapper) updateClientConnState(ccs *balancer.ClientConnState) error { errCh := make(chan error) - ok := ccb.serializer.Schedule(func(ctx context.Context) { + uccs := func(ctx context.Context) { defer close(errCh) if ctx.Err() != nil || ccb.balancer == nil { return @@ -107,17 +111,23 @@ func (ccb *ccBalancerWrapper) updateClientConnState(ccs *balancer.ClientConnStat logger.Infof("error from balancer.UpdateClientConnState: %v", err) } errCh <- err - }) - if !ok { - return nil } + onFailure := func() { close(errCh) } + + // UpdateClientConnState can race with Close, and when the latter wins, the + // serializer is closed, and the attempt to schedule the callback will fail. + // It is acceptable to ignore this failure. But since we want to handle the + // state update in a blocking fashion (when we successfully schedule the + // callback), we have to use the ScheduleOr method and not the MaybeSchedule + // method on the serializer. + ccb.serializer.ScheduleOr(uccs, onFailure) return <-errCh } // resolverError is invoked by grpc to push a resolver error to the underlying // balancer. The call to the balancer is executed from the serializer. func (ccb *ccBalancerWrapper) resolverError(err error) { - ccb.serializer.Schedule(func(ctx context.Context) { + ccb.serializer.TrySchedule(func(ctx context.Context) { if ctx.Err() != nil || ccb.balancer == nil { return } @@ -133,7 +143,7 @@ func (ccb *ccBalancerWrapper) close() { ccb.closed = true ccb.mu.Unlock() channelz.Info(logger, ccb.cc.channelz, "ccBalancerWrapper: closing") - ccb.serializer.Schedule(func(context.Context) { + ccb.serializer.TrySchedule(func(context.Context) { if ccb.balancer == nil { return } @@ -145,7 +155,7 @@ func (ccb *ccBalancerWrapper) close() { // exitIdle invokes the balancer's exitIdle method in the serializer. func (ccb *ccBalancerWrapper) exitIdle() { - ccb.serializer.Schedule(func(ctx context.Context) { + ccb.serializer.TrySchedule(func(ctx context.Context) { if ctx.Err() != nil || ccb.balancer == nil { return } @@ -252,15 +262,29 @@ type acBalancerWrapper struct { // updateState is invoked by grpc to push a subConn state update to the // underlying balancer. -func (acbw *acBalancerWrapper) updateState(s connectivity.State, err error) { - acbw.ccb.serializer.Schedule(func(ctx context.Context) { +func (acbw *acBalancerWrapper) updateState(s connectivity.State, curAddr resolver.Address, err error) { + acbw.ccb.serializer.TrySchedule(func(ctx context.Context) { if ctx.Err() != nil || acbw.ccb.balancer == nil { return } // Even though it is optional for balancers, gracefulswitch ensures // opts.StateListener is set, so this cannot ever be nil. // TODO: delete this comment when UpdateSubConnState is removed. - acbw.stateListener(balancer.SubConnState{ConnectivityState: s, ConnectionError: err}) + scs := balancer.SubConnState{ConnectivityState: s, ConnectionError: err} + if s == connectivity.Ready { + setConnectedAddress(&scs, curAddr) + } + acbw.stateListener(scs) + acbw.ac.mu.Lock() + defer acbw.ac.mu.Unlock() + if s == connectivity.Ready { + // When changing states to READY, reset stateReadyChan. Wait until + // after we notify the LB policy's listener(s) in order to prevent + // ac.getTransport() from unblocking before the LB policy starts + // tracking the subchannel as READY. + close(acbw.ac.stateReadyChan) + acbw.ac.stateReadyChan = make(chan struct{}) + } }) } diff --git a/vendor/google.golang.org/grpc/binarylog/grpc_binarylog_v1/binarylog.pb.go b/vendor/google.golang.org/grpc/binarylog/grpc_binarylog_v1/binarylog.pb.go index 63c639e4fe9..fcd1cfe8024 100644 --- a/vendor/google.golang.org/grpc/binarylog/grpc_binarylog_v1/binarylog.pb.go +++ b/vendor/google.golang.org/grpc/binarylog/grpc_binarylog_v1/binarylog.pb.go @@ -19,7 +19,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.34.1 -// protoc v4.25.2 +// protoc v5.27.1 // source: grpc/binlog/v1/binarylog.proto package grpc_binarylog_v1 diff --git a/vendor/google.golang.org/grpc/clientconn.go b/vendor/google.golang.org/grpc/clientconn.go index 423be7b43b0..9c8850e3fdd 100644 --- a/vendor/google.golang.org/grpc/clientconn.go +++ b/vendor/google.golang.org/grpc/clientconn.go @@ -24,6 +24,7 @@ import ( "fmt" "math" "net/url" + "slices" "strings" "sync" "sync/atomic" @@ -39,6 +40,7 @@ import ( "google.golang.org/grpc/internal/grpcsync" "google.golang.org/grpc/internal/idle" iresolver "google.golang.org/grpc/internal/resolver" + "google.golang.org/grpc/internal/stats" "google.golang.org/grpc/internal/transport" "google.golang.org/grpc/keepalive" "google.golang.org/grpc/resolver" @@ -194,8 +196,11 @@ func NewClient(target string, opts ...DialOption) (conn *ClientConn, err error) cc.csMgr = newConnectivityStateManager(cc.ctx, cc.channelz) cc.pickerWrapper = newPickerWrapper(cc.dopts.copts.StatsHandlers) + cc.metricsRecorderList = stats.NewMetricsRecorderList(cc.dopts.copts.StatsHandlers) + cc.initIdleStateLocked() // Safe to call without the lock, since nothing else has a reference to cc. cc.idlenessMgr = idle.NewManager((*idler)(cc), cc.dopts.idleTimeout) + return cc, nil } @@ -590,13 +595,14 @@ type ClientConn struct { cancel context.CancelFunc // Cancelled on close. // The following are initialized at dial time, and are read-only after that. - target string // User's dial target. - parsedTarget resolver.Target // See initParsedTargetAndResolverBuilder(). - authority string // See initAuthority(). - dopts dialOptions // Default and user specified dial options. - channelz *channelz.Channel // Channelz object. - resolverBuilder resolver.Builder // See initParsedTargetAndResolverBuilder(). - idlenessMgr *idle.Manager + target string // User's dial target. + parsedTarget resolver.Target // See initParsedTargetAndResolverBuilder(). + authority string // See initAuthority(). + dopts dialOptions // Default and user specified dial options. + channelz *channelz.Channel // Channelz object. + resolverBuilder resolver.Builder // See initParsedTargetAndResolverBuilder(). + idlenessMgr *idle.Manager + metricsRecorderList *stats.MetricsRecorderList // The following provide their own synchronization, and therefore don't // require cc.mu to be held to access them. @@ -626,11 +632,6 @@ type ClientConn struct { // WaitForStateChange waits until the connectivity.State of ClientConn changes from sourceState or // ctx expires. A true value is returned in former case and false in latter. -// -// # Experimental -// -// Notice: This API is EXPERIMENTAL and may be changed or removed in a -// later release. func (cc *ClientConn) WaitForStateChange(ctx context.Context, sourceState connectivity.State) bool { ch := cc.csMgr.getNotifyChan() if cc.csMgr.getState() != sourceState { @@ -645,11 +646,6 @@ func (cc *ClientConn) WaitForStateChange(ctx context.Context, sourceState connec } // GetState returns the connectivity.State of ClientConn. -// -// # Experimental -// -// Notice: This API is EXPERIMENTAL and may be changed or removed in a later -// release. func (cc *ClientConn) GetState() connectivity.State { return cc.csMgr.getState() } @@ -812,17 +808,11 @@ func (cc *ClientConn) applyFailingLBLocked(sc *serviceconfig.ParseResult) { cc.csMgr.updateState(connectivity.TransientFailure) } -// Makes a copy of the input addresses slice and clears out the balancer -// attributes field. Addresses are passed during subconn creation and address -// update operations. In both cases, we will clear the balancer attributes by -// calling this function, and therefore we will be able to use the Equal method -// provided by the resolver.Address type for comparison. -func copyAddressesWithoutBalancerAttributes(in []resolver.Address) []resolver.Address { +// Makes a copy of the input addresses slice. Addresses are passed during +// subconn creation and address update operations. +func copyAddresses(in []resolver.Address) []resolver.Address { out := make([]resolver.Address, len(in)) - for i := range in { - out[i] = in[i] - out[i].BalancerAttributes = nil - } + copy(out, in) return out } @@ -835,14 +825,14 @@ func (cc *ClientConn) newAddrConnLocked(addrs []resolver.Address, opts balancer. } ac := &addrConn{ - state: connectivity.Idle, - cc: cc, - addrs: copyAddressesWithoutBalancerAttributes(addrs), - scopts: opts, - dopts: cc.dopts, - channelz: channelz.RegisterSubChannel(cc.channelz, ""), - resetBackoff: make(chan struct{}), - stateChan: make(chan struct{}), + state: connectivity.Idle, + cc: cc, + addrs: copyAddresses(addrs), + scopts: opts, + dopts: cc.dopts, + channelz: channelz.RegisterSubChannel(cc.channelz, ""), + resetBackoff: make(chan struct{}), + stateReadyChan: make(chan struct{}), } ac.ctx, ac.cancel = context.WithCancel(cc.ctx) // Start with our address set to the first address; this may be updated if @@ -918,28 +908,29 @@ func (ac *addrConn) connect() error { ac.mu.Unlock() return nil } - ac.mu.Unlock() - ac.resetTransport() + ac.resetTransportAndUnlock() return nil } -func equalAddresses(a, b []resolver.Address) bool { - if len(a) != len(b) { - return false - } - for i, v := range a { - if !v.Equal(b[i]) { - return false - } - } - return true +// equalAddressIgnoringBalAttributes returns true is a and b are considered equal. +// This is different from the Equal method on the resolver.Address type which +// considers all fields to determine equality. Here, we only consider fields +// that are meaningful to the subConn. +func equalAddressIgnoringBalAttributes(a, b *resolver.Address) bool { + return a.Addr == b.Addr && a.ServerName == b.ServerName && + a.Attributes.Equal(b.Attributes) && + a.Metadata == b.Metadata +} + +func equalAddressesIgnoringBalAttributes(a, b []resolver.Address) bool { + return slices.EqualFunc(a, b, func(a, b resolver.Address) bool { return equalAddressIgnoringBalAttributes(&a, &b) }) } // updateAddrs updates ac.addrs with the new addresses list and handles active // connections or connection attempts. func (ac *addrConn) updateAddrs(addrs []resolver.Address) { - addrs = copyAddressesWithoutBalancerAttributes(addrs) + addrs = copyAddresses(addrs) limit := len(addrs) if limit > 5 { limit = 5 @@ -947,7 +938,7 @@ func (ac *addrConn) updateAddrs(addrs []resolver.Address) { channelz.Infof(logger, ac.channelz, "addrConn: updateAddrs addrs (%d of %d): %v", limit, len(addrs), addrs[:limit]) ac.mu.Lock() - if equalAddresses(ac.addrs, addrs) { + if equalAddressesIgnoringBalAttributes(ac.addrs, addrs) { ac.mu.Unlock() return } @@ -966,7 +957,7 @@ func (ac *addrConn) updateAddrs(addrs []resolver.Address) { // Try to find the connected address. for _, a := range addrs { a.ServerName = ac.cc.getServerName(a) - if a.Equal(ac.curAddr) { + if equalAddressIgnoringBalAttributes(&a, &ac.curAddr) { // We are connected to a valid address, so do nothing but // update the addresses. ac.mu.Unlock() @@ -992,11 +983,9 @@ func (ac *addrConn) updateAddrs(addrs []resolver.Address) { ac.updateConnectivityState(connectivity.Idle, nil) } - ac.mu.Unlock() - // Since we were connecting/connected, we should start a new connection // attempt. - go ac.resetTransport() + go ac.resetTransportAndUnlock() } // getServerName determines the serverName to be used in the connection @@ -1190,8 +1179,8 @@ type addrConn struct { addrs []resolver.Address // All addresses that the resolver resolved to. // Use updateConnectivityState for updating addrConn's connectivity state. - state connectivity.State - stateChan chan struct{} // closed and recreated on every state change. + state connectivity.State + stateReadyChan chan struct{} // closed and recreated on every READY state change. backoffIdx int // Needs to be stateful for resetConnectBackoff. resetBackoff chan struct{} @@ -1204,9 +1193,6 @@ func (ac *addrConn) updateConnectivityState(s connectivity.State, lastErr error) if ac.state == s { return } - // When changing states, reset the state change channel. - close(ac.stateChan) - ac.stateChan = make(chan struct{}) ac.state = s ac.channelz.ChannelMetrics.State.Store(&s) if lastErr == nil { @@ -1214,7 +1200,7 @@ func (ac *addrConn) updateConnectivityState(s connectivity.State, lastErr error) } else { channelz.Infof(logger, ac.channelz, "Subchannel Connectivity change to %v, last error: %s", s, lastErr) } - ac.acbw.updateState(s, lastErr) + ac.acbw.updateState(s, ac.curAddr, lastErr) } // adjustParams updates parameters used to create transports upon @@ -1231,8 +1217,10 @@ func (ac *addrConn) adjustParams(r transport.GoAwayReason) { } } -func (ac *addrConn) resetTransport() { - ac.mu.Lock() +// resetTransportAndUnlock unconditionally connects the addrConn. +// +// ac.mu must be held by the caller, and this function will guarantee it is released. +func (ac *addrConn) resetTransportAndUnlock() { acCtx := ac.ctx if acCtx.Err() != nil { ac.mu.Unlock() @@ -1522,7 +1510,7 @@ func (ac *addrConn) getReadyTransport() transport.ClientTransport { func (ac *addrConn) getTransport(ctx context.Context) (transport.ClientTransport, error) { for ctx.Err() == nil { ac.mu.Lock() - t, state, sc := ac.transport, ac.state, ac.stateChan + t, state, sc := ac.transport, ac.state, ac.stateReadyChan ac.mu.Unlock() if state == connectivity.Ready { return t, nil @@ -1585,7 +1573,7 @@ func (ac *addrConn) tearDown(err error) { } else { // Hard close the transport when the channel is entering idle or is // being shutdown. In the case where the channel is being shutdown, - // closing of transports is also taken care of by cancelation of cc.ctx. + // closing of transports is also taken care of by cancellation of cc.ctx. // But in the case where the channel is entering idle, we need to // explicitly close the transports here. Instead of distinguishing // between these two cases, it is simpler to close the transport diff --git a/vendor/google.golang.org/grpc/codec.go b/vendor/google.golang.org/grpc/codec.go index 411e3dfd47c..e840858b77b 100644 --- a/vendor/google.golang.org/grpc/codec.go +++ b/vendor/google.golang.org/grpc/codec.go @@ -21,18 +21,73 @@ package grpc import ( "google.golang.org/grpc/encoding" _ "google.golang.org/grpc/encoding/proto" // to register the Codec for "proto" + "google.golang.org/grpc/mem" ) -// baseCodec contains the functionality of both Codec and encoding.Codec, but -// omits the name/string, which vary between the two and are not needed for -// anything besides the registry in the encoding package. +// baseCodec captures the new encoding.CodecV2 interface without the Name +// function, allowing it to be implemented by older Codec and encoding.Codec +// implementations. The omitted Name function is only needed for the register in +// the encoding package and is not part of the core functionality. type baseCodec interface { - Marshal(v any) ([]byte, error) - Unmarshal(data []byte, v any) error + Marshal(v any) (mem.BufferSlice, error) + Unmarshal(data mem.BufferSlice, v any) error +} + +// getCodec returns an encoding.CodecV2 for the codec of the given name (if +// registered). Initially checks the V2 registry with encoding.GetCodecV2 and +// returns the V2 codec if it is registered. Otherwise, it checks the V1 registry +// with encoding.GetCodec and if it is registered wraps it with newCodecV1Bridge +// to turn it into an encoding.CodecV2. Returns nil otherwise. +func getCodec(name string) encoding.CodecV2 { + if codecV1 := encoding.GetCodec(name); codecV1 != nil { + return newCodecV1Bridge(codecV1) + } + + return encoding.GetCodecV2(name) +} + +func newCodecV0Bridge(c Codec) baseCodec { + return codecV0Bridge{codec: c} +} + +func newCodecV1Bridge(c encoding.Codec) encoding.CodecV2 { + return codecV1Bridge{ + codecV0Bridge: codecV0Bridge{codec: c}, + name: c.Name(), + } +} + +var _ baseCodec = codecV0Bridge{} + +type codecV0Bridge struct { + codec interface { + Marshal(v any) ([]byte, error) + Unmarshal(data []byte, v any) error + } +} + +func (c codecV0Bridge) Marshal(v any) (mem.BufferSlice, error) { + data, err := c.codec.Marshal(v) + if err != nil { + return nil, err + } + return mem.BufferSlice{mem.NewBuffer(&data, nil)}, nil +} + +func (c codecV0Bridge) Unmarshal(data mem.BufferSlice, v any) (err error) { + return c.codec.Unmarshal(data.Materialize(), v) } -var _ baseCodec = Codec(nil) -var _ baseCodec = encoding.Codec(nil) +var _ encoding.CodecV2 = codecV1Bridge{} + +type codecV1Bridge struct { + codecV0Bridge + name string +} + +func (c codecV1Bridge) Name() string { + return c.name +} // Codec defines the interface gRPC uses to encode and decode messages. // Note that implementations of this interface must be thread safe; diff --git a/vendor/google.golang.org/grpc/dialoptions.go b/vendor/google.golang.org/grpc/dialoptions.go index f5453d48a53..27c1b9bb63f 100644 --- a/vendor/google.golang.org/grpc/dialoptions.go +++ b/vendor/google.golang.org/grpc/dialoptions.go @@ -33,6 +33,7 @@ import ( "google.golang.org/grpc/internal/binarylog" "google.golang.org/grpc/internal/transport" "google.golang.org/grpc/keepalive" + "google.golang.org/grpc/mem" "google.golang.org/grpc/resolver" "google.golang.org/grpc/stats" ) @@ -60,7 +61,7 @@ func init() { internal.WithBinaryLogger = withBinaryLogger internal.JoinDialOptions = newJoinDialOption internal.DisableGlobalDialOptions = newDisableGlobalDialOptions - internal.WithRecvBufferPool = withRecvBufferPool + internal.WithBufferPool = withBufferPool } // dialOptions configure a Dial call. dialOptions are set by the DialOption @@ -92,7 +93,6 @@ type dialOptions struct { defaultServiceConfigRawJSON *string resolvers []resolver.Builder idleTimeout time.Duration - recvBufferPool SharedBufferPool defaultScheme string maxCallAttempts int } @@ -677,11 +677,11 @@ func defaultDialOptions() dialOptions { WriteBufferSize: defaultWriteBufSize, UseProxy: true, UserAgent: grpcUA, + BufferPool: mem.DefaultBufferPool(), }, bs: internalbackoff.DefaultExponential, healthCheckFunc: internal.HealthCheckFunc, idleTimeout: 30 * time.Minute, - recvBufferPool: nopBufferPool{}, defaultScheme: "dns", maxCallAttempts: defaultMaxCallAttempts, } @@ -758,25 +758,8 @@ func WithMaxCallAttempts(n int) DialOption { }) } -// WithRecvBufferPool returns a DialOption that configures the ClientConn -// to use the provided shared buffer pool for parsing incoming messages. Depending -// on the application's workload, this could result in reduced memory allocation. -// -// If you are unsure about how to implement a memory pool but want to utilize one, -// begin with grpc.NewSharedBufferPool. -// -// Note: The shared buffer pool feature will not be active if any of the following -// options are used: WithStatsHandler, EnableTracing, or binary logging. In such -// cases, the shared buffer pool will be ignored. -// -// Deprecated: use experimental.WithRecvBufferPool instead. Will be deleted in -// v1.60.0 or later. -func WithRecvBufferPool(bufferPool SharedBufferPool) DialOption { - return withRecvBufferPool(bufferPool) -} - -func withRecvBufferPool(bufferPool SharedBufferPool) DialOption { +func withBufferPool(bufferPool mem.BufferPool) DialOption { return newFuncDialOption(func(o *dialOptions) { - o.recvBufferPool = bufferPool + o.copts.BufferPool = bufferPool }) } diff --git a/vendor/google.golang.org/grpc/doc.go b/vendor/google.golang.org/grpc/doc.go index 0022859ad74..e7b532b6f80 100644 --- a/vendor/google.golang.org/grpc/doc.go +++ b/vendor/google.golang.org/grpc/doc.go @@ -16,7 +16,7 @@ * */ -//go:generate ./regenerate.sh +//go:generate ./scripts/regenerate.sh /* Package grpc implements an RPC system called gRPC. diff --git a/vendor/google.golang.org/grpc/encoding/encoding.go b/vendor/google.golang.org/grpc/encoding/encoding.go index 5ebf88d7147..11d0ae142c4 100644 --- a/vendor/google.golang.org/grpc/encoding/encoding.go +++ b/vendor/google.golang.org/grpc/encoding/encoding.go @@ -94,7 +94,7 @@ type Codec interface { Name() string } -var registeredCodecs = make(map[string]Codec) +var registeredCodecs = make(map[string]any) // RegisterCodec registers the provided Codec for use with all gRPC clients and // servers. @@ -126,5 +126,6 @@ func RegisterCodec(codec Codec) { // // The content-subtype is expected to be lowercase. func GetCodec(contentSubtype string) Codec { - return registeredCodecs[contentSubtype] + c, _ := registeredCodecs[contentSubtype].(Codec) + return c } diff --git a/vendor/google.golang.org/grpc/encoding/encoding_v2.go b/vendor/google.golang.org/grpc/encoding/encoding_v2.go new file mode 100644 index 00000000000..074c5e234a7 --- /dev/null +++ b/vendor/google.golang.org/grpc/encoding/encoding_v2.go @@ -0,0 +1,81 @@ +/* + * + * Copyright 2024 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package encoding + +import ( + "strings" + + "google.golang.org/grpc/mem" +) + +// CodecV2 defines the interface gRPC uses to encode and decode messages. Note +// that implementations of this interface must be thread safe; a CodecV2's +// methods can be called from concurrent goroutines. +type CodecV2 interface { + // Marshal returns the wire format of v. The buffers in the returned + // [mem.BufferSlice] must have at least one reference each, which will be freed + // by gRPC when they are no longer needed. + Marshal(v any) (out mem.BufferSlice, err error) + // Unmarshal parses the wire format into v. Note that data will be freed as soon + // as this function returns. If the codec wishes to guarantee access to the data + // after this function, it must take its own reference that it frees when it is + // no longer needed. + Unmarshal(data mem.BufferSlice, v any) error + // Name returns the name of the Codec implementation. The returned string + // will be used as part of content type in transmission. The result must be + // static; the result cannot change between calls. + Name() string +} + +// RegisterCodecV2 registers the provided CodecV2 for use with all gRPC clients and +// servers. +// +// The CodecV2 will be stored and looked up by result of its Name() method, which +// should match the content-subtype of the encoding handled by the CodecV2. This +// is case-insensitive, and is stored and looked up as lowercase. If the +// result of calling Name() is an empty string, RegisterCodecV2 will panic. See +// Content-Type on +// https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md#requests for +// more details. +// +// If both a Codec and CodecV2 are registered with the same name, the CodecV2 +// will be used. +// +// NOTE: this function must only be called during initialization time (i.e. in +// an init() function), and is not thread-safe. If multiple Codecs are +// registered with the same name, the one registered last will take effect. +func RegisterCodecV2(codec CodecV2) { + if codec == nil { + panic("cannot register a nil CodecV2") + } + if codec.Name() == "" { + panic("cannot register CodecV2 with empty string result for Name()") + } + contentSubtype := strings.ToLower(codec.Name()) + registeredCodecs[contentSubtype] = codec +} + +// GetCodecV2 gets a registered CodecV2 by content-subtype, or nil if no CodecV2 is +// registered for the content-subtype. +// +// The content-subtype is expected to be lowercase. +func GetCodecV2(contentSubtype string) CodecV2 { + c, _ := registeredCodecs[contentSubtype].(CodecV2) + return c +} diff --git a/vendor/google.golang.org/grpc/encoding/proto/proto.go b/vendor/google.golang.org/grpc/encoding/proto/proto.go index 66d5cdf03ec..ceec319dd2f 100644 --- a/vendor/google.golang.org/grpc/encoding/proto/proto.go +++ b/vendor/google.golang.org/grpc/encoding/proto/proto.go @@ -1,6 +1,6 @@ /* * - * Copyright 2018 gRPC authors. + * Copyright 2024 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,6 +24,7 @@ import ( "fmt" "google.golang.org/grpc/encoding" + "google.golang.org/grpc/mem" "google.golang.org/protobuf/proto" "google.golang.org/protobuf/protoadapt" ) @@ -32,28 +33,51 @@ import ( const Name = "proto" func init() { - encoding.RegisterCodec(codec{}) + encoding.RegisterCodecV2(&codecV2{}) } -// codec is a Codec implementation with protobuf. It is the default codec for gRPC. -type codec struct{} +// codec is a CodecV2 implementation with protobuf. It is the default codec for +// gRPC. +type codecV2 struct{} -func (codec) Marshal(v any) ([]byte, error) { +func (c *codecV2) Marshal(v any) (data mem.BufferSlice, err error) { vv := messageV2Of(v) if vv == nil { - return nil, fmt.Errorf("failed to marshal, message is %T, want proto.Message", v) + return nil, fmt.Errorf("proto: failed to marshal, message is %T, want proto.Message", v) } - return proto.Marshal(vv) + size := proto.Size(vv) + if mem.IsBelowBufferPoolingThreshold(size) { + buf, err := proto.Marshal(vv) + if err != nil { + return nil, err + } + data = append(data, mem.SliceBuffer(buf)) + } else { + pool := mem.DefaultBufferPool() + buf := pool.Get(size) + if _, err := (proto.MarshalOptions{}).MarshalAppend((*buf)[:0], vv); err != nil { + pool.Put(buf) + return nil, err + } + data = append(data, mem.NewBuffer(buf, pool)) + } + + return data, nil } -func (codec) Unmarshal(data []byte, v any) error { +func (c *codecV2) Unmarshal(data mem.BufferSlice, v any) (err error) { vv := messageV2Of(v) if vv == nil { return fmt.Errorf("failed to unmarshal, message is %T, want proto.Message", v) } - return proto.Unmarshal(data, vv) + buf := data.MaterializeToBuffer(mem.DefaultBufferPool()) + defer buf.Free() + // TODO: Upgrade proto.Unmarshal to support mem.BufferSlice. Right now, it's not + // really possible without a major overhaul of the proto package, but the + // vtprotobuf library may be able to support this. + return proto.Unmarshal(buf.ReadOnlyData(), vv) } func messageV2Of(v any) proto.Message { @@ -67,6 +91,6 @@ func messageV2Of(v any) proto.Message { return nil } -func (codec) Name() string { +func (c *codecV2) Name() string { return Name } diff --git a/vendor/google.golang.org/grpc/experimental/stats/metricregistry.go b/vendor/google.golang.org/grpc/experimental/stats/metricregistry.go new file mode 100644 index 00000000000..930140f57ed --- /dev/null +++ b/vendor/google.golang.org/grpc/experimental/stats/metricregistry.go @@ -0,0 +1,270 @@ +/* + * + * Copyright 2024 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package stats + +import ( + "maps" + "testing" + + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/internal" +) + +func init() { + internal.SnapshotMetricRegistryForTesting = snapshotMetricsRegistryForTesting +} + +var logger = grpclog.Component("metrics-registry") + +// DefaultMetrics are the default metrics registered through global metrics +// registry. This is written to at initialization time only, and is read only +// after initialization. +var DefaultMetrics = NewMetrics() + +// MetricDescriptor is the data for a registered metric. +type MetricDescriptor struct { + // The name of this metric. This name must be unique across the whole binary + // (including any per call metrics). See + // https://github.com/grpc/proposal/blob/master/A79-non-per-call-metrics-architecture.md#metric-instrument-naming-conventions + // for metric naming conventions. + Name Metric + // The description of this metric. + Description string + // The unit (e.g. entries, seconds) of this metric. + Unit string + // The required label keys for this metric. These are intended to + // metrics emitted from a stats handler. + Labels []string + // The optional label keys for this metric. These are intended to attached + // to metrics emitted from a stats handler if configured. + OptionalLabels []string + // Whether this metric is on by default. + Default bool + // The type of metric. This is set by the metric registry, and not intended + // to be set by a component registering a metric. + Type MetricType + // Bounds are the bounds of this metric. This only applies to histogram + // metrics. If unset or set with length 0, stats handlers will fall back to + // default bounds. + Bounds []float64 +} + +// MetricType is the type of metric. +type MetricType int + +// Type of metric supported by this instrument registry. +const ( + MetricTypeIntCount MetricType = iota + MetricTypeFloatCount + MetricTypeIntHisto + MetricTypeFloatHisto + MetricTypeIntGauge +) + +// Int64CountHandle is a typed handle for a int count metric. This handle +// is passed at the recording point in order to know which metric to record +// on. +type Int64CountHandle MetricDescriptor + +// Descriptor returns the int64 count handle typecast to a pointer to a +// MetricDescriptor. +func (h *Int64CountHandle) Descriptor() *MetricDescriptor { + return (*MetricDescriptor)(h) +} + +// Record records the int64 count value on the metrics recorder provided. +func (h *Int64CountHandle) Record(recorder MetricsRecorder, incr int64, labels ...string) { + recorder.RecordInt64Count(h, incr, labels...) +} + +// Float64CountHandle is a typed handle for a float count metric. This handle is +// passed at the recording point in order to know which metric to record on. +type Float64CountHandle MetricDescriptor + +// Descriptor returns the float64 count handle typecast to a pointer to a +// MetricDescriptor. +func (h *Float64CountHandle) Descriptor() *MetricDescriptor { + return (*MetricDescriptor)(h) +} + +// Record records the float64 count value on the metrics recorder provided. +func (h *Float64CountHandle) Record(recorder MetricsRecorder, incr float64, labels ...string) { + recorder.RecordFloat64Count(h, incr, labels...) +} + +// Int64HistoHandle is a typed handle for an int histogram metric. This handle +// is passed at the recording point in order to know which metric to record on. +type Int64HistoHandle MetricDescriptor + +// Descriptor returns the int64 histo handle typecast to a pointer to a +// MetricDescriptor. +func (h *Int64HistoHandle) Descriptor() *MetricDescriptor { + return (*MetricDescriptor)(h) +} + +// Record records the int64 histo value on the metrics recorder provided. +func (h *Int64HistoHandle) Record(recorder MetricsRecorder, incr int64, labels ...string) { + recorder.RecordInt64Histo(h, incr, labels...) +} + +// Float64HistoHandle is a typed handle for a float histogram metric. This +// handle is passed at the recording point in order to know which metric to +// record on. +type Float64HistoHandle MetricDescriptor + +// Descriptor returns the float64 histo handle typecast to a pointer to a +// MetricDescriptor. +func (h *Float64HistoHandle) Descriptor() *MetricDescriptor { + return (*MetricDescriptor)(h) +} + +// Record records the float64 histo value on the metrics recorder provided. +func (h *Float64HistoHandle) Record(recorder MetricsRecorder, incr float64, labels ...string) { + recorder.RecordFloat64Histo(h, incr, labels...) +} + +// Int64GaugeHandle is a typed handle for an int gauge metric. This handle is +// passed at the recording point in order to know which metric to record on. +type Int64GaugeHandle MetricDescriptor + +// Descriptor returns the int64 gauge handle typecast to a pointer to a +// MetricDescriptor. +func (h *Int64GaugeHandle) Descriptor() *MetricDescriptor { + return (*MetricDescriptor)(h) +} + +// Record records the int64 histo value on the metrics recorder provided. +func (h *Int64GaugeHandle) Record(recorder MetricsRecorder, incr int64, labels ...string) { + recorder.RecordInt64Gauge(h, incr, labels...) +} + +// registeredMetrics are the registered metric descriptor names. +var registeredMetrics = make(map[Metric]bool) + +// metricsRegistry contains all of the registered metrics. +// +// This is written to only at init time, and read only after that. +var metricsRegistry = make(map[Metric]*MetricDescriptor) + +// DescriptorForMetric returns the MetricDescriptor from the global registry. +// +// Returns nil if MetricDescriptor not present. +func DescriptorForMetric(metric Metric) *MetricDescriptor { + return metricsRegistry[metric] +} + +func registerMetric(name Metric, def bool) { + if registeredMetrics[name] { + logger.Fatalf("metric %v already registered", name) + } + registeredMetrics[name] = true + if def { + DefaultMetrics = DefaultMetrics.Add(name) + } +} + +// RegisterInt64Count registers the metric description onto the global registry. +// It returns a typed handle to use to recording data. +// +// NOTE: this function must only be called during initialization time (i.e. in +// an init() function), and is not thread-safe. If multiple metrics are +// registered with the same name, this function will panic. +func RegisterInt64Count(descriptor MetricDescriptor) *Int64CountHandle { + registerMetric(descriptor.Name, descriptor.Default) + descriptor.Type = MetricTypeIntCount + descPtr := &descriptor + metricsRegistry[descriptor.Name] = descPtr + return (*Int64CountHandle)(descPtr) +} + +// RegisterFloat64Count registers the metric description onto the global +// registry. It returns a typed handle to use to recording data. +// +// NOTE: this function must only be called during initialization time (i.e. in +// an init() function), and is not thread-safe. If multiple metrics are +// registered with the same name, this function will panic. +func RegisterFloat64Count(descriptor MetricDescriptor) *Float64CountHandle { + registerMetric(descriptor.Name, descriptor.Default) + descriptor.Type = MetricTypeFloatCount + descPtr := &descriptor + metricsRegistry[descriptor.Name] = descPtr + return (*Float64CountHandle)(descPtr) +} + +// RegisterInt64Histo registers the metric description onto the global registry. +// It returns a typed handle to use to recording data. +// +// NOTE: this function must only be called during initialization time (i.e. in +// an init() function), and is not thread-safe. If multiple metrics are +// registered with the same name, this function will panic. +func RegisterInt64Histo(descriptor MetricDescriptor) *Int64HistoHandle { + registerMetric(descriptor.Name, descriptor.Default) + descriptor.Type = MetricTypeIntHisto + descPtr := &descriptor + metricsRegistry[descriptor.Name] = descPtr + return (*Int64HistoHandle)(descPtr) +} + +// RegisterFloat64Histo registers the metric description onto the global +// registry. It returns a typed handle to use to recording data. +// +// NOTE: this function must only be called during initialization time (i.e. in +// an init() function), and is not thread-safe. If multiple metrics are +// registered with the same name, this function will panic. +func RegisterFloat64Histo(descriptor MetricDescriptor) *Float64HistoHandle { + registerMetric(descriptor.Name, descriptor.Default) + descriptor.Type = MetricTypeFloatHisto + descPtr := &descriptor + metricsRegistry[descriptor.Name] = descPtr + return (*Float64HistoHandle)(descPtr) +} + +// RegisterInt64Gauge registers the metric description onto the global registry. +// It returns a typed handle to use to recording data. +// +// NOTE: this function must only be called during initialization time (i.e. in +// an init() function), and is not thread-safe. If multiple metrics are +// registered with the same name, this function will panic. +func RegisterInt64Gauge(descriptor MetricDescriptor) *Int64GaugeHandle { + registerMetric(descriptor.Name, descriptor.Default) + descriptor.Type = MetricTypeIntGauge + descPtr := &descriptor + metricsRegistry[descriptor.Name] = descPtr + return (*Int64GaugeHandle)(descPtr) +} + +// snapshotMetricsRegistryForTesting snapshots the global data of the metrics +// registry. Registers a cleanup function on the provided testing.T that sets +// the metrics registry to its original state. Only called in testing functions. +func snapshotMetricsRegistryForTesting(t *testing.T) { + oldDefaultMetrics := DefaultMetrics + oldRegisteredMetrics := registeredMetrics + oldMetricsRegistry := metricsRegistry + + registeredMetrics = make(map[Metric]bool) + metricsRegistry = make(map[Metric]*MetricDescriptor) + maps.Copy(registeredMetrics, registeredMetrics) + maps.Copy(metricsRegistry, metricsRegistry) + + t.Cleanup(func() { + DefaultMetrics = oldDefaultMetrics + registeredMetrics = oldRegisteredMetrics + metricsRegistry = oldMetricsRegistry + }) +} diff --git a/vendor/google.golang.org/grpc/experimental/stats/metrics.go b/vendor/google.golang.org/grpc/experimental/stats/metrics.go new file mode 100644 index 00000000000..3221f7a633a --- /dev/null +++ b/vendor/google.golang.org/grpc/experimental/stats/metrics.go @@ -0,0 +1,114 @@ +/* + * + * Copyright 2024 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// Package stats contains experimental metrics/stats API's. +package stats + +import "maps" + +// MetricsRecorder records on metrics derived from metric registry. +type MetricsRecorder interface { + // RecordInt64Count records the measurement alongside labels on the int + // count associated with the provided handle. + RecordInt64Count(handle *Int64CountHandle, incr int64, labels ...string) + // RecordFloat64Count records the measurement alongside labels on the float + // count associated with the provided handle. + RecordFloat64Count(handle *Float64CountHandle, incr float64, labels ...string) + // RecordInt64Histo records the measurement alongside labels on the int + // histo associated with the provided handle. + RecordInt64Histo(handle *Int64HistoHandle, incr int64, labels ...string) + // RecordFloat64Histo records the measurement alongside labels on the float + // histo associated with the provided handle. + RecordFloat64Histo(handle *Float64HistoHandle, incr float64, labels ...string) + // RecordInt64Gauge records the measurement alongside labels on the int + // gauge associated with the provided handle. + RecordInt64Gauge(handle *Int64GaugeHandle, incr int64, labels ...string) +} + +// Metric is an identifier for a metric. +type Metric string + +// Metrics is a set of metrics to record. Once created, Metrics is immutable, +// however Add and Remove can make copies with specific metrics added or +// removed, respectively. +// +// Do not construct directly; use NewMetrics instead. +type Metrics struct { + // metrics are the set of metrics to initialize. + metrics map[Metric]bool +} + +// NewMetrics returns a Metrics containing Metrics. +func NewMetrics(metrics ...Metric) *Metrics { + newMetrics := make(map[Metric]bool) + for _, metric := range metrics { + newMetrics[metric] = true + } + return &Metrics{ + metrics: newMetrics, + } +} + +// Metrics returns the metrics set. The returned map is read-only and must not +// be modified. +func (m *Metrics) Metrics() map[Metric]bool { + return m.metrics +} + +// Add adds the metrics to the metrics set and returns a new copy with the +// additional metrics. +func (m *Metrics) Add(metrics ...Metric) *Metrics { + newMetrics := make(map[Metric]bool) + for metric := range m.metrics { + newMetrics[metric] = true + } + + for _, metric := range metrics { + newMetrics[metric] = true + } + return &Metrics{ + metrics: newMetrics, + } +} + +// Join joins the metrics passed in with the metrics set, and returns a new copy +// with the merged metrics. +func (m *Metrics) Join(metrics *Metrics) *Metrics { + newMetrics := make(map[Metric]bool) + maps.Copy(newMetrics, m.metrics) + maps.Copy(newMetrics, metrics.metrics) + return &Metrics{ + metrics: newMetrics, + } +} + +// Remove removes the metrics from the metrics set and returns a new copy with +// the metrics removed. +func (m *Metrics) Remove(metrics ...Metric) *Metrics { + newMetrics := make(map[Metric]bool) + for metric := range m.metrics { + newMetrics[metric] = true + } + + for _, metric := range metrics { + delete(newMetrics, metric) + } + return &Metrics{ + metrics: newMetrics, + } +} diff --git a/vendor/google.golang.org/grpc/grpclog/component.go b/vendor/google.golang.org/grpc/grpclog/component.go index ac73c9ced25..f1ae080dcb8 100644 --- a/vendor/google.golang.org/grpc/grpclog/component.go +++ b/vendor/google.golang.org/grpc/grpclog/component.go @@ -20,8 +20,6 @@ package grpclog import ( "fmt" - - "google.golang.org/grpc/internal/grpclog" ) // componentData records the settings for a component. @@ -33,22 +31,22 @@ var cache = map[string]*componentData{} func (c *componentData) InfoDepth(depth int, args ...any) { args = append([]any{"[" + string(c.name) + "]"}, args...) - grpclog.InfoDepth(depth+1, args...) + InfoDepth(depth+1, args...) } func (c *componentData) WarningDepth(depth int, args ...any) { args = append([]any{"[" + string(c.name) + "]"}, args...) - grpclog.WarningDepth(depth+1, args...) + WarningDepth(depth+1, args...) } func (c *componentData) ErrorDepth(depth int, args ...any) { args = append([]any{"[" + string(c.name) + "]"}, args...) - grpclog.ErrorDepth(depth+1, args...) + ErrorDepth(depth+1, args...) } func (c *componentData) FatalDepth(depth int, args ...any) { args = append([]any{"[" + string(c.name) + "]"}, args...) - grpclog.FatalDepth(depth+1, args...) + FatalDepth(depth+1, args...) } func (c *componentData) Info(args ...any) { diff --git a/vendor/google.golang.org/grpc/grpclog/grpclog.go b/vendor/google.golang.org/grpc/grpclog/grpclog.go index 16928c9cb99..db320105e64 100644 --- a/vendor/google.golang.org/grpc/grpclog/grpclog.go +++ b/vendor/google.golang.org/grpc/grpclog/grpclog.go @@ -18,18 +18,15 @@ // Package grpclog defines logging for grpc. // -// All logs in transport and grpclb packages only go to verbose level 2. -// All logs in other packages in grpc are logged in spite of the verbosity level. -// -// In the default logger, -// severity level can be set by environment variable GRPC_GO_LOG_SEVERITY_LEVEL, -// verbosity level can be set by GRPC_GO_LOG_VERBOSITY_LEVEL. -package grpclog // import "google.golang.org/grpc/grpclog" +// In the default logger, severity level can be set by environment variable +// GRPC_GO_LOG_SEVERITY_LEVEL, verbosity level can be set by +// GRPC_GO_LOG_VERBOSITY_LEVEL. +package grpclog import ( "os" - "google.golang.org/grpc/internal/grpclog" + "google.golang.org/grpc/grpclog/internal" ) func init() { @@ -38,58 +35,58 @@ func init() { // V reports whether verbosity level l is at least the requested verbose level. func V(l int) bool { - return grpclog.Logger.V(l) + return internal.LoggerV2Impl.V(l) } // Info logs to the INFO log. func Info(args ...any) { - grpclog.Logger.Info(args...) + internal.LoggerV2Impl.Info(args...) } // Infof logs to the INFO log. Arguments are handled in the manner of fmt.Printf. func Infof(format string, args ...any) { - grpclog.Logger.Infof(format, args...) + internal.LoggerV2Impl.Infof(format, args...) } // Infoln logs to the INFO log. Arguments are handled in the manner of fmt.Println. func Infoln(args ...any) { - grpclog.Logger.Infoln(args...) + internal.LoggerV2Impl.Infoln(args...) } // Warning logs to the WARNING log. func Warning(args ...any) { - grpclog.Logger.Warning(args...) + internal.LoggerV2Impl.Warning(args...) } // Warningf logs to the WARNING log. Arguments are handled in the manner of fmt.Printf. func Warningf(format string, args ...any) { - grpclog.Logger.Warningf(format, args...) + internal.LoggerV2Impl.Warningf(format, args...) } // Warningln logs to the WARNING log. Arguments are handled in the manner of fmt.Println. func Warningln(args ...any) { - grpclog.Logger.Warningln(args...) + internal.LoggerV2Impl.Warningln(args...) } // Error logs to the ERROR log. func Error(args ...any) { - grpclog.Logger.Error(args...) + internal.LoggerV2Impl.Error(args...) } // Errorf logs to the ERROR log. Arguments are handled in the manner of fmt.Printf. func Errorf(format string, args ...any) { - grpclog.Logger.Errorf(format, args...) + internal.LoggerV2Impl.Errorf(format, args...) } // Errorln logs to the ERROR log. Arguments are handled in the manner of fmt.Println. func Errorln(args ...any) { - grpclog.Logger.Errorln(args...) + internal.LoggerV2Impl.Errorln(args...) } // Fatal logs to the FATAL log. Arguments are handled in the manner of fmt.Print. // It calls os.Exit() with exit code 1. func Fatal(args ...any) { - grpclog.Logger.Fatal(args...) + internal.LoggerV2Impl.Fatal(args...) // Make sure fatal logs will exit. os.Exit(1) } @@ -97,15 +94,15 @@ func Fatal(args ...any) { // Fatalf logs to the FATAL log. Arguments are handled in the manner of fmt.Printf. // It calls os.Exit() with exit code 1. func Fatalf(format string, args ...any) { - grpclog.Logger.Fatalf(format, args...) + internal.LoggerV2Impl.Fatalf(format, args...) // Make sure fatal logs will exit. os.Exit(1) } // Fatalln logs to the FATAL log. Arguments are handled in the manner of fmt.Println. -// It calle os.Exit()) with exit code 1. +// It calls os.Exit() with exit code 1. func Fatalln(args ...any) { - grpclog.Logger.Fatalln(args...) + internal.LoggerV2Impl.Fatalln(args...) // Make sure fatal logs will exit. os.Exit(1) } @@ -114,19 +111,76 @@ func Fatalln(args ...any) { // // Deprecated: use Info. func Print(args ...any) { - grpclog.Logger.Info(args...) + internal.LoggerV2Impl.Info(args...) } // Printf prints to the logger. Arguments are handled in the manner of fmt.Printf. // // Deprecated: use Infof. func Printf(format string, args ...any) { - grpclog.Logger.Infof(format, args...) + internal.LoggerV2Impl.Infof(format, args...) } // Println prints to the logger. Arguments are handled in the manner of fmt.Println. // // Deprecated: use Infoln. func Println(args ...any) { - grpclog.Logger.Infoln(args...) + internal.LoggerV2Impl.Infoln(args...) +} + +// InfoDepth logs to the INFO log at the specified depth. +// +// # Experimental +// +// Notice: This API is EXPERIMENTAL and may be changed or removed in a +// later release. +func InfoDepth(depth int, args ...any) { + if internal.DepthLoggerV2Impl != nil { + internal.DepthLoggerV2Impl.InfoDepth(depth, args...) + } else { + internal.LoggerV2Impl.Infoln(args...) + } +} + +// WarningDepth logs to the WARNING log at the specified depth. +// +// # Experimental +// +// Notice: This API is EXPERIMENTAL and may be changed or removed in a +// later release. +func WarningDepth(depth int, args ...any) { + if internal.DepthLoggerV2Impl != nil { + internal.DepthLoggerV2Impl.WarningDepth(depth, args...) + } else { + internal.LoggerV2Impl.Warningln(args...) + } +} + +// ErrorDepth logs to the ERROR log at the specified depth. +// +// # Experimental +// +// Notice: This API is EXPERIMENTAL and may be changed or removed in a +// later release. +func ErrorDepth(depth int, args ...any) { + if internal.DepthLoggerV2Impl != nil { + internal.DepthLoggerV2Impl.ErrorDepth(depth, args...) + } else { + internal.LoggerV2Impl.Errorln(args...) + } +} + +// FatalDepth logs to the FATAL log at the specified depth. +// +// # Experimental +// +// Notice: This API is EXPERIMENTAL and may be changed or removed in a +// later release. +func FatalDepth(depth int, args ...any) { + if internal.DepthLoggerV2Impl != nil { + internal.DepthLoggerV2Impl.FatalDepth(depth, args...) + } else { + internal.LoggerV2Impl.Fatalln(args...) + } + os.Exit(1) } diff --git a/vendor/google.golang.org/grpc/grpclog/internal/grpclog.go b/vendor/google.golang.org/grpc/grpclog/internal/grpclog.go new file mode 100644 index 00000000000..59c03bc14c2 --- /dev/null +++ b/vendor/google.golang.org/grpc/grpclog/internal/grpclog.go @@ -0,0 +1,26 @@ +/* + * + * Copyright 2024 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// Package internal contains functionality internal to the grpclog package. +package internal + +// LoggerV2Impl is the logger used for the non-depth log functions. +var LoggerV2Impl LoggerV2 + +// DepthLoggerV2Impl is the logger used for the depth log functions. +var DepthLoggerV2Impl DepthLoggerV2 diff --git a/vendor/google.golang.org/grpc/grpclog/internal/logger.go b/vendor/google.golang.org/grpc/grpclog/internal/logger.go new file mode 100644 index 00000000000..0d9a824ce1b --- /dev/null +++ b/vendor/google.golang.org/grpc/grpclog/internal/logger.go @@ -0,0 +1,87 @@ +/* + * + * Copyright 2024 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package internal + +// Logger mimics golang's standard Logger as an interface. +// +// Deprecated: use LoggerV2. +type Logger interface { + Fatal(args ...any) + Fatalf(format string, args ...any) + Fatalln(args ...any) + Print(args ...any) + Printf(format string, args ...any) + Println(args ...any) +} + +// LoggerWrapper wraps Logger into a LoggerV2. +type LoggerWrapper struct { + Logger +} + +// Info logs to INFO log. Arguments are handled in the manner of fmt.Print. +func (l *LoggerWrapper) Info(args ...any) { + l.Logger.Print(args...) +} + +// Infoln logs to INFO log. Arguments are handled in the manner of fmt.Println. +func (l *LoggerWrapper) Infoln(args ...any) { + l.Logger.Println(args...) +} + +// Infof logs to INFO log. Arguments are handled in the manner of fmt.Printf. +func (l *LoggerWrapper) Infof(format string, args ...any) { + l.Logger.Printf(format, args...) +} + +// Warning logs to WARNING log. Arguments are handled in the manner of fmt.Print. +func (l *LoggerWrapper) Warning(args ...any) { + l.Logger.Print(args...) +} + +// Warningln logs to WARNING log. Arguments are handled in the manner of fmt.Println. +func (l *LoggerWrapper) Warningln(args ...any) { + l.Logger.Println(args...) +} + +// Warningf logs to WARNING log. Arguments are handled in the manner of fmt.Printf. +func (l *LoggerWrapper) Warningf(format string, args ...any) { + l.Logger.Printf(format, args...) +} + +// Error logs to ERROR log. Arguments are handled in the manner of fmt.Print. +func (l *LoggerWrapper) Error(args ...any) { + l.Logger.Print(args...) +} + +// Errorln logs to ERROR log. Arguments are handled in the manner of fmt.Println. +func (l *LoggerWrapper) Errorln(args ...any) { + l.Logger.Println(args...) +} + +// Errorf logs to ERROR log. Arguments are handled in the manner of fmt.Printf. +func (l *LoggerWrapper) Errorf(format string, args ...any) { + l.Logger.Printf(format, args...) +} + +// V reports whether verbosity level l is at least the requested verbose level. +func (*LoggerWrapper) V(l int) bool { + // Returns true for all verbose level. + return true +} diff --git a/vendor/google.golang.org/grpc/internal/grpclog/grpclog.go b/vendor/google.golang.org/grpc/grpclog/internal/loggerv2.go similarity index 52% rename from vendor/google.golang.org/grpc/internal/grpclog/grpclog.go rename to vendor/google.golang.org/grpc/grpclog/internal/loggerv2.go index bfc45102ab2..07df71e98a8 100644 --- a/vendor/google.golang.org/grpc/internal/grpclog/grpclog.go +++ b/vendor/google.golang.org/grpc/grpclog/internal/loggerv2.go @@ -1,6 +1,6 @@ /* * - * Copyright 2020 gRPC authors. + * Copyright 2024 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,59 +16,17 @@ * */ -// Package grpclog (internal) defines depth logging for grpc. -package grpclog +package internal import ( + "encoding/json" + "fmt" + "io" + "log" "os" ) -// Logger is the logger used for the non-depth log functions. -var Logger LoggerV2 - -// DepthLogger is the logger used for the depth log functions. -var DepthLogger DepthLoggerV2 - -// InfoDepth logs to the INFO log at the specified depth. -func InfoDepth(depth int, args ...any) { - if DepthLogger != nil { - DepthLogger.InfoDepth(depth, args...) - } else { - Logger.Infoln(args...) - } -} - -// WarningDepth logs to the WARNING log at the specified depth. -func WarningDepth(depth int, args ...any) { - if DepthLogger != nil { - DepthLogger.WarningDepth(depth, args...) - } else { - Logger.Warningln(args...) - } -} - -// ErrorDepth logs to the ERROR log at the specified depth. -func ErrorDepth(depth int, args ...any) { - if DepthLogger != nil { - DepthLogger.ErrorDepth(depth, args...) - } else { - Logger.Errorln(args...) - } -} - -// FatalDepth logs to the FATAL log at the specified depth. -func FatalDepth(depth int, args ...any) { - if DepthLogger != nil { - DepthLogger.FatalDepth(depth, args...) - } else { - Logger.Fatalln(args...) - } - os.Exit(1) -} - // LoggerV2 does underlying logging work for grpclog. -// This is a copy of the LoggerV2 defined in the external grpclog package. It -// is defined here to avoid a circular dependency. type LoggerV2 interface { // Info logs to INFO log. Arguments are handled in the manner of fmt.Print. Info(args ...any) @@ -107,14 +65,13 @@ type LoggerV2 interface { // DepthLoggerV2 logs at a specified call frame. If a LoggerV2 also implements // DepthLoggerV2, the below functions will be called with the appropriate stack // depth set for trivial functions the logger may ignore. -// This is a copy of the DepthLoggerV2 defined in the external grpclog package. -// It is defined here to avoid a circular dependency. // // # Experimental // // Notice: This type is EXPERIMENTAL and may be changed or removed in a // later release. type DepthLoggerV2 interface { + LoggerV2 // InfoDepth logs to INFO log at the specified depth. Arguments are handled in the manner of fmt.Println. InfoDepth(depth int, args ...any) // WarningDepth logs to WARNING log at the specified depth. Arguments are handled in the manner of fmt.Println. @@ -124,3 +81,124 @@ type DepthLoggerV2 interface { // FatalDepth logs to FATAL log at the specified depth. Arguments are handled in the manner of fmt.Println. FatalDepth(depth int, args ...any) } + +const ( + // infoLog indicates Info severity. + infoLog int = iota + // warningLog indicates Warning severity. + warningLog + // errorLog indicates Error severity. + errorLog + // fatalLog indicates Fatal severity. + fatalLog +) + +// severityName contains the string representation of each severity. +var severityName = []string{ + infoLog: "INFO", + warningLog: "WARNING", + errorLog: "ERROR", + fatalLog: "FATAL", +} + +// loggerT is the default logger used by grpclog. +type loggerT struct { + m []*log.Logger + v int + jsonFormat bool +} + +func (g *loggerT) output(severity int, s string) { + sevStr := severityName[severity] + if !g.jsonFormat { + g.m[severity].Output(2, fmt.Sprintf("%v: %v", sevStr, s)) + return + } + // TODO: we can also include the logging component, but that needs more + // (API) changes. + b, _ := json.Marshal(map[string]string{ + "severity": sevStr, + "message": s, + }) + g.m[severity].Output(2, string(b)) +} + +func (g *loggerT) Info(args ...any) { + g.output(infoLog, fmt.Sprint(args...)) +} + +func (g *loggerT) Infoln(args ...any) { + g.output(infoLog, fmt.Sprintln(args...)) +} + +func (g *loggerT) Infof(format string, args ...any) { + g.output(infoLog, fmt.Sprintf(format, args...)) +} + +func (g *loggerT) Warning(args ...any) { + g.output(warningLog, fmt.Sprint(args...)) +} + +func (g *loggerT) Warningln(args ...any) { + g.output(warningLog, fmt.Sprintln(args...)) +} + +func (g *loggerT) Warningf(format string, args ...any) { + g.output(warningLog, fmt.Sprintf(format, args...)) +} + +func (g *loggerT) Error(args ...any) { + g.output(errorLog, fmt.Sprint(args...)) +} + +func (g *loggerT) Errorln(args ...any) { + g.output(errorLog, fmt.Sprintln(args...)) +} + +func (g *loggerT) Errorf(format string, args ...any) { + g.output(errorLog, fmt.Sprintf(format, args...)) +} + +func (g *loggerT) Fatal(args ...any) { + g.output(fatalLog, fmt.Sprint(args...)) + os.Exit(1) +} + +func (g *loggerT) Fatalln(args ...any) { + g.output(fatalLog, fmt.Sprintln(args...)) + os.Exit(1) +} + +func (g *loggerT) Fatalf(format string, args ...any) { + g.output(fatalLog, fmt.Sprintf(format, args...)) + os.Exit(1) +} + +func (g *loggerT) V(l int) bool { + return l <= g.v +} + +// LoggerV2Config configures the LoggerV2 implementation. +type LoggerV2Config struct { + // Verbosity sets the verbosity level of the logger. + Verbosity int + // FormatJSON controls whether the logger should output logs in JSON format. + FormatJSON bool +} + +// NewLoggerV2 creates a new LoggerV2 instance with the provided configuration. +// The infoW, warningW, and errorW writers are used to write log messages of +// different severity levels. +func NewLoggerV2(infoW, warningW, errorW io.Writer, c LoggerV2Config) LoggerV2 { + var m []*log.Logger + flag := log.LstdFlags + if c.FormatJSON { + flag = 0 + } + m = append(m, log.New(infoW, "", flag)) + m = append(m, log.New(io.MultiWriter(infoW, warningW), "", flag)) + ew := io.MultiWriter(infoW, warningW, errorW) // ew will be used for error and fatal. + m = append(m, log.New(ew, "", flag)) + m = append(m, log.New(ew, "", flag)) + return &loggerT{m: m, v: c.Verbosity, jsonFormat: c.FormatJSON} +} diff --git a/vendor/google.golang.org/grpc/grpclog/logger.go b/vendor/google.golang.org/grpc/grpclog/logger.go index b1674d8267c..4b203585707 100644 --- a/vendor/google.golang.org/grpc/grpclog/logger.go +++ b/vendor/google.golang.org/grpc/grpclog/logger.go @@ -18,70 +18,17 @@ package grpclog -import "google.golang.org/grpc/internal/grpclog" +import "google.golang.org/grpc/grpclog/internal" // Logger mimics golang's standard Logger as an interface. // // Deprecated: use LoggerV2. -type Logger interface { - Fatal(args ...any) - Fatalf(format string, args ...any) - Fatalln(args ...any) - Print(args ...any) - Printf(format string, args ...any) - Println(args ...any) -} +type Logger internal.Logger // SetLogger sets the logger that is used in grpc. Call only from // init() functions. // // Deprecated: use SetLoggerV2. func SetLogger(l Logger) { - grpclog.Logger = &loggerWrapper{Logger: l} -} - -// loggerWrapper wraps Logger into a LoggerV2. -type loggerWrapper struct { - Logger -} - -func (g *loggerWrapper) Info(args ...any) { - g.Logger.Print(args...) -} - -func (g *loggerWrapper) Infoln(args ...any) { - g.Logger.Println(args...) -} - -func (g *loggerWrapper) Infof(format string, args ...any) { - g.Logger.Printf(format, args...) -} - -func (g *loggerWrapper) Warning(args ...any) { - g.Logger.Print(args...) -} - -func (g *loggerWrapper) Warningln(args ...any) { - g.Logger.Println(args...) -} - -func (g *loggerWrapper) Warningf(format string, args ...any) { - g.Logger.Printf(format, args...) -} - -func (g *loggerWrapper) Error(args ...any) { - g.Logger.Print(args...) -} - -func (g *loggerWrapper) Errorln(args ...any) { - g.Logger.Println(args...) -} - -func (g *loggerWrapper) Errorf(format string, args ...any) { - g.Logger.Printf(format, args...) -} - -func (g *loggerWrapper) V(l int) bool { - // Returns true for all verbose level. - return true + internal.LoggerV2Impl = &internal.LoggerWrapper{Logger: l} } diff --git a/vendor/google.golang.org/grpc/grpclog/loggerv2.go b/vendor/google.golang.org/grpc/grpclog/loggerv2.go index ecfd36d7130..892dc13d164 100644 --- a/vendor/google.golang.org/grpc/grpclog/loggerv2.go +++ b/vendor/google.golang.org/grpc/grpclog/loggerv2.go @@ -19,52 +19,16 @@ package grpclog import ( - "encoding/json" - "fmt" "io" - "log" "os" "strconv" "strings" - "google.golang.org/grpc/internal/grpclog" + "google.golang.org/grpc/grpclog/internal" ) // LoggerV2 does underlying logging work for grpclog. -type LoggerV2 interface { - // Info logs to INFO log. Arguments are handled in the manner of fmt.Print. - Info(args ...any) - // Infoln logs to INFO log. Arguments are handled in the manner of fmt.Println. - Infoln(args ...any) - // Infof logs to INFO log. Arguments are handled in the manner of fmt.Printf. - Infof(format string, args ...any) - // Warning logs to WARNING log. Arguments are handled in the manner of fmt.Print. - Warning(args ...any) - // Warningln logs to WARNING log. Arguments are handled in the manner of fmt.Println. - Warningln(args ...any) - // Warningf logs to WARNING log. Arguments are handled in the manner of fmt.Printf. - Warningf(format string, args ...any) - // Error logs to ERROR log. Arguments are handled in the manner of fmt.Print. - Error(args ...any) - // Errorln logs to ERROR log. Arguments are handled in the manner of fmt.Println. - Errorln(args ...any) - // Errorf logs to ERROR log. Arguments are handled in the manner of fmt.Printf. - Errorf(format string, args ...any) - // Fatal logs to ERROR log. Arguments are handled in the manner of fmt.Print. - // gRPC ensures that all Fatal logs will exit with os.Exit(1). - // Implementations may also call os.Exit() with a non-zero exit code. - Fatal(args ...any) - // Fatalln logs to ERROR log. Arguments are handled in the manner of fmt.Println. - // gRPC ensures that all Fatal logs will exit with os.Exit(1). - // Implementations may also call os.Exit() with a non-zero exit code. - Fatalln(args ...any) - // Fatalf logs to ERROR log. Arguments are handled in the manner of fmt.Printf. - // gRPC ensures that all Fatal logs will exit with os.Exit(1). - // Implementations may also call os.Exit() with a non-zero exit code. - Fatalf(format string, args ...any) - // V reports whether verbosity level l is at least the requested verbose level. - V(l int) bool -} +type LoggerV2 internal.LoggerV2 // SetLoggerV2 sets logger that is used in grpc to a V2 logger. // Not mutex-protected, should be called before any gRPC functions. @@ -72,34 +36,8 @@ func SetLoggerV2(l LoggerV2) { if _, ok := l.(*componentData); ok { panic("cannot use component logger as grpclog logger") } - grpclog.Logger = l - grpclog.DepthLogger, _ = l.(grpclog.DepthLoggerV2) -} - -const ( - // infoLog indicates Info severity. - infoLog int = iota - // warningLog indicates Warning severity. - warningLog - // errorLog indicates Error severity. - errorLog - // fatalLog indicates Fatal severity. - fatalLog -) - -// severityName contains the string representation of each severity. -var severityName = []string{ - infoLog: "INFO", - warningLog: "WARNING", - errorLog: "ERROR", - fatalLog: "FATAL", -} - -// loggerT is the default logger used by grpclog. -type loggerT struct { - m []*log.Logger - v int - jsonFormat bool + internal.LoggerV2Impl = l + internal.DepthLoggerV2Impl, _ = l.(internal.DepthLoggerV2) } // NewLoggerV2 creates a loggerV2 with the provided writers. @@ -108,32 +46,13 @@ type loggerT struct { // Warning logs will be written to warningW and infoW. // Info logs will be written to infoW. func NewLoggerV2(infoW, warningW, errorW io.Writer) LoggerV2 { - return newLoggerV2WithConfig(infoW, warningW, errorW, loggerV2Config{}) + return internal.NewLoggerV2(infoW, warningW, errorW, internal.LoggerV2Config{}) } // NewLoggerV2WithVerbosity creates a loggerV2 with the provided writers and // verbosity level. func NewLoggerV2WithVerbosity(infoW, warningW, errorW io.Writer, v int) LoggerV2 { - return newLoggerV2WithConfig(infoW, warningW, errorW, loggerV2Config{verbose: v}) -} - -type loggerV2Config struct { - verbose int - jsonFormat bool -} - -func newLoggerV2WithConfig(infoW, warningW, errorW io.Writer, c loggerV2Config) LoggerV2 { - var m []*log.Logger - flag := log.LstdFlags - if c.jsonFormat { - flag = 0 - } - m = append(m, log.New(infoW, "", flag)) - m = append(m, log.New(io.MultiWriter(infoW, warningW), "", flag)) - ew := io.MultiWriter(infoW, warningW, errorW) // ew will be used for error and fatal. - m = append(m, log.New(ew, "", flag)) - m = append(m, log.New(ew, "", flag)) - return &loggerT{m: m, v: c.verbose, jsonFormat: c.jsonFormat} + return internal.NewLoggerV2(infoW, warningW, errorW, internal.LoggerV2Config{Verbosity: v}) } // newLoggerV2 creates a loggerV2 to be used as default logger. @@ -161,80 +80,10 @@ func newLoggerV2() LoggerV2 { jsonFormat := strings.EqualFold(os.Getenv("GRPC_GO_LOG_FORMATTER"), "json") - return newLoggerV2WithConfig(infoW, warningW, errorW, loggerV2Config{ - verbose: v, - jsonFormat: jsonFormat, - }) -} - -func (g *loggerT) output(severity int, s string) { - sevStr := severityName[severity] - if !g.jsonFormat { - g.m[severity].Output(2, fmt.Sprintf("%v: %v", sevStr, s)) - return - } - // TODO: we can also include the logging component, but that needs more - // (API) changes. - b, _ := json.Marshal(map[string]string{ - "severity": sevStr, - "message": s, + return internal.NewLoggerV2(infoW, warningW, errorW, internal.LoggerV2Config{ + Verbosity: v, + FormatJSON: jsonFormat, }) - g.m[severity].Output(2, string(b)) -} - -func (g *loggerT) Info(args ...any) { - g.output(infoLog, fmt.Sprint(args...)) -} - -func (g *loggerT) Infoln(args ...any) { - g.output(infoLog, fmt.Sprintln(args...)) -} - -func (g *loggerT) Infof(format string, args ...any) { - g.output(infoLog, fmt.Sprintf(format, args...)) -} - -func (g *loggerT) Warning(args ...any) { - g.output(warningLog, fmt.Sprint(args...)) -} - -func (g *loggerT) Warningln(args ...any) { - g.output(warningLog, fmt.Sprintln(args...)) -} - -func (g *loggerT) Warningf(format string, args ...any) { - g.output(warningLog, fmt.Sprintf(format, args...)) -} - -func (g *loggerT) Error(args ...any) { - g.output(errorLog, fmt.Sprint(args...)) -} - -func (g *loggerT) Errorln(args ...any) { - g.output(errorLog, fmt.Sprintln(args...)) -} - -func (g *loggerT) Errorf(format string, args ...any) { - g.output(errorLog, fmt.Sprintf(format, args...)) -} - -func (g *loggerT) Fatal(args ...any) { - g.output(fatalLog, fmt.Sprint(args...)) - os.Exit(1) -} - -func (g *loggerT) Fatalln(args ...any) { - g.output(fatalLog, fmt.Sprintln(args...)) - os.Exit(1) -} - -func (g *loggerT) Fatalf(format string, args ...any) { - g.output(fatalLog, fmt.Sprintf(format, args...)) - os.Exit(1) -} - -func (g *loggerT) V(l int) bool { - return l <= g.v } // DepthLoggerV2 logs at a specified call frame. If a LoggerV2 also implements @@ -245,14 +94,4 @@ func (g *loggerT) V(l int) bool { // // Notice: This type is EXPERIMENTAL and may be changed or removed in a // later release. -type DepthLoggerV2 interface { - LoggerV2 - // InfoDepth logs to INFO log at the specified depth. Arguments are handled in the manner of fmt.Println. - InfoDepth(depth int, args ...any) - // WarningDepth logs to WARNING log at the specified depth. Arguments are handled in the manner of fmt.Println. - WarningDepth(depth int, args ...any) - // ErrorDepth logs to ERROR log at the specified depth. Arguments are handled in the manner of fmt.Println. - ErrorDepth(depth int, args ...any) - // FatalDepth logs to FATAL log at the specified depth. Arguments are handled in the manner of fmt.Println. - FatalDepth(depth int, args ...any) -} +type DepthLoggerV2 internal.DepthLoggerV2 diff --git a/vendor/google.golang.org/grpc/health/grpc_health_v1/health.pb.go b/vendor/google.golang.org/grpc/health/grpc_health_v1/health.pb.go index 38b88350735..e65cf0ea15e 100644 --- a/vendor/google.golang.org/grpc/health/grpc_health_v1/health.pb.go +++ b/vendor/google.golang.org/grpc/health/grpc_health_v1/health.pb.go @@ -18,7 +18,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.34.1 -// protoc v4.25.2 +// protoc v5.27.1 // source: grpc/health/v1/health.proto package grpc_health_v1 diff --git a/vendor/google.golang.org/grpc/health/grpc_health_v1/health_grpc.pb.go b/vendor/google.golang.org/grpc/health/grpc_health_v1/health_grpc.pb.go index 51b736ba06e..f96b8ab4927 100644 --- a/vendor/google.golang.org/grpc/health/grpc_health_v1/health_grpc.pb.go +++ b/vendor/google.golang.org/grpc/health/grpc_health_v1/health_grpc.pb.go @@ -17,8 +17,8 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.4.0 -// - protoc v4.25.2 +// - protoc-gen-go-grpc v1.5.1 +// - protoc v5.27.1 // source: grpc/health/v1/health.proto package grpc_health_v1 @@ -32,8 +32,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.62.0 or later. -const _ = grpc.SupportPackageIsVersion8 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( Health_Check_FullMethodName = "/grpc.health.v1.Health/Check" @@ -73,7 +73,7 @@ type HealthClient interface { // should assume this method is not supported and should not retry the // call. If the call terminates with any other status (including OK), // clients should retry the call with appropriate exponential backoff. - Watch(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (Health_WatchClient, error) + Watch(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[HealthCheckResponse], error) } type healthClient struct { @@ -94,13 +94,13 @@ func (c *healthClient) Check(ctx context.Context, in *HealthCheckRequest, opts . return out, nil } -func (c *healthClient) Watch(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (Health_WatchClient, error) { +func (c *healthClient) Watch(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[HealthCheckResponse], error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) stream, err := c.cc.NewStream(ctx, &Health_ServiceDesc.Streams[0], Health_Watch_FullMethodName, cOpts...) if err != nil { return nil, err } - x := &healthWatchClient{ClientStream: stream} + x := &grpc.GenericClientStream[HealthCheckRequest, HealthCheckResponse]{ClientStream: stream} if err := x.ClientStream.SendMsg(in); err != nil { return nil, err } @@ -110,26 +110,12 @@ func (c *healthClient) Watch(ctx context.Context, in *HealthCheckRequest, opts . return x, nil } -type Health_WatchClient interface { - Recv() (*HealthCheckResponse, error) - grpc.ClientStream -} - -type healthWatchClient struct { - grpc.ClientStream -} - -func (x *healthWatchClient) Recv() (*HealthCheckResponse, error) { - m := new(HealthCheckResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type Health_WatchClient = grpc.ServerStreamingClient[HealthCheckResponse] // HealthServer is the server API for Health service. // All implementations should embed UnimplementedHealthServer -// for forward compatibility +// for forward compatibility. // // Health is gRPC's mechanism for checking whether a server is able to handle // RPCs. Its semantics are documented in @@ -160,19 +146,23 @@ type HealthServer interface { // should assume this method is not supported and should not retry the // call. If the call terminates with any other status (including OK), // clients should retry the call with appropriate exponential backoff. - Watch(*HealthCheckRequest, Health_WatchServer) error + Watch(*HealthCheckRequest, grpc.ServerStreamingServer[HealthCheckResponse]) error } -// UnimplementedHealthServer should be embedded to have forward compatible implementations. -type UnimplementedHealthServer struct { -} +// UnimplementedHealthServer should be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedHealthServer struct{} func (UnimplementedHealthServer) Check(context.Context, *HealthCheckRequest) (*HealthCheckResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Check not implemented") } -func (UnimplementedHealthServer) Watch(*HealthCheckRequest, Health_WatchServer) error { +func (UnimplementedHealthServer) Watch(*HealthCheckRequest, grpc.ServerStreamingServer[HealthCheckResponse]) error { return status.Errorf(codes.Unimplemented, "method Watch not implemented") } +func (UnimplementedHealthServer) testEmbeddedByValue() {} // UnsafeHealthServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to HealthServer will @@ -182,6 +172,13 @@ type UnsafeHealthServer interface { } func RegisterHealthServer(s grpc.ServiceRegistrar, srv HealthServer) { + // If the following call panics, it indicates UnimplementedHealthServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&Health_ServiceDesc, srv) } @@ -208,21 +205,11 @@ func _Health_Watch_Handler(srv interface{}, stream grpc.ServerStream) error { if err := stream.RecvMsg(m); err != nil { return err } - return srv.(HealthServer).Watch(m, &healthWatchServer{ServerStream: stream}) -} - -type Health_WatchServer interface { - Send(*HealthCheckResponse) error - grpc.ServerStream + return srv.(HealthServer).Watch(m, &grpc.GenericServerStream[HealthCheckRequest, HealthCheckResponse]{ServerStream: stream}) } -type healthWatchServer struct { - grpc.ServerStream -} - -func (x *healthWatchServer) Send(m *HealthCheckResponse) error { - return x.ServerStream.SendMsg(m) -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type Health_WatchServer = grpc.ServerStreamingServer[HealthCheckResponse] // Health_ServiceDesc is the grpc.ServiceDesc for Health service. // It's only intended for direct use with grpc.RegisterService, diff --git a/vendor/google.golang.org/grpc/internal/channelz/channelmap.go b/vendor/google.golang.org/grpc/internal/channelz/channelmap.go index dfe18b08925..bb531225d5f 100644 --- a/vendor/google.golang.org/grpc/internal/channelz/channelmap.go +++ b/vendor/google.golang.org/grpc/internal/channelz/channelmap.go @@ -46,7 +46,7 @@ type entry interface { // channelMap is the storage data structure for channelz. // -// Methods of channelMap can be divided in two two categories with respect to +// Methods of channelMap can be divided into two categories with respect to // locking. // // 1. Methods acquire the global lock. diff --git a/vendor/google.golang.org/grpc/internal/envconfig/envconfig.go b/vendor/google.golang.org/grpc/internal/envconfig/envconfig.go index d9064871394..00abc7c2beb 100644 --- a/vendor/google.golang.org/grpc/internal/envconfig/envconfig.go +++ b/vendor/google.golang.org/grpc/internal/envconfig/envconfig.go @@ -46,6 +46,10 @@ var ( // by setting the environment variable "GRPC_ENFORCE_ALPN_ENABLED" to "true" // or "false". EnforceALPNEnabled = boolFromEnv("GRPC_ENFORCE_ALPN_ENABLED", false) + // XDSFallbackSupport is the env variable that controls whether support for + // xDS fallback is turned on. If this is unset or is false, only the first + // xDS server in the list of server configs will be used. + XDSFallbackSupport = boolFromEnv("GRPC_EXPERIMENTAL_XDS_FALLBACK", false) ) func boolFromEnv(envVar string, def bool) bool { diff --git a/vendor/google.golang.org/grpc/internal/experimental.go b/vendor/google.golang.org/grpc/internal/experimental.go index 7f7044e1731..7617be21589 100644 --- a/vendor/google.golang.org/grpc/internal/experimental.go +++ b/vendor/google.golang.org/grpc/internal/experimental.go @@ -18,11 +18,11 @@ package internal var ( - // WithRecvBufferPool is implemented by the grpc package and returns a dial + // WithBufferPool is implemented by the grpc package and returns a dial // option to configure a shared buffer pool for a grpc.ClientConn. - WithRecvBufferPool any // func (grpc.SharedBufferPool) grpc.DialOption + WithBufferPool any // func (grpc.SharedBufferPool) grpc.DialOption - // RecvBufferPool is implemented by the grpc package and returns a server + // BufferPool is implemented by the grpc package and returns a server // option to configure a shared buffer pool for a grpc.Server. - RecvBufferPool any // func (grpc.SharedBufferPool) grpc.ServerOption + BufferPool any // func (grpc.SharedBufferPool) grpc.ServerOption ) diff --git a/vendor/google.golang.org/grpc/internal/grpclog/prefixLogger.go b/vendor/google.golang.org/grpc/internal/grpclog/prefix_logger.go similarity index 63% rename from vendor/google.golang.org/grpc/internal/grpclog/prefixLogger.go rename to vendor/google.golang.org/grpc/internal/grpclog/prefix_logger.go index faa998de763..092ad187a2c 100644 --- a/vendor/google.golang.org/grpc/internal/grpclog/prefixLogger.go +++ b/vendor/google.golang.org/grpc/internal/grpclog/prefix_logger.go @@ -16,17 +16,21 @@ * */ +// Package grpclog provides logging functionality for internal gRPC packages, +// outside of the functionality provided by the external `grpclog` package. package grpclog import ( "fmt" + + "google.golang.org/grpc/grpclog" ) // PrefixLogger does logging with a prefix. // // Logging method on a nil logs without any prefix. type PrefixLogger struct { - logger DepthLoggerV2 + logger grpclog.DepthLoggerV2 prefix string } @@ -38,7 +42,7 @@ func (pl *PrefixLogger) Infof(format string, args ...any) { pl.logger.InfoDepth(1, fmt.Sprintf(format, args...)) return } - InfoDepth(1, fmt.Sprintf(format, args...)) + grpclog.InfoDepth(1, fmt.Sprintf(format, args...)) } // Warningf does warning logging. @@ -48,7 +52,7 @@ func (pl *PrefixLogger) Warningf(format string, args ...any) { pl.logger.WarningDepth(1, fmt.Sprintf(format, args...)) return } - WarningDepth(1, fmt.Sprintf(format, args...)) + grpclog.WarningDepth(1, fmt.Sprintf(format, args...)) } // Errorf does error logging. @@ -58,36 +62,18 @@ func (pl *PrefixLogger) Errorf(format string, args ...any) { pl.logger.ErrorDepth(1, fmt.Sprintf(format, args...)) return } - ErrorDepth(1, fmt.Sprintf(format, args...)) -} - -// Debugf does info logging at verbose level 2. -func (pl *PrefixLogger) Debugf(format string, args ...any) { - // TODO(6044): Refactor interfaces LoggerV2 and DepthLogger, and maybe - // rewrite PrefixLogger a little to ensure that we don't use the global - // `Logger` here, and instead use the `logger` field. - if !Logger.V(2) { - return - } - if pl != nil { - // Handle nil, so the tests can pass in a nil logger. - format = pl.prefix + format - pl.logger.InfoDepth(1, fmt.Sprintf(format, args...)) - return - } - InfoDepth(1, fmt.Sprintf(format, args...)) - + grpclog.ErrorDepth(1, fmt.Sprintf(format, args...)) } // V reports whether verbosity level l is at least the requested verbose level. func (pl *PrefixLogger) V(l int) bool { - // TODO(6044): Refactor interfaces LoggerV2 and DepthLogger, and maybe - // rewrite PrefixLogger a little to ensure that we don't use the global - // `Logger` here, and instead use the `logger` field. - return Logger.V(l) + if pl != nil { + return pl.logger.V(l) + } + return true } // NewPrefixLogger creates a prefix logger with the given prefix. -func NewPrefixLogger(logger DepthLoggerV2, prefix string) *PrefixLogger { +func NewPrefixLogger(logger grpclog.DepthLoggerV2, prefix string) *PrefixLogger { return &PrefixLogger{logger: logger, prefix: prefix} } diff --git a/vendor/google.golang.org/grpc/internal/grpcsync/callback_serializer.go b/vendor/google.golang.org/grpc/internal/grpcsync/callback_serializer.go index f7f40a16ace..19b9d639275 100644 --- a/vendor/google.golang.org/grpc/internal/grpcsync/callback_serializer.go +++ b/vendor/google.golang.org/grpc/internal/grpcsync/callback_serializer.go @@ -53,16 +53,28 @@ func NewCallbackSerializer(ctx context.Context) *CallbackSerializer { return cs } -// Schedule adds a callback to be scheduled after existing callbacks are run. +// TrySchedule tries to schedules the provided callback function f to be +// executed in the order it was added. This is a best-effort operation. If the +// context passed to NewCallbackSerializer was canceled before this method is +// called, the callback will not be scheduled. // // Callbacks are expected to honor the context when performing any blocking // operations, and should return early when the context is canceled. +func (cs *CallbackSerializer) TrySchedule(f func(ctx context.Context)) { + cs.callbacks.Put(f) +} + +// ScheduleOr schedules the provided callback function f to be executed in the +// order it was added. If the context passed to NewCallbackSerializer has been +// canceled before this method is called, the onFailure callback will be +// executed inline instead. // -// Return value indicates if the callback was successfully added to the list of -// callbacks to be executed by the serializer. It is not possible to add -// callbacks once the context passed to NewCallbackSerializer is cancelled. -func (cs *CallbackSerializer) Schedule(f func(ctx context.Context)) bool { - return cs.callbacks.Put(f) == nil +// Callbacks are expected to honor the context when performing any blocking +// operations, and should return early when the context is canceled. +func (cs *CallbackSerializer) ScheduleOr(f func(ctx context.Context), onFailure func()) { + if cs.callbacks.Put(f) != nil { + onFailure() + } } func (cs *CallbackSerializer) run(ctx context.Context) { diff --git a/vendor/google.golang.org/grpc/internal/grpcsync/pubsub.go b/vendor/google.golang.org/grpc/internal/grpcsync/pubsub.go index aef8cec1ab0..6d8c2f518df 100644 --- a/vendor/google.golang.org/grpc/internal/grpcsync/pubsub.go +++ b/vendor/google.golang.org/grpc/internal/grpcsync/pubsub.go @@ -77,7 +77,7 @@ func (ps *PubSub) Subscribe(sub Subscriber) (cancel func()) { if ps.msg != nil { msg := ps.msg - ps.cs.Schedule(func(context.Context) { + ps.cs.TrySchedule(func(context.Context) { ps.mu.Lock() defer ps.mu.Unlock() if !ps.subscribers[sub] { @@ -103,7 +103,7 @@ func (ps *PubSub) Publish(msg any) { ps.msg = msg for sub := range ps.subscribers { s := sub - ps.cs.Schedule(func(context.Context) { + ps.cs.TrySchedule(func(context.Context) { ps.mu.Lock() defer ps.mu.Unlock() if !ps.subscribers[s] { diff --git a/vendor/google.golang.org/grpc/internal/internal.go b/vendor/google.golang.org/grpc/internal/internal.go index 5d665398692..65f936a623a 100644 --- a/vendor/google.golang.org/grpc/internal/internal.go +++ b/vendor/google.golang.org/grpc/internal/internal.go @@ -208,6 +208,27 @@ var ( // ShuffleAddressListForTesting pseudo-randomizes the order of addresses. n // is the number of elements. swap swaps the elements with indexes i and j. ShuffleAddressListForTesting any // func(n int, swap func(i, j int)) + + // ConnectedAddress returns the connected address for a SubConnState. The + // address is only valid if the state is READY. + ConnectedAddress any // func (scs SubConnState) resolver.Address + + // SetConnectedAddress sets the connected address for a SubConnState. + SetConnectedAddress any // func(scs *SubConnState, addr resolver.Address) + + // SnapshotMetricRegistryForTesting snapshots the global data of the metric + // registry. Registers a cleanup function on the provided testing.T that + // sets the metric registry to its original state. Only called in testing + // functions. + SnapshotMetricRegistryForTesting any // func(t *testing.T) + + // SetDefaultBufferPoolForTesting updates the default buffer pool, for + // testing purposes. + SetDefaultBufferPoolForTesting any // func(mem.BufferPool) + + // SetBufferPoolingThresholdForTesting updates the buffer pooling threshold, for + // testing purposes. + SetBufferPoolingThresholdForTesting any // func(int) ) // HealthChecker defines the signature of the client-side LB channel health diff --git a/vendor/google.golang.org/grpc/internal/stats/labels.go b/vendor/google.golang.org/grpc/internal/stats/labels.go new file mode 100644 index 00000000000..fd33af51ae8 --- /dev/null +++ b/vendor/google.golang.org/grpc/internal/stats/labels.go @@ -0,0 +1,42 @@ +/* + * + * Copyright 2024 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// Package stats provides internal stats related functionality. +package stats + +import "context" + +// Labels are the labels for metrics. +type Labels struct { + // TelemetryLabels are the telemetry labels to record. + TelemetryLabels map[string]string +} + +type labelsKey struct{} + +// GetLabels returns the Labels stored in the context, or nil if there is one. +func GetLabels(ctx context.Context) *Labels { + labels, _ := ctx.Value(labelsKey{}).(*Labels) + return labels +} + +// SetLabels sets the Labels in the context. +func SetLabels(ctx context.Context, labels *Labels) context.Context { + // could also append + return context.WithValue(ctx, labelsKey{}, labels) +} diff --git a/vendor/google.golang.org/grpc/internal/stats/metrics_recorder_list.go b/vendor/google.golang.org/grpc/internal/stats/metrics_recorder_list.go new file mode 100644 index 00000000000..be110d41f9a --- /dev/null +++ b/vendor/google.golang.org/grpc/internal/stats/metrics_recorder_list.go @@ -0,0 +1,95 @@ +/* + * Copyright 2024 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package stats + +import ( + "fmt" + + estats "google.golang.org/grpc/experimental/stats" + "google.golang.org/grpc/stats" +) + +// MetricsRecorderList forwards Record calls to all of its metricsRecorders. +// +// It eats any record calls where the label values provided do not match the +// number of label keys. +type MetricsRecorderList struct { + // metricsRecorders are the metrics recorders this list will forward to. + metricsRecorders []estats.MetricsRecorder +} + +// NewMetricsRecorderList creates a new metric recorder list with all the stats +// handlers provided which implement the MetricsRecorder interface. +// If no stats handlers provided implement the MetricsRecorder interface, +// the MetricsRecorder list returned is a no-op. +func NewMetricsRecorderList(shs []stats.Handler) *MetricsRecorderList { + var mrs []estats.MetricsRecorder + for _, sh := range shs { + if mr, ok := sh.(estats.MetricsRecorder); ok { + mrs = append(mrs, mr) + } + } + return &MetricsRecorderList{ + metricsRecorders: mrs, + } +} + +func verifyLabels(desc *estats.MetricDescriptor, labelsRecv ...string) { + if got, want := len(labelsRecv), len(desc.Labels)+len(desc.OptionalLabels); got != want { + panic(fmt.Sprintf("Received %d labels in call to record metric %q, but expected %d.", got, desc.Name, want)) + } +} + +func (l *MetricsRecorderList) RecordInt64Count(handle *estats.Int64CountHandle, incr int64, labels ...string) { + verifyLabels(handle.Descriptor(), labels...) + + for _, metricRecorder := range l.metricsRecorders { + metricRecorder.RecordInt64Count(handle, incr, labels...) + } +} + +func (l *MetricsRecorderList) RecordFloat64Count(handle *estats.Float64CountHandle, incr float64, labels ...string) { + verifyLabels(handle.Descriptor(), labels...) + + for _, metricRecorder := range l.metricsRecorders { + metricRecorder.RecordFloat64Count(handle, incr, labels...) + } +} + +func (l *MetricsRecorderList) RecordInt64Histo(handle *estats.Int64HistoHandle, incr int64, labels ...string) { + verifyLabels(handle.Descriptor(), labels...) + + for _, metricRecorder := range l.metricsRecorders { + metricRecorder.RecordInt64Histo(handle, incr, labels...) + } +} + +func (l *MetricsRecorderList) RecordFloat64Histo(handle *estats.Float64HistoHandle, incr float64, labels ...string) { + verifyLabels(handle.Descriptor(), labels...) + + for _, metricRecorder := range l.metricsRecorders { + metricRecorder.RecordFloat64Histo(handle, incr, labels...) + } +} + +func (l *MetricsRecorderList) RecordInt64Gauge(handle *estats.Int64GaugeHandle, incr int64, labels ...string) { + verifyLabels(handle.Descriptor(), labels...) + + for _, metricRecorder := range l.metricsRecorders { + metricRecorder.RecordInt64Gauge(handle, incr, labels...) + } +} diff --git a/vendor/google.golang.org/grpc/internal/tcp_keepalive_unix.go b/vendor/google.golang.org/grpc/internal/tcp_keepalive_unix.go index 078137b7fd7..7e7aaa54636 100644 --- a/vendor/google.golang.org/grpc/internal/tcp_keepalive_unix.go +++ b/vendor/google.golang.org/grpc/internal/tcp_keepalive_unix.go @@ -44,7 +44,7 @@ func NetDialerWithTCPKeepalive() *net.Dialer { // combination of unconditionally enabling TCP keepalives here, and // disabling the overriding of TCP keepalive parameters by setting the // KeepAlive field to a negative value above, results in OS defaults for - // the TCP keealive interval and time parameters. + // the TCP keepalive interval and time parameters. Control: func(_, _ string, c syscall.RawConn) error { return c.Control(func(fd uintptr) { unix.SetsockoptInt(int(fd), unix.SOL_SOCKET, unix.SO_KEEPALIVE, 1) diff --git a/vendor/google.golang.org/grpc/internal/tcp_keepalive_windows.go b/vendor/google.golang.org/grpc/internal/tcp_keepalive_windows.go index fd7d43a8907..d5c1085eeae 100644 --- a/vendor/google.golang.org/grpc/internal/tcp_keepalive_windows.go +++ b/vendor/google.golang.org/grpc/internal/tcp_keepalive_windows.go @@ -44,7 +44,7 @@ func NetDialerWithTCPKeepalive() *net.Dialer { // combination of unconditionally enabling TCP keepalives here, and // disabling the overriding of TCP keepalive parameters by setting the // KeepAlive field to a negative value above, results in OS defaults for - // the TCP keealive interval and time parameters. + // the TCP keepalive interval and time parameters. Control: func(_, _ string, c syscall.RawConn) error { return c.Control(func(fd uintptr) { windows.SetsockoptInt(windows.Handle(fd), windows.SOL_SOCKET, windows.SO_KEEPALIVE, 1) diff --git a/vendor/google.golang.org/grpc/internal/transport/controlbuf.go b/vendor/google.golang.org/grpc/internal/transport/controlbuf.go index 3deadfb4a20..ea0633bbdab 100644 --- a/vendor/google.golang.org/grpc/internal/transport/controlbuf.go +++ b/vendor/google.golang.org/grpc/internal/transport/controlbuf.go @@ -32,6 +32,7 @@ import ( "golang.org/x/net/http2/hpack" "google.golang.org/grpc/internal/grpclog" "google.golang.org/grpc/internal/grpcutil" + "google.golang.org/grpc/mem" "google.golang.org/grpc/status" ) @@ -148,9 +149,9 @@ type dataFrame struct { streamID uint32 endStream bool h []byte - d []byte + reader mem.Reader // onEachWrite is called every time - // a part of d is written out. + // a part of data is written out. onEachWrite func() } @@ -289,18 +290,22 @@ func (l *outStreamList) dequeue() *outStream { } // controlBuffer is a way to pass information to loopy. -// Information is passed as specific struct types called control frames. -// A control frame not only represents data, messages or headers to be sent out -// but can also be used to instruct loopy to update its internal state. -// It shouldn't be confused with an HTTP2 frame, although some of the control frames -// like dataFrame and headerFrame do go out on wire as HTTP2 frames. +// +// Information is passed as specific struct types called control frames. A +// control frame not only represents data, messages or headers to be sent out +// but can also be used to instruct loopy to update its internal state. It +// shouldn't be confused with an HTTP2 frame, although some of the control +// frames like dataFrame and headerFrame do go out on wire as HTTP2 frames. type controlBuffer struct { - ch chan struct{} - done <-chan struct{} + wakeupCh chan struct{} // Unblocks readers waiting for something to read. + done <-chan struct{} // Closed when the transport is done. + + // Mutex guards all the fields below, except trfChan which can be read + // atomically without holding mu. mu sync.Mutex - consumerWaiting bool - list *itemList - err error + consumerWaiting bool // True when readers are blocked waiting for new data. + closed bool // True when the controlbuf is finished. + list *itemList // List of queued control frames. // transportResponseFrames counts the number of queued items that represent // the response of an action initiated by the peer. trfChan is created @@ -308,47 +313,59 @@ type controlBuffer struct { // closed and nilled when transportResponseFrames drops below the // threshold. Both fields are protected by mu. transportResponseFrames int - trfChan atomic.Value // chan struct{} + trfChan atomic.Pointer[chan struct{}] } func newControlBuffer(done <-chan struct{}) *controlBuffer { return &controlBuffer{ - ch: make(chan struct{}, 1), - list: &itemList{}, - done: done, + wakeupCh: make(chan struct{}, 1), + list: &itemList{}, + done: done, } } -// throttle blocks if there are too many incomingSettings/cleanupStreams in the -// controlbuf. +// throttle blocks if there are too many frames in the control buf that +// represent the response of an action initiated by the peer, like +// incomingSettings cleanupStreams etc. func (c *controlBuffer) throttle() { - ch, _ := c.trfChan.Load().(chan struct{}) - if ch != nil { + if ch := c.trfChan.Load(); ch != nil { select { - case <-ch: + case <-(*ch): case <-c.done: } } } +// put adds an item to the controlbuf. func (c *controlBuffer) put(it cbItem) error { _, err := c.executeAndPut(nil, it) return err } +// executeAndPut runs f, and if the return value is true, adds the given item to +// the controlbuf. The item could be nil, in which case, this method simply +// executes f and does not add the item to the controlbuf. +// +// The first return value indicates whether the item was successfully added to +// the control buffer. A non-nil error, specifically ErrConnClosing, is returned +// if the control buffer is already closed. func (c *controlBuffer) executeAndPut(f func() bool, it cbItem) (bool, error) { - var wakeUp bool c.mu.Lock() - if c.err != nil { - c.mu.Unlock() - return false, c.err + defer c.mu.Unlock() + + if c.closed { + return false, ErrConnClosing } if f != nil { if !f() { // f wasn't successful - c.mu.Unlock() return false, nil } } + if it == nil { + return true, nil + } + + var wakeUp bool if c.consumerWaiting { wakeUp = true c.consumerWaiting = false @@ -359,98 +376,102 @@ func (c *controlBuffer) executeAndPut(f func() bool, it cbItem) (bool, error) { if c.transportResponseFrames == maxQueuedTransportResponseFrames { // We are adding the frame that puts us over the threshold; create // a throttling channel. - c.trfChan.Store(make(chan struct{})) + ch := make(chan struct{}) + c.trfChan.Store(&ch) } } - c.mu.Unlock() if wakeUp { select { - case c.ch <- struct{}{}: + case c.wakeupCh <- struct{}{}: default: } } return true, nil } -// Note argument f should never be nil. -func (c *controlBuffer) execute(f func(it any) bool, it any) (bool, error) { - c.mu.Lock() - if c.err != nil { - c.mu.Unlock() - return false, c.err - } - if !f(it) { // f wasn't successful - c.mu.Unlock() - return false, nil - } - c.mu.Unlock() - return true, nil -} - +// get returns the next control frame from the control buffer. If block is true +// **and** there are no control frames in the control buffer, the call blocks +// until one of the conditions is met: there is a frame to return or the +// transport is closed. func (c *controlBuffer) get(block bool) (any, error) { for { c.mu.Lock() - if c.err != nil { + frame, err := c.getOnceLocked() + if frame != nil || err != nil || !block { + // If we read a frame or an error, we can return to the caller. The + // call to getOnceLocked() returns a nil frame and a nil error if + // there is nothing to read, and in that case, if the caller asked + // us not to block, we can return now as well. c.mu.Unlock() - return nil, c.err - } - if !c.list.isEmpty() { - h := c.list.dequeue().(cbItem) - if h.isTransportResponseFrame() { - if c.transportResponseFrames == maxQueuedTransportResponseFrames { - // We are removing the frame that put us over the - // threshold; close and clear the throttling channel. - ch := c.trfChan.Load().(chan struct{}) - close(ch) - c.trfChan.Store((chan struct{})(nil)) - } - c.transportResponseFrames-- - } - c.mu.Unlock() - return h, nil - } - if !block { - c.mu.Unlock() - return nil, nil + return frame, err } c.consumerWaiting = true c.mu.Unlock() + + // Release the lock above and wait to be woken up. select { - case <-c.ch: + case <-c.wakeupCh: case <-c.done: return nil, errors.New("transport closed by client") } } } +// Callers must not use this method, but should instead use get(). +// +// Caller must hold c.mu. +func (c *controlBuffer) getOnceLocked() (any, error) { + if c.closed { + return false, ErrConnClosing + } + if c.list.isEmpty() { + return nil, nil + } + h := c.list.dequeue().(cbItem) + if h.isTransportResponseFrame() { + if c.transportResponseFrames == maxQueuedTransportResponseFrames { + // We are removing the frame that put us over the + // threshold; close and clear the throttling channel. + ch := c.trfChan.Swap(nil) + close(*ch) + } + c.transportResponseFrames-- + } + return h, nil +} + +// finish closes the control buffer, cleaning up any streams that have queued +// header frames. Once this method returns, no more frames can be added to the +// control buffer, and attempts to do so will return ErrConnClosing. func (c *controlBuffer) finish() { c.mu.Lock() - if c.err != nil { - c.mu.Unlock() + defer c.mu.Unlock() + + if c.closed { return } - c.err = ErrConnClosing + c.closed = true // There may be headers for streams in the control buffer. // These streams need to be cleaned out since the transport // is still not aware of these yet. for head := c.list.dequeueAll(); head != nil; head = head.next { - hdr, ok := head.it.(*headerFrame) - if !ok { - continue - } - if hdr.onOrphaned != nil { // It will be nil on the server-side. - hdr.onOrphaned(ErrConnClosing) + switch v := head.it.(type) { + case *headerFrame: + if v.onOrphaned != nil { // It will be nil on the server-side. + v.onOrphaned(ErrConnClosing) + } + case *dataFrame: + _ = v.reader.Close() } } + // In case throttle() is currently in flight, it needs to be unblocked. // Otherwise, the transport may not close, since the transport is closed by // the reader encountering the connection error. - ch, _ := c.trfChan.Load().(chan struct{}) + ch := c.trfChan.Swap(nil) if ch != nil { - close(ch) + close(*ch) } - c.trfChan.Store((chan struct{})(nil)) - c.mu.Unlock() } type side int @@ -466,7 +487,7 @@ const ( // stream maintains a queue of data frames; as loopy receives data frames // it gets added to the queue of the relevant stream. // Loopy goes over this list of active streams by processing one node every iteration, -// thereby closely resemebling to a round-robin scheduling over all streams. While +// thereby closely resembling a round-robin scheduling over all streams. While // processing a stream, loopy writes out data bytes from this stream capped by the min // of http2MaxFrameLen, connection-level flow control and stream-level flow control. type loopyWriter struct { @@ -490,12 +511,13 @@ type loopyWriter struct { draining bool conn net.Conn logger *grpclog.PrefixLogger + bufferPool mem.BufferPool // Side-specific handlers ssGoAwayHandler func(*goAway) (bool, error) } -func newLoopyWriter(s side, fr *framer, cbuf *controlBuffer, bdpEst *bdpEstimator, conn net.Conn, logger *grpclog.PrefixLogger, goAwayHandler func(*goAway) (bool, error)) *loopyWriter { +func newLoopyWriter(s side, fr *framer, cbuf *controlBuffer, bdpEst *bdpEstimator, conn net.Conn, logger *grpclog.PrefixLogger, goAwayHandler func(*goAway) (bool, error), bufferPool mem.BufferPool) *loopyWriter { var buf bytes.Buffer l := &loopyWriter{ side: s, @@ -511,6 +533,7 @@ func newLoopyWriter(s side, fr *framer, cbuf *controlBuffer, bdpEst *bdpEstimato conn: conn, logger: logger, ssGoAwayHandler: goAwayHandler, + bufferPool: bufferPool, } return l } @@ -768,6 +791,11 @@ func (l *loopyWriter) cleanupStreamHandler(c *cleanupStream) error { // not be established yet. delete(l.estdStreams, c.streamID) str.deleteSelf() + for head := str.itl.dequeueAll(); head != nil; head = head.next { + if df, ok := head.it.(*dataFrame); ok { + _ = df.reader.Close() + } + } } if c.rst { // If RST_STREAM needs to be sent. if err := l.framer.fr.WriteRSTStream(c.streamID, c.rstCode); err != nil { @@ -903,16 +931,18 @@ func (l *loopyWriter) processData() (bool, error) { dataItem := str.itl.peek().(*dataFrame) // Peek at the first data item this stream. // A data item is represented by a dataFrame, since it later translates into // multiple HTTP2 data frames. - // Every dataFrame has two buffers; h that keeps grpc-message header and d that is actual data. - // As an optimization to keep wire traffic low, data from d is copied to h to make as big as the - // maximum possible HTTP2 frame size. + // Every dataFrame has two buffers; h that keeps grpc-message header and data + // that is the actual message. As an optimization to keep wire traffic low, data + // from data is copied to h to make as big as the maximum possible HTTP2 frame + // size. - if len(dataItem.h) == 0 && len(dataItem.d) == 0 { // Empty data frame + if len(dataItem.h) == 0 && dataItem.reader.Remaining() == 0 { // Empty data frame // Client sends out empty data frame with endStream = true if err := l.framer.fr.WriteData(dataItem.streamID, dataItem.endStream, nil); err != nil { return false, err } str.itl.dequeue() // remove the empty data item from stream + _ = dataItem.reader.Close() if str.itl.isEmpty() { str.state = empty } else if trailer, ok := str.itl.peek().(*headerFrame); ok { // the next item is trailers. @@ -927,9 +957,7 @@ func (l *loopyWriter) processData() (bool, error) { } return false, nil } - var ( - buf []byte - ) + // Figure out the maximum size we can send maxSize := http2MaxFrameLen if strQuota := int(l.oiws) - str.bytesOutStanding; strQuota <= 0 { // stream-level flow control. @@ -943,43 +971,50 @@ func (l *loopyWriter) processData() (bool, error) { } // Compute how much of the header and data we can send within quota and max frame length hSize := min(maxSize, len(dataItem.h)) - dSize := min(maxSize-hSize, len(dataItem.d)) - if hSize != 0 { - if dSize == 0 { - buf = dataItem.h - } else { - // We can add some data to grpc message header to distribute bytes more equally across frames. - // Copy on the stack to avoid generating garbage - var localBuf [http2MaxFrameLen]byte - copy(localBuf[:hSize], dataItem.h) - copy(localBuf[hSize:], dataItem.d[:dSize]) - buf = localBuf[:hSize+dSize] - } + dSize := min(maxSize-hSize, dataItem.reader.Remaining()) + remainingBytes := len(dataItem.h) + dataItem.reader.Remaining() - hSize - dSize + size := hSize + dSize + + var buf *[]byte + + if hSize != 0 && dSize == 0 { + buf = &dataItem.h } else { - buf = dataItem.d - } + // Note: this is only necessary because the http2.Framer does not support + // partially writing a frame, so the sequence must be materialized into a buffer. + // TODO: Revisit once https://github.com/golang/go/issues/66655 is addressed. + pool := l.bufferPool + if pool == nil { + // Note that this is only supposed to be nil in tests. Otherwise, stream is + // always initialized with a BufferPool. + pool = mem.DefaultBufferPool() + } + buf = pool.Get(size) + defer pool.Put(buf) - size := hSize + dSize + copy((*buf)[:hSize], dataItem.h) + _, _ = dataItem.reader.Read((*buf)[hSize:]) + } // Now that outgoing flow controls are checked we can replenish str's write quota str.wq.replenish(size) var endStream bool // If this is the last data message on this stream and all of it can be written in this iteration. - if dataItem.endStream && len(dataItem.h)+len(dataItem.d) <= size { + if dataItem.endStream && remainingBytes == 0 { endStream = true } if dataItem.onEachWrite != nil { dataItem.onEachWrite() } - if err := l.framer.fr.WriteData(dataItem.streamID, endStream, buf[:size]); err != nil { + if err := l.framer.fr.WriteData(dataItem.streamID, endStream, (*buf)[:size]); err != nil { return false, err } str.bytesOutStanding += size l.sendQuota -= uint32(size) dataItem.h = dataItem.h[hSize:] - dataItem.d = dataItem.d[dSize:] - if len(dataItem.h) == 0 && len(dataItem.d) == 0 { // All the data from that message was written out. + if remainingBytes == 0 { // All the data from that message was written out. + _ = dataItem.reader.Close() str.itl.dequeue() } if str.itl.isEmpty() { diff --git a/vendor/google.golang.org/grpc/internal/transport/handler_server.go b/vendor/google.golang.org/grpc/internal/transport/handler_server.go index 4a3ddce29a4..e1cd86b2fce 100644 --- a/vendor/google.golang.org/grpc/internal/transport/handler_server.go +++ b/vendor/google.golang.org/grpc/internal/transport/handler_server.go @@ -24,7 +24,6 @@ package transport import ( - "bytes" "context" "errors" "fmt" @@ -40,6 +39,7 @@ import ( "google.golang.org/grpc/credentials" "google.golang.org/grpc/internal/grpclog" "google.golang.org/grpc/internal/grpcutil" + "google.golang.org/grpc/mem" "google.golang.org/grpc/metadata" "google.golang.org/grpc/peer" "google.golang.org/grpc/stats" @@ -50,7 +50,7 @@ import ( // NewServerHandlerTransport returns a ServerTransport handling gRPC from // inside an http.Handler, or writes an HTTP error to w and returns an error. // It requires that the http Server supports HTTP/2. -func NewServerHandlerTransport(w http.ResponseWriter, r *http.Request, stats []stats.Handler) (ServerTransport, error) { +func NewServerHandlerTransport(w http.ResponseWriter, r *http.Request, stats []stats.Handler, bufferPool mem.BufferPool) (ServerTransport, error) { if r.Method != http.MethodPost { w.Header().Set("Allow", http.MethodPost) msg := fmt.Sprintf("invalid gRPC request method %q", r.Method) @@ -98,6 +98,7 @@ func NewServerHandlerTransport(w http.ResponseWriter, r *http.Request, stats []s contentType: contentType, contentSubtype: contentSubtype, stats: stats, + bufferPool: bufferPool, } st.logger = prefixLoggerForServerHandlerTransport(st) @@ -171,6 +172,8 @@ type serverHandlerTransport struct { stats []stats.Handler logger *grpclog.PrefixLogger + + bufferPool mem.BufferPool } func (ht *serverHandlerTransport) Close(err error) { @@ -244,6 +247,7 @@ func (ht *serverHandlerTransport) WriteStatus(s *Stream, st *status.Status) erro } s.hdrMu.Lock() + defer s.hdrMu.Unlock() if p := st.Proto(); p != nil && len(p.Details) > 0 { delete(s.trailer, grpcStatusDetailsBinHeader) stBytes, err := proto.Marshal(p) @@ -268,7 +272,6 @@ func (ht *serverHandlerTransport) WriteStatus(s *Stream, st *status.Status) erro } } } - s.hdrMu.Unlock() }) if err == nil { // transport has not been closed @@ -330,16 +333,28 @@ func (ht *serverHandlerTransport) writeCustomHeaders(s *Stream) { s.hdrMu.Unlock() } -func (ht *serverHandlerTransport) Write(s *Stream, hdr []byte, data []byte, opts *Options) error { +func (ht *serverHandlerTransport) Write(s *Stream, hdr []byte, data mem.BufferSlice, opts *Options) error { + // Always take a reference because otherwise there is no guarantee the data will + // be available after this function returns. This is what callers to Write + // expect. + data.Ref() headersWritten := s.updateHeaderSent() - return ht.do(func() { + err := ht.do(func() { + defer data.Free() if !headersWritten { ht.writePendingHeaders(s) } ht.rw.Write(hdr) - ht.rw.Write(data) + for _, b := range data { + _, _ = ht.rw.Write(b.ReadOnlyData()) + } ht.rw.(http.Flusher).Flush() }) + if err != nil { + data.Free() + return err + } + return nil } func (ht *serverHandlerTransport) WriteHeader(s *Stream, md metadata.MD) error { @@ -406,7 +421,7 @@ func (ht *serverHandlerTransport) HandleStreams(ctx context.Context, startStream headerWireLength: 0, // won't have access to header wire length until golang/go#18997. } s.trReader = &transportReader{ - reader: &recvBufferReader{ctx: s.ctx, ctxDone: s.ctx.Done(), recv: s.buf, freeBuffer: func(*bytes.Buffer) {}}, + reader: &recvBufferReader{ctx: s.ctx, ctxDone: s.ctx.Done(), recv: s.buf}, windowHandler: func(int) {}, } @@ -415,21 +430,19 @@ func (ht *serverHandlerTransport) HandleStreams(ctx context.Context, startStream go func() { defer close(readerDone) - // TODO: minimize garbage, optimize recvBuffer code/ownership - const readSize = 8196 - for buf := make([]byte, readSize); ; { - n, err := req.Body.Read(buf) + for { + buf := ht.bufferPool.Get(http2MaxFrameLen) + n, err := req.Body.Read(*buf) if n > 0 { - s.buf.put(recvMsg{buffer: bytes.NewBuffer(buf[:n:n])}) - buf = buf[n:] + *buf = (*buf)[:n] + s.buf.put(recvMsg{buffer: mem.NewBuffer(buf, ht.bufferPool)}) + } else { + ht.bufferPool.Put(buf) } if err != nil { s.buf.put(recvMsg{err: mapRecvMsgError(err)}) return } - if len(buf) == 0 { - buf = make([]byte, readSize) - } } }() diff --git a/vendor/google.golang.org/grpc/internal/transport/http2_client.go b/vendor/google.golang.org/grpc/internal/transport/http2_client.go index 3c63c706986..f46194fdc62 100644 --- a/vendor/google.golang.org/grpc/internal/transport/http2_client.go +++ b/vendor/google.golang.org/grpc/internal/transport/http2_client.go @@ -47,6 +47,7 @@ import ( isyscall "google.golang.org/grpc/internal/syscall" "google.golang.org/grpc/internal/transport/networktype" "google.golang.org/grpc/keepalive" + "google.golang.org/grpc/mem" "google.golang.org/grpc/metadata" "google.golang.org/grpc/peer" "google.golang.org/grpc/resolver" @@ -59,6 +60,8 @@ import ( // atomically. var clientConnectionCounter uint64 +var goAwayLoopyWriterTimeout = 5 * time.Second + var metadataFromOutgoingContextRaw = internal.FromOutgoingContextRaw.(func(context.Context) (metadata.MD, [][]string, bool)) // http2Client implements the ClientTransport interface with HTTP2. @@ -144,7 +147,7 @@ type http2Client struct { onClose func(GoAwayReason) - bufferPool *bufferPool + bufferPool mem.BufferPool connectionID uint64 logger *grpclog.PrefixLogger @@ -229,7 +232,7 @@ func newHTTP2Client(connectCtx, ctx context.Context, addr resolver.Address, opts } }(conn) - // The following defer and goroutine monitor the connectCtx for cancelation + // The following defer and goroutine monitor the connectCtx for cancellation // and deadline. On context expiration, the connection is hard closed and // this function will naturally fail as a result. Otherwise, the defer // waits for the goroutine to exit to prevent the context from being @@ -346,7 +349,7 @@ func newHTTP2Client(connectCtx, ctx context.Context, addr resolver.Address, opts streamQuota: defaultMaxStreamsClient, streamsQuotaAvailable: make(chan struct{}, 1), keepaliveEnabled: keepaliveEnabled, - bufferPool: newBufferPool(), + bufferPool: opts.BufferPool, onClose: onClose, } var czSecurity credentials.ChannelzSecurityValue @@ -463,7 +466,7 @@ func newHTTP2Client(connectCtx, ctx context.Context, addr resolver.Address, opts return nil, err } go func() { - t.loopy = newLoopyWriter(clientSide, t.framer, t.controlBuf, t.bdpEst, t.conn, t.logger, t.outgoingGoAwayHandler) + t.loopy = newLoopyWriter(clientSide, t.framer, t.controlBuf, t.bdpEst, t.conn, t.logger, t.outgoingGoAwayHandler, t.bufferPool) if err := t.loopy.run(); !isIOError(err) { // Immediately close the connection, as the loopy writer returns // when there are no more active streams and we were draining (the @@ -504,7 +507,6 @@ func (t *http2Client) newStream(ctx context.Context, callHdr *CallHdr) *Stream { closeStream: func(err error) { t.CloseStream(s, err) }, - freeBuffer: t.bufferPool.put, }, windowHandler: func(n int) { t.updateWindow(s, uint32(n)) @@ -983,6 +985,7 @@ func (t *http2Client) closeStream(s *Stream, err error, rst bool, rstCode http2. // only once on a transport. Once it is called, the transport should not be // accessed anymore. func (t *http2Client) Close(err error) { + t.conn.SetWriteDeadline(time.Now().Add(time.Second * 10)) t.mu.Lock() // Make sure we only close once. if t.state == closing { @@ -1006,10 +1009,20 @@ func (t *http2Client) Close(err error) { t.kpDormancyCond.Signal() } t.mu.Unlock() + // Per HTTP/2 spec, a GOAWAY frame must be sent before closing the - // connection. See https://httpwg.org/specs/rfc7540.html#GOAWAY. + // connection. See https://httpwg.org/specs/rfc7540.html#GOAWAY. It + // also waits for loopyWriter to be closed with a timer to avoid the + // long blocking in case the connection is blackholed, i.e. TCP is + // just stuck. t.controlBuf.put(&goAway{code: http2.ErrCodeNo, debugData: []byte("client transport shutdown"), closeConn: err}) - <-t.writerDone + timer := time.NewTimer(goAwayLoopyWriterTimeout) + defer timer.Stop() + select { + case <-t.writerDone: // success + case <-timer.C: + t.logger.Infof("Failed to write a GOAWAY frame as part of connection close after %s. Giving up and closing the transport.", goAwayLoopyWriterTimeout) + } t.cancel() t.conn.Close() channelz.RemoveEntry(t.channelz.ID) @@ -1065,27 +1078,36 @@ func (t *http2Client) GracefulClose() { // Write formats the data into HTTP2 data frame(s) and sends it out. The caller // should proceed only if Write returns nil. -func (t *http2Client) Write(s *Stream, hdr []byte, data []byte, opts *Options) error { +func (t *http2Client) Write(s *Stream, hdr []byte, data mem.BufferSlice, opts *Options) error { + reader := data.Reader() + if opts.Last { // If it's the last message, update stream state. if !s.compareAndSwapState(streamActive, streamWriteDone) { + _ = reader.Close() return errStreamDone } } else if s.getState() != streamActive { + _ = reader.Close() return errStreamDone } df := &dataFrame{ streamID: s.id, endStream: opts.Last, h: hdr, - d: data, + reader: reader, } - if hdr != nil || data != nil { // If it's not an empty data frame, check quota. - if err := s.wq.get(int32(len(hdr) + len(data))); err != nil { + if hdr != nil || df.reader.Remaining() != 0 { // If it's not an empty data frame, check quota. + if err := s.wq.get(int32(len(hdr) + df.reader.Remaining())); err != nil { + _ = reader.Close() return err } } - return t.controlBuf.put(df) + if err := t.controlBuf.put(df); err != nil { + _ = reader.Close() + return err + } + return nil } func (t *http2Client) getStream(f http2.Frame) *Stream { @@ -1190,10 +1212,13 @@ func (t *http2Client) handleData(f *http2.DataFrame) { // guarantee f.Data() is consumed before the arrival of next frame. // Can this copy be eliminated? if len(f.Data()) > 0 { - buffer := t.bufferPool.get() - buffer.Reset() - buffer.Write(f.Data()) - s.write(recvMsg{buffer: buffer}) + pool := t.bufferPool + if pool == nil { + // Note that this is only supposed to be nil in tests. Otherwise, stream is + // always initialized with a BufferPool. + pool = mem.DefaultBufferPool() + } + s.write(recvMsg{buffer: mem.Copy(f.Data(), pool)}) } } // The server has closed the stream without sending trailers. Record that @@ -1222,7 +1247,7 @@ func (t *http2Client) handleRSTStream(f *http2.RSTStreamFrame) { if statusCode == codes.Canceled { if d, ok := s.ctx.Deadline(); ok && !d.After(time.Now()) { // Our deadline was already exceeded, and that was likely the cause - // of this cancelation. Alter the status code accordingly. + // of this cancellation. Alter the status code accordingly. statusCode = codes.DeadlineExceeded } } @@ -1307,7 +1332,7 @@ func (t *http2Client) handleGoAway(f *http2.GoAwayFrame) { id := f.LastStreamID if id > 0 && id%2 == 0 { t.mu.Unlock() - t.Close(connectionErrorf(true, nil, "received goaway with non-zero even-numbered numbered stream id: %v", id)) + t.Close(connectionErrorf(true, nil, "received goaway with non-zero even-numbered stream id: %v", id)) return } // A client can receive multiple GoAways from the server (see diff --git a/vendor/google.golang.org/grpc/internal/transport/http2_server.go b/vendor/google.golang.org/grpc/internal/transport/http2_server.go index b7091165b50..f5163f770c8 100644 --- a/vendor/google.golang.org/grpc/internal/transport/http2_server.go +++ b/vendor/google.golang.org/grpc/internal/transport/http2_server.go @@ -39,6 +39,7 @@ import ( "google.golang.org/grpc/internal/grpcutil" "google.golang.org/grpc/internal/pretty" "google.golang.org/grpc/internal/syscall" + "google.golang.org/grpc/mem" "google.golang.org/protobuf/proto" "google.golang.org/grpc/codes" @@ -119,7 +120,7 @@ type http2Server struct { // Fields below are for channelz metric collection. channelz *channelz.Socket - bufferPool *bufferPool + bufferPool mem.BufferPool connectionID uint64 @@ -261,7 +262,7 @@ func NewServerTransport(conn net.Conn, config *ServerConfig) (_ ServerTransport, idle: time.Now(), kep: kep, initialWindowSize: iwz, - bufferPool: newBufferPool(), + bufferPool: config.BufferPool, } var czSecurity credentials.ChannelzSecurityValue if au, ok := authInfo.(credentials.ChannelzSecurityInfo); ok { @@ -330,7 +331,7 @@ func NewServerTransport(conn net.Conn, config *ServerConfig) (_ ServerTransport, t.handleSettings(sf) go func() { - t.loopy = newLoopyWriter(serverSide, t.framer, t.controlBuf, t.bdpEst, t.conn, t.logger, t.outgoingGoAwayHandler) + t.loopy = newLoopyWriter(serverSide, t.framer, t.controlBuf, t.bdpEst, t.conn, t.logger, t.outgoingGoAwayHandler, t.bufferPool) err := t.loopy.run() close(t.loopyWriterDone) if !isIOError(err) { @@ -613,10 +614,9 @@ func (t *http2Server) operateHeaders(ctx context.Context, frame *http2.MetaHeade s.wq = newWriteQuota(defaultWriteQuota, s.ctxDone) s.trReader = &transportReader{ reader: &recvBufferReader{ - ctx: s.ctx, - ctxDone: s.ctxDone, - recv: s.buf, - freeBuffer: t.bufferPool.put, + ctx: s.ctx, + ctxDone: s.ctxDone, + recv: s.buf, }, windowHandler: func(n int) { t.updateWindow(s, uint32(n)) @@ -813,10 +813,13 @@ func (t *http2Server) handleData(f *http2.DataFrame) { // guarantee f.Data() is consumed before the arrival of next frame. // Can this copy be eliminated? if len(f.Data()) > 0 { - buffer := t.bufferPool.get() - buffer.Reset() - buffer.Write(f.Data()) - s.write(recvMsg{buffer: buffer}) + pool := t.bufferPool + if pool == nil { + // Note that this is only supposed to be nil in tests. Otherwise, stream is + // always initialized with a BufferPool. + pool = mem.DefaultBufferPool() + } + s.write(recvMsg{buffer: mem.Copy(f.Data(), pool)}) } } if f.StreamEnded() { @@ -1089,7 +1092,9 @@ func (t *http2Server) WriteStatus(s *Stream, st *status.Status) error { onWrite: t.setResetPingStrikes, } - success, err := t.controlBuf.execute(t.checkForHeaderListSize, trailingHeader) + success, err := t.controlBuf.executeAndPut(func() bool { + return t.checkForHeaderListSize(trailingHeader) + }, nil) if !success { if err != nil { return err @@ -1112,27 +1117,37 @@ func (t *http2Server) WriteStatus(s *Stream, st *status.Status) error { // Write converts the data into HTTP2 data frame and sends it out. Non-nil error // is returns if it fails (e.g., framing error, transport error). -func (t *http2Server) Write(s *Stream, hdr []byte, data []byte, opts *Options) error { +func (t *http2Server) Write(s *Stream, hdr []byte, data mem.BufferSlice, opts *Options) error { + reader := data.Reader() + if !s.isHeaderSent() { // Headers haven't been written yet. if err := t.WriteHeader(s, nil); err != nil { + _ = reader.Close() return err } } else { // Writing headers checks for this condition. if s.getState() == streamDone { + _ = reader.Close() return t.streamContextErr(s) } } + df := &dataFrame{ streamID: s.id, h: hdr, - d: data, + reader: reader, onEachWrite: t.setResetPingStrikes, } - if err := s.wq.get(int32(len(hdr) + len(data))); err != nil { + if err := s.wq.get(int32(len(hdr) + df.reader.Remaining())); err != nil { + _ = reader.Close() return t.streamContextErr(s) } - return t.controlBuf.put(df) + if err := t.controlBuf.put(df); err != nil { + _ = reader.Close() + return err + } + return nil } // keepalive running in a separate goroutine does the following: diff --git a/vendor/google.golang.org/grpc/internal/transport/http_util.go b/vendor/google.golang.org/grpc/internal/transport/http_util.go index 39cef3bd442..f609c6c6659 100644 --- a/vendor/google.golang.org/grpc/internal/transport/http_util.go +++ b/vendor/google.golang.org/grpc/internal/transport/http_util.go @@ -317,28 +317,32 @@ func newBufWriter(conn net.Conn, batchSize int, pool *sync.Pool) *bufWriter { return w } -func (w *bufWriter) Write(b []byte) (n int, err error) { +func (w *bufWriter) Write(b []byte) (int, error) { if w.err != nil { return 0, w.err } if w.batchSize == 0 { // Buffer has been disabled. - n, err = w.conn.Write(b) + n, err := w.conn.Write(b) return n, toIOError(err) } if w.buf == nil { b := w.pool.Get().(*[]byte) w.buf = *b } + written := 0 for len(b) > 0 { - nn := copy(w.buf[w.offset:], b) - b = b[nn:] - w.offset += nn - n += nn - if w.offset >= w.batchSize { - err = w.flushKeepBuffer() + copied := copy(w.buf[w.offset:], b) + b = b[copied:] + written += copied + w.offset += copied + if w.offset < w.batchSize { + continue + } + if err := w.flushKeepBuffer(); err != nil { + return written, err } } - return n, err + return written, nil } func (w *bufWriter) Flush() error { diff --git a/vendor/google.golang.org/grpc/internal/transport/proxy.go b/vendor/google.golang.org/grpc/internal/transport/proxy.go index 24fa1032574..54b22443654 100644 --- a/vendor/google.golang.org/grpc/internal/transport/proxy.go +++ b/vendor/google.golang.org/grpc/internal/transport/proxy.go @@ -107,8 +107,14 @@ func doHTTPConnectHandshake(ctx context.Context, conn net.Conn, backendAddr stri } return nil, fmt.Errorf("failed to do connect handshake, response: %q", dump) } - - return &bufConn{Conn: conn, r: r}, nil + // The buffer could contain extra bytes from the target server, so we can't + // discard it. However, in many cases where the server waits for the client + // to send the first message (e.g. when TLS is being used), the buffer will + // be empty, so we can avoid the overhead of reading through this buffer. + if r.Buffered() != 0 { + return &bufConn{Conn: conn, r: r}, nil + } + return conn, nil } // proxyDial dials, connecting to a proxy first if necessary. Checks if a proxy diff --git a/vendor/google.golang.org/grpc/internal/transport/transport.go b/vendor/google.golang.org/grpc/internal/transport/transport.go index 4b39c0ade97..fdd6fa86cc1 100644 --- a/vendor/google.golang.org/grpc/internal/transport/transport.go +++ b/vendor/google.golang.org/grpc/internal/transport/transport.go @@ -22,7 +22,6 @@ package transport import ( - "bytes" "context" "errors" "fmt" @@ -37,6 +36,7 @@ import ( "google.golang.org/grpc/credentials" "google.golang.org/grpc/internal/channelz" "google.golang.org/grpc/keepalive" + "google.golang.org/grpc/mem" "google.golang.org/grpc/metadata" "google.golang.org/grpc/peer" "google.golang.org/grpc/resolver" @@ -47,32 +47,10 @@ import ( const logLevel = 2 -type bufferPool struct { - pool sync.Pool -} - -func newBufferPool() *bufferPool { - return &bufferPool{ - pool: sync.Pool{ - New: func() any { - return new(bytes.Buffer) - }, - }, - } -} - -func (p *bufferPool) get() *bytes.Buffer { - return p.pool.Get().(*bytes.Buffer) -} - -func (p *bufferPool) put(b *bytes.Buffer) { - p.pool.Put(b) -} - // recvMsg represents the received msg from the transport. All transport // protocol specific info has been removed. type recvMsg struct { - buffer *bytes.Buffer + buffer mem.Buffer // nil: received some data // io.EOF: stream is completed. data is nil. // other non-nil error: transport failure. data is nil. @@ -102,6 +80,9 @@ func newRecvBuffer() *recvBuffer { func (b *recvBuffer) put(r recvMsg) { b.mu.Lock() if b.err != nil { + // drop the buffer on the floor. Since b.err is not nil, any subsequent reads + // will always return an error, making this buffer inaccessible. + r.buffer.Free() b.mu.Unlock() // An error had occurred earlier, don't accept more // data or errors. @@ -148,45 +129,97 @@ type recvBufferReader struct { ctx context.Context ctxDone <-chan struct{} // cache of ctx.Done() (for performance). recv *recvBuffer - last *bytes.Buffer // Stores the remaining data in the previous calls. + last mem.Buffer // Stores the remaining data in the previous calls. err error - freeBuffer func(*bytes.Buffer) } -// Read reads the next len(p) bytes from last. If last is drained, it tries to -// read additional data from recv. It blocks if there no additional data available -// in recv. If Read returns any non-nil error, it will continue to return that error. -func (r *recvBufferReader) Read(p []byte) (n int, err error) { +func (r *recvBufferReader) ReadHeader(header []byte) (n int, err error) { if r.err != nil { return 0, r.err } if r.last != nil { - // Read remaining data left in last call. - copied, _ := r.last.Read(p) - if r.last.Len() == 0 { - r.freeBuffer(r.last) + n, r.last = mem.ReadUnsafe(header, r.last) + return n, nil + } + if r.closeStream != nil { + n, r.err = r.readHeaderClient(header) + } else { + n, r.err = r.readHeader(header) + } + return n, r.err +} + +// Read reads the next n bytes from last. If last is drained, it tries to read +// additional data from recv. It blocks if there no additional data available in +// recv. If Read returns any non-nil error, it will continue to return that +// error. +func (r *recvBufferReader) Read(n int) (buf mem.Buffer, err error) { + if r.err != nil { + return nil, r.err + } + if r.last != nil { + buf = r.last + if r.last.Len() > n { + buf, r.last = mem.SplitUnsafe(buf, n) + } else { r.last = nil } - return copied, nil + return buf, nil } if r.closeStream != nil { - n, r.err = r.readClient(p) + buf, r.err = r.readClient(n) } else { - n, r.err = r.read(p) + buf, r.err = r.read(n) } - return n, r.err + return buf, r.err } -func (r *recvBufferReader) read(p []byte) (n int, err error) { +func (r *recvBufferReader) readHeader(header []byte) (n int, err error) { select { case <-r.ctxDone: return 0, ContextErr(r.ctx.Err()) case m := <-r.recv.get(): - return r.readAdditional(m, p) + return r.readHeaderAdditional(m, header) + } +} + +func (r *recvBufferReader) read(n int) (buf mem.Buffer, err error) { + select { + case <-r.ctxDone: + return nil, ContextErr(r.ctx.Err()) + case m := <-r.recv.get(): + return r.readAdditional(m, n) + } +} + +func (r *recvBufferReader) readHeaderClient(header []byte) (n int, err error) { + // If the context is canceled, then closes the stream with nil metadata. + // closeStream writes its error parameter to r.recv as a recvMsg. + // r.readAdditional acts on that message and returns the necessary error. + select { + case <-r.ctxDone: + // Note that this adds the ctx error to the end of recv buffer, and + // reads from the head. This will delay the error until recv buffer is + // empty, thus will delay ctx cancellation in Recv(). + // + // It's done this way to fix a race between ctx cancel and trailer. The + // race was, stream.Recv() may return ctx error if ctxDone wins the + // race, but stream.Trailer() may return a non-nil md because the stream + // was not marked as done when trailer is received. This closeStream + // call will mark stream as done, thus fix the race. + // + // TODO: delaying ctx error seems like a unnecessary side effect. What + // we really want is to mark the stream as done, and return ctx error + // faster. + r.closeStream(ContextErr(r.ctx.Err())) + m := <-r.recv.get() + return r.readHeaderAdditional(m, header) + case m := <-r.recv.get(): + return r.readHeaderAdditional(m, header) } } -func (r *recvBufferReader) readClient(p []byte) (n int, err error) { +func (r *recvBufferReader) readClient(n int) (buf mem.Buffer, err error) { // If the context is canceled, then closes the stream with nil metadata. // closeStream writes its error parameter to r.recv as a recvMsg. // r.readAdditional acts on that message and returns the necessary error. @@ -207,25 +240,40 @@ func (r *recvBufferReader) readClient(p []byte) (n int, err error) { // faster. r.closeStream(ContextErr(r.ctx.Err())) m := <-r.recv.get() - return r.readAdditional(m, p) + return r.readAdditional(m, n) case m := <-r.recv.get(): - return r.readAdditional(m, p) + return r.readAdditional(m, n) } } -func (r *recvBufferReader) readAdditional(m recvMsg, p []byte) (n int, err error) { +func (r *recvBufferReader) readHeaderAdditional(m recvMsg, header []byte) (n int, err error) { r.recv.load() if m.err != nil { + if m.buffer != nil { + m.buffer.Free() + } return 0, m.err } - copied, _ := m.buffer.Read(p) - if m.buffer.Len() == 0 { - r.freeBuffer(m.buffer) - r.last = nil - } else { - r.last = m.buffer + + n, r.last = mem.ReadUnsafe(header, m.buffer) + + return n, nil +} + +func (r *recvBufferReader) readAdditional(m recvMsg, n int) (b mem.Buffer, err error) { + r.recv.load() + if m.err != nil { + if m.buffer != nil { + m.buffer.Free() + } + return nil, m.err + } + + if m.buffer.Len() > n { + m.buffer, r.last = mem.SplitUnsafe(m.buffer, n) } - return copied, nil + + return m.buffer, nil } type streamState uint32 @@ -241,7 +289,7 @@ const ( type Stream struct { id uint32 st ServerTransport // nil for client side Stream - ct *http2Client // nil for server side Stream + ct ClientTransport // nil for server side Stream ctx context.Context // the associated context of the stream cancel context.CancelFunc // always nil for client side Stream done chan struct{} // closed at the end of stream to unblock writers. On the client side. @@ -251,7 +299,7 @@ type Stream struct { recvCompress string sendCompress string buf *recvBuffer - trReader io.Reader + trReader *transportReader fc *inFlow wq *writeQuota @@ -408,7 +456,7 @@ func (s *Stream) TrailersOnly() bool { return s.noHeaders } -// Trailer returns the cached trailer metedata. Note that if it is not called +// Trailer returns the cached trailer metadata. Note that if it is not called // after the entire stream is done, it could return an empty MD. Client // side only. // It can be safely read only after stream has ended that is either read @@ -499,36 +547,87 @@ func (s *Stream) write(m recvMsg) { s.buf.put(m) } -// Read reads all p bytes from the wire for this stream. -func (s *Stream) Read(p []byte) (n int, err error) { +func (s *Stream) ReadHeader(header []byte) (err error) { + // Don't request a read if there was an error earlier + if er := s.trReader.er; er != nil { + return er + } + s.requestRead(len(header)) + for len(header) != 0 { + n, err := s.trReader.ReadHeader(header) + header = header[n:] + if len(header) == 0 { + err = nil + } + if err != nil { + if n > 0 && err == io.EOF { + err = io.ErrUnexpectedEOF + } + return err + } + } + return nil +} + +// Read reads n bytes from the wire for this stream. +func (s *Stream) Read(n int) (data mem.BufferSlice, err error) { // Don't request a read if there was an error earlier - if er := s.trReader.(*transportReader).er; er != nil { - return 0, er + if er := s.trReader.er; er != nil { + return nil, er } - s.requestRead(len(p)) - return io.ReadFull(s.trReader, p) + s.requestRead(n) + for n != 0 { + buf, err := s.trReader.Read(n) + var bufLen int + if buf != nil { + bufLen = buf.Len() + } + n -= bufLen + if n == 0 { + err = nil + } + if err != nil { + if bufLen > 0 && err == io.EOF { + err = io.ErrUnexpectedEOF + } + data.Free() + return nil, err + } + data = append(data, buf) + } + return data, nil } -// tranportReader reads all the data available for this Stream from the transport and +// transportReader reads all the data available for this Stream from the transport and // passes them into the decoder, which converts them into a gRPC message stream. // The error is io.EOF when the stream is done or another non-nil error if // the stream broke. type transportReader struct { - reader io.Reader + reader *recvBufferReader // The handler to control the window update procedure for both this // particular stream and the associated transport. windowHandler func(int) er error } -func (t *transportReader) Read(p []byte) (n int, err error) { - n, err = t.reader.Read(p) +func (t *transportReader) ReadHeader(header []byte) (int, error) { + n, err := t.reader.ReadHeader(header) if err != nil { t.er = err - return + return 0, err + } + t.windowHandler(len(header)) + return n, nil +} + +func (t *transportReader) Read(n int) (mem.Buffer, error) { + buf, err := t.reader.Read(n) + if err != nil { + t.er = err + return buf, err } - t.windowHandler(n) - return + t.windowHandler(buf.Len()) + return buf, nil } // BytesReceived indicates whether any bytes have been received on this stream. @@ -574,6 +673,7 @@ type ServerConfig struct { ChannelzParent *channelz.Server MaxHeaderListSize *uint32 HeaderTableSize *uint32 + BufferPool mem.BufferPool } // ConnectOptions covers all relevant options for communicating with the server. @@ -612,6 +712,8 @@ type ConnectOptions struct { MaxHeaderListSize *uint32 // UseProxy specifies if a proxy should be used. UseProxy bool + // The mem.BufferPool to use when reading/writing to the wire. + BufferPool mem.BufferPool } // NewClientTransport establishes the transport with the required ConnectOptions @@ -673,7 +775,7 @@ type ClientTransport interface { // Write sends the data for the given stream. A nil stream indicates // the write is to be performed on the transport as a whole. - Write(s *Stream, hdr []byte, data []byte, opts *Options) error + Write(s *Stream, hdr []byte, data mem.BufferSlice, opts *Options) error // NewStream creates a Stream for an RPC. NewStream(ctx context.Context, callHdr *CallHdr) (*Stream, error) @@ -725,7 +827,7 @@ type ServerTransport interface { // Write sends the data for the given stream. // Write may not be called on all streams. - Write(s *Stream, hdr []byte, data []byte, opts *Options) error + Write(s *Stream, hdr []byte, data mem.BufferSlice, opts *Options) error // WriteStatus sends the status of a stream to the client. WriteStatus is // the final call made on a stream and always occurs. @@ -798,7 +900,7 @@ var ( // connection is draining. This could be caused by goaway or balancer // removing the address. errStreamDrain = status.Error(codes.Unavailable, "the connection is draining") - // errStreamDone is returned from write at the client side to indiacte application + // errStreamDone is returned from write at the client side to indicate application // layer of an error. errStreamDone = errors.New("the stream is done") // StatusGoAway indicates that the server sent a GOAWAY that included this diff --git a/vendor/google.golang.org/grpc/mem/buffer_pool.go b/vendor/google.golang.org/grpc/mem/buffer_pool.go new file mode 100644 index 00000000000..c37c58c0233 --- /dev/null +++ b/vendor/google.golang.org/grpc/mem/buffer_pool.go @@ -0,0 +1,194 @@ +/* + * + * Copyright 2024 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package mem + +import ( + "sort" + "sync" + + "google.golang.org/grpc/internal" +) + +// BufferPool is a pool of buffers that can be shared and reused, resulting in +// decreased memory allocation. +type BufferPool interface { + // Get returns a buffer with specified length from the pool. + Get(length int) *[]byte + + // Put returns a buffer to the pool. + Put(*[]byte) +} + +var defaultBufferPoolSizes = []int{ + 256, + 4 << 10, // 4KB (go page size) + 16 << 10, // 16KB (max HTTP/2 frame size used by gRPC) + 32 << 10, // 32KB (default buffer size for io.Copy) + 1 << 20, // 1MB +} + +var defaultBufferPool BufferPool + +func init() { + defaultBufferPool = NewTieredBufferPool(defaultBufferPoolSizes...) + + internal.SetDefaultBufferPoolForTesting = func(pool BufferPool) { + defaultBufferPool = pool + } + + internal.SetBufferPoolingThresholdForTesting = func(threshold int) { + bufferPoolingThreshold = threshold + } +} + +// DefaultBufferPool returns the current default buffer pool. It is a BufferPool +// created with NewBufferPool that uses a set of default sizes optimized for +// expected workflows. +func DefaultBufferPool() BufferPool { + return defaultBufferPool +} + +// NewTieredBufferPool returns a BufferPool implementation that uses multiple +// underlying pools of the given pool sizes. +func NewTieredBufferPool(poolSizes ...int) BufferPool { + sort.Ints(poolSizes) + pools := make([]*sizedBufferPool, len(poolSizes)) + for i, s := range poolSizes { + pools[i] = newSizedBufferPool(s) + } + return &tieredBufferPool{ + sizedPools: pools, + } +} + +// tieredBufferPool implements the BufferPool interface with multiple tiers of +// buffer pools for different sizes of buffers. +type tieredBufferPool struct { + sizedPools []*sizedBufferPool + fallbackPool simpleBufferPool +} + +func (p *tieredBufferPool) Get(size int) *[]byte { + return p.getPool(size).Get(size) +} + +func (p *tieredBufferPool) Put(buf *[]byte) { + p.getPool(cap(*buf)).Put(buf) +} + +func (p *tieredBufferPool) getPool(size int) BufferPool { + poolIdx := sort.Search(len(p.sizedPools), func(i int) bool { + return p.sizedPools[i].defaultSize >= size + }) + + if poolIdx == len(p.sizedPools) { + return &p.fallbackPool + } + + return p.sizedPools[poolIdx] +} + +// sizedBufferPool is a BufferPool implementation that is optimized for specific +// buffer sizes. For example, HTTP/2 frames within gRPC have a default max size +// of 16kb and a sizedBufferPool can be configured to only return buffers with a +// capacity of 16kb. Note that however it does not support returning larger +// buffers and in fact panics if such a buffer is requested. Because of this, +// this BufferPool implementation is not meant to be used on its own and rather +// is intended to be embedded in a tieredBufferPool such that Get is only +// invoked when the required size is smaller than or equal to defaultSize. +type sizedBufferPool struct { + pool sync.Pool + defaultSize int +} + +func (p *sizedBufferPool) Get(size int) *[]byte { + buf := p.pool.Get().(*[]byte) + b := *buf + clear(b[:cap(b)]) + *buf = b[:size] + return buf +} + +func (p *sizedBufferPool) Put(buf *[]byte) { + if cap(*buf) < p.defaultSize { + // Ignore buffers that are too small to fit in the pool. Otherwise, when + // Get is called it will panic as it tries to index outside the bounds + // of the buffer. + return + } + p.pool.Put(buf) +} + +func newSizedBufferPool(size int) *sizedBufferPool { + return &sizedBufferPool{ + pool: sync.Pool{ + New: func() any { + buf := make([]byte, size) + return &buf + }, + }, + defaultSize: size, + } +} + +var _ BufferPool = (*simpleBufferPool)(nil) + +// simpleBufferPool is an implementation of the BufferPool interface that +// attempts to pool buffers with a sync.Pool. When Get is invoked, it tries to +// acquire a buffer from the pool but if that buffer is too small, it returns it +// to the pool and creates a new one. +type simpleBufferPool struct { + pool sync.Pool +} + +func (p *simpleBufferPool) Get(size int) *[]byte { + bs, ok := p.pool.Get().(*[]byte) + if ok && cap(*bs) >= size { + *bs = (*bs)[:size] + return bs + } + + // A buffer was pulled from the pool, but it is too small. Put it back in + // the pool and create one large enough. + if ok { + p.pool.Put(bs) + } + + b := make([]byte, size) + return &b +} + +func (p *simpleBufferPool) Put(buf *[]byte) { + p.pool.Put(buf) +} + +var _ BufferPool = NopBufferPool{} + +// NopBufferPool is a buffer pool that returns new buffers without pooling. +type NopBufferPool struct{} + +// Get returns a buffer with specified length from the pool. +func (NopBufferPool) Get(length int) *[]byte { + b := make([]byte, length) + return &b +} + +// Put returns a buffer to the pool. +func (NopBufferPool) Put(*[]byte) { +} diff --git a/vendor/google.golang.org/grpc/mem/buffer_slice.go b/vendor/google.golang.org/grpc/mem/buffer_slice.go new file mode 100644 index 00000000000..d7775cea623 --- /dev/null +++ b/vendor/google.golang.org/grpc/mem/buffer_slice.go @@ -0,0 +1,224 @@ +/* + * + * Copyright 2024 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package mem + +import ( + "compress/flate" + "io" +) + +// BufferSlice offers a means to represent data that spans one or more Buffer +// instances. A BufferSlice is meant to be immutable after creation, and methods +// like Ref create and return copies of the slice. This is why all methods have +// value receivers rather than pointer receivers. +// +// Note that any of the methods that read the underlying buffers such as Ref, +// Len or CopyTo etc., will panic if any underlying buffers have already been +// freed. It is recommended to not directly interact with any of the underlying +// buffers directly, rather such interactions should be mediated through the +// various methods on this type. +// +// By convention, any APIs that return (mem.BufferSlice, error) should reduce +// the burden on the caller by never returning a mem.BufferSlice that needs to +// be freed if the error is non-nil, unless explicitly stated. +type BufferSlice []Buffer + +// Len returns the sum of the length of all the Buffers in this slice. +// +// # Warning +// +// Invoking the built-in len on a BufferSlice will return the number of buffers +// in the slice, and *not* the value returned by this function. +func (s BufferSlice) Len() int { + var length int + for _, b := range s { + length += b.Len() + } + return length +} + +// Ref invokes Ref on each buffer in the slice. +func (s BufferSlice) Ref() { + for _, b := range s { + b.Ref() + } +} + +// Free invokes Buffer.Free() on each Buffer in the slice. +func (s BufferSlice) Free() { + for _, b := range s { + b.Free() + } +} + +// CopyTo copies each of the underlying Buffer's data into the given buffer, +// returning the number of bytes copied. Has the same semantics as the copy +// builtin in that it will copy as many bytes as it can, stopping when either dst +// is full or s runs out of data, returning the minimum of s.Len() and len(dst). +func (s BufferSlice) CopyTo(dst []byte) int { + off := 0 + for _, b := range s { + off += copy(dst[off:], b.ReadOnlyData()) + } + return off +} + +// Materialize concatenates all the underlying Buffer's data into a single +// contiguous buffer using CopyTo. +func (s BufferSlice) Materialize() []byte { + l := s.Len() + if l == 0 { + return nil + } + out := make([]byte, l) + s.CopyTo(out) + return out +} + +// MaterializeToBuffer functions like Materialize except that it writes the data +// to a single Buffer pulled from the given BufferPool. As a special case, if the +// input BufferSlice only actually has one Buffer, this function has nothing to +// do and simply returns said Buffer. +func (s BufferSlice) MaterializeToBuffer(pool BufferPool) Buffer { + if len(s) == 1 { + s[0].Ref() + return s[0] + } + sLen := s.Len() + if sLen == 0 { + return emptyBuffer{} + } + buf := pool.Get(sLen) + s.CopyTo(*buf) + return NewBuffer(buf, pool) +} + +// Reader returns a new Reader for the input slice after taking references to +// each underlying buffer. +func (s BufferSlice) Reader() Reader { + s.Ref() + return &sliceReader{ + data: s, + len: s.Len(), + } +} + +// Reader exposes a BufferSlice's data as an io.Reader, allowing it to interface +// with other parts systems. It also provides an additional convenience method +// Remaining(), which returns the number of unread bytes remaining in the slice. +// Buffers will be freed as they are read. +type Reader interface { + flate.Reader + // Close frees the underlying BufferSlice and never returns an error. Subsequent + // calls to Read will return (0, io.EOF). + Close() error + // Remaining returns the number of unread bytes remaining in the slice. + Remaining() int +} + +type sliceReader struct { + data BufferSlice + len int + // The index into data[0].ReadOnlyData(). + bufferIdx int +} + +func (r *sliceReader) Remaining() int { + return r.len +} + +func (r *sliceReader) Close() error { + r.data.Free() + r.data = nil + r.len = 0 + return nil +} + +func (r *sliceReader) freeFirstBufferIfEmpty() bool { + if len(r.data) == 0 || r.bufferIdx != len(r.data[0].ReadOnlyData()) { + return false + } + + r.data[0].Free() + r.data = r.data[1:] + r.bufferIdx = 0 + return true +} + +func (r *sliceReader) Read(buf []byte) (n int, _ error) { + if r.len == 0 { + return 0, io.EOF + } + + for len(buf) != 0 && r.len != 0 { + // Copy as much as possible from the first Buffer in the slice into the + // given byte slice. + data := r.data[0].ReadOnlyData() + copied := copy(buf, data[r.bufferIdx:]) + r.len -= copied // Reduce len by the number of bytes copied. + r.bufferIdx += copied // Increment the buffer index. + n += copied // Increment the total number of bytes read. + buf = buf[copied:] // Shrink the given byte slice. + + // If we have copied all the data from the first Buffer, free it and advance to + // the next in the slice. + r.freeFirstBufferIfEmpty() + } + + return n, nil +} + +func (r *sliceReader) ReadByte() (byte, error) { + if r.len == 0 { + return 0, io.EOF + } + + // There may be any number of empty buffers in the slice, clear them all until a + // non-empty buffer is reached. This is guaranteed to exit since r.len is not 0. + for r.freeFirstBufferIfEmpty() { + } + + b := r.data[0].ReadOnlyData()[r.bufferIdx] + r.len-- + r.bufferIdx++ + // Free the first buffer in the slice if the last byte was read + r.freeFirstBufferIfEmpty() + return b, nil +} + +var _ io.Writer = (*writer)(nil) + +type writer struct { + buffers *BufferSlice + pool BufferPool +} + +func (w *writer) Write(p []byte) (n int, err error) { + b := Copy(p, w.pool) + *w.buffers = append(*w.buffers, b) + return b.Len(), nil +} + +// NewWriter wraps the given BufferSlice and BufferPool to implement the +// io.Writer interface. Every call to Write copies the contents of the given +// buffer into a new Buffer pulled from the given pool and the Buffer is added to +// the given BufferSlice. +func NewWriter(buffers *BufferSlice, pool BufferPool) io.Writer { + return &writer{buffers: buffers, pool: pool} +} diff --git a/vendor/google.golang.org/grpc/mem/buffers.go b/vendor/google.golang.org/grpc/mem/buffers.go new file mode 100644 index 00000000000..975ceb71853 --- /dev/null +++ b/vendor/google.golang.org/grpc/mem/buffers.go @@ -0,0 +1,252 @@ +/* + * + * Copyright 2024 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// Package mem provides utilities that facilitate memory reuse in byte slices +// that are used as buffers. +// +// # Experimental +// +// Notice: All APIs in this package are EXPERIMENTAL and may be changed or +// removed in a later release. +package mem + +import ( + "fmt" + "sync" + "sync/atomic" +) + +// A Buffer represents a reference counted piece of data (in bytes) that can be +// acquired by a call to NewBuffer() or Copy(). A reference to a Buffer may be +// released by calling Free(), which invokes the free function given at creation +// only after all references are released. +// +// Note that a Buffer is not safe for concurrent access and instead each +// goroutine should use its own reference to the data, which can be acquired via +// a call to Ref(). +// +// Attempts to access the underlying data after releasing the reference to the +// Buffer will panic. +type Buffer interface { + // ReadOnlyData returns the underlying byte slice. Note that it is undefined + // behavior to modify the contents of this slice in any way. + ReadOnlyData() []byte + // Ref increases the reference counter for this Buffer. + Ref() + // Free decrements this Buffer's reference counter and frees the underlying + // byte slice if the counter reaches 0 as a result of this call. + Free() + // Len returns the Buffer's size. + Len() int + + split(n int) (left, right Buffer) + read(buf []byte) (int, Buffer) +} + +var ( + bufferPoolingThreshold = 1 << 10 + + bufferObjectPool = sync.Pool{New: func() any { return new(buffer) }} + refObjectPool = sync.Pool{New: func() any { return new(atomic.Int32) }} +) + +func IsBelowBufferPoolingThreshold(size int) bool { + return size <= bufferPoolingThreshold +} + +type buffer struct { + origData *[]byte + data []byte + refs *atomic.Int32 + pool BufferPool +} + +func newBuffer() *buffer { + return bufferObjectPool.Get().(*buffer) +} + +// NewBuffer creates a new Buffer from the given data, initializing the reference +// counter to 1. The data will then be returned to the given pool when all +// references to the returned Buffer are released. As a special case to avoid +// additional allocations, if the given buffer pool is nil, the returned buffer +// will be a "no-op" Buffer where invoking Buffer.Free() does nothing and the +// underlying data is never freed. +// +// Note that the backing array of the given data is not copied. +func NewBuffer(data *[]byte, pool BufferPool) Buffer { + if pool == nil || IsBelowBufferPoolingThreshold(len(*data)) { + return (SliceBuffer)(*data) + } + b := newBuffer() + b.origData = data + b.data = *data + b.pool = pool + b.refs = refObjectPool.Get().(*atomic.Int32) + b.refs.Add(1) + return b +} + +// Copy creates a new Buffer from the given data, initializing the reference +// counter to 1. +// +// It acquires a []byte from the given pool and copies over the backing array +// of the given data. The []byte acquired from the pool is returned to the +// pool when all references to the returned Buffer are released. +func Copy(data []byte, pool BufferPool) Buffer { + if IsBelowBufferPoolingThreshold(len(data)) { + buf := make(SliceBuffer, len(data)) + copy(buf, data) + return buf + } + + buf := pool.Get(len(data)) + copy(*buf, data) + return NewBuffer(buf, pool) +} + +func (b *buffer) ReadOnlyData() []byte { + if b.refs == nil { + panic("Cannot read freed buffer") + } + return b.data +} + +func (b *buffer) Ref() { + if b.refs == nil { + panic("Cannot ref freed buffer") + } + b.refs.Add(1) +} + +func (b *buffer) Free() { + if b.refs == nil { + panic("Cannot free freed buffer") + } + + refs := b.refs.Add(-1) + switch { + case refs > 0: + return + case refs == 0: + if b.pool != nil { + b.pool.Put(b.origData) + } + + refObjectPool.Put(b.refs) + b.origData = nil + b.data = nil + b.refs = nil + b.pool = nil + bufferObjectPool.Put(b) + default: + panic("Cannot free freed buffer") + } +} + +func (b *buffer) Len() int { + return len(b.ReadOnlyData()) +} + +func (b *buffer) split(n int) (Buffer, Buffer) { + if b.refs == nil { + panic("Cannot split freed buffer") + } + + b.refs.Add(1) + split := newBuffer() + split.origData = b.origData + split.data = b.data[n:] + split.refs = b.refs + split.pool = b.pool + + b.data = b.data[:n] + + return b, split +} + +func (b *buffer) read(buf []byte) (int, Buffer) { + if b.refs == nil { + panic("Cannot read freed buffer") + } + + n := copy(buf, b.data) + if n == len(b.data) { + b.Free() + return n, nil + } + + b.data = b.data[n:] + return n, b +} + +// String returns a string representation of the buffer. May be used for +// debugging purposes. +func (b *buffer) String() string { + return fmt.Sprintf("mem.Buffer(%p, data: %p, length: %d)", b, b.ReadOnlyData(), len(b.ReadOnlyData())) +} + +func ReadUnsafe(dst []byte, buf Buffer) (int, Buffer) { + return buf.read(dst) +} + +// SplitUnsafe modifies the receiver to point to the first n bytes while it +// returns a new reference to the remaining bytes. The returned Buffer functions +// just like a normal reference acquired using Ref(). +func SplitUnsafe(buf Buffer, n int) (left, right Buffer) { + return buf.split(n) +} + +type emptyBuffer struct{} + +func (e emptyBuffer) ReadOnlyData() []byte { + return nil +} + +func (e emptyBuffer) Ref() {} +func (e emptyBuffer) Free() {} + +func (e emptyBuffer) Len() int { + return 0 +} + +func (e emptyBuffer) split(n int) (left, right Buffer) { + return e, e +} + +func (e emptyBuffer) read(buf []byte) (int, Buffer) { + return 0, e +} + +type SliceBuffer []byte + +func (s SliceBuffer) ReadOnlyData() []byte { return s } +func (s SliceBuffer) Ref() {} +func (s SliceBuffer) Free() {} +func (s SliceBuffer) Len() int { return len(s) } + +func (s SliceBuffer) split(n int) (left, right Buffer) { + return s[:n], s[n:] +} + +func (s SliceBuffer) read(buf []byte) (int, Buffer) { + n := copy(buf, s) + if n == len(s) { + return n, nil + } + return n, s[n:] +} diff --git a/vendor/google.golang.org/grpc/metadata/metadata.go b/vendor/google.golang.org/grpc/metadata/metadata.go index 1e9485fd6e2..d2e15253bbf 100644 --- a/vendor/google.golang.org/grpc/metadata/metadata.go +++ b/vendor/google.golang.org/grpc/metadata/metadata.go @@ -213,11 +213,6 @@ func FromIncomingContext(ctx context.Context) (MD, bool) { // ValueFromIncomingContext returns the metadata value corresponding to the metadata // key from the incoming metadata if it exists. Keys are matched in a case insensitive // manner. -// -// # Experimental -// -// Notice: This API is EXPERIMENTAL and may be changed or removed in a -// later release. func ValueFromIncomingContext(ctx context.Context, key string) []string { md, ok := ctx.Value(mdIncomingKey{}).(MD) if !ok { @@ -228,7 +223,7 @@ func ValueFromIncomingContext(ctx context.Context, key string) []string { return copyOf(v) } for k, v := range md { - // Case insenitive comparison: MD is a map, and there's no guarantee + // Case insensitive comparison: MD is a map, and there's no guarantee // that the MD attached to the context is created using our helper // functions. if strings.EqualFold(k, key) { diff --git a/vendor/google.golang.org/grpc/preloader.go b/vendor/google.golang.org/grpc/preloader.go index 73bd6336433..e87a17f36a5 100644 --- a/vendor/google.golang.org/grpc/preloader.go +++ b/vendor/google.golang.org/grpc/preloader.go @@ -20,6 +20,7 @@ package grpc import ( "google.golang.org/grpc/codes" + "google.golang.org/grpc/mem" "google.golang.org/grpc/status" ) @@ -31,9 +32,10 @@ import ( // later release. type PreparedMsg struct { // Struct for preparing msg before sending them - encodedData []byte + encodedData mem.BufferSlice hdr []byte - payload []byte + payload mem.BufferSlice + pf payloadFormat } // Encode marshalls and compresses the message using the codec and compressor for the stream. @@ -57,11 +59,27 @@ func (p *PreparedMsg) Encode(s Stream, msg any) error { if err != nil { return err } - p.encodedData = data - compData, err := compress(data, rpcInfo.preloaderInfo.cp, rpcInfo.preloaderInfo.comp) + + materializedData := data.Materialize() + data.Free() + p.encodedData = mem.BufferSlice{mem.NewBuffer(&materializedData, nil)} + + // TODO: it should be possible to grab the bufferPool from the underlying + // stream implementation with a type cast to its actual type (such as + // addrConnStream) and accessing the buffer pool directly. + var compData mem.BufferSlice + compData, p.pf, err = compress(p.encodedData, rpcInfo.preloaderInfo.cp, rpcInfo.preloaderInfo.comp, mem.DefaultBufferPool()) if err != nil { return err } - p.hdr, p.payload = msgHeader(data, compData) + + if p.pf.isCompressed() { + materializedCompData := compData.Materialize() + compData.Free() + compData = mem.BufferSlice{mem.NewBuffer(&materializedCompData, nil)} + } + + p.hdr, p.payload = msgHeader(p.encodedData, compData, p.pf) + return nil } diff --git a/vendor/google.golang.org/grpc/regenerate.sh b/vendor/google.golang.org/grpc/regenerate.sh deleted file mode 100644 index 3edca296c22..00000000000 --- a/vendor/google.golang.org/grpc/regenerate.sh +++ /dev/null @@ -1,123 +0,0 @@ -#!/bin/bash -# Copyright 2020 gRPC authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -eu -o pipefail - -WORKDIR=$(mktemp -d) - -function finish { - rm -rf "$WORKDIR" -} -trap finish EXIT - -export GOBIN=${WORKDIR}/bin -export PATH=${GOBIN}:${PATH} -mkdir -p ${GOBIN} - -echo "remove existing generated files" -# grpc_testing_not_regenerate/*.pb.go is not re-generated, -# see grpc_testing_not_regenerate/README.md for details. -rm -f $(find . -name '*.pb.go' | grep -v 'grpc_testing_not_regenerate') - -echo "go install google.golang.org/protobuf/cmd/protoc-gen-go" -(cd test/tools && go install google.golang.org/protobuf/cmd/protoc-gen-go) - -echo "go install cmd/protoc-gen-go-grpc" -(cd cmd/protoc-gen-go-grpc && go install .) - -echo "git clone https://github.com/grpc/grpc-proto" -git clone --quiet https://github.com/grpc/grpc-proto ${WORKDIR}/grpc-proto - -echo "git clone https://github.com/protocolbuffers/protobuf" -git clone --quiet https://github.com/protocolbuffers/protobuf ${WORKDIR}/protobuf - -# Pull in code.proto as a proto dependency -mkdir -p ${WORKDIR}/googleapis/google/rpc -echo "curl https://raw.githubusercontent.com/googleapis/googleapis/master/google/rpc/code.proto" -curl --silent https://raw.githubusercontent.com/googleapis/googleapis/master/google/rpc/code.proto > ${WORKDIR}/googleapis/google/rpc/code.proto - -mkdir -p ${WORKDIR}/out - -# Generates sources without the embed requirement -LEGACY_SOURCES=( - ${WORKDIR}/grpc-proto/grpc/binlog/v1/binarylog.proto - ${WORKDIR}/grpc-proto/grpc/channelz/v1/channelz.proto - ${WORKDIR}/grpc-proto/grpc/health/v1/health.proto - ${WORKDIR}/grpc-proto/grpc/lb/v1/load_balancer.proto - profiling/proto/service.proto - ${WORKDIR}/grpc-proto/grpc/reflection/v1alpha/reflection.proto - ${WORKDIR}/grpc-proto/grpc/reflection/v1/reflection.proto -) - -# Generates only the new gRPC Service symbols -SOURCES=( - $(git ls-files --exclude-standard --cached --others "*.proto" | grep -v '^profiling/proto/service.proto$') - ${WORKDIR}/grpc-proto/grpc/gcp/altscontext.proto - ${WORKDIR}/grpc-proto/grpc/gcp/handshaker.proto - ${WORKDIR}/grpc-proto/grpc/gcp/transport_security_common.proto - ${WORKDIR}/grpc-proto/grpc/lookup/v1/rls.proto - ${WORKDIR}/grpc-proto/grpc/lookup/v1/rls_config.proto - ${WORKDIR}/grpc-proto/grpc/testing/*.proto - ${WORKDIR}/grpc-proto/grpc/core/*.proto -) - -# These options of the form 'Mfoo.proto=bar' instruct the codegen to use an -# import path of 'bar' in the generated code when 'foo.proto' is imported in -# one of the sources. -# -# Note that the protos listed here are all for testing purposes. All protos to -# be used externally should have a go_package option (and they don't need to be -# listed here). -OPTS=Mgrpc/core/stats.proto=google.golang.org/grpc/interop/grpc_testing/core,\ -Mgrpc/testing/benchmark_service.proto=google.golang.org/grpc/interop/grpc_testing,\ -Mgrpc/testing/stats.proto=google.golang.org/grpc/interop/grpc_testing,\ -Mgrpc/testing/report_qps_scenario_service.proto=google.golang.org/grpc/interop/grpc_testing,\ -Mgrpc/testing/messages.proto=google.golang.org/grpc/interop/grpc_testing,\ -Mgrpc/testing/worker_service.proto=google.golang.org/grpc/interop/grpc_testing,\ -Mgrpc/testing/control.proto=google.golang.org/grpc/interop/grpc_testing,\ -Mgrpc/testing/test.proto=google.golang.org/grpc/interop/grpc_testing,\ -Mgrpc/testing/payloads.proto=google.golang.org/grpc/interop/grpc_testing,\ -Mgrpc/testing/empty.proto=google.golang.org/grpc/interop/grpc_testing - -for src in ${SOURCES[@]}; do - echo "protoc ${src}" - protoc --go_out=${OPTS}:${WORKDIR}/out --go-grpc_out=${OPTS},use_generic_streams_experimental=true:${WORKDIR}/out \ - -I"." \ - -I${WORKDIR}/grpc-proto \ - -I${WORKDIR}/googleapis \ - -I${WORKDIR}/protobuf/src \ - ${src} -done - -for src in ${LEGACY_SOURCES[@]}; do - echo "protoc ${src}" - protoc --go_out=${OPTS}:${WORKDIR}/out --go-grpc_out=${OPTS},require_unimplemented_servers=false:${WORKDIR}/out \ - -I"." \ - -I${WORKDIR}/grpc-proto \ - -I${WORKDIR}/googleapis \ - -I${WORKDIR}/protobuf/src \ - ${src} -done - -# The go_package option in grpc/lookup/v1/rls.proto doesn't match the -# current location. Move it into the right place. -mkdir -p ${WORKDIR}/out/google.golang.org/grpc/internal/proto/grpc_lookup_v1 -mv ${WORKDIR}/out/google.golang.org/grpc/lookup/grpc_lookup_v1/* ${WORKDIR}/out/google.golang.org/grpc/internal/proto/grpc_lookup_v1 - -# grpc_testing_not_regenerate/*.pb.go are not re-generated, -# see grpc_testing_not_regenerate/README.md for details. -rm ${WORKDIR}/out/google.golang.org/grpc/reflection/test/grpc_testing_not_regenerate/*.pb.go - -cp -R ${WORKDIR}/out/google.golang.org/grpc/* . diff --git a/vendor/google.golang.org/grpc/resolver_wrapper.go b/vendor/google.golang.org/grpc/resolver_wrapper.go index c5fb45236fa..23bb3fb2582 100644 --- a/vendor/google.golang.org/grpc/resolver_wrapper.go +++ b/vendor/google.golang.org/grpc/resolver_wrapper.go @@ -66,7 +66,7 @@ func newCCResolverWrapper(cc *ClientConn) *ccResolverWrapper { // any newly created ccResolverWrapper, except that close may be called instead. func (ccr *ccResolverWrapper) start() error { errCh := make(chan error) - ccr.serializer.Schedule(func(ctx context.Context) { + ccr.serializer.TrySchedule(func(ctx context.Context) { if ctx.Err() != nil { return } @@ -85,7 +85,7 @@ func (ccr *ccResolverWrapper) start() error { } func (ccr *ccResolverWrapper) resolveNow(o resolver.ResolveNowOptions) { - ccr.serializer.Schedule(func(ctx context.Context) { + ccr.serializer.TrySchedule(func(ctx context.Context) { if ctx.Err() != nil || ccr.resolver == nil { return } @@ -102,7 +102,7 @@ func (ccr *ccResolverWrapper) close() { ccr.closed = true ccr.mu.Unlock() - ccr.serializer.Schedule(func(context.Context) { + ccr.serializer.TrySchedule(func(context.Context) { if ccr.resolver == nil { return } @@ -177,6 +177,9 @@ func (ccr *ccResolverWrapper) ParseServiceConfig(scJSON string) *serviceconfig.P // addChannelzTraceEvent adds a channelz trace event containing the new // state received from resolver implementations. func (ccr *ccResolverWrapper) addChannelzTraceEvent(s resolver.State) { + if !logger.V(0) && !channelz.IsOn() { + return + } var updates []string var oldSC, newSC *ServiceConfig var oldOK, newOK bool diff --git a/vendor/google.golang.org/grpc/rpc_util.go b/vendor/google.golang.org/grpc/rpc_util.go index fdd49e6e915..db8865ec3fd 100644 --- a/vendor/google.golang.org/grpc/rpc_util.go +++ b/vendor/google.golang.org/grpc/rpc_util.go @@ -19,7 +19,6 @@ package grpc import ( - "bytes" "compress/gzip" "context" "encoding/binary" @@ -35,6 +34,7 @@ import ( "google.golang.org/grpc/encoding" "google.golang.org/grpc/encoding/proto" "google.golang.org/grpc/internal/transport" + "google.golang.org/grpc/mem" "google.golang.org/grpc/metadata" "google.golang.org/grpc/peer" "google.golang.org/grpc/stats" @@ -271,17 +271,13 @@ func (o PeerCallOption) after(c *callInfo, attempt *csAttempt) { } } -// WaitForReady configures the action to take when an RPC is attempted on broken -// connections or unreachable servers. If waitForReady is false and the -// connection is in the TRANSIENT_FAILURE state, the RPC will fail -// immediately. Otherwise, the RPC client will block the call until a -// connection is available (or the call is canceled or times out) and will -// retry the call if it fails due to a transient error. gRPC will not retry if -// data was written to the wire unless the server indicates it did not process -// the data. Please refer to -// https://github.com/grpc/grpc/blob/master/doc/wait-for-ready.md. +// WaitForReady configures the RPC's behavior when the client is in +// TRANSIENT_FAILURE, which occurs when all addresses fail to connect. If +// waitForReady is false, the RPC will fail immediately. Otherwise, the client +// will wait until a connection becomes available or the RPC's deadline is +// reached. // -// By default, RPCs don't "wait for ready". +// By default, RPCs do not "wait for ready". func WaitForReady(waitForReady bool) CallOption { return FailFastCallOption{FailFast: !waitForReady} } @@ -515,11 +511,51 @@ type ForceCodecCallOption struct { } func (o ForceCodecCallOption) before(c *callInfo) error { - c.codec = o.Codec + c.codec = newCodecV1Bridge(o.Codec) return nil } func (o ForceCodecCallOption) after(c *callInfo, attempt *csAttempt) {} +// ForceCodecV2 returns a CallOption that will set codec to be used for all +// request and response messages for a call. The result of calling Name() will +// be used as the content-subtype after converting to lowercase, unless +// CallContentSubtype is also used. +// +// See Content-Type on +// https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md#requests for +// more details. Also see the documentation on RegisterCodec and +// CallContentSubtype for more details on the interaction between Codec and +// content-subtype. +// +// This function is provided for advanced users; prefer to use only +// CallContentSubtype to select a registered codec instead. +// +// # Experimental +// +// Notice: This API is EXPERIMENTAL and may be changed or removed in a +// later release. +func ForceCodecV2(codec encoding.CodecV2) CallOption { + return ForceCodecV2CallOption{CodecV2: codec} +} + +// ForceCodecV2CallOption is a CallOption that indicates the codec used for +// marshaling messages. +// +// # Experimental +// +// Notice: This type is EXPERIMENTAL and may be changed or removed in a +// later release. +type ForceCodecV2CallOption struct { + CodecV2 encoding.CodecV2 +} + +func (o ForceCodecV2CallOption) before(c *callInfo) error { + c.codec = o.CodecV2 + return nil +} + +func (o ForceCodecV2CallOption) after(c *callInfo, attempt *csAttempt) {} + // CallCustomCodec behaves like ForceCodec, but accepts a grpc.Codec instead of // an encoding.Codec. // @@ -540,7 +576,7 @@ type CustomCodecCallOption struct { } func (o CustomCodecCallOption) before(c *callInfo) error { - c.codec = o.Codec + c.codec = newCodecV0Bridge(o.Codec) return nil } func (o CustomCodecCallOption) after(c *callInfo, attempt *csAttempt) {} @@ -581,19 +617,28 @@ const ( compressionMade payloadFormat = 1 // compressed ) +func (pf payloadFormat) isCompressed() bool { + return pf == compressionMade +} + +type streamReader interface { + ReadHeader(header []byte) error + Read(n int) (mem.BufferSlice, error) +} + // parser reads complete gRPC messages from the underlying reader. type parser struct { // r is the underlying reader. // See the comment on recvMsg for the permissible // error types. - r io.Reader + r streamReader // The header of a gRPC message. Find more detail at // https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md header [5]byte - // recvBufferPool is the pool of shared receive buffers. - recvBufferPool SharedBufferPool + // bufferPool is the pool of shared receive buffers. + bufferPool mem.BufferPool } // recvMsg reads a complete gRPC message from the stream. @@ -608,14 +653,15 @@ type parser struct { // - an error from the status package // // No other error values or types must be returned, which also means -// that the underlying io.Reader must not return an incompatible +// that the underlying streamReader must not return an incompatible // error. -func (p *parser) recvMsg(maxReceiveMessageSize int) (pf payloadFormat, msg []byte, err error) { - if _, err := p.r.Read(p.header[:]); err != nil { +func (p *parser) recvMsg(maxReceiveMessageSize int) (payloadFormat, mem.BufferSlice, error) { + err := p.r.ReadHeader(p.header[:]) + if err != nil { return 0, nil, err } - pf = payloadFormat(p.header[0]) + pf := payloadFormat(p.header[0]) length := binary.BigEndian.Uint32(p.header[1:]) if length == 0 { @@ -627,20 +673,21 @@ func (p *parser) recvMsg(maxReceiveMessageSize int) (pf payloadFormat, msg []byt if int(length) > maxReceiveMessageSize { return 0, nil, status.Errorf(codes.ResourceExhausted, "grpc: received message larger than max (%d vs. %d)", length, maxReceiveMessageSize) } - msg = p.recvBufferPool.Get(int(length)) - if _, err := p.r.Read(msg); err != nil { + + data, err := p.r.Read(int(length)) + if err != nil { if err == io.EOF { err = io.ErrUnexpectedEOF } return 0, nil, err } - return pf, msg, nil + return pf, data, nil } // encode serializes msg and returns a buffer containing the message, or an // error if it is too large to be transmitted by grpc. If msg is nil, it // generates an empty message. -func encode(c baseCodec, msg any) ([]byte, error) { +func encode(c baseCodec, msg any) (mem.BufferSlice, error) { if msg == nil { // NOTE: typed nils will not be caught by this check return nil, nil } @@ -648,7 +695,8 @@ func encode(c baseCodec, msg any) ([]byte, error) { if err != nil { return nil, status.Errorf(codes.Internal, "grpc: error while marshaling: %v", err.Error()) } - if uint(len(b)) > math.MaxUint32 { + if uint(b.Len()) > math.MaxUint32 { + b.Free() return nil, status.Errorf(codes.ResourceExhausted, "grpc: message too large (%d bytes)", len(b)) } return b, nil @@ -659,34 +707,41 @@ func encode(c baseCodec, msg any) ([]byte, error) { // indicating no compression was done. // // TODO(dfawley): eliminate cp parameter by wrapping Compressor in an encoding.Compressor. -func compress(in []byte, cp Compressor, compressor encoding.Compressor) ([]byte, error) { - if compressor == nil && cp == nil { - return nil, nil - } - if len(in) == 0 { - return nil, nil +func compress(in mem.BufferSlice, cp Compressor, compressor encoding.Compressor, pool mem.BufferPool) (mem.BufferSlice, payloadFormat, error) { + if (compressor == nil && cp == nil) || in.Len() == 0 { + return nil, compressionNone, nil } + var out mem.BufferSlice + w := mem.NewWriter(&out, pool) wrapErr := func(err error) error { + out.Free() return status.Errorf(codes.Internal, "grpc: error while compressing: %v", err.Error()) } - cbuf := &bytes.Buffer{} if compressor != nil { - z, err := compressor.Compress(cbuf) + z, err := compressor.Compress(w) if err != nil { - return nil, wrapErr(err) + return nil, 0, wrapErr(err) } - if _, err := z.Write(in); err != nil { - return nil, wrapErr(err) + for _, b := range in { + if _, err := z.Write(b.ReadOnlyData()); err != nil { + return nil, 0, wrapErr(err) + } } if err := z.Close(); err != nil { - return nil, wrapErr(err) + return nil, 0, wrapErr(err) } } else { - if err := cp.Do(cbuf, in); err != nil { - return nil, wrapErr(err) + // This is obviously really inefficient since it fully materializes the data, but + // there is no way around this with the old Compressor API. At least it attempts + // to return the buffer to the provider, in the hopes it can be reused (maybe + // even by a subsequent call to this very function). + buf := in.MaterializeToBuffer(pool) + defer buf.Free() + if err := cp.Do(w, buf.ReadOnlyData()); err != nil { + return nil, 0, wrapErr(err) } } - return cbuf.Bytes(), nil + return out, compressionMade, nil } const ( @@ -697,33 +752,36 @@ const ( // msgHeader returns a 5-byte header for the message being transmitted and the // payload, which is compData if non-nil or data otherwise. -func msgHeader(data, compData []byte) (hdr []byte, payload []byte) { +func msgHeader(data, compData mem.BufferSlice, pf payloadFormat) (hdr []byte, payload mem.BufferSlice) { hdr = make([]byte, headerLen) - if compData != nil { - hdr[0] = byte(compressionMade) - data = compData + hdr[0] = byte(pf) + + var length uint32 + if pf.isCompressed() { + length = uint32(compData.Len()) + payload = compData } else { - hdr[0] = byte(compressionNone) + length = uint32(data.Len()) + payload = data } // Write length of payload into buf - binary.BigEndian.PutUint32(hdr[payloadLen:], uint32(len(data))) - return hdr, data + binary.BigEndian.PutUint32(hdr[payloadLen:], length) + return hdr, payload } -func outPayload(client bool, msg any, data, payload []byte, t time.Time) *stats.OutPayload { +func outPayload(client bool, msg any, dataLength, payloadLength int, t time.Time) *stats.OutPayload { return &stats.OutPayload{ Client: client, Payload: msg, - Data: data, - Length: len(data), - WireLength: len(payload) + headerLen, - CompressedLength: len(payload), + Length: dataLength, + WireLength: payloadLength + headerLen, + CompressedLength: payloadLength, SentTime: t, } } -func checkRecvPayload(pf payloadFormat, recvCompress string, haveCompressor bool) *status.Status { +func checkRecvPayload(pf payloadFormat, recvCompress string, haveCompressor bool, isServer bool) *status.Status { switch pf { case compressionNone: case compressionMade: @@ -731,7 +789,11 @@ func checkRecvPayload(pf payloadFormat, recvCompress string, haveCompressor bool return status.New(codes.Internal, "grpc: compressed flag set with identity or empty encoding") } if !haveCompressor { - return status.Newf(codes.Unimplemented, "grpc: Decompressor is not installed for grpc-encoding %q", recvCompress) + if isServer { + return status.Newf(codes.Unimplemented, "grpc: Decompressor is not installed for grpc-encoding %q", recvCompress) + } else { + return status.Newf(codes.Internal, "grpc: Decompressor is not installed for grpc-encoding %q", recvCompress) + } } default: return status.Newf(codes.Internal, "grpc: received unexpected payload format %d", pf) @@ -741,104 +803,129 @@ func checkRecvPayload(pf payloadFormat, recvCompress string, haveCompressor bool type payloadInfo struct { compressedLength int // The compressed length got from wire. - uncompressedBytes []byte + uncompressedBytes mem.BufferSlice +} + +func (p *payloadInfo) free() { + if p != nil && p.uncompressedBytes != nil { + p.uncompressedBytes.Free() + } } // recvAndDecompress reads a message from the stream, decompressing it if necessary. // // Cancelling the returned cancel function releases the buffer back to the pool. So the caller should cancel as soon as // the buffer is no longer needed. -func recvAndDecompress(p *parser, s *transport.Stream, dc Decompressor, maxReceiveMessageSize int, payInfo *payloadInfo, compressor encoding.Compressor, -) (uncompressedBuf []byte, cancel func(), err error) { - pf, compressedBuf, err := p.recvMsg(maxReceiveMessageSize) +// TODO: Refactor this function to reduce the number of arguments. +// See: https://google.github.io/styleguide/go/best-practices.html#function-argument-lists +func recvAndDecompress(p *parser, s *transport.Stream, dc Decompressor, maxReceiveMessageSize int, payInfo *payloadInfo, compressor encoding.Compressor, isServer bool, +) (out mem.BufferSlice, err error) { + pf, compressed, err := p.recvMsg(maxReceiveMessageSize) if err != nil { - return nil, nil, err + return nil, err } - if st := checkRecvPayload(pf, s.RecvCompress(), compressor != nil || dc != nil); st != nil { - return nil, nil, st.Err() + compressedLength := compressed.Len() + + if st := checkRecvPayload(pf, s.RecvCompress(), compressor != nil || dc != nil, isServer); st != nil { + compressed.Free() + return nil, st.Err() } var size int - if pf == compressionMade { + if pf.isCompressed() { + defer compressed.Free() + // To match legacy behavior, if the decompressor is set by WithDecompressor or RPCDecompressor, // use this decompressor as the default. if dc != nil { - uncompressedBuf, err = dc.Do(bytes.NewReader(compressedBuf)) + var uncompressedBuf []byte + uncompressedBuf, err = dc.Do(compressed.Reader()) + if err == nil { + out = mem.BufferSlice{mem.NewBuffer(&uncompressedBuf, nil)} + } size = len(uncompressedBuf) } else { - uncompressedBuf, size, err = decompress(compressor, compressedBuf, maxReceiveMessageSize) + out, size, err = decompress(compressor, compressed, maxReceiveMessageSize, p.bufferPool) } if err != nil { - return nil, nil, status.Errorf(codes.Internal, "grpc: failed to decompress the received message: %v", err) + return nil, status.Errorf(codes.Internal, "grpc: failed to decompress the received message: %v", err) } if size > maxReceiveMessageSize { + out.Free() // TODO: Revisit the error code. Currently keep it consistent with java // implementation. - return nil, nil, status.Errorf(codes.ResourceExhausted, "grpc: received message after decompression larger than max (%d vs. %d)", size, maxReceiveMessageSize) + return nil, status.Errorf(codes.ResourceExhausted, "grpc: received message after decompression larger than max (%d vs. %d)", size, maxReceiveMessageSize) } } else { - uncompressedBuf = compressedBuf + out = compressed } if payInfo != nil { - payInfo.compressedLength = len(compressedBuf) - payInfo.uncompressedBytes = uncompressedBuf - - cancel = func() {} - } else { - cancel = func() { - p.recvBufferPool.Put(&compressedBuf) - } + payInfo.compressedLength = compressedLength + out.Ref() + payInfo.uncompressedBytes = out } - return uncompressedBuf, cancel, nil + return out, nil } // Using compressor, decompress d, returning data and size. // Optionally, if data will be over maxReceiveMessageSize, just return the size. -func decompress(compressor encoding.Compressor, d []byte, maxReceiveMessageSize int) ([]byte, int, error) { - dcReader, err := compressor.Decompress(bytes.NewReader(d)) +func decompress(compressor encoding.Compressor, d mem.BufferSlice, maxReceiveMessageSize int, pool mem.BufferPool) (mem.BufferSlice, int, error) { + dcReader, err := compressor.Decompress(d.Reader()) if err != nil { return nil, 0, err } - if sizer, ok := compressor.(interface { - DecompressedSize(compressedBytes []byte) int - }); ok { - if size := sizer.DecompressedSize(d); size >= 0 { - if size > maxReceiveMessageSize { - return nil, size, nil - } - // size is used as an estimate to size the buffer, but we - // will read more data if available. - // +MinRead so ReadFrom will not reallocate if size is correct. - // - // TODO: If we ensure that the buffer size is the same as the DecompressedSize, - // we can also utilize the recv buffer pool here. - buf := bytes.NewBuffer(make([]byte, 0, size+bytes.MinRead)) - bytesRead, err := buf.ReadFrom(io.LimitReader(dcReader, int64(maxReceiveMessageSize)+1)) - return buf.Bytes(), int(bytesRead), err - } + + // TODO: Can/should this still be preserved with the new BufferSlice API? Are + // there any actual benefits to allocating a single large buffer instead of + // multiple smaller ones? + //if sizer, ok := compressor.(interface { + // DecompressedSize(compressedBytes []byte) int + //}); ok { + // if size := sizer.DecompressedSize(d); size >= 0 { + // if size > maxReceiveMessageSize { + // return nil, size, nil + // } + // // size is used as an estimate to size the buffer, but we + // // will read more data if available. + // // +MinRead so ReadFrom will not reallocate if size is correct. + // // + // // TODO: If we ensure that the buffer size is the same as the DecompressedSize, + // // we can also utilize the recv buffer pool here. + // buf := bytes.NewBuffer(make([]byte, 0, size+bytes.MinRead)) + // bytesRead, err := buf.ReadFrom(io.LimitReader(dcReader, int64(maxReceiveMessageSize)+1)) + // return buf.Bytes(), int(bytesRead), err + // } + //} + + var out mem.BufferSlice + _, err = io.Copy(mem.NewWriter(&out, pool), io.LimitReader(dcReader, int64(maxReceiveMessageSize)+1)) + if err != nil { + out.Free() + return nil, 0, err } - // Read from LimitReader with limit max+1. So if the underlying - // reader is over limit, the result will be bigger than max. - d, err = io.ReadAll(io.LimitReader(dcReader, int64(maxReceiveMessageSize)+1)) - return d, len(d), err + return out, out.Len(), nil } // For the two compressor parameters, both should not be set, but if they are, // dc takes precedence over compressor. // TODO(dfawley): wrap the old compressor/decompressor using the new API? -func recv(p *parser, c baseCodec, s *transport.Stream, dc Decompressor, m any, maxReceiveMessageSize int, payInfo *payloadInfo, compressor encoding.Compressor) error { - buf, cancel, err := recvAndDecompress(p, s, dc, maxReceiveMessageSize, payInfo, compressor) +func recv(p *parser, c baseCodec, s *transport.Stream, dc Decompressor, m any, maxReceiveMessageSize int, payInfo *payloadInfo, compressor encoding.Compressor, isServer bool) error { + data, err := recvAndDecompress(p, s, dc, maxReceiveMessageSize, payInfo, compressor, isServer) if err != nil { return err } - defer cancel() - if err := c.Unmarshal(buf, m); err != nil { + // If the codec wants its own reference to the data, it can get it. Otherwise, always + // free the buffers. + defer data.Free() + + if err := c.Unmarshal(data, m); err != nil { return status.Errorf(codes.Internal, "grpc: failed to unmarshal the received message: %v", err) } + return nil } @@ -941,7 +1028,7 @@ func setCallInfoCodec(c *callInfo) error { // encoding.Codec (Name vs. String method name). We only support // setting content subtype from encoding.Codec to avoid a behavior // change with the deprecated version. - if ec, ok := c.codec.(encoding.Codec); ok { + if ec, ok := c.codec.(encoding.CodecV2); ok { c.contentSubtype = strings.ToLower(ec.Name()) } } @@ -950,12 +1037,12 @@ func setCallInfoCodec(c *callInfo) error { if c.contentSubtype == "" { // No codec specified in CallOptions; use proto by default. - c.codec = encoding.GetCodec(proto.Name) + c.codec = getCodec(proto.Name) return nil } // c.contentSubtype is already lowercased in CallContentSubtype - c.codec = encoding.GetCodec(c.contentSubtype) + c.codec = getCodec(c.contentSubtype) if c.codec == nil { return status.Errorf(codes.Internal, "no codec registered for content-subtype %s", c.contentSubtype) } diff --git a/vendor/google.golang.org/grpc/server.go b/vendor/google.golang.org/grpc/server.go index 89f8e4792bf..457d27338f7 100644 --- a/vendor/google.golang.org/grpc/server.go +++ b/vendor/google.golang.org/grpc/server.go @@ -45,6 +45,7 @@ import ( "google.golang.org/grpc/internal/grpcutil" "google.golang.org/grpc/internal/transport" "google.golang.org/grpc/keepalive" + "google.golang.org/grpc/mem" "google.golang.org/grpc/metadata" "google.golang.org/grpc/peer" "google.golang.org/grpc/stats" @@ -80,7 +81,7 @@ func init() { } internal.BinaryLogger = binaryLogger internal.JoinServerOptions = newJoinServerOption - internal.RecvBufferPool = recvBufferPool + internal.BufferPool = bufferPool } var statusOK = status.New(codes.OK, "") @@ -170,7 +171,7 @@ type serverOptions struct { maxHeaderListSize *uint32 headerTableSize *uint32 numServerWorkers uint32 - recvBufferPool SharedBufferPool + bufferPool mem.BufferPool waitForHandlers bool } @@ -181,7 +182,7 @@ var defaultServerOptions = serverOptions{ connectionTimeout: 120 * time.Second, writeBufferSize: defaultWriteBufSize, readBufferSize: defaultReadBufSize, - recvBufferPool: nopBufferPool{}, + bufferPool: mem.DefaultBufferPool(), } var globalServerOptions []ServerOption @@ -313,7 +314,7 @@ func KeepaliveEnforcementPolicy(kep keepalive.EnforcementPolicy) ServerOption { // Will be supported throughout 1.x. func CustomCodec(codec Codec) ServerOption { return newFuncServerOption(func(o *serverOptions) { - o.codec = codec + o.codec = newCodecV0Bridge(codec) }) } @@ -342,7 +343,22 @@ func CustomCodec(codec Codec) ServerOption { // later release. func ForceServerCodec(codec encoding.Codec) ServerOption { return newFuncServerOption(func(o *serverOptions) { - o.codec = codec + o.codec = newCodecV1Bridge(codec) + }) +} + +// ForceServerCodecV2 is the equivalent of ForceServerCodec, but for the new +// CodecV2 interface. +// +// Will be supported throughout 1.x. +// +// # Experimental +// +// Notice: This API is EXPERIMENTAL and may be changed or removed in a +// later release. +func ForceServerCodecV2(codecV2 encoding.CodecV2) ServerOption { + return newFuncServerOption(func(o *serverOptions) { + o.codec = codecV2 }) } @@ -592,26 +608,9 @@ func WaitForHandlers(w bool) ServerOption { }) } -// RecvBufferPool returns a ServerOption that configures the server -// to use the provided shared buffer pool for parsing incoming messages. Depending -// on the application's workload, this could result in reduced memory allocation. -// -// If you are unsure about how to implement a memory pool but want to utilize one, -// begin with grpc.NewSharedBufferPool. -// -// Note: The shared buffer pool feature will not be active if any of the following -// options are used: StatsHandler, EnableTracing, or binary logging. In such -// cases, the shared buffer pool will be ignored. -// -// Deprecated: use experimental.WithRecvBufferPool instead. Will be deleted in -// v1.60.0 or later. -func RecvBufferPool(bufferPool SharedBufferPool) ServerOption { - return recvBufferPool(bufferPool) -} - -func recvBufferPool(bufferPool SharedBufferPool) ServerOption { +func bufferPool(bufferPool mem.BufferPool) ServerOption { return newFuncServerOption(func(o *serverOptions) { - o.recvBufferPool = bufferPool + o.bufferPool = bufferPool }) } @@ -622,7 +621,7 @@ func recvBufferPool(bufferPool SharedBufferPool) ServerOption { // workload (assuming a QPS of a few thousand requests/sec). const serverWorkerResetThreshold = 1 << 16 -// serverWorkers blocks on a *transport.Stream channel forever and waits for +// serverWorker blocks on a *transport.Stream channel forever and waits for // data to be fed by serveStreams. This allows multiple requests to be // processed by the same goroutine, removing the need for expensive stack // re-allocations (see the runtime.morestack problem [1]). @@ -980,6 +979,7 @@ func (s *Server) newHTTP2Transport(c net.Conn) transport.ServerTransport { ChannelzParent: s.channelz, MaxHeaderListSize: s.opts.maxHeaderListSize, HeaderTableSize: s.opts.headerTableSize, + BufferPool: s.opts.bufferPool, } st, err := transport.NewServerTransport(c, config) if err != nil { @@ -1072,7 +1072,7 @@ var _ http.Handler = (*Server)(nil) // Notice: This API is EXPERIMENTAL and may be changed or removed in a // later release. func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) { - st, err := transport.NewServerHandlerTransport(w, r, s.opts.statsHandlers) + st, err := transport.NewServerHandlerTransport(w, r, s.opts.statsHandlers, s.opts.bufferPool) if err != nil { // Errors returned from transport.NewServerHandlerTransport have // already been written to w. @@ -1142,20 +1142,35 @@ func (s *Server) sendResponse(ctx context.Context, t transport.ServerTransport, channelz.Error(logger, s.channelz, "grpc: server failed to encode response: ", err) return err } - compData, err := compress(data, cp, comp) + + compData, pf, err := compress(data, cp, comp, s.opts.bufferPool) if err != nil { + data.Free() channelz.Error(logger, s.channelz, "grpc: server failed to compress response: ", err) return err } - hdr, payload := msgHeader(data, compData) + + hdr, payload := msgHeader(data, compData, pf) + + defer func() { + compData.Free() + data.Free() + // payload does not need to be freed here, it is either data or compData, both of + // which are already freed. + }() + + dataLen := data.Len() + payloadLen := payload.Len() // TODO(dfawley): should we be checking len(data) instead? - if len(payload) > s.opts.maxSendMessageSize { - return status.Errorf(codes.ResourceExhausted, "grpc: trying to send message larger than max (%d vs. %d)", len(payload), s.opts.maxSendMessageSize) + if payloadLen > s.opts.maxSendMessageSize { + return status.Errorf(codes.ResourceExhausted, "grpc: trying to send message larger than max (%d vs. %d)", payloadLen, s.opts.maxSendMessageSize) } err = t.Write(stream, hdr, payload, opts) if err == nil { - for _, sh := range s.opts.statsHandlers { - sh.HandleRPC(ctx, outPayload(false, msg, data, payload, time.Now())) + if len(s.opts.statsHandlers) != 0 { + for _, sh := range s.opts.statsHandlers { + sh.HandleRPC(ctx, outPayload(false, msg, dataLen, payloadLen, time.Now())) + } } } return err @@ -1334,9 +1349,10 @@ func (s *Server) processUnaryRPC(ctx context.Context, t transport.ServerTranspor var payInfo *payloadInfo if len(shs) != 0 || len(binlogs) != 0 { payInfo = &payloadInfo{} + defer payInfo.free() } - d, cancel, err := recvAndDecompress(&parser{r: stream, recvBufferPool: s.opts.recvBufferPool}, stream, dc, s.opts.maxReceiveMessageSize, payInfo, decomp) + d, err := recvAndDecompress(&parser{r: stream, bufferPool: s.opts.bufferPool}, stream, dc, s.opts.maxReceiveMessageSize, payInfo, decomp, true) if err != nil { if e := t.WriteStatus(stream, status.Convert(err)); e != nil { channelz.Warningf(logger, s.channelz, "grpc: Server.processUnaryRPC failed to write status: %v", e) @@ -1347,24 +1363,22 @@ func (s *Server) processUnaryRPC(ctx context.Context, t transport.ServerTranspor t.IncrMsgRecv() } df := func(v any) error { - defer cancel() - if err := s.getCodec(stream.ContentSubtype()).Unmarshal(d, v); err != nil { return status.Errorf(codes.Internal, "grpc: error unmarshalling request: %v", err) } + for _, sh := range shs { sh.HandleRPC(ctx, &stats.InPayload{ RecvTime: time.Now(), Payload: v, - Length: len(d), + Length: d.Len(), WireLength: payInfo.compressedLength + headerLen, CompressedLength: payInfo.compressedLength, - Data: d, }) } if len(binlogs) != 0 { cm := &binarylog.ClientMessage{ - Message: d, + Message: d.Materialize(), } for _, binlog := range binlogs { binlog.Log(ctx, cm) @@ -1548,7 +1562,7 @@ func (s *Server) processStreamingRPC(ctx context.Context, t transport.ServerTran ctx: ctx, t: t, s: stream, - p: &parser{r: stream, recvBufferPool: s.opts.recvBufferPool}, + p: &parser{r: stream, bufferPool: s.opts.bufferPool}, codec: s.getCodec(stream.ContentSubtype()), maxReceiveMessageSize: s.opts.maxReceiveMessageSize, maxSendMessageSize: s.opts.maxSendMessageSize, @@ -1963,12 +1977,12 @@ func (s *Server) getCodec(contentSubtype string) baseCodec { return s.opts.codec } if contentSubtype == "" { - return encoding.GetCodec(proto.Name) + return getCodec(proto.Name) } - codec := encoding.GetCodec(contentSubtype) + codec := getCodec(contentSubtype) if codec == nil { logger.Warningf("Unsupported codec %q. Defaulting to %q for now. This will start to fail in future releases.", contentSubtype, proto.Name) - return encoding.GetCodec(proto.Name) + return getCodec(proto.Name) } return codec } diff --git a/vendor/google.golang.org/grpc/shared_buffer_pool.go b/vendor/google.golang.org/grpc/shared_buffer_pool.go deleted file mode 100644 index 48a64cfe8e2..00000000000 --- a/vendor/google.golang.org/grpc/shared_buffer_pool.go +++ /dev/null @@ -1,154 +0,0 @@ -/* - * - * Copyright 2023 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package grpc - -import "sync" - -// SharedBufferPool is a pool of buffers that can be shared, resulting in -// decreased memory allocation. Currently, in gRPC-go, it is only utilized -// for parsing incoming messages. -// -// # Experimental -// -// Notice: This API is EXPERIMENTAL and may be changed or removed in a -// later release. -type SharedBufferPool interface { - // Get returns a buffer with specified length from the pool. - // - // The returned byte slice may be not zero initialized. - Get(length int) []byte - - // Put returns a buffer to the pool. - Put(*[]byte) -} - -// NewSharedBufferPool creates a simple SharedBufferPool with buckets -// of different sizes to optimize memory usage. This prevents the pool from -// wasting large amounts of memory, even when handling messages of varying sizes. -// -// # Experimental -// -// Notice: This API is EXPERIMENTAL and may be changed or removed in a -// later release. -func NewSharedBufferPool() SharedBufferPool { - return &simpleSharedBufferPool{ - pools: [poolArraySize]simpleSharedBufferChildPool{ - newBytesPool(level0PoolMaxSize), - newBytesPool(level1PoolMaxSize), - newBytesPool(level2PoolMaxSize), - newBytesPool(level3PoolMaxSize), - newBytesPool(level4PoolMaxSize), - newBytesPool(0), - }, - } -} - -// simpleSharedBufferPool is a simple implementation of SharedBufferPool. -type simpleSharedBufferPool struct { - pools [poolArraySize]simpleSharedBufferChildPool -} - -func (p *simpleSharedBufferPool) Get(size int) []byte { - return p.pools[p.poolIdx(size)].Get(size) -} - -func (p *simpleSharedBufferPool) Put(bs *[]byte) { - p.pools[p.poolIdx(cap(*bs))].Put(bs) -} - -func (p *simpleSharedBufferPool) poolIdx(size int) int { - switch { - case size <= level0PoolMaxSize: - return level0PoolIdx - case size <= level1PoolMaxSize: - return level1PoolIdx - case size <= level2PoolMaxSize: - return level2PoolIdx - case size <= level3PoolMaxSize: - return level3PoolIdx - case size <= level4PoolMaxSize: - return level4PoolIdx - default: - return levelMaxPoolIdx - } -} - -const ( - level0PoolMaxSize = 16 // 16 B - level1PoolMaxSize = level0PoolMaxSize * 16 // 256 B - level2PoolMaxSize = level1PoolMaxSize * 16 // 4 KB - level3PoolMaxSize = level2PoolMaxSize * 16 // 64 KB - level4PoolMaxSize = level3PoolMaxSize * 16 // 1 MB -) - -const ( - level0PoolIdx = iota - level1PoolIdx - level2PoolIdx - level3PoolIdx - level4PoolIdx - levelMaxPoolIdx - poolArraySize -) - -type simpleSharedBufferChildPool interface { - Get(size int) []byte - Put(any) -} - -type bufferPool struct { - sync.Pool - - defaultSize int -} - -func (p *bufferPool) Get(size int) []byte { - bs := p.Pool.Get().(*[]byte) - - if cap(*bs) < size { - p.Pool.Put(bs) - - return make([]byte, size) - } - - return (*bs)[:size] -} - -func newBytesPool(size int) simpleSharedBufferChildPool { - return &bufferPool{ - Pool: sync.Pool{ - New: func() any { - bs := make([]byte, size) - return &bs - }, - }, - defaultSize: size, - } -} - -// nopBufferPool is a buffer pool just makes new buffer without pooling. -type nopBufferPool struct { -} - -func (nopBufferPool) Get(length int) []byte { - return make([]byte, length) -} - -func (nopBufferPool) Put(*[]byte) { -} diff --git a/vendor/google.golang.org/grpc/stats/stats.go b/vendor/google.golang.org/grpc/stats/stats.go index fdb0bd65182..71195c4943d 100644 --- a/vendor/google.golang.org/grpc/stats/stats.go +++ b/vendor/google.golang.org/grpc/stats/stats.go @@ -77,9 +77,6 @@ type InPayload struct { // the call to HandleRPC which provides the InPayload returns and must be // copied if needed later. Payload any - // Data is the serialized message payload. - // Deprecated: Data will be removed in the next release. - Data []byte // Length is the size of the uncompressed payload data. Does not include any // framing (gRPC or HTTP/2). @@ -150,9 +147,6 @@ type OutPayload struct { // the call to HandleRPC which provides the OutPayload returns and must be // copied if needed later. Payload any - // Data is the serialized message payload. - // Deprecated: Data will be removed in the next release. - Data []byte // Length is the size of the uncompressed payload data. Does not include any // framing (gRPC or HTTP/2). Length int diff --git a/vendor/google.golang.org/grpc/stream.go b/vendor/google.golang.org/grpc/stream.go index 8051ef5b514..bb2b2a216ce 100644 --- a/vendor/google.golang.org/grpc/stream.go +++ b/vendor/google.golang.org/grpc/stream.go @@ -41,6 +41,7 @@ import ( "google.golang.org/grpc/internal/serviceconfig" istatus "google.golang.org/grpc/internal/status" "google.golang.org/grpc/internal/transport" + "google.golang.org/grpc/mem" "google.golang.org/grpc/metadata" "google.golang.org/grpc/peer" "google.golang.org/grpc/stats" @@ -359,7 +360,7 @@ func newClientStreamWithParams(ctx context.Context, desc *StreamDesc, cc *Client cs.attempt = a return nil } - if err := cs.withRetry(op, func() { cs.bufferForRetryLocked(0, op) }); err != nil { + if err := cs.withRetry(op, func() { cs.bufferForRetryLocked(0, op, nil) }); err != nil { return nil, err } @@ -517,7 +518,7 @@ func (a *csAttempt) newStream() error { } a.s = s a.ctx = s.Context() - a.p = &parser{r: s, recvBufferPool: a.cs.cc.dopts.recvBufferPool} + a.p = &parser{r: s, bufferPool: a.cs.cc.dopts.copts.BufferPool} return nil } @@ -566,10 +567,15 @@ type clientStream struct { // place where we need to check if the attempt is nil. attempt *csAttempt // TODO(hedging): hedging will have multiple attempts simultaneously. - committed bool // active attempt committed for retry? - onCommit func() - buffer []func(a *csAttempt) error // operations to replay on retry - bufferSize int // current size of buffer + committed bool // active attempt committed for retry? + onCommit func() + replayBuffer []replayOp // operations to replay on retry + replayBufferSize int // current size of replayBuffer +} + +type replayOp struct { + op func(a *csAttempt) error + cleanup func() } // csAttempt implements a single transport stream attempt within a @@ -607,7 +613,12 @@ func (cs *clientStream) commitAttemptLocked() { cs.onCommit() } cs.committed = true - cs.buffer = nil + for _, op := range cs.replayBuffer { + if op.cleanup != nil { + op.cleanup() + } + } + cs.replayBuffer = nil } func (cs *clientStream) commitAttempt() { @@ -732,7 +743,7 @@ func (cs *clientStream) retryLocked(attempt *csAttempt, lastErr error) error { // the stream is canceled. return err } - // Note that the first op in the replay buffer always sets cs.attempt + // Note that the first op in replayBuffer always sets cs.attempt // if it is able to pick a transport and create a stream. if lastErr = cs.replayBufferLocked(attempt); lastErr == nil { return nil @@ -761,7 +772,7 @@ func (cs *clientStream) withRetry(op func(a *csAttempt) error, onSuccess func()) // already be status errors. return toRPCErr(op(cs.attempt)) } - if len(cs.buffer) == 0 { + if len(cs.replayBuffer) == 0 { // For the first op, which controls creation of the stream and // assigns cs.attempt, we need to create a new attempt inline // before executing the first op. On subsequent ops, the attempt @@ -851,25 +862,26 @@ func (cs *clientStream) Trailer() metadata.MD { } func (cs *clientStream) replayBufferLocked(attempt *csAttempt) error { - for _, f := range cs.buffer { - if err := f(attempt); err != nil { + for _, f := range cs.replayBuffer { + if err := f.op(attempt); err != nil { return err } } return nil } -func (cs *clientStream) bufferForRetryLocked(sz int, op func(a *csAttempt) error) { +func (cs *clientStream) bufferForRetryLocked(sz int, op func(a *csAttempt) error, cleanup func()) { // Note: we still will buffer if retry is disabled (for transparent retries). if cs.committed { return } - cs.bufferSize += sz - if cs.bufferSize > cs.callInfo.maxRetryRPCBufferSize { + cs.replayBufferSize += sz + if cs.replayBufferSize > cs.callInfo.maxRetryRPCBufferSize { cs.commitAttemptLocked() + cleanup() return } - cs.buffer = append(cs.buffer, op) + cs.replayBuffer = append(cs.replayBuffer, replayOp{op: op, cleanup: cleanup}) } func (cs *clientStream) SendMsg(m any) (err error) { @@ -891,23 +903,50 @@ func (cs *clientStream) SendMsg(m any) (err error) { } // load hdr, payload, data - hdr, payload, data, err := prepareMsg(m, cs.codec, cs.cp, cs.comp) + hdr, data, payload, pf, err := prepareMsg(m, cs.codec, cs.cp, cs.comp, cs.cc.dopts.copts.BufferPool) if err != nil { return err } + defer func() { + data.Free() + // only free payload if compression was made, and therefore it is a different set + // of buffers from data. + if pf.isCompressed() { + payload.Free() + } + }() + + dataLen := data.Len() + payloadLen := payload.Len() // TODO(dfawley): should we be checking len(data) instead? - if len(payload) > *cs.callInfo.maxSendMessageSize { - return status.Errorf(codes.ResourceExhausted, "trying to send message larger than max (%d vs. %d)", len(payload), *cs.callInfo.maxSendMessageSize) + if payloadLen > *cs.callInfo.maxSendMessageSize { + return status.Errorf(codes.ResourceExhausted, "trying to send message larger than max (%d vs. %d)", payloadLen, *cs.callInfo.maxSendMessageSize) } + + // always take an extra ref in case data == payload (i.e. when the data isn't + // compressed). The original ref will always be freed by the deferred free above. + payload.Ref() op := func(a *csAttempt) error { - return a.sendMsg(m, hdr, payload, data) + return a.sendMsg(m, hdr, payload, dataLen, payloadLen) + } + + // onSuccess is invoked when the op is captured for a subsequent retry. If the + // stream was established by a previous message and therefore retries are + // disabled, onSuccess will not be invoked, and payloadRef can be freed + // immediately. + onSuccessCalled := false + err = cs.withRetry(op, func() { + cs.bufferForRetryLocked(len(hdr)+payloadLen, op, payload.Free) + onSuccessCalled = true + }) + if !onSuccessCalled { + payload.Free() } - err = cs.withRetry(op, func() { cs.bufferForRetryLocked(len(hdr)+len(payload), op) }) if len(cs.binlogs) != 0 && err == nil { cm := &binarylog.ClientMessage{ OnClientSide: true, - Message: data, + Message: data.Materialize(), } for _, binlog := range cs.binlogs { binlog.Log(cs.ctx, cm) @@ -924,6 +963,7 @@ func (cs *clientStream) RecvMsg(m any) error { var recvInfo *payloadInfo if len(cs.binlogs) != 0 { recvInfo = &payloadInfo{} + defer recvInfo.free() } err := cs.withRetry(func(a *csAttempt) error { return a.recvMsg(m, recvInfo) @@ -931,7 +971,7 @@ func (cs *clientStream) RecvMsg(m any) error { if len(cs.binlogs) != 0 && err == nil { sm := &binarylog.ServerMessage{ OnClientSide: true, - Message: recvInfo.uncompressedBytes, + Message: recvInfo.uncompressedBytes.Materialize(), } for _, binlog := range cs.binlogs { binlog.Log(cs.ctx, sm) @@ -958,7 +998,7 @@ func (cs *clientStream) CloseSend() error { // RecvMsg. This also matches historical behavior. return nil } - cs.withRetry(op, func() { cs.bufferForRetryLocked(0, op) }) + cs.withRetry(op, func() { cs.bufferForRetryLocked(0, op, nil) }) if len(cs.binlogs) != 0 { chc := &binarylog.ClientHalfClose{ OnClientSide: true, @@ -1034,7 +1074,7 @@ func (cs *clientStream) finish(err error) { cs.cancel() } -func (a *csAttempt) sendMsg(m any, hdr, payld, data []byte) error { +func (a *csAttempt) sendMsg(m any, hdr []byte, payld mem.BufferSlice, dataLength, payloadLength int) error { cs := a.cs if a.trInfo != nil { a.mu.Lock() @@ -1052,8 +1092,10 @@ func (a *csAttempt) sendMsg(m any, hdr, payld, data []byte) error { } return io.EOF } - for _, sh := range a.statsHandlers { - sh.HandleRPC(a.ctx, outPayload(true, m, data, payld, time.Now())) + if len(a.statsHandlers) != 0 { + for _, sh := range a.statsHandlers { + sh.HandleRPC(a.ctx, outPayload(true, m, dataLength, payloadLength, time.Now())) + } } if channelz.IsOn() { a.t.IncrMsgSent() @@ -1065,6 +1107,7 @@ func (a *csAttempt) recvMsg(m any, payInfo *payloadInfo) (err error) { cs := a.cs if len(a.statsHandlers) != 0 && payInfo == nil { payInfo = &payloadInfo{} + defer payInfo.free() } if !a.decompSet { @@ -1083,8 +1126,7 @@ func (a *csAttempt) recvMsg(m any, payInfo *payloadInfo) (err error) { // Only initialize this state once per stream. a.decompSet = true } - err = recv(a.p, cs.codec, a.s, a.dc, m, *cs.callInfo.maxReceiveMessageSize, payInfo, a.decomp) - if err != nil { + if err := recv(a.p, cs.codec, a.s, a.dc, m, *cs.callInfo.maxReceiveMessageSize, payInfo, a.decomp, false); err != nil { if err == io.EOF { if statusErr := a.s.Status().Err(); statusErr != nil { return statusErr @@ -1103,14 +1145,12 @@ func (a *csAttempt) recvMsg(m any, payInfo *payloadInfo) (err error) { } for _, sh := range a.statsHandlers { sh.HandleRPC(a.ctx, &stats.InPayload{ - Client: true, - RecvTime: time.Now(), - Payload: m, - // TODO truncate large payload. - Data: payInfo.uncompressedBytes, + Client: true, + RecvTime: time.Now(), + Payload: m, WireLength: payInfo.compressedLength + headerLen, CompressedLength: payInfo.compressedLength, - Length: len(payInfo.uncompressedBytes), + Length: payInfo.uncompressedBytes.Len(), }) } if channelz.IsOn() { @@ -1122,14 +1162,12 @@ func (a *csAttempt) recvMsg(m any, payInfo *payloadInfo) (err error) { } // Special handling for non-server-stream rpcs. // This recv expects EOF or errors, so we don't collect inPayload. - err = recv(a.p, cs.codec, a.s, a.dc, m, *cs.callInfo.maxReceiveMessageSize, nil, a.decomp) - if err == nil { - return toRPCErr(errors.New("grpc: client streaming protocol violation: get , want ")) - } - if err == io.EOF { + if err := recv(a.p, cs.codec, a.s, a.dc, m, *cs.callInfo.maxReceiveMessageSize, nil, a.decomp, false); err == io.EOF { return a.s.Status().Err() // non-server streaming Recv returns nil on success + } else if err != nil { + return toRPCErr(err) } - return toRPCErr(err) + return toRPCErr(errors.New("grpc: client streaming protocol violation: get , want ")) } func (a *csAttempt) finish(err error) { @@ -1185,12 +1223,12 @@ func (a *csAttempt) finish(err error) { a.mu.Unlock() } -// newClientStream creates a ClientStream with the specified transport, on the +// newNonRetryClientStream creates a ClientStream with the specified transport, on the // given addrConn. // // It's expected that the given transport is either the same one in addrConn, or // is already closed. To avoid race, transport is specified separately, instead -// of using ac.transpot. +// of using ac.transport. // // Main difference between this and ClientConn.NewStream: // - no retry @@ -1276,7 +1314,7 @@ func newNonRetryClientStream(ctx context.Context, desc *StreamDesc, method strin return nil, err } as.s = s - as.p = &parser{r: s, recvBufferPool: ac.dopts.recvBufferPool} + as.p = &parser{r: s, bufferPool: ac.dopts.copts.BufferPool} ac.incrCallsStarted() if desc != unaryStreamDesc { // Listen on stream context to cleanup when the stream context is @@ -1373,17 +1411,26 @@ func (as *addrConnStream) SendMsg(m any) (err error) { } // load hdr, payload, data - hdr, payld, _, err := prepareMsg(m, as.codec, as.cp, as.comp) + hdr, data, payload, pf, err := prepareMsg(m, as.codec, as.cp, as.comp, as.ac.dopts.copts.BufferPool) if err != nil { return err } + defer func() { + data.Free() + // only free payload if compression was made, and therefore it is a different set + // of buffers from data. + if pf.isCompressed() { + payload.Free() + } + }() + // TODO(dfawley): should we be checking len(data) instead? - if len(payld) > *as.callInfo.maxSendMessageSize { - return status.Errorf(codes.ResourceExhausted, "trying to send message larger than max (%d vs. %d)", len(payld), *as.callInfo.maxSendMessageSize) + if payload.Len() > *as.callInfo.maxSendMessageSize { + return status.Errorf(codes.ResourceExhausted, "trying to send message larger than max (%d vs. %d)", payload.Len(), *as.callInfo.maxSendMessageSize) } - if err := as.t.Write(as.s, hdr, payld, &transport.Options{Last: !as.desc.ClientStreams}); err != nil { + if err := as.t.Write(as.s, hdr, payload, &transport.Options{Last: !as.desc.ClientStreams}); err != nil { if !as.desc.ClientStreams { // For non-client-streaming RPCs, we return nil instead of EOF on error // because the generated code requires it. finish is not called; RecvMsg() @@ -1423,8 +1470,7 @@ func (as *addrConnStream) RecvMsg(m any) (err error) { // Only initialize this state once per stream. as.decompSet = true } - err = recv(as.p, as.codec, as.s, as.dc, m, *as.callInfo.maxReceiveMessageSize, nil, as.decomp) - if err != nil { + if err := recv(as.p, as.codec, as.s, as.dc, m, *as.callInfo.maxReceiveMessageSize, nil, as.decomp, false); err != nil { if err == io.EOF { if statusErr := as.s.Status().Err(); statusErr != nil { return statusErr @@ -1444,14 +1490,12 @@ func (as *addrConnStream) RecvMsg(m any) (err error) { // Special handling for non-server-stream rpcs. // This recv expects EOF or errors, so we don't collect inPayload. - err = recv(as.p, as.codec, as.s, as.dc, m, *as.callInfo.maxReceiveMessageSize, nil, as.decomp) - if err == nil { - return toRPCErr(errors.New("grpc: client streaming protocol violation: get , want ")) - } - if err == io.EOF { + if err := recv(as.p, as.codec, as.s, as.dc, m, *as.callInfo.maxReceiveMessageSize, nil, as.decomp, false); err == io.EOF { return as.s.Status().Err() // non-server streaming Recv returns nil on success + } else if err != nil { + return toRPCErr(err) } - return toRPCErr(err) + return toRPCErr(errors.New("grpc: client streaming protocol violation: get , want ")) } func (as *addrConnStream) finish(err error) { @@ -1645,18 +1689,31 @@ func (ss *serverStream) SendMsg(m any) (err error) { } // load hdr, payload, data - hdr, payload, data, err := prepareMsg(m, ss.codec, ss.cp, ss.comp) + hdr, data, payload, pf, err := prepareMsg(m, ss.codec, ss.cp, ss.comp, ss.p.bufferPool) if err != nil { return err } + defer func() { + data.Free() + // only free payload if compression was made, and therefore it is a different set + // of buffers from data. + if pf.isCompressed() { + payload.Free() + } + }() + + dataLen := data.Len() + payloadLen := payload.Len() + // TODO(dfawley): should we be checking len(data) instead? - if len(payload) > ss.maxSendMessageSize { - return status.Errorf(codes.ResourceExhausted, "trying to send message larger than max (%d vs. %d)", len(payload), ss.maxSendMessageSize) + if payloadLen > ss.maxSendMessageSize { + return status.Errorf(codes.ResourceExhausted, "trying to send message larger than max (%d vs. %d)", payloadLen, ss.maxSendMessageSize) } if err := ss.t.Write(ss.s, hdr, payload, &transport.Options{Last: false}); err != nil { return toRPCErr(err) } + if len(ss.binlogs) != 0 { if !ss.serverHeaderBinlogged { h, _ := ss.s.Header() @@ -1669,7 +1726,7 @@ func (ss *serverStream) SendMsg(m any) (err error) { } } sm := &binarylog.ServerMessage{ - Message: data, + Message: data.Materialize(), } for _, binlog := range ss.binlogs { binlog.Log(ss.ctx, sm) @@ -1677,7 +1734,7 @@ func (ss *serverStream) SendMsg(m any) (err error) { } if len(ss.statsHandler) != 0 { for _, sh := range ss.statsHandler { - sh.HandleRPC(ss.s.Context(), outPayload(false, m, data, payload, time.Now())) + sh.HandleRPC(ss.s.Context(), outPayload(false, m, dataLen, payloadLen, time.Now())) } } return nil @@ -1714,8 +1771,9 @@ func (ss *serverStream) RecvMsg(m any) (err error) { var payInfo *payloadInfo if len(ss.statsHandler) != 0 || len(ss.binlogs) != 0 { payInfo = &payloadInfo{} + defer payInfo.free() } - if err := recv(ss.p, ss.codec, ss.s, ss.dc, m, ss.maxReceiveMessageSize, payInfo, ss.decomp); err != nil { + if err := recv(ss.p, ss.codec, ss.s, ss.dc, m, ss.maxReceiveMessageSize, payInfo, ss.decomp, true); err != nil { if err == io.EOF { if len(ss.binlogs) != 0 { chc := &binarylog.ClientHalfClose{} @@ -1733,11 +1791,9 @@ func (ss *serverStream) RecvMsg(m any) (err error) { if len(ss.statsHandler) != 0 { for _, sh := range ss.statsHandler { sh.HandleRPC(ss.s.Context(), &stats.InPayload{ - RecvTime: time.Now(), - Payload: m, - // TODO truncate large payload. - Data: payInfo.uncompressedBytes, - Length: len(payInfo.uncompressedBytes), + RecvTime: time.Now(), + Payload: m, + Length: payInfo.uncompressedBytes.Len(), WireLength: payInfo.compressedLength + headerLen, CompressedLength: payInfo.compressedLength, }) @@ -1745,7 +1801,7 @@ func (ss *serverStream) RecvMsg(m any) (err error) { } if len(ss.binlogs) != 0 { cm := &binarylog.ClientMessage{ - Message: payInfo.uncompressedBytes, + Message: payInfo.uncompressedBytes.Materialize(), } for _, binlog := range ss.binlogs { binlog.Log(ss.ctx, cm) @@ -1760,23 +1816,26 @@ func MethodFromServerStream(stream ServerStream) (string, bool) { return Method(stream.Context()) } -// prepareMsg returns the hdr, payload and data -// using the compressors passed or using the -// passed preparedmsg -func prepareMsg(m any, codec baseCodec, cp Compressor, comp encoding.Compressor) (hdr, payload, data []byte, err error) { +// prepareMsg returns the hdr, payload and data using the compressors passed or +// using the passed preparedmsg. The returned boolean indicates whether +// compression was made and therefore whether the payload needs to be freed in +// addition to the returned data. Freeing the payload if the returned boolean is +// false can lead to undefined behavior. +func prepareMsg(m any, codec baseCodec, cp Compressor, comp encoding.Compressor, pool mem.BufferPool) (hdr []byte, data, payload mem.BufferSlice, pf payloadFormat, err error) { if preparedMsg, ok := m.(*PreparedMsg); ok { - return preparedMsg.hdr, preparedMsg.payload, preparedMsg.encodedData, nil + return preparedMsg.hdr, preparedMsg.encodedData, preparedMsg.payload, preparedMsg.pf, nil } // The input interface is not a prepared msg. // Marshal and Compress the data at this point data, err = encode(codec, m) if err != nil { - return nil, nil, nil, err + return nil, nil, nil, 0, err } - compData, err := compress(data, cp, comp) + compData, pf, err := compress(data, cp, comp, pool) if err != nil { - return nil, nil, nil, err + data.Free() + return nil, nil, nil, 0, err } - hdr, payload = msgHeader(data, compData) - return hdr, payload, data, nil + hdr, payload = msgHeader(data, compData, pf) + return hdr, data, payload, pf, nil } diff --git a/vendor/google.golang.org/grpc/version.go b/vendor/google.golang.org/grpc/version.go index bafaef99be9..03f9318347a 100644 --- a/vendor/google.golang.org/grpc/version.go +++ b/vendor/google.golang.org/grpc/version.go @@ -19,4 +19,4 @@ package grpc // Version is the current grpc version. -const Version = "1.65.0" +const Version = "1.66.1" diff --git a/vendor/modules.txt b/vendor/modules.txt index 7b2a632d919..92770cf40ff 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -8,8 +8,8 @@ code.cloudfoundry.org/clock/fakeclock ## explicit; go 1.16 github.com/Azure/go-ansiterm github.com/Azure/go-ansiterm/winterm -# github.com/IBM/idemix v0.0.2-0.20231011101252-a4feda90f3f7 -## explicit; go 1.19 +# github.com/IBM/idemix v0.0.2-0.20231011101252-a4feda90f3f7 => github.com/pfi79/idemix v0.0.0-20240827084656-d5b1e15270f4 +## explicit; go 1.22.6 github.com/IBM/idemix github.com/IBM/idemix/bccsp github.com/IBM/idemix/bccsp/handlers @@ -20,13 +20,13 @@ github.com/IBM/idemix/bccsp/schemes/dlog/crypto/translator/amcl github.com/IBM/idemix/common/flogging github.com/IBM/idemix/common/flogging/fabenc github.com/IBM/idemix/idemixmsp -# github.com/IBM/idemix/bccsp/schemes/aries v0.0.0-20231003085036-c4470b87b2d6 +# github.com/IBM/idemix/bccsp/schemes/aries v0.0.0-20240612072411-114d281b442d ## explicit; go 1.19 github.com/IBM/idemix/bccsp/schemes/aries -# github.com/IBM/idemix/bccsp/schemes/weak-bb v0.0.0-20240125153755-b3fcea5c7863 +# github.com/IBM/idemix/bccsp/schemes/weak-bb v0.0.0-20240612072411-114d281b442d ## explicit; go 1.19 github.com/IBM/idemix/bccsp/schemes/weak-bb -# github.com/IBM/idemix/bccsp/types v0.0.0-20240125153755-b3fcea5c7863 +# github.com/IBM/idemix/bccsp/types v0.0.0-20240612072411-114d281b442d ## explicit; go 1.19 github.com/IBM/idemix/bccsp/types # github.com/IBM/mathlib v0.0.3-0.20231011094432-44ee0eb539da @@ -52,14 +52,14 @@ github.com/Microsoft/go-winio/pkg/guid # github.com/VictoriaMetrics/fastcache v1.9.0 ## explicit; go 1.13 github.com/VictoriaMetrics/fastcache -# github.com/ale-linux/aries-framework-go/component/kmscrypto v0.0.0-20230817163708-4b3de6d91874 +# github.com/ale-linux/aries-framework-go/component/kmscrypto v0.0.0-20231023164747-f3f972769504 ## explicit; go 1.19 github.com/ale-linux/aries-framework-go/component/kmscrypto/crypto/primitive/bbs12381g2pub # github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 ## explicit github.com/alecthomas/template github.com/alecthomas/template/parse -# github.com/alecthomas/units v0.0.0-20210912230133-d1bdfacee922 +# github.com/alecthomas/units v0.0.0-20240626203959-61d1e3462e30 ## explicit; go 1.15 github.com/alecthomas/units # github.com/beorn7/perks v1.0.1 @@ -77,8 +77,8 @@ github.com/cheggaaa/pb # github.com/consensys/bavard v0.1.13 ## explicit; go 1.15 github.com/consensys/bavard -# github.com/consensys/gnark-crypto v0.12.1 -## explicit; go 1.18 +# github.com/consensys/gnark-crypto v0.13.0 +## explicit; go 1.19 github.com/consensys/gnark-crypto/ecc github.com/consensys/gnark-crypto/ecc/bls12-377 github.com/consensys/gnark-crypto/ecc/bls12-377/fp @@ -177,12 +177,10 @@ github.com/gogo/protobuf/proto github.com/gogo/protobuf/protoc-gen-gogo/descriptor # github.com/golang/protobuf v1.5.4 ## explicit; go 1.17 -github.com/golang/protobuf/jsonpb github.com/golang/protobuf/proto github.com/golang/protobuf/ptypes github.com/golang/protobuf/ptypes/any github.com/golang/protobuf/ptypes/duration -github.com/golang/protobuf/ptypes/empty github.com/golang/protobuf/ptypes/timestamp # github.com/golang/snappy v0.0.4 ## explicit @@ -194,7 +192,7 @@ github.com/google/go-cmp/cmp/internal/diff github.com/google/go-cmp/cmp/internal/flags github.com/google/go-cmp/cmp/internal/function github.com/google/go-cmp/cmp/internal/value -# github.com/google/pprof v0.0.0-20240130152714-0ed6a68c8d9e +# github.com/google/pprof v0.0.0-20240424215950-a892ee059fd6 ## explicit; go 1.19 github.com/google/pprof/profile # github.com/gorilla/handlers v1.5.1 @@ -222,12 +220,12 @@ github.com/hyperledger/fabric-amcl/amcl github.com/hyperledger/fabric-amcl/amcl/FP256BN github.com/hyperledger/fabric-amcl/core github.com/hyperledger/fabric-amcl/core/FP256BN -# github.com/hyperledger/fabric-chaincode-go v0.0.0-20220713164125-8f0791c989d7 -## explicit; go 1.12 -github.com/hyperledger/fabric-chaincode-go/pkg/statebased -github.com/hyperledger/fabric-chaincode-go/shim -github.com/hyperledger/fabric-chaincode-go/shim/internal -# github.com/hyperledger/fabric-config v0.2.1 +# github.com/hyperledger/fabric-chaincode-go/v2 v2.0.0 +## explicit; go 1.21.0 +github.com/hyperledger/fabric-chaincode-go/v2/pkg/statebased +github.com/hyperledger/fabric-chaincode-go/v2/shim +github.com/hyperledger/fabric-chaincode-go/v2/shim/internal +# github.com/hyperledger/fabric-config v0.2.1 => github.com/pfi79/fabric-config v0.0.0-20240822061539-a86c531d2c81 ## explicit; go 1.20 github.com/hyperledger/fabric-config/configtx github.com/hyperledger/fabric-config/configtx/internal/policydsl @@ -262,22 +260,22 @@ github.com/hyperledger/fabric-lib-go/common/metrics/prometheus github.com/hyperledger/fabric-lib-go/common/metrics/statsd github.com/hyperledger/fabric-lib-go/common/metrics/statsd/goruntime github.com/hyperledger/fabric-lib-go/healthz -# github.com/hyperledger/fabric-protos-go v0.3.2 +# github.com/hyperledger/fabric-protos-go-apiv2 v0.3.3 ## explicit; go 1.17 -github.com/hyperledger/fabric-protos-go/common -github.com/hyperledger/fabric-protos-go/discovery -github.com/hyperledger/fabric-protos-go/gateway -github.com/hyperledger/fabric-protos-go/gossip -github.com/hyperledger/fabric-protos-go/ledger/queryresult -github.com/hyperledger/fabric-protos-go/ledger/rwset -github.com/hyperledger/fabric-protos-go/ledger/rwset/kvrwset -github.com/hyperledger/fabric-protos-go/msp -github.com/hyperledger/fabric-protos-go/orderer -github.com/hyperledger/fabric-protos-go/orderer/etcdraft -github.com/hyperledger/fabric-protos-go/orderer/smartbft -github.com/hyperledger/fabric-protos-go/peer -github.com/hyperledger/fabric-protos-go/peer/lifecycle -github.com/hyperledger/fabric-protos-go/transientstore +github.com/hyperledger/fabric-protos-go-apiv2/common +github.com/hyperledger/fabric-protos-go-apiv2/discovery +github.com/hyperledger/fabric-protos-go-apiv2/gateway +github.com/hyperledger/fabric-protos-go-apiv2/gossip +github.com/hyperledger/fabric-protos-go-apiv2/ledger/queryresult +github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset +github.com/hyperledger/fabric-protos-go-apiv2/ledger/rwset/kvrwset +github.com/hyperledger/fabric-protos-go-apiv2/msp +github.com/hyperledger/fabric-protos-go-apiv2/orderer +github.com/hyperledger/fabric-protos-go-apiv2/orderer/etcdraft +github.com/hyperledger/fabric-protos-go-apiv2/orderer/smartbft +github.com/hyperledger/fabric-protos-go-apiv2/peer +github.com/hyperledger/fabric-protos-go-apiv2/peer/lifecycle +github.com/hyperledger/fabric-protos-go-apiv2/transientstore # github.com/inconshreveable/mousetrap v1.0.0 ## explicit github.com/inconshreveable/mousetrap @@ -537,15 +535,15 @@ go.uber.org/zap/internal/stacktrace go.uber.org/zap/zapcore go.uber.org/zap/zapgrpc go.uber.org/zap/zaptest/observer -# golang.org/x/crypto v0.24.0 -## explicit; go 1.18 +# golang.org/x/crypto v0.26.0 +## explicit; go 1.20 golang.org/x/crypto/blake2b golang.org/x/crypto/hkdf golang.org/x/crypto/sha3 -# golang.org/x/mod v0.17.0 +# golang.org/x/mod v0.20.0 ## explicit; go 1.18 golang.org/x/mod/semver -# golang.org/x/net v0.25.0 +# golang.org/x/net v0.28.0 ## explicit; go 1.18 golang.org/x/net/context golang.org/x/net/html @@ -561,7 +559,7 @@ golang.org/x/net/trace ## explicit; go 1.18 golang.org/x/sync/errgroup golang.org/x/sync/semaphore -# golang.org/x/sys v0.23.0 +# golang.org/x/sys v0.24.0 ## explicit; go 1.18 golang.org/x/sys/cpu golang.org/x/sys/unix @@ -588,12 +586,11 @@ golang.org/x/text/secure/bidirule golang.org/x/text/transform golang.org/x/text/unicode/bidi golang.org/x/text/unicode/norm -# golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d +# golang.org/x/tools v0.24.0 ## explicit; go 1.19 golang.org/x/tools/cmd/stringer golang.org/x/tools/go/ast/inspector golang.org/x/tools/go/gcexportdata -golang.org/x/tools/go/internal/packagesdriver golang.org/x/tools/go/packages golang.org/x/tools/go/types/objectpath golang.org/x/tools/internal/aliases @@ -609,10 +606,10 @@ golang.org/x/tools/internal/stdlib golang.org/x/tools/internal/tokeninternal golang.org/x/tools/internal/typesinternal golang.org/x/tools/internal/versions -# google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 +# google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117 ## explicit; go 1.20 google.golang.org/genproto/googleapis/rpc/status -# google.golang.org/grpc v1.65.0 +# google.golang.org/grpc v1.66.1 ## explicit; go 1.21 google.golang.org/grpc google.golang.org/grpc/attributes @@ -630,7 +627,9 @@ google.golang.org/grpc/credentials google.golang.org/grpc/credentials/insecure google.golang.org/grpc/encoding google.golang.org/grpc/encoding/proto +google.golang.org/grpc/experimental/stats google.golang.org/grpc/grpclog +google.golang.org/grpc/grpclog/internal google.golang.org/grpc/health google.golang.org/grpc/health/grpc_health_v1 google.golang.org/grpc/internal @@ -654,11 +653,13 @@ google.golang.org/grpc/internal/resolver/dns/internal google.golang.org/grpc/internal/resolver/passthrough google.golang.org/grpc/internal/resolver/unix google.golang.org/grpc/internal/serviceconfig +google.golang.org/grpc/internal/stats google.golang.org/grpc/internal/status google.golang.org/grpc/internal/syscall google.golang.org/grpc/internal/transport google.golang.org/grpc/internal/transport/networktype google.golang.org/grpc/keepalive +google.golang.org/grpc/mem google.golang.org/grpc/metadata google.golang.org/grpc/peer google.golang.org/grpc/resolver @@ -719,3 +720,5 @@ gopkg.in/yaml.v3 ## explicit; go 1.17 rsc.io/tmplfunc rsc.io/tmplfunc/internal/parse +# github.com/IBM/idemix => github.com/pfi79/idemix v0.0.0-20240827084656-d5b1e15270f4 +# github.com/hyperledger/fabric-config => github.com/pfi79/fabric-config v0.0.0-20240822061539-a86c531d2c81