From bdb9f95da086a997d1a76b685d1a1804f1051a91 Mon Sep 17 00:00:00 2001 From: Redouane Lakrache Date: Wed, 14 Aug 2024 08:23:01 +0200 Subject: [PATCH] [Supplier] Rename Supplier.Address to Supplier.OperatorAddress (#734) ## Summary *This PR is duplicate of #722 which got mistakingly merged into `refactor/non-custodial-staking-tests`* This PR renames all the Supplier.Address references to Supplier.OperatorAddress. It also include renaming supplierAddress to supplierOperatorAddress variables, methods in Claim and Proof, comments and error messages. This PR has a lot of changes but does not introduce any addition logic to the code base. ## Issue - #493 ## Type of change Select one or more: - [ ] New feature, functionality or library - [ ] Bug fix - [x] Code health or cleanup - [ ] Documentation - [ ] Other (specify) ## Testing **Documentation changes** (only if making doc changes) - [ ] `make docusaurus_start`; only needed if you make doc changes **Local Testing** (only if making code changes) - [x] **Unit Tests**: `make go_develop_and_test` - [x] **LocalNet E2E Tests**: `make test_e2e` - See [quickstart guide](https://dev.poktroll.com/developer_guide/quickstart) for instructions **PR Testing** (only if making code changes) - [ ] **DevNet E2E Tests**: Add the `devnet-test-e2e` label to the PR. - **THIS IS VERY EXPENSIVE**, so only do it after all the reviews are complete. - Optionally run `make trigger_ci` if you want to re-trigger tests without any code changes - If tests fail, try re-running failed tests only using the GitHub UI as shown [here](https://github.com/pokt-network/poktroll/assets/1892194/607984e9-0615-4569-9452-4c730190c1d2) ## Sanity Checklist - [x] I have tested my changes using the available tooling - [ ] I have commented my code - [x] I have performed a self-review of my own code; both comments & source code - [ ] I create and reference any new tickets, if applicable - [ ] I have left TODOs throughout the codebase, if applicable --- Makefile | 2 +- api/poktroll/proof/claim.pulsar.go | 104 ++-- api/poktroll/proof/proof.pulsar.go | 108 ++-- api/poktroll/proof/query.pulsar.go | 523 +++++++++--------- api/poktroll/proof/tx.pulsar.go | 257 ++++----- api/poktroll/service/relay.pulsar.go | 207 +++---- api/poktroll/shared/supplier.pulsar.go | 143 +++-- api/poktroll/supplier/query.pulsar.go | 183 +++--- api/poktroll/supplier/tx.pulsar.go | 244 ++++---- config.yml | 2 +- docs/static/openapi.yml | 50 +- .../develop/developer_guide/quickstart.md | 2 + .../docs/operate/configs/relayminer_config.md | 2 +- .../primitives/claim_and_proof_lifecycle.md | 43 +- e2e/tests/init_test.go | 68 +-- e2e/tests/session_steps_test.go | 28 +- go.mod | 2 +- go.sum | 4 +- .../config/load_test_manifest_reader.go | 2 +- load-testing/loadtest_manifest_localnet.yaml | 8 +- .../tests/relays_stress_helpers_test.go | 20 +- load-testing/tests/relays_stress_test.go | 7 +- .../relayminer_config_full_example.yaml | 1 + pkg/client/interface.go | 14 +- pkg/client/query/sharedquerier.go | 8 +- pkg/client/query/supplierquerier.go | 6 +- pkg/client/supplier/client.go | 21 +- pkg/client/supplier/options.go | 6 +- pkg/client/supplier/types.go | 2 +- pkg/deps/config/suppliers.go | 4 +- pkg/relayer/cmd/cmd.go | 2 +- .../config/relayminer_configs_reader_test.go | 18 +- .../config/suppliers_config_hydrator.go | 2 +- pkg/relayer/interface.go | 6 +- pkg/relayer/proxy/errors.go | 24 +- pkg/relayer/proxy/options.go | 2 +- pkg/relayer/proxy/proxy.go | 15 +- pkg/relayer/proxy/proxy_test.go | 84 +-- pkg/relayer/proxy/relay_builders.go | 6 +- pkg/relayer/proxy/relay_signer.go | 10 +- pkg/relayer/proxy/relay_verifier.go | 18 +- pkg/relayer/proxy/server_builder.go | 20 +- pkg/relayer/proxy/synchronous.go | 2 +- pkg/relayer/session/claim.go | 14 +- pkg/relayer/session/proof.go | 14 +- pkg/relayer/session/session.go | 42 +- pkg/relayer/session/session_test.go | 10 +- pkg/relayer/session/sessiontree.go | 32 +- proto/poktroll/proof/claim.proto | 2 +- proto/poktroll/proof/proof.proto | 3 +- proto/poktroll/proof/query.proto | 12 +- proto/poktroll/proof/tx.proto | 8 +- proto/poktroll/service/relay.proto | 10 +- proto/poktroll/shared/supplier.proto | 6 +- proto/poktroll/supplier/query.proto | 4 +- proto/poktroll/supplier/tx.proto | 4 +- .../relay_mining_difficulty_test.go | 18 +- .../tokenomics/tokenomics_example_test.go | 8 +- testutil/integration/app.go | 8 +- testutil/keeper/proof.go | 4 +- testutil/keeper/session.go | 10 +- testutil/keeper/tokenomics.go | 14 +- testutil/network/network.go | 12 +- testutil/proof/fixture_generators.go | 12 +- .../testqueryclients/sessionquerier.go | 9 +- .../testqueryclients/sharedquerier.go | 8 +- .../testqueryclients/supplierquerier.go | 19 +- testutil/testclient/testsupplier/client.go | 10 +- testutil/testproxy/relayerproxy.go | 26 +- testutil/testrelayer/relays.go | 46 +- testutil/testtree/tree.go | 30 +- x/application/module/query.go | 2 +- x/application/module/tx.go | 2 +- x/gateway/module/query.go | 2 +- x/gateway/module/tx.go | 2 +- x/proof/keeper/claim.go | 34 +- x/proof/keeper/claim_test.go | 8 +- x/proof/keeper/msg_server_create_claim.go | 14 +- .../keeper/msg_server_create_claim_test.go | 68 +-- x/proof/keeper/msg_server_submit_proof.go | 16 +- .../keeper/msg_server_submit_proof_test.go | 88 +-- x/proof/keeper/proof.go | 32 +- x/proof/keeper/proof_test.go | 8 +- x/proof/keeper/proof_validation.go | 36 +- x/proof/keeper/proof_validation_test.go | 102 ++-- x/proof/keeper/query_claim.go | 10 +- x/proof/keeper/query_claim_test.go | 38 +- x/proof/keeper/query_proof.go | 10 +- x/proof/keeper/query_proof_test.go | 32 +- x/proof/keeper/session.go | 30 +- x/proof/module/flags.go | 6 +- x/proof/module/genesis_test.go | 2 +- x/proof/module/helpers_test.go | 26 +- x/proof/module/query.go | 2 +- x/proof/module/query_claim.go | 41 +- x/proof/module/query_claim_test.go | 52 +- x/proof/module/query_proof.go | 41 +- x/proof/module/query_proof_test.go | 22 +- x/proof/module/tx.go | 2 +- x/proof/simulation/create_claim.go | 2 +- x/proof/simulation/submit_proof.go | 2 +- x/proof/types/claim.pb.go | 58 +- x/proof/types/errors.go | 2 +- x/proof/types/genesis.go | 8 +- x/proof/types/genesis_test.go | 14 +- x/proof/types/key_claim.go | 19 +- x/proof/types/key_proof.go | 19 +- x/proof/types/message_create_claim.go | 14 +- x/proof/types/message_create_claim_test.go | 22 +- x/proof/types/message_submit_proof.go | 16 +- x/proof/types/message_submit_proof_test.go | 12 +- x/proof/types/proof.pb.go | 60 +- x/proof/types/query.pb.go | 215 +++---- x/proof/types/query.pb.gw.go | 36 +- x/proof/types/query_validation.go | 24 +- x/proof/types/shared_query_client.go | 8 +- x/proof/types/tx.pb.go | 145 ++--- x/service/module/tx.go | 2 +- x/service/module/tx_add_service.go | 2 +- x/service/types/relay.go | 18 +- x/service/types/relay.pb.go | 106 ++-- x/session/keeper/session_hydrator_test.go | 2 +- x/shared/session.go | 12 +- x/shared/session_test.go | 24 +- x/shared/types/supplier.go | 2 +- x/shared/types/supplier.pb.go | 86 ++- .../keeper/msg_server_stake_supplier.go | 18 +- .../keeper/msg_server_stake_supplier_test.go | 28 +- .../keeper/msg_server_unstake_supplier.go | 8 +- .../msg_server_unstake_supplier_test.go | 84 +-- x/supplier/keeper/query_supplier.go | 6 +- x/supplier/keeper/query_supplier_test.go | 6 +- x/supplier/keeper/supplier.go | 20 +- x/supplier/keeper/supplier_test.go | 9 +- x/supplier/keeper/unbond_suppliers.go | 6 +- x/supplier/module/genesis_test.go | 10 +- x/supplier/module/query.go | 2 +- x/supplier/module/query_supplier.go | 4 +- x/supplier/module/query_supplier_test.go | 2 +- x/supplier/module/tx.go | 2 +- x/supplier/module/tx_stake_supplier_test.go | 4 +- x/supplier/simulation/stake_supplier.go | 2 +- x/supplier/simulation/unstake_supplier.go | 2 +- x/supplier/types/genesis.go | 19 +- x/supplier/types/genesis_test.go | 160 +++--- x/supplier/types/key_supplier.go | 12 +- x/supplier/types/message_stake_supplier.go | 18 +- .../types/message_stake_supplier_test.go | 205 +++---- x/supplier/types/message_unstake_supplier.go | 12 +- .../types/message_unstake_supplier_test.go | 18 +- x/supplier/types/query.pb.go | 93 ++-- x/supplier/types/query.pb.gw.go | 18 +- x/supplier/types/tx.pb.go | 126 ++--- .../keeper_settle_pending_claims_test.go | 22 +- x/tokenomics/keeper/settle_pending_claims.go | 12 +- x/tokenomics/keeper/token_logic_modules.go | 24 +- .../keeper/token_logic_modules_test.go | 64 +-- x/tokenomics/types/errors.go | 50 +- x/tokenomics/types/expected_keepers.go | 8 +- 159 files changed, 2752 insertions(+), 2655 deletions(-) diff --git a/Makefile b/Makefile index 3d82877cb..b12cca3ea 100644 --- a/Makefile +++ b/Makefile @@ -863,7 +863,7 @@ claim_list: ## List all the claims .PHONY: claims_list_address claim_list_address: ## List all the claims for a specific address (specified via ADDR variable) - poktrolld --home=$(POKTROLLD_HOME) q supplier list-claims --supplier-address $(ADDR) --node $(POCKET_NODE) + poktrolld --home=$(POKTROLLD_HOME) q supplier list-claims --supplier-operator-address $(ADDR) --node $(POCKET_NODE) .PHONY: claims_list_address_supplier1 claim_list_address_supplier1: ## List all the claims for supplier1 diff --git a/api/poktroll/proof/claim.pulsar.go b/api/poktroll/proof/claim.pulsar.go index 859f2619f..a8049ba31 100644 --- a/api/poktroll/proof/claim.pulsar.go +++ b/api/poktroll/proof/claim.pulsar.go @@ -15,16 +15,16 @@ import ( ) var ( - md_Claim protoreflect.MessageDescriptor - fd_Claim_supplier_address protoreflect.FieldDescriptor - fd_Claim_session_header protoreflect.FieldDescriptor - fd_Claim_root_hash protoreflect.FieldDescriptor + md_Claim protoreflect.MessageDescriptor + fd_Claim_supplier_operator_address protoreflect.FieldDescriptor + fd_Claim_session_header protoreflect.FieldDescriptor + fd_Claim_root_hash protoreflect.FieldDescriptor ) func init() { file_poktroll_proof_claim_proto_init() md_Claim = File_poktroll_proof_claim_proto.Messages().ByName("Claim") - fd_Claim_supplier_address = md_Claim.Fields().ByName("supplier_address") + fd_Claim_supplier_operator_address = md_Claim.Fields().ByName("supplier_operator_address") fd_Claim_session_header = md_Claim.Fields().ByName("session_header") fd_Claim_root_hash = md_Claim.Fields().ByName("root_hash") } @@ -94,9 +94,9 @@ func (x *fastReflection_Claim) Interface() protoreflect.ProtoMessage { // While iterating, mutating operations may only be performed // on the current field descriptor. func (x *fastReflection_Claim) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.SupplierAddress != "" { - value := protoreflect.ValueOfString(x.SupplierAddress) - if !f(fd_Claim_supplier_address, value) { + if x.SupplierOperatorAddress != "" { + value := protoreflect.ValueOfString(x.SupplierOperatorAddress) + if !f(fd_Claim_supplier_operator_address, value) { return } } @@ -127,8 +127,8 @@ func (x *fastReflection_Claim) Range(f func(protoreflect.FieldDescriptor, protor // a repeated field is populated if it is non-empty. func (x *fastReflection_Claim) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "poktroll.proof.Claim.supplier_address": - return x.SupplierAddress != "" + case "poktroll.proof.Claim.supplier_operator_address": + return x.SupplierOperatorAddress != "" case "poktroll.proof.Claim.session_header": return x.SessionHeader != nil case "poktroll.proof.Claim.root_hash": @@ -149,8 +149,8 @@ func (x *fastReflection_Claim) Has(fd protoreflect.FieldDescriptor) bool { // Clear is a mutating operation and unsafe for concurrent use. func (x *fastReflection_Claim) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "poktroll.proof.Claim.supplier_address": - x.SupplierAddress = "" + case "poktroll.proof.Claim.supplier_operator_address": + x.SupplierOperatorAddress = "" case "poktroll.proof.Claim.session_header": x.SessionHeader = nil case "poktroll.proof.Claim.root_hash": @@ -171,8 +171,8 @@ func (x *fastReflection_Claim) Clear(fd protoreflect.FieldDescriptor) { // of the value; to obtain a mutable reference, use Mutable. func (x *fastReflection_Claim) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "poktroll.proof.Claim.supplier_address": - value := x.SupplierAddress + case "poktroll.proof.Claim.supplier_operator_address": + value := x.SupplierOperatorAddress return protoreflect.ValueOfString(value) case "poktroll.proof.Claim.session_header": value := x.SessionHeader @@ -200,8 +200,8 @@ func (x *fastReflection_Claim) Get(descriptor protoreflect.FieldDescriptor) prot // Set is a mutating operation and unsafe for concurrent use. func (x *fastReflection_Claim) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "poktroll.proof.Claim.supplier_address": - x.SupplierAddress = value.Interface().(string) + case "poktroll.proof.Claim.supplier_operator_address": + x.SupplierOperatorAddress = value.Interface().(string) case "poktroll.proof.Claim.session_header": x.SessionHeader = value.Message().Interface().(*session.SessionHeader) case "poktroll.proof.Claim.root_hash": @@ -231,8 +231,8 @@ func (x *fastReflection_Claim) Mutable(fd protoreflect.FieldDescriptor) protoref x.SessionHeader = new(session.SessionHeader) } return protoreflect.ValueOfMessage(x.SessionHeader.ProtoReflect()) - case "poktroll.proof.Claim.supplier_address": - panic(fmt.Errorf("field supplier_address of message poktroll.proof.Claim is not mutable")) + case "poktroll.proof.Claim.supplier_operator_address": + panic(fmt.Errorf("field supplier_operator_address of message poktroll.proof.Claim is not mutable")) case "poktroll.proof.Claim.root_hash": panic(fmt.Errorf("field root_hash of message poktroll.proof.Claim is not mutable")) default: @@ -248,7 +248,7 @@ func (x *fastReflection_Claim) Mutable(fd protoreflect.FieldDescriptor) protoref // For lists, maps, and messages, this returns a new, empty, mutable value. func (x *fastReflection_Claim) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "poktroll.proof.Claim.supplier_address": + case "poktroll.proof.Claim.supplier_operator_address": return protoreflect.ValueOfString("") case "poktroll.proof.Claim.session_header": m := new(session.SessionHeader) @@ -324,7 +324,7 @@ func (x *fastReflection_Claim) ProtoMethods() *protoiface.Methods { var n int var l int _ = l - l = len(x.SupplierAddress) + l = len(x.SupplierOperatorAddress) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } @@ -386,10 +386,10 @@ func (x *fastReflection_Claim) ProtoMethods() *protoiface.Methods { i-- dAtA[i] = 0x12 } - if len(x.SupplierAddress) > 0 { - i -= len(x.SupplierAddress) - copy(dAtA[i:], x.SupplierAddress) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.SupplierAddress))) + if len(x.SupplierOperatorAddress) > 0 { + i -= len(x.SupplierOperatorAddress) + copy(dAtA[i:], x.SupplierOperatorAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.SupplierOperatorAddress))) i-- dAtA[i] = 0xa } @@ -444,7 +444,7 @@ func (x *fastReflection_Claim) ProtoMethods() *protoiface.Methods { switch fieldNum { case 1: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field SupplierAddress", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field SupplierOperatorAddress", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -472,7 +472,7 @@ func (x *fastReflection_Claim) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.SupplierAddress = string(dAtA[iNdEx:postIndex]) + x.SupplierOperatorAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { @@ -598,7 +598,7 @@ type Claim struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - SupplierAddress string `protobuf:"bytes,1,opt,name=supplier_address,json=supplierAddress,proto3" json:"supplier_address,omitempty"` // the address of the supplier that submitted this claim + SupplierOperatorAddress string `protobuf:"bytes,1,opt,name=supplier_operator_address,json=supplierOperatorAddress,proto3" json:"supplier_operator_address,omitempty"` // the address of the supplier's operator that submitted this claim // The session header of the session that this claim is for. SessionHeader *session.SessionHeader `protobuf:"bytes,2,opt,name=session_header,json=sessionHeader,proto3" json:"session_header,omitempty"` // Root hash returned from smt.SMST#Root(). @@ -625,9 +625,9 @@ func (*Claim) Descriptor() ([]byte, []int) { return file_poktroll_proof_claim_proto_rawDescGZIP(), []int{0} } -func (x *Claim) GetSupplierAddress() string { +func (x *Claim) GetSupplierOperatorAddress() string { if x != nil { - return x.SupplierAddress + return x.SupplierOperatorAddress } return "" } @@ -655,28 +655,30 @@ var file_poktroll_proof_claim_proto_rawDesc = []byte{ 0x73, 0x6d, 0x6f, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, - 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xb1, 0x01, 0x0a, 0x05, 0x43, 0x6c, 0x61, 0x69, - 0x6d, 0x12, 0x43, 0x0a, 0x10, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x5f, 0x61, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, - 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, - 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x0f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x41, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x46, 0x0a, 0x0e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, - 0x6e, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, - 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, - 0x6e, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, - 0x0d, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x1b, - 0x0a, 0x09, 0x72, 0x6f, 0x6f, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0c, 0x52, 0x08, 0x72, 0x6f, 0x6f, 0x74, 0x48, 0x61, 0x73, 0x68, 0x42, 0x9a, 0x01, 0x0a, 0x12, - 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x70, 0x72, 0x6f, - 0x6f, 0x66, 0x42, 0x0a, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, - 0x5a, 0x1f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, - 0x70, 0x69, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x6f, - 0x66, 0xa2, 0x02, 0x03, 0x50, 0x50, 0x58, 0xaa, 0x02, 0x0e, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, - 0x6c, 0x6c, 0x2e, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0xca, 0x02, 0x0e, 0x50, 0x6f, 0x6b, 0x74, 0x72, - 0x6f, 0x6c, 0x6c, 0x5c, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0xe2, 0x02, 0x1a, 0x50, 0x6f, 0x6b, 0x74, - 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, - 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0f, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, - 0x6c, 0x3a, 0x3a, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc2, 0x01, 0x0a, 0x05, 0x43, 0x6c, 0x61, 0x69, + 0x6d, 0x12, 0x54, 0x0a, 0x19, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x5f, 0x6f, 0x70, + 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x17, + 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, + 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x46, 0x0a, 0x0e, 0x73, 0x65, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1f, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x52, 0x0d, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, + 0x1b, 0x0a, 0x09, 0x72, 0x6f, 0x6f, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x08, 0x72, 0x6f, 0x6f, 0x74, 0x48, 0x61, 0x73, 0x68, 0x42, 0x9a, 0x01, 0x0a, + 0x12, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x70, 0x72, + 0x6f, 0x6f, 0x66, 0x42, 0x0a, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, + 0x01, 0x5a, 0x1f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, + 0x61, 0x70, 0x69, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x70, 0x72, 0x6f, + 0x6f, 0x66, 0xa2, 0x02, 0x03, 0x50, 0x50, 0x58, 0xaa, 0x02, 0x0e, 0x50, 0x6f, 0x6b, 0x74, 0x72, + 0x6f, 0x6c, 0x6c, 0x2e, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0xca, 0x02, 0x0e, 0x50, 0x6f, 0x6b, 0x74, + 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0xe2, 0x02, 0x1a, 0x50, 0x6f, 0x6b, + 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x5c, 0x47, 0x50, 0x42, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0f, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, + 0x6c, 0x6c, 0x3a, 0x3a, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } var ( diff --git a/api/poktroll/proof/proof.pulsar.go b/api/poktroll/proof/proof.pulsar.go index 9fd048a47..9898f478a 100644 --- a/api/poktroll/proof/proof.pulsar.go +++ b/api/poktroll/proof/proof.pulsar.go @@ -15,16 +15,16 @@ import ( ) var ( - md_Proof protoreflect.MessageDescriptor - fd_Proof_supplier_address protoreflect.FieldDescriptor - fd_Proof_session_header protoreflect.FieldDescriptor - fd_Proof_closest_merkle_proof protoreflect.FieldDescriptor + md_Proof protoreflect.MessageDescriptor + fd_Proof_supplier_operator_address protoreflect.FieldDescriptor + fd_Proof_session_header protoreflect.FieldDescriptor + fd_Proof_closest_merkle_proof protoreflect.FieldDescriptor ) func init() { file_poktroll_proof_proof_proto_init() md_Proof = File_poktroll_proof_proof_proto.Messages().ByName("Proof") - fd_Proof_supplier_address = md_Proof.Fields().ByName("supplier_address") + fd_Proof_supplier_operator_address = md_Proof.Fields().ByName("supplier_operator_address") fd_Proof_session_header = md_Proof.Fields().ByName("session_header") fd_Proof_closest_merkle_proof = md_Proof.Fields().ByName("closest_merkle_proof") } @@ -94,9 +94,9 @@ func (x *fastReflection_Proof) Interface() protoreflect.ProtoMessage { // While iterating, mutating operations may only be performed // on the current field descriptor. func (x *fastReflection_Proof) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.SupplierAddress != "" { - value := protoreflect.ValueOfString(x.SupplierAddress) - if !f(fd_Proof_supplier_address, value) { + if x.SupplierOperatorAddress != "" { + value := protoreflect.ValueOfString(x.SupplierOperatorAddress) + if !f(fd_Proof_supplier_operator_address, value) { return } } @@ -127,8 +127,8 @@ func (x *fastReflection_Proof) Range(f func(protoreflect.FieldDescriptor, protor // a repeated field is populated if it is non-empty. func (x *fastReflection_Proof) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "poktroll.proof.Proof.supplier_address": - return x.SupplierAddress != "" + case "poktroll.proof.Proof.supplier_operator_address": + return x.SupplierOperatorAddress != "" case "poktroll.proof.Proof.session_header": return x.SessionHeader != nil case "poktroll.proof.Proof.closest_merkle_proof": @@ -149,8 +149,8 @@ func (x *fastReflection_Proof) Has(fd protoreflect.FieldDescriptor) bool { // Clear is a mutating operation and unsafe for concurrent use. func (x *fastReflection_Proof) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "poktroll.proof.Proof.supplier_address": - x.SupplierAddress = "" + case "poktroll.proof.Proof.supplier_operator_address": + x.SupplierOperatorAddress = "" case "poktroll.proof.Proof.session_header": x.SessionHeader = nil case "poktroll.proof.Proof.closest_merkle_proof": @@ -171,8 +171,8 @@ func (x *fastReflection_Proof) Clear(fd protoreflect.FieldDescriptor) { // of the value; to obtain a mutable reference, use Mutable. func (x *fastReflection_Proof) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "poktroll.proof.Proof.supplier_address": - value := x.SupplierAddress + case "poktroll.proof.Proof.supplier_operator_address": + value := x.SupplierOperatorAddress return protoreflect.ValueOfString(value) case "poktroll.proof.Proof.session_header": value := x.SessionHeader @@ -200,8 +200,8 @@ func (x *fastReflection_Proof) Get(descriptor protoreflect.FieldDescriptor) prot // Set is a mutating operation and unsafe for concurrent use. func (x *fastReflection_Proof) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "poktroll.proof.Proof.supplier_address": - x.SupplierAddress = value.Interface().(string) + case "poktroll.proof.Proof.supplier_operator_address": + x.SupplierOperatorAddress = value.Interface().(string) case "poktroll.proof.Proof.session_header": x.SessionHeader = value.Message().Interface().(*session.SessionHeader) case "poktroll.proof.Proof.closest_merkle_proof": @@ -231,8 +231,8 @@ func (x *fastReflection_Proof) Mutable(fd protoreflect.FieldDescriptor) protoref x.SessionHeader = new(session.SessionHeader) } return protoreflect.ValueOfMessage(x.SessionHeader.ProtoReflect()) - case "poktroll.proof.Proof.supplier_address": - panic(fmt.Errorf("field supplier_address of message poktroll.proof.Proof is not mutable")) + case "poktroll.proof.Proof.supplier_operator_address": + panic(fmt.Errorf("field supplier_operator_address of message poktroll.proof.Proof is not mutable")) case "poktroll.proof.Proof.closest_merkle_proof": panic(fmt.Errorf("field closest_merkle_proof of message poktroll.proof.Proof is not mutable")) default: @@ -248,7 +248,7 @@ func (x *fastReflection_Proof) Mutable(fd protoreflect.FieldDescriptor) protoref // For lists, maps, and messages, this returns a new, empty, mutable value. func (x *fastReflection_Proof) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "poktroll.proof.Proof.supplier_address": + case "poktroll.proof.Proof.supplier_operator_address": return protoreflect.ValueOfString("") case "poktroll.proof.Proof.session_header": m := new(session.SessionHeader) @@ -324,7 +324,7 @@ func (x *fastReflection_Proof) ProtoMethods() *protoiface.Methods { var n int var l int _ = l - l = len(x.SupplierAddress) + l = len(x.SupplierOperatorAddress) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } @@ -386,10 +386,10 @@ func (x *fastReflection_Proof) ProtoMethods() *protoiface.Methods { i-- dAtA[i] = 0x12 } - if len(x.SupplierAddress) > 0 { - i -= len(x.SupplierAddress) - copy(dAtA[i:], x.SupplierAddress) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.SupplierAddress))) + if len(x.SupplierOperatorAddress) > 0 { + i -= len(x.SupplierOperatorAddress) + copy(dAtA[i:], x.SupplierOperatorAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.SupplierOperatorAddress))) i-- dAtA[i] = 0xa } @@ -444,7 +444,7 @@ func (x *fastReflection_Proof) ProtoMethods() *protoiface.Methods { switch fieldNum { case 1: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field SupplierAddress", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field SupplierOperatorAddress", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -472,7 +472,7 @@ func (x *fastReflection_Proof) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.SupplierAddress = string(dAtA[iNdEx:postIndex]) + x.SupplierOperatorAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { @@ -597,7 +597,8 @@ type Proof struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - SupplierAddress string `protobuf:"bytes,1,opt,name=supplier_address,json=supplierAddress,proto3" json:"supplier_address,omitempty"` + // Address of the supplier's operator that submitted this proof. + SupplierOperatorAddress string `protobuf:"bytes,1,opt,name=supplier_operator_address,json=supplierOperatorAddress,proto3" json:"supplier_operator_address,omitempty"` // The session header of the session that this claim is for. SessionHeader *session.SessionHeader `protobuf:"bytes,2,opt,name=session_header,json=sessionHeader,proto3" json:"session_header,omitempty"` // The serialized SMST proof from the `#ClosestProof()` method. @@ -624,9 +625,9 @@ func (*Proof) Descriptor() ([]byte, []int) { return file_poktroll_proof_proof_proto_rawDescGZIP(), []int{0} } -func (x *Proof) GetSupplierAddress() string { +func (x *Proof) GetSupplierOperatorAddress() string { if x != nil { - return x.SupplierAddress + return x.SupplierOperatorAddress } return "" } @@ -654,30 +655,31 @@ var file_poktroll_proof_proof_proto_rawDesc = []byte{ 0x73, 0x6d, 0x6f, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, - 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc6, 0x01, 0x0a, 0x05, 0x50, 0x72, 0x6f, 0x6f, - 0x66, 0x12, 0x43, 0x0a, 0x10, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x5f, 0x61, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, - 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, - 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x0f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x41, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x46, 0x0a, 0x0e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, - 0x6e, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, - 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, - 0x6e, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, - 0x0d, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x30, - 0x0a, 0x14, 0x63, 0x6c, 0x6f, 0x73, 0x65, 0x73, 0x74, 0x5f, 0x6d, 0x65, 0x72, 0x6b, 0x6c, 0x65, - 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x12, 0x63, 0x6c, - 0x6f, 0x73, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x72, 0x6b, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x6f, 0x66, - 0x42, 0x9a, 0x01, 0x0a, 0x12, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, - 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x42, 0x0a, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x50, 0x72, - 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x1f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, - 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, - 0x2f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0xa2, 0x02, 0x03, 0x50, 0x50, 0x58, 0xaa, 0x02, 0x0e, 0x50, - 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0xca, 0x02, 0x0e, - 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0xe2, 0x02, - 0x1a, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x5c, - 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0f, 0x50, 0x6f, - 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xd7, 0x01, 0x0a, 0x05, 0x50, 0x72, 0x6f, 0x6f, + 0x66, 0x12, 0x54, 0x0a, 0x19, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x5f, 0x6f, 0x70, + 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x17, + 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, + 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x46, 0x0a, 0x0e, 0x73, 0x65, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1f, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x52, 0x0d, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, + 0x30, 0x0a, 0x14, 0x63, 0x6c, 0x6f, 0x73, 0x65, 0x73, 0x74, 0x5f, 0x6d, 0x65, 0x72, 0x6b, 0x6c, + 0x65, 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x12, 0x63, + 0x6c, 0x6f, 0x73, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x72, 0x6b, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x6f, + 0x66, 0x42, 0x9a, 0x01, 0x0a, 0x12, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, + 0x6c, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x42, 0x0a, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x50, + 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x1f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, + 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, + 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0xa2, 0x02, 0x03, 0x50, 0x50, 0x58, 0xaa, 0x02, 0x0e, + 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0xca, 0x02, + 0x0e, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0xe2, + 0x02, 0x1a, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x50, 0x72, 0x6f, 0x6f, 0x66, + 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0f, 0x50, + 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/api/poktroll/proof/query.pulsar.go b/api/poktroll/proof/query.pulsar.go index 4b4f62c39..da5a7778f 100644 --- a/api/poktroll/proof/query.pulsar.go +++ b/api/poktroll/proof/query.pulsar.go @@ -809,16 +809,16 @@ func (x *fastReflection_QueryParamsResponse) ProtoMethods() *protoiface.Methods } var ( - md_QueryGetClaimRequest protoreflect.MessageDescriptor - fd_QueryGetClaimRequest_session_id protoreflect.FieldDescriptor - fd_QueryGetClaimRequest_supplier_address protoreflect.FieldDescriptor + md_QueryGetClaimRequest protoreflect.MessageDescriptor + fd_QueryGetClaimRequest_session_id protoreflect.FieldDescriptor + fd_QueryGetClaimRequest_supplier_operator_address protoreflect.FieldDescriptor ) func init() { file_poktroll_proof_query_proto_init() md_QueryGetClaimRequest = File_poktroll_proof_query_proto.Messages().ByName("QueryGetClaimRequest") fd_QueryGetClaimRequest_session_id = md_QueryGetClaimRequest.Fields().ByName("session_id") - fd_QueryGetClaimRequest_supplier_address = md_QueryGetClaimRequest.Fields().ByName("supplier_address") + fd_QueryGetClaimRequest_supplier_operator_address = md_QueryGetClaimRequest.Fields().ByName("supplier_operator_address") } var _ protoreflect.Message = (*fastReflection_QueryGetClaimRequest)(nil) @@ -892,9 +892,9 @@ func (x *fastReflection_QueryGetClaimRequest) Range(f func(protoreflect.FieldDes return } } - if x.SupplierAddress != "" { - value := protoreflect.ValueOfString(x.SupplierAddress) - if !f(fd_QueryGetClaimRequest_supplier_address, value) { + if x.SupplierOperatorAddress != "" { + value := protoreflect.ValueOfString(x.SupplierOperatorAddress) + if !f(fd_QueryGetClaimRequest_supplier_operator_address, value) { return } } @@ -915,8 +915,8 @@ func (x *fastReflection_QueryGetClaimRequest) Has(fd protoreflect.FieldDescripto switch fd.FullName() { case "poktroll.proof.QueryGetClaimRequest.session_id": return x.SessionId != "" - case "poktroll.proof.QueryGetClaimRequest.supplier_address": - return x.SupplierAddress != "" + case "poktroll.proof.QueryGetClaimRequest.supplier_operator_address": + return x.SupplierOperatorAddress != "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.proof.QueryGetClaimRequest")) @@ -935,8 +935,8 @@ func (x *fastReflection_QueryGetClaimRequest) Clear(fd protoreflect.FieldDescrip switch fd.FullName() { case "poktroll.proof.QueryGetClaimRequest.session_id": x.SessionId = "" - case "poktroll.proof.QueryGetClaimRequest.supplier_address": - x.SupplierAddress = "" + case "poktroll.proof.QueryGetClaimRequest.supplier_operator_address": + x.SupplierOperatorAddress = "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.proof.QueryGetClaimRequest")) @@ -956,8 +956,8 @@ func (x *fastReflection_QueryGetClaimRequest) Get(descriptor protoreflect.FieldD case "poktroll.proof.QueryGetClaimRequest.session_id": value := x.SessionId return protoreflect.ValueOfString(value) - case "poktroll.proof.QueryGetClaimRequest.supplier_address": - value := x.SupplierAddress + case "poktroll.proof.QueryGetClaimRequest.supplier_operator_address": + value := x.SupplierOperatorAddress return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { @@ -981,8 +981,8 @@ func (x *fastReflection_QueryGetClaimRequest) Set(fd protoreflect.FieldDescripto switch fd.FullName() { case "poktroll.proof.QueryGetClaimRequest.session_id": x.SessionId = value.Interface().(string) - case "poktroll.proof.QueryGetClaimRequest.supplier_address": - x.SupplierAddress = value.Interface().(string) + case "poktroll.proof.QueryGetClaimRequest.supplier_operator_address": + x.SupplierOperatorAddress = value.Interface().(string) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.proof.QueryGetClaimRequest")) @@ -1005,8 +1005,8 @@ func (x *fastReflection_QueryGetClaimRequest) Mutable(fd protoreflect.FieldDescr switch fd.FullName() { case "poktroll.proof.QueryGetClaimRequest.session_id": panic(fmt.Errorf("field session_id of message poktroll.proof.QueryGetClaimRequest is not mutable")) - case "poktroll.proof.QueryGetClaimRequest.supplier_address": - panic(fmt.Errorf("field supplier_address of message poktroll.proof.QueryGetClaimRequest is not mutable")) + case "poktroll.proof.QueryGetClaimRequest.supplier_operator_address": + panic(fmt.Errorf("field supplier_operator_address of message poktroll.proof.QueryGetClaimRequest is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.proof.QueryGetClaimRequest")) @@ -1022,7 +1022,7 @@ func (x *fastReflection_QueryGetClaimRequest) NewField(fd protoreflect.FieldDesc switch fd.FullName() { case "poktroll.proof.QueryGetClaimRequest.session_id": return protoreflect.ValueOfString("") - case "poktroll.proof.QueryGetClaimRequest.supplier_address": + case "poktroll.proof.QueryGetClaimRequest.supplier_operator_address": return protoreflect.ValueOfString("") default: if fd.IsExtension() { @@ -1097,7 +1097,7 @@ func (x *fastReflection_QueryGetClaimRequest) ProtoMethods() *protoiface.Methods if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - l = len(x.SupplierAddress) + l = len(x.SupplierOperatorAddress) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } @@ -1130,10 +1130,10 @@ func (x *fastReflection_QueryGetClaimRequest) ProtoMethods() *protoiface.Methods i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if len(x.SupplierAddress) > 0 { - i -= len(x.SupplierAddress) - copy(dAtA[i:], x.SupplierAddress) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.SupplierAddress))) + if len(x.SupplierOperatorAddress) > 0 { + i -= len(x.SupplierOperatorAddress) + copy(dAtA[i:], x.SupplierOperatorAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.SupplierOperatorAddress))) i-- dAtA[i] = 0x12 } @@ -1227,7 +1227,7 @@ func (x *fastReflection_QueryGetClaimRequest) ProtoMethods() *protoiface.Methods iNdEx = postIndex case 2: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field SupplierAddress", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field SupplierOperatorAddress", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1255,7 +1255,7 @@ func (x *fastReflection_QueryGetClaimRequest) ProtoMethods() *protoiface.Methods if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.SupplierAddress = string(dAtA[iNdEx:postIndex]) + x.SupplierOperatorAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -1728,18 +1728,18 @@ func (x *fastReflection_QueryGetClaimResponse) ProtoMethods() *protoiface.Method } var ( - md_QueryAllClaimsRequest protoreflect.MessageDescriptor - fd_QueryAllClaimsRequest_pagination protoreflect.FieldDescriptor - fd_QueryAllClaimsRequest_supplier_address protoreflect.FieldDescriptor - fd_QueryAllClaimsRequest_session_id protoreflect.FieldDescriptor - fd_QueryAllClaimsRequest_session_end_height protoreflect.FieldDescriptor + md_QueryAllClaimsRequest protoreflect.MessageDescriptor + fd_QueryAllClaimsRequest_pagination protoreflect.FieldDescriptor + fd_QueryAllClaimsRequest_supplier_operator_address protoreflect.FieldDescriptor + fd_QueryAllClaimsRequest_session_id protoreflect.FieldDescriptor + fd_QueryAllClaimsRequest_session_end_height protoreflect.FieldDescriptor ) func init() { file_poktroll_proof_query_proto_init() md_QueryAllClaimsRequest = File_poktroll_proof_query_proto.Messages().ByName("QueryAllClaimsRequest") fd_QueryAllClaimsRequest_pagination = md_QueryAllClaimsRequest.Fields().ByName("pagination") - fd_QueryAllClaimsRequest_supplier_address = md_QueryAllClaimsRequest.Fields().ByName("supplier_address") + fd_QueryAllClaimsRequest_supplier_operator_address = md_QueryAllClaimsRequest.Fields().ByName("supplier_operator_address") fd_QueryAllClaimsRequest_session_id = md_QueryAllClaimsRequest.Fields().ByName("session_id") fd_QueryAllClaimsRequest_session_end_height = md_QueryAllClaimsRequest.Fields().ByName("session_end_height") } @@ -1817,10 +1817,10 @@ func (x *fastReflection_QueryAllClaimsRequest) Range(f func(protoreflect.FieldDe } if x.Filter != nil { switch o := x.Filter.(type) { - case *QueryAllClaimsRequest_SupplierAddress: - v := o.SupplierAddress + case *QueryAllClaimsRequest_SupplierOperatorAddress: + v := o.SupplierOperatorAddress value := protoreflect.ValueOfString(v) - if !f(fd_QueryAllClaimsRequest_supplier_address, value) { + if !f(fd_QueryAllClaimsRequest_supplier_operator_address, value) { return } case *QueryAllClaimsRequest_SessionId: @@ -1854,10 +1854,10 @@ func (x *fastReflection_QueryAllClaimsRequest) Has(fd protoreflect.FieldDescript switch fd.FullName() { case "poktroll.proof.QueryAllClaimsRequest.pagination": return x.Pagination != nil - case "poktroll.proof.QueryAllClaimsRequest.supplier_address": + case "poktroll.proof.QueryAllClaimsRequest.supplier_operator_address": if x.Filter == nil { return false - } else if _, ok := x.Filter.(*QueryAllClaimsRequest_SupplierAddress); ok { + } else if _, ok := x.Filter.(*QueryAllClaimsRequest_SupplierOperatorAddress); ok { return true } else { return false @@ -1896,7 +1896,7 @@ func (x *fastReflection_QueryAllClaimsRequest) Clear(fd protoreflect.FieldDescri switch fd.FullName() { case "poktroll.proof.QueryAllClaimsRequest.pagination": x.Pagination = nil - case "poktroll.proof.QueryAllClaimsRequest.supplier_address": + case "poktroll.proof.QueryAllClaimsRequest.supplier_operator_address": x.Filter = nil case "poktroll.proof.QueryAllClaimsRequest.session_id": x.Filter = nil @@ -1921,11 +1921,11 @@ func (x *fastReflection_QueryAllClaimsRequest) Get(descriptor protoreflect.Field case "poktroll.proof.QueryAllClaimsRequest.pagination": value := x.Pagination return protoreflect.ValueOfMessage(value.ProtoReflect()) - case "poktroll.proof.QueryAllClaimsRequest.supplier_address": + case "poktroll.proof.QueryAllClaimsRequest.supplier_operator_address": if x.Filter == nil { return protoreflect.ValueOfString("") - } else if v, ok := x.Filter.(*QueryAllClaimsRequest_SupplierAddress); ok { - return protoreflect.ValueOfString(v.SupplierAddress) + } else if v, ok := x.Filter.(*QueryAllClaimsRequest_SupplierOperatorAddress); ok { + return protoreflect.ValueOfString(v.SupplierOperatorAddress) } else { return protoreflect.ValueOfString("") } @@ -1967,9 +1967,9 @@ func (x *fastReflection_QueryAllClaimsRequest) Set(fd protoreflect.FieldDescript switch fd.FullName() { case "poktroll.proof.QueryAllClaimsRequest.pagination": x.Pagination = value.Message().Interface().(*v1beta1.PageRequest) - case "poktroll.proof.QueryAllClaimsRequest.supplier_address": + case "poktroll.proof.QueryAllClaimsRequest.supplier_operator_address": cv := value.Interface().(string) - x.Filter = &QueryAllClaimsRequest_SupplierAddress{SupplierAddress: cv} + x.Filter = &QueryAllClaimsRequest_SupplierOperatorAddress{SupplierOperatorAddress: cv} case "poktroll.proof.QueryAllClaimsRequest.session_id": cv := value.Interface().(string) x.Filter = &QueryAllClaimsRequest_SessionId{SessionId: cv} @@ -2001,8 +2001,8 @@ func (x *fastReflection_QueryAllClaimsRequest) Mutable(fd protoreflect.FieldDesc x.Pagination = new(v1beta1.PageRequest) } return protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) - case "poktroll.proof.QueryAllClaimsRequest.supplier_address": - panic(fmt.Errorf("field supplier_address of message poktroll.proof.QueryAllClaimsRequest is not mutable")) + case "poktroll.proof.QueryAllClaimsRequest.supplier_operator_address": + panic(fmt.Errorf("field supplier_operator_address of message poktroll.proof.QueryAllClaimsRequest is not mutable")) case "poktroll.proof.QueryAllClaimsRequest.session_id": panic(fmt.Errorf("field session_id of message poktroll.proof.QueryAllClaimsRequest is not mutable")) case "poktroll.proof.QueryAllClaimsRequest.session_end_height": @@ -2023,7 +2023,7 @@ func (x *fastReflection_QueryAllClaimsRequest) NewField(fd protoreflect.FieldDes case "poktroll.proof.QueryAllClaimsRequest.pagination": m := new(v1beta1.PageRequest) return protoreflect.ValueOfMessage(m.ProtoReflect()) - case "poktroll.proof.QueryAllClaimsRequest.supplier_address": + case "poktroll.proof.QueryAllClaimsRequest.supplier_operator_address": return protoreflect.ValueOfString("") case "poktroll.proof.QueryAllClaimsRequest.session_id": return protoreflect.ValueOfString("") @@ -2047,8 +2047,8 @@ func (x *fastReflection_QueryAllClaimsRequest) WhichOneof(d protoreflect.OneofDe return nil } switch x.Filter.(type) { - case *QueryAllClaimsRequest_SupplierAddress: - return x.Descriptor().Fields().ByName("supplier_address") + case *QueryAllClaimsRequest_SupplierOperatorAddress: + return x.Descriptor().Fields().ByName("supplier_operator_address") case *QueryAllClaimsRequest_SessionId: return x.Descriptor().Fields().ByName("session_id") case *QueryAllClaimsRequest_SessionEndHeight: @@ -2115,11 +2115,11 @@ func (x *fastReflection_QueryAllClaimsRequest) ProtoMethods() *protoiface.Method n += 1 + l + runtime.Sov(uint64(l)) } switch x := x.Filter.(type) { - case *QueryAllClaimsRequest_SupplierAddress: + case *QueryAllClaimsRequest_SupplierOperatorAddress: if x == nil { break } - l = len(x.SupplierAddress) + l = len(x.SupplierOperatorAddress) n += 1 + l + runtime.Sov(uint64(l)) case *QueryAllClaimsRequest_SessionId: if x == nil { @@ -2163,10 +2163,10 @@ func (x *fastReflection_QueryAllClaimsRequest) ProtoMethods() *protoiface.Method copy(dAtA[i:], x.unknownFields) } switch x := x.Filter.(type) { - case *QueryAllClaimsRequest_SupplierAddress: - i -= len(x.SupplierAddress) - copy(dAtA[i:], x.SupplierAddress) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.SupplierAddress))) + case *QueryAllClaimsRequest_SupplierOperatorAddress: + i -= len(x.SupplierOperatorAddress) + copy(dAtA[i:], x.SupplierOperatorAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.SupplierOperatorAddress))) i-- dAtA[i] = 0x12 case *QueryAllClaimsRequest_SessionId: @@ -2281,7 +2281,7 @@ func (x *fastReflection_QueryAllClaimsRequest) ProtoMethods() *protoiface.Method iNdEx = postIndex case 2: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field SupplierAddress", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field SupplierOperatorAddress", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2309,7 +2309,7 @@ func (x *fastReflection_QueryAllClaimsRequest) ProtoMethods() *protoiface.Method if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.Filter = &QueryAllClaimsRequest_SupplierAddress{string(dAtA[iNdEx:postIndex])} + x.Filter = &QueryAllClaimsRequest_SupplierOperatorAddress{string(dAtA[iNdEx:postIndex])} iNdEx = postIndex case 3: if wireType != 2 { @@ -2972,16 +2972,16 @@ func (x *fastReflection_QueryAllClaimsResponse) ProtoMethods() *protoiface.Metho } var ( - md_QueryGetProofRequest protoreflect.MessageDescriptor - fd_QueryGetProofRequest_session_id protoreflect.FieldDescriptor - fd_QueryGetProofRequest_supplier_address protoreflect.FieldDescriptor + md_QueryGetProofRequest protoreflect.MessageDescriptor + fd_QueryGetProofRequest_session_id protoreflect.FieldDescriptor + fd_QueryGetProofRequest_supplier_operator_address protoreflect.FieldDescriptor ) func init() { file_poktroll_proof_query_proto_init() md_QueryGetProofRequest = File_poktroll_proof_query_proto.Messages().ByName("QueryGetProofRequest") fd_QueryGetProofRequest_session_id = md_QueryGetProofRequest.Fields().ByName("session_id") - fd_QueryGetProofRequest_supplier_address = md_QueryGetProofRequest.Fields().ByName("supplier_address") + fd_QueryGetProofRequest_supplier_operator_address = md_QueryGetProofRequest.Fields().ByName("supplier_operator_address") } var _ protoreflect.Message = (*fastReflection_QueryGetProofRequest)(nil) @@ -3055,9 +3055,9 @@ func (x *fastReflection_QueryGetProofRequest) Range(f func(protoreflect.FieldDes return } } - if x.SupplierAddress != "" { - value := protoreflect.ValueOfString(x.SupplierAddress) - if !f(fd_QueryGetProofRequest_supplier_address, value) { + if x.SupplierOperatorAddress != "" { + value := protoreflect.ValueOfString(x.SupplierOperatorAddress) + if !f(fd_QueryGetProofRequest_supplier_operator_address, value) { return } } @@ -3078,8 +3078,8 @@ func (x *fastReflection_QueryGetProofRequest) Has(fd protoreflect.FieldDescripto switch fd.FullName() { case "poktroll.proof.QueryGetProofRequest.session_id": return x.SessionId != "" - case "poktroll.proof.QueryGetProofRequest.supplier_address": - return x.SupplierAddress != "" + case "poktroll.proof.QueryGetProofRequest.supplier_operator_address": + return x.SupplierOperatorAddress != "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.proof.QueryGetProofRequest")) @@ -3098,8 +3098,8 @@ func (x *fastReflection_QueryGetProofRequest) Clear(fd protoreflect.FieldDescrip switch fd.FullName() { case "poktroll.proof.QueryGetProofRequest.session_id": x.SessionId = "" - case "poktroll.proof.QueryGetProofRequest.supplier_address": - x.SupplierAddress = "" + case "poktroll.proof.QueryGetProofRequest.supplier_operator_address": + x.SupplierOperatorAddress = "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.proof.QueryGetProofRequest")) @@ -3119,8 +3119,8 @@ func (x *fastReflection_QueryGetProofRequest) Get(descriptor protoreflect.FieldD case "poktroll.proof.QueryGetProofRequest.session_id": value := x.SessionId return protoreflect.ValueOfString(value) - case "poktroll.proof.QueryGetProofRequest.supplier_address": - value := x.SupplierAddress + case "poktroll.proof.QueryGetProofRequest.supplier_operator_address": + value := x.SupplierOperatorAddress return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { @@ -3144,8 +3144,8 @@ func (x *fastReflection_QueryGetProofRequest) Set(fd protoreflect.FieldDescripto switch fd.FullName() { case "poktroll.proof.QueryGetProofRequest.session_id": x.SessionId = value.Interface().(string) - case "poktroll.proof.QueryGetProofRequest.supplier_address": - x.SupplierAddress = value.Interface().(string) + case "poktroll.proof.QueryGetProofRequest.supplier_operator_address": + x.SupplierOperatorAddress = value.Interface().(string) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.proof.QueryGetProofRequest")) @@ -3168,8 +3168,8 @@ func (x *fastReflection_QueryGetProofRequest) Mutable(fd protoreflect.FieldDescr switch fd.FullName() { case "poktroll.proof.QueryGetProofRequest.session_id": panic(fmt.Errorf("field session_id of message poktroll.proof.QueryGetProofRequest is not mutable")) - case "poktroll.proof.QueryGetProofRequest.supplier_address": - panic(fmt.Errorf("field supplier_address of message poktroll.proof.QueryGetProofRequest is not mutable")) + case "poktroll.proof.QueryGetProofRequest.supplier_operator_address": + panic(fmt.Errorf("field supplier_operator_address of message poktroll.proof.QueryGetProofRequest is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.proof.QueryGetProofRequest")) @@ -3185,7 +3185,7 @@ func (x *fastReflection_QueryGetProofRequest) NewField(fd protoreflect.FieldDesc switch fd.FullName() { case "poktroll.proof.QueryGetProofRequest.session_id": return protoreflect.ValueOfString("") - case "poktroll.proof.QueryGetProofRequest.supplier_address": + case "poktroll.proof.QueryGetProofRequest.supplier_operator_address": return protoreflect.ValueOfString("") default: if fd.IsExtension() { @@ -3260,7 +3260,7 @@ func (x *fastReflection_QueryGetProofRequest) ProtoMethods() *protoiface.Methods if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - l = len(x.SupplierAddress) + l = len(x.SupplierOperatorAddress) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } @@ -3293,10 +3293,10 @@ func (x *fastReflection_QueryGetProofRequest) ProtoMethods() *protoiface.Methods i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if len(x.SupplierAddress) > 0 { - i -= len(x.SupplierAddress) - copy(dAtA[i:], x.SupplierAddress) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.SupplierAddress))) + if len(x.SupplierOperatorAddress) > 0 { + i -= len(x.SupplierOperatorAddress) + copy(dAtA[i:], x.SupplierOperatorAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.SupplierOperatorAddress))) i-- dAtA[i] = 0x12 } @@ -3390,7 +3390,7 @@ func (x *fastReflection_QueryGetProofRequest) ProtoMethods() *protoiface.Methods iNdEx = postIndex case 2: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field SupplierAddress", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field SupplierOperatorAddress", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -3418,7 +3418,7 @@ func (x *fastReflection_QueryGetProofRequest) ProtoMethods() *protoiface.Methods if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.SupplierAddress = string(dAtA[iNdEx:postIndex]) + x.SupplierOperatorAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -3891,18 +3891,18 @@ func (x *fastReflection_QueryGetProofResponse) ProtoMethods() *protoiface.Method } var ( - md_QueryAllProofsRequest protoreflect.MessageDescriptor - fd_QueryAllProofsRequest_pagination protoreflect.FieldDescriptor - fd_QueryAllProofsRequest_supplier_address protoreflect.FieldDescriptor - fd_QueryAllProofsRequest_session_id protoreflect.FieldDescriptor - fd_QueryAllProofsRequest_session_end_height protoreflect.FieldDescriptor + md_QueryAllProofsRequest protoreflect.MessageDescriptor + fd_QueryAllProofsRequest_pagination protoreflect.FieldDescriptor + fd_QueryAllProofsRequest_supplier_operator_address protoreflect.FieldDescriptor + fd_QueryAllProofsRequest_session_id protoreflect.FieldDescriptor + fd_QueryAllProofsRequest_session_end_height protoreflect.FieldDescriptor ) func init() { file_poktroll_proof_query_proto_init() md_QueryAllProofsRequest = File_poktroll_proof_query_proto.Messages().ByName("QueryAllProofsRequest") fd_QueryAllProofsRequest_pagination = md_QueryAllProofsRequest.Fields().ByName("pagination") - fd_QueryAllProofsRequest_supplier_address = md_QueryAllProofsRequest.Fields().ByName("supplier_address") + fd_QueryAllProofsRequest_supplier_operator_address = md_QueryAllProofsRequest.Fields().ByName("supplier_operator_address") fd_QueryAllProofsRequest_session_id = md_QueryAllProofsRequest.Fields().ByName("session_id") fd_QueryAllProofsRequest_session_end_height = md_QueryAllProofsRequest.Fields().ByName("session_end_height") } @@ -3980,10 +3980,10 @@ func (x *fastReflection_QueryAllProofsRequest) Range(f func(protoreflect.FieldDe } if x.Filter != nil { switch o := x.Filter.(type) { - case *QueryAllProofsRequest_SupplierAddress: - v := o.SupplierAddress + case *QueryAllProofsRequest_SupplierOperatorAddress: + v := o.SupplierOperatorAddress value := protoreflect.ValueOfString(v) - if !f(fd_QueryAllProofsRequest_supplier_address, value) { + if !f(fd_QueryAllProofsRequest_supplier_operator_address, value) { return } case *QueryAllProofsRequest_SessionId: @@ -4017,10 +4017,10 @@ func (x *fastReflection_QueryAllProofsRequest) Has(fd protoreflect.FieldDescript switch fd.FullName() { case "poktroll.proof.QueryAllProofsRequest.pagination": return x.Pagination != nil - case "poktroll.proof.QueryAllProofsRequest.supplier_address": + case "poktroll.proof.QueryAllProofsRequest.supplier_operator_address": if x.Filter == nil { return false - } else if _, ok := x.Filter.(*QueryAllProofsRequest_SupplierAddress); ok { + } else if _, ok := x.Filter.(*QueryAllProofsRequest_SupplierOperatorAddress); ok { return true } else { return false @@ -4059,7 +4059,7 @@ func (x *fastReflection_QueryAllProofsRequest) Clear(fd protoreflect.FieldDescri switch fd.FullName() { case "poktroll.proof.QueryAllProofsRequest.pagination": x.Pagination = nil - case "poktroll.proof.QueryAllProofsRequest.supplier_address": + case "poktroll.proof.QueryAllProofsRequest.supplier_operator_address": x.Filter = nil case "poktroll.proof.QueryAllProofsRequest.session_id": x.Filter = nil @@ -4084,11 +4084,11 @@ func (x *fastReflection_QueryAllProofsRequest) Get(descriptor protoreflect.Field case "poktroll.proof.QueryAllProofsRequest.pagination": value := x.Pagination return protoreflect.ValueOfMessage(value.ProtoReflect()) - case "poktroll.proof.QueryAllProofsRequest.supplier_address": + case "poktroll.proof.QueryAllProofsRequest.supplier_operator_address": if x.Filter == nil { return protoreflect.ValueOfString("") - } else if v, ok := x.Filter.(*QueryAllProofsRequest_SupplierAddress); ok { - return protoreflect.ValueOfString(v.SupplierAddress) + } else if v, ok := x.Filter.(*QueryAllProofsRequest_SupplierOperatorAddress); ok { + return protoreflect.ValueOfString(v.SupplierOperatorAddress) } else { return protoreflect.ValueOfString("") } @@ -4130,9 +4130,9 @@ func (x *fastReflection_QueryAllProofsRequest) Set(fd protoreflect.FieldDescript switch fd.FullName() { case "poktroll.proof.QueryAllProofsRequest.pagination": x.Pagination = value.Message().Interface().(*v1beta1.PageRequest) - case "poktroll.proof.QueryAllProofsRequest.supplier_address": + case "poktroll.proof.QueryAllProofsRequest.supplier_operator_address": cv := value.Interface().(string) - x.Filter = &QueryAllProofsRequest_SupplierAddress{SupplierAddress: cv} + x.Filter = &QueryAllProofsRequest_SupplierOperatorAddress{SupplierOperatorAddress: cv} case "poktroll.proof.QueryAllProofsRequest.session_id": cv := value.Interface().(string) x.Filter = &QueryAllProofsRequest_SessionId{SessionId: cv} @@ -4164,8 +4164,8 @@ func (x *fastReflection_QueryAllProofsRequest) Mutable(fd protoreflect.FieldDesc x.Pagination = new(v1beta1.PageRequest) } return protoreflect.ValueOfMessage(x.Pagination.ProtoReflect()) - case "poktroll.proof.QueryAllProofsRequest.supplier_address": - panic(fmt.Errorf("field supplier_address of message poktroll.proof.QueryAllProofsRequest is not mutable")) + case "poktroll.proof.QueryAllProofsRequest.supplier_operator_address": + panic(fmt.Errorf("field supplier_operator_address of message poktroll.proof.QueryAllProofsRequest is not mutable")) case "poktroll.proof.QueryAllProofsRequest.session_id": panic(fmt.Errorf("field session_id of message poktroll.proof.QueryAllProofsRequest is not mutable")) case "poktroll.proof.QueryAllProofsRequest.session_end_height": @@ -4186,7 +4186,7 @@ func (x *fastReflection_QueryAllProofsRequest) NewField(fd protoreflect.FieldDes case "poktroll.proof.QueryAllProofsRequest.pagination": m := new(v1beta1.PageRequest) return protoreflect.ValueOfMessage(m.ProtoReflect()) - case "poktroll.proof.QueryAllProofsRequest.supplier_address": + case "poktroll.proof.QueryAllProofsRequest.supplier_operator_address": return protoreflect.ValueOfString("") case "poktroll.proof.QueryAllProofsRequest.session_id": return protoreflect.ValueOfString("") @@ -4210,8 +4210,8 @@ func (x *fastReflection_QueryAllProofsRequest) WhichOneof(d protoreflect.OneofDe return nil } switch x.Filter.(type) { - case *QueryAllProofsRequest_SupplierAddress: - return x.Descriptor().Fields().ByName("supplier_address") + case *QueryAllProofsRequest_SupplierOperatorAddress: + return x.Descriptor().Fields().ByName("supplier_operator_address") case *QueryAllProofsRequest_SessionId: return x.Descriptor().Fields().ByName("session_id") case *QueryAllProofsRequest_SessionEndHeight: @@ -4278,11 +4278,11 @@ func (x *fastReflection_QueryAllProofsRequest) ProtoMethods() *protoiface.Method n += 1 + l + runtime.Sov(uint64(l)) } switch x := x.Filter.(type) { - case *QueryAllProofsRequest_SupplierAddress: + case *QueryAllProofsRequest_SupplierOperatorAddress: if x == nil { break } - l = len(x.SupplierAddress) + l = len(x.SupplierOperatorAddress) n += 1 + l + runtime.Sov(uint64(l)) case *QueryAllProofsRequest_SessionId: if x == nil { @@ -4326,10 +4326,10 @@ func (x *fastReflection_QueryAllProofsRequest) ProtoMethods() *protoiface.Method copy(dAtA[i:], x.unknownFields) } switch x := x.Filter.(type) { - case *QueryAllProofsRequest_SupplierAddress: - i -= len(x.SupplierAddress) - copy(dAtA[i:], x.SupplierAddress) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.SupplierAddress))) + case *QueryAllProofsRequest_SupplierOperatorAddress: + i -= len(x.SupplierOperatorAddress) + copy(dAtA[i:], x.SupplierOperatorAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.SupplierOperatorAddress))) i-- dAtA[i] = 0x12 case *QueryAllProofsRequest_SessionId: @@ -4444,7 +4444,7 @@ func (x *fastReflection_QueryAllProofsRequest) ProtoMethods() *protoiface.Method iNdEx = postIndex case 2: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field SupplierAddress", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field SupplierOperatorAddress", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -4472,7 +4472,7 @@ func (x *fastReflection_QueryAllProofsRequest) ProtoMethods() *protoiface.Method if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.Filter = &QueryAllProofsRequest_SupplierAddress{string(dAtA[iNdEx:postIndex])} + x.Filter = &QueryAllProofsRequest_SupplierOperatorAddress{string(dAtA[iNdEx:postIndex])} iNdEx = postIndex case 3: if wireType != 2 { @@ -5216,8 +5216,8 @@ type QueryGetClaimRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - SessionId string `protobuf:"bytes,1,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` - SupplierAddress string `protobuf:"bytes,2,opt,name=supplier_address,json=supplierAddress,proto3" json:"supplier_address,omitempty"` + SessionId string `protobuf:"bytes,1,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` + SupplierOperatorAddress string `protobuf:"bytes,2,opt,name=supplier_operator_address,json=supplierOperatorAddress,proto3" json:"supplier_operator_address,omitempty"` } func (x *QueryGetClaimRequest) Reset() { @@ -5247,9 +5247,9 @@ func (x *QueryGetClaimRequest) GetSessionId() string { return "" } -func (x *QueryGetClaimRequest) GetSupplierAddress() string { +func (x *QueryGetClaimRequest) GetSupplierOperatorAddress() string { if x != nil { - return x.SupplierAddress + return x.SupplierOperatorAddress } return "" } @@ -5297,7 +5297,7 @@ type QueryAllClaimsRequest struct { Pagination *v1beta1.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` // Types that are assignable to Filter: // - // *QueryAllClaimsRequest_SupplierAddress + // *QueryAllClaimsRequest_SupplierOperatorAddress // *QueryAllClaimsRequest_SessionId // *QueryAllClaimsRequest_SessionEndHeight Filter isQueryAllClaimsRequest_Filter `protobuf_oneof:"filter"` @@ -5337,9 +5337,9 @@ func (x *QueryAllClaimsRequest) GetFilter() isQueryAllClaimsRequest_Filter { return nil } -func (x *QueryAllClaimsRequest) GetSupplierAddress() string { - if x, ok := x.GetFilter().(*QueryAllClaimsRequest_SupplierAddress); ok { - return x.SupplierAddress +func (x *QueryAllClaimsRequest) GetSupplierOperatorAddress() string { + if x, ok := x.GetFilter().(*QueryAllClaimsRequest_SupplierOperatorAddress); ok { + return x.SupplierOperatorAddress } return "" } @@ -5362,8 +5362,8 @@ type isQueryAllClaimsRequest_Filter interface { isQueryAllClaimsRequest_Filter() } -type QueryAllClaimsRequest_SupplierAddress struct { - SupplierAddress string `protobuf:"bytes,2,opt,name=supplier_address,json=supplierAddress,proto3,oneof"` +type QueryAllClaimsRequest_SupplierOperatorAddress struct { + SupplierOperatorAddress string `protobuf:"bytes,2,opt,name=supplier_operator_address,json=supplierOperatorAddress,proto3,oneof"` } type QueryAllClaimsRequest_SessionId struct { @@ -5374,7 +5374,7 @@ type QueryAllClaimsRequest_SessionEndHeight struct { SessionEndHeight uint64 `protobuf:"varint,4,opt,name=session_end_height,json=sessionEndHeight,proto3,oneof"` } -func (*QueryAllClaimsRequest_SupplierAddress) isQueryAllClaimsRequest_Filter() {} +func (*QueryAllClaimsRequest_SupplierOperatorAddress) isQueryAllClaimsRequest_Filter() {} func (*QueryAllClaimsRequest_SessionId) isQueryAllClaimsRequest_Filter() {} @@ -5428,8 +5428,8 @@ type QueryGetProofRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - SessionId string `protobuf:"bytes,1,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` - SupplierAddress string `protobuf:"bytes,2,opt,name=supplier_address,json=supplierAddress,proto3" json:"supplier_address,omitempty"` + SessionId string `protobuf:"bytes,1,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` + SupplierOperatorAddress string `protobuf:"bytes,2,opt,name=supplier_operator_address,json=supplierOperatorAddress,proto3" json:"supplier_operator_address,omitempty"` } func (x *QueryGetProofRequest) Reset() { @@ -5459,9 +5459,9 @@ func (x *QueryGetProofRequest) GetSessionId() string { return "" } -func (x *QueryGetProofRequest) GetSupplierAddress() string { +func (x *QueryGetProofRequest) GetSupplierOperatorAddress() string { if x != nil { - return x.SupplierAddress + return x.SupplierOperatorAddress } return "" } @@ -5509,7 +5509,7 @@ type QueryAllProofsRequest struct { Pagination *v1beta1.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` // Types that are assignable to Filter: // - // *QueryAllProofsRequest_SupplierAddress + // *QueryAllProofsRequest_SupplierOperatorAddress // *QueryAllProofsRequest_SessionId // *QueryAllProofsRequest_SessionEndHeight Filter isQueryAllProofsRequest_Filter `protobuf_oneof:"filter"` @@ -5549,9 +5549,9 @@ func (x *QueryAllProofsRequest) GetFilter() isQueryAllProofsRequest_Filter { return nil } -func (x *QueryAllProofsRequest) GetSupplierAddress() string { - if x, ok := x.GetFilter().(*QueryAllProofsRequest_SupplierAddress); ok { - return x.SupplierAddress +func (x *QueryAllProofsRequest) GetSupplierOperatorAddress() string { + if x, ok := x.GetFilter().(*QueryAllProofsRequest_SupplierOperatorAddress); ok { + return x.SupplierOperatorAddress } return "" } @@ -5574,8 +5574,8 @@ type isQueryAllProofsRequest_Filter interface { isQueryAllProofsRequest_Filter() } -type QueryAllProofsRequest_SupplierAddress struct { - SupplierAddress string `protobuf:"bytes,2,opt,name=supplier_address,json=supplierAddress,proto3,oneof"` +type QueryAllProofsRequest_SupplierOperatorAddress struct { + SupplierOperatorAddress string `protobuf:"bytes,2,opt,name=supplier_operator_address,json=supplierOperatorAddress,proto3,oneof"` } type QueryAllProofsRequest_SessionId struct { @@ -5586,7 +5586,7 @@ type QueryAllProofsRequest_SessionEndHeight struct { SessionEndHeight uint64 `protobuf:"varint,4,opt,name=session_end_height,json=sessionEndHeight,proto3,oneof"` } -func (*QueryAllProofsRequest_SupplierAddress) isQueryAllProofsRequest_Filter() {} +func (*QueryAllProofsRequest_SupplierOperatorAddress) isQueryAllProofsRequest_Filter() {} func (*QueryAllProofsRequest_SessionId) isQueryAllProofsRequest_Filter() {} @@ -5661,137 +5661,142 @@ var file_poktroll_proof_query_proto_rawDesc = []byte{ 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, - 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x7a, 0x0a, 0x14, 0x51, 0x75, 0x65, 0x72, 0x79, - 0x47, 0x65, 0x74, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x1d, 0x0a, 0x0a, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x43, - 0x0a, 0x10, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, - 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, - 0x6e, 0x67, 0x52, 0x0f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, - 0x65, 0x73, 0x73, 0x22, 0x4a, 0x0a, 0x15, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x43, - 0x6c, 0x61, 0x69, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x31, 0x0a, 0x05, - 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x6f, - 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x2e, 0x43, 0x6c, 0x61, - 0x69, 0x6d, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x05, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x22, - 0xe7, 0x01, 0x0a, 0x15, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x43, 0x6c, 0x61, 0x69, - 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x46, 0x0a, 0x0a, 0x70, 0x61, 0x67, + 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x8b, 0x01, 0x0a, 0x14, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x47, 0x65, 0x74, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, + 0x54, 0x0a, 0x19, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x5f, 0x6f, 0x70, 0x65, 0x72, + 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x17, 0x73, 0x75, + 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x4a, 0x0a, 0x15, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, + 0x74, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x31, + 0x0a, 0x05, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, + 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x2e, 0x43, + 0x6c, 0x61, 0x69, 0x6d, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x05, 0x63, 0x6c, 0x61, 0x69, + 0x6d, 0x22, 0xf8, 0x01, 0x0a, 0x15, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x43, 0x6c, + 0x61, 0x69, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x46, 0x0a, 0x0a, 0x70, + 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, + 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x3c, 0x0a, 0x19, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x5f, + 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x17, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, + 0x65, 0x72, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x12, 0x1f, 0x0a, 0x0a, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x09, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, + 0x49, 0x64, 0x12, 0x2e, 0x0a, 0x12, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x6e, + 0x64, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x48, 0x00, + 0x52, 0x10, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x64, 0x48, 0x65, 0x69, 0x67, + 0x68, 0x74, 0x42, 0x08, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, 0x96, 0x01, 0x0a, + 0x16, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x33, 0x0a, 0x06, 0x63, 0x6c, 0x61, 0x69, 0x6d, + 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, + 0x6c, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x2e, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x42, 0x04, + 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x06, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x73, 0x12, 0x47, 0x0a, 0x0a, + 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, + 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, + 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x8b, 0x01, 0x0a, 0x14, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, + 0x65, 0x74, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, + 0x0a, 0x0a, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x09, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x54, 0x0a, + 0x19, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x5f, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, + 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x17, 0x73, 0x75, 0x70, 0x70, + 0x6c, 0x69, 0x65, 0x72, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x22, 0x4a, 0x0a, 0x15, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x50, + 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x31, 0x0a, 0x05, + 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x6f, + 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x2e, 0x50, 0x72, 0x6f, + 0x6f, 0x66, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x05, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x22, + 0xf8, 0x01, 0x0a, 0x15, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x50, 0x72, 0x6f, 0x6f, + 0x66, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x46, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x12, 0x2b, 0x0a, 0x10, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x5f, 0x61, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0f, 0x73, - 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1f, - 0x0a, 0x0a, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x48, 0x00, 0x52, 0x09, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, - 0x2e, 0x0a, 0x12, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x6e, 0x64, 0x5f, 0x68, - 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x48, 0x00, 0x52, 0x10, 0x73, - 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x64, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x42, - 0x08, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, 0x96, 0x01, 0x0a, 0x16, 0x51, 0x75, - 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x33, 0x0a, 0x06, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x73, 0x18, 0x01, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, - 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x2e, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x42, 0x04, 0xc8, 0xde, 0x1f, - 0x00, 0x52, 0x06, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x73, 0x12, 0x47, 0x0a, 0x0a, 0x70, 0x61, 0x67, - 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, - 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x22, 0x7a, 0x0a, 0x14, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x50, 0x72, - 0x6f, 0x6f, 0x66, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x65, - 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, - 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x43, 0x0a, 0x10, 0x73, 0x75, 0x70, - 0x70, 0x6c, 0x69, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x0f, 0x73, - 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x4a, - 0x0a, 0x15, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x31, 0x0a, 0x05, 0x70, 0x72, 0x6f, 0x6f, 0x66, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, - 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x2e, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x42, 0x04, 0xc8, - 0xde, 0x1f, 0x00, 0x52, 0x05, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x22, 0xe7, 0x01, 0x0a, 0x15, 0x51, - 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x73, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x46, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2b, 0x0a, 0x10, - 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, - 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1f, 0x0a, 0x0a, 0x73, 0x65, 0x73, - 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, - 0x09, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x2e, 0x0a, 0x12, 0x73, 0x65, - 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x6e, 0x64, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x48, 0x00, 0x52, 0x10, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, - 0x6e, 0x45, 0x6e, 0x64, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x42, 0x08, 0x0a, 0x06, 0x66, 0x69, - 0x6c, 0x74, 0x65, 0x72, 0x22, 0x96, 0x01, 0x0a, 0x16, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, - 0x6c, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x33, 0x0a, 0x06, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x15, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x6f, 0x66, - 0x2e, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x06, 0x70, 0x72, - 0x6f, 0x6f, 0x66, 0x73, 0x12, 0x47, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x32, 0xdf, 0x05, - 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x7e, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, - 0x73, 0x12, 0x22, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x70, 0x72, 0x6f, - 0x6f, 0x66, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, - 0x2e, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, - 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2b, 0x82, 0xd3, 0xe4, 0x93, - 0x02, 0x25, 0x12, 0x23, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, - 0x6b, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x6f, 0x66, - 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0xa0, 0x01, 0x0a, 0x05, 0x43, 0x6c, 0x61, 0x69, - 0x6d, 0x12, 0x24, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x70, 0x72, 0x6f, - 0x6f, 0x66, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x43, 0x6c, 0x61, 0x69, 0x6d, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, + 0x6e, 0x12, 0x3c, 0x0a, 0x19, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x5f, 0x6f, 0x70, + 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x17, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, + 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, + 0x1f, 0x0a, 0x0a, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x09, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, + 0x12, 0x2e, 0x0a, 0x12, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x6e, 0x64, 0x5f, + 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x48, 0x00, 0x52, 0x10, + 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x64, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, + 0x42, 0x08, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, 0x96, 0x01, 0x0a, 0x16, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x33, 0x0a, 0x06, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, + 0x2e, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x2e, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x42, 0x04, 0xc8, 0xde, + 0x1f, 0x00, 0x52, 0x06, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x73, 0x12, 0x47, 0x0a, 0x0a, 0x70, 0x61, + 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, + 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, + 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x32, 0xf1, 0x05, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x7e, 0x0a, + 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x22, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, + 0x6c, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x70, 0x6f, + 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x2e, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x2b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x25, 0x12, 0x23, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x2d, + 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, + 0x2f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0xa9, 0x01, + 0x0a, 0x05, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x12, 0x24, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, - 0x74, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x4a, - 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x44, 0x12, 0x42, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x2d, 0x6e, 0x65, - 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x70, - 0x72, 0x6f, 0x6f, 0x66, 0x2f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x2f, 0x7b, 0x73, 0x65, 0x73, 0x73, - 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x7b, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, - 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x7d, 0x12, 0x86, 0x01, 0x0a, 0x09, 0x41, - 0x6c, 0x6c, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x73, 0x12, 0x25, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, - 0x6f, 0x6c, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, - 0x6c, 0x6c, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x26, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x6f, 0x66, - 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x24, 0x12, - 0x22, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x70, - 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x2f, 0x63, 0x6c, - 0x61, 0x69, 0x6d, 0x12, 0xa0, 0x01, 0x0a, 0x05, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x24, 0x2e, + 0x74, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x2e, 0x51, - 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x70, - 0x72, 0x6f, 0x6f, 0x66, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, - 0x6f, 0x66, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x4a, 0x82, 0xd3, 0xe4, 0x93, - 0x02, 0x44, 0x12, 0x42, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, - 0x6b, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x6f, 0x66, - 0x2f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x2f, 0x7b, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, - 0x69, 0x64, 0x7d, 0x2f, 0x7b, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x5f, 0x61, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x7d, 0x12, 0x86, 0x01, 0x0a, 0x09, 0x41, 0x6c, 0x6c, 0x50, 0x72, - 0x6f, 0x6f, 0x66, 0x73, 0x12, 0x25, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, - 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x50, 0x72, - 0x6f, 0x6f, 0x66, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x70, 0x6f, - 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x2e, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x2a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x24, 0x12, 0x22, 0x2f, 0x70, 0x6f, - 0x6b, 0x74, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, - 0x6f, 0x6c, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x2f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x42, - 0x9a, 0x01, 0x0a, 0x12, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, - 0x2e, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, - 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x1f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, - 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, - 0x70, 0x72, 0x6f, 0x6f, 0x66, 0xa2, 0x02, 0x03, 0x50, 0x50, 0x58, 0xaa, 0x02, 0x0e, 0x50, 0x6f, - 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0xca, 0x02, 0x0e, 0x50, - 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0xe2, 0x02, 0x1a, - 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x5c, 0x47, - 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0f, 0x50, 0x6f, 0x6b, - 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x53, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x4d, 0x12, 0x4b, 0x2f, 0x70, + 0x6f, 0x6b, 0x74, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x70, 0x6f, 0x6b, 0x74, + 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x2f, 0x63, 0x6c, 0x61, 0x69, 0x6d, + 0x2f, 0x7b, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x7b, 0x73, + 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x5f, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, + 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x7d, 0x12, 0x86, 0x01, 0x0a, 0x09, 0x41, 0x6c, + 0x6c, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x73, 0x12, 0x25, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, + 0x6c, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, + 0x6c, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, + 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x2e, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x24, 0x12, 0x22, + 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x70, 0x6f, + 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x2f, 0x63, 0x6c, 0x61, + 0x69, 0x6d, 0x12, 0xa9, 0x01, 0x0a, 0x05, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x24, 0x2e, 0x70, + 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x2e, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x70, 0x72, + 0x6f, 0x6f, 0x66, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x6f, + 0x66, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x53, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x4d, 0x12, 0x4b, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, + 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x2f, + 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x2f, 0x7b, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, + 0x64, 0x7d, 0x2f, 0x7b, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x5f, 0x6f, 0x70, 0x65, + 0x72, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x7d, 0x12, 0x86, + 0x01, 0x0a, 0x09, 0x41, 0x6c, 0x6c, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x73, 0x12, 0x25, 0x2e, 0x70, + 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x2e, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x70, + 0x72, 0x6f, 0x6f, 0x66, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x50, 0x72, 0x6f, + 0x6f, 0x66, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2a, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x24, 0x12, 0x22, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, + 0x72, 0x6b, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x6f, + 0x66, 0x2f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x42, 0x9a, 0x01, 0x0a, 0x12, 0x63, 0x6f, 0x6d, 0x2e, + 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x42, 0x0a, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x1f, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, + 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0xa2, 0x02, 0x03, + 0x50, 0x50, 0x58, 0xaa, 0x02, 0x0e, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x50, + 0x72, 0x6f, 0x6f, 0x66, 0xca, 0x02, 0x0e, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, + 0x50, 0x72, 0x6f, 0x6f, 0x66, 0xe2, 0x02, 0x1a, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, + 0x5c, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0xea, 0x02, 0x0f, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, 0x50, + 0x72, 0x6f, 0x6f, 0x66, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -5982,12 +5987,12 @@ func file_poktroll_proof_query_proto_init() { } } file_poktroll_proof_query_proto_msgTypes[4].OneofWrappers = []interface{}{ - (*QueryAllClaimsRequest_SupplierAddress)(nil), + (*QueryAllClaimsRequest_SupplierOperatorAddress)(nil), (*QueryAllClaimsRequest_SessionId)(nil), (*QueryAllClaimsRequest_SessionEndHeight)(nil), } file_poktroll_proof_query_proto_msgTypes[8].OneofWrappers = []interface{}{ - (*QueryAllProofsRequest_SupplierAddress)(nil), + (*QueryAllProofsRequest_SupplierOperatorAddress)(nil), (*QueryAllProofsRequest_SessionId)(nil), (*QueryAllProofsRequest_SessionEndHeight)(nil), } diff --git a/api/poktroll/proof/tx.pulsar.go b/api/poktroll/proof/tx.pulsar.go index 2dc2636b2..2dc2e1479 100644 --- a/api/poktroll/proof/tx.pulsar.go +++ b/api/poktroll/proof/tx.pulsar.go @@ -2193,16 +2193,16 @@ func (x *fastReflection_MsgUpdateParamResponse) ProtoMethods() *protoiface.Metho } var ( - md_MsgCreateClaim protoreflect.MessageDescriptor - fd_MsgCreateClaim_supplier_address protoreflect.FieldDescriptor - fd_MsgCreateClaim_session_header protoreflect.FieldDescriptor - fd_MsgCreateClaim_root_hash protoreflect.FieldDescriptor + md_MsgCreateClaim protoreflect.MessageDescriptor + fd_MsgCreateClaim_supplier_operator_address protoreflect.FieldDescriptor + fd_MsgCreateClaim_session_header protoreflect.FieldDescriptor + fd_MsgCreateClaim_root_hash protoreflect.FieldDescriptor ) func init() { file_poktroll_proof_tx_proto_init() md_MsgCreateClaim = File_poktroll_proof_tx_proto.Messages().ByName("MsgCreateClaim") - fd_MsgCreateClaim_supplier_address = md_MsgCreateClaim.Fields().ByName("supplier_address") + fd_MsgCreateClaim_supplier_operator_address = md_MsgCreateClaim.Fields().ByName("supplier_operator_address") fd_MsgCreateClaim_session_header = md_MsgCreateClaim.Fields().ByName("session_header") fd_MsgCreateClaim_root_hash = md_MsgCreateClaim.Fields().ByName("root_hash") } @@ -2272,9 +2272,9 @@ func (x *fastReflection_MsgCreateClaim) Interface() protoreflect.ProtoMessage { // While iterating, mutating operations may only be performed // on the current field descriptor. func (x *fastReflection_MsgCreateClaim) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.SupplierAddress != "" { - value := protoreflect.ValueOfString(x.SupplierAddress) - if !f(fd_MsgCreateClaim_supplier_address, value) { + if x.SupplierOperatorAddress != "" { + value := protoreflect.ValueOfString(x.SupplierOperatorAddress) + if !f(fd_MsgCreateClaim_supplier_operator_address, value) { return } } @@ -2305,8 +2305,8 @@ func (x *fastReflection_MsgCreateClaim) Range(f func(protoreflect.FieldDescripto // a repeated field is populated if it is non-empty. func (x *fastReflection_MsgCreateClaim) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "poktroll.proof.MsgCreateClaim.supplier_address": - return x.SupplierAddress != "" + case "poktroll.proof.MsgCreateClaim.supplier_operator_address": + return x.SupplierOperatorAddress != "" case "poktroll.proof.MsgCreateClaim.session_header": return x.SessionHeader != nil case "poktroll.proof.MsgCreateClaim.root_hash": @@ -2327,8 +2327,8 @@ func (x *fastReflection_MsgCreateClaim) Has(fd protoreflect.FieldDescriptor) boo // Clear is a mutating operation and unsafe for concurrent use. func (x *fastReflection_MsgCreateClaim) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "poktroll.proof.MsgCreateClaim.supplier_address": - x.SupplierAddress = "" + case "poktroll.proof.MsgCreateClaim.supplier_operator_address": + x.SupplierOperatorAddress = "" case "poktroll.proof.MsgCreateClaim.session_header": x.SessionHeader = nil case "poktroll.proof.MsgCreateClaim.root_hash": @@ -2349,8 +2349,8 @@ func (x *fastReflection_MsgCreateClaim) Clear(fd protoreflect.FieldDescriptor) { // of the value; to obtain a mutable reference, use Mutable. func (x *fastReflection_MsgCreateClaim) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "poktroll.proof.MsgCreateClaim.supplier_address": - value := x.SupplierAddress + case "poktroll.proof.MsgCreateClaim.supplier_operator_address": + value := x.SupplierOperatorAddress return protoreflect.ValueOfString(value) case "poktroll.proof.MsgCreateClaim.session_header": value := x.SessionHeader @@ -2378,8 +2378,8 @@ func (x *fastReflection_MsgCreateClaim) Get(descriptor protoreflect.FieldDescrip // Set is a mutating operation and unsafe for concurrent use. func (x *fastReflection_MsgCreateClaim) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "poktroll.proof.MsgCreateClaim.supplier_address": - x.SupplierAddress = value.Interface().(string) + case "poktroll.proof.MsgCreateClaim.supplier_operator_address": + x.SupplierOperatorAddress = value.Interface().(string) case "poktroll.proof.MsgCreateClaim.session_header": x.SessionHeader = value.Message().Interface().(*session.SessionHeader) case "poktroll.proof.MsgCreateClaim.root_hash": @@ -2409,8 +2409,8 @@ func (x *fastReflection_MsgCreateClaim) Mutable(fd protoreflect.FieldDescriptor) x.SessionHeader = new(session.SessionHeader) } return protoreflect.ValueOfMessage(x.SessionHeader.ProtoReflect()) - case "poktroll.proof.MsgCreateClaim.supplier_address": - panic(fmt.Errorf("field supplier_address of message poktroll.proof.MsgCreateClaim is not mutable")) + case "poktroll.proof.MsgCreateClaim.supplier_operator_address": + panic(fmt.Errorf("field supplier_operator_address of message poktroll.proof.MsgCreateClaim is not mutable")) case "poktroll.proof.MsgCreateClaim.root_hash": panic(fmt.Errorf("field root_hash of message poktroll.proof.MsgCreateClaim is not mutable")) default: @@ -2426,7 +2426,7 @@ func (x *fastReflection_MsgCreateClaim) Mutable(fd protoreflect.FieldDescriptor) // For lists, maps, and messages, this returns a new, empty, mutable value. func (x *fastReflection_MsgCreateClaim) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "poktroll.proof.MsgCreateClaim.supplier_address": + case "poktroll.proof.MsgCreateClaim.supplier_operator_address": return protoreflect.ValueOfString("") case "poktroll.proof.MsgCreateClaim.session_header": m := new(session.SessionHeader) @@ -2502,7 +2502,7 @@ func (x *fastReflection_MsgCreateClaim) ProtoMethods() *protoiface.Methods { var n int var l int _ = l - l = len(x.SupplierAddress) + l = len(x.SupplierOperatorAddress) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } @@ -2564,10 +2564,10 @@ func (x *fastReflection_MsgCreateClaim) ProtoMethods() *protoiface.Methods { i-- dAtA[i] = 0x12 } - if len(x.SupplierAddress) > 0 { - i -= len(x.SupplierAddress) - copy(dAtA[i:], x.SupplierAddress) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.SupplierAddress))) + if len(x.SupplierOperatorAddress) > 0 { + i -= len(x.SupplierOperatorAddress) + copy(dAtA[i:], x.SupplierOperatorAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.SupplierOperatorAddress))) i-- dAtA[i] = 0xa } @@ -2622,7 +2622,7 @@ func (x *fastReflection_MsgCreateClaim) ProtoMethods() *protoiface.Methods { switch fieldNum { case 1: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field SupplierAddress", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field SupplierOperatorAddress", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2650,7 +2650,7 @@ func (x *fastReflection_MsgCreateClaim) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.SupplierAddress = string(dAtA[iNdEx:postIndex]) + x.SupplierOperatorAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { @@ -3193,16 +3193,16 @@ func (x *fastReflection_MsgCreateClaimResponse) ProtoMethods() *protoiface.Metho } var ( - md_MsgSubmitProof protoreflect.MessageDescriptor - fd_MsgSubmitProof_supplier_address protoreflect.FieldDescriptor - fd_MsgSubmitProof_session_header protoreflect.FieldDescriptor - fd_MsgSubmitProof_proof protoreflect.FieldDescriptor + md_MsgSubmitProof protoreflect.MessageDescriptor + fd_MsgSubmitProof_supplier_operator_address protoreflect.FieldDescriptor + fd_MsgSubmitProof_session_header protoreflect.FieldDescriptor + fd_MsgSubmitProof_proof protoreflect.FieldDescriptor ) func init() { file_poktroll_proof_tx_proto_init() md_MsgSubmitProof = File_poktroll_proof_tx_proto.Messages().ByName("MsgSubmitProof") - fd_MsgSubmitProof_supplier_address = md_MsgSubmitProof.Fields().ByName("supplier_address") + fd_MsgSubmitProof_supplier_operator_address = md_MsgSubmitProof.Fields().ByName("supplier_operator_address") fd_MsgSubmitProof_session_header = md_MsgSubmitProof.Fields().ByName("session_header") fd_MsgSubmitProof_proof = md_MsgSubmitProof.Fields().ByName("proof") } @@ -3272,9 +3272,9 @@ func (x *fastReflection_MsgSubmitProof) Interface() protoreflect.ProtoMessage { // While iterating, mutating operations may only be performed // on the current field descriptor. func (x *fastReflection_MsgSubmitProof) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.SupplierAddress != "" { - value := protoreflect.ValueOfString(x.SupplierAddress) - if !f(fd_MsgSubmitProof_supplier_address, value) { + if x.SupplierOperatorAddress != "" { + value := protoreflect.ValueOfString(x.SupplierOperatorAddress) + if !f(fd_MsgSubmitProof_supplier_operator_address, value) { return } } @@ -3305,8 +3305,8 @@ func (x *fastReflection_MsgSubmitProof) Range(f func(protoreflect.FieldDescripto // a repeated field is populated if it is non-empty. func (x *fastReflection_MsgSubmitProof) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "poktroll.proof.MsgSubmitProof.supplier_address": - return x.SupplierAddress != "" + case "poktroll.proof.MsgSubmitProof.supplier_operator_address": + return x.SupplierOperatorAddress != "" case "poktroll.proof.MsgSubmitProof.session_header": return x.SessionHeader != nil case "poktroll.proof.MsgSubmitProof.proof": @@ -3327,8 +3327,8 @@ func (x *fastReflection_MsgSubmitProof) Has(fd protoreflect.FieldDescriptor) boo // Clear is a mutating operation and unsafe for concurrent use. func (x *fastReflection_MsgSubmitProof) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "poktroll.proof.MsgSubmitProof.supplier_address": - x.SupplierAddress = "" + case "poktroll.proof.MsgSubmitProof.supplier_operator_address": + x.SupplierOperatorAddress = "" case "poktroll.proof.MsgSubmitProof.session_header": x.SessionHeader = nil case "poktroll.proof.MsgSubmitProof.proof": @@ -3349,8 +3349,8 @@ func (x *fastReflection_MsgSubmitProof) Clear(fd protoreflect.FieldDescriptor) { // of the value; to obtain a mutable reference, use Mutable. func (x *fastReflection_MsgSubmitProof) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "poktroll.proof.MsgSubmitProof.supplier_address": - value := x.SupplierAddress + case "poktroll.proof.MsgSubmitProof.supplier_operator_address": + value := x.SupplierOperatorAddress return protoreflect.ValueOfString(value) case "poktroll.proof.MsgSubmitProof.session_header": value := x.SessionHeader @@ -3378,8 +3378,8 @@ func (x *fastReflection_MsgSubmitProof) Get(descriptor protoreflect.FieldDescrip // Set is a mutating operation and unsafe for concurrent use. func (x *fastReflection_MsgSubmitProof) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "poktroll.proof.MsgSubmitProof.supplier_address": - x.SupplierAddress = value.Interface().(string) + case "poktroll.proof.MsgSubmitProof.supplier_operator_address": + x.SupplierOperatorAddress = value.Interface().(string) case "poktroll.proof.MsgSubmitProof.session_header": x.SessionHeader = value.Message().Interface().(*session.SessionHeader) case "poktroll.proof.MsgSubmitProof.proof": @@ -3409,8 +3409,8 @@ func (x *fastReflection_MsgSubmitProof) Mutable(fd protoreflect.FieldDescriptor) x.SessionHeader = new(session.SessionHeader) } return protoreflect.ValueOfMessage(x.SessionHeader.ProtoReflect()) - case "poktroll.proof.MsgSubmitProof.supplier_address": - panic(fmt.Errorf("field supplier_address of message poktroll.proof.MsgSubmitProof is not mutable")) + case "poktroll.proof.MsgSubmitProof.supplier_operator_address": + panic(fmt.Errorf("field supplier_operator_address of message poktroll.proof.MsgSubmitProof is not mutable")) case "poktroll.proof.MsgSubmitProof.proof": panic(fmt.Errorf("field proof of message poktroll.proof.MsgSubmitProof is not mutable")) default: @@ -3426,7 +3426,7 @@ func (x *fastReflection_MsgSubmitProof) Mutable(fd protoreflect.FieldDescriptor) // For lists, maps, and messages, this returns a new, empty, mutable value. func (x *fastReflection_MsgSubmitProof) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "poktroll.proof.MsgSubmitProof.supplier_address": + case "poktroll.proof.MsgSubmitProof.supplier_operator_address": return protoreflect.ValueOfString("") case "poktroll.proof.MsgSubmitProof.session_header": m := new(session.SessionHeader) @@ -3502,7 +3502,7 @@ func (x *fastReflection_MsgSubmitProof) ProtoMethods() *protoiface.Methods { var n int var l int _ = l - l = len(x.SupplierAddress) + l = len(x.SupplierOperatorAddress) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } @@ -3564,10 +3564,10 @@ func (x *fastReflection_MsgSubmitProof) ProtoMethods() *protoiface.Methods { i-- dAtA[i] = 0x12 } - if len(x.SupplierAddress) > 0 { - i -= len(x.SupplierAddress) - copy(dAtA[i:], x.SupplierAddress) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.SupplierAddress))) + if len(x.SupplierOperatorAddress) > 0 { + i -= len(x.SupplierOperatorAddress) + copy(dAtA[i:], x.SupplierOperatorAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.SupplierOperatorAddress))) i-- dAtA[i] = 0xa } @@ -3622,7 +3622,7 @@ func (x *fastReflection_MsgSubmitProof) ProtoMethods() *protoiface.Methods { switch fieldNum { case 1: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field SupplierAddress", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field SupplierOperatorAddress", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -3650,7 +3650,7 @@ func (x *fastReflection_MsgSubmitProof) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.SupplierAddress = string(dAtA[iNdEx:postIndex]) + x.SupplierOperatorAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { @@ -4453,8 +4453,8 @@ type MsgCreateClaim struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - SupplierAddress string `protobuf:"bytes,1,opt,name=supplier_address,json=supplierAddress,proto3" json:"supplier_address,omitempty"` - SessionHeader *session.SessionHeader `protobuf:"bytes,2,opt,name=session_header,json=sessionHeader,proto3" json:"session_header,omitempty"` + SupplierOperatorAddress string `protobuf:"bytes,1,opt,name=supplier_operator_address,json=supplierOperatorAddress,proto3" json:"supplier_operator_address,omitempty"` + SessionHeader *session.SessionHeader `protobuf:"bytes,2,opt,name=session_header,json=sessionHeader,proto3" json:"session_header,omitempty"` // root returned from smt.SMST#Root() RootHash []byte `protobuf:"bytes,3,opt,name=root_hash,json=rootHash,proto3" json:"root_hash,omitempty"` } @@ -4479,9 +4479,9 @@ func (*MsgCreateClaim) Descriptor() ([]byte, []int) { return file_poktroll_proof_tx_proto_rawDescGZIP(), []int{4} } -func (x *MsgCreateClaim) GetSupplierAddress() string { +func (x *MsgCreateClaim) GetSupplierOperatorAddress() string { if x != nil { - return x.SupplierAddress + return x.SupplierOperatorAddress } return "" } @@ -4540,8 +4540,8 @@ type MsgSubmitProof struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - SupplierAddress string `protobuf:"bytes,1,opt,name=supplier_address,json=supplierAddress,proto3" json:"supplier_address,omitempty"` - SessionHeader *session.SessionHeader `protobuf:"bytes,2,opt,name=session_header,json=sessionHeader,proto3" json:"session_header,omitempty"` + SupplierOperatorAddress string `protobuf:"bytes,1,opt,name=supplier_operator_address,json=supplierOperatorAddress,proto3" json:"supplier_operator_address,omitempty"` + SessionHeader *session.SessionHeader `protobuf:"bytes,2,opt,name=session_header,json=sessionHeader,proto3" json:"session_header,omitempty"` // serialized version of *smt.SparseMerkleClosestProof Proof []byte `protobuf:"bytes,3,opt,name=proof,proto3" json:"proof,omitempty"` } @@ -4566,9 +4566,9 @@ func (*MsgSubmitProof) Descriptor() ([]byte, []int) { return file_poktroll_proof_tx_proto_rawDescGZIP(), []int{6} } -func (x *MsgSubmitProof) GetSupplierAddress() string { +func (x *MsgSubmitProof) GetSupplierOperatorAddress() string { if x != nil { - return x.SupplierAddress + return x.SupplierOperatorAddress } return "" } @@ -4685,75 +4685,78 @@ var file_poktroll_proof_tx_proto_rawDesc = []byte{ 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2e, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, - 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0xd1, 0x01, 0x0a, 0x0e, 0x4d, 0x73, 0x67, 0x43, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x12, 0x43, 0x0a, 0x10, 0x73, 0x75, - 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x0f, - 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, - 0x46, 0x0a, 0x0e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, - 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, - 0x6c, 0x6c, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, - 0x6f, 0x6e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0d, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, - 0x6e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x6f, 0x6f, 0x74, 0x5f, - 0x68, 0x61, 0x73, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x72, 0x6f, 0x6f, 0x74, - 0x48, 0x61, 0x73, 0x68, 0x3a, 0x15, 0x82, 0xe7, 0xb0, 0x2a, 0x10, 0x73, 0x75, 0x70, 0x70, 0x6c, - 0x69, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x45, 0x0a, 0x16, 0x4d, - 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2b, 0x0a, 0x05, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, - 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x2e, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x52, 0x05, 0x63, 0x6c, 0x61, - 0x69, 0x6d, 0x22, 0xca, 0x01, 0x0a, 0x0e, 0x4d, 0x73, 0x67, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, - 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x43, 0x0a, 0x10, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, - 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, - 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, - 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x0f, 0x73, 0x75, 0x70, 0x70, 0x6c, - 0x69, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x46, 0x0a, 0x0e, 0x73, 0x65, - 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x65, - 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x61, - 0x64, 0x65, 0x72, 0x52, 0x0d, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x61, 0x64, - 0x65, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0c, 0x52, 0x05, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x3a, 0x15, 0x82, 0xe7, 0xb0, 0x2a, 0x10, 0x73, - 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, - 0x45, 0x0a, 0x16, 0x4d, 0x73, 0x67, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x50, 0x72, 0x6f, 0x6f, - 0x66, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2b, 0x0a, 0x05, 0x70, 0x72, 0x6f, - 0x6f, 0x66, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, - 0x6f, 0x6c, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x2e, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, - 0x05, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x32, 0xeb, 0x02, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x58, - 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x1f, - 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x2e, - 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, - 0x27, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x6f, 0x66, - 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x55, 0x0a, 0x0b, 0x43, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x12, 0x1e, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, - 0x6c, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x1a, 0x26, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, - 0x6c, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, + 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0xeb, 0x01, 0x0a, 0x0e, 0x4d, 0x73, 0x67, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x12, 0x54, 0x0a, 0x19, 0x73, 0x75, + 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x5f, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x5f, + 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, + 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x17, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, + 0x72, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x12, 0x46, 0x0a, 0x0e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x68, 0x65, 0x61, 0x64, + 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, + 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x53, 0x65, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0d, 0x73, 0x65, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x6f, 0x6f, 0x74, + 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x72, 0x6f, 0x6f, + 0x74, 0x48, 0x61, 0x73, 0x68, 0x3a, 0x1e, 0x82, 0xe7, 0xb0, 0x2a, 0x19, 0x73, 0x75, 0x70, 0x70, + 0x6c, 0x69, 0x65, 0x72, 0x5f, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x45, 0x0a, 0x16, 0x4d, 0x73, 0x67, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x55, 0x0a, 0x0b, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x1e, - 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x2e, - 0x4d, 0x73, 0x67, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x1a, 0x26, + 0x2b, 0x0a, 0x05, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x2e, - 0x4d, 0x73, 0x67, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x55, 0x0a, 0x0b, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x1e, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, - 0x2e, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x50, 0x61, 0x72, 0x61, 0x6d, 0x1a, 0x26, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, - 0x2e, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x50, 0x61, 0x72, 0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, - 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0x97, 0x01, 0x0a, 0x12, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, - 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x42, 0x07, 0x54, 0x78, 0x50, - 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x1f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, - 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, - 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0xa2, 0x02, 0x03, 0x50, 0x50, 0x58, 0xaa, 0x02, 0x0e, - 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0xca, 0x02, - 0x0e, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0xe2, - 0x02, 0x1a, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x50, 0x72, 0x6f, 0x6f, 0x66, - 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0f, 0x50, - 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x52, 0x05, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x22, 0xe4, 0x01, 0x0a, + 0x0e, 0x4d, 0x73, 0x67, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, + 0x54, 0x0a, 0x19, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x5f, 0x6f, 0x70, 0x65, 0x72, + 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x17, 0x73, 0x75, + 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x46, 0x0a, 0x0e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, + 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, + 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, + 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0d, + 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x14, 0x0a, + 0x05, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x70, 0x72, + 0x6f, 0x6f, 0x66, 0x3a, 0x1e, 0x82, 0xe7, 0xb0, 0x2a, 0x19, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, + 0x65, 0x72, 0x5f, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x22, 0x45, 0x0a, 0x16, 0x4d, 0x73, 0x67, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, + 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2b, 0x0a, + 0x05, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, + 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x2e, 0x50, 0x72, + 0x6f, 0x6f, 0x66, 0x52, 0x05, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x32, 0xeb, 0x02, 0x0a, 0x03, 0x4d, + 0x73, 0x67, 0x12, 0x58, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x12, 0x1f, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x70, 0x72, + 0x6f, 0x6f, 0x66, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x1a, 0x27, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x70, + 0x72, 0x6f, 0x6f, 0x66, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x55, 0x0a, 0x0b, + 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x12, 0x1e, 0x2e, 0x70, 0x6f, + 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x2e, 0x4d, 0x73, 0x67, + 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x1a, 0x26, 0x2e, 0x70, 0x6f, + 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x2e, 0x4d, 0x73, 0x67, + 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x55, 0x0a, 0x0b, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x50, 0x72, 0x6f, + 0x6f, 0x66, 0x12, 0x1e, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x70, 0x72, + 0x6f, 0x6f, 0x66, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x50, 0x72, 0x6f, + 0x6f, 0x66, 0x1a, 0x26, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x70, 0x72, + 0x6f, 0x6f, 0x66, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x50, 0x72, 0x6f, + 0x6f, 0x66, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x55, 0x0a, 0x0b, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x1e, 0x2e, 0x70, 0x6f, 0x6b, 0x74, + 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x1a, 0x26, 0x2e, 0x70, 0x6f, 0x6b, 0x74, + 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0x97, 0x01, 0x0a, 0x12, 0x63, 0x6f, 0x6d, + 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x42, + 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x1f, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x6f, 0x6b, + 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0xa2, 0x02, 0x03, 0x50, 0x50, + 0x58, 0xaa, 0x02, 0x0e, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x50, 0x72, 0x6f, + 0x6f, 0x66, 0xca, 0x02, 0x0e, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x50, 0x72, + 0x6f, 0x6f, 0x66, 0xe2, 0x02, 0x1a, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x50, + 0x72, 0x6f, 0x6f, 0x66, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0xea, 0x02, 0x0f, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, 0x50, 0x72, 0x6f, + 0x6f, 0x66, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/api/poktroll/service/relay.pulsar.go b/api/poktroll/service/relay.pulsar.go index 19b2cb531..4434cac63 100644 --- a/api/poktroll/service/relay.pulsar.go +++ b/api/poktroll/service/relay.pulsar.go @@ -530,10 +530,10 @@ func (x *fastReflection_Relay) ProtoMethods() *protoiface.Methods { } var ( - md_RelayRequestMetadata protoreflect.MessageDescriptor - fd_RelayRequestMetadata_session_header protoreflect.FieldDescriptor - fd_RelayRequestMetadata_signature protoreflect.FieldDescriptor - fd_RelayRequestMetadata_supplier_address protoreflect.FieldDescriptor + md_RelayRequestMetadata protoreflect.MessageDescriptor + fd_RelayRequestMetadata_session_header protoreflect.FieldDescriptor + fd_RelayRequestMetadata_signature protoreflect.FieldDescriptor + fd_RelayRequestMetadata_supplier_operator_address protoreflect.FieldDescriptor ) func init() { @@ -541,7 +541,7 @@ func init() { md_RelayRequestMetadata = File_poktroll_service_relay_proto.Messages().ByName("RelayRequestMetadata") fd_RelayRequestMetadata_session_header = md_RelayRequestMetadata.Fields().ByName("session_header") fd_RelayRequestMetadata_signature = md_RelayRequestMetadata.Fields().ByName("signature") - fd_RelayRequestMetadata_supplier_address = md_RelayRequestMetadata.Fields().ByName("supplier_address") + fd_RelayRequestMetadata_supplier_operator_address = md_RelayRequestMetadata.Fields().ByName("supplier_operator_address") } var _ protoreflect.Message = (*fastReflection_RelayRequestMetadata)(nil) @@ -621,9 +621,9 @@ func (x *fastReflection_RelayRequestMetadata) Range(f func(protoreflect.FieldDes return } } - if x.SupplierAddress != "" { - value := protoreflect.ValueOfString(x.SupplierAddress) - if !f(fd_RelayRequestMetadata_supplier_address, value) { + if x.SupplierOperatorAddress != "" { + value := protoreflect.ValueOfString(x.SupplierOperatorAddress) + if !f(fd_RelayRequestMetadata_supplier_operator_address, value) { return } } @@ -646,8 +646,8 @@ func (x *fastReflection_RelayRequestMetadata) Has(fd protoreflect.FieldDescripto return x.SessionHeader != nil case "poktroll.service.RelayRequestMetadata.signature": return len(x.Signature) != 0 - case "poktroll.service.RelayRequestMetadata.supplier_address": - return x.SupplierAddress != "" + case "poktroll.service.RelayRequestMetadata.supplier_operator_address": + return x.SupplierOperatorAddress != "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.service.RelayRequestMetadata")) @@ -668,8 +668,8 @@ func (x *fastReflection_RelayRequestMetadata) Clear(fd protoreflect.FieldDescrip x.SessionHeader = nil case "poktroll.service.RelayRequestMetadata.signature": x.Signature = nil - case "poktroll.service.RelayRequestMetadata.supplier_address": - x.SupplierAddress = "" + case "poktroll.service.RelayRequestMetadata.supplier_operator_address": + x.SupplierOperatorAddress = "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.service.RelayRequestMetadata")) @@ -692,8 +692,8 @@ func (x *fastReflection_RelayRequestMetadata) Get(descriptor protoreflect.FieldD case "poktroll.service.RelayRequestMetadata.signature": value := x.Signature return protoreflect.ValueOfBytes(value) - case "poktroll.service.RelayRequestMetadata.supplier_address": - value := x.SupplierAddress + case "poktroll.service.RelayRequestMetadata.supplier_operator_address": + value := x.SupplierOperatorAddress return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { @@ -719,8 +719,8 @@ func (x *fastReflection_RelayRequestMetadata) Set(fd protoreflect.FieldDescripto x.SessionHeader = value.Message().Interface().(*session.SessionHeader) case "poktroll.service.RelayRequestMetadata.signature": x.Signature = value.Bytes() - case "poktroll.service.RelayRequestMetadata.supplier_address": - x.SupplierAddress = value.Interface().(string) + case "poktroll.service.RelayRequestMetadata.supplier_operator_address": + x.SupplierOperatorAddress = value.Interface().(string) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.service.RelayRequestMetadata")) @@ -748,8 +748,8 @@ func (x *fastReflection_RelayRequestMetadata) Mutable(fd protoreflect.FieldDescr return protoreflect.ValueOfMessage(x.SessionHeader.ProtoReflect()) case "poktroll.service.RelayRequestMetadata.signature": panic(fmt.Errorf("field signature of message poktroll.service.RelayRequestMetadata is not mutable")) - case "poktroll.service.RelayRequestMetadata.supplier_address": - panic(fmt.Errorf("field supplier_address of message poktroll.service.RelayRequestMetadata is not mutable")) + case "poktroll.service.RelayRequestMetadata.supplier_operator_address": + panic(fmt.Errorf("field supplier_operator_address of message poktroll.service.RelayRequestMetadata is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.service.RelayRequestMetadata")) @@ -768,7 +768,7 @@ func (x *fastReflection_RelayRequestMetadata) NewField(fd protoreflect.FieldDesc return protoreflect.ValueOfMessage(m.ProtoReflect()) case "poktroll.service.RelayRequestMetadata.signature": return protoreflect.ValueOfBytes(nil) - case "poktroll.service.RelayRequestMetadata.supplier_address": + case "poktroll.service.RelayRequestMetadata.supplier_operator_address": return protoreflect.ValueOfString("") default: if fd.IsExtension() { @@ -847,7 +847,7 @@ func (x *fastReflection_RelayRequestMetadata) ProtoMethods() *protoiface.Methods if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - l = len(x.SupplierAddress) + l = len(x.SupplierOperatorAddress) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } @@ -880,10 +880,10 @@ func (x *fastReflection_RelayRequestMetadata) ProtoMethods() *protoiface.Methods i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if len(x.SupplierAddress) > 0 { - i -= len(x.SupplierAddress) - copy(dAtA[i:], x.SupplierAddress) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.SupplierAddress))) + if len(x.SupplierOperatorAddress) > 0 { + i -= len(x.SupplierOperatorAddress) + copy(dAtA[i:], x.SupplierOperatorAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.SupplierOperatorAddress))) i-- dAtA[i] = 0x1a } @@ -1029,7 +1029,7 @@ func (x *fastReflection_RelayRequestMetadata) ProtoMethods() *protoiface.Methods iNdEx = postIndex case 3: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field SupplierAddress", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field SupplierOperatorAddress", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1057,7 +1057,7 @@ func (x *fastReflection_RelayRequestMetadata) ProtoMethods() *protoiface.Methods if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.SupplierAddress = string(dAtA[iNdEx:postIndex]) + x.SupplierOperatorAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -2097,16 +2097,16 @@ func (x *fastReflection_RelayResponse) ProtoMethods() *protoiface.Methods { } var ( - md_RelayResponseMetadata protoreflect.MessageDescriptor - fd_RelayResponseMetadata_session_header protoreflect.FieldDescriptor - fd_RelayResponseMetadata_supplier_signature protoreflect.FieldDescriptor + md_RelayResponseMetadata protoreflect.MessageDescriptor + fd_RelayResponseMetadata_session_header protoreflect.FieldDescriptor + fd_RelayResponseMetadata_supplier_operator_signature protoreflect.FieldDescriptor ) func init() { file_poktroll_service_relay_proto_init() md_RelayResponseMetadata = File_poktroll_service_relay_proto.Messages().ByName("RelayResponseMetadata") fd_RelayResponseMetadata_session_header = md_RelayResponseMetadata.Fields().ByName("session_header") - fd_RelayResponseMetadata_supplier_signature = md_RelayResponseMetadata.Fields().ByName("supplier_signature") + fd_RelayResponseMetadata_supplier_operator_signature = md_RelayResponseMetadata.Fields().ByName("supplier_operator_signature") } var _ protoreflect.Message = (*fastReflection_RelayResponseMetadata)(nil) @@ -2180,9 +2180,9 @@ func (x *fastReflection_RelayResponseMetadata) Range(f func(protoreflect.FieldDe return } } - if len(x.SupplierSignature) != 0 { - value := protoreflect.ValueOfBytes(x.SupplierSignature) - if !f(fd_RelayResponseMetadata_supplier_signature, value) { + if len(x.SupplierOperatorSignature) != 0 { + value := protoreflect.ValueOfBytes(x.SupplierOperatorSignature) + if !f(fd_RelayResponseMetadata_supplier_operator_signature, value) { return } } @@ -2203,8 +2203,8 @@ func (x *fastReflection_RelayResponseMetadata) Has(fd protoreflect.FieldDescript switch fd.FullName() { case "poktroll.service.RelayResponseMetadata.session_header": return x.SessionHeader != nil - case "poktroll.service.RelayResponseMetadata.supplier_signature": - return len(x.SupplierSignature) != 0 + case "poktroll.service.RelayResponseMetadata.supplier_operator_signature": + return len(x.SupplierOperatorSignature) != 0 default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.service.RelayResponseMetadata")) @@ -2223,8 +2223,8 @@ func (x *fastReflection_RelayResponseMetadata) Clear(fd protoreflect.FieldDescri switch fd.FullName() { case "poktroll.service.RelayResponseMetadata.session_header": x.SessionHeader = nil - case "poktroll.service.RelayResponseMetadata.supplier_signature": - x.SupplierSignature = nil + case "poktroll.service.RelayResponseMetadata.supplier_operator_signature": + x.SupplierOperatorSignature = nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.service.RelayResponseMetadata")) @@ -2244,8 +2244,8 @@ func (x *fastReflection_RelayResponseMetadata) Get(descriptor protoreflect.Field case "poktroll.service.RelayResponseMetadata.session_header": value := x.SessionHeader return protoreflect.ValueOfMessage(value.ProtoReflect()) - case "poktroll.service.RelayResponseMetadata.supplier_signature": - value := x.SupplierSignature + case "poktroll.service.RelayResponseMetadata.supplier_operator_signature": + value := x.SupplierOperatorSignature return protoreflect.ValueOfBytes(value) default: if descriptor.IsExtension() { @@ -2269,8 +2269,8 @@ func (x *fastReflection_RelayResponseMetadata) Set(fd protoreflect.FieldDescript switch fd.FullName() { case "poktroll.service.RelayResponseMetadata.session_header": x.SessionHeader = value.Message().Interface().(*session.SessionHeader) - case "poktroll.service.RelayResponseMetadata.supplier_signature": - x.SupplierSignature = value.Bytes() + case "poktroll.service.RelayResponseMetadata.supplier_operator_signature": + x.SupplierOperatorSignature = value.Bytes() default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.service.RelayResponseMetadata")) @@ -2296,8 +2296,8 @@ func (x *fastReflection_RelayResponseMetadata) Mutable(fd protoreflect.FieldDesc x.SessionHeader = new(session.SessionHeader) } return protoreflect.ValueOfMessage(x.SessionHeader.ProtoReflect()) - case "poktroll.service.RelayResponseMetadata.supplier_signature": - panic(fmt.Errorf("field supplier_signature of message poktroll.service.RelayResponseMetadata is not mutable")) + case "poktroll.service.RelayResponseMetadata.supplier_operator_signature": + panic(fmt.Errorf("field supplier_operator_signature of message poktroll.service.RelayResponseMetadata is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.service.RelayResponseMetadata")) @@ -2314,7 +2314,7 @@ func (x *fastReflection_RelayResponseMetadata) NewField(fd protoreflect.FieldDes case "poktroll.service.RelayResponseMetadata.session_header": m := new(session.SessionHeader) return protoreflect.ValueOfMessage(m.ProtoReflect()) - case "poktroll.service.RelayResponseMetadata.supplier_signature": + case "poktroll.service.RelayResponseMetadata.supplier_operator_signature": return protoreflect.ValueOfBytes(nil) default: if fd.IsExtension() { @@ -2389,7 +2389,7 @@ func (x *fastReflection_RelayResponseMetadata) ProtoMethods() *protoiface.Method l = options.Size(x.SessionHeader) n += 1 + l + runtime.Sov(uint64(l)) } - l = len(x.SupplierSignature) + l = len(x.SupplierOperatorSignature) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } @@ -2422,10 +2422,10 @@ func (x *fastReflection_RelayResponseMetadata) ProtoMethods() *protoiface.Method i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if len(x.SupplierSignature) > 0 { - i -= len(x.SupplierSignature) - copy(dAtA[i:], x.SupplierSignature) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.SupplierSignature))) + if len(x.SupplierOperatorSignature) > 0 { + i -= len(x.SupplierOperatorSignature) + copy(dAtA[i:], x.SupplierOperatorSignature) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.SupplierOperatorSignature))) i-- dAtA[i] = 0x12 } @@ -2530,7 +2530,7 @@ func (x *fastReflection_RelayResponseMetadata) ProtoMethods() *protoiface.Method iNdEx = postIndex case 2: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field SupplierSignature", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field SupplierOperatorSignature", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { @@ -2557,9 +2557,9 @@ func (x *fastReflection_RelayResponseMetadata) ProtoMethods() *protoiface.Method if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.SupplierSignature = append(x.SupplierSignature[:0], dAtA[iNdEx:postIndex]...) - if x.SupplierSignature == nil { - x.SupplierSignature = []byte{} + x.SupplierOperatorSignature = append(x.SupplierOperatorSignature[:0], dAtA[iNdEx:postIndex]...) + if x.SupplierOperatorSignature == nil { + x.SupplierOperatorSignature = []byte{} } iNdEx = postIndex default: @@ -2670,9 +2670,9 @@ type RelayRequestMetadata struct { // TODO_MAINNET: make sure we're checking/verifying this address on-chain (if needed). // Relevant conversation: https://github.com/pokt-network/poktroll/pull/567#discussion_r1628722168 // - // The supplier address the relay is sent to. It is being used on the RelayMiner to - // route to the correct supplier. - SupplierAddress string `protobuf:"bytes,3,opt,name=supplier_address,json=supplierAddress,proto3" json:"supplier_address,omitempty"` // The Bech32 address of the application. + // The supplier operator address the relay is sent to. It is being used on the + // RelayMiner to route to the correct supplier. + SupplierOperatorAddress string `protobuf:"bytes,3,opt,name=supplier_operator_address,json=supplierOperatorAddress,proto3" json:"supplier_operator_address,omitempty"` // The Bech32 address of the application. } func (x *RelayRequestMetadata) Reset() { @@ -2709,9 +2709,9 @@ func (x *RelayRequestMetadata) GetSignature() []byte { return nil } -func (x *RelayRequestMetadata) GetSupplierAddress() string { +func (x *RelayRequestMetadata) GetSupplierOperatorAddress() string { if x != nil { - return x.SupplierAddress + return x.SupplierOperatorAddress } return "" } @@ -2816,8 +2816,8 @@ type RelayResponseMetadata struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - SessionHeader *session.SessionHeader `protobuf:"bytes,1,opt,name=session_header,json=sessionHeader,proto3" json:"session_header,omitempty"` // Session header associated with the relay. - SupplierSignature []byte `protobuf:"bytes,2,opt,name=supplier_signature,json=supplierSignature,proto3" json:"supplier_signature,omitempty"` // Signature of the supplier on the response. + SessionHeader *session.SessionHeader `protobuf:"bytes,1,opt,name=session_header,json=sessionHeader,proto3" json:"session_header,omitempty"` // Session header associated with the relay. + SupplierOperatorSignature []byte `protobuf:"bytes,2,opt,name=supplier_operator_signature,json=supplierOperatorSignature,proto3" json:"supplier_operator_signature,omitempty"` // Signature of the supplier's operator on the response. } func (x *RelayResponseMetadata) Reset() { @@ -2847,9 +2847,9 @@ func (x *RelayResponseMetadata) GetSessionHeader() *session.SessionHeader { return nil } -func (x *RelayResponseMetadata) GetSupplierSignature() []byte { +func (x *RelayResponseMetadata) GetSupplierOperatorSignature() []byte { if x != nil { - return x.SupplierSignature + return x.SupplierOperatorSignature } return nil } @@ -2872,52 +2872,55 @@ var file_poktroll_service_relay_proto_rawDesc = []byte{ 0x72, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x03, 0x72, 0x65, 0x73, 0x22, - 0xc1, 0x01, 0x0a, 0x14, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0xd2, 0x01, 0x0a, 0x14, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x46, 0x0a, 0x0e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0d, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 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, 0x43, - 0x0a, 0x10, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, - 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, - 0x6e, 0x67, 0x52, 0x0f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, - 0x65, 0x73, 0x73, 0x22, 0x6a, 0x0a, 0x0c, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x40, 0x0a, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x26, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, - 0x04, 0x6d, 0x65, 0x74, 0x61, 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, - 0x6c, 0x0a, 0x0d, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x41, 0x0a, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, - 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x2e, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x04, 0x6d, - 0x65, 0x74, 0x61, 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, 0x8e, 0x01, - 0x0a, 0x15, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x46, 0x0a, 0x0e, 0x73, 0x65, 0x73, 0x73, 0x69, - 0x6f, 0x6e, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1f, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, - 0x6f, 0x6e, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, - 0x52, 0x0d, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, - 0x2d, 0x0a, 0x12, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x5f, 0x73, 0x69, 0x67, 0x6e, - 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x11, 0x73, 0x75, 0x70, - 0x70, 0x6c, 0x69, 0x65, 0x72, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x42, 0xa6, - 0x01, 0x0a, 0x14, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, - 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x42, 0x0a, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x50, 0x72, - 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x21, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, - 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, - 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0xa2, 0x02, 0x03, 0x50, 0x53, 0x58, 0xaa, 0x02, - 0x10, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0xca, 0x02, 0x10, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x53, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0xe2, 0x02, 0x1c, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, - 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, - 0x61, 0x74, 0x61, 0xea, 0x02, 0x11, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, - 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x54, + 0x0a, 0x19, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x5f, 0x6f, 0x70, 0x65, 0x72, 0x61, + 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x17, 0x73, 0x75, 0x70, + 0x70, 0x6c, 0x69, 0x65, 0x72, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x22, 0x6a, 0x0a, 0x0c, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x40, 0x0a, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, + 0x52, 0x04, 0x6d, 0x65, 0x74, 0x61, 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, 0x6c, 0x0a, 0x0d, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x41, 0x0a, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x27, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x2e, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x04, + 0x6d, 0x65, 0x74, 0x61, 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, 0x9f, + 0x01, 0x0a, 0x15, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x46, 0x0a, 0x0e, 0x73, 0x65, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1f, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x65, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x52, 0x0d, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x12, 0x3e, 0x0a, 0x1b, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x5f, 0x6f, 0x70, 0x65, + 0x72, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x19, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x4f, + 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, + 0x42, 0xa6, 0x01, 0x0a, 0x14, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, + 0x6c, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x42, 0x0a, 0x52, 0x65, 0x6c, 0x61, 0x79, + 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x21, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, + 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, + 0x6c, 0x6c, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0xa2, 0x02, 0x03, 0x50, 0x53, 0x58, + 0xaa, 0x02, 0x10, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0xca, 0x02, 0x10, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0xe2, 0x02, 0x1c, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, + 0x6c, 0x5c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x11, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, + 0x3a, 0x3a, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } var ( diff --git a/api/poktroll/shared/supplier.pulsar.go b/api/poktroll/shared/supplier.pulsar.go index 5037ddf52..347222d24 100644 --- a/api/poktroll/shared/supplier.pulsar.go +++ b/api/poktroll/shared/supplier.pulsar.go @@ -151,7 +151,7 @@ func (x *_Supplier_6_map) IsValid() bool { var ( md_Supplier protoreflect.MessageDescriptor fd_Supplier_owner_address protoreflect.FieldDescriptor - fd_Supplier_address protoreflect.FieldDescriptor + fd_Supplier_operator_address protoreflect.FieldDescriptor fd_Supplier_stake protoreflect.FieldDescriptor fd_Supplier_services protoreflect.FieldDescriptor fd_Supplier_unstake_session_end_height protoreflect.FieldDescriptor @@ -162,7 +162,7 @@ func init() { file_poktroll_shared_supplier_proto_init() md_Supplier = File_poktroll_shared_supplier_proto.Messages().ByName("Supplier") fd_Supplier_owner_address = md_Supplier.Fields().ByName("owner_address") - fd_Supplier_address = md_Supplier.Fields().ByName("address") + fd_Supplier_operator_address = md_Supplier.Fields().ByName("operator_address") fd_Supplier_stake = md_Supplier.Fields().ByName("stake") fd_Supplier_services = md_Supplier.Fields().ByName("services") fd_Supplier_unstake_session_end_height = md_Supplier.Fields().ByName("unstake_session_end_height") @@ -240,9 +240,9 @@ func (x *fastReflection_Supplier) Range(f func(protoreflect.FieldDescriptor, pro return } } - if x.Address != "" { - value := protoreflect.ValueOfString(x.Address) - if !f(fd_Supplier_address, value) { + if x.OperatorAddress != "" { + value := protoreflect.ValueOfString(x.OperatorAddress) + if !f(fd_Supplier_operator_address, value) { return } } @@ -287,8 +287,8 @@ func (x *fastReflection_Supplier) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { case "poktroll.shared.Supplier.owner_address": return x.OwnerAddress != "" - case "poktroll.shared.Supplier.address": - return x.Address != "" + case "poktroll.shared.Supplier.operator_address": + return x.OperatorAddress != "" case "poktroll.shared.Supplier.stake": return x.Stake != nil case "poktroll.shared.Supplier.services": @@ -315,8 +315,8 @@ func (x *fastReflection_Supplier) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { case "poktroll.shared.Supplier.owner_address": x.OwnerAddress = "" - case "poktroll.shared.Supplier.address": - x.Address = "" + case "poktroll.shared.Supplier.operator_address": + x.OperatorAddress = "" case "poktroll.shared.Supplier.stake": x.Stake = nil case "poktroll.shared.Supplier.services": @@ -344,8 +344,8 @@ func (x *fastReflection_Supplier) Get(descriptor protoreflect.FieldDescriptor) p case "poktroll.shared.Supplier.owner_address": value := x.OwnerAddress return protoreflect.ValueOfString(value) - case "poktroll.shared.Supplier.address": - value := x.Address + case "poktroll.shared.Supplier.operator_address": + value := x.OperatorAddress return protoreflect.ValueOfString(value) case "poktroll.shared.Supplier.stake": value := x.Stake @@ -387,8 +387,8 @@ func (x *fastReflection_Supplier) Set(fd protoreflect.FieldDescriptor, value pro switch fd.FullName() { case "poktroll.shared.Supplier.owner_address": x.OwnerAddress = value.Interface().(string) - case "poktroll.shared.Supplier.address": - x.Address = value.Interface().(string) + case "poktroll.shared.Supplier.operator_address": + x.OperatorAddress = value.Interface().(string) case "poktroll.shared.Supplier.stake": x.Stake = value.Message().Interface().(*v1beta1.Coin) case "poktroll.shared.Supplier.services": @@ -440,8 +440,8 @@ func (x *fastReflection_Supplier) Mutable(fd protoreflect.FieldDescriptor) proto return protoreflect.ValueOfMap(value) case "poktroll.shared.Supplier.owner_address": panic(fmt.Errorf("field owner_address of message poktroll.shared.Supplier is not mutable")) - case "poktroll.shared.Supplier.address": - panic(fmt.Errorf("field address of message poktroll.shared.Supplier is not mutable")) + case "poktroll.shared.Supplier.operator_address": + panic(fmt.Errorf("field operator_address of message poktroll.shared.Supplier is not mutable")) case "poktroll.shared.Supplier.unstake_session_end_height": panic(fmt.Errorf("field unstake_session_end_height of message poktroll.shared.Supplier is not mutable")) default: @@ -459,7 +459,7 @@ func (x *fastReflection_Supplier) NewField(fd protoreflect.FieldDescriptor) prot switch fd.FullName() { case "poktroll.shared.Supplier.owner_address": return protoreflect.ValueOfString("") - case "poktroll.shared.Supplier.address": + case "poktroll.shared.Supplier.operator_address": return protoreflect.ValueOfString("") case "poktroll.shared.Supplier.stake": m := new(v1beta1.Coin) @@ -545,7 +545,7 @@ func (x *fastReflection_Supplier) ProtoMethods() *protoiface.Methods { if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - l = len(x.Address) + l = len(x.OperatorAddress) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } @@ -688,10 +688,10 @@ func (x *fastReflection_Supplier) ProtoMethods() *protoiface.Methods { i-- dAtA[i] = 0x1a } - if len(x.Address) > 0 { - i -= len(x.Address) - copy(dAtA[i:], x.Address) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Address))) + if len(x.OperatorAddress) > 0 { + i -= len(x.OperatorAddress) + copy(dAtA[i:], x.OperatorAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.OperatorAddress))) i-- dAtA[i] = 0x12 } @@ -785,7 +785,7 @@ func (x *fastReflection_Supplier) ProtoMethods() *protoiface.Methods { iNdEx = postIndex case 2: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field OperatorAddress", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -813,7 +813,7 @@ func (x *fastReflection_Supplier) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.Address = string(dAtA[iNdEx:postIndex]) + x.OperatorAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { @@ -1075,15 +1075,13 @@ type Supplier struct { // By default, this address is the one that receives all the rewards unless owtherwise specified. // This property cannot be updated by the operator. OwnerAddress string `protobuf:"bytes,1,opt,name=owner_address,json=ownerAddress,proto3" json:"owner_address,omitempty"` // Bech32 cosmos address - // The address of the supplier operator (i.e. the one managing the off-chain server). + // The operator address of the supplier operator (i.e. the one managing the off-chain server). // The operator address can update the supplier's configurations excluding the owner address. // This property does not change over the supplier's lifespan, the supplier must be unstaked // and re-staked to effectively update this value. - // TODO(#722): Rename this to `operator_address` including all downstream - // variables, comments, docs, tests, etc... - Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` // Bech32 cosmos address - Stake *v1beta1.Coin `protobuf:"bytes,3,opt,name=stake,proto3" json:"stake,omitempty"` // The total amount of uPOKT the supplier has staked - Services []*SupplierServiceConfig `protobuf:"bytes,4,rep,name=services,proto3" json:"services,omitempty"` // The service configs this supplier can support + OperatorAddress string `protobuf:"bytes,2,opt,name=operator_address,json=operatorAddress,proto3" json:"operator_address,omitempty"` // Bech32 cosmos address + Stake *v1beta1.Coin `protobuf:"bytes,3,opt,name=stake,proto3" json:"stake,omitempty"` // The total amount of uPOKT the supplier has staked + Services []*SupplierServiceConfig `protobuf:"bytes,4,rep,name=services,proto3" json:"services,omitempty"` // The service configs this supplier can support // The session end height at which an actively unbonding supplier unbonds its stake. // If the supplier did not unstake, this value will be 0. UnstakeSessionEndHeight uint64 `protobuf:"varint,5,opt,name=unstake_session_end_height,json=unstakeSessionEndHeight,proto3" json:"unstake_session_end_height,omitempty"` @@ -1120,9 +1118,9 @@ func (x *Supplier) GetOwnerAddress() string { return "" } -func (x *Supplier) GetAddress() string { +func (x *Supplier) GetOperatorAddress() string { if x != nil { - return x.Address + return x.OperatorAddress } return "" } @@ -1166,51 +1164,52 @@ var file_poktroll_shared_supplier_proto_rawDesc = []byte{ 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x63, 0x6f, 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1d, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2f, 0x73, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x85, 0x04, 0x0a, 0x08, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x96, 0x04, 0x0a, 0x08, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x12, 0x3d, 0x0a, 0x0d, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x0c, 0x6f, 0x77, 0x6e, 0x65, 0x72, - 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x32, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, - 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, - 0x6e, 0x67, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x2f, 0x0a, 0x05, 0x73, - 0x74, 0x61, 0x6b, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x52, 0x05, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x12, 0x42, 0x0a, 0x08, - 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, - 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, - 0x2e, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x08, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, - 0x12, 0x3b, 0x0a, 0x1a, 0x75, 0x6e, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x5f, 0x73, 0x65, 0x73, 0x73, - 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x6e, 0x64, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x04, 0x52, 0x17, 0x75, 0x6e, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x53, 0x65, 0x73, - 0x73, 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x64, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x82, 0x01, - 0x0a, 0x1f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x5f, 0x61, 0x63, 0x74, 0x69, 0x76, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x73, 0x5f, 0x6d, 0x61, - 0x70, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3b, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, - 0x6c, 0x6c, 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2e, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, - 0x65, 0x72, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x41, 0x63, 0x74, 0x69, 0x76, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x73, 0x4d, 0x61, 0x70, 0x45, - 0x6e, 0x74, 0x72, 0x79, 0x52, 0x1c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x41, 0x63, - 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x73, 0x4d, - 0x61, 0x70, 0x1a, 0x4f, 0x0a, 0x21, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x41, 0x63, - 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x73, 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, 0x04, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, - 0x02, 0x38, 0x01, 0x42, 0xa3, 0x01, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, - 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x42, 0x0d, 0x53, 0x75, 0x70, - 0x70, 0x6c, 0x69, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x20, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, - 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0xa2, 0x02, - 0x03, 0x50, 0x53, 0x58, 0xaa, 0x02, 0x0f, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, - 0x53, 0x68, 0x61, 0x72, 0x65, 0x64, 0xca, 0x02, 0x0f, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, - 0x6c, 0x5c, 0x53, 0x68, 0x61, 0x72, 0x65, 0x64, 0xe2, 0x02, 0x1b, 0x50, 0x6f, 0x6b, 0x74, 0x72, - 0x6f, 0x6c, 0x6c, 0x5c, 0x53, 0x68, 0x61, 0x72, 0x65, 0x64, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, - 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x10, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, - 0x6c, 0x3a, 0x3a, 0x53, 0x68, 0x61, 0x72, 0x65, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, + 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x43, 0x0a, 0x10, 0x6f, 0x70, 0x65, 0x72, 0x61, + 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x0f, 0x6f, 0x70, 0x65, + 0x72, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x2f, 0x0a, 0x05, + 0x73, 0x74, 0x61, 0x6b, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x52, 0x05, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x12, 0x42, 0x0a, + 0x08, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x26, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, + 0x64, 0x2e, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x08, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x73, 0x12, 0x3b, 0x0a, 0x1a, 0x75, 0x6e, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x5f, 0x73, 0x65, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x6e, 0x64, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x17, 0x75, 0x6e, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x53, 0x65, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x64, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x82, + 0x01, 0x0a, 0x1f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x5f, 0x61, 0x63, 0x74, 0x69, + 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x73, 0x5f, 0x6d, + 0x61, 0x70, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3b, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, + 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2e, 0x53, 0x75, 0x70, 0x70, 0x6c, + 0x69, 0x65, 0x72, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x41, 0x63, 0x74, 0x69, + 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x73, 0x4d, 0x61, 0x70, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x1c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x41, + 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x73, + 0x4d, 0x61, 0x70, 0x1a, 0x4f, 0x0a, 0x21, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x41, + 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x73, + 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, 0x04, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x3a, 0x02, 0x38, 0x01, 0x42, 0xa3, 0x01, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, + 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x42, 0x0d, 0x53, 0x75, + 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x20, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, + 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0xa2, + 0x02, 0x03, 0x50, 0x53, 0x58, 0xaa, 0x02, 0x0f, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, + 0x2e, 0x53, 0x68, 0x61, 0x72, 0x65, 0x64, 0xca, 0x02, 0x0f, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, + 0x6c, 0x6c, 0x5c, 0x53, 0x68, 0x61, 0x72, 0x65, 0x64, 0xe2, 0x02, 0x1b, 0x50, 0x6f, 0x6b, 0x74, + 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x53, 0x68, 0x61, 0x72, 0x65, 0x64, 0x5c, 0x47, 0x50, 0x42, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x10, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, + 0x6c, 0x6c, 0x3a, 0x3a, 0x53, 0x68, 0x61, 0x72, 0x65, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( diff --git a/api/poktroll/supplier/query.pulsar.go b/api/poktroll/supplier/query.pulsar.go index 827e8bc66..e55cedcde 100644 --- a/api/poktroll/supplier/query.pulsar.go +++ b/api/poktroll/supplier/query.pulsar.go @@ -811,14 +811,14 @@ func (x *fastReflection_QueryParamsResponse) ProtoMethods() *protoiface.Methods } var ( - md_QueryGetSupplierRequest protoreflect.MessageDescriptor - fd_QueryGetSupplierRequest_address protoreflect.FieldDescriptor + md_QueryGetSupplierRequest protoreflect.MessageDescriptor + fd_QueryGetSupplierRequest_operator_address protoreflect.FieldDescriptor ) func init() { file_poktroll_supplier_query_proto_init() md_QueryGetSupplierRequest = File_poktroll_supplier_query_proto.Messages().ByName("QueryGetSupplierRequest") - fd_QueryGetSupplierRequest_address = md_QueryGetSupplierRequest.Fields().ByName("address") + fd_QueryGetSupplierRequest_operator_address = md_QueryGetSupplierRequest.Fields().ByName("operator_address") } var _ protoreflect.Message = (*fastReflection_QueryGetSupplierRequest)(nil) @@ -886,9 +886,9 @@ func (x *fastReflection_QueryGetSupplierRequest) Interface() protoreflect.ProtoM // While iterating, mutating operations may only be performed // on the current field descriptor. func (x *fastReflection_QueryGetSupplierRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Address != "" { - value := protoreflect.ValueOfString(x.Address) - if !f(fd_QueryGetSupplierRequest_address, value) { + if x.OperatorAddress != "" { + value := protoreflect.ValueOfString(x.OperatorAddress) + if !f(fd_QueryGetSupplierRequest_operator_address, value) { return } } @@ -907,8 +907,8 @@ func (x *fastReflection_QueryGetSupplierRequest) Range(f func(protoreflect.Field // a repeated field is populated if it is non-empty. func (x *fastReflection_QueryGetSupplierRequest) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "poktroll.supplier.QueryGetSupplierRequest.address": - return x.Address != "" + case "poktroll.supplier.QueryGetSupplierRequest.operator_address": + return x.OperatorAddress != "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.QueryGetSupplierRequest")) @@ -925,8 +925,8 @@ func (x *fastReflection_QueryGetSupplierRequest) Has(fd protoreflect.FieldDescri // Clear is a mutating operation and unsafe for concurrent use. func (x *fastReflection_QueryGetSupplierRequest) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "poktroll.supplier.QueryGetSupplierRequest.address": - x.Address = "" + case "poktroll.supplier.QueryGetSupplierRequest.operator_address": + x.OperatorAddress = "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.QueryGetSupplierRequest")) @@ -943,8 +943,8 @@ func (x *fastReflection_QueryGetSupplierRequest) Clear(fd protoreflect.FieldDesc // of the value; to obtain a mutable reference, use Mutable. func (x *fastReflection_QueryGetSupplierRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "poktroll.supplier.QueryGetSupplierRequest.address": - value := x.Address + case "poktroll.supplier.QueryGetSupplierRequest.operator_address": + value := x.OperatorAddress return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { @@ -966,8 +966,8 @@ func (x *fastReflection_QueryGetSupplierRequest) Get(descriptor protoreflect.Fie // Set is a mutating operation and unsafe for concurrent use. func (x *fastReflection_QueryGetSupplierRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "poktroll.supplier.QueryGetSupplierRequest.address": - x.Address = value.Interface().(string) + case "poktroll.supplier.QueryGetSupplierRequest.operator_address": + x.OperatorAddress = value.Interface().(string) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.QueryGetSupplierRequest")) @@ -988,8 +988,8 @@ func (x *fastReflection_QueryGetSupplierRequest) Set(fd protoreflect.FieldDescri // Mutable is a mutating operation and unsafe for concurrent use. func (x *fastReflection_QueryGetSupplierRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "poktroll.supplier.QueryGetSupplierRequest.address": - panic(fmt.Errorf("field address of message poktroll.supplier.QueryGetSupplierRequest is not mutable")) + case "poktroll.supplier.QueryGetSupplierRequest.operator_address": + panic(fmt.Errorf("field operator_address of message poktroll.supplier.QueryGetSupplierRequest is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.QueryGetSupplierRequest")) @@ -1003,7 +1003,7 @@ func (x *fastReflection_QueryGetSupplierRequest) Mutable(fd protoreflect.FieldDe // For lists, maps, and messages, this returns a new, empty, mutable value. func (x *fastReflection_QueryGetSupplierRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "poktroll.supplier.QueryGetSupplierRequest.address": + case "poktroll.supplier.QueryGetSupplierRequest.operator_address": return protoreflect.ValueOfString("") default: if fd.IsExtension() { @@ -1074,7 +1074,7 @@ func (x *fastReflection_QueryGetSupplierRequest) ProtoMethods() *protoiface.Meth var n int var l int _ = l - l = len(x.Address) + l = len(x.OperatorAddress) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } @@ -1107,10 +1107,10 @@ func (x *fastReflection_QueryGetSupplierRequest) ProtoMethods() *protoiface.Meth i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if len(x.Address) > 0 { - i -= len(x.Address) - copy(dAtA[i:], x.Address) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Address))) + if len(x.OperatorAddress) > 0 { + i -= len(x.OperatorAddress) + copy(dAtA[i:], x.OperatorAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.OperatorAddress))) i-- dAtA[i] = 0xa } @@ -1165,7 +1165,7 @@ func (x *fastReflection_QueryGetSupplierRequest) ProtoMethods() *protoiface.Meth switch fieldNum { case 1: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field OperatorAddress", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1193,7 +1193,7 @@ func (x *fastReflection_QueryGetSupplierRequest) ProtoMethods() *protoiface.Meth if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.Address = string(dAtA[iNdEx:postIndex]) + x.OperatorAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -2755,7 +2755,7 @@ type QueryGetSupplierRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + OperatorAddress string `protobuf:"bytes,1,opt,name=operator_address,json=operatorAddress,proto3" json:"operator_address,omitempty"` } func (x *QueryGetSupplierRequest) Reset() { @@ -2778,9 +2778,9 @@ func (*QueryGetSupplierRequest) Descriptor() ([]byte, []int) { return file_poktroll_supplier_query_proto_rawDescGZIP(), []int{2} } -func (x *QueryGetSupplierRequest) GetAddress() string { +func (x *QueryGetSupplierRequest) GetOperatorAddress() string { if x != nil { - return x.Address + return x.OperatorAddress } return "" } @@ -2925,75 +2925,76 @@ var file_poktroll_supplier_query_proto_rawDesc = []byte{ 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, - 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x4d, 0x0a, 0x17, 0x51, + 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x5e, 0x0a, 0x17, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x32, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, - 0x67, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x57, 0x0a, 0x18, 0x51, 0x75, - 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x52, 0x65, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x43, 0x0a, 0x10, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, + 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x0f, 0x6f, 0x70, 0x65, 0x72, + 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x57, 0x0a, 0x18, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3b, 0x0a, 0x08, 0x73, 0x75, 0x70, 0x70, 0x6c, + 0x69, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x6f, 0x6b, 0x74, + 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2e, 0x53, 0x75, 0x70, 0x70, + 0x6c, 0x69, 0x65, 0x72, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x08, 0x73, 0x75, 0x70, 0x70, + 0x6c, 0x69, 0x65, 0x72, 0x22, 0x62, 0x0a, 0x18, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, + 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x46, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, + 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x0a, 0x70, 0x61, + 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xa1, 0x01, 0x0a, 0x19, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3b, 0x0a, 0x08, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, - 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, + 0x65, 0x72, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2e, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x08, 0x73, 0x75, 0x70, 0x70, 0x6c, - 0x69, 0x65, 0x72, 0x22, 0x62, 0x0a, 0x18, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x53, - 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x46, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, - 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, - 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x0a, 0x70, 0x61, 0x67, - 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xa1, 0x01, 0x0a, 0x19, 0x51, 0x75, 0x65, 0x72, - 0x79, 0x41, 0x6c, 0x6c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3b, 0x0a, 0x08, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, - 0x72, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, - 0x6c, 0x6c, 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2e, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, - 0x65, 0x72, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x08, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, - 0x65, 0x72, 0x12, 0x47, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, - 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x32, 0xd1, 0x03, 0x0a, 0x05, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x87, 0x01, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, - 0x12, 0x25, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, - 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, - 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, - 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x28, 0x12, 0x26, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x2d, 0x6e, - 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, - 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, - 0x9f, 0x01, 0x0a, 0x08, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x12, 0x2a, 0x2e, 0x70, - 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, - 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, - 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, + 0x69, 0x65, 0x72, 0x12, 0x47, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x32, 0xda, 0x03, 0x0a, + 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x87, 0x01, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x73, 0x12, 0x25, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, + 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x47, 0x65, 0x74, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x34, 0x12, 0x32, 0x2f, - 0x70, 0x6f, 0x6b, 0x74, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x70, 0x6f, 0x6b, - 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2f, 0x73, - 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2f, 0x7b, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x7d, 0x12, 0x9b, 0x01, 0x0a, 0x0c, 0x41, 0x6c, 0x6c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, - 0x72, 0x73, 0x12, 0x2b, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, - 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x53, - 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x2c, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, - 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x53, 0x75, 0x70, 0x70, - 0x6c, 0x69, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x30, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x2a, 0x12, 0x28, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x2d, 0x6e, 0x65, 0x74, - 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x73, 0x75, - 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x42, - 0xac, 0x01, 0x0a, 0x15, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, - 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, - 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x22, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, - 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, - 0x6c, 0x6c, 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0xa2, 0x02, 0x03, 0x50, 0x53, - 0x58, 0xaa, 0x02, 0x11, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x53, 0x75, 0x70, - 0x70, 0x6c, 0x69, 0x65, 0x72, 0xca, 0x02, 0x11, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, - 0x5c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0xe2, 0x02, 0x1d, 0x50, 0x6f, 0x6b, 0x74, - 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x5c, 0x47, 0x50, - 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x12, 0x50, 0x6f, 0x6b, 0x74, - 0x72, 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x28, 0x12, 0x26, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x2d, + 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, + 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x12, 0xa8, 0x01, 0x0a, 0x08, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x12, 0x2a, 0x2e, + 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, + 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, + 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x70, 0x6f, 0x6b, 0x74, + 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x47, 0x65, 0x74, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x43, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3d, 0x12, 0x3b, + 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x70, 0x6f, + 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2f, + 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2f, 0x7b, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, + 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x7d, 0x12, 0x9b, 0x01, 0x0a, 0x0c, + 0x41, 0x6c, 0x6c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x73, 0x12, 0x2b, 0x2e, 0x70, + 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, + 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, + 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x70, 0x6f, 0x6b, 0x74, + 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x41, 0x6c, 0x6c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x30, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2a, 0x12, + 0x28, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x2d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x70, + 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, + 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x42, 0xac, 0x01, 0x0a, 0x15, 0x63, 0x6f, + 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, + 0x69, 0x65, 0x72, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, + 0x01, 0x5a, 0x22, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, + 0x61, 0x70, 0x69, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x73, 0x75, 0x70, + 0x70, 0x6c, 0x69, 0x65, 0x72, 0xa2, 0x02, 0x03, 0x50, 0x53, 0x58, 0xaa, 0x02, 0x11, 0x50, 0x6f, + 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0xca, + 0x02, 0x11, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x53, 0x75, 0x70, 0x70, 0x6c, + 0x69, 0x65, 0x72, 0xe2, 0x02, 0x1d, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x53, + 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0xea, 0x02, 0x12, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, + 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/api/poktroll/supplier/tx.pulsar.go b/api/poktroll/supplier/tx.pulsar.go index c8e1c1b5e..b589aa142 100644 --- a/api/poktroll/supplier/tx.pulsar.go +++ b/api/poktroll/supplier/tx.pulsar.go @@ -925,12 +925,12 @@ func (x *_MsgStakeSupplier_5_list) IsValid() bool { } var ( - md_MsgStakeSupplier protoreflect.MessageDescriptor - fd_MsgStakeSupplier_signer protoreflect.FieldDescriptor - fd_MsgStakeSupplier_owner_address protoreflect.FieldDescriptor - fd_MsgStakeSupplier_address protoreflect.FieldDescriptor - fd_MsgStakeSupplier_stake protoreflect.FieldDescriptor - fd_MsgStakeSupplier_services protoreflect.FieldDescriptor + md_MsgStakeSupplier protoreflect.MessageDescriptor + fd_MsgStakeSupplier_signer protoreflect.FieldDescriptor + fd_MsgStakeSupplier_owner_address protoreflect.FieldDescriptor + fd_MsgStakeSupplier_operator_address protoreflect.FieldDescriptor + fd_MsgStakeSupplier_stake protoreflect.FieldDescriptor + fd_MsgStakeSupplier_services protoreflect.FieldDescriptor ) func init() { @@ -938,7 +938,7 @@ func init() { md_MsgStakeSupplier = File_poktroll_supplier_tx_proto.Messages().ByName("MsgStakeSupplier") fd_MsgStakeSupplier_signer = md_MsgStakeSupplier.Fields().ByName("signer") fd_MsgStakeSupplier_owner_address = md_MsgStakeSupplier.Fields().ByName("owner_address") - fd_MsgStakeSupplier_address = md_MsgStakeSupplier.Fields().ByName("address") + fd_MsgStakeSupplier_operator_address = md_MsgStakeSupplier.Fields().ByName("operator_address") fd_MsgStakeSupplier_stake = md_MsgStakeSupplier.Fields().ByName("stake") fd_MsgStakeSupplier_services = md_MsgStakeSupplier.Fields().ByName("services") } @@ -1020,9 +1020,9 @@ func (x *fastReflection_MsgStakeSupplier) Range(f func(protoreflect.FieldDescrip return } } - if x.Address != "" { - value := protoreflect.ValueOfString(x.Address) - if !f(fd_MsgStakeSupplier_address, value) { + if x.OperatorAddress != "" { + value := protoreflect.ValueOfString(x.OperatorAddress) + if !f(fd_MsgStakeSupplier_operator_address, value) { return } } @@ -1057,8 +1057,8 @@ func (x *fastReflection_MsgStakeSupplier) Has(fd protoreflect.FieldDescriptor) b return x.Signer != "" case "poktroll.supplier.MsgStakeSupplier.owner_address": return x.OwnerAddress != "" - case "poktroll.supplier.MsgStakeSupplier.address": - return x.Address != "" + case "poktroll.supplier.MsgStakeSupplier.operator_address": + return x.OperatorAddress != "" case "poktroll.supplier.MsgStakeSupplier.stake": return x.Stake != nil case "poktroll.supplier.MsgStakeSupplier.services": @@ -1083,8 +1083,8 @@ func (x *fastReflection_MsgStakeSupplier) Clear(fd protoreflect.FieldDescriptor) x.Signer = "" case "poktroll.supplier.MsgStakeSupplier.owner_address": x.OwnerAddress = "" - case "poktroll.supplier.MsgStakeSupplier.address": - x.Address = "" + case "poktroll.supplier.MsgStakeSupplier.operator_address": + x.OperatorAddress = "" case "poktroll.supplier.MsgStakeSupplier.stake": x.Stake = nil case "poktroll.supplier.MsgStakeSupplier.services": @@ -1111,8 +1111,8 @@ func (x *fastReflection_MsgStakeSupplier) Get(descriptor protoreflect.FieldDescr case "poktroll.supplier.MsgStakeSupplier.owner_address": value := x.OwnerAddress return protoreflect.ValueOfString(value) - case "poktroll.supplier.MsgStakeSupplier.address": - value := x.Address + case "poktroll.supplier.MsgStakeSupplier.operator_address": + value := x.OperatorAddress return protoreflect.ValueOfString(value) case "poktroll.supplier.MsgStakeSupplier.stake": value := x.Stake @@ -1147,8 +1147,8 @@ func (x *fastReflection_MsgStakeSupplier) Set(fd protoreflect.FieldDescriptor, v x.Signer = value.Interface().(string) case "poktroll.supplier.MsgStakeSupplier.owner_address": x.OwnerAddress = value.Interface().(string) - case "poktroll.supplier.MsgStakeSupplier.address": - x.Address = value.Interface().(string) + case "poktroll.supplier.MsgStakeSupplier.operator_address": + x.OperatorAddress = value.Interface().(string) case "poktroll.supplier.MsgStakeSupplier.stake": x.Stake = value.Message().Interface().(*v1beta1.Coin) case "poktroll.supplier.MsgStakeSupplier.services": @@ -1190,8 +1190,8 @@ func (x *fastReflection_MsgStakeSupplier) Mutable(fd protoreflect.FieldDescripto panic(fmt.Errorf("field signer of message poktroll.supplier.MsgStakeSupplier is not mutable")) case "poktroll.supplier.MsgStakeSupplier.owner_address": panic(fmt.Errorf("field owner_address of message poktroll.supplier.MsgStakeSupplier is not mutable")) - case "poktroll.supplier.MsgStakeSupplier.address": - panic(fmt.Errorf("field address of message poktroll.supplier.MsgStakeSupplier is not mutable")) + case "poktroll.supplier.MsgStakeSupplier.operator_address": + panic(fmt.Errorf("field operator_address of message poktroll.supplier.MsgStakeSupplier is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.MsgStakeSupplier")) @@ -1209,7 +1209,7 @@ func (x *fastReflection_MsgStakeSupplier) NewField(fd protoreflect.FieldDescript return protoreflect.ValueOfString("") case "poktroll.supplier.MsgStakeSupplier.owner_address": return protoreflect.ValueOfString("") - case "poktroll.supplier.MsgStakeSupplier.address": + case "poktroll.supplier.MsgStakeSupplier.operator_address": return protoreflect.ValueOfString("") case "poktroll.supplier.MsgStakeSupplier.stake": m := new(v1beta1.Coin) @@ -1294,7 +1294,7 @@ func (x *fastReflection_MsgStakeSupplier) ProtoMethods() *protoiface.Methods { if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - l = len(x.Address) + l = len(x.OperatorAddress) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } @@ -1367,10 +1367,10 @@ func (x *fastReflection_MsgStakeSupplier) ProtoMethods() *protoiface.Methods { i-- dAtA[i] = 0x22 } - if len(x.Address) > 0 { - i -= len(x.Address) - copy(dAtA[i:], x.Address) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Address))) + if len(x.OperatorAddress) > 0 { + i -= len(x.OperatorAddress) + copy(dAtA[i:], x.OperatorAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.OperatorAddress))) i-- dAtA[i] = 0x1a } @@ -1503,7 +1503,7 @@ func (x *fastReflection_MsgStakeSupplier) ProtoMethods() *protoiface.Methods { iNdEx = postIndex case 3: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field OperatorAddress", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1531,7 +1531,7 @@ func (x *fastReflection_MsgStakeSupplier) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.Address = string(dAtA[iNdEx:postIndex]) + x.OperatorAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: if wireType != 2 { @@ -1995,16 +1995,16 @@ func (x *fastReflection_MsgStakeSupplierResponse) ProtoMethods() *protoiface.Met } var ( - md_MsgUnstakeSupplier protoreflect.MessageDescriptor - fd_MsgUnstakeSupplier_signer protoreflect.FieldDescriptor - fd_MsgUnstakeSupplier_address protoreflect.FieldDescriptor + md_MsgUnstakeSupplier protoreflect.MessageDescriptor + fd_MsgUnstakeSupplier_signer protoreflect.FieldDescriptor + fd_MsgUnstakeSupplier_operator_address protoreflect.FieldDescriptor ) func init() { file_poktroll_supplier_tx_proto_init() md_MsgUnstakeSupplier = File_poktroll_supplier_tx_proto.Messages().ByName("MsgUnstakeSupplier") fd_MsgUnstakeSupplier_signer = md_MsgUnstakeSupplier.Fields().ByName("signer") - fd_MsgUnstakeSupplier_address = md_MsgUnstakeSupplier.Fields().ByName("address") + fd_MsgUnstakeSupplier_operator_address = md_MsgUnstakeSupplier.Fields().ByName("operator_address") } var _ protoreflect.Message = (*fastReflection_MsgUnstakeSupplier)(nil) @@ -2078,9 +2078,9 @@ func (x *fastReflection_MsgUnstakeSupplier) Range(f func(protoreflect.FieldDescr return } } - if x.Address != "" { - value := protoreflect.ValueOfString(x.Address) - if !f(fd_MsgUnstakeSupplier_address, value) { + if x.OperatorAddress != "" { + value := protoreflect.ValueOfString(x.OperatorAddress) + if !f(fd_MsgUnstakeSupplier_operator_address, value) { return } } @@ -2101,8 +2101,8 @@ func (x *fastReflection_MsgUnstakeSupplier) Has(fd protoreflect.FieldDescriptor) switch fd.FullName() { case "poktroll.supplier.MsgUnstakeSupplier.signer": return x.Signer != "" - case "poktroll.supplier.MsgUnstakeSupplier.address": - return x.Address != "" + case "poktroll.supplier.MsgUnstakeSupplier.operator_address": + return x.OperatorAddress != "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.MsgUnstakeSupplier")) @@ -2121,8 +2121,8 @@ func (x *fastReflection_MsgUnstakeSupplier) Clear(fd protoreflect.FieldDescripto switch fd.FullName() { case "poktroll.supplier.MsgUnstakeSupplier.signer": x.Signer = "" - case "poktroll.supplier.MsgUnstakeSupplier.address": - x.Address = "" + case "poktroll.supplier.MsgUnstakeSupplier.operator_address": + x.OperatorAddress = "" default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.MsgUnstakeSupplier")) @@ -2142,8 +2142,8 @@ func (x *fastReflection_MsgUnstakeSupplier) Get(descriptor protoreflect.FieldDes case "poktroll.supplier.MsgUnstakeSupplier.signer": value := x.Signer return protoreflect.ValueOfString(value) - case "poktroll.supplier.MsgUnstakeSupplier.address": - value := x.Address + case "poktroll.supplier.MsgUnstakeSupplier.operator_address": + value := x.OperatorAddress return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { @@ -2167,8 +2167,8 @@ func (x *fastReflection_MsgUnstakeSupplier) Set(fd protoreflect.FieldDescriptor, switch fd.FullName() { case "poktroll.supplier.MsgUnstakeSupplier.signer": x.Signer = value.Interface().(string) - case "poktroll.supplier.MsgUnstakeSupplier.address": - x.Address = value.Interface().(string) + case "poktroll.supplier.MsgUnstakeSupplier.operator_address": + x.OperatorAddress = value.Interface().(string) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.MsgUnstakeSupplier")) @@ -2191,8 +2191,8 @@ func (x *fastReflection_MsgUnstakeSupplier) Mutable(fd protoreflect.FieldDescrip switch fd.FullName() { case "poktroll.supplier.MsgUnstakeSupplier.signer": panic(fmt.Errorf("field signer of message poktroll.supplier.MsgUnstakeSupplier is not mutable")) - case "poktroll.supplier.MsgUnstakeSupplier.address": - panic(fmt.Errorf("field address of message poktroll.supplier.MsgUnstakeSupplier is not mutable")) + case "poktroll.supplier.MsgUnstakeSupplier.operator_address": + panic(fmt.Errorf("field operator_address of message poktroll.supplier.MsgUnstakeSupplier is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.supplier.MsgUnstakeSupplier")) @@ -2208,7 +2208,7 @@ func (x *fastReflection_MsgUnstakeSupplier) NewField(fd protoreflect.FieldDescri switch fd.FullName() { case "poktroll.supplier.MsgUnstakeSupplier.signer": return protoreflect.ValueOfString("") - case "poktroll.supplier.MsgUnstakeSupplier.address": + case "poktroll.supplier.MsgUnstakeSupplier.operator_address": return protoreflect.ValueOfString("") default: if fd.IsExtension() { @@ -2283,7 +2283,7 @@ func (x *fastReflection_MsgUnstakeSupplier) ProtoMethods() *protoiface.Methods { if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - l = len(x.Address) + l = len(x.OperatorAddress) if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } @@ -2316,10 +2316,10 @@ func (x *fastReflection_MsgUnstakeSupplier) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if len(x.Address) > 0 { - i -= len(x.Address) - copy(dAtA[i:], x.Address) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Address))) + if len(x.OperatorAddress) > 0 { + i -= len(x.OperatorAddress) + copy(dAtA[i:], x.OperatorAddress) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.OperatorAddress))) i-- dAtA[i] = 0x12 } @@ -2413,7 +2413,7 @@ func (x *fastReflection_MsgUnstakeSupplier) ProtoMethods() *protoiface.Methods { iNdEx = postIndex case 2: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field OperatorAddress", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2441,7 +2441,7 @@ func (x *fastReflection_MsgUnstakeSupplier) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.Address = string(dAtA[iNdEx:postIndex]) + x.OperatorAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -2927,11 +2927,11 @@ type MsgStakeSupplier struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Signer string `protobuf:"bytes,1,opt,name=signer,proto3" json:"signer,omitempty"` // The Bech32 address of the message signer (i.e. owner or operator) - OwnerAddress string `protobuf:"bytes,2,opt,name=owner_address,json=ownerAddress,proto3" json:"owner_address,omitempty"` // The Bech32 address of the owner (i.e. custodial, staker) - Address string `protobuf:"bytes,3,opt,name=address,proto3" json:"address,omitempty"` // The Bech32 address of the operator (i.e. provider, non-custodial) - Stake *v1beta1.Coin `protobuf:"bytes,4,opt,name=stake,proto3" json:"stake,omitempty"` // The total amount of uPOKT the supplier has staked. Must be ≥ to the current amount that the supplier has staked (if any) - Services []*shared.SupplierServiceConfig `protobuf:"bytes,5,rep,name=services,proto3" json:"services,omitempty"` // The list of services this supplier is staked to provide service for + Signer string `protobuf:"bytes,1,opt,name=signer,proto3" json:"signer,omitempty"` // The Bech32 address of the message signer (i.e. owner or operator) + OwnerAddress string `protobuf:"bytes,2,opt,name=owner_address,json=ownerAddress,proto3" json:"owner_address,omitempty"` // The Bech32 address of the owner (i.e. custodial, staker) + OperatorAddress string `protobuf:"bytes,3,opt,name=operator_address,json=operatorAddress,proto3" json:"operator_address,omitempty"` // The Bech32 address of the operator (i.e. provider, non-custodial) + Stake *v1beta1.Coin `protobuf:"bytes,4,opt,name=stake,proto3" json:"stake,omitempty"` // The total amount of uPOKT the supplier has staked. Must be ≥ to the current amount that the supplier has staked (if any) + Services []*shared.SupplierServiceConfig `protobuf:"bytes,5,rep,name=services,proto3" json:"services,omitempty"` // The list of services this supplier is staked to provide service for } func (x *MsgStakeSupplier) Reset() { @@ -2968,9 +2968,9 @@ func (x *MsgStakeSupplier) GetOwnerAddress() string { return "" } -func (x *MsgStakeSupplier) GetAddress() string { +func (x *MsgStakeSupplier) GetOperatorAddress() string { if x != nil { - return x.Address + return x.OperatorAddress } return "" } @@ -3020,8 +3020,8 @@ type MsgUnstakeSupplier struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Signer string `protobuf:"bytes,1,opt,name=signer,proto3" json:"signer,omitempty"` // The Bech32 address of the message signer (i.e. owner or operator) - Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` // The Bech32 address of the operator (i.e. provider, non-custodial) + Signer string `protobuf:"bytes,1,opt,name=signer,proto3" json:"signer,omitempty"` // The Bech32 address of the message signer (i.e. owner or operator) + OperatorAddress string `protobuf:"bytes,2,opt,name=operator_address,json=operatorAddress,proto3" json:"operator_address,omitempty"` // The Bech32 address of the operator (i.e. provider, non-custodial) } func (x *MsgUnstakeSupplier) Reset() { @@ -3051,9 +3051,9 @@ func (x *MsgUnstakeSupplier) GetSigner() string { return "" } -func (x *MsgUnstakeSupplier) GetAddress() string { +func (x *MsgUnstakeSupplier) GetOperatorAddress() string { if x != nil { - return x.Address + return x.OperatorAddress } return "" } @@ -3115,7 +3115,7 @@ var file_poktroll_supplier_tx_proto_rawDesc = []byte{ 0x6c, 0x6c, 0x2f, 0x78, 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2f, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x19, 0x0a, 0x17, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xb9, 0x02, 0x0a, 0x10, 0x4d, 0x73, 0x67, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xca, 0x02, 0x0a, 0x10, 0x4d, 0x73, 0x67, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x12, 0x30, 0x0a, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, @@ -3123,62 +3123,64 @@ var file_poktroll_supplier_tx_proto_rawDesc = []byte{ 0x3d, 0x0a, 0x0d, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, - 0x52, 0x0c, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x32, - 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, - 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, - 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, - 0x73, 0x73, 0x12, 0x2f, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x52, 0x05, 0x73, 0x74, - 0x61, 0x6b, 0x65, 0x12, 0x42, 0x0a, 0x08, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x18, - 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, - 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2e, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, - 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x08, 0x73, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x3a, 0x0b, 0x82, 0xe7, 0xb0, 0x2a, 0x06, 0x73, 0x69, - 0x67, 0x6e, 0x65, 0x72, 0x22, 0x1a, 0x0a, 0x18, 0x4d, 0x73, 0x67, 0x53, 0x74, 0x61, 0x6b, 0x65, - 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x87, 0x01, 0x0a, 0x12, 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x53, - 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x12, 0x30, 0x0a, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, - 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, - 0x67, 0x52, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x12, 0x32, 0x0a, 0x07, 0x61, 0x64, 0x64, - 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, - 0x72, 0x69, 0x6e, 0x67, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x3a, 0x0b, 0x82, - 0xe7, 0xb0, 0x2a, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x22, 0x1c, 0x0a, 0x1a, 0x4d, 0x73, - 0x67, 0x55, 0x6e, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xb8, 0x02, 0x0a, 0x03, 0x4d, 0x73, 0x67, - 0x12, 0x5e, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, - 0x12, 0x22, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, - 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, - 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x2a, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, - 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x61, 0x0a, 0x0d, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, - 0x72, 0x12, 0x23, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, - 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x53, 0x75, - 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x1a, 0x2b, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, - 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x74, - 0x61, 0x6b, 0x65, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x67, 0x0a, 0x0f, 0x55, 0x6e, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x53, 0x75, - 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x12, 0x25, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, - 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x6e, - 0x73, 0x74, 0x61, 0x6b, 0x65, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x1a, 0x2d, 0x2e, - 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, - 0x72, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x53, 0x75, 0x70, 0x70, - 0x6c, 0x69, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, - 0xb0, 0x2a, 0x01, 0x42, 0xa9, 0x01, 0x0a, 0x15, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, - 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x42, 0x07, 0x54, - 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x22, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, - 0x6f, 0x6c, 0x6c, 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0xa2, 0x02, 0x03, 0x50, - 0x53, 0x58, 0xaa, 0x02, 0x11, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x53, 0x75, - 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0xca, 0x02, 0x11, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, - 0x6c, 0x5c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0xe2, 0x02, 0x1d, 0x50, 0x6f, 0x6b, - 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x5c, 0x47, - 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x12, 0x50, 0x6f, 0x6b, - 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x52, 0x0c, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x43, + 0x0a, 0x10, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, + 0x6e, 0x67, 0x52, 0x0f, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x12, 0x2f, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, + 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x52, 0x05, 0x73, + 0x74, 0x61, 0x6b, 0x65, 0x12, 0x42, 0x0a, 0x08, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, + 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, + 0x6c, 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2e, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, + 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x08, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x3a, 0x0b, 0x82, 0xe7, 0xb0, 0x2a, 0x06, 0x73, + 0x69, 0x67, 0x6e, 0x65, 0x72, 0x22, 0x1a, 0x0a, 0x18, 0x4d, 0x73, 0x67, 0x53, 0x74, 0x61, 0x6b, + 0x65, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x98, 0x01, 0x0a, 0x12, 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x73, 0x74, 0x61, 0x6b, 0x65, + 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x12, 0x30, 0x0a, 0x06, 0x73, 0x69, 0x67, 0x6e, + 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, + 0x6e, 0x67, 0x52, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x12, 0x43, 0x0a, 0x10, 0x6f, 0x70, + 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x0f, + 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x3a, + 0x0b, 0x82, 0xe7, 0xb0, 0x2a, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x22, 0x1c, 0x0a, 0x1a, + 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, + 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xb8, 0x02, 0x0a, 0x03, 0x4d, + 0x73, 0x67, 0x12, 0x5e, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x12, 0x22, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, + 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x2a, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, + 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x61, 0x0a, 0x0d, 0x53, 0x74, 0x61, 0x6b, 0x65, 0x53, 0x75, 0x70, 0x70, 0x6c, + 0x69, 0x65, 0x72, 0x12, 0x23, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, + 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x74, 0x61, 0x6b, 0x65, + 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x1a, 0x2b, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, + 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x4d, 0x73, 0x67, + 0x53, 0x74, 0x61, 0x6b, 0x65, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x67, 0x0a, 0x0f, 0x55, 0x6e, 0x73, 0x74, 0x61, 0x6b, 0x65, + 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x12, 0x25, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, + 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x4d, 0x73, 0x67, + 0x55, 0x6e, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x1a, + 0x2d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, + 0x69, 0x65, 0x72, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x53, 0x75, + 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, + 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0xa9, 0x01, 0x0a, 0x15, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, + 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x42, + 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x22, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x6f, 0x6b, + 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0xa2, 0x02, + 0x03, 0x50, 0x53, 0x58, 0xaa, 0x02, 0x11, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, + 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0xca, 0x02, 0x11, 0x50, 0x6f, 0x6b, 0x74, 0x72, + 0x6f, 0x6c, 0x6c, 0x5c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0xe2, 0x02, 0x1d, 0x50, + 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, + 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x12, 0x50, + 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, + 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/config.yml b/config.yml index f6ffaa640..ed65e4ae4 100644 --- a/config.yml +++ b/config.yml @@ -170,7 +170,7 @@ genesis: supplier: supplierList: - owner_address: pokt19a3t4yunp0dlpfjrp7qwnzwlrzd5fzs2gjaaaj - address: pokt19a3t4yunp0dlpfjrp7qwnzwlrzd5fzs2gjaaaj + operator_address: pokt19a3t4yunp0dlpfjrp7qwnzwlrzd5fzs2gjaaaj services: - service: id: anvil diff --git a/docs/static/openapi.yml b/docs/static/openapi.yml index b5e27e4b8..c6cb3e27a 100644 --- a/docs/static/openapi.yml +++ b/docs/static/openapi.yml @@ -16611,7 +16611,7 @@ paths: items: type: object properties: - supplier_address: + supplier_operator_address: type: string title: the address of the supplier that submitted this claim session_header: @@ -16795,7 +16795,7 @@ paths: in: query required: false type: boolean - - name: supplier_address + - name: supplier_operator_address in: query required: false type: string @@ -16810,7 +16810,7 @@ paths: format: uint64 tags: - Query - /pokt-network/poktroll/proof/claim/{session_id}/{supplier_address}: + /pokt-network/poktroll/proof/claim/{session_id}/{supplier_operator_address}: get: summary: Queries a list of Claim items. operationId: PoktrollProofQuery_Claim @@ -16823,7 +16823,7 @@ paths: claim: type: object properties: - supplier_address: + supplier_operator_address: type: string title: the address of the supplier that submitted this claim session_header: @@ -16923,7 +16923,7 @@ paths: in: path required: true type: string - - name: supplier_address + - name: supplier_operator_address in: path required: true type: string @@ -17032,7 +17032,7 @@ paths: items: type: object properties: - supplier_address: + supplier_operator_address: type: string session_header: description: >- @@ -17214,7 +17214,7 @@ paths: in: query required: false type: boolean - - name: supplier_address + - name: supplier_operator_address in: query required: false type: string @@ -17229,7 +17229,7 @@ paths: format: uint64 tags: - Query - /pokt-network/poktroll/proof/proof/{session_id}/{supplier_address}: + /pokt-network/poktroll/proof/proof/{session_id}/{supplier_operator_address}: get: summary: Queries a list of Proof items. operationId: PoktrollProofQuery_Proof @@ -17242,7 +17242,7 @@ paths: proof: type: object properties: - supplier_address: + supplier_operator_address: type: string session_header: description: The session header of the session that this claim is for. @@ -17340,7 +17340,7 @@ paths: in: path required: true type: string - - name: supplier_address + - name: supplier_operator_address in: path required: true type: string @@ -17358,7 +17358,7 @@ paths: claim: type: object properties: - supplier_address: + supplier_operator_address: type: string title: the address of the supplier that submitted this claim session_header: @@ -17460,7 +17460,7 @@ paths: schema: type: object properties: - supplier_address: + supplier_operator_address: type: string session_header: type: object @@ -17552,7 +17552,7 @@ paths: proof: type: object properties: - supplier_address: + supplier_operator_address: type: string session_header: type: object @@ -17657,7 +17657,7 @@ paths: schema: type: object properties: - supplier_address: + supplier_operator_address: type: string session_header: type: object @@ -26007,7 +26007,7 @@ definitions: poktroll.proof.Claim: type: object properties: - supplier_address: + supplier_operator_address: type: string title: the address of the supplier that submitted this claim session_header: @@ -26136,7 +26136,7 @@ definitions: poktroll.proof.Proof: type: object properties: - supplier_address: + supplier_operator_address: type: string session_header: description: The session header of the session that this claim is for. @@ -26211,7 +26211,7 @@ definitions: items: type: object properties: - supplier_address: + supplier_operator_address: type: string title: the address of the supplier that submitted this claim session_header: @@ -26318,7 +26318,7 @@ definitions: items: type: object properties: - supplier_address: + supplier_operator_address: type: string session_header: description: The session header of the session that this claim is for. @@ -26419,7 +26419,7 @@ definitions: claim: type: object properties: - supplier_address: + supplier_operator_address: type: string title: the address of the supplier that submitted this claim session_header: @@ -26498,7 +26498,7 @@ definitions: proof: type: object properties: - supplier_address: + supplier_operator_address: type: string session_header: description: The session header of the session that this claim is for. @@ -26692,7 +26692,7 @@ definitions: poktroll.proof.MsgCreateClaim: type: object properties: - supplier_address: + supplier_operator_address: type: string session_header: type: object @@ -26770,7 +26770,7 @@ definitions: claim: type: object properties: - supplier_address: + supplier_operator_address: type: string title: the address of the supplier that submitted this claim session_header: @@ -26846,7 +26846,7 @@ definitions: poktroll.proof.MsgSubmitProof: type: object properties: - supplier_address: + supplier_operator_address: type: string session_header: type: object @@ -26924,7 +26924,7 @@ definitions: proof: type: object properties: - supplier_address: + supplier_operator_address: type: string session_header: type: object @@ -27228,7 +27228,7 @@ definitions: poktroll.proof.Proof: type: object properties: - supplier_address: + supplier_operator_address: type: string session_header: type: object diff --git a/docusaurus/docs/develop/developer_guide/quickstart.md b/docusaurus/docs/develop/developer_guide/quickstart.md index 6d07c0d5c..13a899e29 100644 --- a/docusaurus/docs/develop/developer_guide/quickstart.md +++ b/docusaurus/docs/develop/developer_guide/quickstart.md @@ -390,6 +390,8 @@ The following is an example config to get you started: ```bash cat <> shannon_supplier_config.yaml +owner_address: pokt1h04g6njyuv03dhd74a73pyzeadmd8dk7l9tsk8 +operator_address: pokt1h04g6njyuv03dhd74a73pyzeadmd8dk7l9tsk8 stake_amount: 1000069upokt services: - service_id: anvil diff --git a/docusaurus/docs/operate/configs/relayminer_config.md b/docusaurus/docs/operate/configs/relayminer_config.md index 985eca313..e23dbd6be 100644 --- a/docusaurus/docs/operate/configs/relayminer_config.md +++ b/docusaurus/docs/operate/configs/relayminer_config.md @@ -113,7 +113,7 @@ smt_store_path: ### `default_signing_key_names` -_`Required`_ if `suppliers.*.signing_key_names` is not specified. +_`Required`_ if `suppliers.*.signing_key_names` is not specified. This configuration option specifies a list of key names from the keyring that the `RelayMiner` will use to sign transactions. These key names are used to derive the public diff --git a/docusaurus/docs/protocol/primitives/claim_and_proof_lifecycle.md b/docusaurus/docs/protocol/primitives/claim_and_proof_lifecycle.md index 5b5022db8..caaa15b5a 100644 --- a/docusaurus/docs/protocol/primitives/claim_and_proof_lifecycle.md +++ b/docusaurus/docs/protocol/primitives/claim_and_proof_lifecycle.md @@ -15,7 +15,8 @@ to all readers. ::: - [Introduction](#introduction) -- [Session Windows & On-Chain Parameters](#session-windows--on-chain-parameters) +- [Session Windows \& On-Chain Parameters](#session-windows--on-chain-parameters) + - [References:](#references) - [Claim Expiration](#claim-expiration) - [Session](#session) - [Session Duration](#session-duration) @@ -23,10 +24,12 @@ to all readers. - [Claim](#claim) - [Protobuf Types](#protobuf-types) - [CreateClaim Validation](#createclaim-validation) + - [References:](#references-1) - [Claim Window](#claim-window) - [Proof](#proof) - [Protobuf Types](#protobuf-types-1) - [SubmitProof Validation](#submitproof-validation) + - [References:](#references-2) - [Proof Window](#proof-window) - [Proof Security](#proof-security) - [Merkle Leaf Validation](#merkle-leaf-validation) @@ -37,6 +40,12 @@ to all readers. - [Example 3: Path to empty node](#example-3-path-to-empty-node) - [Full Lifecycle](#full-lifecycle) - [Reference Diagrams](#reference-diagrams) + - [Session Header Validation](#session-header-validation) + - [Proof Basic Validation](#proof-basic-validation) + - [Proof Submission Relay Request Validation](#proof-submission-relay-request-validation) + - [Proof Submission Relay Response Validation](#proof-submission-relay-response-validation) + - [Proof Session Header Comparison](#proof-session-header-comparison) + - [Proof Submission Claim Validation](#proof-submission-claim-validation) ## Introduction @@ -211,16 +220,16 @@ stateDiagram-v2 [*] --> Validate_Claim state Validate_Claim { [*] --> Validate_Basic - + state Validate_Basic { state if_session_start_gt_0 <> state if_session_id_empty <> state if_service_invalid <> - state if_supplier_addr_valid <> - - [*] --> if_supplier_addr_valid - if_supplier_addr_valid --> Basic_Validation_Error: invalid supplier address - if_supplier_addr_valid --> if_session_start_gt_0 + state if_supplier_operator_addr_valid <> + + [*] --> if_supplier_operator_addr_valid + if_supplier_operator_addr_valid --> Basic_Validation_Error: invalid supplier operator address + if_supplier_operator_addr_valid --> if_session_start_gt_0 if_session_start_gt_0 --> Basic_Validation_Error: session start height < 0 if_session_start_gt_0 --> if_session_id_empty if_session_id_empty --> Basic_Validation_Error: empty session ID @@ -287,11 +296,11 @@ state Validate_Proof { Proof_Validate_Basic --> Validate_Session_Header Validate_Session_Header --> Validate_Proof_Window Validate_Proof_Window --> Unpack_Proven_Relay - + state Unpack_Proven_Relay { state if_closest_proof_malformed <> state if_relay_valid <> - + [*] --> if_closest_proof_malformed if_closest_proof_malformed --> Closest_Proof_Unmarshal_Error: cannot unmarshal closest proof if_closest_proof_malformed --> if_relay_valid @@ -373,7 +382,7 @@ The key components of every leaf in the `Sparse Merkle Sum Trie` are shown below After the leaf is validated, two things happen: 1. The stake of `Application` signing the `Relay Request` is decreased through burn -2. The account balance of the `Supplier` signing the `Relay Response` is increased through mint +2. The account balance of the `Supplier` owner is increased through mint The validation on these signatures is done on-chain as part of `Proof Validation`. @@ -689,13 +698,13 @@ stateDiagram-v2 [*] --> Proof_Validate_Basic state Proof_Validate_Basic { - state if_supplier_addr_valid <> + state if_supplier_operator_addr_valid <> state if_app_addr_valid <> state if_service_id_empty <> state if_proof_empty <> - [*] --> if_supplier_addr_valid - if_supplier_addr_valid --> Basic_Validation_error: invalid supplier address - if_supplier_addr_valid --> if_app_addr_valid + [*] --> if_supplier_operator_addr_valid + if_supplier_operator_addr_valid --> Basic_Validation_error: invalid supplier operator address + if_supplier_operator_addr_valid --> if_app_addr_valid if_app_addr_valid --> Basic_Validation_error: invalid app address if_app_addr_valid --> if_service_id_empty if_service_id_empty --> Basic_Validation_error: empty service ID @@ -714,7 +723,7 @@ stateDiagram-v2 [*] --> Validate_Relay_Request state Validate_Relay_Request { - + [*] --> Validate_Relay_Request_Basic state Validate_Relay_Request_Basic { @@ -748,7 +757,7 @@ state Validate_Relay_Request { state if_ring_valid <> state if_ring_mismatch <> state if_ring_sig_valid <> - + [*] --> if_request_meta_empty if_request_meta_empty --> Relay_Request_Signature_Error: empty relay request metadata if_request_meta_empty --> if_ring_sig_empty @@ -779,7 +788,7 @@ stateDiagram-v2 [*] --> Validate_Relay_Response state Validate_Relay_Response { - + [*] --> Validate_Relay_Response_Basic state Validate_Relay_Response_Basic { diff --git a/e2e/tests/init_test.go b/e2e/tests/init_test.go index c9dcaedc3..035c17b73 100644 --- a/e2e/tests/init_test.go +++ b/e2e/tests/init_test.go @@ -52,10 +52,10 @@ var ( amountRe *regexp.Regexp addrAndAmountRe *regexp.Regexp - accNameToAddrMap = make(map[string]string) - accAddrToNameMap = make(map[string]string) - accNameToAppMap = make(map[string]apptypes.Application) - accNameToSupplierMap = make(map[string]sharedtypes.Supplier) + accNameToAddrMap = make(map[string]string) + accAddrToNameMap = make(map[string]string) + accNameToAppMap = make(map[string]apptypes.Application) + operatorAccNameToSupplierMap = make(map[string]sharedtypes.Supplier) flagFeaturesPath string keyRingFlag = "--keyring-backend=test" @@ -423,35 +423,35 @@ func (s *suite) TheApplicationIsStakedForService(appName string, serviceId strin s.Fatalf("ERROR: application %s is not staked for service %s", appName, serviceId) } -func (s *suite) TheSupplierIsStakedForService(supplierName string, serviceId string) { - for _, serviceConfig := range accNameToSupplierMap[supplierName].Services { +func (s *suite) TheSupplierIsStakedForService(supplierOperatorName string, serviceId string) { + for _, serviceConfig := range operatorAccNameToSupplierMap[supplierOperatorName].Services { if serviceConfig.Service.Id == serviceId { return } } - s.Fatalf("ERROR: supplier %s is not staked for service %s", supplierName, serviceId) + s.Fatalf("ERROR: supplier %s is not staked for service %s", supplierOperatorName, serviceId) } -func (s *suite) TheSessionForApplicationAndServiceContainsTheSupplier(appName string, serviceId string, supplierName string) { - expectedSupplier, ok := accNameToSupplierMap[supplierName] - require.True(s, ok, "supplier %s not found", supplierName) +func (s *suite) TheSessionForApplicationAndServiceContainsTheSupplier(appName string, serviceId string, supplierOperatorName string) { + expectedSupplier, ok := operatorAccNameToSupplierMap[supplierOperatorName] + require.True(s, ok, "supplier %s not found", supplierOperatorName) session := s.getSession(appName, serviceId) for _, supplier := range session.Suppliers { - if supplier.Address == expectedSupplier.Address { + if supplier.OperatorAddress == expectedSupplier.OperatorAddress { return } } - s.Fatalf("ERROR: session for app %s and service %s does not contain supplier %s", appName, serviceId, supplierName) + s.Fatalf("ERROR: session for app %s and service %s does not contain supplier %s", appName, serviceId, supplierOperatorName) } -func (s *suite) TheApplicationSendsTheSupplierASuccessfulRequestForServiceWithPathAndData(appName, supplierName, serviceId, path, requestData string) { +func (s *suite) TheApplicationSendsTheSupplierASuccessfulRequestForServiceWithPathAndData(appName, supplierOperatorName, serviceId, path, requestData string) { // TODO_HACK: We need to support a non self_signing LocalNet AppGateServer // that allows any application to send a relay in LocalNet and our E2E Tests. require.Equal(s, "app1", appName, "TODO_HACK: The LocalNet AppGateServer is self_signing and only supports app1.") res, err := s.pocketd.RunCurlWithRetry(appGateServerUrl, serviceId, path, requestData, 5) - require.NoError(s, err, "error sending relay request from app %q to supplier %q for service %q", appName, supplierName, serviceId) + require.NoError(s, err, "error sending relay request from app %q to supplier %q for service %q", appName, supplierOperatorName, serviceId) var jsonContent json.RawMessage err = json.Unmarshal([]byte(res.Stdout), &jsonContent) @@ -481,18 +481,18 @@ func (s *suite) AModuleEndBlockEventIsBroadcast(module, eventType string) { s.waitForNewBlockEvent(newEventTypeMatchFn(module, eventType)) } -func (s *suite) TheSupplierForAccountIsUnbonding(accName string) { - _, ok := accNameToSupplierMap[accName] - require.True(s, ok, "supplier %s not found", accName) +func (s *suite) TheSupplierForAccountIsUnbonding(supplierOperatorName string) { + _, ok := operatorAccNameToSupplierMap[supplierOperatorName] + require.True(s, ok, "supplier %s not found", supplierOperatorName) s.waitForTxResultEvent(newEventMsgTypeMatchFn("supplier", "UnstakeSupplier")) - supplier := s.getSupplierInfo(accName) + supplier := s.getSupplierInfo(supplierOperatorName) require.True(s, supplier.IsUnbonding()) } func (s *suite) TheUserWaitsForUnbondingPeriodToFinish(accName string) { - _, ok := accNameToSupplierMap[accName] + _, ok := operatorAccNameToSupplierMap[accName] require.True(s, ok, "supplier %s not found", accName) unbondingHeight := s.getSupplierUnbondingHeight(accName) @@ -528,29 +528,29 @@ func (s *suite) getStakedAmount(actorType, accName string) (int, bool) { return 0, false } -func (s *suite) TheUserShouldSeeThatTheSupplierForAccountIsStaked(supplierName string) { - supplier := s.getSupplierInfo(supplierName) - accNameToSupplierMap[accAddrToNameMap[supplier.Address]] = *supplier - require.NotNil(s, supplier, "supplier %s not found", supplierName) +func (s *suite) TheUserShouldSeeThatTheSupplierForAccountIsStaked(supplierOperatorName string) { + supplier := s.getSupplierInfo(supplierOperatorName) + operatorAccNameToSupplierMap[accAddrToNameMap[supplier.OperatorAddress]] = *supplier + require.NotNil(s, supplier, "supplier %s not found", supplierOperatorName) } -func (s *suite) TheSessionForApplicationAndServiceDoesNotContain(appName, serviceId, supplierName string) { +func (s *suite) TheSessionForApplicationAndServiceDoesNotContain(appName, serviceId, supplierOperatorName string) { session := s.getSession(appName, serviceId) for _, supplier := range session.Suppliers { - if supplier.Address == accNameToAddrMap[supplierName] { + if supplier.OperatorAddress == accNameToAddrMap[supplierOperatorName] { s.Fatalf( "ERROR: session for app %s and service %s should not contain supplier %s", appName, serviceId, - supplierName, + supplierOperatorName, ) } } } -func (s *suite) TheUserWaitsForSupplierToBecomeActiveForService(supplierName, serviceId string) { - supplier := s.getSupplierInfo(supplierName) +func (s *suite) TheUserWaitsForSupplierToBecomeActiveForService(supplierOperatorName, serviceId string) { + supplier := s.getSupplierInfo(supplierOperatorName) s.waitForBlockHeight(int64(supplier.ServicesActivationHeightsMap[serviceId])) } @@ -604,7 +604,7 @@ func (s *suite) buildSupplierMap() { responseBz := []byte(strings.TrimSpace(res.Stdout)) s.cdc.MustUnmarshalJSON(responseBz, &resp) for _, supplier := range resp.Supplier { - accNameToSupplierMap[accAddrToNameMap[supplier.Address]] = supplier + operatorAccNameToSupplierMap[accAddrToNameMap[supplier.OperatorAddress]] = supplier } } @@ -672,19 +672,19 @@ func (s *suite) validateAmountChange(prevAmount, currAmount int, expectedAmountC } -// getSupplierInfo returns the supplier information for a given supplier address -func (s *suite) getSupplierInfo(supplierName string) *sharedtypes.Supplier { - supplierAddr := accNameToAddrMap[supplierName] +// getSupplierInfo returns the supplier information for a given supplier operator address +func (s *suite) getSupplierInfo(supplierOperatorName string) *sharedtypes.Supplier { + supplierOperatorAddr := accNameToAddrMap[supplierOperatorName] args := []string{ "query", "supplier", "show-supplier", - supplierAddr, + supplierOperatorAddr, "--output=json", } res, err := s.pocketd.RunCommandOnHostWithRetry("", numQueryRetries, args...) - require.NoError(s, err, "error getting supplier %s", supplierAddr) + require.NoError(s, err, "error getting supplier %s", supplierOperatorAddr) s.pocketd.result = res var resp suppliertypes.QueryGetSupplierResponse diff --git a/e2e/tests/session_steps_test.go b/e2e/tests/session_steps_test.go index db849e315..297ab73ed 100644 --- a/e2e/tests/session_steps_test.go +++ b/e2e/tests/session_steps_test.go @@ -60,12 +60,12 @@ func (s *suite) TheUserShouldWaitForTheModuleEndBlockEventToBeBroadcast(module, // TODO_FLAKY: See how 'TheClaimCreatedBySupplierForServiceForApplicationShouldBeSuccessfullySettled' // was modified to using an event replay client, instead of a query, to eliminate the flakiness. -func (s *suite) TheClaimCreatedBySupplierForServiceForApplicationShouldBePersistedOnchain(supplierName, serviceId, appName string) { +func (s *suite) TheClaimCreatedBySupplierForServiceForApplicationShouldBePersistedOnchain(supplierOperatorName, serviceId, appName string) { ctx := context.Background() allClaimsRes, err := s.proofQueryClient.AllClaims(ctx, &prooftypes.QueryAllClaimsRequest{ - Filter: &prooftypes.QueryAllClaimsRequest_SupplierAddress{ - SupplierAddress: accNameToAddrMap[supplierName], + Filter: &prooftypes.QueryAllClaimsRequest_SupplierOperatorAddress{ + SupplierOperatorAddress: accNameToAddrMap[supplierOperatorName], }, }) require.NoError(s, err) @@ -89,10 +89,10 @@ func (s *suite) TheClaimCreatedBySupplierForServiceForApplicationShouldBePersist // them into the scenarioState key(s). claim := allClaimsRes.Claims[0] - require.Equal(s, accNameToAddrMap[supplierName], claim.SupplierAddress) + require.Equal(s, accNameToAddrMap[supplierOperatorName], claim.SupplierOperatorAddress) } -func (s *suite) TheSupplierHasServicedASessionWithRelaysForServiceForApplication(supplierName, numRelaysStr, serviceId, appName string) { +func (s *suite) TheSupplierHasServicedASessionWithRelaysForServiceForApplication(supplierOperatorName, numRelaysStr, serviceId, appName string) { ctx := context.Background() numRelays, err := strconv.Atoi(numRelaysStr) @@ -113,18 +113,18 @@ func (s *suite) TheSupplierHasServicedASessionWithRelaysForServiceForApplication // Send relays for the session. s.sendRelaysForSession( appName, - supplierName, + supplierOperatorName, testServiceId, numRelays, ) } -func (s *suite) TheClaimCreatedBySupplierForServiceForApplicationShouldBeSuccessfullySettled(supplierName, serviceId, appName string) { +func (s *suite) TheClaimCreatedBySupplierForServiceForApplicationShouldBeSuccessfullySettled(supplierOperatorName, serviceId, appName string) { app, ok := accNameToAppMap[appName] require.True(s, ok, "application %s not found", appName) - supplier, ok := accNameToSupplierMap[supplierName] - require.True(s, ok, "supplier %s not found", supplierName) + supplier, ok := operatorAccNameToSupplierMap[supplierOperatorName] + require.True(s, ok, "supplier %s not found", supplierOperatorName) isValidClaimSettledEvent := func(event *abci.Event) bool { if event.Type != "poktroll.tokenomics.EventClaimSettled" { @@ -142,7 +142,7 @@ func (s *suite) TheClaimCreatedBySupplierForServiceForApplicationShouldBeSuccess // Assert that the claim was settled for the correct application, supplier, and service. claim := claimSettledEvent.Claim require.Equal(s, app.Address, claim.SessionHeader.ApplicationAddress) - require.Equal(s, supplier.Address, claim.SupplierAddress) + require.Equal(s, supplier.OperatorAddress, claim.SupplierOperatorAddress) require.Equal(s, serviceId, claim.SessionHeader.Service.Id) require.Greater(s, claimSettledEvent.NumComputeUnits, uint64(0), "compute units should be greater than 0") return true @@ -153,13 +153,13 @@ func (s *suite) TheClaimCreatedBySupplierForServiceForApplicationShouldBeSuccess func (s *suite) sendRelaysForSession( appName string, - supplierName string, + supplierOperatorName string, serviceId string, relayLimit int, ) { s.TheApplicationIsStakedForService(appName, serviceId) - s.TheSupplierIsStakedForService(supplierName, serviceId) - s.TheSessionForApplicationAndServiceContainsTheSupplier(appName, serviceId, supplierName) + s.TheSupplierIsStakedForService(supplierOperatorName, serviceId) + s.TheSessionForApplicationAndServiceContainsTheSupplier(appName, serviceId, supplierOperatorName) // TODO_IMPROVE: hard-code a default set of RPC calls to iterate over for coverage. payload_fmt := `{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":%d}` @@ -167,7 +167,7 @@ func (s *suite) sendRelaysForSession( for i := 0; i < relayLimit; i++ { payload := fmt.Sprintf(payload_fmt, i+1) // i+1 to avoid id=0 which is invalid - s.TheApplicationSendsTheSupplierASuccessfulRequestForServiceWithPathAndData(appName, supplierName, serviceId, defaultJSONPRCPath, payload) + s.TheApplicationSendsTheSupplierASuccessfulRequestForServiceWithPathAndData(appName, supplierOperatorName, serviceId, defaultJSONPRCPath, payload) time.Sleep(10 * time.Millisecond) } } diff --git a/go.mod b/go.mod index 69ce37df6..e4c0f4080 100644 --- a/go.mod +++ b/go.mod @@ -56,7 +56,7 @@ require ( // This is creating a circular dependency whereby exporting the protobufs into a separate // repo is the first obvious idea, but has to be carefully considered, automated, and is not // a hard blocker. - github.com/pokt-network/shannon-sdk v0.0.0-20240628223057-7d2928722749 + github.com/pokt-network/shannon-sdk v0.0.0-20240806142441-c21a52c209b5 github.com/pokt-network/smt v0.12.0 github.com/pokt-network/smt/kvstore/badger v0.0.0-20240109205447-868237978c0b github.com/prometheus/client_golang v1.19.0 diff --git a/go.sum b/go.sum index fa3214946..fe11eb4c6 100644 --- a/go.sum +++ b/go.sum @@ -994,8 +994,8 @@ github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRI github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pokt-network/ring-go v0.1.0 h1:hF7mDR4VVCIqqDAsrloP8azM9y1mprc99YgnTjKSSwk= github.com/pokt-network/ring-go v0.1.0/go.mod h1:8NHPH7H3EwrPX3XHfpyRI6bz4gApkE3+fd0XZRbMWP0= -github.com/pokt-network/shannon-sdk v0.0.0-20240628223057-7d2928722749 h1:V/3xzmykSABhAxRZLawWUoIPVlnp7EGCnCxFpLXD7R0= -github.com/pokt-network/shannon-sdk v0.0.0-20240628223057-7d2928722749/go.mod h1:MfoRhzPRlxiaY3xQyZo28B7ibDuhricA//TGGy48TwM= +github.com/pokt-network/shannon-sdk v0.0.0-20240806142441-c21a52c209b5 h1:NoFeAk4y3pp+MvGyhaaRz3j8swJ5dmyQVVOXCTlkG/s= +github.com/pokt-network/shannon-sdk v0.0.0-20240806142441-c21a52c209b5/go.mod h1:1mvr4H75w3UgGwCH1B7fCHpGfwZFbsVFaohHd2vRSEU= github.com/pokt-network/smt v0.12.0 h1:uqru/0ykC4LnBoMacakobNOd1iRK69PlohqjMtLmYNA= github.com/pokt-network/smt v0.12.0/go.mod h1:S4Ho4OPkK2v2vUCHNtA49XDjqUC/OFYpBbynRVYmxvA= github.com/pokt-network/smt/kvstore/badger v0.0.0-20240109205447-868237978c0b h1:TjfgV3vgW0zW47Br/OgUXD4M8iyR74EYanbFfN4ed8o= diff --git a/load-testing/config/load_test_manifest_reader.go b/load-testing/config/load_test_manifest_reader.go index 3e1a1f1d5..db20b21fc 100644 --- a/load-testing/config/load_test_manifest_reader.go +++ b/load-testing/config/load_test_manifest_reader.go @@ -83,7 +83,7 @@ func validatedEphemeralChainManifest(manifest *LoadTestManifestYAML) (*LoadTestM for _, supplier := range manifest.Suppliers { if len(supplier.Address) == 0 { - return nil, ErrEphemeralChainLoadTestInvalidManifest.Wrap("empty supplier address") + return nil, ErrEphemeralChainLoadTestInvalidManifest.Wrap("empty supplier operator address") } if len(supplier.ExposedUrl) == 0 { diff --git a/load-testing/loadtest_manifest_localnet.yaml b/load-testing/loadtest_manifest_localnet.yaml index e75e55bf0..f8216e408 100644 --- a/load-testing/loadtest_manifest_localnet.yaml +++ b/load-testing/loadtest_manifest_localnet.yaml @@ -17,10 +17,10 @@ funding_account_address: pokt1eeeksh2tvkh7wzmfrljnhw4wrhs55lcuvmekkw # address f # When running on **LocalNet**, the number of the suppliers defined below should match # the `relayminers.count` in your `localnet_config.yaml`. suppliers: - # The supplier address that is available in the load test's environment keyring, - # used to identify the supplier and sign relays and transactions with. - # It must be the address corresponding to the provided signing_key_name in the - # `relay_miner_config.yaml` file. + # The supplier operator address that is available in the load test's environment + # keyring, used to identify the supplier and sign relays and transactions with. + # It must be the operator address corresponding to the provided signing_key_name + # in the `relay_miner_config.yaml` file. # RelayMiner 1; http://localhost:10350/r/relayminer1/overview - address: pokt19a3t4yunp0dlpfjrp7qwnzwlrzd5fzs2gjaaaj diff --git a/load-testing/tests/relays_stress_helpers_test.go b/load-testing/tests/relays_stress_helpers_test.go index 37f2e5254..7aef74565 100644 --- a/load-testing/tests/relays_stress_helpers_test.go +++ b/load-testing/tests/relays_stress_helpers_test.go @@ -120,7 +120,7 @@ func (s *relaysSuite) initFundingAccount(fundingAccountAddress string) { } // initializeLoadTestParams parses the load test manifest and initializes the -// gateway and supplier addresses and the URLs used to send requests to. +// gateway and supplier operator addresses and the URLs used to send requests to. func (s *relaysSuite) initializeLoadTestParams() *config.LoadTestManifestYAML { workingDirectory, err := os.Getwd() require.NoError(s, err) @@ -141,7 +141,7 @@ func (s *relaysSuite) initializeLoadTestParams() *config.LoadTestManifestYAML { for _, supplier := range loadTestManifest.Suppliers { s.suppliersUrls[supplier.Address] = supplier.ExposedUrl - s.availableSupplierAddresses = append(s.availableSupplierAddresses, supplier.Address) + s.availableSupplierOperatorAddresses = append(s.availableSupplierOperatorAddresses, supplier.Address) } return loadTestManifest @@ -517,12 +517,12 @@ func (s *relaysSuite) sendFundAvailableActorsTx() (suppliers, gateways, applicat // Fund accounts for **all** suppliers that will be used over the duration of the test. suppliersAdded := int64(0) - for _, supplierAddress := range s.availableSupplierAddresses { + for _, supplierOperatorAddress := range s.availableSupplierOperatorAddresses { if suppliersAdded >= s.plans.suppliers.maxActorCount { break } - supplier := s.addActor(supplierAddress, supplierStakeAmount) + supplier := s.addActor(supplierOperatorAddress, supplierStakeAmount) // Add a bank.MsgSend message to fund the supplier. s.addPendingFundMsg(supplier.address, sdk.NewCoins(supplierStakeAmount)) @@ -781,13 +781,15 @@ func (s *relaysSuite) addActor(actorAddress string, actorStakeAmount sdk.Coin) * // addPendingStakeSupplierMsg generates a MsgStakeSupplier message to stake a given // supplier then appends it to the suppliers account's pending messages. +// The supplier is staked with custodial mode (i.e. the supplier owner is the same +// as the operator address). // No transaction is sent to give flexibility to the caller to group multiple // messages in a single supplier transaction. func (s *relaysSuite) addPendingStakeSupplierMsg(supplier *accountInfo) { supplier.addPendingMsg(suppliertypes.NewMsgStakeSupplier( - supplier.address, - supplier.address, - supplier.address, + supplier.address, // The message signer. + supplier.address, // The supplier owner. + supplier.address, // The supplier operator. supplier.amountToStake, []*sharedtypes.SupplierServiceConfig{ { @@ -830,8 +832,8 @@ func (s *relaysSuite) sendStakeSuppliersTxs( ) for supplierIdx := int64(0); supplierIdx < suppliersToStake; supplierIdx++ { - supplierAddress := s.availableSupplierAddresses[supplierCount+supplierIdx] - supplier := s.addActor(supplierAddress, supplierStakeAmount) + supplierOperatorAddress := s.availableSupplierOperatorAddresses[supplierCount+supplierIdx] + supplier := s.addActor(supplierOperatorAddress, supplierStakeAmount) s.addPendingStakeSupplierMsg(supplier) s.sendPendingMsgsTx(supplier) newSuppliers = append(newSuppliers, supplier) diff --git a/load-testing/tests/relays_stress_test.go b/load-testing/tests/relays_stress_test.go index 2b979021a..944f81707 100644 --- a/load-testing/tests/relays_stress_test.go +++ b/load-testing/tests/relays_stress_test.go @@ -180,7 +180,7 @@ type relaysSuite struct { // in the test. It is populated from the gatewayUrls map. // It is used to ensure that the gateways are staked in the order they are provisioned. availableGatewayAddresses []string - // suppliersUrls is a map of supplierAddress->URL representing the provisioned suppliers. + // suppliersUrls is a map of supplierOperatorAddress->URL representing the provisioned suppliers. // These suppliers are not staked yet but have their off-chain instance running // and ready to be staked and used in the test. // Since RelayMiners are pre-provisioned, and already assigned a signingAddress @@ -188,10 +188,11 @@ type relaysSuite struct { // The max suppliers used in the test must be less than or equal to the number of // provisioned suppliers. suppliersUrls map[string]string - // availableSupplierAddresses is the list of available supplier addresses to be used + // availableSupplierOperatorAddresses is the list of available supplier operator addresses to be used // in the test. It is populated from the suppliersUrls map. // It is used to ensure that the suppliers are staked in the order they are provisioned. - availableSupplierAddresses []string + // The same address is used as the owner and the operator address (i.e. custodial staking). + availableSupplierOperatorAddresses []string // fundingAccountInfo is the account entry corresponding to the fundingAccountKeyName. // It is used to send transactions to fund other accounts. diff --git a/localnet/poktrolld/config/relayminer_config_full_example.yaml b/localnet/poktrolld/config/relayminer_config_full_example.yaml index 71af84f27..7196024fd 100644 --- a/localnet/poktrolld/config/relayminer_config_full_example.yaml +++ b/localnet/poktrolld/config/relayminer_config_full_example.yaml @@ -1,4 +1,5 @@ # Names of the key (in the keyring) used to run the suppliers for. +# These keys must correspond to the operator addresses of the suppliers. default_signing_key_names: [supplier1] # Relative path (on the relayminer's machine) to the SMT KV store data on disk. diff --git a/pkg/client/interface.go b/pkg/client/interface.go index a5cec3ae8..6f61ea9c9 100644 --- a/pkg/client/interface.go +++ b/pkg/client/interface.go @@ -39,7 +39,7 @@ type MsgCreateClaim interface { cosmostypes.Msg GetRootHash() []byte GetSessionHeader() *sessiontypes.SessionHeader - GetSupplierAddress() string + GetSupplierOperatorAddress() string } // MsgSubmitProof is an interface satisfying proof.MsgSubmitProof concrete type @@ -48,7 +48,7 @@ type MsgSubmitProof interface { cosmostypes.Msg GetProof() []byte GetSessionHeader() *sessiontypes.SessionHeader - GetSupplierAddress() string + GetSupplierOperatorAddress() string } // SupplierClient is an interface for sufficient for a supplier operator to be @@ -71,8 +71,8 @@ type SupplierClient interface { ctx context.Context, sessionProofs ...MsgSubmitProof, ) error - // Address returns the address of the SupplierClient that will be submitting proofs & claims. - Address() *cosmostypes.AccAddress + // Address returns the operator address of the SupplierClient that will be submitting proofs & claims. + OperatorAddress() *cosmostypes.AccAddress } // TxClient provides a synchronous interface initiating and waiting for transactions @@ -285,7 +285,7 @@ type ApplicationQueryClient interface { // on-chain supplier information type SupplierQueryClient interface { // GetSupplier queries the chain for the details of the supplier provided - GetSupplier(ctx context.Context, supplierAddress string) (sharedtypes.Supplier, error) + GetSupplier(ctx context.Context, supplierOperatorAddress string) (sharedtypes.Supplier, error) } // SessionQueryClient defines an interface that enables the querying of the @@ -315,13 +315,13 @@ type SharedQueryClient interface { GetClaimWindowOpenHeight(ctx context.Context, queryHeight int64) (int64, error) // GetEarliestSupplierClaimCommitHeight returns the earliest block height at which a claim // for the session that includes queryHeight can be committed for a given supplier. - GetEarliestSupplierClaimCommitHeight(ctx context.Context, queryHeight int64, supplierAddr string) (int64, error) + GetEarliestSupplierClaimCommitHeight(ctx context.Context, queryHeight int64, supplierOperatorAddr string) (int64, error) // GetProofWindowOpenHeight returns the block height at which the proof window of // the session that includes queryHeight opens. GetProofWindowOpenHeight(ctx context.Context, queryHeight int64) (int64, error) // GetEarliestSupplierProofCommitHeight returns the earliest block height at which a proof // for the session that includes queryHeight can be committed for a given supplier. - GetEarliestSupplierProofCommitHeight(ctx context.Context, queryHeight int64, supplierAddr string) (int64, error) + GetEarliestSupplierProofCommitHeight(ctx context.Context, queryHeight int64, supplierOperatorAddr string) (int64, error) } // BlockQueryClient defines an interface that enables the querying of diff --git a/pkg/client/query/sharedquerier.go b/pkg/client/query/sharedquerier.go index f9de306a5..e3fa78d87 100644 --- a/pkg/client/query/sharedquerier.go +++ b/pkg/client/query/sharedquerier.go @@ -119,7 +119,7 @@ func (sq *sharedQuerier) GetSessionGracePeriodEndHeight( // to get the most recently (asynchronously) observed (and cached) value. // TODO_BLOCKER(@bryanchriswhite, #543): We also don't really want to use the current value of the params. // Instead, we should be using the value that the params had for the session which includes queryHeight. -func (sq *sharedQuerier) GetEarliestSupplierClaimCommitHeight(ctx context.Context, queryHeight int64, supplierAddr string) (int64, error) { +func (sq *sharedQuerier) GetEarliestSupplierClaimCommitHeight(ctx context.Context, queryHeight int64, supplierOperatorAddr string) (int64, error) { sharedParams, err := sq.GetParams(ctx) if err != nil { return 0, err @@ -140,7 +140,7 @@ func (sq *sharedQuerier) GetEarliestSupplierClaimCommitHeight(ctx context.Contex sharedParams, queryHeight, claimWindowOpenBlockHash, - supplierAddr, + supplierOperatorAddr, ), nil } @@ -152,7 +152,7 @@ func (sq *sharedQuerier) GetEarliestSupplierClaimCommitHeight(ctx context.Contex // to get the most recently (asynchronously) observed (and cached) value. // TODO_BLOCKER(@bryanchriswhite, #543): We also don't really want to use the current value of the params. // Instead, we should be using the value that the params had for the session which includes queryHeight. -func (sq *sharedQuerier) GetEarliestSupplierProofCommitHeight(ctx context.Context, queryHeight int64, supplierAddr string) (int64, error) { +func (sq *sharedQuerier) GetEarliestSupplierProofCommitHeight(ctx context.Context, queryHeight int64, supplierOperatorAddr string) (int64, error) { sharedParams, err := sq.GetParams(ctx) if err != nil { return 0, err @@ -170,6 +170,6 @@ func (sq *sharedQuerier) GetEarliestSupplierProofCommitHeight(ctx context.Contex sharedParams, queryHeight, proofWindowOpenBlock.BlockID.Hash, - supplierAddr, + supplierOperatorAddr, ), nil } diff --git a/pkg/client/query/supplierquerier.go b/pkg/client/query/supplierquerier.go index c622ad9e5..040a4303f 100644 --- a/pkg/client/query/supplierquerier.go +++ b/pkg/client/query/supplierquerier.go @@ -42,14 +42,14 @@ func NewSupplierQuerier(deps depinject.Config) (client.SupplierQueryClient, erro // GetSupplier returns an suppliertypes.Supplier struct for a given address func (supq *supplierQuerier) GetSupplier( ctx context.Context, - address string, + operatorAddress string, ) (sharedtypes.Supplier, error) { - req := &suppliertypes.QueryGetSupplierRequest{Address: address} + req := &suppliertypes.QueryGetSupplierRequest{OperatorAddress: operatorAddress} res, err := supq.supplierQuerier.Supplier(ctx, req) if err != nil { return sharedtypes.Supplier{}, suppliertypes.ErrSupplierNotFound.Wrapf( "address: %s [%v]", - address, err, + operatorAddress, err, ) } return res.Supplier, nil diff --git a/pkg/client/supplier/client.go b/pkg/client/supplier/client.go index 089605894..4e15bb648 100644 --- a/pkg/client/supplier/client.go +++ b/pkg/client/supplier/client.go @@ -17,7 +17,10 @@ var _ client.SupplierClient = (*supplierClient)(nil) // supplierClient type supplierClient struct { + // signingKeyName is the name of the operator key in the keyring that will be + // used to sign transactions. signingKeyName string + // signingKeyAddr is the account address of the operator key in the keyring. signingKeyAddr cosmostypes.AccAddress // pendingTxMu is used to prevent concurrent txs with the same sequence number. @@ -94,10 +97,10 @@ func (sClient *supplierClient) SubmitProofs( // TODO_IMPROVE: log details related to what & how much is being proven logger.Info(). Fields(map[string]any{ - "supplier_addr": proofMsg.SupplierAddress, - "app_addr": sessionHeader.ApplicationAddress, - "session_id": sessionHeader.SessionId, - "service": sessionHeader.Service.Id, + "supplier_operator_addr": proofMsg.SupplierOperatorAddress, + "app_addr": sessionHeader.ApplicationAddress, + "session_id": sessionHeader.SessionId, + "service": sessionHeader.Service.Id, }). Msg("submitted a new proof") } @@ -140,10 +143,10 @@ func (sClient *supplierClient) CreateClaims( // TODO_IMPROVE: log details related to how much is claimed logger.Info(). Fields(map[string]any{ - "supplier_addr": claimMsg.SupplierAddress, - "app_addr": sessionHeader.ApplicationAddress, - "session_id": sessionHeader.SessionId, - "service": sessionHeader.Service.Id, + "supplier_operator_addr": claimMsg.SupplierOperatorAddress, + "app_addr": sessionHeader.ApplicationAddress, + "session_id": sessionHeader.SessionId, + "service": sessionHeader.Service.Id, }). Msg("created a new claim") } @@ -152,7 +155,7 @@ func (sClient *supplierClient) CreateClaims( } // Address returns an address of the supplier client. -func (sClient *supplierClient) Address() *cosmostypes.AccAddress { +func (sClient *supplierClient) OperatorAddress() *cosmostypes.AccAddress { return &sClient.signingKeyAddr } diff --git a/pkg/client/supplier/options.go b/pkg/client/supplier/options.go index 424cf7420..00bda79fa 100644 --- a/pkg/client/supplier/options.go +++ b/pkg/client/supplier/options.go @@ -2,9 +2,9 @@ package supplier import "github.com/pokt-network/poktroll/pkg/client" -// WithSigningKeyName sets the name of the key which the supplier client should -// retrieve from the keyring to use for authoring and signing CreateClaim and -// SubmitProof messages. +// WithSigningKeyName sets the name of the operator key which the supplier +// client should retrieve from the keyring to use for authoring and signing +// CreateClaim and SubmitProof messages. func WithSigningKeyName(keyName string) client.SupplierClientOption { return func(sClient client.SupplierClient) { sClient.(*supplierClient).signingKeyName = keyName diff --git a/pkg/client/supplier/types.go b/pkg/client/supplier/types.go index 44cdd102f..996895dc9 100644 --- a/pkg/client/supplier/types.go +++ b/pkg/client/supplier/types.go @@ -3,7 +3,7 @@ package supplier import "github.com/pokt-network/poktroll/pkg/client" // SupplierClientMap is a helper struct needed to depinject multiple supplier clients. -// The inner structure maps a supplier address to a list of supplier clients for that address. +// The inner structure maps a supplier operator address to a list of supplier clients for that address. // Must be a type to successfully work with depinject. type SupplierClientMap struct { SupplierClients map[string]client.SupplierClient diff --git a/pkg/deps/config/suppliers.go b/pkg/deps/config/suppliers.go index b00b7f54e..267575d13 100644 --- a/pkg/deps/config/suppliers.go +++ b/pkg/deps/config/suppliers.go @@ -382,6 +382,8 @@ func NewSupplyShannonSDKFn(signingKeyName string) SupplierFn { // NewSupplySupplierClientsFn returns a function which constructs a // SupplierClientMap and returns a new depinject.Config which is // supplied with the given deps and the new SupplierClientMap. +// - signingKeyNames is a list of operators signing key name corresponding to +// the staked suppliers operator addresess. func NewSupplySupplierClientsFn(signingKeyNames []string) SupplierFn { return func( ctx context.Context, @@ -404,7 +406,7 @@ func NewSupplySupplierClientsFn(signingKeyNames []string) SupplierFn { } // Making sure we use addresses as keys. - suppliers.SupplierClients[supplierClient.Address().String()] = supplierClient + suppliers.SupplierClients[supplierClient.OperatorAddress().String()] = supplierClient } return depinject.Configs(deps, depinject.Supply(suppliers)), nil } diff --git a/pkg/relayer/cmd/cmd.go b/pkg/relayer/cmd/cmd.go index 1f1fdd185..2989cfd4c 100644 --- a/pkg/relayer/cmd/cmd.go +++ b/pkg/relayer/cmd/cmd.go @@ -308,7 +308,7 @@ func newSupplyRelayerSessionsManagerFn(smtStorePath string) config.SupplierFn { } // uniqueSigningKeyNames goes through RelayMiner configuration and returns a list of unique -// singning key names. +// operators singning key names. func uniqueSigningKeyNames(relayMinerConfig *relayerconfig.RelayMinerConfig) []string { uniqueKeyMap := make(map[string]bool) for _, server := range relayMinerConfig.Servers { diff --git a/pkg/relayer/config/relayminer_configs_reader_test.go b/pkg/relayer/config/relayminer_configs_reader_test.go index e7ba0c2b9..bcf2eda74 100644 --- a/pkg/relayer/config/relayminer_configs_reader_test.go +++ b/pkg/relayer/config/relayminer_configs_reader_test.go @@ -820,41 +820,41 @@ func Test_ParseRelayMinerConfigs(t *testing.T) { config.Servers[listenAddress].ServerType, ) - for supplierName, supplier := range server.SupplierConfigsMap { + for supplierOperatorName, supplier := range server.SupplierConfigsMap { require.Equal( t, supplier.ServiceId, - config.Servers[listenAddress].SupplierConfigsMap[supplierName].ServiceId, + config.Servers[listenAddress].SupplierConfigsMap[supplierOperatorName].ServiceId, ) require.Equal( t, supplier.ServerType, - config.Servers[listenAddress].SupplierConfigsMap[supplierName].ServerType, + config.Servers[listenAddress].SupplierConfigsMap[supplierOperatorName].ServerType, ) require.Equal( t, supplier.ServiceConfig.BackendUrl.String(), - config.Servers[listenAddress].SupplierConfigsMap[supplierName].ServiceConfig.BackendUrl.String(), + config.Servers[listenAddress].SupplierConfigsMap[supplierOperatorName].ServiceConfig.BackendUrl.String(), ) if supplier.ServiceConfig.Authentication != nil { require.NotNil( t, - config.Servers[listenAddress].SupplierConfigsMap[supplierName].ServiceConfig.Authentication, + config.Servers[listenAddress].SupplierConfigsMap[supplierOperatorName].ServiceConfig.Authentication, ) require.Equal( t, supplier.ServiceConfig.Authentication.Username, - config.Servers[listenAddress].SupplierConfigsMap[supplierName].ServiceConfig.Authentication.Username, + config.Servers[listenAddress].SupplierConfigsMap[supplierOperatorName].ServiceConfig.Authentication.Username, ) require.Equal( t, supplier.ServiceConfig.Authentication.Password, - config.Servers[listenAddress].SupplierConfigsMap[supplierName].ServiceConfig.Authentication.Password, + config.Servers[listenAddress].SupplierConfigsMap[supplierOperatorName].ServiceConfig.Authentication.Password, ) } @@ -862,7 +862,7 @@ func Test_ParseRelayMinerConfigs(t *testing.T) { require.Equal( t, headerValue, - config.Servers[listenAddress].SupplierConfigsMap[supplierName].ServiceConfig.Headers[headerKey], + config.Servers[listenAddress].SupplierConfigsMap[supplierOperatorName].ServiceConfig.Headers[headerKey], ) } @@ -870,7 +870,7 @@ func Test_ParseRelayMinerConfigs(t *testing.T) { require.Contains( t, host, - config.Servers[listenAddress].SupplierConfigsMap[supplierName].PubliclyExposedEndpoints[i], + config.Servers[listenAddress].SupplierConfigsMap[supplierOperatorName].PubliclyExposedEndpoints[i], ) } } diff --git a/pkg/relayer/config/suppliers_config_hydrator.go b/pkg/relayer/config/suppliers_config_hydrator.go index 3cb069331..e202436cb 100644 --- a/pkg/relayer/config/suppliers_config_hydrator.go +++ b/pkg/relayer/config/suppliers_config_hydrator.go @@ -29,7 +29,7 @@ func (relayMinerConfig *RelayMinerConfig) HydrateSuppliers( supplierConfig.SigningKeyNames = relayMinerConfig.DefaultSigningKeyNames } - // Supplier name should be unique + // Supplier operator name should be unique if _, ok := existingSuppliers[yamlSupplierConfig.ServiceId]; ok { return ErrRelayMinerConfigInvalidSupplier.Wrapf( "duplicate supplier name %s", diff --git a/pkg/relayer/interface.go b/pkg/relayer/interface.go index d9a7d38f7..866772d38 100644 --- a/pkg/relayer/interface.go +++ b/pkg/relayer/interface.go @@ -72,7 +72,7 @@ type RelayerProxy interface { // and append the signature to the RelayResponse. // TODO_TECHDEBT(@red-0ne): This method should be moved out of the RelayerProxy interface // that should not be responsible for signing relay responses. - SignRelayResponse(relayResponse *servicetypes.RelayResponse, supplierAddr string) error + SignRelayResponse(relayResponse *servicetypes.RelayResponse, supplierOperatorAddr string) error } type RelayerProxyOption func(RelayerProxy) @@ -157,6 +157,6 @@ type SessionTree interface { // It returns an error if it has already been marked as such. StartClaiming() error - // GetSupplierAddress returns the supplier address building this tree. - GetSupplierAddress() *cosmostypes.AccAddress + // GetSupplierOperatorAddress returns the supplier operator address building this tree. + GetSupplierOperatorAddress() *cosmostypes.AccAddress } diff --git a/pkg/relayer/proxy/errors.go b/pkg/relayer/proxy/errors.go index d3731903a..be2dbd95c 100644 --- a/pkg/relayer/proxy/errors.go +++ b/pkg/relayer/proxy/errors.go @@ -5,16 +5,16 @@ import ( ) var ( - codespace = "relayer_proxy" - ErrRelayerProxyUnsupportedRPCType = sdkerrors.Register(codespace, 1, "unsupported rpc type") - ErrRelayerProxyInvalidSession = sdkerrors.Register(codespace, 2, "invalid session in relayer request") - ErrRelayerProxyInvalidSupplier = sdkerrors.Register(codespace, 3, "supplier does not belong to session") - ErrRelayerProxyUndefinedSigningKeyNames = sdkerrors.Register(codespace, 4, "supplier signing key names are undefined") - ErrRelayerServicesConfigsUndefined = sdkerrors.Register(codespace, 5, "services configurations are undefined") - ErrRelayerProxyInvalidRelayRequest = sdkerrors.Register(codespace, 6, "invalid relay request") - ErrRelayerProxyInvalidRelayResponse = sdkerrors.Register(codespace, 7, "invalid relay response") - ErrRelayerProxyServiceEndpointNotHandled = sdkerrors.Register(codespace, 8, "service endpoint not handled by relayer proxy") - ErrRelayerProxyUnsupportedTransportType = sdkerrors.Register(codespace, 9, "unsupported proxy transport type") - ErrRelayerProxyInternalError = sdkerrors.Register(codespace, 10, "internal error") - ErrRelayerProxyMissingSupplierAddress = sdkerrors.Register(codespace, 11, "supplier address is missing") + codespace = "relayer_proxy" + ErrRelayerProxyUnsupportedRPCType = sdkerrors.Register(codespace, 1, "unsupported rpc type") + ErrRelayerProxyInvalidSession = sdkerrors.Register(codespace, 2, "invalid session in relayer request") + ErrRelayerProxyInvalidSupplier = sdkerrors.Register(codespace, 3, "supplier does not belong to session") + ErrRelayerProxyUndefinedSigningKeyNames = sdkerrors.Register(codespace, 4, "supplier signing key names are undefined") + ErrRelayerServicesConfigsUndefined = sdkerrors.Register(codespace, 5, "services configurations are undefined") + ErrRelayerProxyInvalidRelayRequest = sdkerrors.Register(codespace, 6, "invalid relay request") + ErrRelayerProxyInvalidRelayResponse = sdkerrors.Register(codespace, 7, "invalid relay response") + ErrRelayerProxyServiceEndpointNotHandled = sdkerrors.Register(codespace, 8, "service endpoint not handled by relayer proxy") + ErrRelayerProxyUnsupportedTransportType = sdkerrors.Register(codespace, 9, "unsupported proxy transport type") + ErrRelayerProxyInternalError = sdkerrors.Register(codespace, 10, "internal error") + ErrRelayerProxyMissingSupplierOperatorAddress = sdkerrors.Register(codespace, 11, "supplier operator address is missing") ) diff --git a/pkg/relayer/proxy/options.go b/pkg/relayer/proxy/options.go index c4d32a462..7dc5a4768 100644 --- a/pkg/relayer/proxy/options.go +++ b/pkg/relayer/proxy/options.go @@ -6,7 +6,7 @@ import ( ) // WithSigningKeyName sets the signing key name used by the relayer proxy to sign relay responses. -// It is used along with the keyring to get the supplier address and sign the relay responses. +// It is used along with the keyring to get the supplier operator address and sign the relay responses. func WithSigningKeyNames(keyNames []string) relayer.RelayerProxyOption { return func(relProxy relayer.RelayerProxy) { relProxy.(*relayerProxy).signingKeyNames = keyNames diff --git a/pkg/relayer/proxy/proxy.go b/pkg/relayer/proxy/proxy.go index ce54a70b9..4249e1dca 100644 --- a/pkg/relayer/proxy/proxy.go +++ b/pkg/relayer/proxy/proxy.go @@ -25,10 +25,12 @@ var _ relayer.RelayerProxy = (*relayerProxy)(nil) type relayerProxy struct { logger polylog.Logger - // signingKeyNames are the supplier key names in the Cosmos's keybase. - // They are used along with the keyring to get the supplier addresses and sign relay responses. - // A unique list of key names from all suppliers configured on RelayMiner is passed to relayerProxy, - // and the address for each signing key is looked up in `BuildProvidedServices`. + // signingKeyNames are the supplier operator key names in the Cosmos's keybase. + // They are used along with the keyring to get the supplier operator addresses + // and sign relay responses. + // A unique list of operator key names from all suppliers configured on RelayMiner + // is passed to relayerProxy, and the address for each signing key is looked up + // in `BuildProvidedServices`. signingKeyNames []string keyring keyring.Keyring @@ -70,11 +72,12 @@ type relayerProxy struct { // ringCache is used to obtain and store the ring for the application. ringCache crypto.RingCache - // AddressToSigningKeyNameMap is a map with a CosmoSDK address as a key, and the keyring signing key name as a value. + // OperatorAddressToSigningKeyNameMap is a map with a CosmoSDK address as a key, + // and the keyring signing key name as a value. // We use this map in: // 1. Relay verification to check if the incoming relay matches the supplier hosted by the relay miner; // 2. Relay signing to resolve which keyring key name to use for signing; - AddressToSigningKeyNameMap map[string]string + OperatorAddressToSigningKeyNameMap map[string]string } // NewRelayerProxy creates a new relayer proxy with the given dependencies or returns diff --git a/pkg/relayer/proxy/proxy_test.go b/pkg/relayer/proxy/proxy_test.go index e9f8409c3..b4481e8d8 100644 --- a/pkg/relayer/proxy/proxy_test.go +++ b/pkg/relayer/proxy/proxy_test.go @@ -33,7 +33,7 @@ const ( var ( // helpers used for tests that are initialized in init() - supplierKeyName string + supplierOperatorKeyName string // supplierEndpoints is the map of serviceName -> []SupplierEndpoint // where serviceName is the name of the service the supplier staked for @@ -57,7 +57,7 @@ var ( ) func init() { - supplierKeyName = "supplierKeyName" + supplierOperatorKeyName = "supplierKeyName" appPrivateKey = secp256k1.GenPrivKey() supplierEndpoints = map[string][]*sharedtypes.SupplierEndpoint{ @@ -94,7 +94,7 @@ func init() { ServiceConfig: &config.RelayMinerSupplierServiceConfig{ BackendUrl: &url.URL{Scheme: "http", Host: "127.0.0.1:8545", Path: "/"}, }, - SigningKeyNames: []string{supplierKeyName}, + SigningKeyNames: []string{supplierOperatorKeyName}, }, secondaryService: { ServiceId: secondaryService, @@ -103,7 +103,7 @@ func init() { ServiceConfig: &config.RelayMinerSupplierServiceConfig{ BackendUrl: &url.URL{Scheme: "http", Host: "127.0.0.1:8546", Path: "/"}, }, - SigningKeyNames: []string{supplierKeyName}, + SigningKeyNames: []string{supplierOperatorKeyName}, }, }, }, @@ -124,11 +124,11 @@ func init() { } defaultRelayerProxyBehavior = []func(*testproxy.TestBehavior){ - testproxy.WithRelayerProxyDependenciesForBlockHeight(supplierKeyName, blockHeight), + testproxy.WithRelayerProxyDependenciesForBlockHeight(supplierOperatorKeyName, blockHeight), testproxy.WithServicesConfigMap(servicesConfigMap), - testproxy.WithDefaultSupplier(supplierKeyName, supplierEndpoints), + testproxy.WithDefaultSupplier(supplierOperatorKeyName, supplierEndpoints), testproxy.WithDefaultApplication(appPrivateKey), - testproxy.WithDefaultSessionSupplier(supplierKeyName, defaultService, appPrivateKey), + testproxy.WithDefaultSessionSupplier(supplierOperatorKeyName, defaultService, appPrivateKey), } } @@ -142,7 +142,7 @@ func TestRelayerProxy_StartAndStop(t *testing.T) { // Create a RelayerProxy rp, err := proxy.NewRelayerProxy( test.Deps, - proxy.WithSigningKeyNames([]string{supplierKeyName}), + proxy.WithSigningKeyNames([]string{supplierOperatorKeyName}), proxy.WithServicesConfigMap(servicesConfigMap), ) require.NoError(t, err) @@ -168,7 +168,7 @@ func TestRelayerProxy_StartAndStop(t *testing.T) { } // RelayerProxy should fail to start if the signing key is not found in the keyring -func TestRelayerProxy_InvalidSupplierKeyName(t *testing.T) { +func TestRelayerProxy_InvalidSupplierOperatorKeyName(t *testing.T) { ctx, cancel := context.WithCancel(context.TODO()) defer cancel() test := testproxy.NewRelayerProxyTestBehavior(ctx, t, defaultRelayerProxyBehavior...) @@ -185,7 +185,7 @@ func TestRelayerProxy_InvalidSupplierKeyName(t *testing.T) { } // RelayerProxy should fail to build if the signing key name is not provided -func TestRelayerProxy_MissingSupplierKeyName(t *testing.T) { +func TestRelayerProxy_MissingSupplierOperatorKeyName(t *testing.T) { ctx, cancel := context.WithCancel(context.TODO()) defer cancel() test := testproxy.NewRelayerProxyTestBehavior(ctx, t, defaultRelayerProxyBehavior...) @@ -207,7 +207,7 @@ func TestRelayerProxy_EmptyServicesConfigMap(t *testing.T) { _, err := proxy.NewRelayerProxy( test.Deps, - proxy.WithSigningKeyNames([]string{supplierKeyName}), + proxy.WithSigningKeyNames([]string{supplierOperatorKeyName}), proxy.WithServicesConfigMap(make(map[string]*config.RelayMinerServerConfig)), ) require.Error(t, err) @@ -230,20 +230,20 @@ func TestRelayerProxy_UnsupportedRpcType(t *testing.T) { } unsupportedRPCTypeBehavior := []func(*testproxy.TestBehavior){ - testproxy.WithRelayerProxyDependenciesForBlockHeight(supplierKeyName, blockHeight), + testproxy.WithRelayerProxyDependenciesForBlockHeight(supplierOperatorKeyName, blockHeight), testproxy.WithServicesConfigMap(servicesConfigMap), // The supplier is staked on-chain but the service it provides is not supported by the proxy - testproxy.WithDefaultSupplier(supplierKeyName, unsupportedSupplierEndpoint), + testproxy.WithDefaultSupplier(supplierOperatorKeyName, unsupportedSupplierEndpoint), testproxy.WithDefaultApplication(appPrivateKey), - testproxy.WithDefaultSessionSupplier(supplierKeyName, defaultService, appPrivateKey), + testproxy.WithDefaultSessionSupplier(supplierOperatorKeyName, defaultService, appPrivateKey), } test := testproxy.NewRelayerProxyTestBehavior(ctx, t, unsupportedRPCTypeBehavior...) rp, err := proxy.NewRelayerProxy( test.Deps, - proxy.WithSigningKeyNames([]string{supplierKeyName}), + proxy.WithSigningKeyNames([]string{supplierOperatorKeyName}), proxy.WithServicesConfigMap(servicesConfigMap), ) require.NoError(t, err) @@ -285,20 +285,20 @@ func TestRelayerProxy_UnsupportedTransportType(t *testing.T) { } unsupportedTransportTypeBehavior := []func(*testproxy.TestBehavior){ - testproxy.WithRelayerProxyDependenciesForBlockHeight(supplierKeyName, blockHeight), + testproxy.WithRelayerProxyDependenciesForBlockHeight(supplierOperatorKeyName, blockHeight), // The proxy is configured with an unsupported transport type for the proxy testproxy.WithServicesConfigMap(unsupportedTransportProxy), - testproxy.WithDefaultSupplier(supplierKeyName, badTransportSupplierEndpoints), + testproxy.WithDefaultSupplier(supplierOperatorKeyName, badTransportSupplierEndpoints), testproxy.WithDefaultApplication(appPrivateKey), - testproxy.WithDefaultSessionSupplier(supplierKeyName, defaultService, appPrivateKey), + testproxy.WithDefaultSessionSupplier(supplierOperatorKeyName, defaultService, appPrivateKey), } test := testproxy.NewRelayerProxyTestBehavior(ctx, t, unsupportedTransportTypeBehavior...) rp, err := proxy.NewRelayerProxy( test.Deps, - proxy.WithSigningKeyNames([]string{supplierKeyName}), + proxy.WithSigningKeyNames([]string{supplierOperatorKeyName}), proxy.WithServicesConfigMap(unsupportedTransportProxy), ) require.NoError(t, err) @@ -329,20 +329,20 @@ func TestRelayerProxy_NonConfiguredSupplierServices(t *testing.T) { } unsupportedTransportTypeBehavior := []func(*testproxy.TestBehavior){ - testproxy.WithRelayerProxyDependenciesForBlockHeight(supplierKeyName, blockHeight), + testproxy.WithRelayerProxyDependenciesForBlockHeight(supplierOperatorKeyName, blockHeight), // The proxy is configured with an unsupported transport type for the proxy testproxy.WithServicesConfigMap(missingServicesProxy), - testproxy.WithDefaultSupplier(supplierKeyName, supplierEndpoints), + testproxy.WithDefaultSupplier(supplierOperatorKeyName, supplierEndpoints), testproxy.WithDefaultApplication(appPrivateKey), - testproxy.WithDefaultSessionSupplier(supplierKeyName, defaultService, appPrivateKey), + testproxy.WithDefaultSessionSupplier(supplierOperatorKeyName, defaultService, appPrivateKey), } test := testproxy.NewRelayerProxyTestBehavior(ctx, t, unsupportedTransportTypeBehavior...) rp, err := proxy.NewRelayerProxy( test.Deps, - proxy.WithSigningKeyNames([]string{supplierKeyName}), + proxy.WithSigningKeyNames([]string{supplierOperatorKeyName}), proxy.WithServicesConfigMap(missingServicesProxy), ) require.NoError(t, err) @@ -452,9 +452,9 @@ func TestRelayerProxy_Relays(t *testing.T) { desc: "Invalid relay supplier", relayerProxyBehavior: []func(*testproxy.TestBehavior){ - testproxy.WithRelayerProxyDependenciesForBlockHeight(supplierKeyName, blockHeight), + testproxy.WithRelayerProxyDependenciesForBlockHeight(supplierOperatorKeyName, blockHeight), testproxy.WithServicesConfigMap(servicesConfigMap), - testproxy.WithDefaultSupplier(supplierKeyName, supplierEndpoints), + testproxy.WithDefaultSupplier(supplierOperatorKeyName, supplierEndpoints), testproxy.WithDefaultApplication(appPrivateKey), // Missing session supplier testproxy.WithDefaultSessionSupplier("", defaultService, appPrivateKey), @@ -486,15 +486,15 @@ func TestRelayerProxy_Relays(t *testing.T) { relayerProxyBehavior: []func(*testproxy.TestBehavior){ // blockHeight is past the first session but within its session grace period testproxy.WithRelayerProxyDependenciesForBlockHeight( - supplierKeyName, + supplierOperatorKeyName, blockWithinSessionGracePeriod, ), testproxy.WithServicesConfigMap(servicesConfigMap), - testproxy.WithDefaultSupplier(supplierKeyName, supplierEndpoints), + testproxy.WithDefaultSupplier(supplierOperatorKeyName, supplierEndpoints), testproxy.WithDefaultApplication(appPrivateKey), // Add 2 sessions, with the first one being within the withing grace period // and the second one being the current session - testproxy.WithSuccessiveSessions(supplierKeyName, defaultService, appPrivateKey, 2), + testproxy.WithSuccessiveSessions(supplierOperatorKeyName, defaultService, appPrivateKey, 2), }, inputScenario: sendRequestWithCustomSessionHeight(blockHeight), @@ -507,16 +507,16 @@ func TestRelayerProxy_Relays(t *testing.T) { relayerProxyBehavior: []func(*testproxy.TestBehavior){ // blockHeight is past the first session's grace period testproxy.WithRelayerProxyDependenciesForBlockHeight( - supplierKeyName, + supplierOperatorKeyName, // Set the current block height value returned by the block provider blockOutsideSessionGracePeriod, ), testproxy.WithServicesConfigMap(servicesConfigMap), - testproxy.WithDefaultSupplier(supplierKeyName, supplierEndpoints), + testproxy.WithDefaultSupplier(supplierOperatorKeyName, supplierEndpoints), testproxy.WithDefaultApplication(appPrivateKey), // Add 3 sessions, with the first one that is no longer within its // session grace period - testproxy.WithSuccessiveSessions(supplierKeyName, defaultService, appPrivateKey, 3), + testproxy.WithSuccessiveSessions(supplierOperatorKeyName, defaultService, appPrivateKey, 3), }, // Send a request that has a late session past the grace period inputScenario: sendRequestWithCustomSessionHeight(blockHeight), @@ -534,7 +534,7 @@ func TestRelayerProxy_Relays(t *testing.T) { rp, err := proxy.NewRelayerProxy( testBehavior.Deps, - proxy.WithSigningKeyNames([]string{supplierKeyName}), + proxy.WithSigningKeyNames([]string{supplierOperatorKeyName}), proxy.WithServicesConfigMap(servicesConfigMap), ) require.NoError(t, err) @@ -579,7 +579,7 @@ func sendRequestWithMissingSignature( appPrivateKey, defaultService, blockHeight, - supplierKeyName, + supplierOperatorKeyName, testproxy.PrepareJSONRPCRequest(t), ) req.Meta.Signature = nil @@ -595,7 +595,7 @@ func sendRequestWithInvalidSignature( appPrivateKey, defaultService, blockHeight, - supplierKeyName, + supplierOperatorKeyName, testproxy.PrepareJSONRPCRequest(t), ) req.Meta.Signature = []byte("invalid signature") @@ -613,7 +613,7 @@ func sendRequestWithMissingSessionHeaderApplicationAddress( randomPrivKey, defaultService, blockHeight, - supplierKeyName, + supplierOperatorKeyName, testproxy.PrepareJSONRPCRequest(t), ) @@ -637,7 +637,7 @@ func sendRequestWithNonStakedApplicationAddress( randomPrivKey, defaultService, blockHeight, - supplierKeyName, + supplierOperatorKeyName, testproxy.PrepareJSONRPCRequest(t), ) @@ -656,7 +656,7 @@ func sendRequestWithRingSignatureMismatch( appPrivateKey, defaultService, blockHeight, - supplierKeyName, + supplierOperatorKeyName, testproxy.PrepareJSONRPCRequest(t), ) @@ -679,7 +679,7 @@ func sendRequestWithDifferentSession( appPrivateKey, defaultService, blockHeightAfterSessionGracePeriod, - supplierKeyName, + supplierOperatorKeyName, testproxy.PrepareJSONRPCRequest(t), ) req.Meta.Signature = testproxy.GetApplicationRingSignature(t, req, appPrivateKey) @@ -696,7 +696,7 @@ func sendRequestWithInvalidRelaySupplier( appPrivateKey, defaultService, blockHeight, - supplierKeyName, + supplierOperatorKeyName, testproxy.PrepareJSONRPCRequest(t), ) req.Meta.Signature = testproxy.GetApplicationRingSignature(t, req, appPrivateKey) @@ -712,7 +712,7 @@ func sendRequestWithSignatureForDifferentPayload( test, appPrivateKey, defaultService, blockHeight, - supplierKeyName, + supplierOperatorKeyName, testproxy.PrepareJSONRPCRequest(t), ) req.Meta.Signature = testproxy.GetApplicationRingSignature(t, req, appPrivateKey) @@ -743,7 +743,7 @@ func sendRequestWithSuccessfulReply( appPrivateKey, defaultService, blockHeight, - supplierKeyName, + supplierOperatorKeyName, testproxy.PrepareJSONRPCRequest(t), ) req.Meta.Signature = testproxy.GetApplicationRingSignature(t, req, appPrivateKey) @@ -763,7 +763,7 @@ func sendRequestWithCustomSessionHeight( appPrivateKey, defaultService, requestSessionBlockHeight, - supplierKeyName, + supplierOperatorKeyName, testproxy.PrepareJSONRPCRequest(t), ) req.Meta.Signature = testproxy.GetApplicationRingSignature(t, req, appPrivateKey) diff --git a/pkg/relayer/proxy/relay_builders.go b/pkg/relayer/proxy/relay_builders.go index f8c6b83f8..69d1dab38 100644 --- a/pkg/relayer/proxy/relay_builders.go +++ b/pkg/relayer/proxy/relay_builders.go @@ -27,13 +27,13 @@ func (sync *synchronousRPCServer) newRelayRequest(request *http.Request) (*types } // newRelayResponse builds a RelayResponse from the serialized response and SessionHeader. -// It also signs the RelayResponse and assigns it to RelayResponse.Meta.SupplierSignature. +// It also signs the RelayResponse and assigns it to RelayResponse.Meta.SupplierOperatorSignature. // The whole serialized response (i.e. status code, headers and body) is embedded // into the RelayResponse. func (sync *synchronousRPCServer) newRelayResponse( responseBz []byte, sessionHeader *sessiontypes.SessionHeader, - supplierAddr string, + supplierOperatorAddr string, ) (*types.RelayResponse, error) { relayResponse := &types.RelayResponse{ Meta: types.RelayResponseMetadata{SessionHeader: sessionHeader}, @@ -41,7 +41,7 @@ func (sync *synchronousRPCServer) newRelayResponse( } // Sign the relay response and add the signature to the relay response metadata - if err := sync.relayerProxy.SignRelayResponse(relayResponse, supplierAddr); err != nil { + if err := sync.relayerProxy.SignRelayResponse(relayResponse, supplierOperatorAddr); err != nil { return nil, err } diff --git a/pkg/relayer/proxy/relay_signer.go b/pkg/relayer/proxy/relay_signer.go index 23360e22a..83b1ab115 100644 --- a/pkg/relayer/proxy/relay_signer.go +++ b/pkg/relayer/proxy/relay_signer.go @@ -10,13 +10,13 @@ import ( // TODO_TECHDEBT(@red-0ne): This method should be moved out of the RelayerProxy interface // that should not be responsible for signing relay responses. // See https://github.com/pokt-network/poktroll/issues/160 for a better design. -func (rp *relayerProxy) SignRelayResponse(relayResponse *types.RelayResponse, supplierAddr string) error { +func (rp *relayerProxy) SignRelayResponse(relayResponse *types.RelayResponse, supplierOperatorAddr string) error { // create a simple signer for the request - _, ok := rp.AddressToSigningKeyNameMap[supplierAddr] + _, ok := rp.OperatorAddressToSigningKeyNameMap[supplierOperatorAddr] if !ok { - return ErrRelayerProxyUndefinedSigningKeyNames.Wrapf("unable to resolve the signing key name for %s", supplierAddr) + return ErrRelayerProxyUndefinedSigningKeyNames.Wrapf("unable to resolve the signing key name for %s", supplierOperatorAddr) } - signer := signer.NewSimpleSigner(rp.keyring, rp.AddressToSigningKeyNameMap[supplierAddr]) + signer := signer.NewSimpleSigner(rp.keyring, rp.OperatorAddressToSigningKeyNameMap[supplierOperatorAddr]) // extract and hash the relay response's signable bytes signableBz, err := relayResponse.GetSignableBytesHash() @@ -31,6 +31,6 @@ func (rp *relayerProxy) SignRelayResponse(relayResponse *types.RelayResponse, su } // set the relay response's signature - relayResponse.Meta.SupplierSignature = responseSig + relayResponse.Meta.SupplierOperatorSignature = responseSig return nil } diff --git a/pkg/relayer/proxy/relay_verifier.go b/pkg/relayer/proxy/relay_verifier.go index b8d1d07dc..50fd55bff 100644 --- a/pkg/relayer/proxy/relay_verifier.go +++ b/pkg/relayer/proxy/relay_verifier.go @@ -42,10 +42,10 @@ func (rp *relayerProxy) VerifyRelayRequest( rp.logger.Debug(). Fields(map[string]any{ - "session_id": sessionHeader.GetSessionId(), - "application_address": appAddress, - "service_id": sessionHeader.GetService().GetId(), - "supplier_address": meta.GetSupplierAddress(), + "session_id": sessionHeader.GetSessionId(), + "application_address": appAddress, + "service_id": sessionHeader.GetService().GetId(), + "supplier_operator_address": meta.GetSupplierOperatorAddress(), }). Msg("verifying relay request session") @@ -75,14 +75,14 @@ func (rp *relayerProxy) VerifyRelayRequest( } // Check if the relayRequest is allowed to be served by the relayer proxy. - _, isSupplierAddressPresent := rp.AddressToSigningKeyNameMap[meta.GetSupplierAddress()] - if !isSupplierAddressPresent { - return ErrRelayerProxyMissingSupplierAddress + _, isSupplierOperatorAddressPresent := rp.OperatorAddressToSigningKeyNameMap[meta.GetSupplierOperatorAddress()] + if !isSupplierOperatorAddressPresent { + return ErrRelayerProxyMissingSupplierOperatorAddress } for _, supplier := range session.Suppliers { - // Verify if the supplier address in the session matches the one in the relayRequest. - if isSupplierAddressPresent && supplier.Address == meta.GetSupplierAddress() { + // Verify if the supplier operator address in the session matches the one in the relayRequest. + if isSupplierOperatorAddressPresent && supplier.OperatorAddress == meta.GetSupplierOperatorAddress() { return nil } } diff --git a/pkg/relayer/proxy/server_builder.go b/pkg/relayer/proxy/server_builder.go index 288c8ca48..dd32bf564 100644 --- a/pkg/relayer/proxy/server_builder.go +++ b/pkg/relayer/proxy/server_builder.go @@ -35,15 +35,15 @@ const ( // It populates the relayerProxy's `advertisedRelayServers` map of servers for each service, where each server // is responsible for listening for incoming relay requests and relaying them to the supported proxied service. func (rp *relayerProxy) BuildProvidedServices(ctx context.Context) error { - rp.AddressToSigningKeyNameMap = make(map[string]string) - for _, signingKeyName := range rp.signingKeyNames { - // Get the supplier address from the keyring - supplierKey, err := rp.keyring.Key(signingKeyName) + rp.OperatorAddressToSigningKeyNameMap = make(map[string]string) + for _, operatorSigningKeyName := range rp.signingKeyNames { + // Get the supplier operator address from the keyring + supplierOperatorKey, err := rp.keyring.Key(operatorSigningKeyName) if err != nil { return err } - supplierAddress, err := supplierKey.GetAddress() + supplierOperatorAddress, err := supplierOperatorKey.GetAddress() if err != nil { return err } @@ -58,7 +58,7 @@ func (rp *relayerProxy) BuildProvidedServices(ctx context.Context) error { // Prevent the RelayMiner from stopping by waiting until its associated supplier // is staked and its on-chain record retrieved. - supplier, err := rp.waitForSupplierToStake(ctx, supplierAddress.String()) + supplier, err := rp.waitForSupplierToStake(ctx, supplierOperatorAddress.String()) if err != nil { return err } @@ -94,7 +94,7 @@ func (rp *relayerProxy) BuildProvidedServices(ctx context.Context) error { } } - rp.AddressToSigningKeyNameMap[supplier.Address] = signingKeyName + rp.OperatorAddressToSigningKeyNameMap[supplier.OperatorAddress] = operatorSigningKeyName } var err error @@ -143,12 +143,12 @@ func (rp *relayerProxy) initializeProxyServers() (proxyServerMap map[string]rela // is most likely staked before the relay miner starts. func (rp *relayerProxy) waitForSupplierToStake( ctx context.Context, - supplierAddress string, + supplierOperatorAddress string, ) (supplier sharedtypes.Supplier, err error) { startTime := time.Now() for { // Get the supplier's on-chain record - supplier, err = rp.supplierQuerier.GetSupplier(ctx, supplierAddress) + supplier, err = rp.supplierQuerier.GetSupplier(ctx, supplierOperatorAddress) // If the supplier is not found, wait for the supplier to be staked. // This enables provisioning and deploying a RelayMiner without staking a @@ -159,7 +159,7 @@ func (rp *relayerProxy) waitForSupplierToStake( rp.logger.Info().Msgf( "Waiting %d seconds for the supplier with address %s to stake", supplierStakeWaitTime/time.Second, - supplierAddress, + supplierOperatorAddress, ) time.Sleep(supplierStakeWaitTime) diff --git a/pkg/relayer/proxy/synchronous.go b/pkg/relayer/proxy/synchronous.go index 649073bdd..cba720ebc 100644 --- a/pkg/relayer/proxy/synchronous.go +++ b/pkg/relayer/proxy/synchronous.go @@ -372,7 +372,7 @@ func (sync *synchronousRPCServer) serveHTTP( // Build the relay response using the original service's response. // Use relayRequest.Meta.SessionHeader on the relayResponse session header since it // was verified to be valid and has to be the same as the relayResponse session header. - relayResponse, err := sync.newRelayResponse(responseBz, relayRequest.Meta.SessionHeader, relayRequest.Meta.SupplierAddress) + relayResponse, err := sync.newRelayResponse(responseBz, relayRequest.Meta.SessionHeader, relayRequest.Meta.SupplierOperatorAddress) if err != nil { // The client should not have knowledge about the RelayMiner's issues with // building the relay response. Reply with an internal error so that the diff --git a/pkg/relayer/session/claim.go b/pkg/relayer/session/claim.go index 2a070975b..39cca4404 100644 --- a/pkg/relayer/session/claim.go +++ b/pkg/relayer/session/claim.go @@ -146,12 +146,12 @@ func (rs *relayerSessionsManager) waitForEarliestCreateClaimsHeight( logger.Info().Msg("observed earliest claim commit height offset seed block height") // Get the earliest claim commit height for this supplier. - supplierAddr := sessionTrees[0].GetSupplierAddress().String() + supplierOperatorAddr := sessionTrees[0].GetSupplierOperatorAddress().String() earliestSupplierClaimsCommitHeight := shared.GetEarliestSupplierClaimCommitHeight( sharedParams, sessionEndHeight, claimsWindowOpenBlock.Hash(), - supplierAddr, + supplierOperatorAddr, ) logger = logger.With("earliest_claim_commit_height", earliestSupplierClaimsCommitHeight) @@ -180,17 +180,17 @@ func (rs *relayerSessionsManager) newMapClaimSessionsFn( return either.Success(sessionTrees), false } - // Map key is the supplier address. + // Map key is the supplier operator address. claimMsgs := make([]client.MsgCreateClaim, 0) for _, sessionTree := range sessionTrees { claimMsgs = append(claimMsgs, &prooftypes.MsgCreateClaim{ - RootHash: sessionTree.GetClaimRoot(), - SessionHeader: sessionTree.GetSessionHeader(), - SupplierAddress: sessionTree.GetSupplierAddress().String(), + RootHash: sessionTree.GetClaimRoot(), + SessionHeader: sessionTree.GetSessionHeader(), + SupplierOperatorAddress: sessionTree.GetSupplierOperatorAddress().String(), }) } - // Create claims for each supplier address in `sessionTrees`. + // Create claims for each supplier operator address in `sessionTrees`. if err := supplierClient.CreateClaims(ctx, claimMsgs...); err != nil { failedCreateClaimsSessionsPublishCh <- sessionTrees rs.logger.Error().Err(err).Msg("failed to create claims") diff --git a/pkg/relayer/session/proof.go b/pkg/relayer/session/proof.go index e5cfe1020..ac321e853 100644 --- a/pkg/relayer/session/proof.go +++ b/pkg/relayer/session/proof.go @@ -125,12 +125,12 @@ func (rs *relayerSessionsManager) waitForEarliestSubmitProofsHeightAndGeneratePr } // Get the earliest proof commit height for this supplier. - supplierAddr := sessionTrees[0].GetSupplierAddress().String() + supplierOperatorAddr := sessionTrees[0].GetSupplierOperatorAddress().String() earliestSupplierProofsCommitHeight := shared.GetEarliestSupplierProofCommitHeight( sharedParams, sessionEndHeight, proofsWindowOpenBlock.Hash(), - supplierAddr, + supplierOperatorAddr, ) logger = logger.With("earliest_supplier_proof_commit_height", earliestSupplierProofsCommitHeight) @@ -186,17 +186,17 @@ func (rs *relayerSessionsManager) newMapProveSessionsFn( return either.Success(sessionTrees), false } - // Map key is the supplier address. + // Map key is the supplier operator address. proofMsgs := make([]client.MsgSubmitProof, 0) for _, session := range sessionTrees { proofMsgs = append(proofMsgs, &types.MsgSubmitProof{ - Proof: session.GetProofBz(), - SessionHeader: session.GetSessionHeader(), - SupplierAddress: session.GetSupplierAddress().String(), + Proof: session.GetProofBz(), + SessionHeader: session.GetSessionHeader(), + SupplierOperatorAddress: session.GetSupplierOperatorAddress().String(), }) } - // Submit proofs for each supplier address in `sessionTrees`. + // Submit proofs for each supplier operator address in `sessionTrees`. if err := supplierClient.SubmitProofs(ctx, proofMsgs...); err != nil { failedSubmitProofSessionsCh <- sessionTrees rs.logger.Error().Err(err).Msg("failed to submit proofs") diff --git a/pkg/relayer/session/session.go b/pkg/relayer/session/session.go index 961e772b7..9e7d6181d 100644 --- a/pkg/relayer/session/session.go +++ b/pkg/relayer/session/session.go @@ -22,9 +22,9 @@ import ( var _ relayer.RelayerSessionsManager = (*relayerSessionsManager)(nil) // sessionTreesMap is an alias type for a map of -// sessionEndHeight->sessionId->supplierAddress->SessionTree. +// sessionEndHeight->sessionId->supplierOperatorAddress->SessionTree. // It is used to keep track of the sessions that are created in the RelayMiner -// by grouping them by their end block height, session id and supplier address. +// by grouping them by their end block height, session id and supplier operator address. type sessionsTreesMap = map[int64]map[string]map[string]relayer.SessionTree // relayerSessionsManager is an implementation of the RelayerSessions interface. @@ -34,11 +34,11 @@ type relayerSessionsManager struct { relayObs relayer.MinedRelaysObservable - // sessionTrees is a map of blockHeight->sessionId->supplierAddress->sessionTree. + // sessionTrees is a map of blockHeight->sessionId->supplierOperatorAddress->sessionTree. // The block height index is used to know when the sessions contained in the // entry should be closed, this helps to avoid iterating over all sessionsTrees // to check if they are ready to be closed. - // The sessionTrees are grouped by supplierAddress since each supplier has to + // The sessionTrees are grouped by supplierOperatorAddress since each supplier has to // claim the work it has been assigned. sessionsTrees sessionsTreesMap sessionsTreesMu *sync.Mutex @@ -114,8 +114,8 @@ func (rs *relayerSessionsManager) Start(ctx context.Context) { logging.LogErrors(ctx, miningErrorsObs) // Start claim/proof pipeline for each supplier that is present in the RelayMiner. - for supplierAddress, supplierClient := range rs.supplierClients.SupplierClients { - supplierSessionsToClaimObs := rs.supplierSessionsToClaim(ctx, supplierAddress) + for supplierOperatorAddress, supplierClient := range rs.supplierClients.SupplierClients { + supplierSessionsToClaimObs := rs.supplierSessionsToClaim(ctx, supplierOperatorAddress) claimedSessionsObs := rs.createClaims(ctx, supplierClient, supplierSessionsToClaimObs) rs.submitProofs(ctx, supplierClient, claimedSessionsObs) } @@ -164,24 +164,24 @@ func (rs *relayerSessionsManager) ensureSessionTree( sessionTreesWithEndHeight[sessionHeader.SessionId] = sessionTreeWithSessionId } - supplierAccAddress, err := cosmostypes.AccAddressFromBech32(relayRequestMetadata.SupplierAddress) + supplierOperatorAccAddress, err := cosmostypes.AccAddressFromBech32(relayRequestMetadata.SupplierOperatorAddress) if err != nil { return nil, err } - supplierAddress := supplierAccAddress.String() + supplierOperatorAddress := supplierOperatorAccAddress.String() // Get the sessionTree for the supplier corresponding to the relay request. - sessionTree, ok := sessionTreeWithSessionId[supplierAddress] + sessionTree, ok := sessionTreeWithSessionId[supplierOperatorAddress] // If the sessionTree does not exist, create and assign it to the - // sessionTreeWithSessionId map for the given supplier address. + // sessionTreeWithSessionId map for the given supplier operator address. if !ok { - sessionTree, err = NewSessionTree(sessionHeader, &supplierAccAddress, rs.storesDirectory) + sessionTree, err = NewSessionTree(sessionHeader, &supplierOperatorAccAddress, rs.storesDirectory) if err != nil { return nil, err } - sessionTreeWithSessionId[supplierAddress] = sessionTree + sessionTreeWithSessionId[supplierOperatorAddress] = sessionTree } return sessionTree, nil @@ -301,7 +301,7 @@ func (rs *relayerSessionsManager) removeFromRelayerSessions(sessionTree relayer. defer rs.sessionsTreesMu.Unlock() sessionHeader := sessionTree.GetSessionHeader() - supplierAddress := sessionTree.GetSupplierAddress().String() + supplierOperatorAddress := sessionTree.GetSupplierOperatorAddress().String() logger := rs.logger.With("session_end_block_height", sessionHeader.SessionEndBlockHeight) @@ -319,15 +319,15 @@ func (rs *relayerSessionsManager) removeFromRelayerSessions(sessionTree relayer. return } - logger = logger.With("supplier_address", supplierAddress) + logger = logger.With("supplier_operator_address", supplierOperatorAddress) - _, ok = suppliersSessionTrees[supplierAddress] + _, ok = suppliersSessionTrees[supplierOperatorAddress] if !ok { - logger.Debug().Msg("no session tree found for the supplier address") + logger.Debug().Msg("no session tree found for the supplier operator address") return } - delete(suppliersSessionTrees, supplierAddress) + delete(suppliersSessionTrees, supplierOperatorAddress) // Check if the suppliersSessionTrees map is empty and delete it if so. if len(suppliersSessionTrees) == 0 { @@ -417,7 +417,7 @@ func (rs *relayerSessionsManager) mapAddMinedRelayToSessionTree( logger := rs.logger. With("session_id", smst.GetSessionHeader().GetSessionId()). With("application", smst.GetSessionHeader().GetApplicationAddress()). - With("supplier_address", smst.GetSupplierAddress().String()) + With("supplier_operator_address", smst.GetSupplierOperatorAddress().String()) // TODO_BETA(#705): Make sure to update the weight of each relay to the value // associated with `relayDifficultyTargetHash` in the `miner/miner.go`. @@ -457,7 +457,7 @@ func (rs *relayerSessionsManager) deleteExpiredSessionTreesFn( rs.logger.Error(). Err(err). Str("session_id", sessionTree.GetSessionHeader().GetSessionId()). - Str("supplier_address", sessionTree.GetSupplierAddress().String()). + Str("supplier_operator_address", sessionTree.GetSupplierOperatorAddress().String()). Msg("failed to delete session tree") } continue @@ -470,13 +470,13 @@ func (rs *relayerSessionsManager) deleteExpiredSessionTreesFn( // are handled by the given supplier are ready to be claimed. func (rs *relayerSessionsManager) supplierSessionsToClaim( ctx context.Context, - supplierAddress string, + supplierOperatorAddress string, ) observable.Observable[[]relayer.SessionTree] { sessionsToClaimObs, sessionsToClaimPublishCh := channel.NewObservable[[]relayer.SessionTree]() channel.ForEach( ctx, rs.blockClient.CommittedBlocksSequence(ctx), - rs.forEachBlockClaimSessionsFn(supplierAddress, sessionsToClaimPublishCh), + rs.forEachBlockClaimSessionsFn(supplierOperatorAddress, sessionsToClaimPublishCh), ) return sessionsToClaimObs diff --git a/pkg/relayer/session/session_test.go b/pkg/relayer/session/session_test.go index d412c2117..27c685dbd 100644 --- a/pkg/relayer/session/session_test.go +++ b/pkg/relayer/session/session_test.go @@ -52,8 +52,8 @@ func TestRelayerSessionsManager_Start(t *testing.T) { // Set up dependencies. blocksObs, blockPublishCh := channel.NewReplayObservable[client.Block](ctx, 20) blockClient := testblock.NewAnyTimesCommittedBlocksSequenceBlockClient(t, emptyBlockHash, blocksObs) - supplierAddress := sample.AccAddress() - supplierClientMap := testsupplier.NewOneTimeClaimProofSupplierClientMap(ctx, t, supplierAddress) + supplierOperatorAddress := sample.AccAddress() + supplierClientMap := testsupplier.NewOneTimeClaimProofSupplierClientMap(ctx, t, supplierOperatorAddress) ctrl := gomock.NewController(t) blockQueryClientMock := mockclient.NewMockCometRPC(ctrl) @@ -104,7 +104,7 @@ func TestRelayerSessionsManager_Start(t *testing.T) { waitSimulateIO() // Publish a mined relay to the minedRelaysPublishCh to insert into the session tree. - minedRelay := testrelayer.NewUnsignedMinedRelay(t, activeSession, supplierAddress) + minedRelay := testrelayer.NewUnsignedMinedRelay(t, activeSession, supplierOperatorAddress) minedRelaysPublishCh <- minedRelay // The relayerSessionsManager should have created a session tree for the relay. @@ -126,7 +126,7 @@ func TestRelayerSessionsManager_Start(t *testing.T) { &sharedParams, sessionEndHeight, emptyBlockHash, - supplierAddress, + supplierOperatorAddress, ) claimOpenHeightBlock := testblock.NewAnyTimesBlock(t, emptyBlockHash, claimWindowOpenHeight) @@ -153,7 +153,7 @@ func TestRelayerSessionsManager_Start(t *testing.T) { &sharedParams, sessionEndHeight, emptyBlockHash, - supplierAddress, + supplierOperatorAddress, ) triggerProofBlock := testblock.NewAnyTimesBlock(t, emptyBlockHash, earliestSupplierProofCommitHeight) blockPublishCh <- triggerProofBlock diff --git a/pkg/relayer/session/sessiontree.go b/pkg/relayer/session/sessiontree.go index c1ff34cf7..843186b0d 100644 --- a/pkg/relayer/session/sessiontree.go +++ b/pkg/relayer/session/sessiontree.go @@ -30,10 +30,10 @@ type sessionTree struct { // sessionSMT is the SMST (Sparse Merkle State Trie) corresponding the session. sessionSMT smt.SparseMerkleSumTrie - // supplierAddress is the address of the supplier that owns this sessionTree. - // RelayMiner can run suppliers for many supplier addresses at the same time, - // and we need a way to group the session trees by the supplier address for that. - supplierAddress *cosmostypes.AccAddress + // supplierOperatorAddress is the address of the supplier's operator that owns this sessionTree. + // RelayMiner can run suppliers for many supplier operator addresses at the same time, + // and we need a way to group the session trees by the supplier operator address for that. + supplierOperatorAddress *cosmostypes.AccAddress // claimedRoot is the root hash of the SMST needed for submitting the claim. // If it holds a non-nil value, it means that the SMST has been flushed, @@ -67,12 +67,12 @@ type sessionTree struct { // It returns an error if the KVStore fails to be created. func NewSessionTree( sessionHeader *sessiontypes.SessionHeader, - supplierAddress *cosmostypes.AccAddress, + supplierOperatorAddress *cosmostypes.AccAddress, storesDirectory string, ) (relayer.SessionTree, error) { - // Join the storePrefix and the session.sessionId and supplier address to + // Join the storePrefix and the session.sessionId and supplier's operator address to // create a unique storePath. - storePath := filepath.Join(storesDirectory, sessionHeader.SessionId, "_", supplierAddress.String()) + storePath := filepath.Join(storesDirectory, sessionHeader.SessionId, "_", supplierOperatorAddress.String()) // Make sure storePath does not exist when creating a new SessionTree if _, err := os.Stat(storePath); err != nil && !os.IsNotExist(err) { @@ -89,12 +89,12 @@ func NewSessionTree( trie := smt.NewSparseMerkleSumTrie(treeStore, protocol.NewTrieHasher(), smt.WithValueHasher(nil)) sessionTree := &sessionTree{ - sessionHeader: sessionHeader, - storePath: storePath, - treeStore: treeStore, - sessionSMT: trie, - sessionMu: &sync.Mutex{}, - supplierAddress: supplierAddress, + sessionHeader: sessionHeader, + storePath: storePath, + treeStore: treeStore, + sessionSMT: trie, + sessionMu: &sync.Mutex{}, + supplierOperatorAddress: supplierOperatorAddress, } return sessionTree, nil @@ -267,7 +267,7 @@ func (st *sessionTree) StartClaiming() error { return nil } -// SupplierAddress returns a CosmosSDK address of the supplier this sessionTree belongs to. -func (st *sessionTree) GetSupplierAddress() *cosmostypes.AccAddress { - return st.supplierAddress +// GetSupplierOperatorAddress returns a CosmosSDK address of the supplier this sessionTree belongs to. +func (st *sessionTree) GetSupplierOperatorAddress() *cosmostypes.AccAddress { + return st.supplierOperatorAddress } diff --git a/proto/poktroll/proof/claim.proto b/proto/poktroll/proof/claim.proto index b0e91d4b3..bfc5d6cd3 100644 --- a/proto/poktroll/proof/claim.proto +++ b/proto/poktroll/proof/claim.proto @@ -9,7 +9,7 @@ import "poktroll/session/session.proto"; // Claim is the serialized object stored on-chain for claims pending to be proven message Claim { - string supplier_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // the address of the supplier that submitted this claim + string supplier_operator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // the address of the supplier's operator that submitted this claim // The session header of the session that this claim is for. poktroll.session.SessionHeader session_header = 2; // Root hash returned from smt.SMST#Root(). diff --git a/proto/poktroll/proof/proof.proto b/proto/poktroll/proof/proof.proto index 83168c4cf..5d95903b0 100644 --- a/proto/poktroll/proof/proof.proto +++ b/proto/poktroll/proof/proof.proto @@ -8,7 +8,8 @@ import "cosmos_proto/cosmos.proto"; import "poktroll/session/session.proto"; message Proof { - string supplier_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // Address of the supplier's operator that submitted this proof. + string supplier_operator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // The session header of the session that this claim is for. poktroll.session.SessionHeader session_header = 2; // The serialized SMST proof from the `#ClosestProof()` method. diff --git a/proto/poktroll/proof/query.proto b/proto/poktroll/proof/query.proto index 9e5795188..af83f822c 100644 --- a/proto/poktroll/proof/query.proto +++ b/proto/poktroll/proof/query.proto @@ -24,7 +24,7 @@ service Query { // Queries a list of Claim items. rpc Claim (QueryGetClaimRequest ) returns (QueryGetClaimResponse ) { - option (google.api.http).get = "/pokt-network/poktroll/proof/claim/{session_id}/{supplier_address}"; + option (google.api.http).get = "/pokt-network/poktroll/proof/claim/{session_id}/{supplier_operator_address}"; } rpc AllClaims (QueryAllClaimsRequest) returns (QueryAllClaimsResponse) { @@ -34,7 +34,7 @@ service Query { // Queries a list of Proof items. rpc Proof (QueryGetProofRequest) returns (QueryGetProofResponse) { - option (google.api.http).get = "/pokt-network/poktroll/proof/proof/{session_id}/{supplier_address}"; + option (google.api.http).get = "/pokt-network/poktroll/proof/proof/{session_id}/{supplier_operator_address}"; } rpc AllProofs (QueryAllProofsRequest) returns (QueryAllProofsResponse) { @@ -53,7 +53,7 @@ message QueryParamsResponse { message QueryGetClaimRequest { string session_id = 1; - string supplier_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string supplier_operator_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; } message QueryGetClaimResponse { @@ -64,7 +64,7 @@ message QueryAllClaimsRequest { cosmos.base.query.v1beta1.PageRequest pagination = 1; oneof filter { - string supplier_address= 2; + string supplier_operator_address= 2; string session_id = 3; uint64 session_end_height = 4; } @@ -77,7 +77,7 @@ message QueryAllClaimsResponse { message QueryGetProofRequest { string session_id = 1; - string supplier_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string supplier_operator_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; } message QueryGetProofResponse { @@ -88,7 +88,7 @@ message QueryAllProofsRequest { cosmos.base.query.v1beta1.PageRequest pagination = 1; oneof filter { - string supplier_address = 2; + string supplier_operator_address = 2; string session_id = 3; uint64 session_end_height = 4; } diff --git a/proto/poktroll/proof/tx.proto b/proto/poktroll/proof/tx.proto index f2f3968e5..bb46cf099 100644 --- a/proto/poktroll/proof/tx.proto +++ b/proto/poktroll/proof/tx.proto @@ -74,8 +74,8 @@ message MsgUpdateParamResponse { } message MsgCreateClaim { - option (cosmos.msg.v1.signer) = "supplier_address"; - string supplier_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + option (cosmos.msg.v1.signer) = "supplier_operator_address"; + string supplier_operator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; poktroll.session.SessionHeader session_header = 2; // root returned from smt.SMST#Root() @@ -87,8 +87,8 @@ message MsgCreateClaimResponse { } message MsgSubmitProof { - option (cosmos.msg.v1.signer) = "supplier_address"; - string supplier_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + option (cosmos.msg.v1.signer) = "supplier_operator_address"; + string supplier_operator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; poktroll.session.SessionHeader session_header = 2; // serialized version of *smt.SparseMerkleClosestProof diff --git a/proto/poktroll/service/relay.proto b/proto/poktroll/service/relay.proto index 6874a3f61..81e9b40ec 100644 --- a/proto/poktroll/service/relay.proto +++ b/proto/poktroll/service/relay.proto @@ -24,12 +24,12 @@ message RelayRequestMetadata { // application in both cases. bytes signature = 2; - // TODO_MAINNET: make sure we're checking/verifying this address on-chain (if needed). + // TODO_MAINNET: make sure we're checking/verifying this address on-chain (if needed). // Relevant conversation: https://github.com/pokt-network/poktroll/pull/567#discussion_r1628722168 // - // The supplier address the relay is sent to. It is being used on the RelayMiner to - // route to the correct supplier. - string supplier_address = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // The Bech32 address of the application. + // The supplier operator address the relay is sent to. It is being used on the + // RelayMiner to route to the correct supplier. + string supplier_operator_address = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // The Bech32 address of the application. } // RelayRequest holds the request details for a relay. @@ -53,5 +53,5 @@ message RelayResponse { // RelayResponseMetadata contains the metadata for a RelayResponse. message RelayResponseMetadata { session.SessionHeader session_header = 1; // Session header associated with the relay. - bytes supplier_signature = 2; // Signature of the supplier on the response. + bytes supplier_operator_signature = 2; // Signature of the supplier's operator on the response. } diff --git a/proto/poktroll/shared/supplier.proto b/proto/poktroll/shared/supplier.proto index 919f49efd..9eec62cb2 100644 --- a/proto/poktroll/shared/supplier.proto +++ b/proto/poktroll/shared/supplier.proto @@ -14,13 +14,11 @@ message Supplier { // By default, this address is the one that receives all the rewards unless owtherwise specified. // This property cannot be updated by the operator. string owner_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // Bech32 cosmos address - // The address of the supplier operator (i.e. the one managing the off-chain server). + // The operator address of the supplier operator (i.e. the one managing the off-chain server). // The operator address can update the supplier's configurations excluding the owner address. // This property does not change over the supplier's lifespan, the supplier must be unstaked // and re-staked to effectively update this value. - // TODO(#722): Rename this to `operator_address` including all downstream - // variables, comments, docs, tests, etc... - string address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // Bech32 cosmos address + string operator_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // Bech32 cosmos address cosmos.base.v1beta1.Coin stake = 3; // The total amount of uPOKT the supplier has staked repeated SupplierServiceConfig services = 4; // The service configs this supplier can support // The session end height at which an actively unbonding supplier unbonds its stake. diff --git a/proto/poktroll/supplier/query.proto b/proto/poktroll/supplier/query.proto index 4220f9a39..c8598f2b0 100644 --- a/proto/poktroll/supplier/query.proto +++ b/proto/poktroll/supplier/query.proto @@ -24,7 +24,7 @@ service Query { // Queries a list of Supplier items. rpc Supplier (QueryGetSupplierRequest) returns (QueryGetSupplierResponse) { - option (google.api.http).get = "/pokt-network/poktroll/supplier/supplier/{address}"; + option (google.api.http).get = "/pokt-network/poktroll/supplier/supplier/{operator_address}"; } rpc AllSuppliers (QueryAllSuppliersRequest) returns (QueryAllSuppliersResponse) { @@ -43,7 +43,7 @@ message QueryParamsResponse { } message QueryGetSupplierRequest { - string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + string operator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; } message QueryGetSupplierResponse { diff --git a/proto/poktroll/supplier/tx.proto b/proto/poktroll/supplier/tx.proto index 9d69fdd87..bb2f79b67 100644 --- a/proto/poktroll/supplier/tx.proto +++ b/proto/poktroll/supplier/tx.proto @@ -49,7 +49,7 @@ message MsgStakeSupplier { string signer = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // The Bech32 address of the message signer (i.e. owner or operator) string owner_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // The Bech32 address of the owner (i.e. custodial, staker) - string address = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // The Bech32 address of the operator (i.e. provider, non-custodial) + string operator_address = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // The Bech32 address of the operator (i.e. provider, non-custodial) cosmos.base.v1beta1.Coin stake = 4; // The total amount of uPOKT the supplier has staked. Must be ≥ to the current amount that the supplier has staked (if any) repeated poktroll.shared.SupplierServiceConfig services = 5; // The list of services this supplier is staked to provide service for } @@ -60,7 +60,7 @@ message MsgUnstakeSupplier { option (cosmos.msg.v1.signer) = "signer"; string signer = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // The Bech32 address of the message signer (i.e. owner or operator) - string address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // The Bech32 address of the operator (i.e. provider, non-custodial) + string operator_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // The Bech32 address of the operator (i.e. provider, non-custodial) } message MsgUnstakeSupplierResponse {} diff --git a/tests/integration/tokenomics/relay_mining_difficulty_test.go b/tests/integration/tokenomics/relay_mining_difficulty_test.go index 7ba982537..9a6dda60e 100644 --- a/tests/integration/tokenomics/relay_mining_difficulty_test.go +++ b/tests/integration/tokenomics/relay_mining_difficulty_test.go @@ -49,13 +49,13 @@ func TestUpdateRelayMiningDifficulty_NewServiceSeenForTheFirstTime(t *testing.T) &sharedParams, sessionEndHeight, claimWindowOpenBlockHash, - integrationApp.DefaultSupplier.GetAddress(), + integrationApp.DefaultSupplier.GetOperatorAddress(), ) earliestSupplierProofCommitHeight := shared.GetEarliestSupplierProofCommitHeight( &sharedParams, sessionEndHeight, proofWindowOpenBlockHash, - integrationApp.DefaultSupplier.GetAddress(), + integrationApp.DefaultSupplier.GetOperatorAddress(), ) proofWindowCloseHeight := shared.GetProofWindowCloseHeight(&sharedParams, sessionEndHeight) @@ -67,9 +67,9 @@ func TestUpdateRelayMiningDifficulty_NewServiceSeenForTheFirstTime(t *testing.T) // Construct a new create claim message and commit it. createClaimMsg := prooftypes.MsgCreateClaim{ - SupplierAddress: integrationApp.DefaultSupplier.Address, - SessionHeader: session.Header, - RootHash: trie.Root(), + SupplierOperatorAddress: integrationApp.DefaultSupplier.OperatorAddress, + SessionHeader: session.Header, + RootHash: trie.Root(), } result := integrationApp.RunMsg(t, &createClaimMsg, @@ -86,9 +86,9 @@ func TestUpdateRelayMiningDifficulty_NewServiceSeenForTheFirstTime(t *testing.T) // Construct a new proof message and commit it createProofMsg := prooftypes.MsgSubmitProof{ - SupplierAddress: integrationApp.DefaultSupplier.Address, - SessionHeader: session.Header, - Proof: getProof(t, trie, proofPathSeedBlockHash, session.GetHeader().GetSessionId()), + SupplierOperatorAddress: integrationApp.DefaultSupplier.OperatorAddress, + SessionHeader: session.Header, + Proof: getProof(t, trie, proofPathSeedBlockHash, session.GetHeader().GetSessionId()), } result = integrationApp.RunMsg(t, &createProofMsg, @@ -186,7 +186,7 @@ func prepareSMST( minedRelay := testrelayer.NewSignedMinedRelay(t, ctx, session, integrationApp.DefaultApplication.Address, - integrationApp.DefaultSupplier.Address, + integrationApp.DefaultSupplier.OperatorAddress, integrationApp.DefaultSupplierKeyringKeyringUid, integrationApp.GetKeyRing(), integrationApp.GetRingClient(), diff --git a/tests/integration/tokenomics/tokenomics_example_test.go b/tests/integration/tokenomics/tokenomics_example_test.go index d135c978c..9d3a3b52e 100644 --- a/tests/integration/tokenomics/tokenomics_example_test.go +++ b/tests/integration/tokenomics/tokenomics_example_test.go @@ -81,7 +81,7 @@ func TestTokenomicsIntegrationExample(t *testing.T) { &sharedParams, session.GetHeader().GetSessionEndBlockHeight(), claimWindowOpenBlockHash, - integrationApp.DefaultSupplier.GetAddress(), + integrationApp.DefaultSupplier.GetOperatorAddress(), ) // Need to wait until the earliest claim commit height @@ -93,9 +93,9 @@ func TestTokenomicsIntegrationExample(t *testing.T) { // Create a new claim createClaimMsg := prooftypes.MsgCreateClaim{ - SupplierAddress: integrationApp.DefaultSupplier.GetAddress(), - SessionHeader: session.GetHeader(), - RootHash: testutilproof.SmstRootWithSumAndCount(1, 1), + SupplierOperatorAddress: integrationApp.DefaultSupplier.GetOperatorAddress(), + SessionHeader: session.GetHeader(), + RootHash: testutilproof.SmstRootWithSumAndCount(1, 1), } // Run the message to create the claim diff --git a/testutil/integration/app.go b/testutil/integration/app.go index 003886df7..9bb861c60 100644 --- a/testutil/integration/app.go +++ b/testutil/integration/app.go @@ -518,7 +518,7 @@ func NewCompleteIntegrationApp(t *testing.T) *App { // Create a supplier account with the corresponding keys in the keyring for the supplier. integrationApp.DefaultSupplierKeyringKeyringUid = "supplier" - supplierAddr := testkeyring.CreateOnChainAccount( + supplierOperatorAddr := testkeyring.CreateOnChainAccount( integrationApp.sdkCtx, t, integrationApp.DefaultSupplierKeyringKeyringUid, keyRing, @@ -529,9 +529,9 @@ func NewCompleteIntegrationApp(t *testing.T) *App { // Prepare the on-chain supplier supplierStake := types.NewCoin("upokt", math.NewInt(1000000)) defaultSupplier := sharedtypes.Supplier{ - OwnerAddress: supplierAddr.String(), - Address: supplierAddr.String(), - Stake: &supplierStake, + OwnerAddress: supplierOperatorAddr.String(), + OperatorAddress: supplierOperatorAddr.String(), + Stake: &supplierStake, Services: []*sharedtypes.SupplierServiceConfig{ { Service: &defaultService, diff --git a/testutil/keeper/proof.go b/testutil/keeper/proof.go index 80049be35..17d008f43 100644 --- a/testutil/keeper/proof.go +++ b/testutil/keeper/proof.go @@ -256,13 +256,13 @@ func (keepers *ProofModuleKeepers) AddServiceActors( ctx context.Context, t *testing.T, service *sharedtypes.Service, - supplierAddr string, + supplierOperatorAddr string, appAddr string, ) { t.Helper() keepers.SetSupplier(ctx, sharedtypes.Supplier{ - Address: supplierAddr, + OperatorAddress: supplierOperatorAddr, Services: []*sharedtypes.SupplierServiceConfig{ {Service: service}, }, diff --git a/testutil/keeper/session.go b/testutil/keeper/session.go index 517643c8e..1b32d2219 100644 --- a/testutil/keeper/session.go +++ b/testutil/keeper/session.go @@ -73,11 +73,11 @@ var ( }, } - TestSupplierUrl = "http://olshansky.info" - TestSupplierAddress = sample.AccAddress() - TestSupplier = sharedtypes.Supplier{ - Address: TestSupplierAddress, - Stake: &sdk.Coin{Denom: "upokt", Amount: math.NewInt(100)}, + TestSupplierUrl = "http://olshansky.info" + TestSupplierOperatorAddress = sample.AccAddress() + TestSupplier = sharedtypes.Supplier{ + OperatorAddress: TestSupplierOperatorAddress, + Stake: &sdk.Coin{Denom: "upokt", Amount: math.NewInt(100)}, Services: []*sharedtypes.SupplierServiceConfig{ { Service: &sharedtypes.Service{Id: TestServiceId1}, diff --git a/testutil/keeper/tokenomics.go b/testutil/keeper/tokenomics.go index eabc675b9..b7504f0a6 100644 --- a/testutil/keeper/tokenomics.go +++ b/testutil/keeper/tokenomics.go @@ -82,13 +82,13 @@ func TokenomicsKeeper(t testing.TB) (tokenomicsKeeper tokenomicskeeper.Keeper, c // TODO_TECHDEBT: Remove this and force everyone to use NewTokenomicsModuleKeepers. // There is a difference in the method signatures and mocking, which was simply // a result of the evolution of the testutil package. -// TODO_REFACTOR(@Olshansk): Rather than making `service`, `appAddr` and `supplierAddr` +// TODO_REFACTOR(@Olshansk): Rather than making `service`, `appAddr` and `supplierOperatorAddr` // explicit params, make them passable by the caller as options. func TokenomicsKeeperWithActorAddrs(t testing.TB) ( tokenomicsKeeper tokenomicskeeper.Keeper, ctx context.Context, appAddr string, - supplierAddr string, + supplierOperatorAddr string, service *sharedtypes.Service, ) { t.Helper() @@ -123,9 +123,9 @@ func TokenomicsKeeperWithActorAddrs(t testing.TB) ( // Prepare the test supplier. supplier := sharedtypes.Supplier{ - OwnerAddress: sample.AccAddress(), - Address: sample.AccAddress(), - Stake: &sdk.Coin{Denom: "upokt", Amount: math.NewInt(100000)}, + OwnerAddress: sample.AccAddress(), + OperatorAddress: sample.AccAddress(), + Stake: &sdk.Coin{Denom: "upokt", Amount: math.NewInt(100000)}, } ctrl := gomock.NewController(t) @@ -156,7 +156,7 @@ func TokenomicsKeeperWithActorAddrs(t testing.TB) ( // Get test supplier if the address matches. mockSupplierKeeper.EXPECT(). - GetSupplier(gomock.Any(), gomock.Eq(supplier.Address)). + GetSupplier(gomock.Any(), gomock.Eq(supplier.OperatorAddress)). Return(supplier, true). AnyTimes() @@ -228,7 +228,7 @@ func TokenomicsKeeperWithActorAddrs(t testing.TB) ( // Initialize params require.NoError(t, k.SetParams(sdkCtx, tokenomicstypes.DefaultParams())) - return k, sdkCtx, application.Address, supplier.Address, service + return k, sdkCtx, application.Address, supplier.OperatorAddress, service } // NewTokenomicsModuleKeepers is a helper function to create a tokenomics keeper diff --git a/testutil/network/network.go b/testutil/network/network.go index d6fa0ae17..41d238129 100644 --- a/testutil/network/network.go +++ b/testutil/network/network.go @@ -140,9 +140,9 @@ func DefaultSupplierModuleGenesisState(t *testing.T, n int) *suppliertypes.Genes svcId := fmt.Sprintf("svc%d", i) stake := sdk.NewCoin("upokt", math.NewInt(int64(i))) supplier := sharedtypes.Supplier{ - OwnerAddress: sample.AccAddress(), - Address: sample.AccAddress(), - Stake: &stake, + OwnerAddress: sample.AccAddress(), + OperatorAddress: sample.AccAddress(), + Stake: &stake, Services: []*sharedtypes.SupplierServiceConfig{ { Service: &sharedtypes.Service{Id: svcId}, @@ -170,9 +170,9 @@ func SupplierModuleGenesisStateWithAddresses(t *testing.T, addresses []string) * state := suppliertypes.DefaultGenesis() for _, addr := range addresses { supplier := sharedtypes.Supplier{ - OwnerAddress: sample.AccAddress(), - Address: addr, - Stake: &sdk.Coin{Denom: "upokt", Amount: math.NewInt(10000)}, + OwnerAddress: sample.AccAddress(), + OperatorAddress: addr, + Stake: &sdk.Coin{Denom: "upokt", Amount: math.NewInt(10000)}, Services: []*sharedtypes.SupplierServiceConfig{ { Service: &sharedtypes.Service{Id: "svc1"}, diff --git a/testutil/proof/fixture_generators.go b/testutil/proof/fixture_generators.go index 6d4f59cd0..5aff488df 100644 --- a/testutil/proof/fixture_generators.go +++ b/testutil/proof/fixture_generators.go @@ -22,12 +22,12 @@ const ( ) // BaseClaim returns a base (default, example, etc..) claim with the given -// service ID, app address, supplier address and num relays that can be used for testing. -func BaseClaim(serviceId, appAddr, supplierAddr string, numRelays uint64) prooftypes.Claim { +// service ID, app address, supplier operator address and num relays that can be used for testing. +func BaseClaim(serviceId, appAddr, supplierOperatorAddr string, numRelays uint64) prooftypes.Claim { computeUnitsPerRelay := uint64(1) sum := numRelays * computeUnitsPerRelay return prooftypes.Claim{ - SupplierAddress: supplierAddr, + SupplierOperatorAddress: supplierOperatorAddr, SessionHeader: &sessiontypes.SessionHeader{ ApplicationAddress: appAddr, Service: &sharedtypes.Service{ @@ -45,11 +45,11 @@ func BaseClaim(serviceId, appAddr, supplierAddr string, numRelays uint64) prooft } // ClaimWithRandomHash returns a claim with a random SMST root hash with the given -// app address, supplier address, and num relays that can be used for testing. +// app address, supplier operator address, and num relays that can be used for testing. // Each claim generated this way will have a random chance to require a proof via // probabilistic selection. -func ClaimWithRandomHash(t *testing.T, appAddr, supplierAddr string, numRelays uint64) prooftypes.Claim { - claim := BaseClaim(DefaultTestServiceID, appAddr, supplierAddr, numRelays) +func ClaimWithRandomHash(t *testing.T, appAddr, supplierOperatorAddr string, numRelays uint64) prooftypes.Claim { + claim := BaseClaim(DefaultTestServiceID, appAddr, supplierOperatorAddr, numRelays) claim.RootHash = RandSmstRootWithSumAndCount(t, numRelays, numRelays) return claim } diff --git a/testutil/testclient/testqueryclients/sessionquerier.go b/testutil/testclient/testqueryclients/sessionquerier.go index e011ae29a..7522380b4 100644 --- a/testutil/testclient/testqueryclients/sessionquerier.go +++ b/testutil/testclient/testqueryclients/sessionquerier.go @@ -68,7 +68,7 @@ func AddToExistingSessions( appAddress string, serviceId string, blockHeight int64, - suppliersAddress []string, + supplierOperatorAddresses []string, ) { t.Helper() @@ -88,8 +88,11 @@ func AddToExistingSessions( Suppliers: []*sharedtypes.Supplier{}, } - for _, supplierAddress := range suppliersAddress { - supplier := &sharedtypes.Supplier{Address: supplierAddress} + for _, supplierOperatorAddress := range supplierOperatorAddresses { + supplier := &sharedtypes.Supplier{ + OwnerAddress: supplierOperatorAddress, + OperatorAddress: supplierOperatorAddress, + } session.Suppliers = append(session.Suppliers, supplier) } diff --git a/testutil/testclient/testqueryclients/sharedquerier.go b/testutil/testclient/testqueryclients/sharedquerier.go index 58c570d22..8abb9c312 100644 --- a/testutil/testclient/testqueryclients/sharedquerier.go +++ b/testutil/testclient/testqueryclients/sharedquerier.go @@ -62,14 +62,14 @@ func NewTestSharedQueryClient( func( ctx context.Context, sessionEndHeight int64, - supplierAddr string, + supplierOperatorAddr string, ) (int64, error) { sharedParams := sharedtypes.DefaultParams() return shared.GetEarliestSupplierClaimCommitHeight( &sharedParams, sessionEndHeight, []byte{}, - supplierAddr, + supplierOperatorAddr, ), nil }, ). @@ -81,14 +81,14 @@ func NewTestSharedQueryClient( func( ctx context.Context, sessionEndHeight int64, - supplierAddr string, + supplierOperatorAddr string, ) (int64, error) { sharedParams := sharedtypes.DefaultParams() return shared.GetEarliestSupplierProofCommitHeight( &sharedParams, sessionEndHeight, []byte{}, - supplierAddr, + supplierOperatorAddr, ), nil }, ). diff --git a/testutil/testclient/testqueryclients/supplierquerier.go b/testutil/testclient/testqueryclients/supplierquerier.go index 6dd6b32b1..352916c67 100644 --- a/testutil/testclient/testqueryclients/supplierquerier.go +++ b/testutil/testclient/testqueryclients/supplierquerier.go @@ -14,7 +14,7 @@ import ( // suppliersProvidedServicesMap is a map of maps: // -// supplierAddress -> {service -> []SupplierEndpoint} +// supplierOperatorAddress -> {service -> []SupplierEndpoint} // // If an address is not present in the map it is then assumed that the supplier does // not exist (has not staked) @@ -36,9 +36,9 @@ func NewTestSupplierQueryClient( supplierQuerier.EXPECT().GetSupplier(gomock.Any(), gomock.Any()). DoAndReturn(func( _ context.Context, - address string, + supplierOperatorAddress string, ) (supplier sharedtypes.Supplier, err error) { - supplierProvidedServices, ok := suppliersProvidedServicesMap[address] + supplierProvidedServices, ok := suppliersProvidedServicesMap[supplierOperatorAddress] if !ok { return sharedtypes.Supplier{}, errors.New("address not found") } @@ -65,8 +65,9 @@ func NewTestSupplierQueryClient( } return sharedtypes.Supplier{ - Address: address, - Services: services, + OwnerAddress: supplierOperatorAddress, + OperatorAddress: supplierOperatorAddress, + Services: services, }, nil }). AnyTimes() @@ -79,13 +80,13 @@ func NewTestSupplierQueryClient( // it will also remove the address from the map when the test is cleaned up. func AddSuppliersWithServiceEndpoints( t *testing.T, - address, service string, + supplierOperatorAddress, service string, endpoints []*sharedtypes.SupplierEndpoint, ) { t.Helper() require.NotEmpty(t, endpoints) - supplier, ok := suppliersProvidedServicesMap[address] + supplier, ok := suppliersProvidedServicesMap[supplierOperatorAddress] if !ok { supplier = make(map[string][]*sharedtypes.SupplierEndpoint) } @@ -98,9 +99,9 @@ func AddSuppliersWithServiceEndpoints( serviceEndpoints = append(serviceEndpoints, endpoints...) supplier[service] = serviceEndpoints - suppliersProvidedServicesMap[address] = supplier + suppliersProvidedServicesMap[supplierOperatorAddress] = supplier t.Cleanup(func() { - delete(addressAccountMap, address) + delete(addressAccountMap, supplierOperatorAddress) }) } diff --git a/testutil/testclient/testsupplier/client.go b/testutil/testclient/testsupplier/client.go index 6d5357f7c..838b24707 100644 --- a/testutil/testclient/testsupplier/client.go +++ b/testutil/testclient/testsupplier/client.go @@ -43,17 +43,17 @@ func NewLocalnetClient( func NewOneTimeClaimProofSupplierClientMap( ctx context.Context, t *testing.T, - supplierAddress string, + supplierOperatorAddress string, ) *supplier.SupplierClientMap { t.Helper() ctrl := gomock.NewController(t) supplierClientMock := mockclient.NewMockSupplierClient(ctrl) - supplierAccAddress := cosmostypes.MustAccAddressFromBech32(supplierAddress) + supplierOperatorAccAddress := cosmostypes.MustAccAddressFromBech32(supplierOperatorAddress) supplierClientMock.EXPECT(). - Address(). - Return(&supplierAccAddress). + OperatorAddress(). + Return(&supplierOperatorAccAddress). AnyTimes() supplierClientMock.EXPECT(). @@ -73,7 +73,7 @@ func NewOneTimeClaimProofSupplierClientMap( Times(1) supplierClientMap := supplier.NewSupplierClientMap() - supplierClientMap.SupplierClients[supplierAddress] = supplierClientMock + supplierClientMap.SupplierClients[supplierOperatorAddress] = supplierClientMock return supplierClientMap } diff --git a/testutil/testproxy/relayerproxy.go b/testutil/testproxy/relayerproxy.go index 1216b0421..d16ce48e2 100644 --- a/testutil/testproxy/relayerproxy.go +++ b/testutil/testproxy/relayerproxy.go @@ -184,16 +184,16 @@ $ go test -v -count=1 -run TestRelayerProxy ./pkg/relayer/...`) // WithDefaultSupplier creates the default staked supplier for the test func WithDefaultSupplier( - supplierKeyName string, + supplierOperatorKeyName string, supplierEndpoints map[string][]*sharedtypes.SupplierEndpoint, ) func(*TestBehavior) { return func(test *TestBehavior) { - supplierAddress := getAddressFromKeyName(test, supplierKeyName) + supplierOperatorAddress := getAddressFromKeyName(test, supplierOperatorKeyName) for serviceId, endpoints := range supplierEndpoints { testqueryclients.AddSuppliersWithServiceEndpoints( test.t, - supplierAddress, + supplierOperatorAddress, serviceId, endpoints, ) @@ -222,20 +222,20 @@ func WithDefaultApplication(appPrivateKey *secp256k1.PrivKey) func(*TestBehavior // If the supplierKeyName is empty, the supplier will not be staked so we can // test the case where the supplier is not in the application's session's supplier list. func WithDefaultSessionSupplier( - supplierKeyName string, + supplierOperatorKeyName string, serviceId string, appPrivateKey *secp256k1.PrivKey, ) func(*TestBehavior) { return func(test *TestBehavior) { - if supplierKeyName == "" { + if supplierOperatorKeyName == "" { return } appAddress := getAddressFromPrivateKey(test, appPrivateKey) sessionSuppliers := []string{} - supplierAddress := getAddressFromKeyName(test, supplierKeyName) - sessionSuppliers = append(sessionSuppliers, supplierAddress) + supplierOperatorAddress := getAddressFromKeyName(test, supplierOperatorKeyName) + sessionSuppliers = append(sessionSuppliers, supplierOperatorAddress) testqueryclients.AddToExistingSessions( test.t, @@ -251,7 +251,7 @@ func WithDefaultSessionSupplier( // and adds all of them to the sessionMap. // Each session is configured for the same serviceId and application provided. func WithSuccessiveSessions( - supplierKeyName string, + supplierOperatorKeyName string, serviceId string, appPrivateKey *secp256k1.PrivKey, sessionsCount int, @@ -260,8 +260,8 @@ func WithSuccessiveSessions( appAddress := getAddressFromPrivateKey(test, appPrivateKey) sessionSuppliers := []string{} - supplierAddress := getAddressFromKeyName(test, supplierKeyName) - sessionSuppliers = append(sessionSuppliers, supplierAddress) + supplierOperatorAddress := getAddressFromKeyName(test, supplierOperatorKeyName) + sessionSuppliers = append(sessionSuppliers, supplierOperatorAddress) // Adding `sessionCount` sessions to the sessionsMap to make them available // to the MockSessionQueryClient. @@ -417,12 +417,12 @@ func GenerateRelayRequest( privKey *secp256k1.PrivKey, serviceId string, blockHeight int64, - supplierKeyName string, + supplierOperatorKeyName string, payload []byte, ) *servicetypes.RelayRequest { appAddress := getAddressFromPrivateKey(test, privKey) sessionId, _ := testsession.GetSessionIdWithDefaultParams(appAddress, serviceId, blockHashBz, blockHeight) - supplierAddress := getAddressFromKeyName(test, supplierKeyName) + supplierOperatorAddress := getAddressFromKeyName(test, supplierOperatorKeyName) return &servicetypes.RelayRequest{ Meta: servicetypes.RelayRequestMetadata{ @@ -433,7 +433,7 @@ func GenerateRelayRequest( SessionStartBlockHeight: testsession.GetSessionStartHeightWithDefaultParams(blockHeight), SessionEndBlockHeight: testsession.GetSessionEndHeightWithDefaultParams(blockHeight), }, - SupplierAddress: supplierAddress, + SupplierOperatorAddress: supplierOperatorAddress, // The returned relay is unsigned and must be signed elsewhere for functionality Signature: []byte(""), }, diff --git a/testutil/testrelayer/relays.go b/testutil/testrelayer/relays.go index 43a4c5753..14da2aace 100644 --- a/testutil/testrelayer/relays.go +++ b/testutil/testrelayer/relays.go @@ -33,15 +33,15 @@ import ( func NewUnsignedMinedRelay( t *testing.T, session *sessiontypes.Session, - supplierAddress string, + supplierOperatorAddress string, ) *relayer.MinedRelay { t.Helper() relay := servicetypes.Relay{ Req: &servicetypes.RelayRequest{ Meta: servicetypes.RelayRequestMetadata{ - SessionHeader: session.Header, - SupplierAddress: supplierAddress, + SessionHeader: session.Header, + SupplierOperatorAddress: supplierOperatorAddress, }, Payload: []byte("request_payload"), }, @@ -81,7 +81,7 @@ func NewSignedMinedRelay( t *testing.T, ctx context.Context, session *sessiontypes.Session, - appAddr, supplierAddr, supplierKeyUid string, + appAddr, supplierOperatorAddr, supplierOperatorKeyUid string, keyRing keyring.Keyring, ringClient crypto.RingClient, ) *relayer.MinedRelay { @@ -90,8 +90,8 @@ func NewSignedMinedRelay( relay := servicetypes.Relay{ Req: &servicetypes.RelayRequest{ Meta: servicetypes.RelayRequestMetadata{ - SessionHeader: session.Header, - SupplierAddress: supplierAddr, + SessionHeader: session.Header, + SupplierOperatorAddress: supplierOperatorAddr, }, Payload: []byte("request_payload"), }, @@ -104,7 +104,7 @@ func NewSignedMinedRelay( } SignRelayRequest(ctx, t, &relay, appAddr, keyRing, ringClient) - SignRelayResponse(ctx, t, &relay, supplierKeyUid, supplierAddr, keyRing) + SignRelayResponse(ctx, t, &relay, supplierOperatorKeyUid, supplierOperatorAddr, keyRing) // TODO_TECHDEBT(@red-0ne): marshal using canonical codec. relayBz, err := relay.Marshal() @@ -164,13 +164,13 @@ func SignRelayRequest( // TODO_TECHDEBT(@red-0ne): Centralize this logic in the relayer package. // in the relayer package? -// SignRelayResponse signs the relay response (updates relay.Res.Meta.SupplierSignature) -// on behalf of supplierAddr using the clients provided. +// SignRelayResponse signs the relay response (updates relay.Res.Meta.SupplierOperatorSignature) +// on behalf of supplierOperatorAddr using the clients provided. func SignRelayResponse( _ context.Context, t *testing.T, relay *servicetypes.Relay, - supplierKeyUid, supplierAddr string, + supplierOperatorKeyUid, supplierOperatorAddr string, keyRing keyring.Keyring, ) { t.Helper() @@ -180,17 +180,17 @@ func SignRelayResponse( require.NoError(t, err) // Sign the relay response. - signatureBz, signerPubKey, err := keyRing.Sign(supplierKeyUid, relayResSignableBz[:], signingtypes.SignMode_SIGN_MODE_DIRECT) + signatureBz, signerPubKey, err := keyRing.Sign(supplierOperatorKeyUid, relayResSignableBz[:], signingtypes.SignMode_SIGN_MODE_DIRECT) require.NoError(t, err) - // Verify the signer address matches the expected supplier address. - addr, err := cosmostypes.AccAddressFromBech32(supplierAddr) + // Verify the signer address matches the expected supplier operator address. + addr, err := cosmostypes.AccAddressFromBech32(supplierOperatorAddr) require.NoError(t, err) addrHexBz := strings.ToUpper(fmt.Sprintf("%x", addr.Bytes())) require.Equal(t, addrHexBz, signerPubKey.Address().String()) // Update the relay response signature. - relay.Res.Meta.SupplierSignature = signatureBz + relay.Res.Meta.SupplierOperatorSignature = signatureBz } // NewSignedEmptyRelay creates a new relay structure for the given req & res headers. @@ -199,36 +199,36 @@ func SignRelayResponse( func NewSignedEmptyRelay( ctx context.Context, t *testing.T, - supplierKeyUid, supplierAddr string, + supplierOperatorKeyUid, supplierOperatorAddr string, reqHeader, resHeader *sessiontypes.SessionHeader, keyRing keyring.Keyring, ringClient crypto.RingClient, ) *servicetypes.Relay { t.Helper() - relay := NewEmptyRelay(reqHeader, resHeader, supplierAddr) + relay := NewEmptyRelay(reqHeader, resHeader, supplierOperatorAddr) SignRelayRequest(ctx, t, relay, reqHeader.GetApplicationAddress(), keyRing, ringClient) - SignRelayResponse(ctx, t, relay, supplierKeyUid, supplierAddr, keyRing) + SignRelayResponse(ctx, t, relay, supplierOperatorKeyUid, supplierOperatorAddr, keyRing) return relay } // NewEmptyRelay creates a new relay structure for the given req & res headers // WITHOUT any payload or signatures. -func NewEmptyRelay(reqHeader, resHeader *sessiontypes.SessionHeader, supplierAddr string) *servicetypes.Relay { +func NewEmptyRelay(reqHeader, resHeader *sessiontypes.SessionHeader, supplierOperatorAddr string) *servicetypes.Relay { return &servicetypes.Relay{ Req: &servicetypes.RelayRequest{ Meta: servicetypes.RelayRequestMetadata{ - SessionHeader: reqHeader, - Signature: nil, // Signature added elsewhere. - SupplierAddress: supplierAddr, + SessionHeader: reqHeader, + Signature: nil, // Signature added elsewhere. + SupplierOperatorAddress: supplierOperatorAddr, }, Payload: nil, }, Res: &servicetypes.RelayResponse{ Meta: servicetypes.RelayResponseMetadata{ - SessionHeader: resHeader, - SupplierSignature: nil, // Signature added elsewhere. + SessionHeader: resHeader, + SupplierOperatorSignature: nil, // Signature added elsewhere. }, Payload: nil, }, diff --git a/testutil/testtree/tree.go b/testutil/testtree/tree.go index 0a8d2caac..5774de7c8 100644 --- a/testutil/testtree/tree.go +++ b/testutil/testtree/tree.go @@ -23,7 +23,7 @@ import ( func NewFilledSessionTree( ctx context.Context, t *testing.T, numRelays, computeUnitsPerRelay uint64, - supplierKeyUid, supplierAddr string, + supplierKeyUid, supplierOperatorAddr string, sessionTreeHeader, reqHeader, resHeader *sessiontypes.SessionHeader, keyRing keyring.Keyring, ringClient crypto.RingClient, @@ -31,14 +31,14 @@ func NewFilledSessionTree( t.Helper() // Initialize an empty session tree with the given session header. - sessionTree := NewEmptySessionTree(t, sessionTreeHeader, supplierAddr) + sessionTree := NewEmptySessionTree(t, sessionTreeHeader, supplierOperatorAddr) // Add numRelays of relays to the session tree. FillSessionTree( ctx, t, sessionTree, numRelays, computeUnitsPerRelay, - supplierKeyUid, supplierAddr, + supplierKeyUid, supplierOperatorAddr, reqHeader, resHeader, keyRing, ringClient, @@ -51,7 +51,7 @@ func NewFilledSessionTree( func NewEmptySessionTree( t *testing.T, sessionTreeHeader *sessiontypes.SessionHeader, - supplierAddr string, + supplierOperatorAddr string, ) relayer.SessionTree { t.Helper() @@ -64,7 +64,7 @@ func NewEmptySessionTree( _ = os.RemoveAll(testSessionTreeStoreDir) }) - accAddress := cosmostypes.MustAccAddressFromBech32(supplierAddr) + accAddress := cosmostypes.MustAccAddressFromBech32(supplierOperatorAddr) // Construct a session tree to add relays to and generate a proof from. sessionTree, err := session.NewSessionTree( @@ -84,7 +84,7 @@ func FillSessionTree( ctx context.Context, t *testing.T, sessionTree relayer.SessionTree, numRelays, computeUnitsPerRelay uint64, - supplierKeyUid, supplierAddr string, + supplierOperatorKeyUid, supplierOperatorAddr string, reqHeader, resHeader *sessiontypes.SessionHeader, keyRing keyring.Keyring, ringClient crypto.RingClient, @@ -94,7 +94,7 @@ func FillSessionTree( for i := 0; i < int(numRelays); i++ { relay := testrelayer.NewSignedEmptyRelay( ctx, t, - supplierKeyUid, supplierAddr, + supplierOperatorKeyUid, supplierOperatorAddr, reqHeader, resHeader, keyRing, ringClient, @@ -113,7 +113,7 @@ func FillSessionTree( // NewProof creates a new proof structure. func NewProof( t *testing.T, - supplierAddr string, + supplierOperatorAddr string, sessionHeader *sessiontypes.SessionHeader, sessionTree relayer.SessionTree, closestProofPath []byte, @@ -130,22 +130,22 @@ func NewProof( require.NoError(t, err) return &prooftypes.Proof{ - SupplierAddress: supplierAddr, - SessionHeader: sessionHeader, - ClosestMerkleProof: merkleProofBz, + SupplierOperatorAddress: supplierOperatorAddr, + SessionHeader: sessionHeader, + ClosestMerkleProof: merkleProofBz, } } func NewClaim( t *testing.T, - supplierAddr string, + supplierOperatorAddr string, sessionHeader *sessiontypes.SessionHeader, rootHash []byte, ) *prooftypes.Claim { // Create a new claim. return &prooftypes.Claim{ - SupplierAddress: supplierAddr, - SessionHeader: sessionHeader, - RootHash: rootHash, + SupplierOperatorAddress: supplierOperatorAddr, + SessionHeader: sessionHeader, + RootHash: rootHash, } } diff --git a/x/application/module/query.go b/x/application/module/query.go index 6662ea51c..16d157750 100644 --- a/x/application/module/query.go +++ b/x/application/module/query.go @@ -10,7 +10,7 @@ import ( ) // GetQueryCmd returns the cli query commands for this module -// TODO_TECHDEBT(@bryanchriswhite, #370): remove if custom query commands are consolidated into AutoCLI. +// TODO_MAINNET(#370): remove if custom query commands are consolidated into AutoCLI. func (am AppModule) GetQueryCmd() *cobra.Command { // Group application queries under a subcommand cmd := &cobra.Command{ diff --git a/x/application/module/tx.go b/x/application/module/tx.go index c74852a65..9f959b171 100644 --- a/x/application/module/tx.go +++ b/x/application/module/tx.go @@ -10,7 +10,7 @@ import ( ) // GetTxCmd returns the transaction commands for this module -// TODO_TECHDEBT(@bryanchriswhite, #370): remove if custom query commands are consolidated into AutoCLI. +// TODO_MAINNET(#370): remove if custom query commands are consolidated into AutoCLI. func (am AppModule) GetTxCmd() *cobra.Command { cmd := &cobra.Command{ Use: types.ModuleName, diff --git a/x/gateway/module/query.go b/x/gateway/module/query.go index aa76ee607..8d9aea636 100644 --- a/x/gateway/module/query.go +++ b/x/gateway/module/query.go @@ -10,7 +10,7 @@ import ( ) // GetQueryCmd returns the cli query commands for this module -// TODO_TECHDEBT(@bryanchriswhite, #370): remove if custom query commands are consolidated into AutoCLI. +// TODO_MAINNET(#370): remove if custom query commands are consolidated into AutoCLI. func (am AppModule) GetQueryCmd() *cobra.Command { // Group gateway queries under a subcommand cmd := &cobra.Command{ diff --git a/x/gateway/module/tx.go b/x/gateway/module/tx.go index 5d473c1b1..a6b9cea86 100644 --- a/x/gateway/module/tx.go +++ b/x/gateway/module/tx.go @@ -10,7 +10,7 @@ import ( ) // GetTxCmd returns the transaction commands for this module -// TODO_TECHDEBT(@bryanchriswhite, #370): remove if custom query commands are consolidated into AutoCLI. +// TODO_MAINNET(#370): remove if custom query commands are consolidated into AutoCLI. func (am AppModule) GetTxCmd() *cobra.Command { cmd := &cobra.Command{ Use: types.ModuleName, diff --git a/x/proof/keeper/claim.go b/x/proof/keeper/claim.go index 4660a4451..dac4060cc 100644 --- a/x/proof/keeper/claim.go +++ b/x/proof/keeper/claim.go @@ -20,58 +20,58 @@ func (k Keeper) UpsertClaim(ctx context.Context, claim types.Claim) { primaryStore := prefix.NewStore(storeAdapter, types.KeyPrefix(types.ClaimPrimaryKeyPrefix)) sessionId := claim.GetSessionHeader().GetSessionId() - primaryKey := types.ClaimPrimaryKey(sessionId, claim.SupplierAddress) + primaryKey := types.ClaimPrimaryKey(sessionId, claim.SupplierOperatorAddress) primaryStore.Set(primaryKey, claimBz) - logger.Info(fmt.Sprintf("upserted claim for supplier %s with primaryKey %s", claim.SupplierAddress, primaryKey)) + logger.Info(fmt.Sprintf("upserted claim for supplier %s with primaryKey %s", claim.SupplierOperatorAddress, primaryKey)) - // Update the address index: supplierAddress -> [ClaimPrimaryKey] - supplierAddrStore := prefix.NewStore(storeAdapter, types.KeyPrefix(types.ClaimSupplierAddressPrefix)) - supplierAddrKey := types.ClaimSupplierAddressKey(claim.SupplierAddress, primaryKey) - supplierAddrStore.Set(supplierAddrKey, primaryKey) - logger.Info(fmt.Sprintf("indexed claim for supplier %s with primaryKey %s", claim.SupplierAddress, primaryKey)) + // Update the address index: supplierOperatorAddress -> [ClaimPrimaryKey] + supplierOperatorAddrStore := prefix.NewStore(storeAdapter, types.KeyPrefix(types.ClaimSupplierOperatorAddressPrefix)) + supplierOperatorAddrKey := types.ClaimSupplierOperatorAddressKey(claim.SupplierOperatorAddress, primaryKey) + supplierOperatorAddrStore.Set(supplierOperatorAddrKey, primaryKey) + logger.Info(fmt.Sprintf("indexed claim for supplier %s with primaryKey %s", claim.SupplierOperatorAddress, primaryKey)) // Update the session end height index: sessionEndHeight -> [ClaimPrimaryKey] sessionEndHeightStore := prefix.NewStore(storeAdapter, types.KeyPrefix(types.ClaimSessionEndHeightPrefix)) sessionEndHeight := claim.GetSessionHeader().GetSessionEndBlockHeight() sessionEndHeightKey := types.ClaimSupplierEndSessionHeightKey(sessionEndHeight, primaryKey) sessionEndHeightStore.Set(sessionEndHeightKey, primaryKey) - logger.Info(fmt.Sprintf("indexed claim for supplier %s at session ending height %d", claim.SupplierAddress, sessionEndHeight)) + logger.Info(fmt.Sprintf("indexed claim for supplier %s at session ending height %d", claim.SupplierOperatorAddress, sessionEndHeight)) } // GetClaim returns a claim from its index -func (k Keeper) GetClaim(ctx context.Context, sessionId, supplierAddr string) (_ types.Claim, isClaimFound bool) { - return k.getClaimByPrimaryKey(ctx, types.ClaimPrimaryKey(sessionId, supplierAddr)) +func (k Keeper) GetClaim(ctx context.Context, sessionId, supplierOperatorAddr string) (_ types.Claim, isClaimFound bool) { + return k.getClaimByPrimaryKey(ctx, types.ClaimPrimaryKey(sessionId, supplierOperatorAddr)) } // RemoveClaim removes a claim from the store -func (k Keeper) RemoveClaim(ctx context.Context, sessionId, supplierAddr string) { +func (k Keeper) RemoveClaim(ctx context.Context, sessionId, supplierOperatorAddr string) { logger := k.Logger().With("method", "RemoveClaim") storeAdapter := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) primaryStore := prefix.NewStore(storeAdapter, types.KeyPrefix(types.ClaimPrimaryKeyPrefix)) // Check if the claim exists - primaryKey := types.ClaimPrimaryKey(sessionId, supplierAddr) + primaryKey := types.ClaimPrimaryKey(sessionId, supplierOperatorAddr) foundClaim, isClaimFound := k.getClaimByPrimaryKey(ctx, primaryKey) if !isClaimFound { - logger.Error(fmt.Sprintf("trying to delete non-existent claim with primary key %s for supplier %s and session %s", primaryKey, supplierAddr, sessionId)) + logger.Error(fmt.Sprintf("trying to delete non-existent claim with primary key %s for supplier %s and session %s", primaryKey, supplierOperatorAddr, sessionId)) return } // Prepare the indices for deletion - supplierAddrStore := prefix.NewStore(storeAdapter, types.KeyPrefix(types.ClaimSupplierAddressPrefix)) + supplierOperatorAddrStore := prefix.NewStore(storeAdapter, types.KeyPrefix(types.ClaimSupplierOperatorAddressPrefix)) sessionEndHeightStore := prefix.NewStore(storeAdapter, types.KeyPrefix(types.ClaimSessionEndHeightPrefix)) - supplierAddrKey := types.ClaimSupplierAddressKey(foundClaim.GetSupplierAddress(), primaryKey) + supplierOperatorAddrKey := types.ClaimSupplierOperatorAddressKey(foundClaim.GetSupplierOperatorAddress(), primaryKey) sessionEndHeight := foundClaim.GetSessionHeader().GetSessionEndBlockHeight() sessionEndHeightKey := types.ClaimSupplierEndSessionHeightKey(sessionEndHeight, primaryKey) // Delete all the entries (primary store and secondary indices) primaryStore.Delete(primaryKey) - supplierAddrStore.Delete(supplierAddrKey) + supplierOperatorAddrStore.Delete(supplierOperatorAddrKey) sessionEndHeightStore.Delete(sessionEndHeightKey) - logger.Info(fmt.Sprintf("deleted claim with primary key %s for supplier %s and session %s", primaryKey, supplierAddr, sessionId)) + logger.Info(fmt.Sprintf("deleted claim with primary key %s for supplier %s and session %s", primaryKey, supplierOperatorAddr, sessionId)) } // GetAllClaims returns all claim diff --git a/x/proof/keeper/claim_test.go b/x/proof/keeper/claim_test.go index 36dae6204..a39b7fdf3 100644 --- a/x/proof/keeper/claim_test.go +++ b/x/proof/keeper/claim_test.go @@ -23,7 +23,7 @@ func createNClaims(keeper keeper.Keeper, ctx context.Context, n int) []types.Cla claims := make([]types.Claim, n) for i := range claims { - claims[i].SupplierAddress = sample.AccAddress() + claims[i].SupplierOperatorAddress = sample.AccAddress() claims[i].SessionHeader = &sessiontypes.SessionHeader{ SessionId: fmt.Sprintf("session-%d", i), SessionEndBlockHeight: int64(i), @@ -43,7 +43,7 @@ func TestClaimGet(t *testing.T) { foundClaim, isClaimFound := keeper.GetClaim( ctx, claim.GetSessionHeader().GetSessionId(), - claim.SupplierAddress, + claim.SupplierOperatorAddress, ) require.True(t, isClaimFound) require.Equal(t, @@ -58,8 +58,8 @@ func TestClaimRemove(t *testing.T) { for _, claim := range claims { sessionId := claim.GetSessionHeader().GetSessionId() - keeper.RemoveClaim(ctx, sessionId, claim.SupplierAddress) - _, isClaimFound := keeper.GetClaim(ctx, sessionId, claim.SupplierAddress) + keeper.RemoveClaim(ctx, sessionId, claim.SupplierOperatorAddress) + _, isClaimFound := keeper.GetClaim(ctx, sessionId, claim.SupplierOperatorAddress) require.False(t, isClaimFound) } } diff --git a/x/proof/keeper/msg_server_create_claim.go b/x/proof/keeper/msg_server_create_claim.go index eccf4a324..3e6c5cf6e 100644 --- a/x/proof/keeper/msg_server_create_claim.go +++ b/x/proof/keeper/msg_server_create_claim.go @@ -46,16 +46,16 @@ func (k msgServer) CreateClaim( logger.Info("validated the createClaim message") // Compare msg session header w/ on-chain session header. - session, err := k.queryAndValidateSessionHeader(ctx, msg.GetSessionHeader(), msg.GetSupplierAddress()) + session, err := k.queryAndValidateSessionHeader(ctx, msg.GetSessionHeader(), msg.GetSupplierOperatorAddress()) if err != nil { return nil, status.Error(codes.InvalidArgument, err.Error()) } // Construct and insert claim claim = types.Claim{ - SupplierAddress: msg.GetSupplierAddress(), - SessionHeader: session.GetHeader(), - RootHash: msg.GetRootHash(), + SupplierOperatorAddress: msg.GetSupplierOperatorAddress(), + SessionHeader: session.GetHeader(), + RootHash: msg.GetRootHash(), } // Helpers for logging the same metadata throughout this function calls @@ -63,12 +63,12 @@ func (k msgServer) CreateClaim( With( "session_id", session.GetSessionId(), "session_end_height", claim.SessionHeader.GetSessionEndBlockHeight(), - "supplier", msg.GetSupplierAddress(), + "supplier_operator_address", msg.GetSupplierOperatorAddress(), ) // Validate claim message commit height is within the respective session's // claim creation window using the on-chain session header. - if err = k.validateClaimWindow(ctx, claim.SessionHeader, claim.SupplierAddress); err != nil { + if err = k.validateClaimWindow(ctx, claim.SessionHeader, claim.SupplierOperatorAddress); err != nil { return nil, status.Error(codes.FailedPrecondition, err.Error()) } @@ -81,7 +81,7 @@ func (k msgServer) CreateClaim( if err != nil { return nil, status.Error(codes.Internal, types.ErrProofInvalidClaimRootHash.Wrap(err.Error()).Error()) } - _, isExistingClaim = k.Keeper.GetClaim(ctx, claim.GetSessionHeader().GetSessionId(), claim.GetSupplierAddress()) + _, isExistingClaim = k.Keeper.GetClaim(ctx, claim.GetSessionHeader().GetSessionId(), claim.GetSupplierOperatorAddress()) // TODO_UPNEXT(#705): Check (and test) that numClaimComputeUnits is equal // to num_relays * the_compute_units_per_relay for this_service. diff --git a/x/proof/keeper/msg_server_create_claim_test.go b/x/proof/keeper/msg_server_create_claim_test.go index fb3f7f4bd..c215e77ec 100644 --- a/x/proof/keeper/msg_server_create_claim_test.go +++ b/x/proof/keeper/msg_server_create_claim_test.go @@ -32,7 +32,7 @@ var defaultMerkleRoot = testproof.SmstRootWithSumAndCount(expectedNumComputeUnit func TestMsgServer_CreateClaim_Success(t *testing.T) { var claimWindowOpenBlockHash []byte - supplierAddr := sample.AccAddress() + supplierOperatorAddr := sample.AccAddress() tests := []struct { desc string @@ -48,7 +48,7 @@ func TestMsgServer_CreateClaim_Success(t *testing.T) { sharedParams, queryHeight, claimWindowOpenBlockHash, - supplierAddr, + supplierOperatorAddr, ) }, }, @@ -81,7 +81,7 @@ func TestMsgServer_CreateClaim_Success(t *testing.T) { appAddr := sample.AccAddress() keepers.SetSupplier(ctx, sharedtypes.Supplier{ - Address: supplierAddr, + OperatorAddress: supplierOperatorAddr, Services: []*sharedtypes.SupplierServiceConfig{ {Service: service}, }, @@ -116,7 +116,7 @@ func TestMsgServer_CreateClaim_Success(t *testing.T) { claimMsg := newTestClaimMsg(t, sessionStartHeight, sessionRes.GetSession().GetSessionId(), - supplierAddr, + supplierOperatorAddr, appAddr, service, defaultMerkleRoot, @@ -137,7 +137,7 @@ func TestMsgServer_CreateClaim_Success(t *testing.T) { claim := claims[0] claimSessionHeader := claim.GetSessionHeader() require.Equal(t, claimMsg.SessionHeader.SessionId, claimSessionHeader.GetSessionId()) - require.Equal(t, claimMsg.SupplierAddress, claim.GetSupplierAddress()) + require.Equal(t, claimMsg.SupplierOperatorAddress, claim.GetSupplierOperatorAddress()) require.Equal(t, claimMsg.SessionHeader.GetSessionEndBlockHeight(), claimSessionHeader.GetSessionEndBlockHeight()) require.Equal(t, claimMsg.RootHash, claim.GetRootHash()) @@ -177,11 +177,11 @@ func TestMsgServer_CreateClaim_Error_OutsideOfWindow(t *testing.T) { ComputeUnitsPerRelay: computeUnitsPerRelay, OwnerAddress: sample.AccAddress(), } - supplierAddr := sample.AccAddress() + supplierOperatorAddr := sample.AccAddress() appAddr := sample.AccAddress() keepers.SetSupplier(ctx, sharedtypes.Supplier{ - Address: supplierAddr, + OperatorAddress: supplierOperatorAddr, Services: []*sharedtypes.SupplierServiceConfig{ {Service: service}, }, @@ -215,7 +215,7 @@ func TestMsgServer_CreateClaim_Error_OutsideOfWindow(t *testing.T) { &sharedParams, sessionHeader.GetSessionEndBlockHeight(), claimWindowOpenBlockHash, - supplierAddr, + supplierOperatorAddr, ) tests := []struct { @@ -235,7 +235,7 @@ func TestMsgServer_CreateClaim_Error_OutsideOfWindow(t *testing.T) { &sharedParams, sessionHeader.GetSessionEndBlockHeight(), claimWindowOpenBlockHash, - supplierAddr, + supplierOperatorAddr, ), ).Error(), ), @@ -264,7 +264,7 @@ func TestMsgServer_CreateClaim_Error_OutsideOfWindow(t *testing.T) { claimMsg := newTestClaimMsg(t, sessionStartHeight, sessionRes.GetSession().GetSessionId(), - supplierAddr, + supplierOperatorAddr, appAddr, service, defaultMerkleRoot, @@ -299,12 +299,12 @@ func TestMsgServer_CreateClaim_Error(t *testing.T) { ComputeUnitsPerRelay: computeUnitsPerRelay, OwnerAddress: sample.AccAddress(), } - // supplierAddr is staked for "svc1" such that it is expected to be in the session. - supplierAddr := sample.AccAddress() - // wrongSupplierAddr is staked for "nosvc1" such that it is *not* expected to be in the session. - wrongSupplierAddr := sample.AccAddress() - // randSupplierAddr is *not* staked for any service. - randSupplierAddr := sample.AccAddress() + // supplierOperatorAddr is staked for "svc1" such that it is expected to be in the session. + supplierOperatorAddr := sample.AccAddress() + // wrongSupplierOperatorAddr is staked for "nosvc1" such that it is *not* expected to be in the session. + wrongSupplierOperatorAddr := sample.AccAddress() + // randSupplierOperatorAddr is *not* staked for any service. + randSupplierOperatorAddr := sample.AccAddress() // appAddr is staked for "svc1" such that it is expected to be in the session. appAddr := sample.AccAddress() @@ -318,7 +318,7 @@ func TestMsgServer_CreateClaim_Error(t *testing.T) { // Add a supplier that is expected to be in the session. supplierKeeper.SetSupplier(ctx, sharedtypes.Supplier{ - Address: supplierAddr, + OperatorAddress: supplierOperatorAddr, Services: []*sharedtypes.SupplierServiceConfig{ {Service: service}, }, @@ -326,7 +326,7 @@ func TestMsgServer_CreateClaim_Error(t *testing.T) { // Add a supplier that is *not* expected to be in the session. supplierKeeper.SetSupplier(ctx, sharedtypes.Supplier{ - Address: wrongSupplierAddr, + OperatorAddress: wrongSupplierOperatorAddr, Services: []*sharedtypes.SupplierServiceConfig{ { Service: &sharedtypes.Service{ @@ -375,7 +375,7 @@ func TestMsgServer_CreateClaim_Error(t *testing.T) { sessionResSuppliers := sessionRes.GetSession().GetSuppliers() require.NotEmpty(t, sessionResSuppliers) - require.Equal(t, supplierAddr, sessionResSuppliers[0].GetAddress()) + require.Equal(t, supplierOperatorAddr, sessionResSuppliers[0].GetOperatorAddress()) tests := []struct { desc string @@ -389,7 +389,7 @@ func TestMsgServer_CreateClaim_Error(t *testing.T) { sessionStartHeight, // Use a session ID that doesn't match. "invalid_session_id", - supplierAddr, + supplierOperatorAddr, appAddr, service, defaultMerkleRoot, @@ -405,13 +405,13 @@ func TestMsgServer_CreateClaim_Error(t *testing.T) { ), }, { - desc: "claim msg supplier address must be in the session", + desc: "claim msg supplier operator address must be in the session", claimMsgFn: func(t *testing.T) *types.MsgCreateClaim { return newTestClaimMsg(t, sessionStartHeight, sessionRes.GetSession().GetSessionId(), - // Use a supplier address not included in the session. - wrongSupplierAddr, + // Use a supplier operator address not included in the session. + wrongSupplierOperatorAddr, appAddr, service, defaultMerkleRoot, @@ -420,20 +420,20 @@ func TestMsgServer_CreateClaim_Error(t *testing.T) { expectedErr: status.Error( codes.InvalidArgument, types.ErrProofNotFound.Wrapf( - "supplier address %q not found in session ID %q", - wrongSupplierAddr, + "supplier operator address %q not found in session ID %q", + wrongSupplierOperatorAddr, sessionRes.GetSession().GetSessionId(), ).Error(), ), }, { - desc: "claim msg supplier address must exist on-chain", + desc: "claim msg supplier operator address must exist on-chain", claimMsgFn: func(t *testing.T) *types.MsgCreateClaim { return newTestClaimMsg(t, sessionStartHeight, sessionRes.GetSession().GetSessionId(), - // Use a supplier address that's nonexistent on-chain. - randSupplierAddr, + // Use a supplier operat address that's nonexistent on-chain. + randSupplierOperatorAddr, appAddr, service, defaultMerkleRoot, @@ -442,8 +442,8 @@ func TestMsgServer_CreateClaim_Error(t *testing.T) { expectedErr: status.Error( codes.InvalidArgument, types.ErrProofNotFound.Wrapf( - "supplier address %q not found in session ID %q", - randSupplierAddr, + "supplier operator address %q not found in session ID %q", + randSupplierOperatorAddr, sessionRes.GetSession().GetSessionId(), ).Error(), ), @@ -454,7 +454,7 @@ func TestMsgServer_CreateClaim_Error(t *testing.T) { return newTestClaimMsg(t, sessionStartHeight, sessionRes.GetSession().GetSessionId(), - supplierAddr, + supplierOperatorAddr, // Use an application address not included in the session. wrongAppAddr, service, @@ -476,7 +476,7 @@ func TestMsgServer_CreateClaim_Error(t *testing.T) { return newTestClaimMsg(t, sessionStartHeight, sessionRes.GetSession().GetSessionId(), - supplierAddr, + supplierOperatorAddr, // Use an application address that's nonexistent on-chain. randAppAddr, service, @@ -512,7 +512,7 @@ func newTestClaimMsg( t *testing.T, sessionStartHeight int64, sessionId string, - supplierAddr string, + supplierOperatorAddr string, appAddr string, service *sharedtypes.Service, merkleRoot smt.MerkleSumRoot, @@ -520,7 +520,7 @@ func newTestClaimMsg( t.Helper() return types.NewMsgCreateClaim( - supplierAddr, + supplierOperatorAddr, &sessiontypes.SessionHeader{ ApplicationAddress: appAddr, Service: service, diff --git a/x/proof/keeper/msg_server_submit_proof.go b/x/proof/keeper/msg_server_submit_proof.go index 2d95b1dff..d15dd9b6a 100644 --- a/x/proof/keeper/msg_server_submit_proof.go +++ b/x/proof/keeper/msg_server_submit_proof.go @@ -66,33 +66,33 @@ func (k msgServer) SubmitProof( logger.Info("validated the submitProof message") // Compare msg session header w/ on-chain session header. - session, err := k.queryAndValidateSessionHeader(ctx, msg.GetSessionHeader(), msg.GetSupplierAddress()) + session, err := k.queryAndValidateSessionHeader(ctx, msg.GetSessionHeader(), msg.GetSupplierOperatorAddress()) if err != nil { return nil, status.Error(codes.InvalidArgument, err.Error()) } // Construct the proof proof := types.Proof{ - SupplierAddress: msg.GetSupplierAddress(), - SessionHeader: session.GetHeader(), - ClosestMerkleProof: msg.GetProof(), + SupplierOperatorAddress: msg.GetSupplierOperatorAddress(), + SessionHeader: session.GetHeader(), + ClosestMerkleProof: msg.GetProof(), } // Helpers for logging the same metadata throughout this function calls logger = logger.With( "session_id", proof.SessionHeader.SessionId, "session_end_height", proof.SessionHeader.SessionEndBlockHeight, - "supplier", proof.SupplierAddress) + "supplier_operator_address", proof.SupplierOperatorAddress) // Validate proof message commit height is within the respective session's // proof submission window using the on-chain session header. - if err = k.validateProofWindow(ctx, proof.SessionHeader, proof.SupplierAddress); err != nil { + if err = k.validateProofWindow(ctx, proof.SessionHeader, proof.SupplierOperatorAddress); err != nil { return nil, status.Error(codes.FailedPrecondition, err.Error()) } // Retrieve the corresponding claim for the proof submitted so it can be // used in the proof validation below. - claim, err = k.queryAndValidateClaimForProof(ctx, proof.SessionHeader, proof.SupplierAddress) + claim, err = k.queryAndValidateClaimForProof(ctx, proof.SessionHeader, proof.SupplierOperatorAddress) if err != nil { return nil, status.Error(codes.Internal, types.ErrProofClaimNotFound.Wrap(err.Error()).Error()) } @@ -106,7 +106,7 @@ func (k msgServer) SubmitProof( if err != nil { return nil, status.Error(codes.Internal, types.ErrProofInvalidClaimRootHash.Wrap(err.Error()).Error()) } - _, isExistingProof = k.GetProof(ctx, proof.SessionHeader.SessionId, proof.SupplierAddress) + _, isExistingProof = k.GetProof(ctx, proof.SessionHeader.SessionId, proof.SupplierOperatorAddress) // Upsert the proof k.UpsertProof(ctx, proof) diff --git a/x/proof/keeper/msg_server_submit_proof_test.go b/x/proof/keeper/msg_server_submit_proof_test.go index 090fdc19e..66b317707 100644 --- a/x/proof/keeper/msg_server_submit_proof_test.go +++ b/x/proof/keeper/msg_server_submit_proof_test.go @@ -30,7 +30,7 @@ import ( // TODO_TECHDEBT(@bryanchriswhite): Simplify this file; https://github.com/pokt-network/poktroll/pull/417#pullrequestreview-1958582600 const ( - supplierUid = "supplier" + supplierOperatorUid = "supplier" ) var ( @@ -57,17 +57,17 @@ func TestMsgServer_SubmitProof_Success(t *testing.T) { getProofMsgHeight func( sharedParams *sharedtypes.Params, queryHeight int64, - supplierAddr string, + supplierOperatorAddr string, ) int64 }{ { desc: "proof message height equals supplier's earliest proof commit height", - getProofMsgHeight: func(sharedParams *sharedtypes.Params, queryHeight int64, supplierAddr string) int64 { + getProofMsgHeight: func(sharedParams *sharedtypes.Params, queryHeight int64, supplierOperatorAddr string) int64 { return shared.GetEarliestSupplierProofCommitHeight( sharedParams, queryHeight, blockHeaderHash, - supplierAddr, + supplierOperatorAddr, ) }, }, @@ -103,9 +103,9 @@ func TestMsgServer_SubmitProof_Success(t *testing.T) { // Create accounts in the account keeper with corresponding keys in the // keyring for the application and supplier. - supplierAddr := testkeyring.CreateOnChainAccount( + supplierOperatorAddr := testkeyring.CreateOnChainAccount( ctx, t, - supplierUid, + supplierOperatorUid, keyRing, keepers, preGeneratedAccts, @@ -125,7 +125,7 @@ func TestMsgServer_SubmitProof_Success(t *testing.T) { } // Add a supplier and application pair that are expected to be in the session. - keepers.AddServiceActors(ctx, t, service, supplierAddr, appAddr) + keepers.AddServiceActors(ctx, t, service, supplierOperatorAddr, appAddr) // Get the session for the application/supplier pair which is expected // to be claimed and for which a valid proof would be accepted. @@ -151,7 +151,7 @@ func TestMsgServer_SubmitProof_Success(t *testing.T) { sessionTree := testtree.NewFilledSessionTree( ctx, t, numRelays, service.ComputeUnitsPerRelay, - supplierUid, supplierAddr, + supplierOperatorUid, supplierOperatorAddr, sessionHeader, sessionHeader, sessionHeader, keyRing, ringClient, @@ -162,14 +162,14 @@ func TestMsgServer_SubmitProof_Success(t *testing.T) { &sharedParams, sessionHeader.GetSessionEndBlockHeight(), blockHeaderHash, - supplierAddr, + supplierOperatorAddr, ) ctx = keepertest.SetBlockHeight(ctx, claimMsgHeight) // Create a valid claim. claim := createClaimAndStoreBlockHash( ctx, t, 1, - supplierAddr, + supplierOperatorAddr, appAddr, service, sessionTree, @@ -183,7 +183,7 @@ func TestMsgServer_SubmitProof_Success(t *testing.T) { &sharedParams, sessionHeader.GetSessionEndBlockHeight(), blockHeaderHash, - supplierAddr, + supplierOperatorAddr, ) ctx = keepertest.SetBlockHeight(ctx, earliestSupplierProofCommitHeight-1) @@ -195,11 +195,11 @@ func TestMsgServer_SubmitProof_Success(t *testing.T) { expectedMerkleProofPath = protocol.GetPathForProof(blockHeaderHash, sessionHeader.GetSessionId()) // Advance the block height to the test proof msg height. - proofMsgHeight := test.getProofMsgHeight(&sharedParams, sessionHeader.GetSessionEndBlockHeight(), supplierAddr) + proofMsgHeight := test.getProofMsgHeight(&sharedParams, sessionHeader.GetSessionEndBlockHeight(), supplierOperatorAddr) ctx = keepertest.SetBlockHeight(ctx, proofMsgHeight) proofMsg := newTestProofMsg(t, - supplierAddr, + supplierOperatorAddr, sessionHeader, sessionTree, expectedMerkleProofPath, @@ -214,7 +214,7 @@ func TestMsgServer_SubmitProof_Success(t *testing.T) { proofs := proofRes.GetProofs() require.Lenf(t, proofs, 1, "expected 1 proof, got %d", len(proofs)) require.Equal(t, proofMsg.SessionHeader.SessionId, proofs[0].GetSessionHeader().GetSessionId()) - require.Equal(t, proofMsg.SupplierAddress, proofs[0].GetSupplierAddress()) + require.Equal(t, proofMsg.SupplierOperatorAddress, proofs[0].GetSupplierOperatorAddress()) require.Equal(t, proofMsg.SessionHeader.GetSessionEndBlockHeight(), proofs[0].GetSessionHeader().GetSessionEndBlockHeight()) events := sdkCtx.EventManager().Events() @@ -255,9 +255,9 @@ func TestMsgServer_SubmitProof_Error_OutsideOfWindow(t *testing.T) { preGeneratedAccts := testkeyring.PreGeneratedAccounts() // Create accounts in the account keeper with corresponding keys in the keyring for the application and supplier. - supplierAddr := testkeyring.CreateOnChainAccount( + supplierOperatorAddr := testkeyring.CreateOnChainAccount( ctx, t, - supplierUid, + supplierOperatorUid, keyRing, keepers, preGeneratedAccts, @@ -277,7 +277,7 @@ func TestMsgServer_SubmitProof_Error_OutsideOfWindow(t *testing.T) { } // Add a supplier and application pair that are expected to be in the session. - keepers.AddServiceActors(ctx, t, service, supplierAddr, appAddr) + keepers.AddServiceActors(ctx, t, service, supplierOperatorAddr, appAddr) // Get the session for the application/supplier pair which is expected // to be claimed and for which a valid proof would be accepted. @@ -302,7 +302,7 @@ func TestMsgServer_SubmitProof_Error_OutsideOfWindow(t *testing.T) { sessionTree := testtree.NewFilledSessionTree( ctx, t, numRelays, service.ComputeUnitsPerRelay, - supplierUid, supplierAddr, + supplierOperatorUid, supplierOperatorAddr, sessionHeader, sessionHeader, sessionHeader, keyRing, ringClient, @@ -314,7 +314,7 @@ func TestMsgServer_SubmitProof_Error_OutsideOfWindow(t *testing.T) { &sharedParams, sessionHeader.GetSessionEndBlockHeight(), claimWindowOpenHeightBlockHash, - supplierAddr, + supplierOperatorAddr, ) sdkCtx := cosmostypes.UnwrapSDKContext(ctx) sdkCtx = sdkCtx.WithBlockHeight(claimMsgHeight) @@ -323,7 +323,7 @@ func TestMsgServer_SubmitProof_Error_OutsideOfWindow(t *testing.T) { // Create a valid claim. createClaimAndStoreBlockHash( ctx, t, 1, - supplierAddr, + supplierOperatorAddr, appAddr, service, sessionTree, @@ -336,7 +336,7 @@ func TestMsgServer_SubmitProof_Error_OutsideOfWindow(t *testing.T) { &sharedParams, sessionHeader.GetSessionEndBlockHeight(), proofWindowOpenHeightBlockHash, - supplierAddr, + supplierOperatorAddr, ) proofWindowCloseHeight := shared.GetProofWindowCloseHeight(&sharedParams, sessionHeader.GetSessionEndBlockHeight()) @@ -379,7 +379,7 @@ func TestMsgServer_SubmitProof_Error_OutsideOfWindow(t *testing.T) { ctx = sdkCtx proofMsg := newTestProofMsg(t, - supplierAddr, + supplierOperatorAddr, sessionHeader, sessionTree, expectedMerkleProofPath, @@ -424,14 +424,14 @@ func TestMsgServer_SubmitProof_Error(t *testing.T) { // Create accounts in the account keeper with corresponding keys in the keyring // for the applications and suppliers used in the tests. - supplierAddr := testkeyring.CreateOnChainAccount( + supplierOperatorAddr := testkeyring.CreateOnChainAccount( ctx, t, - supplierUid, + supplierOperatorUid, keyRing, keepers, preGeneratedAccts, ).String() - wrongSupplierAddr := testkeyring.CreateOnChainAccount( + wrongSupplierOperatorAddr := testkeyring.CreateOnChainAccount( ctx, t, "wrong_supplier", keyRing, @@ -465,10 +465,10 @@ func TestMsgServer_SubmitProof_Error(t *testing.T) { } // Add a supplier and application pair that are expected to be in the session. - keepers.AddServiceActors(ctx, t, service, supplierAddr, appAddr) + keepers.AddServiceActors(ctx, t, service, supplierOperatorAddr, appAddr) // Add a supplier and application pair that are *not* expected to be in the session. - keepers.AddServiceActors(ctx, t, wrongService, wrongSupplierAddr, wrongAppAddr) + keepers.AddServiceActors(ctx, t, wrongService, wrongSupplierOperatorAddr, wrongAppAddr) // Get the session for the application/supplier pair which is expected // to be claimed and for which a valid proof would be accepted. @@ -496,7 +496,7 @@ func TestMsgServer_SubmitProof_Error(t *testing.T) { validSessionTree := testtree.NewFilledSessionTree( ctx, t, numRelays, service.ComputeUnitsPerRelay, - supplierUid, supplierAddr, + supplierOperatorUid, supplierOperatorAddr, validSessionHeader, validSessionHeader, validSessionHeader, keyRing, ringClient, @@ -508,7 +508,7 @@ func TestMsgServer_SubmitProof_Error(t *testing.T) { &sharedParams, validSessionHeader.GetSessionEndBlockHeight(), blockHeaderHash, - supplierAddr, + supplierOperatorAddr, ) sdkCtx := cosmostypes.UnwrapSDKContext(ctx) sdkCtx = sdkCtx.WithBlockHeight(claimMsgHeight) @@ -518,7 +518,7 @@ func TestMsgServer_SubmitProof_Error(t *testing.T) { // store for the corresponding session. createClaimAndStoreBlockHash( ctx, t, 1, - supplierAddr, + supplierOperatorAddr, appAddr, service, validSessionTree, @@ -541,7 +541,7 @@ func TestMsgServer_SubmitProof_Error(t *testing.T) { // Construct new proof message. return newTestProofMsg(t, - supplierAddr, + supplierOperatorAddr, &emptySessionIdHeader, validSessionTree, expectedMerkleProofPath, @@ -561,7 +561,7 @@ func TestMsgServer_SubmitProof_Error(t *testing.T) { newProofMsg: func(t *testing.T) *prooftypes.MsgSubmitProof { // Construct new proof message. proof := newTestProofMsg(t, - supplierAddr, + supplierOperatorAddr, validSessionHeader, validSessionTree, expectedMerkleProofPath, @@ -583,7 +583,7 @@ func TestMsgServer_SubmitProof_Error(t *testing.T) { newProofMsg: func(t *testing.T) *prooftypes.MsgSubmitProof { // Construct new proof message using the wrong session ID. return newTestProofMsg(t, - supplierAddr, + supplierOperatorAddr, &wrongSessionIdHeader, validSessionTree, expectedMerkleProofPath, @@ -603,7 +603,7 @@ func TestMsgServer_SubmitProof_Error(t *testing.T) { newProofMsg: func(t *testing.T) *prooftypes.MsgSubmitProof { // Construct a proof message with a supplier that does not belong in the session. return newTestProofMsg(t, - wrongSupplierAddr, + wrongSupplierOperatorAddr, validSessionHeader, validSessionTree, expectedMerkleProofPath, @@ -612,8 +612,8 @@ func TestMsgServer_SubmitProof_Error(t *testing.T) { expectedErr: status.Error( codes.InvalidArgument, prooftypes.ErrProofNotFound.Wrapf( - "supplier address %q not found in session ID %q", - wrongSupplierAddr, + "supplier operator address %q not found in session ID %q", + wrongSupplierOperatorAddr, validSessionHeader.GetSessionId(), ).Error(), ), @@ -630,7 +630,7 @@ func TestMsgServer_SubmitProof_Error(t *testing.T) { &sharedParams, proofMsg.GetSessionHeader().GetSessionEndBlockHeight(), blockHeaderHash, - proofMsg.GetSupplierAddress(), + proofMsg.GetSupplierOperatorAddress(), ) ctx = keepertest.SetBlockHeight(ctx, earliestSupplierProofCommitHeight-1) @@ -665,7 +665,7 @@ func TestMsgServer_SubmitProof_Error(t *testing.T) { // to be validated and stored on-chain. func newTestProofMsg( t *testing.T, - supplierAddr string, + supplierOperatorAddr string, sessionHeader *sessiontypes.SessionHeader, sessionTree relayer.SessionTree, closestProofPath []byte, @@ -682,9 +682,9 @@ func newTestProofMsg( require.NoError(t, err) return &prooftypes.MsgSubmitProof{ - SupplierAddress: supplierAddr, - SessionHeader: sessionHeader, - Proof: merkleProofBz, + SupplierOperatorAddress: supplierOperatorAddr, + SessionHeader: sessionHeader, + Proof: merkleProofBz, } } @@ -696,7 +696,7 @@ func createClaimAndStoreBlockHash( ctx context.Context, t *testing.T, sessionStartHeight int64, - supplierAddr, appAddr string, + supplierOperatorAddr, appAddr string, service *sharedtypes.Service, sessionTree relayer.SessionTree, sessionHeader *sessiontypes.SessionHeader, @@ -710,7 +710,7 @@ func createClaimAndStoreBlockHash( claimMsg := newTestClaimMsg(t, sessionStartHeight, sessionHeader.GetSessionId(), - supplierAddr, + supplierOperatorAddr, appAddr, service, merkleRootBz, @@ -732,7 +732,7 @@ func createClaimAndStoreBlockHash( &sharedParams, sessionStartHeight, sdkCtx.HeaderHash(), - supplierAddr, + supplierOperatorAddr, ) // Set block height to be after the session grace period. diff --git a/x/proof/keeper/proof.go b/x/proof/keeper/proof.go index 7fd1d40e9..1309920a0 100644 --- a/x/proof/keeper/proof.go +++ b/x/proof/keeper/proof.go @@ -22,19 +22,19 @@ func (k Keeper) UpsertProof(ctx context.Context, proof types.Proof) { primaryStore := prefix.NewStore(storeAdapter, types.KeyPrefix(types.ProofPrimaryKeyPrefix)) sessionId := proof.GetSessionHeader().GetSessionId() - primaryKey := types.ProofPrimaryKey(sessionId, proof.GetSupplierAddress()) + primaryKey := types.ProofPrimaryKey(sessionId, proof.GetSupplierOperatorAddress()) primaryStore.Set(primaryKey, proofBz) logger.Info( - fmt.Sprintf("upserted proof for supplier %s with primaryKey %s", proof.GetSupplierAddress(), primaryKey), + fmt.Sprintf("upserted proof for supplier %s with primaryKey %s", proof.GetSupplierOperatorAddress(), primaryKey), ) - // Update the address index: supplierAddress -> [ProofPrimaryKey] - supplierAddrStore := prefix.NewStore(storeAdapter, types.KeyPrefix(types.ProofSupplierAddressPrefix)) - supplierAddrKey := types.ProofSupplierAddressKey(proof.GetSupplierAddress(), primaryKey) - supplierAddrStore.Set(supplierAddrKey, primaryKey) + // Update the address index: supplierOperatorAddress -> [ProofPrimaryKey] + supplierOperatorAddrStore := prefix.NewStore(storeAdapter, types.KeyPrefix(types.ProofSupplierOperatorAddressPrefix)) + supplierOperatorAddrKey := types.ProofSupplierOperatorAddressKey(proof.GetSupplierOperatorAddress(), primaryKey) + supplierOperatorAddrStore.Set(supplierOperatorAddrKey, primaryKey) - logger.Info(fmt.Sprintf("indexed Proof for supplier %s with primaryKey %s", proof.GetSupplierAddress(), primaryKey)) + logger.Info(fmt.Sprintf("indexed Proof for supplier %s with primaryKey %s", proof.GetSupplierOperatorAddress(), primaryKey)) // Update the session end height index: sessionEndHeight -> [ProofPrimaryKey] sessionEndHeightStore := prefix.NewStore(storeAdapter, types.KeyPrefix(types.ProofSessionEndHeightPrefix)) @@ -44,26 +44,26 @@ func (k Keeper) UpsertProof(ctx context.Context, proof types.Proof) { } // GetProof returns a proof from its index -func (k Keeper) GetProof(ctx context.Context, sessionId, supplierAddr string) (_ types.Proof, isProofFound bool) { - return k.getProofByPrimaryKey(ctx, types.ProofPrimaryKey(sessionId, supplierAddr)) +func (k Keeper) GetProof(ctx context.Context, sessionId, supplierOperatorAddr string) (_ types.Proof, isProofFound bool) { + return k.getProofByPrimaryKey(ctx, types.ProofPrimaryKey(sessionId, supplierOperatorAddr)) } // RemoveProof removes a proof from the store -func (k Keeper) RemoveProof(ctx context.Context, sessionId, supplierAddr string) { +func (k Keeper) RemoveProof(ctx context.Context, sessionId, supplierOperatorAddr string) { logger := k.Logger().With("method", "RemoveProof") storeAdapter := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) primaryStore := prefix.NewStore(storeAdapter, types.KeyPrefix(types.ProofPrimaryKeyPrefix)) // Check if the proof exists - primaryKey := types.ProofPrimaryKey(sessionId, supplierAddr) + primaryKey := types.ProofPrimaryKey(sessionId, supplierOperatorAddr) foundProof, isProofFound := k.getProofByPrimaryKey(ctx, primaryKey) if !isProofFound { logger.Error( fmt.Sprintf( "trying to delete non-existent proof with primary key %s for supplier %s and session %s", primaryKey, - supplierAddr, + supplierOperatorAddr, sessionId, ), ) @@ -71,23 +71,23 @@ func (k Keeper) RemoveProof(ctx context.Context, sessionId, supplierAddr string) } // Prepare the indices for deletion - supplierAddrStore := prefix.NewStore(storeAdapter, types.KeyPrefix(types.ProofSupplierAddressPrefix)) + supplierOperatorAddrStore := prefix.NewStore(storeAdapter, types.KeyPrefix(types.ProofSupplierOperatorAddressPrefix)) sessionEndHeightStore := prefix.NewStore(storeAdapter, types.KeyPrefix(types.ProofSessionEndHeightPrefix)) - supplierAddrKey := types.ProofSupplierAddressKey(foundProof.GetSupplierAddress(), primaryKey) + supplierOperatorAddrKey := types.ProofSupplierOperatorAddressKey(foundProof.GetSupplierOperatorAddress(), primaryKey) sessionEndHeight := foundProof.GetSessionHeader().GetSessionEndBlockHeight() sessionEndHeightKey := types.ProofSupplierEndSessionHeightKey(sessionEndHeight, primaryKey) // Delete all the entries (primary store and secondary indices) primaryStore.Delete(primaryKey) - supplierAddrStore.Delete(supplierAddrKey) + supplierOperatorAddrStore.Delete(supplierOperatorAddrKey) sessionEndHeightStore.Delete(sessionEndHeightKey) logger.Info( fmt.Sprintf( "deleted proof with primary key %s for supplier %s and session %s", primaryKey, - supplierAddr, + supplierOperatorAddr, sessionId, ), ) diff --git a/x/proof/keeper/proof_test.go b/x/proof/keeper/proof_test.go index d27ed7494..d2bcc9c18 100644 --- a/x/proof/keeper/proof_test.go +++ b/x/proof/keeper/proof_test.go @@ -31,7 +31,7 @@ func createNProofs(keeper keeper.Keeper, ctx context.Context, n int) []types.Pro for i := range proofs { proofs[i] = types.Proof{ - SupplierAddress: sample.AccAddress(), + SupplierOperatorAddress: sample.AccAddress(), SessionHeader: &sessiontypes.SessionHeader{ ApplicationAddress: sample.AccAddress(), Service: &sharedtypes.Service{Id: testServiceId}, @@ -56,7 +56,7 @@ func TestProofGet(t *testing.T) { foundProof, isProofFound := keeper.GetProof( ctx, proof.GetSessionHeader().GetSessionId(), - proof.GetSupplierAddress(), + proof.GetSupplierOperatorAddress(), ) require.True(t, isProofFound) require.Equal(t, @@ -70,8 +70,8 @@ func TestProofRemove(t *testing.T) { proofs := createNProofs(keeper, ctx, 10) for _, proof := range proofs { sessionId := proof.GetSessionHeader().GetSessionId() - keeper.RemoveProof(ctx, sessionId, proof.GetSupplierAddress()) - _, isProofFound := keeper.GetProof(ctx, sessionId, proof.GetSupplierAddress()) + keeper.RemoveProof(ctx, sessionId, proof.GetSupplierOperatorAddress()) + _, isProofFound := keeper.GetProof(ctx, sessionId, proof.GetSupplierOperatorAddress()) require.False(t, isProofFound) } } diff --git a/x/proof/keeper/proof_validation.go b/x/proof/keeper/proof_validation.go index bd4afac74..aa041bcad 100644 --- a/x/proof/keeper/proof_validation.go +++ b/x/proof/keeper/proof_validation.go @@ -60,16 +60,16 @@ func (k Keeper) EnsureValidProof( ) error { logger := k.Logger().With("method", "ValidateProof") - // Retrieve the supplier's public key. - supplierAddr := proof.SupplierAddress - supplierPubKey, err := k.accountQuerier.GetPubKeyFromAddress(ctx, supplierAddr) + // Retrieve the supplier operator's public key. + supplierOperatorAddr := proof.SupplierOperatorAddress + supplierOperatorPubKey, err := k.accountQuerier.GetPubKeyFromAddress(ctx, supplierOperatorAddr) if err != nil { return err } // Validate the session header. var onChainSession *sessiontypes.Session - onChainSession, err = k.queryAndValidateSessionHeader(ctx, proof.SessionHeader, supplierAddr) + onChainSession, err = k.queryAndValidateSessionHeader(ctx, proof.SessionHeader, supplierOperatorAddr) if err != nil { return err } @@ -82,7 +82,7 @@ func (k Keeper) EnsureValidProof( // Validate proof message commit height is within the respective session's // proof submission window using the on-chain session header. - if err = k.validateProofWindow(ctx, sessionHeader, supplierAddr); err != nil { + if err = k.validateProofWindow(ctx, sessionHeader, supplierOperatorAddr); err != nil { return err } @@ -118,11 +118,11 @@ func (k Keeper) EnsureValidProof( } logger.Debug("successfully validated relay request") - // Make sure that the supplier address in the proof matches the one in the relay request. - if supplierAddr != relayReq.Meta.SupplierAddress { + // Make sure that the supplier operator address in the proof matches the one in the relay request. + if supplierOperatorAddr != relayReq.Meta.SupplierOperatorAddress { return types.ErrProofSupplierMismatch.Wrapf("supplier type mismatch") } - logger.Debug("the proof supplier address matches the relay request supplier address") + logger.Debug("the proof supplier operator address matches the relay request supplier operator address") // Basic validation of the relay response. relayRes := relay.GetRes() @@ -150,7 +150,7 @@ func (k Keeper) EnsureValidProof( logger.Debug("successfully verified relay request signature") // Verify the relay response's signature. - if err = relayRes.VerifySupplierSignature(supplierPubKey); err != nil { + if err = relayRes.VerifySupplierOperatorSignature(supplierOperatorPubKey); err != nil { return err } logger.Debug("successfully verified relay response signature") @@ -179,7 +179,7 @@ func (k Keeper) EnsureValidProof( ctx, sparseMerkleClosestProof, sessionHeader, - supplierAddr, + supplierOperatorAddr, ); err != nil { return err } @@ -187,7 +187,7 @@ func (k Keeper) EnsureValidProof( // Retrieve the corresponding claim for the proof submitted so it can be // used in the proof validation below. - claim, err := k.queryAndValidateClaimForProof(ctx, sessionHeader, supplierAddr) + claim, err := k.queryAndValidateClaimForProof(ctx, sessionHeader, supplierOperatorAddr) if err != nil { return err } @@ -211,7 +211,7 @@ func (k Keeper) validateClosestPath( ctx context.Context, proof *smt.SparseMerkleClosestProof, sessionHeader *sessiontypes.SessionHeader, - supplierAddr string, + supplierOperatorAddr string, ) error { // The RelayMiner has to wait until the submit claim and proof windows is are open // in order to to create the claim and submit claims and proofs, respectively. @@ -229,7 +229,7 @@ func (k Keeper) validateClosestPath( earliestSupplierProofCommitHeight, err := k.sharedQuerier.GetEarliestSupplierProofCommitHeight( ctx, sessionHeader.GetSessionEndBlockHeight(), - supplierAddr, + supplierOperatorAddr, ) if err != nil { return err @@ -257,23 +257,23 @@ func (k Keeper) validateClosestPath( } // queryAndValidateClaimForProof ensures that a claim corresponding to the given -// proof's session exists & has a matching supplier address and session header, +// proof's session exists & has a matching supplier operator address and session header, // it then returns the corresponding claim if the validation is successful. func (k Keeper) queryAndValidateClaimForProof( ctx context.Context, sessionHeader *sessiontypes.SessionHeader, - supplierAddr string, + supplierOperatorAddr string, ) (*types.Claim, error) { sessionId := sessionHeader.SessionId - // NB: no need to assert the testSessionId or supplier address as it is retrieved + // NB: no need to assert the testSessionId or supplier operator address as it is retrieved // by respective values of the given proof. I.e., if the claim exists, then these // values are guaranteed to match. - foundClaim, found := k.GetClaim(ctx, sessionId, supplierAddr) + foundClaim, found := k.GetClaim(ctx, sessionId, supplierOperatorAddr) if !found { return nil, types.ErrProofClaimNotFound.Wrapf( "no claim found for session ID %q and supplier %q", sessionId, - supplierAddr, + supplierOperatorAddr, ) } diff --git a/x/proof/keeper/proof_validation_test.go b/x/proof/keeper/proof_validation_test.go index 4c1655723..13df2e49a 100644 --- a/x/proof/keeper/proof_validation_test.go +++ b/x/proof/keeper/proof_validation_test.go @@ -50,14 +50,14 @@ func TestEnsureValidProof_Error(t *testing.T) { // Create accounts in the account keeper with corresponding keys in the keyring // for the applications and suppliers used in the tests. - supplierAddr := testkeyring.CreateOnChainAccount( + supplierOperatorAddr := testkeyring.CreateOnChainAccount( ctx, t, - supplierUid, + supplierOperatorUid, keyRing, keepers, preGeneratedAccts, ).String() - wrongSupplierAddr := testkeyring.CreateOnChainAccount( + wrongSupplierOperatorAddr := testkeyring.CreateOnChainAccount( ctx, t, "wrong_supplier", keyRing, @@ -87,10 +87,10 @@ func TestEnsureValidProof_Error(t *testing.T) { wrongService := &sharedtypes.Service{Id: "wrong_svc"} // Add a supplier and application pair that are expected to be in the session. - keepers.AddServiceActors(ctx, t, service, supplierAddr, appAddr) + keepers.AddServiceActors(ctx, t, service, supplierOperatorAddr, appAddr) // Add a supplier and application pair that are *not* expected to be in the session. - keepers.AddServiceActors(ctx, t, wrongService, wrongSupplierAddr, wrongAppAddr) + keepers.AddServiceActors(ctx, t, wrongService, wrongSupplierOperatorAddr, wrongAppAddr) // Get the session for the application/supplier pair which is expected // to be claimed and for which a valid proof would be accepted. @@ -122,7 +122,7 @@ func TestEnsureValidProof_Error(t *testing.T) { validSessionTree := testtree.NewFilledSessionTree( ctx, t, numRelays, service.ComputeUnitsPerRelay, - supplierUid, supplierAddr, + supplierOperatorUid, supplierOperatorAddr, validSessionHeader, validSessionHeader, validSessionHeader, keyRing, ringClient, @@ -134,7 +134,7 @@ func TestEnsureValidProof_Error(t *testing.T) { &sharedParams, validSessionHeader.GetSessionEndBlockHeight(), blockHeaderHash, - supplierAddr, + supplierOperatorAddr, ) sdkCtx := cosmostypes.UnwrapSDKContext(ctx) sdkCtx = sdkCtx.WithBlockHeight(claimMsgHeight) @@ -144,9 +144,9 @@ func TestEnsureValidProof_Error(t *testing.T) { require.NoError(t, err) claim := prooftypes.Claim{ - SessionHeader: validSessionHeader, - SupplierAddress: supplierAddr, - RootHash: merkleRootBz, + SessionHeader: validSessionHeader, + SupplierOperatorAddress: supplierOperatorAddr, + RootHash: merkleRootBz, } keepers.UpsertClaim(ctx, claim) @@ -164,11 +164,11 @@ func TestEnsureValidProof_Error(t *testing.T) { // Construct a relay to be mangled such that it fails to deserialize in order // to set the error expectation for the relevant test case. - mangledRelay := testrelayer.NewEmptyRelay(validSessionHeader, validSessionHeader, supplierAddr) + mangledRelay := testrelayer.NewEmptyRelay(validSessionHeader, validSessionHeader, supplierOperatorAddr) // Ensure valid relay request and response signatures. testrelayer.SignRelayRequest(ctx, t, mangledRelay, appAddr, keyRing, ringClient) - testrelayer.SignRelayResponse(ctx, t, mangledRelay, supplierUid, supplierAddr, keyRing) + testrelayer.SignRelayResponse(ctx, t, mangledRelay, supplierOperatorUid, supplierOperatorAddr, keyRing) // Serialize the relay so that it can be mangled. mangledRelayBz, err := mangledRelay.Marshal() @@ -207,7 +207,7 @@ func TestEnsureValidProof_Error(t *testing.T) { // Construct new proof message. return testtree.NewProof(t, - supplierAddr, + supplierOperatorAddr, &emptySessionIdHeader, validSessionTree, expectedMerkleProofPath) @@ -223,7 +223,7 @@ func TestEnsureValidProof_Error(t *testing.T) { newProof: func(t *testing.T) *prooftypes.Proof { // Construct new proof message. proof := testtree.NewProof(t, - supplierAddr, + supplierOperatorAddr, validSessionHeader, validSessionTree, expectedMerkleProofPath, @@ -242,7 +242,7 @@ func TestEnsureValidProof_Error(t *testing.T) { newProof: func(t *testing.T) *prooftypes.Proof { // Construct new proof message using the wrong session ID. return testtree.NewProof(t, - supplierAddr, + supplierOperatorAddr, &wrongSessionIdHeader, validSessionTree, expectedMerkleProofPath, @@ -259,15 +259,15 @@ func TestEnsureValidProof_Error(t *testing.T) { newProof: func(t *testing.T) *prooftypes.Proof { // Construct a proof message with a supplier that does not belong in the session. return testtree.NewProof(t, - wrongSupplierAddr, + wrongSupplierOperatorAddr, validSessionHeader, validSessionTree, expectedMerkleProofPath, ) }, expectedErr: prooftypes.ErrProofNotFound.Wrapf( - "supplier address %q not found in session ID %q", - wrongSupplierAddr, + "supplier operator address %q not found in session ID %q", + wrongSupplierOperatorAddr, validSessionHeader.GetSessionId(), ), }, @@ -276,7 +276,7 @@ func TestEnsureValidProof_Error(t *testing.T) { newProof: func(t *testing.T) *prooftypes.Proof { // Construct new proof message. proof := testtree.NewProof(t, - supplierAddr, + supplierOperatorAddr, validSessionHeader, validSessionTree, expectedMerkleProofPath, @@ -296,7 +296,7 @@ func TestEnsureValidProof_Error(t *testing.T) { desc: "relay must be deserializable", newProof: func(t *testing.T) *prooftypes.Proof { // Construct a session tree to which we'll add 1 unserializable relay. - mangledRelaySessionTree := testtree.NewEmptySessionTree(t, validSessionHeader, supplierAddr) + mangledRelaySessionTree := testtree.NewEmptySessionTree(t, validSessionHeader, supplierOperatorAddr) // Add the mangled relay to the session tree. err = mangledRelaySessionTree.Update([]byte{1}, mangledRelayBz, 1) @@ -313,7 +313,7 @@ func TestEnsureValidProof_Error(t *testing.T) { // Create a claim with a merkle root derived from a session tree // with an unserializable relay. claim := testtree.NewClaim(t, - supplierAddr, + supplierOperatorAddr, validSessionHeader, mangledRelayMerkleRootBz, ) @@ -323,7 +323,7 @@ func TestEnsureValidProof_Error(t *testing.T) { // Construct new proof message derived from a session tree // with an unserializable relay. return testtree.NewProof(t, - supplierAddr, + supplierOperatorAddr, validSessionHeader, mangledRelaySessionTree, expectedMerkleProofPath, @@ -344,7 +344,7 @@ func TestEnsureValidProof_Error(t *testing.T) { wrongRequestSessionIdSessionTree := testtree.NewFilledSessionTree( ctx, t, numRelays, service.ComputeUnitsPerRelay, - supplierUid, supplierAddr, + supplierOperatorUid, supplierOperatorAddr, validSessionHeader, &wrongSessionIdHeader, validSessionHeader, keyRing, ringClient, @@ -361,7 +361,7 @@ func TestEnsureValidProof_Error(t *testing.T) { // Create a claim with a merkle root derived from a relay // request containing the wrong session ID. claim := testtree.NewClaim(t, - supplierAddr, + supplierOperatorAddr, validSessionHeader, wrongRequestSessionIdMerkleRootBz, ) @@ -371,7 +371,7 @@ func TestEnsureValidProof_Error(t *testing.T) { // Construct new proof message using the valid session header, // *not* the one used in the session tree's relay request. return testtree.NewProof(t, - supplierAddr, + supplierOperatorAddr, validSessionHeader, wrongRequestSessionIdSessionTree, expectedMerkleProofPath, @@ -393,7 +393,7 @@ func TestEnsureValidProof_Error(t *testing.T) { wrongResponseSessionIdSessionTree := testtree.NewFilledSessionTree( ctx, t, numRelays, service.ComputeUnitsPerRelay, - supplierUid, supplierAddr, + supplierOperatorUid, supplierOperatorAddr, validSessionHeader, validSessionHeader, &wrongSessionIdHeader, keyRing, ringClient, @@ -410,7 +410,7 @@ func TestEnsureValidProof_Error(t *testing.T) { // Create a claim with a merkle root derived from a relay // response containing the wrong session ID. claim := testtree.NewClaim(t, - supplierAddr, + supplierOperatorAddr, validSessionHeader, wrongResponseSessionIdMerkleRootBz, ) @@ -420,7 +420,7 @@ func TestEnsureValidProof_Error(t *testing.T) { // Construct new proof message using the valid session header, // *not* the one used in the session tree's relay response. return testtree.NewProof(t, - supplierAddr, + supplierOperatorAddr, validSessionHeader, wrongResponseSessionIdSessionTree, expectedMerkleProofPath, @@ -436,18 +436,18 @@ func TestEnsureValidProof_Error(t *testing.T) { desc: "relay request signature must be valid", newProof: func(t *testing.T) *prooftypes.Proof { // Set the relay request signature to an invalid byte slice. - invalidRequestSignatureRelay := testrelayer.NewEmptyRelay(validSessionHeader, validSessionHeader, supplierAddr) + invalidRequestSignatureRelay := testrelayer.NewEmptyRelay(validSessionHeader, validSessionHeader, supplierOperatorAddr) invalidRequestSignatureRelay.Req.Meta.Signature = invalidSignatureBz // Ensure a valid relay response signature. - testrelayer.SignRelayResponse(ctx, t, invalidRequestSignatureRelay, supplierUid, supplierAddr, keyRing) + testrelayer.SignRelayResponse(ctx, t, invalidRequestSignatureRelay, supplierOperatorUid, supplierOperatorAddr, keyRing) invalidRequestSignatureRelayBz, marshalErr := invalidRequestSignatureRelay.Marshal() require.NoError(t, marshalErr) // Construct a session tree with 1 relay with a session header containing // a session ID that doesn't match the expected session ID. - invalidRequestSignatureSessionTree := testtree.NewEmptySessionTree(t, validSessionHeader, supplierAddr) + invalidRequestSignatureSessionTree := testtree.NewEmptySessionTree(t, validSessionHeader, supplierOperatorAddr) // Add the relay to the session tree. err = invalidRequestSignatureSessionTree.Update([]byte{1}, invalidRequestSignatureRelayBz, 1) @@ -465,7 +465,7 @@ func TestEnsureValidProof_Error(t *testing.T) { // with an invalid relay request signature. claim := testtree.NewClaim(t, - supplierAddr, + supplierOperatorAddr, validSessionHeader, invalidRequestSignatureMerkleRootBz, ) @@ -475,7 +475,7 @@ func TestEnsureValidProof_Error(t *testing.T) { // Construct new proof message derived from a session tree // with an invalid relay request signature. return testtree.NewProof(t, - supplierAddr, + supplierOperatorAddr, validSessionHeader, invalidRequestSignatureSessionTree, expectedMerkleProofPath, @@ -497,8 +497,8 @@ func TestEnsureValidProof_Error(t *testing.T) { desc: "relay response signature must be valid", newProof: func(t *testing.T) *prooftypes.Proof { // Set the relay response signature to an invalid byte slice. - relay := testrelayer.NewEmptyRelay(validSessionHeader, validSessionHeader, supplierAddr) - relay.Res.Meta.SupplierSignature = invalidSignatureBz + relay := testrelayer.NewEmptyRelay(validSessionHeader, validSessionHeader, supplierOperatorAddr) + relay.Res.Meta.SupplierOperatorSignature = invalidSignatureBz // Ensure a valid relay request signature testrelayer.SignRelayRequest(ctx, t, relay, appAddr, keyRing, ringClient) @@ -508,7 +508,7 @@ func TestEnsureValidProof_Error(t *testing.T) { // Construct a session tree with 1 relay with a session header containing // a session ID that doesn't match the expected session ID. - invalidResponseSignatureSessionTree := testtree.NewEmptySessionTree(t, validSessionHeader, supplierAddr) + invalidResponseSignatureSessionTree := testtree.NewEmptySessionTree(t, validSessionHeader, supplierOperatorAddr) // Add the relay to the session tree. err = invalidResponseSignatureSessionTree.Update([]byte{1}, relayBz, 1) @@ -525,7 +525,7 @@ func TestEnsureValidProof_Error(t *testing.T) { // Create a claim with a merkle root derived from a session tree // with an invalid relay response signature. claim := testtree.NewClaim(t, - supplierAddr, + supplierOperatorAddr, validSessionHeader, invalidResponseSignatureMerkleRootBz, ) @@ -535,7 +535,7 @@ func TestEnsureValidProof_Error(t *testing.T) { // Construct new proof message derived from a session tree // with an invalid relay response signature. return testtree.NewProof(t, - supplierAddr, + supplierOperatorAddr, validSessionHeader, invalidResponseSignatureSessionTree, expectedMerkleProofPath, @@ -559,7 +559,7 @@ func TestEnsureValidProof_Error(t *testing.T) { wrongPathSessionTree := testtree.NewFilledSessionTree( ctx, t, numRelays, service.ComputeUnitsPerRelay, - supplierUid, supplierAddr, + supplierOperatorUid, supplierOperatorAddr, validSessionHeader, validSessionHeader, validSessionHeader, keyRing, ringClient, @@ -573,7 +573,7 @@ func TestEnsureValidProof_Error(t *testing.T) { // Create an upsert the claim claim := testtree.NewClaim(t, - supplierAddr, + supplierOperatorAddr, validSessionHeader, wrongPathMerkleRootBz, ) @@ -582,7 +582,7 @@ func TestEnsureValidProof_Error(t *testing.T) { // Construct new proof message derived from a session tree // with an invalid relay response signature. - return testtree.NewProof(t, supplierAddr, validSessionHeader, wrongPathSessionTree, wrongClosestProofPath) + return testtree.NewProof(t, supplierOperatorAddr, validSessionHeader, wrongPathSessionTree, wrongClosestProofPath) }, expectedErr: prooftypes.ErrProofInvalidProof.Wrapf( "the path of the proof provided (%x) does not match one expected by the on-chain protocol (%x)", @@ -609,7 +609,7 @@ func TestEnsureValidProof_Error(t *testing.T) { // Construct a proof message with a session tree containing // a relay of insufficient difficulty. return testtree.NewProof(t, - supplierAddr, + supplierOperatorAddr, validSessionHeader, validSessionTree, expectedMerkleProofPath, @@ -630,7 +630,7 @@ func TestEnsureValidProof_Error(t *testing.T) { unclaimedSessionTree := testtree.NewFilledSessionTree( ctx, t, numRelays, service.ComputeUnitsPerRelay, - "wrong_supplier", wrongSupplierAddr, + "wrong_supplier", wrongSupplierOperatorAddr, unclaimedSessionHeader, unclaimedSessionHeader, unclaimedSessionHeader, keyRing, ringClient, @@ -650,7 +650,7 @@ func TestEnsureValidProof_Error(t *testing.T) { // Construct new proof message using the supplier & session header // from the session which is *not* expected to be claimed. return testtree.NewProof(t, - wrongSupplierAddr, + wrongSupplierOperatorAddr, unclaimedSessionHeader, unclaimedSessionTree, expectedMerkleProofPath, @@ -659,7 +659,7 @@ func TestEnsureValidProof_Error(t *testing.T) { expectedErr: prooftypes.ErrProofClaimNotFound.Wrapf( "no claim found for session ID %q and supplier %q", unclaimedSessionHeader.GetSessionId(), - wrongSupplierAddr, + wrongSupplierOperatorAddr, ), }, { @@ -669,7 +669,7 @@ func TestEnsureValidProof_Error(t *testing.T) { wrongMerkleRootSessionTree := testtree.NewFilledSessionTree( ctx, t, numRelays, service.ComputeUnitsPerRelay, - supplierUid, supplierAddr, + supplierOperatorUid, supplierOperatorAddr, validSessionHeader, validSessionHeader, validSessionHeader, keyRing, ringClient, @@ -683,7 +683,7 @@ func TestEnsureValidProof_Error(t *testing.T) { // Create a claim with the incorrect Merkle root. claim := testtree.NewClaim(t, - supplierAddr, + supplierOperatorAddr, validSessionHeader, wrongMerkleRootBz, ) @@ -695,7 +695,7 @@ func TestEnsureValidProof_Error(t *testing.T) { validSessionTree := testtree.NewFilledSessionTree( ctx, t, numRelays, service.ComputeUnitsPerRelay, - supplierUid, supplierAddr, + supplierOperatorUid, supplierOperatorAddr, validSessionHeader, validSessionHeader, validSessionHeader, keyRing, ringClient, @@ -711,7 +711,7 @@ func TestEnsureValidProof_Error(t *testing.T) { ) return testtree.NewProof(t, - supplierAddr, + supplierOperatorAddr, validSessionHeader, validSessionTree, expectedMerkleProofPath, @@ -734,7 +734,7 @@ func TestEnsureValidProof_Error(t *testing.T) { }, }, { - desc: "claim and proof supplier addresses must match", + desc: "claim and proof supplier operator addresses must match", newProof: func(t *testing.T) *prooftypes.Proof { t.Skip("this test case reduces to either the 'claim must exist for proof message' or 'proof session ID must match on-chain session ID cases") return nil @@ -752,7 +752,7 @@ func TestEnsureValidProof_Error(t *testing.T) { &sharedParams, proof.GetSessionHeader().GetSessionEndBlockHeight(), blockHeaderHash, - proof.GetSupplierAddress(), + proof.GetSupplierOperatorAddress(), ) ctx = keepertest.SetBlockHeight(ctx, earliestSupplierProofCommitHeight-1) diff --git a/x/proof/keeper/query_claim.go b/x/proof/keeper/query_claim.go index f02d5d242..52a0f5fbe 100644 --- a/x/proof/keeper/query_claim.go +++ b/x/proof/keeper/query_claim.go @@ -28,10 +28,10 @@ func (k Keeper) AllClaims(ctx context.Context, req *types.QueryAllClaimsRequest) ) switch filter := req.Filter.(type) { - case *types.QueryAllClaimsRequest_SupplierAddress: + case *types.QueryAllClaimsRequest_SupplierOperatorAddress: isCustomIndex = true - keyPrefix = types.KeyPrefix(types.ClaimSupplierAddressPrefix) - keyPrefix = append(keyPrefix, []byte(filter.SupplierAddress)...) + keyPrefix = types.KeyPrefix(types.ClaimSupplierOperatorAddressPrefix) + keyPrefix = append(keyPrefix, []byte(filter.SupplierOperatorAddress)...) case *types.QueryAllClaimsRequest_SessionEndHeight: isCustomIndex = true @@ -93,10 +93,10 @@ func (k Keeper) Claim(ctx context.Context, req *types.QueryGetClaimRequest) (*ty foundClaim, isClaimFound := k.GetClaim( ctx, req.SessionId, - req.SupplierAddress, + req.SupplierOperatorAddress, ) if !isClaimFound { - err := types.ErrProofClaimNotFound.Wrapf("session ID %q and supplier %q", req.SessionId, req.SupplierAddress) + err := types.ErrProofClaimNotFound.Wrapf("session ID %q and supplier %q", req.SessionId, req.SupplierOperatorAddress) return nil, status.Error(codes.NotFound, err.Error()) } diff --git a/x/proof/keeper/query_claim_test.go b/x/proof/keeper/query_claim_test.go index 5f33a3487..e791ec5fa 100644 --- a/x/proof/keeper/query_claim_test.go +++ b/x/proof/keeper/query_claim_test.go @@ -22,7 +22,7 @@ func TestClaimQuerySingle(t *testing.T) { keeper, ctx := keepertest.ProofKeeper(t) claims := createNClaims(keeper, ctx, 2) - var wrongSupplierAddr = sample.AccAddress() + var wrongSupplierOperatorAddr = sample.AccAddress() tests := []struct { desc string @@ -35,8 +35,8 @@ func TestClaimQuerySingle(t *testing.T) { desc: "First Claim", request: &types.QueryGetClaimRequest{ - SessionId: claims[0].GetSessionHeader().GetSessionId(), - SupplierAddress: claims[0].SupplierAddress, + SessionId: claims[0].GetSessionHeader().GetSessionId(), + SupplierOperatorAddress: claims[0].SupplierOperatorAddress, }, response: &types.QueryGetClaimResponse{Claim: claims[0]}, @@ -46,8 +46,8 @@ func TestClaimQuerySingle(t *testing.T) { desc: "Second Claim", request: &types.QueryGetClaimRequest{ - SessionId: claims[1].GetSessionHeader().GetSessionId(), - SupplierAddress: claims[1].SupplierAddress, + SessionId: claims[1].GetSessionHeader().GetSessionId(), + SupplierOperatorAddress: claims[1].SupplierOperatorAddress, }, response: &types.QueryGetClaimResponse{Claim: claims[1]}, @@ -57,8 +57,8 @@ func TestClaimQuerySingle(t *testing.T) { desc: "Claim Not Found - Random SessionId", request: &types.QueryGetClaimRequest{ - SessionId: "not a real session id", - SupplierAddress: claims[0].GetSupplierAddress(), + SessionId: "not a real session id", + SupplierOperatorAddress: claims[0].GetSupplierOperatorAddress(), }, expectedErr: status.Error( @@ -67,16 +67,16 @@ func TestClaimQuerySingle(t *testing.T) { // TODO_CONSIDERATION: factor out error message format strings to constants. "session ID %q and supplier %q", "not a real session id", - claims[0].GetSupplierAddress(), + claims[0].GetSupplierOperatorAddress(), ).Error(), ), }, { - desc: "Claim Not Found - Wrong Supplier Address", + desc: "Claim Not Found - Wrong Supplier Operator Address", request: &types.QueryGetClaimRequest{ - SessionId: claims[0].GetSessionHeader().GetSessionId(), - SupplierAddress: wrongSupplierAddr, + SessionId: claims[0].GetSessionHeader().GetSessionId(), + SupplierOperatorAddress: wrongSupplierOperatorAddr, }, expectedErr: status.Error( @@ -84,7 +84,7 @@ func TestClaimQuerySingle(t *testing.T) { types.ErrProofClaimNotFound.Wrapf( "session ID %q and supplier %q", claims[0].GetSessionHeader().GetSessionId(), - wrongSupplierAddr, + wrongSupplierOperatorAddr, ).Error(), ), }, @@ -92,7 +92,7 @@ func TestClaimQuerySingle(t *testing.T) { desc: "InvalidRequest - Missing SessionId", request: &types.QueryGetClaimRequest{ // SessionId explicitly omitted - SupplierAddress: claims[0].GetSupplierAddress(), + SupplierOperatorAddress: claims[0].GetSupplierOperatorAddress(), }, expectedErr: status.Error( @@ -103,16 +103,16 @@ func TestClaimQuerySingle(t *testing.T) { ), }, { - desc: "InvalidRequest - Missing SupplierAddress", + desc: "InvalidRequest - Missing SupplierOperatorAddress", request: &types.QueryGetClaimRequest{ SessionId: claims[0].GetSessionHeader().GetSessionId(), - // SupplierAddress explicitly omitted + // SupplierOperatorAddress explicitly omitted }, expectedErr: status.Error( codes.InvalidArgument, types.ErrProofInvalidAddress.Wrap( - "invalid supplier address for claim being retrieved ; (empty address string is not allowed)", + "invalid supplier operator address for claim being retrieved ; (empty address string is not allowed)", ).Error(), ), }, @@ -202,10 +202,10 @@ func TestClaimQueryPaginated(t *testing.T) { require.ErrorIs(t, err, status.Error(codes.InvalidArgument, "invalid request")) }) - t.Run("BySupplierAddress", func(t *testing.T) { + t.Run("BySupplierOperatorAddress", func(t *testing.T) { req := request(nil, 0, 0, true) - req.Filter = &types.QueryAllClaimsRequest_SupplierAddress{ - SupplierAddress: claims[0].SupplierAddress, + req.Filter = &types.QueryAllClaimsRequest_SupplierOperatorAddress{ + SupplierOperatorAddress: claims[0].SupplierOperatorAddress, } resp, err := keeper.AllClaims(ctx, req) require.NoError(t, err) diff --git a/x/proof/keeper/query_proof.go b/x/proof/keeper/query_proof.go index bc34456f3..de538e43e 100644 --- a/x/proof/keeper/query_proof.go +++ b/x/proof/keeper/query_proof.go @@ -32,10 +32,10 @@ func (k Keeper) AllProofs(ctx context.Context, req *types.QueryAllProofsRequest) ) switch filter := req.Filter.(type) { - case *types.QueryAllProofsRequest_SupplierAddress: + case *types.QueryAllProofsRequest_SupplierOperatorAddress: isCustomIndex = true - keyPrefix = types.KeyPrefix(types.ProofSupplierAddressPrefix) - keyPrefix = append(keyPrefix, []byte(filter.SupplierAddress)...) + keyPrefix = types.KeyPrefix(types.ProofSupplierOperatorAddressPrefix) + keyPrefix = append(keyPrefix, []byte(filter.SupplierOperatorAddress)...) case *types.QueryAllProofsRequest_SessionEndHeight: isCustomIndex = true keyPrefix = types.KeyPrefix(types.ProofSessionEndHeightPrefix) @@ -89,9 +89,9 @@ func (k Keeper) Proof(ctx context.Context, req *types.QueryGetProofRequest) (*ty return nil, status.Error(codes.InvalidArgument, err.Error()) } - foundProof, isProofFound := k.GetProof(ctx, req.GetSessionId(), req.GetSupplierAddress()) + foundProof, isProofFound := k.GetProof(ctx, req.GetSessionId(), req.GetSupplierOperatorAddress()) if !isProofFound { - err := types.ErrProofProofNotFound.Wrapf("session ID %q and supplier %q", req.SessionId, req.SupplierAddress) + err := types.ErrProofProofNotFound.Wrapf("session ID %q and supplier %q", req.SessionId, req.SupplierOperatorAddress) return nil, status.Error(codes.NotFound, err.Error()) } diff --git a/x/proof/keeper/query_proof_test.go b/x/proof/keeper/query_proof_test.go index b3d450b77..3d9bec5c3 100644 --- a/x/proof/keeper/query_proof_test.go +++ b/x/proof/keeper/query_proof_test.go @@ -23,7 +23,7 @@ func TestProofQuerySingle(t *testing.T) { keeper, ctx := keepertest.ProofKeeper(t) proofs := createNProofs(keeper, ctx, 2) - var randSupplierAddr = sample.AccAddress() + var randSupplierOperatorAddr = sample.AccAddress() tests := []struct { desc string request *types.QueryGetProofRequest @@ -33,46 +33,46 @@ func TestProofQuerySingle(t *testing.T) { { desc: "First", request: &types.QueryGetProofRequest{ - SessionId: proofs[0].GetSessionHeader().GetSessionId(), - SupplierAddress: proofs[0].SupplierAddress, + SessionId: proofs[0].GetSessionHeader().GetSessionId(), + SupplierOperatorAddress: proofs[0].SupplierOperatorAddress, }, response: &types.QueryGetProofResponse{Proof: proofs[0]}, }, { desc: "Second", request: &types.QueryGetProofRequest{ - SessionId: proofs[1].GetSessionHeader().GetSessionId(), - SupplierAddress: proofs[1].SupplierAddress, + SessionId: proofs[1].GetSessionHeader().GetSessionId(), + SupplierOperatorAddress: proofs[1].SupplierOperatorAddress, }, response: &types.QueryGetProofResponse{Proof: proofs[1]}, }, { desc: "Proof Not Found - Random SessionId", request: &types.QueryGetProofRequest{ - SessionId: "not a real session id", - SupplierAddress: proofs[0].GetSupplierAddress(), + SessionId: "not a real session id", + SupplierOperatorAddress: proofs[0].GetSupplierOperatorAddress(), }, expectedErr: status.Error( codes.NotFound, types.ErrProofProofNotFound.Wrapf( "session ID %q and supplier %q", "not a real session id", - proofs[0].GetSupplierAddress(), + proofs[0].GetSupplierOperatorAddress(), ).Error(), ), }, { - desc: "Proof Not Found - Random Supplier Address", + desc: "Proof Not Found - Random Supplier Operator Address", request: &types.QueryGetProofRequest{ - SessionId: proofs[0].GetSessionHeader().GetSessionId(), - SupplierAddress: randSupplierAddr, + SessionId: proofs[0].GetSessionHeader().GetSessionId(), + SupplierOperatorAddress: randSupplierOperatorAddr, }, expectedErr: status.Error( codes.NotFound, types.ErrProofProofNotFound.Wrapf( "session ID %q and supplier %q", proofs[0].GetSessionHeader().GetSessionId(), - randSupplierAddr, + randSupplierOperatorAddr, ).Error(), ), }, @@ -80,7 +80,7 @@ func TestProofQuerySingle(t *testing.T) { desc: "InvalidRequest - Missing SessionId", request: &types.QueryGetProofRequest{ // SessionId explicitly omitted - SupplierAddress: proofs[0].GetSupplierAddress(), + SupplierOperatorAddress: proofs[0].GetSupplierOperatorAddress(), }, expectedErr: status.Error( codes.InvalidArgument, @@ -90,15 +90,15 @@ func TestProofQuerySingle(t *testing.T) { ), }, { - desc: "InvalidRequest - Missing SupplierAddress", + desc: "InvalidRequest - Missing SupplierOperatorAddress", request: &types.QueryGetProofRequest{ SessionId: proofs[0].GetSessionHeader().GetSessionId(), - // SupplierAddress explicitly omitted + // SupplierOperatorAddress explicitly omitted }, expectedErr: status.Error( codes.InvalidArgument, types.ErrProofInvalidAddress.Wrap( - "invalid supplier address for proof being retrieved ; (empty address string is not allowed)", + "invalid supplier operator address for proof being retrieved ; (empty address string is not allowed)", ).Error(), ), }, diff --git a/x/proof/keeper/session.go b/x/proof/keeper/session.go index f2c3990a7..5a51130f3 100644 --- a/x/proof/keeper/session.go +++ b/x/proof/keeper/session.go @@ -12,12 +12,12 @@ import ( ) // queryAndValidateSessionHeader ensures that a session with the sessionID of the given session -// header exists and that this session includes the supplier with the given address. +// header exists and that this session includes the supplier with the given operator address. // It returns a session which is hydrated with the on-chain session data. func (k Keeper) queryAndValidateSessionHeader( ctx context.Context, sessionHeader *sessiontypes.SessionHeader, - supplierAddr string, + supplierOperatorAddr string, ) (*sessiontypes.Session, error) { logger := k.Logger().With("method", "queryAndValidateSessionHeader") @@ -39,7 +39,7 @@ func (k Keeper) queryAndValidateSessionHeader( With( "session_id", onChainSession.GetSessionId(), "session_end_height", sessionHeader.GetSessionEndBlockHeight(), - "supplier", supplierAddr, + "supplier_operator_address", supplierOperatorAddr, ). Debug("got sessionId for proof") @@ -61,11 +61,11 @@ func (k Keeper) queryAndValidateSessionHeader( // Ensure the given supplier is in the onChainSession supplier list. if isSupplerFound := foundSupplier( sessionRes.GetSession().GetSuppliers(), - supplierAddr, + supplierOperatorAddr, ); !isSupplerFound { return nil, types.ErrProofNotFound.Wrapf( - "supplier address %q not found in session ID %q", - supplierAddr, + "supplier operator address %q not found in session ID %q", + supplierOperatorAddr, sessionHeader.GetSessionId(), ) } @@ -80,7 +80,7 @@ func (k Keeper) queryAndValidateSessionHeader( func (k Keeper) validateClaimWindow( ctx context.Context, sessionHeader *sessiontypes.SessionHeader, - supplierAddr string, + supplierOperatorAddr string, ) error { logger := k.Logger().With("method", "validateClaimWindow") sharedParams := k.sharedKeeper.GetParams(ctx) @@ -95,7 +95,7 @@ func (k Keeper) validateClaimWindow( earliestClaimCommitHeight, err := k.sharedQuerier.GetEarliestSupplierClaimCommitHeight( ctx, sessionEndHeight, - supplierAddr, + supplierOperatorAddr, ) if err != nil { return err @@ -134,7 +134,7 @@ func (k Keeper) validateClaimWindow( "claim_window_open_height", claimWindowOpenHeight, "earliest_claim_commit_height", earliestClaimCommitHeight, "claim_window_close_height", claimWindowCloseHeight, - "supplier_addr", supplierAddr, + "supplier_operator_addr", supplierOperatorAddr, ). Debug("validated claim window") @@ -148,7 +148,7 @@ func (k Keeper) validateClaimWindow( func (k Keeper) validateProofWindow( ctx context.Context, sessionHeader *sessiontypes.SessionHeader, - supplierAddr string, + supplierOperatorAddr string, ) error { logger := k.Logger().With("method", "validateProofWindow") @@ -163,7 +163,7 @@ func (k Keeper) validateProofWindow( earliestProofCommitHeight, err := k.sharedQuerier.GetEarliestSupplierProofCommitHeight( ctx, sessionEndHeight, - supplierAddr, + supplierOperatorAddr, ) if err != nil { return err @@ -198,17 +198,17 @@ func (k Keeper) validateProofWindow( "proof_window_open_height", proofWindowOpenHeight, "earliest_proof_commit_height", earliestProofCommitHeight, "proof_window_close_height", proofWindowCloseHeight, - "supplier_addr", supplierAddr, + "supplier_operator_addr", supplierOperatorAddr, ). Debug("validated proof window") return nil } -// foundSupplier ensures that the given supplier address is in the given list of suppliers. -func foundSupplier(suppliers []*sharedtypes.Supplier, supplierAddr string) bool { +// foundSupplier ensures that the given supplier operator address is in the given list of suppliers. +func foundSupplier(suppliers []*sharedtypes.Supplier, supplierOperatorAddr string) bool { for _, supplier := range suppliers { - if supplier.Address == supplierAddr { + if supplier.OperatorAddress == supplierOperatorAddr { return true } } diff --git a/x/proof/module/flags.go b/x/proof/module/flags.go index 3afd82824..940c9cd1e 100644 --- a/x/proof/module/flags.go +++ b/x/proof/module/flags.go @@ -1,7 +1,7 @@ package proof const ( - FlagSessionEndHeight = "session-end-height" - FlagSessionId = "session-id" - FlagSupplierAddress = "supplier-address" + FlagSessionEndHeight = "session-end-height" + FlagSessionId = "session-id" + FlagSupplierOperatorAddress = "supplier-operator-address" ) diff --git a/x/proof/module/genesis_test.go b/x/proof/module/genesis_test.go index 9f792e497..2f2effb63 100644 --- a/x/proof/module/genesis_test.go +++ b/x/proof/module/genesis_test.go @@ -21,7 +21,7 @@ func TestGenesis(t *testing.T) { ClaimList: []types.Claim{ { - SupplierAddress: sample.AccAddress(), + SupplierOperatorAddress: sample.AccAddress(), SessionHeader: &sessiontypes.SessionHeader{ SessionId: mockSessionId, ApplicationAddress: sample.AccAddress(), diff --git a/x/proof/module/helpers_test.go b/x/proof/module/helpers_test.go index 612c4df3e..3744f257f 100644 --- a/x/proof/module/helpers_test.go +++ b/x/proof/module/helpers_test.go @@ -56,14 +56,14 @@ func networkWithClaimObjects( // Create a supplier for each session in numClaimsSessions and an app for each // claim in numClaimsPerSession. - supplierAccts := make([]*testkeyring.PreGeneratedAccount, numSuppliers) - supplierAddrs := make([]string, numSuppliers) - for i := range supplierAccts { + supplierOperatorAccts := make([]*testkeyring.PreGeneratedAccount, numSuppliers) + supplierOperatorAddrs := make([]string, numSuppliers) + for i := range supplierOperatorAccts { account, ok := preGeneratedAccts.Next() require.True(t, ok) - supplierAccts[i] = account - supplierAddrs[i] = account.Address.String() + supplierOperatorAccts[i] = account + supplierOperatorAddrs[i] = account.Address.String() } appAccts := make([]*testkeyring.PreGeneratedAccount, numApps) appAddrs := make([]string, numApps) @@ -76,7 +76,7 @@ func networkWithClaimObjects( } // Construct supplier and application module genesis states given the account addresses. - supplierGenesisState := network.SupplierModuleGenesisStateWithAddresses(t, supplierAddrs) + supplierGenesisState := network.SupplierModuleGenesisStateWithAddresses(t, supplierOperatorAddrs) supplierGenesisBuffer, err := cfg.Codec.MarshalJSON(supplierGenesisState) require.NoError(t, err) @@ -89,10 +89,10 @@ func networkWithClaimObjects( // Create numSessions * numApps * numSuppliers claims. for sessionIdx := 0; sessionIdx < numSessions; sessionIdx++ { for _, appAcct := range appAccts { - for _, supplierAcct := range supplierAccts { + for _, supplierOperatorAcct := range supplierOperatorAccts { claim := newTestClaim( t, &sharedParams, - supplierAcct.Address.String(), + supplierOperatorAcct.Address.String(), testsession.GetSessionStartHeightWithDefaultParams(1), appAcct.Address.String(), ) @@ -120,8 +120,8 @@ func networkWithClaimObjects( // Initialize all the accounts sequenceIndex := 1 - for _, supplierAcct := range supplierAccts { - network.InitAccountWithSequence(t, net, supplierAcct.Address, sequenceIndex) + for _, supplierOperatorAcct := range supplierOperatorAccts { + network.InitAccountWithSequence(t, net, supplierOperatorAcct.Address, sequenceIndex) sequenceIndex++ } for _, appAcct := range appAccts { @@ -134,12 +134,12 @@ func networkWithClaimObjects( return net, claims, clientCtx } -// newTestClaim returns a new claim with the given supplier address, session start height, +// newTestClaim returns a new claim with the given supplier operator address, session start height, // and application address. It uses mock byte slices for the root hash and block hash. func newTestClaim( t *testing.T, sharedParams *sharedtypes.Params, - supplierAddr string, + supplierOperatorAddr string, sessionStartHeight int64, appAddr string, ) *types.Claim { @@ -160,7 +160,7 @@ func newTestClaim( // TODO_TECHDEBT: Forward the actual claim in the response once the response is updated to return it. return &types.Claim{ - SupplierAddress: supplierAddr, + SupplierOperatorAddress: supplierOperatorAddr, SessionHeader: &sessiontypes.SessionHeader{ ApplicationAddress: appAddr, Service: &sharedtypes.Service{Id: testServiceId}, diff --git a/x/proof/module/query.go b/x/proof/module/query.go index 9fb24e453..1f186326a 100644 --- a/x/proof/module/query.go +++ b/x/proof/module/query.go @@ -10,7 +10,7 @@ import ( ) // GetQueryCmd returns the cli query commands for this module -// TODO_TECHDEBT(@bryanchriswhite, #370): remove if custom query commands are consolidated into AutoCLI. +// TODO_MAINNET(#370): remove if custom query commands are consolidated into AutoCLI. func (am AppModule) GetQueryCmd() *cobra.Command { // Group supplier queries under a subcommand cmd := &cobra.Command{ diff --git a/x/proof/module/query_claim.go b/x/proof/module/query_claim.go index cb2ae93f8..5e8bfddd1 100644 --- a/x/proof/module/query_claim.go +++ b/x/proof/module/query_claim.go @@ -14,7 +14,7 @@ import ( func AddClaimFilterFlags(cmd *cobra.Command) { cmd.Flags().Uint64(FlagSessionEndHeight, 0, "claims whose session ends at this height will be returned") cmd.Flags().String(FlagSessionId, "", "claims matching this session id will be returned") - cmd.Flags().String(FlagSupplierAddress, "", "claims submitted by suppliers matching this address will be returned") + cmd.Flags().String(FlagSupplierOperatorAddress, "", "claims submitted by suppliers matching this operator address will be returned") } func CmdListClaims() *cobra.Command { @@ -23,13 +23,13 @@ func CmdListClaims() *cobra.Command { Short: "list all claims", Long: `List all the claims that the node being queried has in its state. -The claims can be optionally filtered by one of --session-end-height --session-id or --supplier-address flags +The claims can be optionally filtered by one of --session-end-height --session-id or --supplier-operator-address flags Example: $ poktrolld q claim list-claims --node $(POCKET_NODE) --home $(POKTROLLD_HOME) $ poktrolld q claim list-claims --session-id --node $(POCKET_NODE) --home $(POKTROLLD_HOME) $ poktrolld q claim list-claims --session-end-height --node $(POCKET_NODE) --home $(POKTROLLD_HOME) -$ poktrolld q claim list-claims --supplier-address --node $(POCKET_NODE) --home $(POKTROLLD_HOME)`, +$ poktrolld q claim list-claims --supplier-operator-address --node $(POCKET_NODE) --home $(POKTROLLD_HOME)`, Args: cobra.NoArgs, RunE: func(cmd *cobra.Command, args []string) (err error) { pageReq, pageErr := client.ReadPageRequest(cmd.Flags()) @@ -70,7 +70,7 @@ $ poktrolld q claim list-claims --supplier-address --node $(P func CmdShowClaim() *cobra.Command { cmd := &cobra.Command{ - Use: "show-claim ", + Use: "show-claim ", Short: "shows a specific claim", Long: `List a specific claim that the node being queried has access to (if it still exists). @@ -81,15 +81,15 @@ A unique claim can be defined via a ` + "`session_id`" + ` that the given ` + "` This is done to minimize the rate at which state accumulates by eliminating claims as a long-term factor to persistence requirements. Example: -$ poktrolld --home=$(POKTROLLD_HOME) q claim show-claims --node $(POCKET_NODE)`, +$ poktrolld --home=$(POKTROLLD_HOME) q claim show-claims --node $(POCKET_NODE)`, Args: cobra.ExactArgs(2), RunE: func(cmd *cobra.Command, args []string) error { sessionId := args[0] - supplierAddr := args[1] + supplierOperatorAddr := args[1] getClaimRequest := &types.QueryGetClaimRequest{ - SessionId: sessionId, - SupplierAddress: supplierAddr, + SessionId: sessionId, + SupplierOperatorAddress: supplierOperatorAddr, } if err := getClaimRequest.ValidateBasic(); err != nil { return err @@ -119,16 +119,21 @@ $ poktrolld --home=$(POKTROLLD_HOME) q claim show-claims 0 { + if supplierOperatorAddr != "" || sessionEndHeight > 0 { return err } // Set the session id filter @@ -138,15 +143,15 @@ func updateClaimsFilter(cmd *cobra.Command, req *types.QueryAllClaimsRequest) er return nil } - // Use the supplier address as the filter - if supplierAddr != "" { - // If the supplier address is set, then the other flags must not be set + // Use the supplier operator address as the filter + if supplierOperatorAddr != "" { + // If the supplier operator address is set, then the other flags must not be set if sessionId != "" || sessionEndHeight > 0 { return err } - // Set the supplier address filter - req.Filter = &types.QueryAllClaimsRequest_SupplierAddress{ - SupplierAddress: supplierAddr, + // Set the supplier operator address filter + req.Filter = &types.QueryAllClaimsRequest_SupplierOperatorAddress{ + SupplierOperatorAddress: supplierOperatorAddr, } return nil } @@ -154,7 +159,7 @@ func updateClaimsFilter(cmd *cobra.Command, req *types.QueryAllClaimsRequest) er // Use the session end height as the filter if sessionEndHeight > 0 { // If the session end height is set, then the other flags must not be set - if sessionId != "" || supplierAddr != "" { + if sessionId != "" || supplierOperatorAddr != "" { return err } // Set the session end height filter diff --git a/x/proof/module/query_claim_test.go b/x/proof/module/query_claim_test.go index 56c06cc92..70cf9e48c 100644 --- a/x/proof/module/query_claim_test.go +++ b/x/proof/module/query_claim_test.go @@ -30,62 +30,62 @@ func TestClaim_Show(t *testing.T) { fmt.Sprintf("--%s=json", cometcli.OutputFlag), } - var wrongSupplierAddr = sample.AccAddress() + var wrongSupplierOperatorAddr = sample.AccAddress() tests := []struct { - desc string - sessionId string - supplierAddr string + desc string + sessionId string + supplierOperatorAddr string claim types.Claim expectedErr error }{ { - desc: "claim found", - sessionId: claims[0].GetSessionHeader().GetSessionId(), - supplierAddr: claims[0].GetSupplierAddress(), + desc: "claim found", + sessionId: claims[0].GetSessionHeader().GetSessionId(), + supplierOperatorAddr: claims[0].GetSupplierOperatorAddress(), claim: claims[0], expectedErr: nil, }, { - desc: "claim not found (wrong session ID)", - sessionId: "wrong_session_id", - supplierAddr: claims[0].GetSupplierAddress(), + desc: "claim not found (wrong session ID)", + sessionId: "wrong_session_id", + supplierOperatorAddr: claims[0].GetSupplierOperatorAddress(), expectedErr: status.Error( codes.NotFound, types.ErrProofClaimNotFound.Wrapf( "session ID %q and supplier %q", "wrong_session_id", - claims[0].GetSupplierAddress(), + claims[0].GetSupplierOperatorAddress(), ).Error(), ), }, { - desc: "claim not found (invalid bech32 supplier address)", - sessionId: claims[0].GetSessionHeader().GetSessionId(), - supplierAddr: "invalid_bech32_supplier_address", + desc: "claim not found (invalid bech32 supplier operator address)", + sessionId: claims[0].GetSessionHeader().GetSessionId(), + supplierOperatorAddr: "invalid_bech32_supplier_operator_address", // NB: this is *NOT* a gRPC status error because the bech32 parse // error occurs during request validation (i.e. client-side). expectedErr: types.ErrProofInvalidAddress.Wrapf( // TODO_TECHDEBT: prefer using "%q" in error format strings // to disambiguate empty string from space or no output. - "invalid supplier address for claim being retrieved %s; (decoding bech32 failed: invalid separator index -1)", - "invalid_bech32_supplier_address", + "invalid supplier operator address for claim being retrieved %s; (decoding bech32 failed: invalid separator index -1)", + "invalid_bech32_supplier_operator_address", ), }, { - desc: "claim not found (wrong supplier address)", - sessionId: claims[0].GetSessionHeader().GetSessionId(), - supplierAddr: wrongSupplierAddr, + desc: "claim not found (wrong supplier operator address)", + sessionId: claims[0].GetSessionHeader().GetSessionId(), + supplierOperatorAddr: wrongSupplierOperatorAddr, expectedErr: status.Error( codes.NotFound, types.ErrProofClaimNotFound.Wrapf( "session ID %q and supplier %q", claims[0].GetSessionHeader().GetSessionId(), - wrongSupplierAddr, + wrongSupplierOperatorAddr, ).Error(), ), }, @@ -94,7 +94,7 @@ func TestClaim_Show(t *testing.T) { t.Run(test.desc, func(t *testing.T) { args := []string{ test.sessionId, - test.supplierAddr, + test.supplierOperatorAddr, } args = append(args, commonArgs...) out, err := clitestutil.ExecTestCLICmd(clientCtx, proof.CmdShowClaim(), args) @@ -107,7 +107,7 @@ func TestClaim_Show(t *testing.T) { require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) require.NotNil(t, resp.Claim) - require.Equal(t, test.claim.GetSupplierAddress(), resp.Claim.GetSupplierAddress()) + require.Equal(t, test.claim.GetSupplierOperatorAddress(), resp.Claim.GetSupplierOperatorAddress()) require.Equal(t, test.claim.GetRootHash(), resp.Claim.GetRootHash()) require.Equal(t, test.claim.GetSessionHeader(), resp.Claim.GetSessionHeader()) } @@ -201,14 +201,14 @@ func TestClaim_List(t *testing.T) { } }) - t.Run("BySupplierAddress", func(t *testing.T) { - supplierAddr := claims[0].SupplierAddress + t.Run("BySupplierOperatorAddress", func(t *testing.T) { + supplierOperatorAddr := claims[0].SupplierOperatorAddress args := prepareArgs(nil, 0, uint64(totalClaims), true) - args = append(args, fmt.Sprintf("--%s=%s", proof.FlagSupplierAddress, supplierAddr)) + args = append(args, fmt.Sprintf("--%s=%s", proof.FlagSupplierOperatorAddress, supplierOperatorAddr)) expectedClaims := make([]types.Claim, 0) for _, claim := range claims { - if claim.SupplierAddress == supplierAddr { + if claim.SupplierOperatorAddress == supplierOperatorAddr { expectedClaims = append(expectedClaims, claim) } } diff --git a/x/proof/module/query_proof.go b/x/proof/module/query_proof.go index dbc006e12..060a290a9 100644 --- a/x/proof/module/query_proof.go +++ b/x/proof/module/query_proof.go @@ -14,7 +14,7 @@ import ( func AddProofFilterFlagsToCmd(cmd *cobra.Command) { cmd.Flags().Uint64(FlagSessionEndHeight, 0, "proofs whose session ends at this height will be returned") cmd.Flags().String(FlagSessionId, "", "proofs matching this session id will be returned") - cmd.Flags().String(FlagSupplierAddress, "", "proofs submitted by suppliers matching this address will be returned") + cmd.Flags().String(FlagSupplierOperatorAddress, "", "proofs submitted by suppliers matching this operator address will be returned") } func CmdListProof() *cobra.Command { @@ -23,13 +23,13 @@ func CmdListProof() *cobra.Command { Short: "list all proofs", Long: `List all the proofs that the node being queried has in its state. -The proofs can be optionally filtered by one of --session-end-height --session-id or --supplier-address flags +The proofs can be optionally filtered by one of --session-end-height --session-id or --supplier-operator-address flags Example: $ poktrolld q proof list-proofs --node $(POCKET_NODE) --home $(POKTROLLD_HOME) $ poktrolld q proof list-proofs --session-id --node $(POCKET_NODE) --home $(POKTROLLD_HOME) $ poktrolld q proof list-proofs --session-end-height --node $(POCKET_NODE) --home $(POKTROLLD_HOME) -$ poktrolld q proof list-proofs --supplier-address --node $(POCKET_NODE) --home $(POKTROLLD_HOME)`, +$ poktrolld q proof list-proofs --supplier-operator-address --node $(POCKET_NODE) --home $(POKTROLLD_HOME)`, Args: cobra.NoArgs, RunE: func(cmd *cobra.Command, args []string) error { pageReq, err := client.ReadPageRequest(cmd.Flags()) @@ -71,22 +71,22 @@ $ poktrolld q proof list-proofs --supplier-address --node $(P func CmdShowProof() *cobra.Command { cmd := &cobra.Command{ - Use: "show-proof ", + Use: "show-proof ", Short: "shows a specific proof", Long: `List a specific proof that the node being queried has access to. A unique proof can be defined via a session_id that a given supplier participated in. Example: -$ poktrolld --home=$(POKTROLLD_HOME) q proof show-proofs --node $(POCKET_NODE)`, +$ poktrolld --home=$(POKTROLLD_HOME) q proof show-proofs --node $(POCKET_NODE)`, Args: cobra.ExactArgs(2), RunE: func(cmd *cobra.Command, args []string) (err error) { sessionId := args[0] - supplierAddr := args[1] + supplierOperatorAddr := args[1] getProofRequest := &types.QueryGetProofRequest{ - SessionId: sessionId, - SupplierAddress: supplierAddr, + SessionId: sessionId, + SupplierOperatorAddress: supplierOperatorAddr, } if err = getProofRequest.ValidateBasic(); err != nil { return err @@ -116,16 +116,21 @@ $ poktrolld --home=$(POKTROLLD_HOME) q proof show-proofs 0 { + if supplierOperatorAddr != "" || sessionEndHeight > 0 { return err } // Set the session id filter @@ -135,15 +140,15 @@ func updateProofsFilter(cmd *cobra.Command, req *types.QueryAllProofsRequest) er return nil } - // Use the supplier address as the filter - if supplierAddr != "" { - // If the supplier address is set, then the other flags must not be set + // Use the supplier operator address as the filter + if supplierOperatorAddr != "" { + // If the supplier operator address is set, then the other flags must not be set if sessionId != "" || sessionEndHeight > 0 { return err } - // Set the supplier address filter - req.Filter = &types.QueryAllProofsRequest_SupplierAddress{ - SupplierAddress: supplierAddr, + // Set the supplier operator address filter + req.Filter = &types.QueryAllProofsRequest_SupplierOperatorAddress{ + SupplierOperatorAddress: supplierOperatorAddr, } return nil } @@ -151,7 +156,7 @@ func updateProofsFilter(cmd *cobra.Command, req *types.QueryAllProofsRequest) er // Use the session end height as the filter if sessionEndHeight > 0 { // If the session end height is set, then the other flags must not be set - if sessionId != "" || supplierAddr != "" { + if sessionId != "" || supplierOperatorAddr != "" { return err } // Set the session end height filter diff --git a/x/proof/module/query_proof_test.go b/x/proof/module/query_proof_test.go index 0956cdb7d..7030b174a 100644 --- a/x/proof/module/query_proof_test.go +++ b/x/proof/module/query_proof_test.go @@ -26,7 +26,7 @@ func networkWithProofObjects(t *testing.T, n int) (*network.Network, []types.Pro state := types.GenesisState{} for i := 0; i < n; i++ { proof := types.Proof{ - SupplierAddress: sample.AccAddress(), + SupplierOperatorAddress: sample.AccAddress(), SessionHeader: &sessiontypes.SessionHeader{ SessionId: "mock_session_id", // Other fields omitted and unused for these tests. @@ -51,26 +51,26 @@ func TestShowProof(t *testing.T) { fmt.Sprintf("--%s=json", cometcli.OutputFlag), } tests := []struct { - desc string - sessionId string - supplierAddr string + desc string + sessionId string + supplierOperatorAddr string args []string expectedErr error proof types.Proof }{ { - desc: "found", - supplierAddr: proofs[0].SupplierAddress, - sessionId: proofs[0].SessionHeader.SessionId, + desc: "found", + supplierOperatorAddr: proofs[0].SupplierOperatorAddress, + sessionId: proofs[0].SessionHeader.SessionId, args: common, proof: proofs[0], }, { - desc: "not found", - supplierAddr: sample.AccAddress(), - sessionId: proofs[0].SessionHeader.SessionId, + desc: "not found", + supplierOperatorAddr: sample.AccAddress(), + sessionId: proofs[0].SessionHeader.SessionId, args: common, expectedErr: status.Error(codes.NotFound, "not found"), @@ -80,7 +80,7 @@ func TestShowProof(t *testing.T) { t.Run(test.desc, func(t *testing.T) { args := []string{ test.sessionId, - test.supplierAddr, + test.supplierOperatorAddr, } args = append(args, test.args...) out, err := clitestutil.ExecTestCLICmd(ctx, proof.CmdShowProof(), args) diff --git a/x/proof/module/tx.go b/x/proof/module/tx.go index c3c8d0215..619843fff 100644 --- a/x/proof/module/tx.go +++ b/x/proof/module/tx.go @@ -10,7 +10,7 @@ import ( ) // GetTxCmd returns the transaction commands for this module -// TODO_TECHDEBT(@bryanchriswhite, #370): remove if custom query commands are consolidated into AutoCLI. +// TODO_MAINNET(#370): remove if custom query commands are consolidated into AutoCLI. func (am AppModule) GetTxCmd() *cobra.Command { cmd := &cobra.Command{ Use: types.ModuleName, diff --git a/x/proof/simulation/create_claim.go b/x/proof/simulation/create_claim.go index 08b6b7ddb..0f6bd5419 100644 --- a/x/proof/simulation/create_claim.go +++ b/x/proof/simulation/create_claim.go @@ -19,7 +19,7 @@ func SimulateMsgCreateClaim( ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { simAccount, _ := simtypes.RandomAcc(r, accs) msg := &types.MsgCreateClaim{ - SupplierAddress: simAccount.Address.String(), + SupplierOperatorAddress: simAccount.Address.String(), } // TODO: Handling the CreateClaim simulation diff --git a/x/proof/simulation/submit_proof.go b/x/proof/simulation/submit_proof.go index 0b6bfeacb..b7261296c 100644 --- a/x/proof/simulation/submit_proof.go +++ b/x/proof/simulation/submit_proof.go @@ -19,7 +19,7 @@ func SimulateMsgSubmitProof( ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { simAccount, _ := simtypes.RandomAcc(r, accs) msg := &types.MsgSubmitProof{ - SupplierAddress: simAccount.Address.String(), + SupplierOperatorAddress: simAccount.Address.String(), } // TODO: Handling the SubmitProof simulation diff --git a/x/proof/types/claim.pb.go b/x/proof/types/claim.pb.go index b58cc16e7..d386160e4 100644 --- a/x/proof/types/claim.pb.go +++ b/x/proof/types/claim.pb.go @@ -26,7 +26,7 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // Claim is the serialized object stored on-chain for claims pending to be proven type Claim struct { - SupplierAddress string `protobuf:"bytes,1,opt,name=supplier_address,json=supplierAddress,proto3" json:"supplier_address,omitempty"` + SupplierOperatorAddress string `protobuf:"bytes,1,opt,name=supplier_operator_address,json=supplierOperatorAddress,proto3" json:"supplier_operator_address,omitempty"` // The session header of the session that this claim is for. SessionHeader *types.SessionHeader `protobuf:"bytes,2,opt,name=session_header,json=sessionHeader,proto3" json:"session_header,omitempty"` // Root hash returned from smt.SMST#Root(). @@ -66,9 +66,9 @@ func (m *Claim) XXX_DiscardUnknown() { var xxx_messageInfo_Claim proto.InternalMessageInfo -func (m *Claim) GetSupplierAddress() string { +func (m *Claim) GetSupplierOperatorAddress() string { if m != nil { - return m.SupplierAddress + return m.SupplierOperatorAddress } return "" } @@ -94,25 +94,25 @@ func init() { func init() { proto.RegisterFile("poktroll/proof/claim.proto", fileDescriptor_51f775f805f1488c) } var fileDescriptor_51f775f805f1488c = []byte{ - // 277 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x4c, 0x90, 0xc1, 0x4e, 0x83, 0x40, - 0x10, 0x86, 0x59, 0x8d, 0xc6, 0xa2, 0x56, 0x43, 0x3c, 0x20, 0x26, 0x2b, 0xf1, 0xc4, 0xa5, 0x90, - 0xe8, 0x13, 0xd8, 0x26, 0x86, 0x33, 0xbd, 0x79, 0x21, 0x14, 0xd6, 0xb2, 0x29, 0x30, 0x9b, 0x9d, - 0x6d, 0xd4, 0xb7, 0xf0, 0x55, 0x4c, 0x7c, 0x08, 0x8f, 0x8d, 0x27, 0x8f, 0x06, 0x5e, 0xc4, 0xc0, - 0x02, 0xe9, 0x69, 0x32, 0xf3, 0xcd, 0x7e, 0xb3, 0xf9, 0x4d, 0x47, 0xc0, 0x46, 0x49, 0x28, 0x8a, - 0x40, 0x48, 0x80, 0x97, 0x20, 0x2d, 0x12, 0x5e, 0xfa, 0x42, 0x82, 0x02, 0x6b, 0x3a, 0x30, 0xbf, - 0x63, 0xce, 0x75, 0x0a, 0x58, 0x02, 0xc6, 0x1d, 0x0d, 0x74, 0xa3, 0x57, 0x1d, 0x3a, 0x6a, 0x90, - 0x21, 0x72, 0xa8, 0x86, 0xaa, 0xf9, 0xdd, 0x27, 0x31, 0x8f, 0x16, 0xad, 0xda, 0x5a, 0x98, 0x97, - 0xb8, 0x15, 0xa2, 0xe0, 0x4c, 0xc6, 0x49, 0x96, 0x49, 0x86, 0x68, 0x13, 0x97, 0x78, 0x93, 0xb9, - 0xfd, 0xf3, 0x35, 0xbb, 0xea, 0xad, 0x8f, 0x9a, 0x2c, 0x95, 0xe4, 0xd5, 0x3a, 0xba, 0x18, 0x5e, - 0xf4, 0x63, 0xeb, 0xc9, 0x9c, 0xf6, 0xfe, 0x38, 0x67, 0x49, 0xc6, 0xa4, 0x7d, 0xe0, 0x12, 0xef, - 0xf4, 0xfe, 0xd6, 0x1f, 0xbf, 0x3c, 0xdc, 0x5f, 0xea, 0x1a, 0x76, 0x6b, 0xd1, 0x39, 0xee, 0xb7, - 0xd6, 0x8d, 0x39, 0x91, 0x00, 0x2a, 0xce, 0x13, 0xcc, 0xed, 0x43, 0x97, 0x78, 0x67, 0xd1, 0x49, - 0x3b, 0x08, 0x13, 0xcc, 0xe7, 0xe1, 0x77, 0x4d, 0xc9, 0xae, 0xa6, 0xe4, 0xaf, 0xa6, 0xe4, 0xa3, - 0xa1, 0xc6, 0xae, 0xa1, 0xc6, 0x6f, 0x43, 0x8d, 0x67, 0x7f, 0xcd, 0x55, 0xbe, 0x5d, 0xf9, 0x29, - 0x94, 0x41, 0x7b, 0x70, 0x56, 0x31, 0xf5, 0x0a, 0x72, 0x13, 0x8c, 0x29, 0xbc, 0xf5, 0x71, 0xaa, - 0x77, 0xc1, 0x70, 0x75, 0xdc, 0x85, 0xf0, 0xf0, 0x1f, 0x00, 0x00, 0xff, 0xff, 0x97, 0x71, 0x55, - 0xe7, 0x6d, 0x01, 0x00, 0x00, + // 287 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x4c, 0x90, 0xcf, 0x4a, 0xc3, 0x40, + 0x10, 0xc6, 0xbb, 0x8a, 0x62, 0xa3, 0xf6, 0x10, 0x04, 0xd3, 0x0a, 0x6b, 0xf0, 0x94, 0x4b, 0x13, + 0xd0, 0x27, 0xb0, 0x82, 0xe4, 0x26, 0xa4, 0x9e, 0xbc, 0x84, 0x6d, 0xb2, 0x36, 0xa1, 0x49, 0x66, + 0x99, 0xd9, 0xa2, 0xbe, 0x85, 0x0f, 0xe3, 0x13, 0x78, 0xf2, 0x58, 0x3c, 0x79, 0x94, 0xe4, 0x45, + 0x24, 0x7f, 0xf1, 0x34, 0xcc, 0xfe, 0x66, 0xbe, 0x6f, 0xe7, 0x33, 0x66, 0x0a, 0x36, 0x1a, 0x21, + 0xcb, 0x3c, 0x85, 0x00, 0xcf, 0x5e, 0x94, 0x89, 0x34, 0x77, 0x15, 0x82, 0x06, 0x73, 0xd2, 0x33, + 0xb7, 0x61, 0xb3, 0x69, 0x04, 0x94, 0x03, 0x85, 0x0d, 0xf5, 0xda, 0xa6, 0x1d, 0x9d, 0xf1, 0x41, + 0x86, 0x24, 0x51, 0x0a, 0x45, 0x5f, 0x5b, 0x7e, 0xf5, 0xc9, 0x8c, 0x83, 0xbb, 0x5a, 0xda, 0x7c, + 0x34, 0xa6, 0xb4, 0x55, 0x2a, 0x4b, 0x25, 0x86, 0xa0, 0x24, 0x0a, 0x0d, 0x18, 0x8a, 0x38, 0x46, + 0x49, 0x64, 0x31, 0x9b, 0x39, 0xe3, 0x85, 0xf5, 0xfd, 0x31, 0x3f, 0xeb, 0xe4, 0x6f, 0x5b, 0xb2, + 0xd4, 0x98, 0x16, 0xeb, 0xe0, 0xbc, 0x5f, 0x7d, 0xe8, 0x36, 0x3b, 0x6c, 0xde, 0x1b, 0x93, 0xce, + 0x30, 0x4c, 0xa4, 0x88, 0x25, 0x5a, 0x7b, 0x36, 0x73, 0x8e, 0xaf, 0x2f, 0xdd, 0xe1, 0x86, 0xfe, + 0x43, 0xcb, 0xb6, 0xfa, 0xcd, 0x58, 0x70, 0x4a, 0xff, 0x5b, 0xf3, 0xc2, 0x18, 0x23, 0x80, 0x0e, + 0x13, 0x41, 0x89, 0xb5, 0x6f, 0x33, 0xe7, 0x24, 0x38, 0xaa, 0x1f, 0x7c, 0x41, 0xc9, 0xc2, 0xff, + 0x2a, 0x39, 0xdb, 0x95, 0x9c, 0xfd, 0x96, 0x9c, 0xbd, 0x57, 0x7c, 0xb4, 0xab, 0xf8, 0xe8, 0xa7, + 0xe2, 0xa3, 0x27, 0x77, 0x9d, 0xea, 0x64, 0xbb, 0x72, 0x23, 0xc8, 0xbd, 0xda, 0x70, 0x5e, 0x48, + 0xfd, 0x02, 0xb8, 0xf1, 0x86, 0x58, 0x5e, 0xbb, 0x7c, 0xf5, 0x9b, 0x92, 0xb4, 0x3a, 0x6c, 0x52, + 0xb9, 0xf9, 0x0b, 0x00, 0x00, 0xff, 0xff, 0xb2, 0xfb, 0x84, 0x3e, 0x7e, 0x01, 0x00, 0x00, } func (m *Claim) Marshal() (dAtA []byte, err error) { @@ -154,10 +154,10 @@ func (m *Claim) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x12 } - if len(m.SupplierAddress) > 0 { - i -= len(m.SupplierAddress) - copy(dAtA[i:], m.SupplierAddress) - i = encodeVarintClaim(dAtA, i, uint64(len(m.SupplierAddress))) + if len(m.SupplierOperatorAddress) > 0 { + i -= len(m.SupplierOperatorAddress) + copy(dAtA[i:], m.SupplierOperatorAddress) + i = encodeVarintClaim(dAtA, i, uint64(len(m.SupplierOperatorAddress))) i-- dAtA[i] = 0xa } @@ -181,7 +181,7 @@ func (m *Claim) Size() (n int) { } var l int _ = l - l = len(m.SupplierAddress) + l = len(m.SupplierOperatorAddress) if l > 0 { n += 1 + l + sovClaim(uint64(l)) } @@ -233,7 +233,7 @@ func (m *Claim) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SupplierAddress", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field SupplierOperatorAddress", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -261,7 +261,7 @@ func (m *Claim) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.SupplierAddress = string(dAtA[iNdEx:postIndex]) + m.SupplierOperatorAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { diff --git a/x/proof/types/errors.go b/x/proof/types/errors.go index 7e9c64867..def99883a 100644 --- a/x/proof/types/errors.go +++ b/x/proof/types/errors.go @@ -31,6 +31,6 @@ var ( ErrProofParamInvalid = sdkerrors.Register(ModuleName, 1120, "the provided param is invalid") ErrProofClaimOutsideOfWindow = sdkerrors.Register(ModuleName, 1121, "claim attempted outside of the session's claim window") ErrProofProofOutsideOfWindow = sdkerrors.Register(ModuleName, 1122, "proof attempted outside of the session's proof window") - ErrProofSupplierMismatch = sdkerrors.Register(ModuleName, 1123, "supplier address does not match the claim or proof") + ErrProofSupplierMismatch = sdkerrors.Register(ModuleName, 1123, "supplier operator address does not match the claim or proof") ErrProofAccNotFound = sdkerrors.Register(ModuleName, 1124, "account not found") ) diff --git a/x/proof/types/genesis.go b/x/proof/types/genesis.go index 3df18ef67..cd58165d5 100644 --- a/x/proof/types/genesis.go +++ b/x/proof/types/genesis.go @@ -18,7 +18,7 @@ func (gs GenesisState) Validate() error { // Check for duplicated index in claim claimPrimaryKeyMap := make(map[string]struct{}) - // Ensure claims are unique with respect to a given session ID and supplier address. + // Ensure claims are unique with respect to a given session ID and supplier operator address. for _, claim := range gs.ClaimList { // TODO_TEST: ensure the corresponding supplier exists and is staked. @@ -31,9 +31,9 @@ func (gs GenesisState) Validate() error { } sessionId := claim.GetSessionHeader().GetSessionId() - primaryKey := string(ClaimPrimaryKey(sessionId, claim.SupplierAddress)) + primaryKey := string(ClaimPrimaryKey(sessionId, claim.SupplierOperatorAddress)) if _, ok := claimPrimaryKeyMap[primaryKey]; ok { - return fmt.Errorf("duplicated supplierAddr for claim") + return fmt.Errorf("duplicated supplierOperatorAddr for claim") } claimPrimaryKeyMap[primaryKey] = struct{}{} } @@ -43,7 +43,7 @@ func (gs GenesisState) Validate() error { for _, proof := range gs.ProofList { proofPrimaryKey := string(ProofPrimaryKey( proof.GetSessionHeader().GetSessionId(), - proof.GetSupplierAddress(), + proof.GetSupplierOperatorAddress(), )) if _, ok := proofPrimaryKeyMap[proofPrimaryKey]; ok { return fmt.Errorf("duplicated primaryKey for proof") diff --git a/x/proof/types/genesis_test.go b/x/proof/types/genesis_test.go index 1f2601f00..13db17d8b 100644 --- a/x/proof/types/genesis_test.go +++ b/x/proof/types/genesis_test.go @@ -11,7 +11,7 @@ import ( ) func TestGenesisState_Validate(t *testing.T) { - randSupplierAddr := sample.AccAddress() + randSupplierOperatorAddr := sample.AccAddress() mockSessionId := "mock_session_id" tests := []struct { @@ -30,7 +30,7 @@ func TestGenesisState_Validate(t *testing.T) { Params: types.DefaultParams(), ClaimList: []types.Claim{ { - SupplierAddress: sample.AccAddress(), + SupplierOperatorAddress: sample.AccAddress(), SessionHeader: &sessiontypes.SessionHeader{ SessionId: mockSessionId, ApplicationAddress: sample.AccAddress(), @@ -41,7 +41,7 @@ func TestGenesisState_Validate(t *testing.T) { // TODO_TEST: finish genesis proof list validation. //ProofList: []types.Proof{ // { - // SupplierAddress: sample.AccAddress(), + // SupplierOperatorAddress: sample.AccAddress(), // SessionHeader: &sessiontypes.SessionHeader{ // SessionId: mockSessionId, // ApplicationAddress: sample.AccAddress(), @@ -59,7 +59,7 @@ func TestGenesisState_Validate(t *testing.T) { Params: types.DefaultParams(), ClaimList: []types.Claim{ { - SupplierAddress: randSupplierAddr, + SupplierOperatorAddress: randSupplierOperatorAddr, SessionHeader: &sessiontypes.SessionHeader{ SessionId: mockSessionId, ApplicationAddress: sample.AccAddress(), @@ -67,7 +67,7 @@ func TestGenesisState_Validate(t *testing.T) { RootHash: []byte{1, 2, 3}, }, { - SupplierAddress: randSupplierAddr, + SupplierOperatorAddress: randSupplierOperatorAddr, SessionHeader: &sessiontypes.SessionHeader{ SessionId: mockSessionId, ApplicationAddress: sample.AccAddress(), @@ -84,7 +84,7 @@ func TestGenesisState_Validate(t *testing.T) { Params: types.DefaultParams(), ClaimList: []types.Claim{ { - SupplierAddress: sample.AccAddress(), + SupplierOperatorAddress: sample.AccAddress(), SessionHeader: &sessiontypes.SessionHeader{ SessionId: mockSessionId, ApplicationAddress: sample.AccAddress(), @@ -101,7 +101,7 @@ func TestGenesisState_Validate(t *testing.T) { Params: types.DefaultParams(), ClaimList: []types.Claim{ { - SupplierAddress: sample.AccAddress(), + SupplierOperatorAddress: sample.AccAddress(), SessionHeader: &sessiontypes.SessionHeader{ SessionId: mockSessionId, ApplicationAddress: sample.AccAddress(), diff --git a/x/proof/types/key_claim.go b/x/proof/types/key_claim.go index 73e99d7fb..d8a72b13d 100644 --- a/x/proof/types/key_claim.go +++ b/x/proof/types/key_claim.go @@ -9,23 +9,24 @@ const ( // TODO_TECHDEBT: consider renaming to ClaimSessionIDPrefix. ClaimPrimaryKeyPrefix = "Claim/primary_key/" - // ClaimSupplierAddressPrefix is the key to retrieve a Claim's Primary Key from the Address index - ClaimSupplierAddressPrefix = "Claim/address/" + // ClaimSupplierOperatorAddressPrefix is the key to retrieve a Claim's Primary Key from the Address index + ClaimSupplierOperatorAddressPrefix = "Claim/address/" // ClaimSessionEndHeightPrefix is the key to retrieve a Claim's Primary Key from the Height index ClaimSessionEndHeightPrefix = "Claim/height/" ) -// ClaimPrimaryKey returns the primary store key used to retrieve a Claim by creating a composite key of the sessionId and supplierAddr. -func ClaimPrimaryKey(sessionId, supplierAddr string) []byte { - // We are guaranteed uniqueness of the primary key if it's a composite of the (sessionId, supplierAddr) +// ClaimPrimaryKey returns the primary store key used to retrieve a Claim by creating +// a composite key of the sessionId and supplierOperatorAddr. +func ClaimPrimaryKey(sessionId, supplierOperatorAddr string) []byte { + // We are guaranteed uniqueness of the primary key if it's a composite of the (sessionId, supplierOperatorAddr) // because every supplier can only have one claim per session. - return KeyComposite([]byte(sessionId), []byte(supplierAddr)) + return KeyComposite([]byte(sessionId), []byte(supplierOperatorAddr)) } -// ClaimSupplierAddressKey returns the key used to iterate through claims given a supplier Address. -func ClaimSupplierAddressKey(supplierAddr string, primaryKey []byte) []byte { - return KeyComposite([]byte(supplierAddr), primaryKey) +// ClaimSupplierOperatorAddressKey returns the key used to iterate through claims given a supplier operator address. +func ClaimSupplierOperatorAddressKey(supplierOperatorAddr string, primaryKey []byte) []byte { + return KeyComposite([]byte(supplierOperatorAddr), primaryKey) } // ClaimSupplierEndSessionHeightKey returns the key used to iterate through claims given a session end height. diff --git a/x/proof/types/key_proof.go b/x/proof/types/key_proof.go index 5c136466a..d59d94b5b 100644 --- a/x/proof/types/key_proof.go +++ b/x/proof/types/key_proof.go @@ -9,23 +9,24 @@ const ( // TODO_TECHDEBT: consider renaming to ProofSessionIDPrefix. ProofPrimaryKeyPrefix = "Proof/primary_key/" - // ProofSupplierAddressPrefix is the key to retrieve a Proof's Primary Key from the Address index - ProofSupplierAddressPrefix = "Proof/address/" + // ProofSupplierOperatorAddressPrefix is the key to retrieve a Proof's Primary Key from the Address index + ProofSupplierOperatorAddressPrefix = "Proof/address/" // ProofSessionEndHeightPrefix is the key to retrieve a Proof's Primary Key from the Height index ProofSessionEndHeightPrefix = "Proof/height/" ) -// ProofPrimaryKey returns the primary store key used to retrieve a Proof by creating a composite key of the sessionId and supplierAddr. -func ProofPrimaryKey(sessionId, supplierAddr string) []byte { - // We are guaranteed uniqueness of the primary key if it's a composite of the (sessionId, supplierAddr). +// ProofPrimaryKey returns the primary store key used to retrieve a Proof by creating +// a composite key of the sessionId and supplierOperatorAddr. +func ProofPrimaryKey(sessionId, supplierOperatorAddr string) []byte { + // We are guaranteed uniqueness of the primary key if it's a composite of the (sessionId, supplierOperatorAddr). // because every supplier can only have one Proof per session. - return KeyComposite([]byte(sessionId), []byte(supplierAddr)) + return KeyComposite([]byte(sessionId), []byte(supplierOperatorAddr)) } -// ProofSupplierAddressKey returns the key used to iterate through Proofs given a supplier Address. -func ProofSupplierAddressKey(supplierAddr string, primaryKey []byte) []byte { - return KeyComposite([]byte(supplierAddr), primaryKey) +// ProofSupplierOperatorAddressKey returns the key used to iterate through Proofs given a supplier operator Address. +func ProofSupplierOperatorAddressKey(supplierOperatorAddr string, primaryKey []byte) []byte { + return KeyComposite([]byte(supplierOperatorAddr), primaryKey) } // ProofSupplierEndSessionHeightKey returns the key used to iterate through Proofs given a session end height. diff --git a/x/proof/types/message_create_claim.go b/x/proof/types/message_create_claim.go index 50e094d5b..3b375daf3 100644 --- a/x/proof/types/message_create_claim.go +++ b/x/proof/types/message_create_claim.go @@ -11,21 +11,21 @@ const TypeMsgCreateClaim = "create_claim" var _ sdk.Msg = (*MsgCreateClaim)(nil) func NewMsgCreateClaim( - supplierAddr string, + supplierOperatorAddr string, sessionHeader *sessiontypes.SessionHeader, rootHash []byte, ) *MsgCreateClaim { return &MsgCreateClaim{ - SupplierAddress: supplierAddr, - SessionHeader: sessionHeader, - RootHash: rootHash, + SupplierOperatorAddress: supplierOperatorAddr, + SessionHeader: sessionHeader, + RootHash: rootHash, } } func (msg *MsgCreateClaim) ValidateBasic() error { - // Validate the supplier address - if _, err := sdk.AccAddressFromBech32(msg.GetSupplierAddress()); err != nil { - return ErrProofInvalidAddress.Wrapf("%s", msg.GetSupplierAddress()) + // Validate the supplier operator address + if _, err := sdk.AccAddressFromBech32(msg.GetSupplierOperatorAddress()); err != nil { + return ErrProofInvalidAddress.Wrapf("%s", msg.GetSupplierOperatorAddress()) } // Retrieve & validate the session header diff --git a/x/proof/types/message_create_claim_test.go b/x/proof/types/message_create_claim_test.go index 68befb3ce..9aa06ef87 100644 --- a/x/proof/types/message_create_claim_test.go +++ b/x/proof/types/message_create_claim_test.go @@ -18,10 +18,10 @@ func TestMsgCreateClaim_ValidateBasic(t *testing.T) { expectedErr error }{ { - desc: "invalid supplier address", + desc: "invalid supplier operator address", msg: MsgCreateClaim{ - SupplierAddress: "invalid_address", + SupplierOperatorAddress: "invalid_address", SessionHeader: &sessiontypes.SessionHeader{ ApplicationAddress: sample.AccAddress(), Service: &sharedtypes.Service{Id: "svcId"}, @@ -33,10 +33,10 @@ func TestMsgCreateClaim_ValidateBasic(t *testing.T) { expectedErr: ErrProofInvalidAddress, }, { - desc: "valid supplier address but invalid session start height", + desc: "valid supplier operator address but invalid session start height", msg: MsgCreateClaim{ - SupplierAddress: sample.AccAddress(), + SupplierOperatorAddress: sample.AccAddress(), SessionHeader: &sessiontypes.SessionHeader{ ApplicationAddress: sample.AccAddress(), Service: &sharedtypes.Service{Id: "svcId"}, @@ -48,10 +48,10 @@ func TestMsgCreateClaim_ValidateBasic(t *testing.T) { expectedErr: ErrProofInvalidSessionHeader, }, { - desc: "valid supplier address and session start height but invalid session ID", + desc: "valid supplier operator address and session start height but invalid session ID", msg: MsgCreateClaim{ - SupplierAddress: sample.AccAddress(), + SupplierOperatorAddress: sample.AccAddress(), SessionHeader: &sessiontypes.SessionHeader{ ApplicationAddress: sample.AccAddress(), Service: &sharedtypes.Service{Id: "svcId"}, @@ -63,10 +63,10 @@ func TestMsgCreateClaim_ValidateBasic(t *testing.T) { expectedErr: ErrProofInvalidSessionHeader, }, { - desc: "valid address, session start height, session ID but invalid service", + desc: "valid operator address, session start height, session ID but invalid service", msg: MsgCreateClaim{ - SupplierAddress: sample.AccAddress(), + SupplierOperatorAddress: sample.AccAddress(), SessionHeader: &sessiontypes.SessionHeader{ ApplicationAddress: sample.AccAddress(), Service: &sharedtypes.Service{Id: "invalid service id"}, @@ -78,10 +78,10 @@ func TestMsgCreateClaim_ValidateBasic(t *testing.T) { expectedErr: ErrProofInvalidSessionHeader, }, { - desc: "valid address, session start height, session ID, service but invalid root hash", + desc: "valid operator address, session start height, session ID, service but invalid root hash", msg: MsgCreateClaim{ - SupplierAddress: sample.AccAddress(), + SupplierOperatorAddress: sample.AccAddress(), SessionHeader: &sessiontypes.SessionHeader{ ApplicationAddress: sample.AccAddress(), Service: &sharedtypes.Service{Id: "svcId"}, @@ -97,7 +97,7 @@ func TestMsgCreateClaim_ValidateBasic(t *testing.T) { desc: "all valid inputs", msg: MsgCreateClaim{ - SupplierAddress: sample.AccAddress(), + SupplierOperatorAddress: sample.AccAddress(), SessionHeader: &sessiontypes.SessionHeader{ ApplicationAddress: sample.AccAddress(), Service: &sharedtypes.Service{Id: "svcId"}, diff --git a/x/proof/types/message_submit_proof.go b/x/proof/types/message_submit_proof.go index f491a6259..b2ad02b2e 100644 --- a/x/proof/types/message_submit_proof.go +++ b/x/proof/types/message_submit_proof.go @@ -9,23 +9,23 @@ import ( var _ sdk.Msg = (*MsgSubmitProof)(nil) -func NewMsgSubmitProof(supplierAddress string, sessionHeader *sessiontypes.SessionHeader, proof []byte) *MsgSubmitProof { +func NewMsgSubmitProof(supplierOperatorAddress string, sessionHeader *sessiontypes.SessionHeader, proof []byte) *MsgSubmitProof { return &MsgSubmitProof{ - SupplierAddress: supplierAddress, - SessionHeader: sessionHeader, - Proof: proof, + SupplierOperatorAddress: supplierOperatorAddress, + SessionHeader: sessionHeader, + Proof: proof, } } -// ValidateBasic ensures that the bech32 address strings for the supplier and +// ValidateBasic ensures that the bech32 operator address strings for the supplier and // application addresses are valid and that the proof and service ID are not empty. // // TODO_BETA: Call `msg.GetSessionHeader().ValidateBasic()` once its implemented func (msg *MsgSubmitProof) ValidateBasic() error { - if _, err := sdk.AccAddressFromBech32(msg.GetSupplierAddress()); err != nil { + if _, err := sdk.AccAddressFromBech32(msg.GetSupplierOperatorAddress()); err != nil { return sdkerrors.ErrInvalidAddress.Wrapf( - "supplier address %q, error: %s", - msg.GetSupplierAddress(), + "supplier operator address %q, error: %s", + msg.GetSupplierOperatorAddress(), err, ) } diff --git a/x/proof/types/message_submit_proof_test.go b/x/proof/types/message_submit_proof_test.go index 155255d96..aaef1c1e3 100644 --- a/x/proof/types/message_submit_proof_test.go +++ b/x/proof/types/message_submit_proof_test.go @@ -24,7 +24,7 @@ func TestMsgSubmitProof_ValidateBasic(t *testing.T) { { desc: "application bech32 address is invalid", msg: MsgSubmitProof{ - SupplierAddress: sample.AccAddress(), + SupplierOperatorAddress: sample.AccAddress(), SessionHeader: &sessiontypes.SessionHeader{ ApplicationAddress: "not_a_bech32_address", Service: testService, @@ -41,9 +41,9 @@ func TestMsgSubmitProof_ValidateBasic(t *testing.T) { ), }, { - desc: "supplier bech32 address is invalid", + desc: "supplier operator bech32 address is invalid", msg: MsgSubmitProof{ - SupplierAddress: "not_a_bech32_address", + SupplierOperatorAddress: "not_a_bech32_address", SessionHeader: &sessiontypes.SessionHeader{ ApplicationAddress: sample.AccAddress(), Service: testService, @@ -54,7 +54,7 @@ func TestMsgSubmitProof_ValidateBasic(t *testing.T) { Proof: testClosestMerkleProof, }, expectedErr: sdkerrors.ErrInvalidAddress.Wrapf( - "supplier address %q, error: %s", + "supplier operator address %q, error: %s", "not_a_bech32_address", "decoding bech32 failed: invalid separator index -1", ), @@ -62,7 +62,7 @@ func TestMsgSubmitProof_ValidateBasic(t *testing.T) { { desc: "session service ID is empty", msg: MsgSubmitProof{ - SupplierAddress: sample.AccAddress(), + SupplierOperatorAddress: sample.AccAddress(), SessionHeader: &sessiontypes.SessionHeader{ ApplicationAddress: sample.AccAddress(), Service: &sharedtypes.Service{Id: ""}, @@ -77,7 +77,7 @@ func TestMsgSubmitProof_ValidateBasic(t *testing.T) { { desc: "valid message metadata", msg: MsgSubmitProof{ - SupplierAddress: sample.AccAddress(), + SupplierOperatorAddress: sample.AccAddress(), SessionHeader: &sessiontypes.SessionHeader{ ApplicationAddress: sample.AccAddress(), Service: testService, diff --git a/x/proof/types/proof.pb.go b/x/proof/types/proof.pb.go index 7a422adf0..bebd6aa99 100644 --- a/x/proof/types/proof.pb.go +++ b/x/proof/types/proof.pb.go @@ -25,7 +25,8 @@ var _ = math.Inf const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type Proof struct { - SupplierAddress string `protobuf:"bytes,1,opt,name=supplier_address,json=supplierAddress,proto3" json:"supplier_address,omitempty"` + // Address of the supplier's operator that submitted this proof. + SupplierOperatorAddress string `protobuf:"bytes,1,opt,name=supplier_operator_address,json=supplierOperatorAddress,proto3" json:"supplier_operator_address,omitempty"` // The session header of the session that this claim is for. SessionHeader *types.SessionHeader `protobuf:"bytes,2,opt,name=session_header,json=sessionHeader,proto3" json:"session_header,omitempty"` // The serialized SMST proof from the `#ClosestProof()` method. @@ -65,9 +66,9 @@ func (m *Proof) XXX_DiscardUnknown() { var xxx_messageInfo_Proof proto.InternalMessageInfo -func (m *Proof) GetSupplierAddress() string { +func (m *Proof) GetSupplierOperatorAddress() string { if m != nil { - return m.SupplierAddress + return m.SupplierOperatorAddress } return "" } @@ -93,25 +94,26 @@ func init() { func init() { proto.RegisterFile("poktroll/proof/proof.proto", fileDescriptor_0119ab01846040c2) } var fileDescriptor_0119ab01846040c2 = []byte{ - // 283 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x2a, 0xc8, 0xcf, 0x2e, - 0x29, 0xca, 0xcf, 0xc9, 0xd1, 0x2f, 0x28, 0xca, 0xcf, 0x4f, 0x83, 0x90, 0x7a, 0x05, 0x45, 0xf9, - 0x25, 0xf9, 0x42, 0x7c, 0x30, 0x39, 0x3d, 0xb0, 0xa8, 0x94, 0x64, 0x72, 0x7e, 0x71, 0x6e, 0x7e, - 0x71, 0x3c, 0x58, 0x56, 0x1f, 0xc2, 0x81, 0x28, 0x95, 0x92, 0x83, 0x1b, 0x53, 0x9c, 0x5a, 0x5c, - 0x9c, 0x99, 0x9f, 0x07, 0xa3, 0x21, 0xf2, 0x4a, 0xc7, 0x18, 0xb9, 0x58, 0x03, 0x40, 0x86, 0x08, - 0x39, 0x73, 0x09, 0x14, 0x97, 0x16, 0x14, 0xe4, 0x64, 0xa6, 0x16, 0xc5, 0x27, 0xa6, 0xa4, 0x14, - 0xa5, 0x16, 0x17, 0x4b, 0x30, 0x2a, 0x30, 0x6a, 0x70, 0x3a, 0x49, 0x5c, 0xda, 0xa2, 0x2b, 0x02, - 0x35, 0xd5, 0x11, 0x22, 0x13, 0x5c, 0x52, 0x94, 0x99, 0x97, 0x1e, 0xc4, 0x0f, 0xd3, 0x01, 0x15, - 0x16, 0x72, 0xe3, 0xe2, 0x83, 0x9a, 0x1f, 0x9f, 0x91, 0x9a, 0x98, 0x92, 0x5a, 0x24, 0xc1, 0xa4, - 0xc0, 0xa8, 0xc1, 0x6d, 0x24, 0xaf, 0x07, 0x77, 0x32, 0xcc, 0xfe, 0x60, 0x08, 0xed, 0x01, 0x56, - 0x16, 0xc4, 0x5b, 0x8c, 0xcc, 0x15, 0x32, 0xe0, 0x12, 0x49, 0xce, 0xc9, 0x2f, 0x4e, 0x2d, 0x2e, - 0x89, 0xcf, 0x4d, 0x2d, 0xca, 0xce, 0x49, 0x8d, 0x07, 0xfb, 0x54, 0x82, 0x59, 0x81, 0x51, 0x83, - 0x27, 0x48, 0x08, 0x2a, 0xe7, 0x0b, 0x96, 0x02, 0x3b, 0xdf, 0xc9, 0xe3, 0xc4, 0x23, 0x39, 0xc6, - 0x0b, 0x8f, 0xe4, 0x18, 0x1f, 0x3c, 0x92, 0x63, 0x9c, 0xf0, 0x58, 0x8e, 0xe1, 0xc2, 0x63, 0x39, - 0x86, 0x1b, 0x8f, 0xe5, 0x18, 0xa2, 0xf4, 0xd2, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92, 0xf3, - 0x73, 0xf5, 0x41, 0xae, 0xd0, 0xcd, 0x4b, 0x2d, 0x29, 0xcf, 0x2f, 0xca, 0xd6, 0x87, 0x07, 0x4d, - 0x05, 0x34, 0x8c, 0x4b, 0x2a, 0x0b, 0x52, 0x8b, 0x93, 0xd8, 0xc0, 0x21, 0x63, 0x0c, 0x08, 0x00, - 0x00, 0xff, 0xff, 0xb7, 0xfc, 0xd4, 0xd7, 0x82, 0x01, 0x00, 0x00, + // 292 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x4c, 0x90, 0xbf, 0x4e, 0xc3, 0x30, + 0x10, 0xc6, 0x6b, 0x10, 0x48, 0x04, 0xe8, 0x10, 0x55, 0x22, 0xed, 0x60, 0x22, 0xa6, 0x2c, 0x4d, + 0x10, 0x3c, 0x01, 0x1d, 0x50, 0x17, 0x04, 0x4a, 0x99, 0x58, 0xac, 0x34, 0x31, 0x6d, 0x94, 0x3f, + 0x67, 0xf9, 0x5c, 0x01, 0x6f, 0xc1, 0xc3, 0xf0, 0x10, 0x8c, 0x15, 0x0b, 0x8c, 0x28, 0x79, 0x11, + 0x54, 0xdb, 0x89, 0x58, 0x72, 0xba, 0xfc, 0xee, 0x3e, 0xdf, 0xf7, 0x39, 0x13, 0x01, 0x85, 0x92, + 0x50, 0x96, 0x91, 0x90, 0x00, 0xcf, 0xe6, 0x1b, 0x0a, 0x09, 0x0a, 0xdc, 0x61, 0xc7, 0x42, 0xfd, + 0x77, 0x32, 0x4e, 0x01, 0x2b, 0x40, 0xa6, 0x69, 0x64, 0x1a, 0x33, 0x3a, 0xa1, 0xbd, 0x0c, 0x72, + 0xc4, 0x1c, 0xea, 0xae, 0x1a, 0x7e, 0xf1, 0x4d, 0x9c, 0x83, 0x87, 0x9d, 0x88, 0xfb, 0xe8, 0x8c, + 0x71, 0x23, 0x44, 0x99, 0x73, 0xc9, 0x40, 0x70, 0x99, 0x28, 0x90, 0x2c, 0xc9, 0x32, 0xc9, 0x11, + 0x3d, 0xe2, 0x93, 0xe0, 0x68, 0xe6, 0x7d, 0x7d, 0x4c, 0x47, 0x56, 0xfe, 0xc6, 0x90, 0x85, 0x92, + 0x79, 0xbd, 0x8a, 0xcf, 0xba, 0xd5, 0x7b, 0xbb, 0x69, 0xb1, 0x7b, 0xeb, 0x0c, 0xed, 0x83, 0x6c, + 0xcd, 0x93, 0x8c, 0x4b, 0x6f, 0xcf, 0x27, 0xc1, 0xf1, 0xd5, 0x79, 0xd8, 0x7b, 0xe8, 0x0e, 0x5a, + 0x98, 0x3a, 0xd7, 0x63, 0xf1, 0x29, 0xfe, 0x6f, 0xdd, 0x4b, 0x67, 0x94, 0x96, 0x80, 0x1c, 0x15, + 0xab, 0xb8, 0x2c, 0x4a, 0xce, 0xb4, 0x75, 0x6f, 0xdf, 0x27, 0xc1, 0x49, 0xec, 0x5a, 0x76, 0xa7, + 0x91, 0xf6, 0x33, 0x9b, 0x7f, 0x36, 0x94, 0x6c, 0x1b, 0x4a, 0x7e, 0x1b, 0x4a, 0xde, 0x5b, 0x3a, + 0xd8, 0xb6, 0x74, 0xf0, 0xd3, 0xd2, 0xc1, 0x53, 0xb8, 0xca, 0xd5, 0x7a, 0xb3, 0x0c, 0x53, 0xa8, + 0xa2, 0xdd, 0x15, 0xd3, 0x9a, 0xab, 0x17, 0x90, 0x45, 0xd4, 0x67, 0xf5, 0x6a, 0x43, 0x57, 0x6f, + 0x82, 0xe3, 0xf2, 0x50, 0x47, 0x75, 0xfd, 0x17, 0x00, 0x00, 0xff, 0xff, 0x75, 0xc2, 0x0a, 0xf2, + 0x93, 0x01, 0x00, 0x00, } func (m *Proof) Marshal() (dAtA []byte, err error) { @@ -153,10 +155,10 @@ func (m *Proof) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x12 } - if len(m.SupplierAddress) > 0 { - i -= len(m.SupplierAddress) - copy(dAtA[i:], m.SupplierAddress) - i = encodeVarintProof(dAtA, i, uint64(len(m.SupplierAddress))) + if len(m.SupplierOperatorAddress) > 0 { + i -= len(m.SupplierOperatorAddress) + copy(dAtA[i:], m.SupplierOperatorAddress) + i = encodeVarintProof(dAtA, i, uint64(len(m.SupplierOperatorAddress))) i-- dAtA[i] = 0xa } @@ -180,7 +182,7 @@ func (m *Proof) Size() (n int) { } var l int _ = l - l = len(m.SupplierAddress) + l = len(m.SupplierOperatorAddress) if l > 0 { n += 1 + l + sovProof(uint64(l)) } @@ -232,7 +234,7 @@ func (m *Proof) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SupplierAddress", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field SupplierOperatorAddress", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -260,7 +262,7 @@ func (m *Proof) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.SupplierAddress = string(dAtA[iNdEx:postIndex]) + m.SupplierOperatorAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { diff --git a/x/proof/types/query.pb.go b/x/proof/types/query.pb.go index 7cc2d2899..b2ab4e3d1 100644 --- a/x/proof/types/query.pb.go +++ b/x/proof/types/query.pb.go @@ -116,8 +116,8 @@ func (m *QueryParamsResponse) GetParams() Params { } type QueryGetClaimRequest struct { - SessionId string `protobuf:"bytes,1,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` - SupplierAddress string `protobuf:"bytes,2,opt,name=supplier_address,json=supplierAddress,proto3" json:"supplier_address,omitempty"` + SessionId string `protobuf:"bytes,1,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` + SupplierOperatorAddress string `protobuf:"bytes,2,opt,name=supplier_operator_address,json=supplierOperatorAddress,proto3" json:"supplier_operator_address,omitempty"` } func (m *QueryGetClaimRequest) Reset() { *m = QueryGetClaimRequest{} } @@ -160,9 +160,9 @@ func (m *QueryGetClaimRequest) GetSessionId() string { return "" } -func (m *QueryGetClaimRequest) GetSupplierAddress() string { +func (m *QueryGetClaimRequest) GetSupplierOperatorAddress() string { if m != nil { - return m.SupplierAddress + return m.SupplierOperatorAddress } return "" } @@ -214,7 +214,7 @@ func (m *QueryGetClaimResponse) GetClaim() Claim { type QueryAllClaimsRequest struct { Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` // Types that are valid to be assigned to Filter: - // *QueryAllClaimsRequest_SupplierAddress + // *QueryAllClaimsRequest_SupplierOperatorAddress // *QueryAllClaimsRequest_SessionId // *QueryAllClaimsRequest_SessionEndHeight Filter isQueryAllClaimsRequest_Filter `protobuf_oneof:"filter"` @@ -259,8 +259,8 @@ type isQueryAllClaimsRequest_Filter interface { Size() int } -type QueryAllClaimsRequest_SupplierAddress struct { - SupplierAddress string `protobuf:"bytes,2,opt,name=supplier_address,json=supplierAddress,proto3,oneof" json:"supplier_address,omitempty"` +type QueryAllClaimsRequest_SupplierOperatorAddress struct { + SupplierOperatorAddress string `protobuf:"bytes,2,opt,name=supplier_operator_address,json=supplierOperatorAddress,proto3,oneof" json:"supplier_operator_address,omitempty"` } type QueryAllClaimsRequest_SessionId struct { SessionId string `protobuf:"bytes,3,opt,name=session_id,json=sessionId,proto3,oneof" json:"session_id,omitempty"` @@ -269,9 +269,9 @@ type QueryAllClaimsRequest_SessionEndHeight struct { SessionEndHeight uint64 `protobuf:"varint,4,opt,name=session_end_height,json=sessionEndHeight,proto3,oneof" json:"session_end_height,omitempty"` } -func (*QueryAllClaimsRequest_SupplierAddress) isQueryAllClaimsRequest_Filter() {} -func (*QueryAllClaimsRequest_SessionId) isQueryAllClaimsRequest_Filter() {} -func (*QueryAllClaimsRequest_SessionEndHeight) isQueryAllClaimsRequest_Filter() {} +func (*QueryAllClaimsRequest_SupplierOperatorAddress) isQueryAllClaimsRequest_Filter() {} +func (*QueryAllClaimsRequest_SessionId) isQueryAllClaimsRequest_Filter() {} +func (*QueryAllClaimsRequest_SessionEndHeight) isQueryAllClaimsRequest_Filter() {} func (m *QueryAllClaimsRequest) GetFilter() isQueryAllClaimsRequest_Filter { if m != nil { @@ -287,9 +287,9 @@ func (m *QueryAllClaimsRequest) GetPagination() *query.PageRequest { return nil } -func (m *QueryAllClaimsRequest) GetSupplierAddress() string { - if x, ok := m.GetFilter().(*QueryAllClaimsRequest_SupplierAddress); ok { - return x.SupplierAddress +func (m *QueryAllClaimsRequest) GetSupplierOperatorAddress() string { + if x, ok := m.GetFilter().(*QueryAllClaimsRequest_SupplierOperatorAddress); ok { + return x.SupplierOperatorAddress } return "" } @@ -311,7 +311,7 @@ func (m *QueryAllClaimsRequest) GetSessionEndHeight() uint64 { // XXX_OneofWrappers is for the internal use of the proto package. func (*QueryAllClaimsRequest) XXX_OneofWrappers() []interface{} { return []interface{}{ - (*QueryAllClaimsRequest_SupplierAddress)(nil), + (*QueryAllClaimsRequest_SupplierOperatorAddress)(nil), (*QueryAllClaimsRequest_SessionId)(nil), (*QueryAllClaimsRequest_SessionEndHeight)(nil), } @@ -370,8 +370,8 @@ func (m *QueryAllClaimsResponse) GetPagination() *query.PageResponse { } type QueryGetProofRequest struct { - SessionId string `protobuf:"bytes,1,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` - SupplierAddress string `protobuf:"bytes,2,opt,name=supplier_address,json=supplierAddress,proto3" json:"supplier_address,omitempty"` + SessionId string `protobuf:"bytes,1,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` + SupplierOperatorAddress string `protobuf:"bytes,2,opt,name=supplier_operator_address,json=supplierOperatorAddress,proto3" json:"supplier_operator_address,omitempty"` } func (m *QueryGetProofRequest) Reset() { *m = QueryGetProofRequest{} } @@ -414,9 +414,9 @@ func (m *QueryGetProofRequest) GetSessionId() string { return "" } -func (m *QueryGetProofRequest) GetSupplierAddress() string { +func (m *QueryGetProofRequest) GetSupplierOperatorAddress() string { if m != nil { - return m.SupplierAddress + return m.SupplierOperatorAddress } return "" } @@ -469,7 +469,7 @@ type QueryAllProofsRequest struct { Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` // Types that are valid to be assigned to Filter: // - // *QueryAllProofsRequest_SupplierAddress + // *QueryAllProofsRequest_SupplierOperatorAddress // *QueryAllProofsRequest_SessionId // *QueryAllProofsRequest_SessionEndHeight Filter isQueryAllProofsRequest_Filter `protobuf_oneof:"filter"` @@ -514,8 +514,8 @@ type isQueryAllProofsRequest_Filter interface { Size() int } -type QueryAllProofsRequest_SupplierAddress struct { - SupplierAddress string `protobuf:"bytes,2,opt,name=supplier_address,json=supplierAddress,proto3,oneof" json:"supplier_address,omitempty"` +type QueryAllProofsRequest_SupplierOperatorAddress struct { + SupplierOperatorAddress string `protobuf:"bytes,2,opt,name=supplier_operator_address,json=supplierOperatorAddress,proto3,oneof" json:"supplier_operator_address,omitempty"` } type QueryAllProofsRequest_SessionId struct { SessionId string `protobuf:"bytes,3,opt,name=session_id,json=sessionId,proto3,oneof" json:"session_id,omitempty"` @@ -524,9 +524,9 @@ type QueryAllProofsRequest_SessionEndHeight struct { SessionEndHeight uint64 `protobuf:"varint,4,opt,name=session_end_height,json=sessionEndHeight,proto3,oneof" json:"session_end_height,omitempty"` } -func (*QueryAllProofsRequest_SupplierAddress) isQueryAllProofsRequest_Filter() {} -func (*QueryAllProofsRequest_SessionId) isQueryAllProofsRequest_Filter() {} -func (*QueryAllProofsRequest_SessionEndHeight) isQueryAllProofsRequest_Filter() {} +func (*QueryAllProofsRequest_SupplierOperatorAddress) isQueryAllProofsRequest_Filter() {} +func (*QueryAllProofsRequest_SessionId) isQueryAllProofsRequest_Filter() {} +func (*QueryAllProofsRequest_SessionEndHeight) isQueryAllProofsRequest_Filter() {} func (m *QueryAllProofsRequest) GetFilter() isQueryAllProofsRequest_Filter { if m != nil { @@ -542,9 +542,9 @@ func (m *QueryAllProofsRequest) GetPagination() *query.PageRequest { return nil } -func (m *QueryAllProofsRequest) GetSupplierAddress() string { - if x, ok := m.GetFilter().(*QueryAllProofsRequest_SupplierAddress); ok { - return x.SupplierAddress +func (m *QueryAllProofsRequest) GetSupplierOperatorAddress() string { + if x, ok := m.GetFilter().(*QueryAllProofsRequest_SupplierOperatorAddress); ok { + return x.SupplierOperatorAddress } return "" } @@ -566,7 +566,7 @@ func (m *QueryAllProofsRequest) GetSessionEndHeight() uint64 { // XXX_OneofWrappers is for the internal use of the proto package. func (*QueryAllProofsRequest) XXX_OneofWrappers() []interface{} { return []interface{}{ - (*QueryAllProofsRequest_SupplierAddress)(nil), + (*QueryAllProofsRequest_SupplierOperatorAddress)(nil), (*QueryAllProofsRequest_SessionId)(nil), (*QueryAllProofsRequest_SessionEndHeight)(nil), } @@ -640,53 +640,54 @@ func init() { func init() { proto.RegisterFile("poktroll/proof/query.proto", fileDescriptor_452adc3cc4abc239) } var fileDescriptor_452adc3cc4abc239 = []byte{ - // 731 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x56, 0xcf, 0x4f, 0x13, 0x4f, - 0x14, 0xef, 0x02, 0x6d, 0xbe, 0x9d, 0x6f, 0xa2, 0x38, 0x16, 0x52, 0xab, 0x16, 0xb2, 0xfc, 0x90, - 0x40, 0xd8, 0x0d, 0x70, 0xf2, 0x48, 0x51, 0xa9, 0x9c, 0xea, 0x7a, 0xf3, 0xd2, 0x6c, 0xe9, 0xb0, - 0x6c, 0xd8, 0xee, 0x2c, 0x3b, 0x53, 0x15, 0x09, 0x1e, 0x3c, 0x78, 0x36, 0x31, 0xf1, 0xec, 0xd1, - 0xa3, 0x07, 0xff, 0x08, 0x8e, 0x44, 0x2f, 0x9e, 0xd4, 0x80, 0x09, 0xff, 0x86, 0xd9, 0x37, 0x6f, - 0x6d, 0x77, 0x61, 0x29, 0x07, 0x13, 0x0f, 0x5e, 0x26, 0xdd, 0x79, 0x9f, 0x79, 0xef, 0xf3, 0x3e, - 0xf3, 0x99, 0x97, 0x92, 0x4a, 0xc0, 0x77, 0x64, 0xc8, 0x3d, 0xcf, 0x0c, 0x42, 0xce, 0xb7, 0xcc, - 0xdd, 0x2e, 0x0b, 0xf7, 0x8c, 0x20, 0xe4, 0x92, 0xd3, 0x2b, 0x71, 0xcc, 0x80, 0x58, 0xe5, 0x9a, - 0xdd, 0x71, 0x7d, 0x6e, 0xc2, 0xaa, 0x20, 0x95, 0x92, 0xc3, 0x1d, 0x0e, 0x3f, 0xcd, 0xe8, 0x17, - 0xee, 0xde, 0x72, 0x38, 0x77, 0x3c, 0x66, 0xda, 0x81, 0x6b, 0xda, 0xbe, 0xcf, 0xa5, 0x2d, 0x5d, - 0xee, 0x0b, 0x8c, 0xde, 0xd8, 0xe4, 0xa2, 0xc3, 0x45, 0x53, 0x1d, 0x53, 0x1f, 0x18, 0x9a, 0x57, - 0x5f, 0x66, 0xcb, 0x16, 0x4c, 0x51, 0x31, 0x9f, 0x2e, 0xb5, 0x98, 0xb4, 0x97, 0xcc, 0xc0, 0x76, - 0x5c, 0x1f, 0xf2, 0x20, 0xf6, 0x66, 0x8a, 0x79, 0x60, 0x87, 0x76, 0x27, 0x4e, 0x94, 0x6e, 0x6b, - 0xd3, 0xb3, 0xdd, 0x4e, 0x46, 0x0c, 0x56, 0x15, 0xd3, 0x4b, 0x84, 0x3e, 0x8a, 0xca, 0x36, 0x20, - 0x99, 0xc5, 0x76, 0xbb, 0x4c, 0x48, 0xbd, 0x41, 0xae, 0x27, 0x76, 0x45, 0xc0, 0x7d, 0xc1, 0xe8, - 0x5d, 0x52, 0x50, 0x45, 0xcb, 0xda, 0xa4, 0x36, 0xf7, 0xff, 0xf2, 0xb8, 0x91, 0x14, 0xcc, 0x50, - 0xf8, 0x5a, 0xf1, 0xf0, 0xdb, 0x44, 0xee, 0xc3, 0xe9, 0xc7, 0x79, 0xcd, 0xc2, 0x03, 0xfa, 0x0b, - 0x52, 0x82, 0x8c, 0xeb, 0x4c, 0xae, 0x45, 0xd4, 0xb0, 0x12, 0xbd, 0x4d, 0x88, 0x60, 0x42, 0xb8, - 0xdc, 0x6f, 0xba, 0x6d, 0x48, 0x5b, 0xb4, 0x8a, 0xb8, 0xf3, 0xb0, 0x4d, 0xd7, 0xc8, 0xa8, 0xe8, - 0x06, 0x81, 0xe7, 0xb2, 0xb0, 0x69, 0xb7, 0xdb, 0x21, 0x13, 0xa2, 0x3c, 0x14, 0x81, 0x6a, 0xe5, - 0xcf, 0x9f, 0x16, 0x4b, 0xa8, 0xe5, 0xaa, 0x8a, 0x3c, 0x96, 0xa1, 0xeb, 0x3b, 0xd6, 0xd5, 0xf8, - 0x04, 0x6e, 0xeb, 0x1b, 0x64, 0x2c, 0x55, 0x1b, 0xfb, 0x59, 0x22, 0x79, 0xd0, 0x09, 0xdb, 0x19, - 0x4b, 0xb7, 0x03, 0xe8, 0xda, 0x48, 0xd4, 0x8d, 0xa5, 0x90, 0xfa, 0xa9, 0x86, 0xc9, 0x56, 0x3d, - 0x0f, 0xc2, 0xb1, 0x66, 0xf4, 0x01, 0x21, 0xbd, 0x2b, 0xc3, 0x8c, 0xb3, 0x06, 0x32, 0x8c, 0xee, - 0xd7, 0x50, 0x56, 0xc3, 0xfb, 0x35, 0x1a, 0xb6, 0xc3, 0xf0, 0xac, 0xd5, 0x77, 0x92, 0x2e, 0x64, - 0xb5, 0x5c, 0xcf, 0x9d, 0x69, 0x8d, 0x4e, 0x24, 0xe4, 0x1b, 0x46, 0x58, 0x9f, 0x80, 0x06, 0xa1, - 0x31, 0x80, 0xf9, 0xed, 0xe6, 0x36, 0x73, 0x9d, 0x6d, 0x59, 0x1e, 0x99, 0xd4, 0xe6, 0x46, 0xea, - 0x39, 0x6b, 0x14, 0x63, 0xf7, 0xfd, 0x76, 0x1d, 0x22, 0xb5, 0xff, 0x48, 0x61, 0xcb, 0xf5, 0x24, - 0x0b, 0xf5, 0x77, 0x1a, 0x19, 0x4f, 0x77, 0x8a, 0xba, 0xad, 0x90, 0x02, 0xa8, 0x11, 0xf9, 0x60, - 0x78, 0x90, 0x70, 0x08, 0xa5, 0xeb, 0x09, 0x7d, 0x86, 0x40, 0x9f, 0x3b, 0x03, 0xf5, 0x51, 0x15, - 0xfb, 0x05, 0xea, 0xb7, 0x52, 0x23, 0xaa, 0xf6, 0x97, 0xac, 0x84, 0xb5, 0x7b, 0x56, 0x82, 0xd6, - 0xb3, 0xac, 0x04, 0xe8, 0xd8, 0x4a, 0xb0, 0x95, 0xb0, 0x12, 0x84, 0xff, 0x09, 0x2b, 0xc5, 0x9d, - 0xf6, 0xac, 0x04, 0x6a, 0x64, 0x5a, 0xa9, 0x5f, 0x38, 0x84, 0xfe, 0x31, 0x2b, 0x2d, 0x7f, 0xcf, - 0x93, 0x3c, 0x10, 0xa3, 0x2f, 0x49, 0x41, 0x0d, 0x2f, 0xaa, 0xa7, 0x19, 0x9c, 0x9d, 0x8f, 0x95, - 0xa9, 0x0b, 0x31, 0xaa, 0x90, 0xbe, 0xf0, 0xea, 0xcb, 0xcf, 0xb7, 0x43, 0x33, 0x74, 0xca, 0x8c, - 0xc0, 0x8b, 0x3e, 0x93, 0xcf, 0x78, 0xb8, 0x63, 0x9e, 0x3b, 0xc5, 0xe9, 0x7b, 0x8d, 0xe4, 0xe1, - 0xd5, 0xd0, 0xe9, 0x73, 0x73, 0xa7, 0xe6, 0x66, 0x65, 0x66, 0x00, 0x0a, 0x39, 0x6c, 0x00, 0x87, - 0x7b, 0xb4, 0x76, 0x21, 0x07, 0x78, 0xa1, 0xe6, 0x7e, 0xef, 0xfa, 0x0f, 0xcc, 0xfd, 0xb4, 0x71, - 0x0e, 0xe8, 0x6b, 0x8d, 0x14, 0x7f, 0xcf, 0x02, 0x7a, 0x3e, 0x81, 0xf4, 0x54, 0xac, 0xcc, 0x0e, - 0x82, 0x21, 0xd1, 0x79, 0x20, 0x3a, 0x4d, 0xf5, 0xc1, 0x44, 0x41, 0x2b, 0xb0, 0x45, 0xb6, 0x56, - 0xfd, 0x83, 0x21, 0x5b, 0xab, 0xc4, 0x13, 0xbe, 0xa4, 0x56, 0x6a, 0xbd, 0xa4, 0x56, 0xca, 0xec, - 0xd9, 0x5a, 0x25, 0x9e, 0x7d, 0xb6, 0x56, 0xc9, 0x37, 0x73, 0x49, 0xad, 0x60, 0xad, 0xd5, 0x0f, - 0x8f, 0xab, 0xda, 0xd1, 0x71, 0x55, 0xfb, 0x71, 0x5c, 0xd5, 0xde, 0x9c, 0x54, 0x73, 0x47, 0x27, - 0xd5, 0xdc, 0xd7, 0x93, 0x6a, 0xee, 0x89, 0xe1, 0xb8, 0x72, 0xbb, 0xdb, 0x32, 0x36, 0x79, 0x27, - 0x23, 0xcf, 0x73, 0xcc, 0x24, 0xf7, 0x02, 0x26, 0x5a, 0x05, 0xf8, 0xc3, 0xb0, 0xf2, 0x2b, 0x00, - 0x00, 0xff, 0xff, 0x85, 0xf7, 0x77, 0xb8, 0x41, 0x09, 0x00, 0x00, + // 750 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x56, 0xbf, 0x6f, 0x13, 0x4b, + 0x10, 0xf6, 0x25, 0xb1, 0xf5, 0xbc, 0x4f, 0x7a, 0x7a, 0x6f, 0x9f, 0x13, 0x1c, 0x03, 0x4e, 0x74, + 0xf9, 0x41, 0x14, 0x94, 0x3b, 0x25, 0xa9, 0x90, 0x68, 0x62, 0x04, 0x31, 0x20, 0x84, 0xb9, 0x50, + 0xd1, 0x58, 0xe7, 0x78, 0x73, 0x39, 0xe5, 0x7c, 0x7b, 0xb9, 0x5d, 0x03, 0x51, 0x14, 0x0a, 0x0a, + 0x1a, 0x1a, 0x24, 0x24, 0xfe, 0x06, 0xe8, 0x28, 0xf8, 0x23, 0x52, 0x46, 0xd0, 0x50, 0x21, 0x94, + 0x20, 0x51, 0xd3, 0x51, 0xa2, 0x9b, 0x9d, 0xc3, 0xbe, 0x23, 0x17, 0x07, 0x89, 0x02, 0x89, 0x66, + 0xe5, 0xdb, 0xf9, 0x76, 0xe6, 0x9b, 0x6f, 0xbf, 0x9d, 0x84, 0x54, 0x02, 0xbe, 0x25, 0x43, 0xee, + 0x79, 0x66, 0x10, 0x72, 0xbe, 0x61, 0x6e, 0x77, 0x59, 0xb8, 0x63, 0x04, 0x21, 0x97, 0x9c, 0xfe, + 0x13, 0xc7, 0x0c, 0x88, 0x55, 0xfe, 0xb3, 0x3b, 0xae, 0xcf, 0x4d, 0x58, 0x15, 0xa4, 0x52, 0x72, + 0xb8, 0xc3, 0xe1, 0xa7, 0x19, 0xfd, 0xc2, 0xdd, 0x73, 0x0e, 0xe7, 0x8e, 0xc7, 0x4c, 0x3b, 0x70, + 0x4d, 0xdb, 0xf7, 0xb9, 0xb4, 0xa5, 0xcb, 0x7d, 0x81, 0xd1, 0xf1, 0x75, 0x2e, 0x3a, 0x5c, 0x34, + 0xd5, 0x31, 0xf5, 0x81, 0xa1, 0x79, 0xf5, 0x65, 0xb6, 0x6c, 0xc1, 0x14, 0x15, 0xf3, 0xfe, 0x62, + 0x8b, 0x49, 0x7b, 0xd1, 0x0c, 0x6c, 0xc7, 0xf5, 0x21, 0x0f, 0x62, 0xcf, 0xa6, 0x98, 0x07, 0x76, + 0x68, 0x77, 0xe2, 0x44, 0xe9, 0xb6, 0xd6, 0x3d, 0xdb, 0xed, 0x64, 0xc4, 0x60, 0x55, 0x31, 0xbd, + 0x44, 0xe8, 0x9d, 0xa8, 0x6c, 0x03, 0x92, 0x59, 0x6c, 0xbb, 0xcb, 0x84, 0xd4, 0x1b, 0xe4, 0xff, + 0xc4, 0xae, 0x08, 0xb8, 0x2f, 0x18, 0xbd, 0x44, 0x0a, 0xaa, 0x68, 0x59, 0x9b, 0xd4, 0xe6, 0xfe, + 0x5e, 0x1a, 0x33, 0x92, 0x82, 0x19, 0x0a, 0x5f, 0x2b, 0xee, 0x7f, 0x98, 0xc8, 0xbd, 0xfc, 0xfc, + 0x7a, 0x5e, 0xb3, 0xf0, 0x80, 0xfe, 0x54, 0x23, 0x25, 0x48, 0xb9, 0xca, 0xe4, 0x95, 0x88, 0x1b, + 0x96, 0xa2, 0xe7, 0x09, 0x11, 0x4c, 0x08, 0x97, 0xfb, 0x4d, 0xb7, 0x0d, 0x79, 0x8b, 0x56, 0x11, + 0x77, 0xae, 0xb7, 0xe9, 0x5d, 0x32, 0x2e, 0xba, 0x41, 0xe0, 0xb9, 0x2c, 0x6c, 0xf2, 0x80, 0x85, + 0xb6, 0xe4, 0x61, 0xd3, 0x6e, 0xb7, 0x43, 0x26, 0x44, 0x79, 0x28, 0x42, 0xd7, 0xca, 0x6f, 0xdf, + 0x2c, 0x94, 0x50, 0xd5, 0x15, 0x15, 0x59, 0x93, 0xa1, 0xeb, 0x3b, 0xd6, 0x99, 0xf8, 0xe8, 0x6d, + 0x3c, 0x89, 0x61, 0xfd, 0x06, 0x19, 0x4d, 0x91, 0xc1, 0x0e, 0x17, 0x49, 0x1e, 0x94, 0xc3, 0x06, + 0x47, 0xd3, 0x0d, 0x02, 0xba, 0x36, 0x12, 0xf5, 0x67, 0x29, 0xa4, 0xfe, 0x55, 0xc3, 0x64, 0x2b, + 0x9e, 0x07, 0xe1, 0x58, 0x45, 0x7a, 0x8d, 0x90, 0xde, 0x25, 0x62, 0xc6, 0x59, 0x03, 0x99, 0x46, + 0x37, 0x6e, 0x28, 0xf3, 0xe1, 0x8d, 0x1b, 0x0d, 0xdb, 0x61, 0x78, 0xd6, 0xea, 0x3b, 0x49, 0x2f, + 0x0f, 0xd4, 0xa0, 0x9e, 0xcb, 0xec, 0x95, 0x4e, 0x24, 0x04, 0x1e, 0x46, 0x78, 0x9f, 0xc4, 0x06, + 0xa1, 0x31, 0x80, 0xf9, 0xed, 0xe6, 0x26, 0x73, 0x9d, 0x4d, 0x59, 0x1e, 0x99, 0xd4, 0xe6, 0x46, + 0xea, 0x39, 0xeb, 0x5f, 0x8c, 0x5d, 0xf5, 0xdb, 0x75, 0x88, 0xd4, 0xfe, 0x22, 0x85, 0x0d, 0xd7, + 0x93, 0x2c, 0xd4, 0x5f, 0x68, 0x64, 0x2c, 0xdd, 0x3a, 0x0a, 0xb9, 0x4c, 0x0a, 0x20, 0x4f, 0x64, + 0x95, 0xe1, 0x41, 0x4a, 0x22, 0x94, 0xae, 0x26, 0x04, 0x1b, 0x02, 0xc1, 0x2e, 0x0c, 0x14, 0x4c, + 0x55, 0xec, 0x57, 0x2c, 0xe1, 0xb6, 0x46, 0x54, 0xee, 0x77, 0x71, 0x1b, 0x92, 0xe9, 0xb9, 0x0d, + 0xc4, 0xc8, 0x72, 0x1b, 0xa0, 0x63, 0xb7, 0xc1, 0x56, 0xc2, 0x6d, 0x10, 0xfe, 0x33, 0xdd, 0x16, + 0xb7, 0xde, 0x73, 0x1b, 0xc8, 0x93, 0xe9, 0xb6, 0x7e, 0x25, 0x11, 0xfa, 0xcb, 0xdc, 0xb6, 0xf4, + 0x25, 0x4f, 0xf2, 0x40, 0x8c, 0x3e, 0x22, 0x05, 0x35, 0x02, 0xa9, 0x9e, 0x66, 0xf0, 0xe3, 0x94, + 0xad, 0x4c, 0x9d, 0x88, 0x51, 0x85, 0xf4, 0x8b, 0x8f, 0xdf, 0x7d, 0x7a, 0x3e, 0x34, 0x43, 0xa7, + 0xcc, 0x08, 0xbc, 0xe0, 0x33, 0xf9, 0x80, 0x87, 0x5b, 0xe6, 0xb1, 0x7f, 0x0b, 0xe8, 0x2b, 0x8d, + 0xe4, 0xe1, 0x61, 0xd1, 0xe9, 0x63, 0x73, 0xa7, 0x86, 0x6f, 0x65, 0x66, 0x00, 0x0a, 0x39, 0xac, + 0x01, 0x87, 0x5b, 0xf4, 0xe6, 0x89, 0x1c, 0xe0, 0x11, 0x9b, 0xbb, 0xbd, 0xeb, 0xdf, 0x33, 0x77, + 0x33, 0x9d, 0xb4, 0x47, 0x9f, 0x68, 0xa4, 0xf8, 0x7d, 0x6e, 0xd0, 0xe3, 0x99, 0xa4, 0x47, 0x6a, + 0x65, 0x76, 0x10, 0x0c, 0x19, 0xcf, 0x03, 0xe3, 0x69, 0xaa, 0x0f, 0x66, 0x0c, 0xa2, 0x81, 0x3f, + 0xb2, 0x45, 0xeb, 0x9f, 0x21, 0xd9, 0xa2, 0x25, 0x1e, 0xf7, 0x29, 0x45, 0x53, 0xeb, 0xcf, 0x8a, + 0xa6, 0xec, 0x9f, 0x2d, 0x5a, 0x62, 0x32, 0x64, 0x8b, 0x96, 0x7c, 0x45, 0xa7, 0x14, 0x0d, 0xd6, + 0x5a, 0x7d, 0xff, 0xb0, 0xaa, 0x1d, 0x1c, 0x56, 0xb5, 0x8f, 0x87, 0x55, 0xed, 0xd9, 0x51, 0x35, + 0x77, 0x70, 0x54, 0xcd, 0xbd, 0x3f, 0xaa, 0xe6, 0xee, 0x19, 0x8e, 0x2b, 0x37, 0xbb, 0x2d, 0x63, + 0x9d, 0x77, 0x32, 0xf2, 0x3c, 0xc4, 0x4c, 0x72, 0x27, 0x60, 0xa2, 0x55, 0x80, 0x7f, 0x44, 0x96, + 0xbf, 0x05, 0x00, 0x00, 0xff, 0xff, 0xb1, 0x27, 0xdb, 0x39, 0x99, 0x09, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -995,10 +996,10 @@ func (m *QueryGetClaimRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.SupplierAddress) > 0 { - i -= len(m.SupplierAddress) - copy(dAtA[i:], m.SupplierAddress) - i = encodeVarintQuery(dAtA, i, uint64(len(m.SupplierAddress))) + if len(m.SupplierOperatorAddress) > 0 { + i -= len(m.SupplierOperatorAddress) + copy(dAtA[i:], m.SupplierOperatorAddress) + i = encodeVarintQuery(dAtA, i, uint64(len(m.SupplierOperatorAddress))) i-- dAtA[i] = 0x12 } @@ -1089,16 +1090,16 @@ func (m *QueryAllClaimsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *QueryAllClaimsRequest_SupplierAddress) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryAllClaimsRequest_SupplierOperatorAddress) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryAllClaimsRequest_SupplierAddress) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryAllClaimsRequest_SupplierOperatorAddress) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) - i -= len(m.SupplierAddress) - copy(dAtA[i:], m.SupplierAddress) - i = encodeVarintQuery(dAtA, i, uint64(len(m.SupplierAddress))) + i -= len(m.SupplierOperatorAddress) + copy(dAtA[i:], m.SupplierOperatorAddress) + i = encodeVarintQuery(dAtA, i, uint64(len(m.SupplierOperatorAddress))) i-- dAtA[i] = 0x12 return len(dAtA) - i, nil @@ -1198,10 +1199,10 @@ func (m *QueryGetProofRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.SupplierAddress) > 0 { - i -= len(m.SupplierAddress) - copy(dAtA[i:], m.SupplierAddress) - i = encodeVarintQuery(dAtA, i, uint64(len(m.SupplierAddress))) + if len(m.SupplierOperatorAddress) > 0 { + i -= len(m.SupplierOperatorAddress) + copy(dAtA[i:], m.SupplierOperatorAddress) + i = encodeVarintQuery(dAtA, i, uint64(len(m.SupplierOperatorAddress))) i-- dAtA[i] = 0x12 } @@ -1292,16 +1293,16 @@ func (m *QueryAllProofsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *QueryAllProofsRequest_SupplierAddress) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryAllProofsRequest_SupplierOperatorAddress) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryAllProofsRequest_SupplierAddress) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryAllProofsRequest_SupplierOperatorAddress) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) - i -= len(m.SupplierAddress) - copy(dAtA[i:], m.SupplierAddress) - i = encodeVarintQuery(dAtA, i, uint64(len(m.SupplierAddress))) + i -= len(m.SupplierOperatorAddress) + copy(dAtA[i:], m.SupplierOperatorAddress) + i = encodeVarintQuery(dAtA, i, uint64(len(m.SupplierOperatorAddress))) i-- dAtA[i] = 0x12 return len(dAtA) - i, nil @@ -1422,7 +1423,7 @@ func (m *QueryGetClaimRequest) Size() (n int) { if l > 0 { n += 1 + l + sovQuery(uint64(l)) } - l = len(m.SupplierAddress) + l = len(m.SupplierOperatorAddress) if l > 0 { n += 1 + l + sovQuery(uint64(l)) } @@ -1456,13 +1457,13 @@ func (m *QueryAllClaimsRequest) Size() (n int) { return n } -func (m *QueryAllClaimsRequest_SupplierAddress) Size() (n int) { +func (m *QueryAllClaimsRequest_SupplierOperatorAddress) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.SupplierAddress) + l = len(m.SupplierOperatorAddress) n += 1 + l + sovQuery(uint64(l)) return n } @@ -1514,7 +1515,7 @@ func (m *QueryGetProofRequest) Size() (n int) { if l > 0 { n += 1 + l + sovQuery(uint64(l)) } - l = len(m.SupplierAddress) + l = len(m.SupplierOperatorAddress) if l > 0 { n += 1 + l + sovQuery(uint64(l)) } @@ -1548,13 +1549,13 @@ func (m *QueryAllProofsRequest) Size() (n int) { return n } -func (m *QueryAllProofsRequest_SupplierAddress) Size() (n int) { +func (m *QueryAllProofsRequest_SupplierOperatorAddress) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.SupplierAddress) + l = len(m.SupplierOperatorAddress) n += 1 + l + sovQuery(uint64(l)) return n } @@ -1798,7 +1799,7 @@ func (m *QueryGetClaimRequest) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SupplierAddress", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field SupplierOperatorAddress", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1826,7 +1827,7 @@ func (m *QueryGetClaimRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.SupplierAddress = string(dAtA[iNdEx:postIndex]) + m.SupplierOperatorAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -1999,7 +2000,7 @@ func (m *QueryAllClaimsRequest) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SupplierAddress", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field SupplierOperatorAddress", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2027,7 +2028,7 @@ func (m *QueryAllClaimsRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Filter = &QueryAllClaimsRequest_SupplierAddress{string(dAtA[iNdEx:postIndex])} + m.Filter = &QueryAllClaimsRequest_SupplierOperatorAddress{string(dAtA[iNdEx:postIndex])} iNdEx = postIndex case 3: if wireType != 2 { @@ -2285,7 +2286,7 @@ func (m *QueryGetProofRequest) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SupplierAddress", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field SupplierOperatorAddress", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2313,7 +2314,7 @@ func (m *QueryGetProofRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.SupplierAddress = string(dAtA[iNdEx:postIndex]) + m.SupplierOperatorAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -2486,7 +2487,7 @@ func (m *QueryAllProofsRequest) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SupplierAddress", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field SupplierOperatorAddress", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2514,7 +2515,7 @@ func (m *QueryAllProofsRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Filter = &QueryAllProofsRequest_SupplierAddress{string(dAtA[iNdEx:postIndex])} + m.Filter = &QueryAllProofsRequest_SupplierOperatorAddress{string(dAtA[iNdEx:postIndex])} iNdEx = postIndex case 3: if wireType != 2 { diff --git a/x/proof/types/query.pb.gw.go b/x/proof/types/query.pb.gw.go index ddbd0131e..28b7efa33 100644 --- a/x/proof/types/query.pb.gw.go +++ b/x/proof/types/query.pb.gw.go @@ -73,15 +73,15 @@ func request_Query_Claim_0(ctx context.Context, marshaler runtime.Marshaler, cli return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "session_id", err) } - val, ok = pathParams["supplier_address"] + val, ok = pathParams["supplier_operator_address"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "supplier_address") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "supplier_operator_address") } - protoReq.SupplierAddress, err = runtime.String(val) + protoReq.SupplierOperatorAddress, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "supplier_address", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "supplier_operator_address", err) } msg, err := client.Claim(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) @@ -111,15 +111,15 @@ func local_request_Query_Claim_0(ctx context.Context, marshaler runtime.Marshale return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "session_id", err) } - val, ok = pathParams["supplier_address"] + val, ok = pathParams["supplier_operator_address"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "supplier_address") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "supplier_operator_address") } - protoReq.SupplierAddress, err = runtime.String(val) + protoReq.SupplierOperatorAddress, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "supplier_address", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "supplier_operator_address", err) } msg, err := server.Claim(ctx, &protoReq) @@ -185,15 +185,15 @@ func request_Query_Proof_0(ctx context.Context, marshaler runtime.Marshaler, cli return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "session_id", err) } - val, ok = pathParams["supplier_address"] + val, ok = pathParams["supplier_operator_address"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "supplier_address") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "supplier_operator_address") } - protoReq.SupplierAddress, err = runtime.String(val) + protoReq.SupplierOperatorAddress, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "supplier_address", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "supplier_operator_address", err) } msg, err := client.Proof(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) @@ -223,15 +223,15 @@ func local_request_Query_Proof_0(ctx context.Context, marshaler runtime.Marshale return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "session_id", err) } - val, ok = pathParams["supplier_address"] + val, ok = pathParams["supplier_operator_address"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "supplier_address") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "supplier_operator_address") } - protoReq.SupplierAddress, err = runtime.String(val) + protoReq.SupplierOperatorAddress, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "supplier_address", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "supplier_operator_address", err) } msg, err := server.Proof(ctx, &protoReq) @@ -543,11 +543,11 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie var ( pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"pokt-network", "poktroll", "proof", "params"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_Claim_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5}, []string{"pokt-network", "poktroll", "proof", "claim", "session_id", "supplier_address"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_Claim_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5}, []string{"pokt-network", "poktroll", "proof", "claim", "session_id", "supplier_operator_address"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_AllClaims_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"pokt-network", "poktroll", "proof", "claim"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_Proof_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 2, 1, 0, 4, 1, 5, 3, 1, 0, 4, 1, 5, 4}, []string{"pokt-network", "poktroll", "proof", "session_id", "supplier_address"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_Proof_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 2, 1, 0, 4, 1, 5, 3, 1, 0, 4, 1, 5, 4}, []string{"pokt-network", "poktroll", "proof", "session_id", "supplier_operator_address"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_AllProofs_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 2}, []string{"pokt-network", "poktroll", "proof"}, "", runtime.AssumeColonVerbOpt(false))) ) diff --git a/x/proof/types/query_validation.go b/x/proof/types/query_validation.go index a2c576c87..e1742dd99 100644 --- a/x/proof/types/query_validation.go +++ b/x/proof/types/query_validation.go @@ -14,9 +14,9 @@ import ( // ValidateBasic performs basic (non-state-dependant) validation on a QueryGetClaimRequest. func (query *QueryGetClaimRequest) ValidateBasic() error { - // Validate the supplier address - if _, err := sdk.AccAddressFromBech32(query.SupplierAddress); err != nil { - return ErrProofInvalidAddress.Wrapf("invalid supplier address for claim being retrieved %s; (%v)", query.SupplierAddress, err) + // Validate the supplier operator address + if _, err := sdk.AccAddressFromBech32(query.SupplierOperatorAddress); err != nil { + return ErrProofInvalidAddress.Wrapf("invalid supplier operator address for claim being retrieved %s; (%v)", query.SupplierOperatorAddress, err) } if query.SessionId == "" { @@ -29,9 +29,9 @@ func (query *QueryGetClaimRequest) ValidateBasic() error { // ValidateBasic performs basic (non-state-dependant) validation on a QueryAllClaimsRequest. func (query *QueryAllClaimsRequest) ValidateBasic() error { switch filter := query.Filter.(type) { - case *QueryAllClaimsRequest_SupplierAddress: - if _, err := sdk.AccAddressFromBech32(filter.SupplierAddress); err != nil { - return ErrProofInvalidAddress.Wrapf("invalid supplier address for claims being retrieved %s; (%v)", filter.SupplierAddress, err) + case *QueryAllClaimsRequest_SupplierOperatorAddress: + if _, err := sdk.AccAddressFromBech32(filter.SupplierOperatorAddress); err != nil { + return ErrProofInvalidAddress.Wrapf("invalid supplier operator address for claims being retrieved %s; (%v)", filter.SupplierOperatorAddress, err) } case *QueryAllClaimsRequest_SessionId: @@ -47,9 +47,9 @@ func (query *QueryAllClaimsRequest) ValidateBasic() error { } func (query *QueryGetProofRequest) ValidateBasic() error { - // Validate the supplier address - if _, err := sdk.AccAddressFromBech32(query.SupplierAddress); err != nil { - return ErrProofInvalidAddress.Wrapf("invalid supplier address for proof being retrieved %s; (%v)", query.SupplierAddress, err) + // Validate the supplier operator address + if _, err := sdk.AccAddressFromBech32(query.SupplierOperatorAddress); err != nil { + return ErrProofInvalidAddress.Wrapf("invalid supplier operator address for proof being retrieved %s; (%v)", query.SupplierOperatorAddress, err) } if query.SessionId == "" { @@ -64,9 +64,9 @@ func (query *QueryAllProofsRequest) ValidateBasic() error { logger := polylog.Ctx(context.TODO()) switch filter := query.Filter.(type) { - case *QueryAllProofsRequest_SupplierAddress: - if _, err := sdk.AccAddressFromBech32(filter.SupplierAddress); err != nil { - return ErrProofInvalidAddress.Wrapf("invalid supplier address for proofs being retrieved %s; (%v)", filter.SupplierAddress, err) + case *QueryAllProofsRequest_SupplierOperatorAddress: + if _, err := sdk.AccAddressFromBech32(filter.SupplierOperatorAddress); err != nil { + return ErrProofInvalidAddress.Wrapf("invalid supplier operator address for proofs being retrieved %s; (%v)", filter.SupplierOperatorAddress, err) } case *QueryAllProofsRequest_SessionId: diff --git a/x/proof/types/shared_query_client.go b/x/proof/types/shared_query_client.go index 40a7a272b..afad8894c 100644 --- a/x/proof/types/shared_query_client.go +++ b/x/proof/types/shared_query_client.go @@ -84,7 +84,7 @@ func (sqc *SharedKeeperQueryClient) GetProofWindowOpenHeight( func (sqc *SharedKeeperQueryClient) GetEarliestSupplierClaimCommitHeight( ctx context.Context, queryHeight int64, - supplierAddr string, + supplierOperatorAddr string, ) (int64, error) { sharedParams := sqc.sharedKeeper.GetParams(ctx) claimWindowOpenHeight := shared.GetClaimWindowOpenHeight(&sharedParams, queryHeight) @@ -99,7 +99,7 @@ func (sqc *SharedKeeperQueryClient) GetEarliestSupplierClaimCommitHeight( &sharedParams, queryHeight, claimWindowOpenBlockHashBz, - supplierAddr, + supplierOperatorAddr, ), nil } @@ -108,7 +108,7 @@ func (sqc *SharedKeeperQueryClient) GetEarliestSupplierClaimCommitHeight( func (sqc *SharedKeeperQueryClient) GetEarliestSupplierProofCommitHeight( ctx context.Context, queryHeight int64, - supplierAddr string, + supplierOperatorAddr string, ) (int64, error) { sharedParams := sqc.sharedKeeper.GetParams(ctx) proofWindowOpenHeight := shared.GetProofWindowOpenHeight(&sharedParams, queryHeight) @@ -123,6 +123,6 @@ func (sqc *SharedKeeperQueryClient) GetEarliestSupplierProofCommitHeight( &sharedParams, queryHeight, proofWindowOpenBlockHash, - supplierAddr, + supplierOperatorAddr, ), nil } diff --git a/x/proof/types/tx.pb.go b/x/proof/types/tx.pb.go index ad1227474..6901f8590 100644 --- a/x/proof/types/tx.pb.go +++ b/x/proof/types/tx.pb.go @@ -320,8 +320,8 @@ func (m *MsgUpdateParamResponse) GetParams() *Params { } type MsgCreateClaim struct { - SupplierAddress string `protobuf:"bytes,1,opt,name=supplier_address,json=supplierAddress,proto3" json:"supplier_address,omitempty"` - SessionHeader *types1.SessionHeader `protobuf:"bytes,2,opt,name=session_header,json=sessionHeader,proto3" json:"session_header,omitempty"` + SupplierOperatorAddress string `protobuf:"bytes,1,opt,name=supplier_operator_address,json=supplierOperatorAddress,proto3" json:"supplier_operator_address,omitempty"` + SessionHeader *types1.SessionHeader `protobuf:"bytes,2,opt,name=session_header,json=sessionHeader,proto3" json:"session_header,omitempty"` // root returned from smt.SMST#Root() RootHash []byte `protobuf:"bytes,3,opt,name=root_hash,json=rootHash,proto3" json:"root_hash,omitempty"` } @@ -359,9 +359,9 @@ func (m *MsgCreateClaim) XXX_DiscardUnknown() { var xxx_messageInfo_MsgCreateClaim proto.InternalMessageInfo -func (m *MsgCreateClaim) GetSupplierAddress() string { +func (m *MsgCreateClaim) GetSupplierOperatorAddress() string { if m != nil { - return m.SupplierAddress + return m.SupplierOperatorAddress } return "" } @@ -425,8 +425,8 @@ func (m *MsgCreateClaimResponse) GetClaim() *Claim { } type MsgSubmitProof struct { - SupplierAddress string `protobuf:"bytes,1,opt,name=supplier_address,json=supplierAddress,proto3" json:"supplier_address,omitempty"` - SessionHeader *types1.SessionHeader `protobuf:"bytes,2,opt,name=session_header,json=sessionHeader,proto3" json:"session_header,omitempty"` + SupplierOperatorAddress string `protobuf:"bytes,1,opt,name=supplier_operator_address,json=supplierOperatorAddress,proto3" json:"supplier_operator_address,omitempty"` + SessionHeader *types1.SessionHeader `protobuf:"bytes,2,opt,name=session_header,json=sessionHeader,proto3" json:"session_header,omitempty"` // serialized version of *smt.SparseMerkleClosestProof Proof []byte `protobuf:"bytes,3,opt,name=proof,proto3" json:"proof,omitempty"` } @@ -464,9 +464,9 @@ func (m *MsgSubmitProof) XXX_DiscardUnknown() { var xxx_messageInfo_MsgSubmitProof proto.InternalMessageInfo -func (m *MsgSubmitProof) GetSupplierAddress() string { +func (m *MsgSubmitProof) GetSupplierOperatorAddress() string { if m != nil { - return m.SupplierAddress + return m.SupplierOperatorAddress } return "" } @@ -543,56 +543,57 @@ func init() { func init() { proto.RegisterFile("poktroll/proof/tx.proto", fileDescriptor_345e95e87511f6a6) } var fileDescriptor_345e95e87511f6a6 = []byte{ - // 783 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x55, 0xcd, 0x4e, 0xdb, 0x4a, - 0x14, 0x8e, 0xc3, 0x25, 0xc4, 0x93, 0x10, 0xee, 0xb5, 0xf8, 0x31, 0x41, 0xd7, 0x89, 0xb2, 0xb8, - 0x37, 0xa5, 0xc5, 0x16, 0x50, 0x21, 0x95, 0x1d, 0x89, 0x8a, 0xd2, 0x05, 0x12, 0x32, 0x42, 0xaa, - 0xba, 0x89, 0x26, 0xc9, 0x90, 0x58, 0xc4, 0x1e, 0xcb, 0x33, 0xa1, 0xb0, 0xab, 0xba, 0xec, 0xaa, - 0x8f, 0xd1, 0x25, 0x8b, 0x6e, 0xfa, 0x06, 0xa8, 0x2b, 0xda, 0x55, 0x57, 0x51, 0x05, 0x0b, 0x54, - 0xfa, 0x12, 0xd5, 0xfc, 0xd8, 0x71, 0x42, 0x08, 0x52, 0x57, 0xdd, 0x78, 0x66, 0xce, 0xf7, 0xcd, - 0xd1, 0x39, 0xdf, 0x39, 0x73, 0x0c, 0x96, 0x7c, 0x7c, 0x4c, 0x03, 0xdc, 0xed, 0x5a, 0x7e, 0x80, - 0xf1, 0x91, 0x45, 0x4f, 0x4d, 0x3f, 0xc0, 0x14, 0x6b, 0xb9, 0x10, 0x30, 0x39, 0x90, 0xff, 0x07, - 0xba, 0x8e, 0x87, 0x2d, 0xfe, 0x15, 0x94, 0xbc, 0xd1, 0xc4, 0xc4, 0xc5, 0xc4, 0x6a, 0x40, 0x82, - 0xac, 0x93, 0xf5, 0x06, 0xa2, 0x70, 0xdd, 0x6a, 0x62, 0xc7, 0x93, 0xf8, 0x92, 0xc4, 0x5d, 0xd2, - 0xb6, 0x4e, 0xd6, 0xd9, 0x22, 0x81, 0x65, 0x01, 0xd4, 0xf9, 0xc9, 0x12, 0x07, 0x09, 0xcd, 0xb7, - 0x71, 0x1b, 0x0b, 0x3b, 0xdb, 0x49, 0xeb, 0xca, 0x48, 0x94, 0x3e, 0x0c, 0xa0, 0x1b, 0x5e, 0xc9, - 0x8f, 0x80, 0xcd, 0x2e, 0x74, 0xdc, 0x7b, 0x30, 0xfe, 0x0d, 0xc3, 0x8f, 0x30, 0x82, 0x08, 0x71, - 0xb0, 0x17, 0xae, 0x12, 0xff, 0x77, 0x80, 0x77, 0x60, 0x80, 0x5a, 0x16, 0x41, 0xc1, 0x89, 0xd3, - 0x44, 0x02, 0x2e, 0x7d, 0x52, 0xc0, 0xdc, 0x1e, 0x69, 0x1f, 0xfa, 0x2d, 0x48, 0xd1, 0x3e, 0x0f, - 0x48, 0xdb, 0x02, 0x2a, 0xec, 0xd1, 0x0e, 0x0e, 0x1c, 0x7a, 0xa6, 0x2b, 0x45, 0xa5, 0xac, 0x56, - 0xf4, 0xaf, 0x1f, 0xd7, 0xe6, 0x65, 0x8a, 0x3b, 0xad, 0x56, 0x80, 0x08, 0x39, 0xa0, 0x81, 0xe3, - 0xb5, 0xed, 0x01, 0x55, 0x7b, 0x06, 0x52, 0x22, 0x25, 0x3d, 0x59, 0x54, 0xca, 0x99, 0x8d, 0x45, - 0x73, 0x58, 0x7d, 0x53, 0xf8, 0xaf, 0xa8, 0x17, 0xfd, 0x42, 0xe2, 0xc3, 0xcd, 0xf9, 0xaa, 0x62, - 0xcb, 0x0b, 0xdb, 0x9b, 0x6f, 0x6f, 0xce, 0x57, 0x07, 0xae, 0xde, 0xdd, 0x9c, 0xaf, 0x16, 0xa3, - 0xc0, 0x4f, 0x65, 0xda, 0x23, 0x71, 0x96, 0x96, 0xc1, 0xd2, 0x88, 0xc9, 0x46, 0xc4, 0xc7, 0x1e, - 0x41, 0xa5, 0x1f, 0x49, 0x90, 0x1b, 0xc6, 0x7e, 0x3b, 0x2b, 0x0d, 0xfc, 0xe5, 0x41, 0x17, 0xf1, - 0x9c, 0x54, 0x9b, 0xef, 0xb5, 0x27, 0x40, 0x85, 0xa4, 0x4e, 0x38, 0x57, 0x9f, 0xe2, 0xbe, 0x66, - 0x6f, 0xfb, 0x85, 0x81, 0xb1, 0x96, 0xb0, 0xd3, 0x50, 0x3a, 0xd3, 0x1e, 0x81, 0x34, 0x24, 0x75, - 0xc7, 0xa3, 0x5b, 0x4f, 0xf5, 0x54, 0x51, 0x29, 0x4f, 0x55, 0xb2, 0xb7, 0xfd, 0x42, 0x64, 0xab, - 0x25, 0xec, 0x19, 0x48, 0x5e, 0xb0, 0xad, 0xa4, 0x36, 0xce, 0x28, 0x22, 0xfa, 0x4c, 0x51, 0x29, - 0x67, 0x23, 0x2a, 0xb7, 0x09, 0x6a, 0x85, 0x6d, 0x25, 0xf5, 0xa8, 0x8b, 0x21, 0xd5, 0xd3, 0x45, - 0xa5, 0x9c, 0x8c, 0xa8, 0xdc, 0x26, 0xa8, 0xbb, 0x6c, 0xab, 0xed, 0x80, 0x19, 0x48, 0xea, 0xac, - 0xa7, 0x75, 0x95, 0x57, 0x66, 0xd9, 0x94, 0x59, 0xb3, 0xa6, 0x37, 0x65, 0xd3, 0x9b, 0x55, 0xec, - 0x78, 0x95, 0xcc, 0x6d, 0xbf, 0x10, 0xb2, 0x6b, 0x09, 0x3b, 0x05, 0x09, 0x33, 0x6f, 0xe7, 0x86, - 0x0b, 0x54, 0x51, 0xb9, 0x4b, 0x7a, 0xe6, 0xa3, 0x52, 0x0d, 0x2c, 0x0e, 0x4b, 0x1d, 0x56, 0x41, - 0x33, 0xa3, 0x86, 0x50, 0x26, 0x35, 0x44, 0xd8, 0x05, 0xa5, 0x2f, 0x0a, 0xaf, 0x5a, 0x35, 0x40, - 0x90, 0xa2, 0x2a, 0x7b, 0x00, 0x5a, 0x15, 0xfc, 0x4d, 0x7a, 0xbe, 0xdf, 0x75, 0x50, 0x50, 0x87, - 0xa2, 0x44, 0x0f, 0x16, 0x6f, 0x2e, 0xbc, 0x21, 0xcd, 0xda, 0x2e, 0xc8, 0xc9, 0x47, 0x51, 0xef, - 0x20, 0xd8, 0x42, 0x81, 0x6c, 0xd0, 0xc2, 0x20, 0x9e, 0xf0, 0xd1, 0x1c, 0x88, 0xb5, 0xc6, 0x69, - 0xf6, 0x2c, 0x89, 0x1f, 0xb5, 0x15, 0xa0, 0x06, 0x18, 0xd3, 0x7a, 0x07, 0x92, 0x0e, 0x2f, 0x7b, - 0xd6, 0x4e, 0x33, 0x43, 0x0d, 0x92, 0xce, 0xf6, 0x02, 0x53, 0xe8, 0x4e, 0xb0, 0xa5, 0xe7, 0x5c, - 0x9d, 0x58, 0x4a, 0x91, 0x3a, 0x8f, 0xc1, 0x34, 0x7f, 0xe4, 0x52, 0x9c, 0x85, 0x51, 0x71, 0x04, - 0x5b, 0x70, 0x4a, 0x9f, 0x85, 0x34, 0x07, 0xbd, 0x86, 0xeb, 0xd0, 0x7d, 0x86, 0xff, 0x59, 0xd2, - 0xcc, 0x83, 0x69, 0x1e, 0xb5, 0x94, 0x45, 0x1c, 0x26, 0x6b, 0x12, 0xcb, 0x25, 0xae, 0x89, 0x70, - 0x73, 0x8f, 0x26, 0x82, 0x2d, 0x38, 0x1b, 0x3f, 0x93, 0x60, 0x6a, 0x8f, 0xb4, 0xb5, 0x97, 0x20, - 0x3b, 0x34, 0xbf, 0x0a, 0xa3, 0xb7, 0x46, 0xa6, 0x44, 0xfe, 0xff, 0x07, 0x08, 0x51, 0x38, 0x87, - 0x20, 0x13, 0x6f, 0x46, 0x63, 0xcc, 0xbd, 0x18, 0x9e, 0xff, 0x6f, 0x32, 0x1e, 0x77, 0x1b, 0x2f, - 0xe4, 0x38, 0xb7, 0x31, 0x7c, 0xac, 0xdb, 0x71, 0xe2, 0x1d, 0x82, 0x4c, 0x7c, 0xe0, 0x19, 0x93, - 0xb3, 0x1c, 0xeb, 0x76, 0xcc, 0x2b, 0xce, 0x4f, 0xbf, 0x61, 0xa3, 0xba, 0x52, 0xbb, 0xb8, 0x32, - 0x94, 0xcb, 0x2b, 0x43, 0xf9, 0x7e, 0x65, 0x28, 0xef, 0xaf, 0x8d, 0xc4, 0xe5, 0xb5, 0x91, 0xf8, - 0x76, 0x6d, 0x24, 0x5e, 0x99, 0x6d, 0x87, 0x76, 0x7a, 0x0d, 0xb3, 0x89, 0x5d, 0x8b, 0xb9, 0x5c, - 0xf3, 0x10, 0x7d, 0x8d, 0x83, 0x63, 0xeb, 0xce, 0x04, 0x67, 0xf3, 0x82, 0x34, 0x52, 0xfc, 0xd7, - 0xb3, 0xf9, 0x2b, 0x00, 0x00, 0xff, 0xff, 0x99, 0x5d, 0x17, 0x47, 0xb6, 0x07, 0x00, 0x00, + // 793 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x55, 0x41, 0x4f, 0xdb, 0x48, + 0x14, 0x8e, 0xc3, 0x12, 0xe2, 0x49, 0xc8, 0x6a, 0x2d, 0x96, 0x38, 0x41, 0xeb, 0x44, 0x39, 0xec, + 0x66, 0xd9, 0xc5, 0x16, 0xb0, 0x42, 0x5a, 0x6e, 0x04, 0x15, 0xa5, 0x07, 0x54, 0x64, 0x8a, 0x54, + 0xf5, 0x62, 0x4d, 0x92, 0x21, 0xb1, 0x88, 0x3d, 0xd6, 0xcc, 0x84, 0xc2, 0xad, 0xea, 0xb1, 0xa7, + 0xfe, 0x8c, 0x1e, 0x39, 0xf4, 0xd2, 0x7f, 0xc0, 0x11, 0xf5, 0xd4, 0x53, 0x54, 0x41, 0x25, 0x54, + 0xf8, 0x13, 0x95, 0x67, 0xc6, 0x8e, 0x93, 0x06, 0xa8, 0x7a, 0xea, 0x25, 0x9e, 0x79, 0xdf, 0xf7, + 0x9e, 0xde, 0xfb, 0xde, 0x9b, 0x17, 0x50, 0x0c, 0xf0, 0x11, 0x23, 0xb8, 0xdf, 0xb7, 0x02, 0x82, + 0xf1, 0xa1, 0xc5, 0x4e, 0xcc, 0x80, 0x60, 0x86, 0xb5, 0x42, 0x04, 0x98, 0x1c, 0x28, 0xff, 0x06, + 0x3d, 0xd7, 0xc7, 0x16, 0xff, 0x15, 0x94, 0xb2, 0xd1, 0xc6, 0xd4, 0xc3, 0xd4, 0x6a, 0x41, 0x8a, + 0xac, 0xe3, 0xd5, 0x16, 0x62, 0x70, 0xd5, 0x6a, 0x63, 0xd7, 0x97, 0x78, 0x51, 0xe2, 0x1e, 0xed, + 0x5a, 0xc7, 0xab, 0xe1, 0x47, 0x02, 0x25, 0x01, 0x38, 0xfc, 0x66, 0x89, 0x8b, 0x84, 0x16, 0xba, + 0xb8, 0x8b, 0x85, 0x3d, 0x3c, 0x49, 0xeb, 0xd2, 0x44, 0x96, 0x01, 0x24, 0xd0, 0x8b, 0x5c, 0xca, + 0x13, 0x60, 0xbb, 0x0f, 0x5d, 0xef, 0x0e, 0x8c, 0xff, 0x46, 0xe9, 0xc7, 0x18, 0x45, 0x94, 0xba, + 0xd8, 0x8f, 0xbe, 0x12, 0xff, 0x63, 0x84, 0xf7, 0x20, 0x41, 0x1d, 0x8b, 0x22, 0x72, 0xec, 0xb6, + 0x91, 0x80, 0x6b, 0xef, 0x15, 0xf0, 0xeb, 0x2e, 0xed, 0x1e, 0x04, 0x1d, 0xc8, 0xd0, 0x1e, 0x4f, + 0x48, 0xdb, 0x00, 0x2a, 0x1c, 0xb0, 0x1e, 0x26, 0x2e, 0x3b, 0xd5, 0x95, 0xaa, 0x52, 0x57, 0x1b, + 0xfa, 0x87, 0x77, 0x2b, 0x0b, 0xb2, 0xc4, 0xad, 0x4e, 0x87, 0x20, 0x4a, 0xf7, 0x19, 0x71, 0xfd, + 0xae, 0x3d, 0xa2, 0x6a, 0xff, 0x83, 0x8c, 0x28, 0x49, 0x4f, 0x57, 0x95, 0x7a, 0x6e, 0x6d, 0xd1, + 0x1c, 0x57, 0xdf, 0x14, 0xf1, 0x1b, 0xea, 0xf9, 0xb0, 0x92, 0x7a, 0x7b, 0x7d, 0xb6, 0xac, 0xd8, + 0xd2, 0x61, 0x73, 0xfd, 0xd5, 0xf5, 0xd9, 0xf2, 0x28, 0xd4, 0xeb, 0xeb, 0xb3, 0xe5, 0x6a, 0x9c, + 0xf8, 0x89, 0x2c, 0x7b, 0x22, 0xcf, 0x5a, 0x09, 0x14, 0x27, 0x4c, 0x36, 0xa2, 0x01, 0xf6, 0x29, + 0xaa, 0x7d, 0x49, 0x83, 0xc2, 0x38, 0xf6, 0xc3, 0x55, 0x69, 0xe0, 0x17, 0x1f, 0x7a, 0x88, 0xd7, + 0xa4, 0xda, 0xfc, 0xac, 0xfd, 0x0b, 0x54, 0x48, 0x1d, 0xca, 0xb9, 0xfa, 0x0c, 0x8f, 0x35, 0x7f, + 0x33, 0xac, 0x8c, 0x8c, 0xcd, 0x94, 0x9d, 0x85, 0x32, 0x98, 0xf6, 0x37, 0xc8, 0x42, 0xea, 0xb8, + 0x3e, 0xdb, 0xf8, 0x4f, 0xcf, 0x54, 0x95, 0xfa, 0x4c, 0x23, 0x7f, 0x33, 0xac, 0xc4, 0xb6, 0x66, + 0xca, 0x9e, 0x83, 0xf4, 0x71, 0x78, 0x94, 0xd4, 0xd6, 0x29, 0x43, 0x54, 0x9f, 0xab, 0x2a, 0xf5, + 0x7c, 0x4c, 0xe5, 0x36, 0x41, 0x6d, 0x84, 0x47, 0x49, 0x3d, 0xec, 0x63, 0xc8, 0xf4, 0x6c, 0x55, + 0xa9, 0xa7, 0x63, 0x2a, 0xb7, 0x09, 0xea, 0x4e, 0x78, 0xd4, 0xb6, 0xc0, 0x1c, 0xa4, 0x4e, 0x38, + 0xd3, 0xba, 0xca, 0x3b, 0x53, 0x32, 0x65, 0xd5, 0xe1, 0xd0, 0x9b, 0x72, 0xe8, 0xcd, 0x6d, 0xec, + 0xfa, 0x8d, 0xdc, 0xcd, 0xb0, 0x12, 0xb1, 0x9b, 0x29, 0x3b, 0x03, 0x69, 0x68, 0xde, 0x2c, 0x8c, + 0x37, 0xa8, 0xa1, 0xf2, 0x90, 0xec, 0x34, 0x40, 0xb5, 0x26, 0x58, 0x1c, 0x97, 0x3a, 0xea, 0x82, + 0x66, 0xc6, 0x03, 0xa1, 0xdc, 0x37, 0x10, 0xd1, 0x14, 0xd4, 0x6e, 0x15, 0xde, 0xb5, 0x6d, 0x82, + 0x20, 0x43, 0xdb, 0xe1, 0x03, 0xd0, 0x9e, 0x82, 0x12, 0x1d, 0x04, 0x41, 0xdf, 0x45, 0xc4, 0xc1, + 0x01, 0x22, 0x90, 0x61, 0xe2, 0x40, 0xd1, 0xab, 0x07, 0xbb, 0x58, 0x8c, 0x5c, 0x9f, 0x48, 0x4f, + 0x09, 0x6b, 0x3b, 0xa0, 0x20, 0x5f, 0x89, 0xd3, 0x43, 0xb0, 0x83, 0x88, 0x9c, 0xd8, 0xca, 0x28, + 0xc1, 0xe8, 0x15, 0xed, 0x8b, 0x6f, 0x93, 0xd3, 0xec, 0x79, 0x9a, 0xbc, 0x6a, 0x4b, 0x40, 0x25, + 0x18, 0x33, 0xa7, 0x07, 0x69, 0x8f, 0xcf, 0x41, 0xde, 0xce, 0x86, 0x86, 0x26, 0xa4, 0xbd, 0x4d, + 0x23, 0x94, 0xec, 0xee, 0xec, 0x6b, 0x8f, 0xb8, 0x6e, 0x89, 0x62, 0x63, 0xdd, 0xfe, 0x01, 0xb3, + 0xfc, 0xf9, 0x4b, 0xd9, 0x7e, 0x9f, 0x94, 0x4d, 0xb0, 0x05, 0xa7, 0xf6, 0x59, 0x88, 0xb6, 0x3f, + 0x68, 0x79, 0x2e, 0xdb, 0x0b, 0xf1, 0x9f, 0x5c, 0xb4, 0x05, 0x30, 0xcb, 0xcb, 0x90, 0x82, 0x89, + 0xcb, 0x77, 0xaa, 0x95, 0xa8, 0x32, 0xa9, 0x96, 0x88, 0x77, 0x87, 0x5a, 0x82, 0x2d, 0x38, 0x6b, + 0xb7, 0x69, 0x30, 0xb3, 0x4b, 0xbb, 0xda, 0x33, 0x90, 0x1f, 0xdb, 0x79, 0x95, 0x49, 0xaf, 0x89, + 0xcd, 0x52, 0xfe, 0xeb, 0x01, 0x42, 0x9c, 0xce, 0x01, 0xc8, 0x25, 0x07, 0xd8, 0x98, 0xe2, 0x97, + 0xc0, 0xcb, 0x7f, 0xde, 0x8f, 0x27, 0xc3, 0x26, 0x5b, 0x3c, 0x2d, 0x6c, 0x02, 0x9f, 0x1a, 0x76, + 0x9a, 0x78, 0x07, 0x20, 0x97, 0x5c, 0x92, 0xc6, 0xfd, 0x55, 0x4e, 0x0d, 0x3b, 0xe5, 0xe5, 0x97, + 0x67, 0x5f, 0x86, 0xeb, 0xbd, 0xd1, 0x3c, 0xbf, 0x34, 0x94, 0x8b, 0x4b, 0x43, 0xf9, 0x74, 0x69, + 0x28, 0x6f, 0xae, 0x8c, 0xd4, 0xc5, 0x95, 0x91, 0xfa, 0x78, 0x65, 0xa4, 0x9e, 0x9b, 0x5d, 0x97, + 0xf5, 0x06, 0x2d, 0xb3, 0x8d, 0x3d, 0x2b, 0x0c, 0xb9, 0xe2, 0x23, 0xf6, 0x02, 0x93, 0x23, 0xeb, + 0x9b, 0xad, 0x1f, 0xee, 0x18, 0xda, 0xca, 0xf0, 0xbf, 0xab, 0xf5, 0xaf, 0x01, 0x00, 0x00, 0xff, + 0xff, 0xa9, 0xe8, 0xcc, 0x37, 0xea, 0x07, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1046,10 +1047,10 @@ func (m *MsgCreateClaim) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x12 } - if len(m.SupplierAddress) > 0 { - i -= len(m.SupplierAddress) - copy(dAtA[i:], m.SupplierAddress) - i = encodeVarintTx(dAtA, i, uint64(len(m.SupplierAddress))) + if len(m.SupplierOperatorAddress) > 0 { + i -= len(m.SupplierOperatorAddress) + copy(dAtA[i:], m.SupplierOperatorAddress) + i = encodeVarintTx(dAtA, i, uint64(len(m.SupplierOperatorAddress))) i-- dAtA[i] = 0xa } @@ -1130,10 +1131,10 @@ func (m *MsgSubmitProof) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x12 } - if len(m.SupplierAddress) > 0 { - i -= len(m.SupplierAddress) - copy(dAtA[i:], m.SupplierAddress) - i = encodeVarintTx(dAtA, i, uint64(len(m.SupplierAddress))) + if len(m.SupplierOperatorAddress) > 0 { + i -= len(m.SupplierOperatorAddress) + copy(dAtA[i:], m.SupplierOperatorAddress) + i = encodeVarintTx(dAtA, i, uint64(len(m.SupplierOperatorAddress))) i-- dAtA[i] = 0xa } @@ -1301,7 +1302,7 @@ func (m *MsgCreateClaim) Size() (n int) { } var l int _ = l - l = len(m.SupplierAddress) + l = len(m.SupplierOperatorAddress) if l > 0 { n += 1 + l + sovTx(uint64(l)) } @@ -1335,7 +1336,7 @@ func (m *MsgSubmitProof) Size() (n int) { } var l int _ = l - l = len(m.SupplierAddress) + l = len(m.SupplierOperatorAddress) if l > 0 { n += 1 + l + sovTx(uint64(l)) } @@ -1896,7 +1897,7 @@ func (m *MsgCreateClaim) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SupplierAddress", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field SupplierOperatorAddress", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1924,7 +1925,7 @@ func (m *MsgCreateClaim) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.SupplierAddress = string(dAtA[iNdEx:postIndex]) + m.SupplierOperatorAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { @@ -2134,7 +2135,7 @@ func (m *MsgSubmitProof) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SupplierAddress", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field SupplierOperatorAddress", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2162,7 +2163,7 @@ func (m *MsgSubmitProof) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.SupplierAddress = string(dAtA[iNdEx:postIndex]) + m.SupplierOperatorAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { diff --git a/x/service/module/tx.go b/x/service/module/tx.go index 4ae1d1f13..a54ac9fbe 100644 --- a/x/service/module/tx.go +++ b/x/service/module/tx.go @@ -10,7 +10,7 @@ import ( ) // GetTxCmd returns the transaction commands for this module -// TODO_TECHDEBT(@bryanchriswhite, #370): remove if custom query commands are consolidated into AutoCLI. +// TODO_MAINNET(#370): remove if custom query commands are consolidated into AutoCLI. func (am AppModule) GetTxCmd() *cobra.Command { cmd := &cobra.Command{ Use: types.ModuleName, diff --git a/x/service/module/tx_add_service.go b/x/service/module/tx_add_service.go index 4f0c40657..4e51bdad5 100644 --- a/x/service/module/tx_add_service.go +++ b/x/service/module/tx_add_service.go @@ -30,7 +30,7 @@ func CmdAddService() *cobra.Command { gateways and suppliers to use. The service id MUST be unique but the service name doesn't have to be. Example: -$ poktrolld tx service add-service "svc1" "service_one" 1 --keyring-backend test --from $(SUPPLIER) --node $(POCKET_NODE) --home $(POKTROLLD_HOME)`, +$ poktrolld tx service add-service "svc1" "service_one" 1 --keyring-backend test --from $(SERVICE_OWNER) --node $(POCKET_NODE) --home $(POKTROLLD_HOME)`, Args: cobra.MinimumNArgs(2), RunE: func(cmd *cobra.Command, args []string) (err error) { serviceIdStr := args[0] diff --git a/x/service/types/relay.go b/x/service/types/relay.go index b43ded9f7..5d9748032 100644 --- a/x/service/types/relay.go +++ b/x/service/types/relay.go @@ -55,8 +55,8 @@ func (req *RelayRequest) ValidateBasic() error { return ErrServiceInvalidRelayRequest.Wrap("missing application signature") } - if meta.GetSupplierAddress() == "" { - return ErrServiceInvalidRelayRequest.Wrap("relay metadata missing supplier address") + if meta.GetSupplierOperatorAddress() == "" { + return ErrServiceInvalidRelayRequest.Wrap("relay metadata missing supplier operator address") } return nil @@ -68,7 +68,7 @@ func (req *RelayRequest) ValidateBasic() error { func (res RelayResponse) GetSignableBytesHash() ([protocol.RelayHasherSize]byte, error) { // res and res.Meta are not pointers, so we can set the signature to nil // in order to generate the signable bytes hash without the need restore it. - res.Meta.SupplierSignature = nil + res.Meta.SupplierOperatorSignature = nil responseBz, err := res.Marshal() if err != nil { return [protocol.RelayHasherSize]byte{}, err @@ -80,7 +80,7 @@ func (res RelayResponse) GetSignableBytesHash() ([protocol.RelayHasherSize]byte, } // ValidateBasic performs basic validation of the RelayResponse Meta, SessionHeader -// and SupplierSignature fields. +// and SupplierOperatorSignature fields. // TODO_TEST: Add tests for RelayResponse validation func (res *RelayResponse) ValidateBasic() error { // TODO: if a client gets a response with an invalid/incomplete @@ -97,22 +97,22 @@ func (res *RelayResponse) ValidateBasic() error { return ErrServiceInvalidRelayResponse.Wrapf("invalid session header: %v", err) } - if len(meta.GetSupplierSignature()) == 0 { - return ErrServiceInvalidRelayResponse.Wrap("missing supplier signature") + if len(meta.GetSupplierOperatorSignature()) == 0 { + return ErrServiceInvalidRelayResponse.Wrap("missing supplier operator signature") } return nil } -// VerifySupplierSignature ensures the signature provided by the supplier is +// VerifySupplierOperatorSignature ensures the signature provided by the supplier is // valid according to their relay response. -func (res *RelayResponse) VerifySupplierSignature(supplierPubKey cryptotypes.PubKey) error { +func (res *RelayResponse) VerifySupplierOperatorSignature(supplierOperatorPubKey cryptotypes.PubKey) error { // Get the signable bytes hash of the response. signableBz, err := res.GetSignableBytesHash() if err != nil { return err } - if ok := supplierPubKey.VerifySignature(signableBz[:], res.GetMeta().SupplierSignature); !ok { + if ok := supplierOperatorPubKey.VerifySignature(signableBz[:], res.GetMeta().SupplierOperatorSignature); !ok { return ErrServiceInvalidRelayResponse.Wrap("invalid signature") } diff --git a/x/service/types/relay.pb.go b/x/service/types/relay.pb.go index 777f356ac..dc2e55c54 100644 --- a/x/service/types/relay.pb.go +++ b/x/service/types/relay.pb.go @@ -90,9 +90,9 @@ type RelayRequestMetadata struct { // TODO_MAINNET: make sure we're checking/verifying this address on-chain (if needed). // Relevant conversation: https://github.com/pokt-network/poktroll/pull/567#discussion_r1628722168 // - // The supplier address the relay is sent to. It is being used on the RelayMiner to - // route to the correct supplier. - SupplierAddress string `protobuf:"bytes,3,opt,name=supplier_address,json=supplierAddress,proto3" json:"supplier_address,omitempty"` + // The supplier operator address the relay is sent to. It is being used on the + // RelayMiner to route to the correct supplier. + SupplierOperatorAddress string `protobuf:"bytes,3,opt,name=supplier_operator_address,json=supplierOperatorAddress,proto3" json:"supplier_operator_address,omitempty"` } func (m *RelayRequestMetadata) Reset() { *m = RelayRequestMetadata{} } @@ -142,9 +142,9 @@ func (m *RelayRequestMetadata) GetSignature() []byte { return nil } -func (m *RelayRequestMetadata) GetSupplierAddress() string { +func (m *RelayRequestMetadata) GetSupplierOperatorAddress() string { if m != nil { - return m.SupplierAddress + return m.SupplierOperatorAddress } return "" } @@ -263,8 +263,8 @@ func (m *RelayResponse) GetPayload() []byte { // RelayResponseMetadata contains the metadata for a RelayResponse. type RelayResponseMetadata struct { - SessionHeader *types.SessionHeader `protobuf:"bytes,1,opt,name=session_header,json=sessionHeader,proto3" json:"session_header,omitempty"` - SupplierSignature []byte `protobuf:"bytes,2,opt,name=supplier_signature,json=supplierSignature,proto3" json:"supplier_signature,omitempty"` + SessionHeader *types.SessionHeader `protobuf:"bytes,1,opt,name=session_header,json=sessionHeader,proto3" json:"session_header,omitempty"` + SupplierOperatorSignature []byte `protobuf:"bytes,2,opt,name=supplier_operator_signature,json=supplierOperatorSignature,proto3" json:"supplier_operator_signature,omitempty"` } func (m *RelayResponseMetadata) Reset() { *m = RelayResponseMetadata{} } @@ -307,9 +307,9 @@ func (m *RelayResponseMetadata) GetSessionHeader() *types.SessionHeader { return nil } -func (m *RelayResponseMetadata) GetSupplierSignature() []byte { +func (m *RelayResponseMetadata) GetSupplierOperatorSignature() []byte { if m != nil { - return m.SupplierSignature + return m.SupplierOperatorSignature } return nil } @@ -325,34 +325,34 @@ func init() { func init() { proto.RegisterFile("poktroll/service/relay.proto", fileDescriptor_38cf3e40553b40a1) } var fileDescriptor_38cf3e40553b40a1 = []byte{ - // 420 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x53, 0xcd, 0xae, 0xd2, 0x40, - 0x14, 0xee, 0x78, 0xaf, 0x9a, 0x3b, 0xde, 0xab, 0x38, 0xc1, 0xa4, 0x12, 0x32, 0x90, 0x2e, 0x94, - 0x0d, 0x2d, 0xea, 0x0b, 0x08, 0x26, 0xc6, 0x98, 0xb8, 0x29, 0x3b, 0x37, 0x64, 0xa0, 0x27, 0xa5, - 0x52, 0x3a, 0x65, 0xce, 0x54, 0xe5, 0x25, 0x8c, 0x0f, 0xe3, 0x0b, 0xb8, 0x63, 0x49, 0x5c, 0xb9, - 0x32, 0x06, 0x5e, 0xc4, 0xb4, 0x9d, 0x62, 0x21, 0xfe, 0xc4, 0xc4, 0xd5, 0xf4, 0x9c, 0xef, 0x7c, - 0xf3, 0x7d, 0x73, 0xce, 0x29, 0x6d, 0xa7, 0x72, 0xa1, 0x95, 0x8c, 0x63, 0x0f, 0x41, 0xbd, 0x8d, - 0x66, 0xe0, 0x29, 0x88, 0xc5, 0xda, 0x4d, 0x95, 0xd4, 0x92, 0x35, 0x2a, 0xd4, 0x35, 0x68, 0xeb, - 0xfe, 0x4c, 0xe2, 0x52, 0xe2, 0xa4, 0xc0, 0xbd, 0x32, 0x28, 0x8b, 0x5b, 0xcd, 0x50, 0x86, 0xb2, - 0xcc, 0xe7, 0x5f, 0x26, 0xcb, 0x6b, 0x02, 0x88, 0x91, 0x4c, 0xaa, 0xb3, 0xc4, 0x9d, 0x98, 0x5e, - 0xf7, 0x73, 0x45, 0x36, 0xa0, 0x67, 0x0a, 0x56, 0x36, 0xe9, 0x92, 0xde, 0xad, 0xc7, 0xdc, 0x3d, - 0x55, 0x76, 0x8b, 0x2a, 0x1f, 0x56, 0x19, 0xa0, 0xf6, 0xf3, 0x52, 0xf6, 0x28, 0x67, 0xa0, 0x7d, - 0xad, 0x60, 0x74, 0x7e, 0xcb, 0xc0, 0x54, 0x26, 0x08, 0x39, 0x05, 0x9d, 0xcf, 0x84, 0x36, 0xeb, - 0x17, 0xbd, 0x02, 0x2d, 0x02, 0xa1, 0x05, 0x7b, 0x4e, 0x6f, 0x1b, 0x5f, 0x93, 0x39, 0x88, 0x00, - 0x94, 0x31, 0x72, 0x74, 0x6d, 0xe9, 0x7b, 0x5c, 0x9e, 0x2f, 0x8a, 0x32, 0xff, 0x0a, 0xeb, 0x21, - 0x6b, 0xd3, 0x0b, 0x8c, 0xc2, 0x44, 0xe8, 0x4c, 0x41, 0xe1, 0xec, 0xd2, 0xff, 0x99, 0x60, 0xcf, - 0x68, 0x03, 0xb3, 0x34, 0x8d, 0x23, 0x50, 0x13, 0x11, 0x04, 0x0a, 0x10, 0xed, 0xb3, 0x2e, 0xe9, - 0x5d, 0x8c, 0xec, 0x2f, 0x9f, 0xfa, 0x4d, 0xd3, 0xce, 0x61, 0x89, 0x8c, 0xb5, 0x8a, 0x92, 0xd0, - 0xbf, 0x53, 0x31, 0x4c, 0xda, 0x79, 0x43, 0x2f, 0xeb, 0x4f, 0x60, 0x4f, 0xe9, 0xf9, 0x12, 0xb4, - 0x30, 0x86, 0x1f, 0xfc, 0xb9, 0x73, 0xd5, 0x83, 0x47, 0xe7, 0x9b, 0x6f, 0x1d, 0xcb, 0x2f, 0x98, - 0xcc, 0xa6, 0x37, 0x53, 0xb1, 0x8e, 0xa5, 0x08, 0x8c, 0xe5, 0x2a, 0x74, 0x62, 0x7a, 0x75, 0xd4, - 0x45, 0x36, 0x3c, 0x12, 0x7b, 0xf8, 0x97, 0xa6, 0xff, 0xa3, 0xda, 0x07, 0x42, 0xef, 0xfd, 0x92, - 0xff, 0xdf, 0xc6, 0xd3, 0xa7, 0xec, 0x30, 0x80, 0xd3, 0x39, 0xdd, 0xad, 0x90, 0x71, 0x05, 0x8c, - 0x5e, 0x6e, 0x76, 0x9c, 0x6c, 0x77, 0x9c, 0x7c, 0xdf, 0x71, 0xf2, 0x71, 0xcf, 0xad, 0xed, 0x9e, - 0x5b, 0x5f, 0xf7, 0xdc, 0x7a, 0x3d, 0x08, 0x23, 0x3d, 0xcf, 0xa6, 0xee, 0x4c, 0x2e, 0xbd, 0xdc, - 0x42, 0x3f, 0x01, 0xfd, 0x4e, 0xaa, 0x85, 0x77, 0x58, 0xf7, 0xf7, 0x87, 0x3f, 0x4a, 0xaf, 0x53, - 0xc0, 0xe9, 0x8d, 0x62, 0xdf, 0x9f, 0xfc, 0x08, 0x00, 0x00, 0xff, 0xff, 0x00, 0x21, 0xb2, 0x0a, - 0x72, 0x03, 0x00, 0x00, + // 432 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x53, 0xcd, 0x6e, 0xd3, 0x40, + 0x10, 0xf6, 0xd2, 0x02, 0xea, 0xd2, 0x22, 0xb4, 0x0a, 0xc2, 0x29, 0xd5, 0xb6, 0xf2, 0x01, 0x7a, + 0xa9, 0x5d, 0xe0, 0x8e, 0x68, 0x0e, 0x08, 0x21, 0x21, 0x24, 0x87, 0x13, 0x17, 0x6b, 0x1b, 0x8f, + 0x1c, 0x13, 0xc7, 0xbb, 0xd9, 0x59, 0x03, 0x79, 0x0b, 0xde, 0x80, 0x97, 0xe0, 0x21, 0x72, 0x8c, + 0x72, 0xe2, 0x84, 0x50, 0xf2, 0x22, 0xc8, 0xf6, 0x3a, 0x38, 0xe1, 0x4f, 0x48, 0x3d, 0xd9, 0x33, + 0xdf, 0x7c, 0x3b, 0xdf, 0x7c, 0xa3, 0xa1, 0x47, 0x4a, 0x8e, 0x8c, 0x96, 0x59, 0x16, 0x20, 0xe8, + 0xf7, 0xe9, 0x00, 0x02, 0x0d, 0x99, 0x98, 0xfa, 0x4a, 0x4b, 0x23, 0xd9, 0x9d, 0x06, 0xf5, 0x2d, + 0x7a, 0xd8, 0x1d, 0x48, 0x1c, 0x4b, 0x8c, 0x2a, 0x3c, 0xa8, 0x83, 0xba, 0xf8, 0xb0, 0x93, 0xc8, + 0x44, 0xd6, 0xf9, 0xf2, 0xcf, 0x66, 0x79, 0xab, 0x01, 0x62, 0x2a, 0xf3, 0xe6, 0x5b, 0xe3, 0x5e, + 0x46, 0xaf, 0x87, 0x65, 0x47, 0x76, 0x4e, 0x77, 0x34, 0x4c, 0x5c, 0x72, 0x42, 0x4e, 0x6f, 0x3d, + 0xe6, 0xfe, 0x76, 0x67, 0xbf, 0xaa, 0x0a, 0x61, 0x52, 0x00, 0x9a, 0xb0, 0x2c, 0x65, 0x8f, 0x4a, + 0x06, 0xba, 0xd7, 0x2a, 0xc6, 0xf1, 0x1f, 0x19, 0xa8, 0x64, 0x8e, 0x50, 0x52, 0xd0, 0x5b, 0x10, + 0xda, 0x69, 0x3f, 0xf4, 0x0a, 0x8c, 0x88, 0x85, 0x11, 0xec, 0x39, 0xbd, 0x6d, 0x75, 0x45, 0x43, + 0x10, 0x31, 0x68, 0x2b, 0x64, 0xe3, 0xd9, 0x5a, 0x77, 0xbf, 0xfe, 0xbe, 0xa8, 0xca, 0xc2, 0x03, + 0x6c, 0x87, 0xec, 0x88, 0xee, 0x61, 0x9a, 0xe4, 0xc2, 0x14, 0x1a, 0x2a, 0x65, 0xfb, 0xe1, 0xcf, + 0x04, 0x7b, 0x43, 0xbb, 0x58, 0x28, 0x95, 0xa5, 0xa0, 0x23, 0xa9, 0x40, 0x0b, 0x23, 0x75, 0x24, + 0xe2, 0x58, 0x03, 0xa2, 0xbb, 0x73, 0x42, 0x4e, 0xf7, 0x7a, 0xee, 0xe2, 0xcb, 0x59, 0xc7, 0xfa, + 0x7a, 0x51, 0x23, 0x7d, 0xa3, 0xd3, 0x3c, 0x09, 0xef, 0x35, 0xd4, 0xd7, 0x96, 0x69, 0x61, 0xef, + 0x1d, 0xdd, 0x6f, 0xcf, 0xc4, 0x9e, 0xd1, 0xdd, 0x31, 0x18, 0x61, 0x27, 0x78, 0xf0, 0x77, 0x2b, + 0x1b, 0x07, 0x7a, 0xbb, 0xb3, 0x6f, 0xc7, 0x4e, 0x58, 0x31, 0x99, 0x4b, 0x6f, 0x2a, 0x31, 0xcd, + 0xa4, 0x88, 0xed, 0x0c, 0x4d, 0xe8, 0x65, 0xf4, 0x60, 0xc3, 0x56, 0x76, 0xb1, 0xd1, 0xec, 0xe1, + 0x3f, 0xb6, 0xf0, 0x9f, 0xdd, 0x3e, 0x13, 0x7a, 0xf7, 0xb7, 0xfc, 0x2b, 0xdb, 0xd7, 0x53, 0x7a, + 0xff, 0xd7, 0x8d, 0x6c, 0x6f, 0xb0, 0xbb, 0xed, 0x7c, 0xbf, 0x29, 0xe8, 0xbd, 0x9c, 0x2d, 0x39, + 0x99, 0x2f, 0x39, 0xf9, 0xbe, 0xe4, 0xe4, 0xd3, 0x8a, 0x3b, 0xf3, 0x15, 0x77, 0xbe, 0xae, 0xb8, + 0xf3, 0xf6, 0x3c, 0x49, 0xcd, 0xb0, 0xb8, 0xf4, 0x07, 0x72, 0x1c, 0x94, 0x9a, 0xce, 0x72, 0x30, + 0x1f, 0xa4, 0x1e, 0x05, 0xeb, 0x83, 0xf8, 0xb8, 0xbe, 0x39, 0x33, 0x55, 0x80, 0x97, 0x37, 0xaa, + 0x8b, 0x78, 0xf2, 0x23, 0x00, 0x00, 0xff, 0xff, 0xf3, 0xcc, 0x64, 0x01, 0x94, 0x03, 0x00, 0x00, } func (m *Relay) Marshal() (dAtA []byte, err error) { @@ -422,10 +422,10 @@ func (m *RelayRequestMetadata) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.SupplierAddress) > 0 { - i -= len(m.SupplierAddress) - copy(dAtA[i:], m.SupplierAddress) - i = encodeVarintRelay(dAtA, i, uint64(len(m.SupplierAddress))) + if len(m.SupplierOperatorAddress) > 0 { + i -= len(m.SupplierOperatorAddress) + copy(dAtA[i:], m.SupplierOperatorAddress) + i = encodeVarintRelay(dAtA, i, uint64(len(m.SupplierOperatorAddress))) i-- dAtA[i] = 0x1a } @@ -551,10 +551,10 @@ func (m *RelayResponseMetadata) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.SupplierSignature) > 0 { - i -= len(m.SupplierSignature) - copy(dAtA[i:], m.SupplierSignature) - i = encodeVarintRelay(dAtA, i, uint64(len(m.SupplierSignature))) + if len(m.SupplierOperatorSignature) > 0 { + i -= len(m.SupplierOperatorSignature) + copy(dAtA[i:], m.SupplierOperatorSignature) + i = encodeVarintRelay(dAtA, i, uint64(len(m.SupplierOperatorSignature))) i-- dAtA[i] = 0x12 } @@ -615,7 +615,7 @@ func (m *RelayRequestMetadata) Size() (n int) { if l > 0 { n += 1 + l + sovRelay(uint64(l)) } - l = len(m.SupplierAddress) + l = len(m.SupplierOperatorAddress) if l > 0 { n += 1 + l + sovRelay(uint64(l)) } @@ -662,7 +662,7 @@ func (m *RelayResponseMetadata) Size() (n int) { l = m.SessionHeader.Size() n += 1 + l + sovRelay(uint64(l)) } - l = len(m.SupplierSignature) + l = len(m.SupplierOperatorSignature) if l > 0 { n += 1 + l + sovRelay(uint64(l)) } @@ -898,7 +898,7 @@ func (m *RelayRequestMetadata) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SupplierAddress", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field SupplierOperatorAddress", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -926,7 +926,7 @@ func (m *RelayRequestMetadata) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.SupplierAddress = string(dAtA[iNdEx:postIndex]) + m.SupplierOperatorAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -1250,7 +1250,7 @@ func (m *RelayResponseMetadata) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SupplierSignature", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field SupplierOperatorSignature", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { @@ -1277,9 +1277,9 @@ func (m *RelayResponseMetadata) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.SupplierSignature = append(m.SupplierSignature[:0], dAtA[iNdEx:postIndex]...) - if m.SupplierSignature == nil { - m.SupplierSignature = []byte{} + m.SupplierOperatorSignature = append(m.SupplierOperatorSignature[:0], dAtA[iNdEx:postIndex]...) + if m.SupplierOperatorSignature == nil { + m.SupplierOperatorSignature = []byte{} } iNdEx = postIndex default: diff --git a/x/session/keeper/session_hydrator_test.go b/x/session/keeper/session_hydrator_test.go index d37ee1ed2..d70c148b7 100644 --- a/x/session/keeper/session_hydrator_test.go +++ b/x/session/keeper/session_hydrator_test.go @@ -46,7 +46,7 @@ func TestSession_HydrateSession_Success_BaseCase(t *testing.T) { require.Len(t, suppliers, 1) supplier := suppliers[0] - require.Equal(t, keepertest.TestSupplierAddress, supplier.Address) + require.Equal(t, keepertest.TestSupplierOperatorAddress, supplier.OperatorAddress) require.Len(t, supplier.Services, 3) } diff --git a/x/shared/session.go b/x/shared/session.go index 28f0645b5..b264df0e8 100644 --- a/x/shared/session.go +++ b/x/shared/session.go @@ -114,13 +114,13 @@ func GetEarliestSupplierClaimCommitHeight( sharedParams *sharedtypes.Params, queryHeight int64, claimWindowOpenBlockHash []byte, - supplierAddr string, + supplierOperatorAddr string, ) int64 { claimWindowOpenHeight := GetClaimWindowOpenHeight(sharedParams, queryHeight) // Generate a deterministic random (non-negative) int64, seeded by the claim - // window open block hash and the supplier address. - //randomNumber := poktrand.SeededInt63(claimWindowOpenBlockHash, []byte(supplierAddr)) + // window open block hash and the supplier operator address. + //randomNumber := poktrand.SeededInt63(claimWindowOpenBlockHash, []byte(supplierOperatorAddr)) //distributionWindowSizeBlocks := sharedParams.GetClaimWindowCloseOffsetBlocks() //randCreateClaimHeightOffset := randomNumber % int64(distributionWindowSizeBlocks) @@ -141,13 +141,13 @@ func GetEarliestSupplierProofCommitHeight( sharedParams *sharedtypes.Params, queryHeight int64, proofWindowOpenBlockHash []byte, - supplierAddr string, + supplierOperatorAddr string, ) int64 { proofWindowOpenHeight := GetProofWindowOpenHeight(sharedParams, queryHeight) // Generate a deterministic random (non-negative) int64, seeded by the proof - // window open block hash and the supplier address. - //randomNumber := poktrand.SeededInt63(proofWindowOpenBlockHash, []byte(supplierAddr)) + // window open block hash and the supplier operator address. + //randomNumber := poktrand.SeededInt63(proofWindowOpenBlockHash, []byte(supplierOperatorAddr)) //distributionWindowSizeBlocks := sharedParams.GetProofWindowCloseOffsetBlocks() //randCreateProofHeightOffset := randomNumber % int64(distributionWindowSizeBlocks) diff --git a/x/shared/session_test.go b/x/shared/session_test.go index 168557365..9e38706d6 100644 --- a/x/shared/session_test.go +++ b/x/shared/session_test.go @@ -20,7 +20,7 @@ func TestGetEarliestSupplierClaimCommitHeight_IsDeterministic(t *testing.T) { wg = sync.WaitGroup{} ) - // Randomize queryHeight, claimWindowOpenBlockHash, and supplierAddr. + // Randomize queryHeight, claimWindowOpenBlockHash, and supplierOperatorAddr. for randomizeIdx := 0; randomizeIdx < 100; randomizeIdx++ { select { case <-ctx.Done(): @@ -34,7 +34,7 @@ func TestGetEarliestSupplierClaimCommitHeight_IsDeterministic(t *testing.T) { // NB: sample concurrently to save time. go func() { queryHeight := rand.Int63() - supplierAddr := sample.AccAddress() + supplierOperatorAddr := sample.AccAddress() var claimWindowOpenBlockHash [32]byte _, err := rand.Read(claimWindowOpenBlockHash[:]) //nolint:staticcheck // We need a deterministic pseudo-random source. @@ -44,7 +44,7 @@ func TestGetEarliestSupplierClaimCommitHeight_IsDeterministic(t *testing.T) { &sharedParams, queryHeight, claimWindowOpenBlockHash[:], - supplierAddr, + supplierOperatorAddr, ) // Ensure consecutive calls are deterministic. @@ -62,7 +62,7 @@ func TestGetEarliestSupplierClaimCommitHeight_IsDeterministic(t *testing.T) { &sharedParams, queryHeight, claimWindowOpenBlockHash[:], - supplierAddr, + supplierOperatorAddr, ) require.Equalf(t, expected, actual, "on call number %d", deterministicIdx) wg.Done() @@ -95,9 +95,9 @@ func TestGetEarliestSupplierProofCommitHeight_IsDeterministic(t *testing.T) { // NB: sample concurrently to save time. go func() { - // Randomize queryHeight, proofWindowOpenBlockHash, and supplierAddr. + // Randomize queryHeight, proofWindowOpenBlockHash, and supplierOperatorAddr. queryHeight := rand.Int63() - supplierAddr := sample.AccAddress() + supplierOperatorAddr := sample.AccAddress() var proofWindowOpenBlockHash [32]byte _, err := rand.Read(proofWindowOpenBlockHash[:]) //nolint:staticcheck // We need a deterministic pseudo-random source. @@ -111,7 +111,7 @@ func TestGetEarliestSupplierProofCommitHeight_IsDeterministic(t *testing.T) { &sharedParams, queryHeight, proofWindowOpenBlockHash[:], - supplierAddr, + supplierOperatorAddr, ) // Ensure consecutive calls are deterministic. @@ -130,7 +130,7 @@ func TestGetEarliestSupplierProofCommitHeight_IsDeterministic(t *testing.T) { &sharedParams, queryHeight, proofWindowOpenBlockHash[:], - supplierAddr, + supplierOperatorAddr, ) if !assert.Equalf(t, expected, actual, "on call number %d", deterministicIdx) { @@ -183,9 +183,9 @@ func TestClaimProofWindows(t *testing.T) { for i := 0; i < sampleSize; i++ { // NB: sample concurrently to save time. go func() { - // Randomize the supplier address for each sample. + // Randomize the supplier operator address for each sample. // This will produce different randomized earliest claim & proof offsets. - supplierAddr := sample.AccAddress() + supplierOperatorAddr := sample.AccAddress() claimWindowOpenHeight := GetClaimWindowOpenHeight(&test.sharedParams, test.queryHeight) claimWindowCloseHeight := GetClaimWindowCloseHeight(&test.sharedParams, test.queryHeight) @@ -202,7 +202,7 @@ func TestClaimProofWindows(t *testing.T) { &test.sharedParams, test.queryHeight, blockHash, - supplierAddr, + supplierOperatorAddr, ) require.Greater(t, claimWindowCloseHeight, earliestClaimCommitHeight) @@ -211,7 +211,7 @@ func TestClaimProofWindows(t *testing.T) { &test.sharedParams, test.queryHeight, blockHash, - supplierAddr, + supplierOperatorAddr, ) require.GreaterOrEqual(t, earliestProofCommitHeight, claimWindowCloseHeight) diff --git a/x/shared/types/supplier.go b/x/shared/types/supplier.go index 1632de314..49802c397 100644 --- a/x/shared/types/supplier.go +++ b/x/shared/types/supplier.go @@ -39,5 +39,5 @@ func (s *Supplier) HasOwner(address string) bool { // HasOperator returns whether the given address is the supplier's operator address. func (s *Supplier) HasOperator(address string) bool { - return s.Address == address + return s.OperatorAddress == address } diff --git a/x/shared/types/supplier.pb.go b/x/shared/types/supplier.pb.go index 868e01a6e..7cb4944c8 100644 --- a/x/shared/types/supplier.pb.go +++ b/x/shared/types/supplier.pb.go @@ -30,15 +30,13 @@ type Supplier struct { // By default, this address is the one that receives all the rewards unless owtherwise specified. // This property cannot be updated by the operator. OwnerAddress string `protobuf:"bytes,1,opt,name=owner_address,json=ownerAddress,proto3" json:"owner_address,omitempty"` - // The address of the supplier operator (i.e. the one managing the off-chain server). + // The operator address of the supplier operator (i.e. the one managing the off-chain server). // The operator address can update the supplier's configurations excluding the owner address. // This property does not change over the supplier's lifespan, the supplier must be unstaked // and re-staked to effectively update this value. - // TODO(#722): Rename this to `operator_address` including all downstream - // variables, comments, docs, tests, etc... - Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` - Stake *types.Coin `protobuf:"bytes,3,opt,name=stake,proto3" json:"stake,omitempty"` - Services []*SupplierServiceConfig `protobuf:"bytes,4,rep,name=services,proto3" json:"services,omitempty"` + OperatorAddress string `protobuf:"bytes,2,opt,name=operator_address,json=operatorAddress,proto3" json:"operator_address,omitempty"` + Stake *types.Coin `protobuf:"bytes,3,opt,name=stake,proto3" json:"stake,omitempty"` + Services []*SupplierServiceConfig `protobuf:"bytes,4,rep,name=services,proto3" json:"services,omitempty"` // The session end height at which an actively unbonding supplier unbonds its stake. // If the supplier did not unstake, this value will be 0. UnstakeSessionEndHeight uint64 `protobuf:"varint,5,opt,name=unstake_session_end_height,json=unstakeSessionEndHeight,proto3" json:"unstake_session_end_height,omitempty"` @@ -88,9 +86,9 @@ func (m *Supplier) GetOwnerAddress() string { return "" } -func (m *Supplier) GetAddress() string { +func (m *Supplier) GetOperatorAddress() string { if m != nil { - return m.Address + return m.OperatorAddress } return "" } @@ -131,35 +129,35 @@ func init() { func init() { proto.RegisterFile("poktroll/shared/supplier.proto", fileDescriptor_4a189b52ba503cf2) } var fileDescriptor_4a189b52ba503cf2 = []byte{ - // 433 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x52, 0x3f, 0x6f, 0x13, 0x31, - 0x14, 0x8f, 0x9b, 0xa4, 0x14, 0x17, 0x04, 0xb2, 0x2a, 0x71, 0x8d, 0xc0, 0x04, 0x06, 0x94, 0xa5, - 0xb6, 0x1a, 0x16, 0x44, 0xc5, 0xd0, 0x54, 0x95, 0x60, 0x40, 0x48, 0x97, 0x8d, 0xe5, 0xe4, 0xdc, - 0x3d, 0x12, 0x2b, 0x89, 0x7d, 0xf2, 0x73, 0x52, 0xb2, 0x22, 0xb1, 0xf3, 0x61, 0xf8, 0x10, 0x8c, - 0x15, 0x13, 0x23, 0x4a, 0xbe, 0x08, 0xca, 0xd9, 0x97, 0x01, 0x44, 0xbb, 0xdd, 0xbb, 0xdf, 0x9f, - 0xf7, 0x7e, 0x7e, 0x8f, 0xf2, 0xd2, 0x4e, 0xbd, 0xb3, 0xb3, 0x99, 0xc4, 0x89, 0x72, 0x50, 0x48, - 0x5c, 0x94, 0xe5, 0x4c, 0x83, 0x13, 0xa5, 0xb3, 0xde, 0xb2, 0x07, 0x35, 0x2e, 0x02, 0xde, 0x39, - 0xce, 0x2d, 0xce, 0x2d, 0x66, 0x15, 0x2c, 0x43, 0x11, 0xb8, 0x1d, 0x1e, 0x2a, 0x39, 0x52, 0x08, - 0x72, 0x79, 0x3a, 0x02, 0xaf, 0x4e, 0x65, 0x6e, 0xb5, 0x89, 0xf8, 0x93, 0x7f, 0x7a, 0x81, 0x5b, - 0xea, 0x1c, 0x02, 0xfc, 0xfc, 0x6b, 0x8b, 0x1e, 0x0c, 0x63, 0x77, 0xf6, 0x86, 0xde, 0xb7, 0x57, - 0x06, 0x5c, 0xa6, 0x8a, 0xc2, 0x01, 0x62, 0x42, 0xba, 0xa4, 0x77, 0x77, 0x90, 0xfc, 0xfc, 0x7e, - 0x72, 0x14, 0x9b, 0x9e, 0x07, 0x64, 0xe8, 0x9d, 0x36, 0xe3, 0xf4, 0x5e, 0x45, 0x8f, 0xff, 0x58, - 0x9f, 0xde, 0xa9, 0x85, 0x7b, 0xb7, 0x08, 0x6b, 0x22, 0x93, 0xb4, 0x8d, 0x5e, 0x4d, 0x21, 0x69, - 0x76, 0x49, 0xef, 0xb0, 0x7f, 0x2c, 0x22, 0x7d, 0x1b, 0x47, 0xc4, 0x38, 0xe2, 0xc2, 0x6a, 0x93, - 0x06, 0x1e, 0x1b, 0xd0, 0x83, 0x98, 0x00, 0x93, 0x56, 0xb7, 0xd9, 0x3b, 0xec, 0xbf, 0x10, 0x7f, - 0x3d, 0x97, 0xa8, 0x03, 0x0d, 0x03, 0xf1, 0xc2, 0x9a, 0x4f, 0x7a, 0x9c, 0xee, 0x74, 0xec, 0x8c, - 0x76, 0x16, 0xa6, 0xb2, 0xcb, 0x10, 0x10, 0xb5, 0x35, 0x19, 0x98, 0x22, 0x9b, 0x80, 0x1e, 0x4f, - 0x7c, 0xd2, 0xee, 0x92, 0x5e, 0x2b, 0x7d, 0x14, 0x19, 0xc3, 0x40, 0xb8, 0x34, 0xc5, 0xdb, 0x0a, - 0x66, 0x5f, 0x08, 0x7d, 0x5a, 0x3b, 0x65, 0x2a, 0xf7, 0x7a, 0xa9, 0xfc, 0xd6, 0x21, 0xa8, 0x31, - 0x9b, 0xab, 0x32, 0xd9, 0xaf, 0x06, 0x3b, 0xfb, 0xef, 0x60, 0x22, 0x4e, 0x86, 0xe7, 0x3b, 0x7d, - 0x70, 0xc7, 0xf7, 0xaa, 0xbc, 0x34, 0xde, 0xad, 0xd2, 0xc7, 0x78, 0x03, 0xa5, 0xf3, 0x81, 0x3e, - 0xbb, 0xd5, 0x82, 0x3d, 0xa4, 0xcd, 0x29, 0xac, 0xc2, 0x12, 0xd3, 0xed, 0x27, 0x3b, 0xa2, 0xed, - 0xa5, 0x9a, 0x2d, 0xa0, 0xda, 0x4f, 0x2b, 0x0d, 0xc5, 0xeb, 0xbd, 0x57, 0x64, 0xf0, 0xee, 0xc7, - 0x9a, 0x93, 0xeb, 0x35, 0x27, 0xbf, 0xd7, 0x9c, 0x7c, 0xdb, 0xf0, 0xc6, 0xf5, 0x86, 0x37, 0x7e, - 0x6d, 0x78, 0xe3, 0xa3, 0x1c, 0x6b, 0x3f, 0x59, 0x8c, 0x44, 0x6e, 0xe7, 0x72, 0x9b, 0xe7, 0xc4, - 0x80, 0xbf, 0xb2, 0x6e, 0x2a, 0x77, 0x87, 0xf5, 0xb9, 0x3e, 0x2d, 0xbf, 0x2a, 0x01, 0x47, 0xfb, - 0xd5, 0x65, 0xbd, 0xfc, 0x13, 0x00, 0x00, 0xff, 0xff, 0xe7, 0x7c, 0x1e, 0xd1, 0xe6, 0x02, 0x00, - 0x00, + // 442 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x52, 0xcd, 0x6e, 0x13, 0x31, + 0x10, 0x8e, 0x9b, 0xa4, 0x2a, 0x2e, 0xa8, 0xd5, 0xaa, 0x12, 0xdb, 0x08, 0x96, 0xc0, 0x01, 0xe5, + 0x52, 0x5b, 0x2d, 0x17, 0x44, 0xc5, 0xa1, 0x89, 0x2a, 0xc1, 0x01, 0x21, 0x6d, 0x6e, 0x5c, 0x56, + 0xce, 0xee, 0x90, 0x58, 0x49, 0x6c, 0xcb, 0xe3, 0xa4, 0xe4, 0xca, 0x13, 0x70, 0xe2, 0x49, 0x78, + 0x08, 0x8e, 0x15, 0x27, 0x8e, 0x28, 0x79, 0x11, 0xb4, 0x6b, 0x6f, 0x90, 0x40, 0x34, 0xb7, 0x9d, + 0xfd, 0x7e, 0x66, 0x3e, 0xcf, 0xd0, 0xc4, 0xe8, 0xa9, 0xb3, 0x7a, 0x36, 0xe3, 0x38, 0x11, 0x16, + 0x0a, 0x8e, 0x0b, 0x63, 0x66, 0x12, 0x2c, 0x33, 0x56, 0x3b, 0x1d, 0x1d, 0xd5, 0x38, 0xf3, 0x78, + 0xe7, 0x34, 0xd7, 0x38, 0xd7, 0x98, 0x55, 0x30, 0xf7, 0x85, 0xe7, 0x76, 0x12, 0x5f, 0xf1, 0x91, + 0x40, 0xe0, 0xcb, 0xf3, 0x11, 0x38, 0x71, 0xce, 0x73, 0x2d, 0x55, 0xc0, 0x1f, 0xff, 0xd3, 0x0b, + 0xec, 0x52, 0xe6, 0xe0, 0xe1, 0x67, 0x5f, 0x5b, 0xf4, 0x60, 0x18, 0xba, 0x47, 0xaf, 0xe9, 0x03, + 0x7d, 0xa3, 0xc0, 0x66, 0xa2, 0x28, 0x2c, 0x20, 0xc6, 0xa4, 0x4b, 0x7a, 0xf7, 0xfa, 0xf1, 0x8f, + 0x6f, 0x67, 0x27, 0xa1, 0xe9, 0x95, 0x47, 0x86, 0xce, 0x4a, 0x35, 0x4e, 0xef, 0x57, 0xf4, 0xf0, + 0x2f, 0x1a, 0xd0, 0x63, 0x6d, 0xc0, 0x0a, 0xa7, 0xff, 0x38, 0xec, 0xed, 0x70, 0x38, 0xaa, 0x15, + 0xb5, 0x09, 0xa7, 0x6d, 0x74, 0x62, 0x0a, 0x71, 0xb3, 0x4b, 0x7a, 0x87, 0x17, 0xa7, 0x2c, 0xc8, + 0xca, 0x7c, 0x2c, 0xe4, 0x63, 0x03, 0x2d, 0x55, 0xea, 0x79, 0x51, 0x9f, 0x1e, 0x84, 0x48, 0x18, + 0xb7, 0xba, 0xcd, 0xde, 0xe1, 0xc5, 0x73, 0xf6, 0xd7, 0xfb, 0xb1, 0x3a, 0xe1, 0xd0, 0x13, 0x07, + 0x5a, 0x7d, 0x94, 0xe3, 0x74, 0xab, 0x8b, 0x2e, 0x69, 0x67, 0xa1, 0x2a, 0xbb, 0x0c, 0x01, 0x51, + 0x6a, 0x95, 0x81, 0x2a, 0xb2, 0x09, 0xc8, 0xf1, 0xc4, 0xc5, 0xed, 0x2e, 0xe9, 0xb5, 0xd2, 0x87, + 0x81, 0x31, 0xf4, 0x84, 0x6b, 0x55, 0xbc, 0xa9, 0xe0, 0xe8, 0x33, 0xa1, 0x4f, 0x6a, 0xa7, 0x4c, + 0xe4, 0x4e, 0x2e, 0x85, 0x2b, 0x1d, 0xbc, 0x1a, 0xb3, 0xb9, 0x30, 0xf1, 0x7e, 0x35, 0xd8, 0xe5, + 0x7f, 0x07, 0x63, 0x61, 0x32, 0xbc, 0xda, 0xea, 0xbd, 0x3b, 0xbe, 0x13, 0xe6, 0x5a, 0x39, 0xbb, + 0x4a, 0x1f, 0xe1, 0x1d, 0x94, 0xce, 0x7b, 0xfa, 0x74, 0xa7, 0x45, 0x74, 0x4c, 0x9b, 0x53, 0x58, + 0xf9, 0xad, 0xa6, 0xe5, 0x67, 0x74, 0x42, 0xdb, 0x4b, 0x31, 0x5b, 0x40, 0xb5, 0xa7, 0x56, 0xea, + 0x8b, 0x57, 0x7b, 0x2f, 0x49, 0xff, 0xed, 0xf7, 0x75, 0x42, 0x6e, 0xd7, 0x09, 0xf9, 0xb5, 0x4e, + 0xc8, 0x97, 0x4d, 0xd2, 0xb8, 0xdd, 0x24, 0x8d, 0x9f, 0x9b, 0xa4, 0xf1, 0x81, 0x8f, 0xa5, 0x9b, + 0x2c, 0x46, 0x2c, 0xd7, 0x73, 0x5e, 0xe6, 0x39, 0x53, 0xe0, 0x6e, 0xb4, 0x9d, 0xf2, 0xed, 0xa5, + 0x7d, 0xaa, 0x6f, 0xcd, 0xad, 0x0c, 0xe0, 0x68, 0xbf, 0x3a, 0xb5, 0x17, 0xbf, 0x03, 0x00, 0x00, + 0xff, 0xff, 0xcb, 0xa8, 0xdf, 0xfb, 0xf7, 0x02, 0x00, 0x00, } func (m *Supplier) Marshal() (dAtA []byte, err error) { @@ -230,10 +228,10 @@ func (m *Supplier) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x1a } - if len(m.Address) > 0 { - i -= len(m.Address) - copy(dAtA[i:], m.Address) - i = encodeVarintSupplier(dAtA, i, uint64(len(m.Address))) + if len(m.OperatorAddress) > 0 { + i -= len(m.OperatorAddress) + copy(dAtA[i:], m.OperatorAddress) + i = encodeVarintSupplier(dAtA, i, uint64(len(m.OperatorAddress))) i-- dAtA[i] = 0x12 } @@ -268,7 +266,7 @@ func (m *Supplier) Size() (n int) { if l > 0 { n += 1 + l + sovSupplier(uint64(l)) } - l = len(m.Address) + l = len(m.OperatorAddress) if l > 0 { n += 1 + l + sovSupplier(uint64(l)) } @@ -365,7 +363,7 @@ func (m *Supplier) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field OperatorAddress", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -393,7 +391,7 @@ func (m *Supplier) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Address = string(dAtA[iNdEx:postIndex]) + m.OperatorAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { diff --git a/x/supplier/keeper/msg_server_stake_supplier.go b/x/supplier/keeper/msg_server_stake_supplier.go index 31d0087b2..dada0e40c 100644 --- a/x/supplier/keeper/msg_server_stake_supplier.go +++ b/x/supplier/keeper/msg_server_stake_supplier.go @@ -40,23 +40,23 @@ func (k msgServer) StakeSupplier(ctx context.Context, msg *types.MsgStakeSupplie // Check if the supplier already exists or not var err error var coinsToEscrow sdk.Coin - supplier, isSupplierFound := k.GetSupplier(ctx, msg.Address) + supplier, isSupplierFound := k.GetSupplier(ctx, msg.OperatorAddress) if !isSupplierFound { - logger.Info(fmt.Sprintf("Supplier not found. Creating new supplier for address %q", msg.Address)) + logger.Info(fmt.Sprintf("Supplier not found. Creating new supplier for address %q", msg.OperatorAddress)) supplier = k.createSupplier(ctx, msg) coinsToEscrow = *msg.Stake } else { - logger.Info(fmt.Sprintf("Supplier found. About to try updating supplier with address %q", msg.Address)) + logger.Info(fmt.Sprintf("Supplier found. About to try updating supplier with address %q", msg.OperatorAddress)) // Ensure the signer is either the owner or the operator of the supplier. - if !msg.IsSigner(supplier.OwnerAddress) && !msg.IsSigner(supplier.Address) { + if !msg.IsSigner(supplier.OwnerAddress) && !msg.IsSigner(supplier.OperatorAddress) { return nil, sharedtypes.ErrSharedUnauthorizedSupplierUpdate.Wrapf( - "signer address %s does not match owner address %s or supplier address %s", + "signer address %s does not match owner address %s or supplier operator address %s", msg.Signer, msg.OwnerAddress, - msg.Address, + msg.OperatorAddress, ) } @@ -74,7 +74,7 @@ func (k msgServer) StakeSupplier(ctx context.Context, msg *types.MsgStakeSupplie // Ensure that the operator addresses cannot be changed. This is because changing // it mid-session invalidates the current session. - if !supplier.HasOperator(msg.Address) { + if !supplier.HasOperator(msg.OperatorAddress) { logger.Error("updating the supplier's operator address forbidden") return nil, sharedtypes.ErrSharedUnauthorizedSupplierUpdate.Wrap( @@ -84,7 +84,7 @@ func (k msgServer) StakeSupplier(ctx context.Context, msg *types.MsgStakeSupplie currSupplierStake := *supplier.Stake if err = k.updateSupplier(ctx, &supplier, msg); err != nil { - logger.Error(fmt.Sprintf("could not update supplier for address %q due to error %v", msg.Address, err)) + logger.Error(fmt.Sprintf("could not update supplier for address %q due to error %v", msg.OperatorAddress, err)) return nil, err } coinsToEscrow, err = (*msg.Stake).SafeSub(currSupplierStake) @@ -145,7 +145,7 @@ func (k msgServer) createSupplier( return sharedtypes.Supplier{ OwnerAddress: msg.OwnerAddress, - Address: msg.Address, + OperatorAddress: msg.OperatorAddress, Stake: msg.Stake, Services: msg.Services, ServicesActivationHeightsMap: servicesActivationHeightsMap, diff --git a/x/supplier/keeper/msg_server_stake_supplier_test.go b/x/supplier/keeper/msg_server_stake_supplier_test.go index 5f4350e36..8664c1787 100644 --- a/x/supplier/keeper/msg_server_stake_supplier_test.go +++ b/x/supplier/keeper/msg_server_stake_supplier_test.go @@ -37,7 +37,7 @@ func TestMsgServer_StakeSupplier_SuccessfulCreateAndUpdate(t *testing.T) { // Verify that the supplier exists foundSupplier, isSupplierFound := supplierModuleKeepers.GetSupplier(ctx, operatorAddr) require.True(t, isSupplierFound) - require.Equal(t, operatorAddr, foundSupplier.Address) + require.Equal(t, operatorAddr, foundSupplier.OperatorAddress) require.Equal(t, int64(100), foundSupplier.Stake.Amount.Int64()) require.Len(t, foundSupplier.Services, 1) require.Equal(t, "svcId", foundSupplier.Services[0].Service.Id) @@ -87,7 +87,7 @@ func TestMsgServer_StakeSupplier_FailRestakingDueToInvalidServices(t *testing.T) // Verify the supplierFound still exists and is staked for svc1 supplierFound, isSupplierFound := supplierModuleKeepers.GetSupplier(ctx, operatorAddr) require.True(t, isSupplierFound) - require.Equal(t, operatorAddr, supplierFound.Address) + require.Equal(t, operatorAddr, supplierFound.OperatorAddress) require.Len(t, supplierFound.Services, 1) require.Equal(t, "svcId", supplierFound.Services[0].Service.Id) require.Len(t, supplierFound.Services[0].Endpoints, 1) @@ -104,7 +104,7 @@ func TestMsgServer_StakeSupplier_FailRestakingDueToInvalidServices(t *testing.T) // Verify the supplier still exists and is staked for svc1 supplierFound, isSupplierFound = supplierModuleKeepers.GetSupplier(ctx, operatorAddr) require.True(t, isSupplierFound) - require.Equal(t, operatorAddr, supplierFound.Address) + require.Equal(t, operatorAddr, supplierFound.OperatorAddress) require.Len(t, supplierFound.Services, 1) require.Equal(t, "svcId", supplierFound.Services[0].Service.Id) require.Len(t, supplierFound.Services[0].Endpoints, 1) @@ -175,7 +175,7 @@ func TestMsgServer_StakeSupplier_OperatorAuthorizations(t *testing.T) { require.NoError(t, err) supplier, isSupplierFound := k.GetSupplier(ctx, operatorAddr) require.True(t, isSupplierFound) - require.Equal(t, operatorAddr, supplier.Address) + require.Equal(t, operatorAddr, supplier.OperatorAddress) require.Equal(t, ownerAddr, supplier.OwnerAddress) // Update the supplier using the operator address as the signer and verify that it succeeds. @@ -209,7 +209,7 @@ func TestMsgServer_StakeSupplier_OperatorAuthorizations(t *testing.T) { // will create a new supplier. stakeMsgUpdateOperator := stakeSupplierForServicesMsg(ownerAddr, operatorAddr, 300, "svcId") newOperatorAddress := sample.AccAddress() - stakeMsgUpdateOperator.Address = newOperatorAddress + stakeMsgUpdateOperator.OperatorAddress = newOperatorAddress setStakeMsgSigner(stakeMsgUpdateOperator, operatorAddr) _, err = srv.StakeSupplier(ctx, stakeMsgUpdateOperator) require.NoError(t, err) @@ -221,12 +221,12 @@ func TestMsgServer_StakeSupplier_OperatorAuthorizations(t *testing.T) { newSupplier, newSupplierFound := k.GetSupplier(ctx, newOperatorAddress) require.True(t, newSupplierFound) // Check that the old supplier is different from the new supplier. - require.NotEqual(t, oldSupplier.Address, newSupplier.Address) + require.NotEqual(t, oldSupplier.OperatorAddress, newSupplier.OperatorAddress) // Trying to update the supplier's operator address using the owner as a signer // will create a new supplier. newOperatorAddress = sample.AccAddress() - stakeMsgUpdateOperator.Address = newOperatorAddress + stakeMsgUpdateOperator.OperatorAddress = newOperatorAddress stakeMsgUpdateOperator.Stake.Amount = math.NewInt(400) setStakeMsgSigner(stakeMsgUpdateOperator, ownerAddr) _, err = srv.StakeSupplier(ctx, stakeMsgUpdateOperator) @@ -239,7 +239,7 @@ func TestMsgServer_StakeSupplier_OperatorAuthorizations(t *testing.T) { newSupplier, newSupplierFound = k.GetSupplier(ctx, newOperatorAddress) require.True(t, newSupplierFound) // Check that the old supplier is different from the new supplier. - require.NotEqual(t, oldSupplier.Address, newSupplier.Address) + require.NotEqual(t, oldSupplier.OperatorAddress, newSupplier.OperatorAddress) // Try updating the supplier's owner address using the operator as a signer // and verify that it fails. @@ -329,7 +329,7 @@ func TestMsgServer_StakeSupplier_ActiveSupplier(t *testing.T) { } // stakeSupplierForServicesMsg prepares and returns a MsgStakeSupplier that stakes -// the given supplier address, stake amount, and service IDs. +// the given supplier operator address, stake amount, and service IDs. func stakeSupplierForServicesMsg( ownerAddr, operatorAddr string, amount int64, @@ -350,11 +350,11 @@ func stakeSupplierForServicesMsg( } return &types.MsgStakeSupplier{ - Signer: ownerAddr, - OwnerAddress: ownerAddr, - Address: operatorAddr, - Stake: &sdk.Coin{Denom: volatile.DenomuPOKT, Amount: math.NewInt(amount)}, - Services: services, + Signer: ownerAddr, + OwnerAddress: ownerAddr, + OperatorAddress: operatorAddr, + Stake: &sdk.Coin{Denom: volatile.DenomuPOKT, Amount: math.NewInt(amount)}, + Services: services, } } diff --git a/x/supplier/keeper/msg_server_unstake_supplier.go b/x/supplier/keeper/msg_server_unstake_supplier.go index 0cdc0821c..877134b2a 100644 --- a/x/supplier/keeper/msg_server_unstake_supplier.go +++ b/x/supplier/keeper/msg_server_unstake_supplier.go @@ -32,9 +32,9 @@ func (k msgServer) UnstakeSupplier( } // Check if the supplier already exists or not - supplier, isSupplierFound := k.GetSupplier(ctx, msg.Address) + supplier, isSupplierFound := k.GetSupplier(ctx, msg.OperatorAddress) if !isSupplierFound { - logger.Info(fmt.Sprintf("Supplier not found. Cannot unstake address %s", msg.Address)) + logger.Info(fmt.Sprintf("Supplier not found. Cannot unstake address %s", msg.OperatorAddress)) return nil, types.ErrSupplierNotFound } @@ -48,11 +48,11 @@ func (k msgServer) UnstakeSupplier( ) } - logger.Info(fmt.Sprintf("Supplier found. Unstaking supplier for address %s", msg.Address)) + logger.Info(fmt.Sprintf("Supplier found. Unstaking supplier for address %s", msg.OperatorAddress)) // Check if the supplier has already initiated the unstake action. if supplier.IsUnbonding() { - logger.Warn(fmt.Sprintf("Supplier %s still unbonding from previous unstaking", msg.Address)) + logger.Warn(fmt.Sprintf("Supplier %s still unbonding from previous unstaking", msg.OperatorAddress)) return nil, types.ErrSupplierIsUnstaking } diff --git a/x/supplier/keeper/msg_server_unstake_supplier_test.go b/x/supplier/keeper/msg_server_unstake_supplier_test.go index be4cccd94..4bdd414c1 100644 --- a/x/supplier/keeper/msg_server_unstake_supplier_test.go +++ b/x/supplier/keeper/msg_server_unstake_supplier_test.go @@ -21,48 +21,48 @@ func TestMsgServer_UnstakeSupplier_Success(t *testing.T) { sharedParams := supplierModuleKeepers.SharedKeeper.GetParams(ctx) - // Generate two addresses for an unstaking and a non-unstaking suppliers - unstakingSupplierAddr := sample.AccAddress() + // Generate an operator addresses for a supplier that will be unstaked later in the test. + unstakingSupplierOperatorAddr := sample.AccAddress() // Verify that the supplier does not exist yet - _, isSupplierFound := supplierModuleKeepers.GetSupplier(ctx, unstakingSupplierAddr) + _, isSupplierFound := supplierModuleKeepers.GetSupplier(ctx, unstakingSupplierOperatorAddr) require.False(t, isSupplierFound) initialStake := int64(100) - stakeMsg := createStakeMsg(unstakingSupplierAddr, initialStake) + stakeMsg := createStakeMsg(unstakingSupplierOperatorAddr, initialStake) // Stake the supplier _, err := srv.StakeSupplier(ctx, stakeMsg) require.NoError(t, err) // Verify that the supplier exists - foundSupplier, isSupplierFound := supplierModuleKeepers.GetSupplier(ctx, unstakingSupplierAddr) + foundSupplier, isSupplierFound := supplierModuleKeepers.GetSupplier(ctx, unstakingSupplierOperatorAddr) require.True(t, isSupplierFound) - require.Equal(t, unstakingSupplierAddr, foundSupplier.Address) + require.Equal(t, unstakingSupplierOperatorAddr, foundSupplier.OperatorAddress) require.Equal(t, math.NewInt(initialStake), foundSupplier.Stake.Amount) require.Len(t, foundSupplier.Services, 1) // Create and stake another supplier that will not be unstaked to assert that only the // unstaking supplier is removed from the suppliers list when the unbonding period is over. - nonUnstakingSupplierAddr := sample.AccAddress() - stakeMsg = createStakeMsg(nonUnstakingSupplierAddr, initialStake) + nonUnstakingSupplierOperatorAddr := sample.AccAddress() + stakeMsg = createStakeMsg(nonUnstakingSupplierOperatorAddr, initialStake) _, err = srv.StakeSupplier(ctx, stakeMsg) require.NoError(t, err) // Verify that the non-unstaking supplier exists - _, isSupplierFound = supplierModuleKeepers.GetSupplier(ctx, nonUnstakingSupplierAddr) + _, isSupplierFound = supplierModuleKeepers.GetSupplier(ctx, nonUnstakingSupplierOperatorAddr) require.True(t, isSupplierFound) // Initiate the supplier unstaking unstakeMsg := &types.MsgUnstakeSupplier{ - Signer: unstakingSupplierAddr, - Address: unstakingSupplierAddr, + Signer: unstakingSupplierOperatorAddr, + OperatorAddress: unstakingSupplierOperatorAddr, } _, err = srv.UnstakeSupplier(ctx, unstakeMsg) require.NoError(t, err) // Make sure the supplier entered the unbonding period - foundSupplier, isSupplierFound = supplierModuleKeepers.GetSupplier(ctx, unstakingSupplierAddr) + foundSupplier, isSupplierFound = supplierModuleKeepers.GetSupplier(ctx, unstakingSupplierOperatorAddr) require.True(t, isSupplierFound) require.True(t, foundSupplier.IsUnbonding()) @@ -76,11 +76,11 @@ func TestMsgServer_UnstakeSupplier_Success(t *testing.T) { // Make sure the unstaking supplier is removed from the suppliers list when the // unbonding period is over - _, isSupplierFound = supplierModuleKeepers.GetSupplier(ctx, unstakingSupplierAddr) + _, isSupplierFound = supplierModuleKeepers.GetSupplier(ctx, unstakingSupplierOperatorAddr) require.False(t, isSupplierFound) // Verify that the non-unstaking supplier still exists - nonUnstakingSupplier, isSupplierFound := supplierModuleKeepers.GetSupplier(ctx, nonUnstakingSupplierAddr) + nonUnstakingSupplier, isSupplierFound := supplierModuleKeepers.GetSupplier(ctx, nonUnstakingSupplierOperatorAddr) require.True(t, isSupplierFound) require.False(t, nonUnstakingSupplier.IsUnbonding()) } @@ -92,41 +92,41 @@ func TestMsgServer_UnstakeSupplier_CancelUnbondingIfRestaked(t *testing.T) { sharedParams := supplierModuleKeepers.SharedKeeper.GetParams(ctx) // Generate an address for the supplier - supplierAddr := sample.AccAddress() + supplierOperatorAddr := sample.AccAddress() // Stake the supplier initialStake := int64(100) - stakeMsg := createStakeMsg(supplierAddr, initialStake) + stakeMsg := createStakeMsg(supplierOperatorAddr, initialStake) _, err := srv.StakeSupplier(ctx, stakeMsg) require.NoError(t, err) // Verify that the supplier exists with no unbonding height - foundSupplier, isSupplierFound := supplierModuleKeepers.GetSupplier(ctx, supplierAddr) + foundSupplier, isSupplierFound := supplierModuleKeepers.GetSupplier(ctx, supplierOperatorAddr) require.True(t, isSupplierFound) require.False(t, foundSupplier.IsUnbonding()) // Initiate the supplier unstaking unstakeMsg := &types.MsgUnstakeSupplier{ - Signer: supplierAddr, - Address: supplierAddr, + Signer: supplierOperatorAddr, + OperatorAddress: supplierOperatorAddr, } _, err = srv.UnstakeSupplier(ctx, unstakeMsg) require.NoError(t, err) // Make sure the supplier entered the unbonding period - foundSupplier, isSupplierFound = supplierModuleKeepers.GetSupplier(ctx, supplierAddr) + foundSupplier, isSupplierFound = supplierModuleKeepers.GetSupplier(ctx, supplierOperatorAddr) require.True(t, isSupplierFound) require.True(t, foundSupplier.IsUnbonding()) unbondingHeight := shared.GetSupplierUnbondingHeight(&sharedParams, &foundSupplier) // Stake the supplier again - stakeMsg = createStakeMsg(supplierAddr, initialStake+1) + stakeMsg = createStakeMsg(supplierOperatorAddr, initialStake+1) _, err = srv.StakeSupplier(ctx, stakeMsg) require.NoError(t, err) // Make sure the supplier is no longer in the unbonding period - foundSupplier, isSupplierFound = supplierModuleKeepers.GetSupplier(ctx, supplierAddr) + foundSupplier, isSupplierFound = supplierModuleKeepers.GetSupplier(ctx, supplierOperatorAddr) require.True(t, isSupplierFound) require.False(t, foundSupplier.IsUnbonding()) @@ -137,7 +137,7 @@ func TestMsgServer_UnstakeSupplier_CancelUnbondingIfRestaked(t *testing.T) { require.NoError(t, err) // Make sure the supplier is still in the suppliers list with an unbonding height of 0 - foundSupplier, isSupplierFound = supplierModuleKeepers.GetSupplier(ctx, supplierAddr) + foundSupplier, isSupplierFound = supplierModuleKeepers.GetSupplier(ctx, supplierOperatorAddr) require.True(t, isSupplierFound) require.False(t, foundSupplier.IsUnbonding()) } @@ -147,22 +147,22 @@ func TestMsgServer_UnstakeSupplier_FailIfNotStaked(t *testing.T) { srv := keeper.NewMsgServerImpl(*supplierModuleKeepers.Keeper) // Generate an address for the supplier - supplierAddr := sample.AccAddress() + supplierOperatorAddr := sample.AccAddress() // Verify that the supplier does not exist yet - _, isSupplierFound := supplierModuleKeepers.GetSupplier(ctx, supplierAddr) + _, isSupplierFound := supplierModuleKeepers.GetSupplier(ctx, supplierOperatorAddr) require.False(t, isSupplierFound) // Initiate the supplier unstaking unstakeMsg := &types.MsgUnstakeSupplier{ - Signer: supplierAddr, - Address: supplierAddr, + Signer: supplierOperatorAddr, + OperatorAddress: supplierOperatorAddr, } _, err := srv.UnstakeSupplier(ctx, unstakeMsg) require.Error(t, err) require.ErrorIs(t, err, types.ErrSupplierNotFound) - _, isSupplierFound = supplierModuleKeepers.GetSupplier(ctx, supplierAddr) + _, isSupplierFound = supplierModuleKeepers.GetSupplier(ctx, supplierOperatorAddr) require.False(t, isSupplierFound) } @@ -171,18 +171,18 @@ func TestMsgServer_UnstakeSupplier_FailIfCurrentlyUnstaking(t *testing.T) { srv := keeper.NewMsgServerImpl(*supplierModuleKeepers.Keeper) // Generate an address for the supplier - supplierAddr := sample.AccAddress() + supplierOperatorAddr := sample.AccAddress() // Stake the supplier initialStake := int64(100) - stakeMsg := createStakeMsg(supplierAddr, initialStake) + stakeMsg := createStakeMsg(supplierOperatorAddr, initialStake) _, err := srv.StakeSupplier(ctx, stakeMsg) require.NoError(t, err) // Initiate the supplier unstaking unstakeMsg := &types.MsgUnstakeSupplier{ - Signer: supplierAddr, - Address: supplierAddr, + Signer: supplierOperatorAddr, + OperatorAddress: supplierOperatorAddr, } _, err = srv.UnstakeSupplier(ctx, unstakeMsg) require.NoError(t, err) @@ -200,25 +200,25 @@ func TestMsgServer_UnstakeSupplier_OperatorCanUnstake(t *testing.T) { // Generate an address for the supplier ownerAddr := sample.AccAddress() - supplierAddr := sample.AccAddress() + supplierOperatorAddr := sample.AccAddress() // Stake the supplier initialStake := int64(100) stakeMsg := createStakeMsg(ownerAddr, initialStake) - stakeMsg.Address = supplierAddr + stakeMsg.OperatorAddress = supplierOperatorAddr _, err := srv.StakeSupplier(ctx, stakeMsg) require.NoError(t, err) // Initiate the supplier unstaking unstakeMsg := &types.MsgUnstakeSupplier{ - Signer: supplierAddr, - Address: supplierAddr, + Signer: supplierOperatorAddr, + OperatorAddress: supplierOperatorAddr, } _, err = srv.UnstakeSupplier(ctx, unstakeMsg) require.NoError(t, err) // Make sure the supplier entered the unbonding period - foundSupplier, isSupplierFound := supplierModuleKeepers.GetSupplier(ctx, supplierAddr) + foundSupplier, isSupplierFound := supplierModuleKeepers.GetSupplier(ctx, supplierOperatorAddr) require.True(t, isSupplierFound) require.True(t, foundSupplier.IsUnbonding()) @@ -238,13 +238,13 @@ func TestMsgServer_UnstakeSupplier_OperatorCanUnstake(t *testing.T) { require.Equal(t, initialStake, supplierModuleKeepers.SupplierUnstakedFundsMap[ownerAddr]) } -func createStakeMsg(supplierAddr string, stakeAmount int64) *types.MsgStakeSupplier { +func createStakeMsg(supplierOwnerAddr string, stakeAmount int64) *types.MsgStakeSupplier { initialStake := sdk.NewCoin("upokt", math.NewInt(stakeAmount)) return &types.MsgStakeSupplier{ - Signer: supplierAddr, - OwnerAddress: supplierAddr, - Address: supplierAddr, - Stake: &initialStake, + Signer: supplierOwnerAddr, + OwnerAddress: supplierOwnerAddr, + OperatorAddress: supplierOwnerAddr, + Stake: &initialStake, Services: []*sharedtypes.SupplierServiceConfig{ { Service: &sharedtypes.Service{ diff --git a/x/supplier/keeper/query_supplier.go b/x/supplier/keeper/query_supplier.go index e4c429e06..92112827a 100644 --- a/x/supplier/keeper/query_supplier.go +++ b/x/supplier/keeper/query_supplier.go @@ -25,7 +25,7 @@ func (k Keeper) AllSuppliers( var suppliers []sharedtypes.Supplier store := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) - supplierStore := prefix.NewStore(store, types.KeyPrefix(types.SupplierKeyPrefix)) + supplierStore := prefix.NewStore(store, types.KeyPrefix(types.SupplierKeyOperatorPrefix)) pageRes, err := query.Paginate( supplierStore, @@ -56,10 +56,10 @@ func (k Keeper) Supplier( return nil, status.Error(codes.InvalidArgument, "invalid request") } - supplier, found := k.GetSupplier(ctx, req.Address) + supplier, found := k.GetSupplier(ctx, req.OperatorAddress) if !found { // TODO_TECHDEBT(@bryanchriswhite, #384): conform to logging conventions once established - msg := fmt.Sprintf("supplier with address %q", req.GetAddress()) + msg := fmt.Sprintf("supplier with address %q", req.GetOperatorAddress()) return nil, status.Error(codes.NotFound, msg) } diff --git a/x/supplier/keeper/query_supplier_test.go b/x/supplier/keeper/query_supplier_test.go index e45ac1558..b0d448ec4 100644 --- a/x/supplier/keeper/query_supplier_test.go +++ b/x/supplier/keeper/query_supplier_test.go @@ -29,21 +29,21 @@ func TestSupplierQuerySingle(t *testing.T) { { desc: "First", request: &types.QueryGetSupplierRequest{ - Address: suppliers[0].Address, + OperatorAddress: suppliers[0].OperatorAddress, }, response: &types.QueryGetSupplierResponse{Supplier: suppliers[0]}, }, { desc: "Second", request: &types.QueryGetSupplierRequest{ - Address: suppliers[1].Address, + OperatorAddress: suppliers[1].OperatorAddress, }, response: &types.QueryGetSupplierResponse{Supplier: suppliers[1]}, }, { desc: "KeyNotFound", request: &types.QueryGetSupplierRequest{ - Address: strconv.Itoa(100000), + OperatorAddress: strconv.Itoa(100000), }, expectedErr: status.Error(codes.NotFound, "supplier with address \"100000\""), }, diff --git a/x/supplier/keeper/supplier.go b/x/supplier/keeper/supplier.go index f890b7a96..a64a20054 100644 --- a/x/supplier/keeper/supplier.go +++ b/x/supplier/keeper/supplier.go @@ -14,22 +14,22 @@ import ( // SetSupplier set a specific supplier in the store from its index func (k Keeper) SetSupplier(ctx context.Context, supplier sharedtypes.Supplier) { storeAdapter := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) - store := prefix.NewStore(storeAdapter, types.KeyPrefix(types.SupplierKeyPrefix)) + store := prefix.NewStore(storeAdapter, types.KeyPrefix(types.SupplierKeyOperatorPrefix)) supplierBz := k.cdc.MustMarshal(&supplier) - store.Set(types.SupplierKey( - supplier.Address, + store.Set(types.SupplierOperatorKey( + supplier.OperatorAddress, ), supplierBz) } // GetSupplier returns a supplier from its index func (k Keeper) GetSupplier( ctx context.Context, - supplierAddr string, + supplierOperatorAddr string, ) (supplier sharedtypes.Supplier, found bool) { storeAdapter := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) - store := prefix.NewStore(storeAdapter, types.KeyPrefix(types.SupplierKeyPrefix)) + store := prefix.NewStore(storeAdapter, types.KeyPrefix(types.SupplierKeyOperatorPrefix)) - supplierBz := store.Get(types.SupplierKey(supplierAddr)) + supplierBz := store.Get(types.SupplierOperatorKey(supplierOperatorAddr)) if supplierBz == nil { return supplier, false } @@ -39,16 +39,16 @@ func (k Keeper) GetSupplier( } // RemoveSupplier removes a supplier from the store -func (k Keeper) RemoveSupplier(ctx context.Context, address string) { +func (k Keeper) RemoveSupplier(ctx context.Context, supplierOperatorAddress string) { storeAdapter := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) - store := prefix.NewStore(storeAdapter, types.KeyPrefix(types.SupplierKeyPrefix)) - store.Delete(types.SupplierKey(address)) + store := prefix.NewStore(storeAdapter, types.KeyPrefix(types.SupplierKeyOperatorPrefix)) + store.Delete(types.SupplierOperatorKey(supplierOperatorAddress)) } // GetAllSuppliers returns all supplier func (k Keeper) GetAllSuppliers(ctx context.Context) (suppliers []sharedtypes.Supplier) { storeAdapter := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) - store := prefix.NewStore(storeAdapter, types.KeyPrefix(types.SupplierKeyPrefix)) + store := prefix.NewStore(storeAdapter, types.KeyPrefix(types.SupplierKeyOperatorPrefix)) iterator := storetypes.KVStorePrefixIterator(store, []byte{}) defer iterator.Close() diff --git a/x/supplier/keeper/supplier_test.go b/x/supplier/keeper/supplier_test.go index e5776a468..279fcd81b 100644 --- a/x/supplier/keeper/supplier_test.go +++ b/x/supplier/keeper/supplier_test.go @@ -38,7 +38,8 @@ func createNSuppliers(keeper keeper.Keeper, ctx context.Context, n int) []shared suppliers := make([]sharedtypes.Supplier, n) for i := range suppliers { supplier := &suppliers[i] - supplier.Address = sample.AccAddress() + supplier.OwnerAddress = sample.AccAddress() + supplier.OperatorAddress = sample.AccAddress() supplier.Stake = &sdk.Coin{Denom: "upokt", Amount: math.NewInt(int64(i))} supplier.Services = []*sharedtypes.SupplierServiceConfig{ { @@ -63,7 +64,7 @@ func TestSupplierGet(t *testing.T) { suppliers := createNSuppliers(*supplierModuleKeepers.Keeper, ctx, 10) for _, supplier := range suppliers { supplierFound, isSupplierFound := supplierModuleKeepers.GetSupplier(ctx, - supplier.Address, + supplier.OperatorAddress, ) require.True(t, isSupplierFound) require.Equal(t, @@ -77,9 +78,9 @@ func TestSupplierRemove(t *testing.T) { supplierModuleKeepers, ctx := keepertest.SupplierKeeper(t) suppliers := createNSuppliers(*supplierModuleKeepers.Keeper, ctx, 10) for _, supplier := range suppliers { - supplierModuleKeepers.RemoveSupplier(ctx, supplier.Address) + supplierModuleKeepers.RemoveSupplier(ctx, supplier.OperatorAddress) _, isSupplierFound := supplierModuleKeepers.GetSupplier(ctx, - supplier.Address, + supplier.OperatorAddress, ) require.False(t, isSupplierFound) } diff --git a/x/supplier/keeper/unbond_suppliers.go b/x/supplier/keeper/unbond_suppliers.go index e606e4963..ab6f9d0b1 100644 --- a/x/supplier/keeper/unbond_suppliers.go +++ b/x/supplier/keeper/unbond_suppliers.go @@ -47,9 +47,9 @@ func (k Keeper) EndBlockerUnbondSuppliers(ctx context.Context) error { } // Retrieve the address of the supplier. - supplierAddress, err := cosmostypes.AccAddressFromBech32(supplier.Address) + supplierOperatorAddress, err := cosmostypes.AccAddressFromBech32(supplier.OperatorAddress) if err != nil { - logger.Error(fmt.Sprintf("could not parse the operator address %s", supplier.Address)) + logger.Error(fmt.Sprintf("could not parse the operator address %s", supplier.OperatorAddress)) return err } @@ -65,7 +65,7 @@ func (k Keeper) EndBlockerUnbondSuppliers(ctx context.Context) error { } // Remove the supplier from the store. - k.RemoveSupplier(ctx, supplierAddress.String()) + k.RemoveSupplier(ctx, supplierOperatorAddress.String()) logger.Info(fmt.Sprintf("Successfully removed the supplier: %+v", supplier)) } diff --git a/x/supplier/module/genesis_test.go b/x/supplier/module/genesis_test.go index 57cde19a6..987492154 100644 --- a/x/supplier/module/genesis_test.go +++ b/x/supplier/module/genesis_test.go @@ -20,8 +20,9 @@ func TestGenesis(t *testing.T) { Params: types.DefaultParams(), SupplierList: []sharedtypes.Supplier{ { - Address: sample.AccAddress(), - Stake: &sdk.Coin{Denom: "upokt", Amount: math.NewInt(100)}, + OwnerAddress: sample.AccAddress(), + OperatorAddress: sample.AccAddress(), + Stake: &sdk.Coin{Denom: "upokt", Amount: math.NewInt(100)}, Services: []*sharedtypes.SupplierServiceConfig{ { Service: &sharedtypes.Service{ @@ -38,8 +39,9 @@ func TestGenesis(t *testing.T) { }, }, { - Address: sample.AccAddress(), - Stake: &sdk.Coin{Denom: "upokt", Amount: math.NewInt(100)}, + OwnerAddress: sample.AccAddress(), + OperatorAddress: sample.AccAddress(), + Stake: &sdk.Coin{Denom: "upokt", Amount: math.NewInt(100)}, Services: []*sharedtypes.SupplierServiceConfig{ { Service: &sharedtypes.Service{ diff --git a/x/supplier/module/query.go b/x/supplier/module/query.go index 11769f738..7802db00e 100644 --- a/x/supplier/module/query.go +++ b/x/supplier/module/query.go @@ -10,7 +10,7 @@ import ( ) // GetQueryCmd returns the cli query commands for this module -// TODO_TECHDEBT(@bryanchriswhite, #370): remove if custom query commands are consolidated into AutoCLI. +// TODO_MAINNET(#370): remove if custom query commands are consolidated into AutoCLI. func (am AppModule) GetQueryCmd() *cobra.Command { // Group supplier queries under a subcommand cmd := &cobra.Command{ diff --git a/x/supplier/module/query_supplier.go b/x/supplier/module/query_supplier.go index bf565e651..81a18454e 100644 --- a/x/supplier/module/query_supplier.go +++ b/x/supplier/module/query_supplier.go @@ -46,7 +46,7 @@ func CmdListSuppliers() *cobra.Command { func CmdShowSupplier() *cobra.Command { cmd := &cobra.Command{ - Use: "show-supplier ", + Use: "show-supplier ", Short: "shows a supplier", Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) (err error) { @@ -60,7 +60,7 @@ func CmdShowSupplier() *cobra.Command { argAddress := args[0] params := &types.QueryGetSupplierRequest{ - Address: argAddress, + OperatorAddress: argAddress, } res, err := queryClient.Supplier(cmd.Context(), params) diff --git a/x/supplier/module/query_supplier_test.go b/x/supplier/module/query_supplier_test.go index d741481f2..78c529d90 100644 --- a/x/supplier/module/query_supplier_test.go +++ b/x/supplier/module/query_supplier_test.go @@ -35,7 +35,7 @@ func TestShowSupplier(t *testing.T) { }{ { desc: "supplier found", - idAddress: suppliers[0].Address, + idAddress: suppliers[0].OperatorAddress, args: common, supplier: suppliers[0], diff --git a/x/supplier/module/tx.go b/x/supplier/module/tx.go index 943cf1895..78d16f011 100644 --- a/x/supplier/module/tx.go +++ b/x/supplier/module/tx.go @@ -10,7 +10,7 @@ import ( ) // GetTxCmd returns the transaction commands for this module -// TODO_TECHDEBT(@bryanchriswhite, #370): remove if custom query commands are consolidated into AutoCLI. +// TODO_MAINNET(#370): remove if custom query commands are consolidated into AutoCLI. func (am AppModule) GetTxCmd() *cobra.Command { cmd := &cobra.Command{ Use: types.ModuleName, diff --git a/x/supplier/module/tx_stake_supplier_test.go b/x/supplier/module/tx_stake_supplier_test.go index 3cac27cf6..ea8b95746 100644 --- a/x/supplier/module/tx_stake_supplier_test.go +++ b/x/supplier/module/tx_stake_supplier_test.go @@ -82,13 +82,13 @@ func TestCLI_StakeSupplier(t *testing.T) { // Error Paths - Address Related { - desc: "stake supplier: missing address", + desc: "stake supplier: missing owner address", // ownerAddress: "explicitly missing", expectedErr: types.ErrSupplierInvalidAddress, config: defaultConfig, }, { - desc: "stake supplier: invalid address", + desc: "stake supplier: invalid owner address", ownerAddress: "invalid", expectedErr: types.ErrSupplierInvalidAddress, config: defaultConfig, diff --git a/x/supplier/simulation/stake_supplier.go b/x/supplier/simulation/stake_supplier.go index 29acc1fd4..144236c9c 100644 --- a/x/supplier/simulation/stake_supplier.go +++ b/x/supplier/simulation/stake_supplier.go @@ -20,7 +20,7 @@ func SimulateMsgStakeSupplier( ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { simAccount, _ := simtypes.RandomAcc(r, accs) msg := &types.MsgStakeSupplier{ - Address: simAccount.Address.String(), + OperatorAddress: simAccount.Address.String(), // TODO: Update all stake message fields } diff --git a/x/supplier/simulation/unstake_supplier.go b/x/supplier/simulation/unstake_supplier.go index 06a2a38c3..16843fb06 100644 --- a/x/supplier/simulation/unstake_supplier.go +++ b/x/supplier/simulation/unstake_supplier.go @@ -20,7 +20,7 @@ func SimulateMsgUnstakeSupplier( ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { simAccount, _ := simtypes.RandomAcc(r, accs) msg := &types.MsgUnstakeSupplier{ - Address: simAccount.Address.String(), + OperatorAddress: simAccount.Address.String(), } // TODO: Handling the UnstakeSupplier simulation diff --git a/x/supplier/types/genesis.go b/x/supplier/types/genesis.go index 96f5fc63e..7c696a50f 100644 --- a/x/supplier/types/genesis.go +++ b/x/supplier/types/genesis.go @@ -22,13 +22,13 @@ func DefaultGenesis() *GenesisState { // failure. func (gs GenesisState) Validate() error { // Check for duplicated index in supplier - supplierAddrMap := make(map[string]struct{}) + supplierOperatorAddrMap := make(map[string]struct{}) for _, supplier := range gs.SupplierList { - supplierAddr := string(SupplierKey(supplier.Address)) - if _, ok := supplierAddrMap[supplierAddr]; ok { + supplierOperatorAddr := string(SupplierOperatorKey(supplier.OperatorAddress)) + if _, ok := supplierOperatorAddrMap[supplierOperatorAddr]; ok { return fmt.Errorf("duplicated index for supplier") } - supplierAddrMap[supplierAddr] = struct{}{} + supplierOperatorAddrMap[supplierOperatorAddr] = struct{}{} } // Check that the stake value for the suppliers is valid @@ -56,6 +56,17 @@ func (gs GenesisState) Validate() error { if err := servicehelpers.ValidateSupplierServiceConfigs(supplier.Services); err != nil { return ErrSupplierInvalidServiceConfig.Wrapf(err.Error()) } + + // Validate the supplier owner address + if _, err := sdk.AccAddressFromBech32(supplier.OwnerAddress); err != nil { + return ErrSupplierInvalidAddress.Wrapf("invalid supplier owner address %v", err.Error()) + } + + // Validate the supplier operator address + if _, err := sdk.AccAddressFromBech32(supplier.OperatorAddress); err != nil { + return ErrSupplierInvalidAddress.Wrapf("invalid supplier operator address %v", err.Error()) + } + } // this line is used by starport scaffolding # genesis/types/validate diff --git a/x/supplier/types/genesis_test.go b/x/supplier/types/genesis_test.go index 6898d96d3..b1a78f68d 100644 --- a/x/supplier/types/genesis_test.go +++ b/x/supplier/types/genesis_test.go @@ -60,14 +60,16 @@ func TestGenesisState_Validate(t *testing.T) { genState: &types.GenesisState{ SupplierList: []sharedtypes.Supplier{ { - Address: addr1, - Stake: &stake1, - Services: serviceList1, + OwnerAddress: addr1, + OperatorAddress: addr1, + Stake: &stake1, + Services: serviceList1, }, { - Address: addr2, - Stake: &stake2, - Services: serviceList2, + OwnerAddress: addr2, + OperatorAddress: addr2, + Stake: &stake2, + Services: serviceList2, }, }, // this line is used by starport scaffolding # types/genesis/validField @@ -79,14 +81,16 @@ func TestGenesisState_Validate(t *testing.T) { genState: &types.GenesisState{ SupplierList: []sharedtypes.Supplier{ { - Address: addr1, - Stake: &stake1, - Services: serviceList1, + OwnerAddress: addr1, + OperatorAddress: addr1, + Stake: &stake1, + Services: serviceList1, }, { - Address: addr2, - Stake: &sdk.Coin{Denom: "upokt", Amount: math.NewInt(0)}, - Services: serviceList2, + OwnerAddress: addr2, + OperatorAddress: addr2, + Stake: &sdk.Coin{Denom: "upokt", Amount: math.NewInt(0)}, + Services: serviceList2, }, }, }, @@ -97,14 +101,16 @@ func TestGenesisState_Validate(t *testing.T) { genState: &types.GenesisState{ SupplierList: []sharedtypes.Supplier{ { - Address: addr1, - Stake: &stake1, - Services: serviceList1, + OwnerAddress: addr1, + OperatorAddress: addr1, + Stake: &stake1, + Services: serviceList1, }, { - Address: addr2, - Stake: &sdk.Coin{Denom: "upokt", Amount: math.NewInt(-100)}, - Services: serviceList2, + OwnerAddress: addr2, + OperatorAddress: addr2, + Stake: &sdk.Coin{Denom: "upokt", Amount: math.NewInt(-100)}, + Services: serviceList2, }, }, }, @@ -115,14 +121,16 @@ func TestGenesisState_Validate(t *testing.T) { genState: &types.GenesisState{ SupplierList: []sharedtypes.Supplier{ { - Address: addr1, - Stake: &stake1, - Services: serviceList1, + OwnerAddress: addr1, + OperatorAddress: addr1, + Stake: &stake1, + Services: serviceList1, }, { - Address: addr2, - Stake: &sdk.Coin{Denom: "invalid", Amount: math.NewInt(100)}, - Services: serviceList2, + OwnerAddress: addr2, + OperatorAddress: addr2, + Stake: &sdk.Coin{Denom: "invalid", Amount: math.NewInt(100)}, + Services: serviceList2, }, }, }, @@ -133,32 +141,36 @@ func TestGenesisState_Validate(t *testing.T) { genState: &types.GenesisState{ SupplierList: []sharedtypes.Supplier{ { - Address: addr1, - Stake: &stake1, - Services: serviceList1, + OwnerAddress: addr1, + OperatorAddress: addr1, + Stake: &stake1, + Services: serviceList1, }, { - Address: addr2, - Stake: &sdk.Coin{Denom: "", Amount: math.NewInt(100)}, - Services: serviceList2, + OwnerAddress: addr2, + OperatorAddress: addr2, + Stake: &sdk.Coin{Denom: "", Amount: math.NewInt(100)}, + Services: serviceList2, }, }, }, isValid: false, }, { - desc: "invalid - due to duplicated supplier address", + desc: "invalid - due to duplicated supplier operator address", genState: &types.GenesisState{ SupplierList: []sharedtypes.Supplier{ { - Address: addr1, - Stake: &stake1, - Services: serviceList1, + OwnerAddress: addr1, + OperatorAddress: addr1, + Stake: &stake1, + Services: serviceList1, }, { - Address: addr1, - Stake: &stake2, - Services: serviceList2, + OwnerAddress: addr1, + OperatorAddress: addr1, + Stake: &stake2, + Services: serviceList2, }, }, }, @@ -169,14 +181,16 @@ func TestGenesisState_Validate(t *testing.T) { genState: &types.GenesisState{ SupplierList: []sharedtypes.Supplier{ { - Address: addr1, - Stake: &stake1, - Services: serviceList1, + OwnerAddress: addr1, + OperatorAddress: addr1, + Stake: &stake1, + Services: serviceList1, }, { - Address: addr2, - Stake: nil, - Services: serviceList2, + OwnerAddress: addr2, + OperatorAddress: addr2, + Stake: nil, + Services: serviceList2, }, }, }, @@ -187,12 +201,14 @@ func TestGenesisState_Validate(t *testing.T) { genState: &types.GenesisState{ SupplierList: []sharedtypes.Supplier{ { - Address: addr1, - Stake: &stake1, - Services: serviceList1, + OwnerAddress: addr1, + OperatorAddress: addr1, + Stake: &stake1, + Services: serviceList1, }, { - Address: addr2, + OwnerAddress: addr2, + OperatorAddress: addr2, // Stake explicitly omitted Services: serviceList2, }, @@ -205,13 +221,15 @@ func TestGenesisState_Validate(t *testing.T) { genState: &types.GenesisState{ SupplierList: []sharedtypes.Supplier{ { - Address: addr1, - Stake: &stake1, - Services: serviceList1, + OwnerAddress: addr1, + OperatorAddress: addr1, + Stake: &stake1, + Services: serviceList1, }, { - Address: addr2, - Stake: &stake2, + OwnerAddress: addr2, + OperatorAddress: addr2, + Stake: &stake2, // Services explicitly omitted }, }, @@ -223,14 +241,16 @@ func TestGenesisState_Validate(t *testing.T) { genState: &types.GenesisState{ SupplierList: []sharedtypes.Supplier{ { - Address: addr1, - Stake: &stake1, - Services: serviceList1, + OwnerAddress: addr1, + OperatorAddress: addr1, + Stake: &stake1, + Services: serviceList1, }, { - Address: addr2, - Stake: &stake2, - Services: []*sharedtypes.SupplierServiceConfig{}, + OwnerAddress: addr2, + OperatorAddress: addr2, + Stake: &stake2, + Services: []*sharedtypes.SupplierServiceConfig{}, }, }, }, @@ -241,13 +261,15 @@ func TestGenesisState_Validate(t *testing.T) { genState: &types.GenesisState{ SupplierList: []sharedtypes.Supplier{ { - Address: addr1, - Stake: &stake1, - Services: serviceList1, + OwnerAddress: addr1, + OperatorAddress: addr1, + Stake: &stake1, + Services: serviceList1, }, { - Address: addr2, - Stake: &stake2, + OwnerAddress: addr2, + OperatorAddress: addr2, + Stake: &stake2, Services: []*sharedtypes.SupplierServiceConfig{ { Service: &sharedtypes.Service{ @@ -272,13 +294,15 @@ func TestGenesisState_Validate(t *testing.T) { genState: &types.GenesisState{ SupplierList: []sharedtypes.Supplier{ { - Address: addr1, - Stake: &stake1, - Services: serviceList1, + OwnerAddress: addr1, + OperatorAddress: addr1, + Stake: &stake1, + Services: serviceList1, }, { - Address: addr2, - Stake: &stake2, + OwnerAddress: addr2, + OperatorAddress: addr2, + Stake: &stake2, Services: []*sharedtypes.SupplierServiceConfig{ { Service: &sharedtypes.Service{ diff --git a/x/supplier/types/key_supplier.go b/x/supplier/types/key_supplier.go index b23c0ec8b..4e3011b30 100644 --- a/x/supplier/types/key_supplier.go +++ b/x/supplier/types/key_supplier.go @@ -5,16 +5,16 @@ import "encoding/binary" var _ binary.ByteOrder const ( - // SupplierKeyPrefix is the prefix to retrieve all Supplier - SupplierKeyPrefix = "Supplier/address/" + // SupplierKeyOperatorPrefix is the prefix to retrieve all Supplier + SupplierKeyOperatorPrefix = "Supplier/operator_address/" ) -// SupplierKey returns the store key to retrieve a Supplier from the index fields -func SupplierKey(supplierAddr string) []byte { +// SupplierOperatorKey returns the store key to retrieve a Supplier from the index fields +func SupplierOperatorKey(supplierOperatorAddr string) []byte { var key []byte - supplierAddrBz := []byte(supplierAddr) - key = append(key, supplierAddrBz...) + supplierOperatorAddrBz := []byte(supplierOperatorAddr) + key = append(key, supplierOperatorAddrBz...) key = append(key, []byte("/")...) return key diff --git a/x/supplier/types/message_stake_supplier.go b/x/supplier/types/message_stake_supplier.go index 399799742..18cc9e03b 100644 --- a/x/supplier/types/message_stake_supplier.go +++ b/x/supplier/types/message_stake_supplier.go @@ -14,16 +14,16 @@ var _ sdk.Msg = (*MsgStakeSupplier)(nil) func NewMsgStakeSupplier( signerAddress string, ownerAddress string, - supplierAddress string, + supplierOperatorAddress string, stake sdk.Coin, services []*sharedtypes.SupplierServiceConfig, ) *MsgStakeSupplier { return &MsgStakeSupplier{ - Signer: signerAddress, - OwnerAddress: ownerAddress, - Address: supplierAddress, - Stake: &stake, - Services: services, + Signer: signerAddress, + OwnerAddress: ownerAddress, + OperatorAddress: supplierOperatorAddress, + Stake: &stake, + Services: services, } } @@ -34,13 +34,13 @@ func (msg *MsgStakeSupplier) ValidateBasic() error { } // Validate the address - if _, err := sdk.AccAddressFromBech32(msg.Address); err != nil { - return ErrSupplierInvalidAddress.Wrapf("invalid operator address %s; (%v)", msg.Address, err) + if _, err := sdk.AccAddressFromBech32(msg.OperatorAddress); err != nil { + return ErrSupplierInvalidAddress.Wrapf("invalid operator address %s; (%v)", msg.OperatorAddress, err) } // Validate the signer address if _, err := sdk.AccAddressFromBech32(msg.Signer); err != nil { - return ErrSupplierInvalidAddress.Wrapf("invalid signer address %s; (%v)", msg.Address, err) + return ErrSupplierInvalidAddress.Wrapf("invalid signer address %s; (%v)", msg.Signer, err) } // TODO_MAINNET: Centralize stake related verification and share across different diff --git a/x/supplier/types/message_stake_supplier_test.go b/x/supplier/types/message_stake_supplier_test.go index cf92ba3a7..980b91f6e 100644 --- a/x/supplier/types/message_stake_supplier_test.go +++ b/x/supplier/types/message_stake_supplier_test.go @@ -43,62 +43,62 @@ func TestMsgStakeSupplier_ValidateBasic(t *testing.T) { { desc: "valid same owner and operator address", msg: MsgStakeSupplier{ - Signer: ownerAddress, - OwnerAddress: ownerAddress, - Address: ownerAddress, - Stake: &sdk.Coin{Denom: volatile.DenomuPOKT, Amount: math.NewInt(100)}, - Services: defaultServicesList, + Signer: ownerAddress, + OwnerAddress: ownerAddress, + OperatorAddress: ownerAddress, + Stake: &sdk.Coin{Denom: volatile.DenomuPOKT, Amount: math.NewInt(100)}, + Services: defaultServicesList, }, }, { desc: "valid different owner and operator address", msg: MsgStakeSupplier{ - Signer: ownerAddress, - OwnerAddress: ownerAddress, - Address: operatorAddress, - Stake: &sdk.Coin{Denom: volatile.DenomuPOKT, Amount: math.NewInt(100)}, - Services: defaultServicesList, + Signer: ownerAddress, + OwnerAddress: ownerAddress, + OperatorAddress: operatorAddress, + Stake: &sdk.Coin{Denom: volatile.DenomuPOKT, Amount: math.NewInt(100)}, + Services: defaultServicesList, }, }, { desc: "valid signer is operator address", msg: MsgStakeSupplier{ - Signer: operatorAddress, - OwnerAddress: ownerAddress, - Address: operatorAddress, - Stake: &sdk.Coin{Denom: volatile.DenomuPOKT, Amount: math.NewInt(100)}, - Services: defaultServicesList, + Signer: operatorAddress, + OwnerAddress: ownerAddress, + OperatorAddress: operatorAddress, + Stake: &sdk.Coin{Denom: volatile.DenomuPOKT, Amount: math.NewInt(100)}, + Services: defaultServicesList, }, }, { desc: "valid signer is neither the operator nor the owner", msg: MsgStakeSupplier{ - Signer: sample.AccAddress(), - OwnerAddress: ownerAddress, - Address: operatorAddress, - Stake: &sdk.Coin{Denom: volatile.DenomuPOKT, Amount: math.NewInt(100)}, - Services: defaultServicesList, + Signer: sample.AccAddress(), + OwnerAddress: ownerAddress, + OperatorAddress: operatorAddress, + Stake: &sdk.Coin{Denom: volatile.DenomuPOKT, Amount: math.NewInt(100)}, + Services: defaultServicesList, }, }, { desc: "invalid operator address", msg: MsgStakeSupplier{ - Signer: ownerAddress, - OwnerAddress: ownerAddress, - Address: "invalid_address", - Stake: &sdk.Coin{Denom: volatile.DenomuPOKT, Amount: math.NewInt(100)}, - Services: defaultServicesList, + Signer: ownerAddress, + OwnerAddress: ownerAddress, + OperatorAddress: "invalid_address", + Stake: &sdk.Coin{Denom: volatile.DenomuPOKT, Amount: math.NewInt(100)}, + Services: defaultServicesList, }, expectedErr: ErrSupplierInvalidAddress, }, { desc: "invalid owner address", msg: MsgStakeSupplier{ - Signer: ownerAddress, - OwnerAddress: "invalid_address", - Address: operatorAddress, - Stake: &sdk.Coin{Denom: volatile.DenomuPOKT, Amount: math.NewInt(100)}, - Services: defaultServicesList, + Signer: ownerAddress, + OwnerAddress: "invalid_address", + OperatorAddress: operatorAddress, + Stake: &sdk.Coin{Denom: volatile.DenomuPOKT, Amount: math.NewInt(100)}, + Services: defaultServicesList, }, expectedErr: ErrSupplierInvalidAddress, }, @@ -117,9 +117,9 @@ func TestMsgStakeSupplier_ValidateBasic(t *testing.T) { msg: MsgStakeSupplier{ Signer: ownerAddress, // OwnerAddress: ownerAddress, - Address: operatorAddress, - Stake: &sdk.Coin{Denom: volatile.DenomuPOKT, Amount: math.NewInt(100)}, - Services: defaultServicesList, + OperatorAddress: operatorAddress, + Stake: &sdk.Coin{Denom: volatile.DenomuPOKT, Amount: math.NewInt(100)}, + Services: defaultServicesList, }, expectedErr: ErrSupplierInvalidAddress, }, @@ -128,7 +128,7 @@ func TestMsgStakeSupplier_ValidateBasic(t *testing.T) { msg: MsgStakeSupplier{ Signer: ownerAddress, OwnerAddress: ownerAddress, - // Address: operatorAddress, + // OperatorAddress: operatorAddress, Stake: &sdk.Coin{Denom: volatile.DenomuPOKT, Amount: math.NewInt(0)}, Services: defaultServicesList, }, @@ -138,9 +138,10 @@ func TestMsgStakeSupplier_ValidateBasic(t *testing.T) { desc: "missing signer address", msg: MsgStakeSupplier{ // Signer: ownerAddress, - OwnerAddress: ownerAddress, - Stake: &sdk.Coin{Denom: volatile.DenomuPOKT, Amount: math.NewInt(0)}, - Services: defaultServicesList, + OwnerAddress: ownerAddress, + OperatorAddress: operatorAddress, + Stake: &sdk.Coin{Denom: volatile.DenomuPOKT, Amount: math.NewInt(0)}, + Services: defaultServicesList, }, expectedErr: ErrSupplierInvalidAddress, }, @@ -149,19 +150,19 @@ func TestMsgStakeSupplier_ValidateBasic(t *testing.T) { { desc: "valid stake", msg: MsgStakeSupplier{ - Signer: ownerAddress, - OwnerAddress: ownerAddress, - Address: operatorAddress, - Stake: &sdk.Coin{Denom: volatile.DenomuPOKT, Amount: math.NewInt(100)}, - Services: defaultServicesList, + Signer: ownerAddress, + OwnerAddress: ownerAddress, + OperatorAddress: operatorAddress, + Stake: &sdk.Coin{Denom: volatile.DenomuPOKT, Amount: math.NewInt(100)}, + Services: defaultServicesList, }, }, { desc: "invalid stake - missing stake", msg: MsgStakeSupplier{ - Signer: ownerAddress, - OwnerAddress: ownerAddress, - Address: operatorAddress, + Signer: ownerAddress, + OwnerAddress: ownerAddress, + OperatorAddress: operatorAddress, // Stake explicitly omitted Services: defaultServicesList, }, @@ -170,44 +171,44 @@ func TestMsgStakeSupplier_ValidateBasic(t *testing.T) { { desc: "invalid stake - zero amount", msg: MsgStakeSupplier{ - Signer: ownerAddress, - OwnerAddress: ownerAddress, - Address: operatorAddress, - Stake: &sdk.Coin{Denom: volatile.DenomuPOKT, Amount: math.NewInt(0)}, - Services: defaultServicesList, + Signer: ownerAddress, + OwnerAddress: ownerAddress, + OperatorAddress: operatorAddress, + Stake: &sdk.Coin{Denom: volatile.DenomuPOKT, Amount: math.NewInt(0)}, + Services: defaultServicesList, }, expectedErr: ErrSupplierInvalidStake, }, { desc: "invalid stake - negative amount", msg: MsgStakeSupplier{ - Signer: ownerAddress, - OwnerAddress: ownerAddress, - Address: operatorAddress, - Stake: &sdk.Coin{Denom: volatile.DenomuPOKT, Amount: math.NewInt(-100)}, - Services: defaultServicesList, + Signer: ownerAddress, + OwnerAddress: ownerAddress, + OperatorAddress: operatorAddress, + Stake: &sdk.Coin{Denom: volatile.DenomuPOKT, Amount: math.NewInt(-100)}, + Services: defaultServicesList, }, expectedErr: ErrSupplierInvalidStake, }, { desc: "invalid stake - invalid denom", msg: MsgStakeSupplier{ - Signer: ownerAddress, - OwnerAddress: ownerAddress, - Address: operatorAddress, - Stake: &sdk.Coin{Denom: "invalid", Amount: math.NewInt(100)}, - Services: defaultServicesList, + Signer: ownerAddress, + OwnerAddress: ownerAddress, + OperatorAddress: operatorAddress, + Stake: &sdk.Coin{Denom: "invalid", Amount: math.NewInt(100)}, + Services: defaultServicesList, }, expectedErr: ErrSupplierInvalidStake, }, { desc: "invalid stake - missing denom", msg: MsgStakeSupplier{ - Signer: ownerAddress, - OwnerAddress: ownerAddress, - Address: operatorAddress, - Stake: &sdk.Coin{Denom: "", Amount: math.NewInt(100)}, - Services: defaultServicesList, + Signer: ownerAddress, + OwnerAddress: ownerAddress, + OperatorAddress: operatorAddress, + Stake: &sdk.Coin{Denom: "", Amount: math.NewInt(100)}, + Services: defaultServicesList, }, expectedErr: ErrSupplierInvalidStake, }, @@ -216,10 +217,10 @@ func TestMsgStakeSupplier_ValidateBasic(t *testing.T) { { desc: "valid service configs - multiple services", msg: MsgStakeSupplier{ - Signer: ownerAddress, - OwnerAddress: ownerAddress, - Address: operatorAddress, - Stake: &sdk.Coin{Denom: volatile.DenomuPOKT, Amount: math.NewInt(100)}, + Signer: ownerAddress, + OwnerAddress: ownerAddress, + OperatorAddress: operatorAddress, + Stake: &sdk.Coin{Denom: volatile.DenomuPOKT, Amount: math.NewInt(100)}, Services: []*sharedtypes.SupplierServiceConfig{ { Service: &sharedtypes.Service{ @@ -251,10 +252,10 @@ func TestMsgStakeSupplier_ValidateBasic(t *testing.T) { { desc: "invalid service configs - omitted", msg: MsgStakeSupplier{ - Signer: ownerAddress, - OwnerAddress: ownerAddress, - Address: operatorAddress, - Stake: &sdk.Coin{Denom: volatile.DenomuPOKT, Amount: math.NewInt(100)}, + Signer: ownerAddress, + OwnerAddress: ownerAddress, + OperatorAddress: operatorAddress, + Stake: &sdk.Coin{Denom: volatile.DenomuPOKT, Amount: math.NewInt(100)}, // Services explicitly omitted }, expectedErr: ErrSupplierInvalidServiceConfig, @@ -262,21 +263,21 @@ func TestMsgStakeSupplier_ValidateBasic(t *testing.T) { { desc: "invalid service configs - empty", msg: MsgStakeSupplier{ - Signer: ownerAddress, - OwnerAddress: ownerAddress, - Address: operatorAddress, - Stake: &sdk.Coin{Denom: volatile.DenomuPOKT, Amount: math.NewInt(100)}, - Services: []*sharedtypes.SupplierServiceConfig{}, + Signer: ownerAddress, + OwnerAddress: ownerAddress, + OperatorAddress: operatorAddress, + Stake: &sdk.Coin{Denom: volatile.DenomuPOKT, Amount: math.NewInt(100)}, + Services: []*sharedtypes.SupplierServiceConfig{}, }, expectedErr: ErrSupplierInvalidServiceConfig, }, { desc: "invalid service configs - invalid service ID that's too long", msg: MsgStakeSupplier{ - Signer: ownerAddress, - OwnerAddress: ownerAddress, - Address: operatorAddress, - Stake: &sdk.Coin{Denom: volatile.DenomuPOKT, Amount: math.NewInt(100)}, + Signer: ownerAddress, + OwnerAddress: ownerAddress, + OperatorAddress: operatorAddress, + Stake: &sdk.Coin{Denom: volatile.DenomuPOKT, Amount: math.NewInt(100)}, Services: []*sharedtypes.SupplierServiceConfig{ { Service: &sharedtypes.Service{ @@ -297,10 +298,10 @@ func TestMsgStakeSupplier_ValidateBasic(t *testing.T) { { desc: "invalid service configs - invalid service Name that's too long", msg: MsgStakeSupplier{ - Signer: ownerAddress, - OwnerAddress: ownerAddress, - Address: operatorAddress, - Stake: &sdk.Coin{Denom: volatile.DenomuPOKT, Amount: math.NewInt(100)}, + Signer: ownerAddress, + OwnerAddress: ownerAddress, + OperatorAddress: operatorAddress, + Stake: &sdk.Coin{Denom: volatile.DenomuPOKT, Amount: math.NewInt(100)}, Services: []*sharedtypes.SupplierServiceConfig{ { Service: &sharedtypes.Service{ @@ -322,10 +323,10 @@ func TestMsgStakeSupplier_ValidateBasic(t *testing.T) { { desc: "invalid service configs - invalid service ID that contains invalid characters", msg: MsgStakeSupplier{ - Signer: ownerAddress, - OwnerAddress: ownerAddress, - Address: operatorAddress, - Stake: &sdk.Coin{Denom: volatile.DenomuPOKT, Amount: math.NewInt(100)}, + Signer: ownerAddress, + OwnerAddress: ownerAddress, + OperatorAddress: operatorAddress, + Stake: &sdk.Coin{Denom: volatile.DenomuPOKT, Amount: math.NewInt(100)}, Services: []*sharedtypes.SupplierServiceConfig{ { Service: &sharedtypes.Service{ @@ -346,10 +347,10 @@ func TestMsgStakeSupplier_ValidateBasic(t *testing.T) { { desc: "invalid service configs - missing url", msg: MsgStakeSupplier{ - Signer: ownerAddress, - OwnerAddress: ownerAddress, - Address: operatorAddress, - Stake: &sdk.Coin{Denom: volatile.DenomuPOKT, Amount: math.NewInt(100)}, + Signer: ownerAddress, + OwnerAddress: ownerAddress, + OperatorAddress: operatorAddress, + Stake: &sdk.Coin{Denom: volatile.DenomuPOKT, Amount: math.NewInt(100)}, Services: []*sharedtypes.SupplierServiceConfig{ { Service: &sharedtypes.Service{ @@ -371,10 +372,10 @@ func TestMsgStakeSupplier_ValidateBasic(t *testing.T) { { desc: "invalid service configs - invalid url", msg: MsgStakeSupplier{ - Signer: ownerAddress, - OwnerAddress: ownerAddress, - Address: operatorAddress, - Stake: &sdk.Coin{Denom: volatile.DenomuPOKT, Amount: math.NewInt(100)}, + Signer: ownerAddress, + OwnerAddress: ownerAddress, + OperatorAddress: operatorAddress, + Stake: &sdk.Coin{Denom: volatile.DenomuPOKT, Amount: math.NewInt(100)}, Services: []*sharedtypes.SupplierServiceConfig{ { Service: &sharedtypes.Service{ @@ -396,10 +397,10 @@ func TestMsgStakeSupplier_ValidateBasic(t *testing.T) { { desc: "invalid service configs - missing rpc type", msg: MsgStakeSupplier{ - Signer: ownerAddress, - OwnerAddress: ownerAddress, - Address: operatorAddress, - Stake: &sdk.Coin{Denom: volatile.DenomuPOKT, Amount: math.NewInt(100)}, + Signer: ownerAddress, + OwnerAddress: ownerAddress, + OperatorAddress: operatorAddress, + Stake: &sdk.Coin{Denom: volatile.DenomuPOKT, Amount: math.NewInt(100)}, Services: []*sharedtypes.SupplierServiceConfig{ { Service: &sharedtypes.Service{ diff --git a/x/supplier/types/message_unstake_supplier.go b/x/supplier/types/message_unstake_supplier.go index b0e42dbed..a35d5e191 100644 --- a/x/supplier/types/message_unstake_supplier.go +++ b/x/supplier/types/message_unstake_supplier.go @@ -6,20 +6,20 @@ const TypeMsgUnstakeSupplier = "unstake_supplier" var _ sdk.Msg = (*MsgUnstakeSupplier)(nil) -func NewMsgUnstakeSupplier(signerAddress, address string) *MsgUnstakeSupplier { +func NewMsgUnstakeSupplier(signerAddress, operatorAddress string) *MsgUnstakeSupplier { return &MsgUnstakeSupplier{ - Signer: signerAddress, - Address: address, + Signer: signerAddress, + OperatorAddress: operatorAddress, } } func (msg *MsgUnstakeSupplier) ValidateBasic() error { if _, err := sdk.AccAddressFromBech32(msg.Signer); err != nil { - return ErrSupplierInvalidAddress.Wrapf("invalid address address (%s)", err) + return ErrSupplierInvalidAddress.Wrapf("invalid signer address address (%s)", err) } - if _, err := sdk.AccAddressFromBech32(msg.Address); err != nil { - return ErrSupplierInvalidAddress.Wrapf("invalid address address (%s)", err) + if _, err := sdk.AccAddressFromBech32(msg.OperatorAddress); err != nil { + return ErrSupplierInvalidAddress.Wrapf("invalid operator address address (%s)", err) } return nil diff --git a/x/supplier/types/message_unstake_supplier_test.go b/x/supplier/types/message_unstake_supplier_test.go index 6ecb26642..378e8f2b4 100644 --- a/x/supplier/types/message_unstake_supplier_test.go +++ b/x/supplier/types/message_unstake_supplier_test.go @@ -19,8 +19,8 @@ func TestMsgUnstakeSupplier_ValidateBasic(t *testing.T) { { desc: "invalid operator address", msg: MsgUnstakeSupplier{ - Signer: signerAddress, - Address: "invalid_address", + Signer: signerAddress, + OperatorAddress: "invalid_address", }, expectedErr: ErrSupplierInvalidAddress, }, @@ -34,30 +34,30 @@ func TestMsgUnstakeSupplier_ValidateBasic(t *testing.T) { { desc: "invalid signer address", msg: MsgUnstakeSupplier{ - Signer: "invalid_address", - Address: operatorAddress, + Signer: "invalid_address", + OperatorAddress: operatorAddress, }, expectedErr: ErrSupplierInvalidAddress, }, { desc: "missing signer address", msg: MsgUnstakeSupplier{ - Address: operatorAddress, + OperatorAddress: operatorAddress, }, expectedErr: ErrSupplierInvalidAddress, }, { desc: "valid message", msg: MsgUnstakeSupplier{ - Signer: signerAddress, - Address: operatorAddress, + Signer: signerAddress, + OperatorAddress: operatorAddress, }, }, { desc: "valid message - same signer and operator addresses", msg: MsgUnstakeSupplier{ - Signer: operatorAddress, - Address: operatorAddress, + Signer: operatorAddress, + OperatorAddress: operatorAddress, }, }, } diff --git a/x/supplier/types/query.pb.go b/x/supplier/types/query.pb.go index dbe3966c4..36a3766d6 100644 --- a/x/supplier/types/query.pb.go +++ b/x/supplier/types/query.pb.go @@ -118,7 +118,7 @@ func (m *QueryParamsResponse) GetParams() Params { } type QueryGetSupplierRequest struct { - Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + OperatorAddress string `protobuf:"bytes,1,opt,name=operator_address,json=operatorAddress,proto3" json:"operator_address,omitempty"` } func (m *QueryGetSupplierRequest) Reset() { *m = QueryGetSupplierRequest{} } @@ -154,9 +154,9 @@ func (m *QueryGetSupplierRequest) XXX_DiscardUnknown() { var xxx_messageInfo_QueryGetSupplierRequest proto.InternalMessageInfo -func (m *QueryGetSupplierRequest) GetAddress() string { +func (m *QueryGetSupplierRequest) GetOperatorAddress() string { if m != nil { - return m.Address + return m.OperatorAddress } return "" } @@ -313,42 +313,43 @@ func init() { func init() { proto.RegisterFile("poktroll/supplier/query.proto", fileDescriptor_7a8c18c53656bd0d) } var fileDescriptor_7a8c18c53656bd0d = []byte{ - // 554 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x94, 0x3f, 0x6f, 0xd3, 0x40, - 0x18, 0xc6, 0x73, 0x2d, 0x84, 0xf6, 0x60, 0xe9, 0x11, 0x89, 0x24, 0x02, 0x83, 0x2c, 0x11, 0xa2, - 0x40, 0xef, 0x48, 0x60, 0x02, 0x96, 0x66, 0xa0, 0x03, 0x42, 0x2a, 0xce, 0x80, 0xc4, 0x82, 0xce, - 0xc9, 0xc9, 0xb5, 0xea, 0xf8, 0x5c, 0xdf, 0x05, 0xa8, 0x10, 0x0b, 0x0b, 0x2b, 0x12, 0x23, 0x03, - 0x62, 0x63, 0x64, 0xe0, 0x43, 0x74, 0x2c, 0xb0, 0x30, 0x21, 0x94, 0x20, 0xf1, 0x35, 0x90, 0xef, - 0x4f, 0x9a, 0xca, 0x8e, 0x92, 0x2e, 0xd1, 0xd9, 0xef, 0xf3, 0x3c, 0xef, 0xcf, 0xf7, 0xbe, 0x0a, - 0xbc, 0x92, 0xf0, 0x3d, 0x99, 0xf2, 0x28, 0x22, 0x62, 0x94, 0x24, 0x51, 0xc8, 0x52, 0xb2, 0x3f, - 0x62, 0xe9, 0x01, 0x4e, 0x52, 0x2e, 0x39, 0xda, 0xb0, 0x65, 0x6c, 0xcb, 0xf5, 0x0d, 0x3a, 0x0c, - 0x63, 0x4e, 0xd4, 0xaf, 0x56, 0xd5, 0x2b, 0x01, 0x0f, 0xb8, 0x3a, 0x92, 0xec, 0x64, 0xde, 0x5e, - 0x0e, 0x38, 0x0f, 0x22, 0x46, 0x68, 0x12, 0x12, 0x1a, 0xc7, 0x5c, 0x52, 0x19, 0xf2, 0x58, 0x98, - 0x6a, 0xad, 0xcf, 0xc5, 0x90, 0x8b, 0xe7, 0xda, 0xa6, 0x1f, 0x4c, 0xa9, 0xa5, 0x9f, 0x88, 0x4f, - 0x05, 0xd3, 0x34, 0xe4, 0x45, 0xdb, 0x67, 0x92, 0xb6, 0x49, 0x42, 0x83, 0x30, 0x56, 0x39, 0x46, - 0xeb, 0xcc, 0x6a, 0xad, 0xaa, 0xcf, 0xc3, 0x69, 0x3d, 0xff, 0x7d, 0x09, 0x4d, 0xe9, 0x50, 0xe4, - 0xeb, 0xbb, 0x34, 0x65, 0x83, 0xa9, 0x4c, 0xd7, 0xdd, 0x0a, 0x44, 0x4f, 0x32, 0x82, 0x1d, 0x65, - 0xf2, 0xd8, 0xfe, 0x88, 0x09, 0xe9, 0xf6, 0xe0, 0xc5, 0x13, 0x6f, 0x45, 0xc2, 0x63, 0xc1, 0xd0, - 0x03, 0x58, 0xd6, 0xe1, 0x55, 0x70, 0x0d, 0x34, 0xcf, 0x77, 0x6a, 0x38, 0x77, 0x7d, 0x58, 0x5b, - 0xba, 0xeb, 0x87, 0xbf, 0xaf, 0x96, 0xbe, 0xfc, 0xfb, 0xda, 0x02, 0x9e, 0xf1, 0xb8, 0x8f, 0xe1, - 0x25, 0x15, 0xba, 0xcd, 0x64, 0xcf, 0xa8, 0x4d, 0x3f, 0xd4, 0x81, 0xe7, 0xe8, 0x60, 0x90, 0x32, - 0xa1, 0x93, 0xd7, 0xbb, 0xd5, 0x1f, 0xdf, 0x36, 0x2b, 0xe6, 0xd2, 0xb6, 0x74, 0xa5, 0x27, 0xd3, - 0x30, 0x0e, 0x3c, 0x2b, 0x74, 0x9f, 0xc2, 0x6a, 0x3e, 0xce, 0x80, 0xde, 0x87, 0x6b, 0x16, 0xa8, - 0x00, 0x55, 0x5d, 0x04, 0xb6, 0xa6, 0xee, 0x99, 0x0c, 0xd5, 0x9b, 0x1a, 0x5c, 0xdf, 0x04, 0x6f, - 0x45, 0x91, 0xd5, 0xd8, 0x8b, 0x41, 0x0f, 0x21, 0x3c, 0x1e, 0x91, 0x89, 0x6e, 0x60, 0x03, 0x9a, - 0xcd, 0x08, 0xeb, 0xed, 0x32, 0x93, 0xc2, 0x3b, 0x34, 0x60, 0xc6, 0xeb, 0xcd, 0x38, 0xdd, 0xcf, - 0x00, 0xd6, 0x0a, 0x9a, 0x14, 0xe2, 0xaf, 0x9e, 0x0a, 0x1f, 0x6d, 0x9f, 0x40, 0x5c, 0x51, 0x88, - 0x37, 0x16, 0x22, 0xea, 0xce, 0xb3, 0x8c, 0x9d, 0xef, 0xab, 0xf0, 0xac, 0x62, 0x44, 0xef, 0x00, - 0x2c, 0xeb, 0xb9, 0xa2, 0xeb, 0x05, 0x23, 0xcf, 0x2f, 0x50, 0xbd, 0xb1, 0x48, 0xa6, 0xfb, 0xb9, - 0xf8, 0xed, 0xcf, 0xbf, 0x1f, 0x56, 0x9a, 0xa8, 0x41, 0x32, 0xfd, 0x66, 0xcc, 0xe4, 0x4b, 0x9e, - 0xee, 0x91, 0x79, 0x4b, 0x8d, 0x3e, 0x01, 0xb8, 0x66, 0xbf, 0x1c, 0xb5, 0xe6, 0x35, 0xc9, 0x6f, - 0x58, 0xfd, 0xe6, 0x52, 0x5a, 0x43, 0x75, 0x4f, 0x51, 0xdd, 0x45, 0x9d, 0x45, 0x54, 0xd3, 0xc3, - 0x6b, 0xb3, 0x95, 0x6f, 0xd0, 0x47, 0x00, 0x2f, 0xcc, 0x0e, 0x15, 0xcd, 0xed, 0x5c, 0xb0, 0x5f, - 0xf5, 0x5b, 0xcb, 0x89, 0x0d, 0xe7, 0x6d, 0xc5, 0xd9, 0x42, 0xcd, 0x65, 0x39, 0xbb, 0x8f, 0x0e, - 0xc7, 0x0e, 0x38, 0x1a, 0x3b, 0xe0, 0xcf, 0xd8, 0x01, 0xef, 0x27, 0x4e, 0xe9, 0x68, 0xe2, 0x94, - 0x7e, 0x4d, 0x9c, 0xd2, 0xb3, 0x76, 0x10, 0xca, 0xdd, 0x91, 0x8f, 0xfb, 0x7c, 0x38, 0x27, 0xed, - 0xd5, 0x71, 0x9e, 0x3c, 0x48, 0x98, 0xf0, 0xcb, 0xea, 0x2f, 0xe4, 0xce, 0xff, 0x00, 0x00, 0x00, - 0xff, 0xff, 0x26, 0x84, 0xa3, 0xba, 0x64, 0x05, 0x00, 0x00, + // 564 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x94, 0x31, 0x6f, 0x13, 0x31, + 0x14, 0xc7, 0xe3, 0x16, 0xaa, 0xd6, 0x20, 0x41, 0x4d, 0x24, 0x92, 0x08, 0x0e, 0x74, 0x12, 0x21, + 0x0a, 0xd4, 0x26, 0x65, 0x2c, 0x0c, 0x4d, 0x25, 0x3a, 0xb0, 0x94, 0x64, 0x40, 0x62, 0xa0, 0x72, + 0x12, 0xeb, 0x7a, 0xea, 0xe5, 0xec, 0xda, 0x0e, 0x50, 0x21, 0x16, 0x16, 0x56, 0x24, 0x46, 0x26, + 0xb6, 0x8e, 0x0c, 0x7c, 0x88, 0x8e, 0x15, 0x2c, 0x88, 0x01, 0xa1, 0x04, 0x89, 0xaf, 0x81, 0xce, + 0xf6, 0xa5, 0x29, 0x77, 0x51, 0xc2, 0x12, 0xf9, 0xfc, 0xfe, 0xff, 0xf7, 0x7e, 0x7e, 0xef, 0x29, + 0xf0, 0xba, 0xe0, 0xfb, 0x5a, 0xf2, 0x28, 0x22, 0x6a, 0x20, 0x44, 0x14, 0x32, 0x49, 0x0e, 0x06, + 0x4c, 0x1e, 0x62, 0x21, 0xb9, 0xe6, 0x68, 0x35, 0x0d, 0xe3, 0x34, 0x5c, 0x59, 0xa5, 0xfd, 0x30, + 0xe6, 0xc4, 0xfc, 0x5a, 0x55, 0xa5, 0x18, 0xf0, 0x80, 0x9b, 0x23, 0x49, 0x4e, 0xee, 0xf6, 0x5a, + 0xc0, 0x79, 0x10, 0x31, 0x42, 0x45, 0x48, 0x68, 0x1c, 0x73, 0x4d, 0x75, 0xc8, 0x63, 0xe5, 0xa2, + 0xe5, 0x2e, 0x57, 0x7d, 0xae, 0x76, 0xad, 0xcd, 0x7e, 0xb8, 0x50, 0xdd, 0x7e, 0x91, 0x0e, 0x55, + 0xcc, 0xd2, 0x90, 0x17, 0x8d, 0x0e, 0xd3, 0xb4, 0x41, 0x04, 0x0d, 0xc2, 0xd8, 0xe4, 0x71, 0x5a, + 0x6f, 0x52, 0x9b, 0xaa, 0xba, 0x3c, 0x1c, 0xc7, 0xb3, 0xef, 0x13, 0x54, 0xd2, 0xbe, 0xca, 0xc6, + 0xf7, 0xa8, 0x64, 0xbd, 0xb1, 0xcc, 0xc6, 0xfd, 0x22, 0x44, 0x4f, 0x12, 0x82, 0x1d, 0x63, 0x6a, + 0xb1, 0x83, 0x01, 0x53, 0xda, 0x6f, 0xc3, 0x2b, 0x67, 0x6e, 0x95, 0xe0, 0xb1, 0x62, 0xe8, 0x01, + 0x5c, 0xb2, 0xc9, 0x4b, 0xe0, 0x26, 0xa8, 0x5d, 0x58, 0x2f, 0xe3, 0x4c, 0xfb, 0xb0, 0xb5, 0x34, + 0x57, 0x8e, 0x7f, 0xde, 0x28, 0x1c, 0xfd, 0xf9, 0x5c, 0x07, 0x2d, 0xe7, 0xf1, 0x9f, 0xc3, 0xab, + 0x26, 0xe9, 0x36, 0xd3, 0x6d, 0xa7, 0x76, 0xf5, 0xd0, 0x16, 0xbc, 0xcc, 0x05, 0x93, 0x54, 0x73, + 0xb9, 0x4b, 0x7b, 0x3d, 0xc9, 0x94, 0x2d, 0xb1, 0xd2, 0x2c, 0x7d, 0xfd, 0xb2, 0x56, 0x74, 0xdd, + 0xdb, 0xb4, 0x91, 0xb6, 0x96, 0x61, 0x1c, 0xb4, 0x2e, 0xa5, 0x0e, 0x77, 0xed, 0x3f, 0x85, 0xa5, + 0x6c, 0x7e, 0x47, 0xbe, 0x01, 0x97, 0x53, 0xc2, 0x1c, 0x76, 0xd3, 0x19, 0x9c, 0x9a, 0x9a, 0xe7, + 0x12, 0xf6, 0xd6, 0xd8, 0xe0, 0x77, 0x5c, 0xe2, 0xcd, 0x28, 0x4a, 0x35, 0x69, 0xa7, 0xd0, 0x23, + 0x08, 0x4f, 0x67, 0xe6, 0x52, 0x57, 0xb1, 0x03, 0x4e, 0x86, 0x86, 0xed, 0xba, 0xb9, 0xd1, 0xe1, + 0x1d, 0x1a, 0x30, 0xe7, 0x6d, 0x4d, 0x38, 0xfd, 0x4f, 0x00, 0x96, 0x73, 0x8a, 0xe4, 0xe2, 0x2f, + 0xfe, 0x17, 0x3e, 0xda, 0x3e, 0x83, 0xb8, 0x60, 0x10, 0x6f, 0xcf, 0x44, 0xb4, 0x95, 0x27, 0x19, + 0xd7, 0x7f, 0x2c, 0xc2, 0xf3, 0x86, 0x11, 0xbd, 0x03, 0x70, 0xc9, 0x0e, 0x1a, 0xdd, 0xca, 0xd9, + 0x81, 0xec, 0x46, 0x55, 0xaa, 0xb3, 0x64, 0xb6, 0x9e, 0x8f, 0xdf, 0x7e, 0xfb, 0xfd, 0x61, 0xa1, + 0x86, 0xaa, 0x24, 0xd1, 0xaf, 0xc5, 0x4c, 0xbf, 0xe4, 0x72, 0x9f, 0x4c, 0xdb, 0x72, 0x74, 0x04, + 0xe0, 0x72, 0xfa, 0x72, 0x54, 0x9f, 0x56, 0x24, 0xbb, 0x72, 0x95, 0x3b, 0x73, 0x69, 0x1d, 0xd5, + 0x96, 0xa1, 0x7a, 0x88, 0x36, 0x66, 0x51, 0x8d, 0x0f, 0xaf, 0xff, 0xdd, 0xe7, 0x37, 0xe8, 0x23, + 0x80, 0x17, 0x27, 0xa7, 0x8b, 0xa6, 0x22, 0xe4, 0x2c, 0x5a, 0xe5, 0xee, 0x7c, 0x62, 0x07, 0x7c, + 0xcf, 0x00, 0xd7, 0x51, 0x6d, 0x5e, 0xe0, 0xe6, 0xe3, 0xe3, 0xa1, 0x07, 0x4e, 0x86, 0x1e, 0xf8, + 0x35, 0xf4, 0xc0, 0xfb, 0x91, 0x57, 0x38, 0x19, 0x79, 0x85, 0xef, 0x23, 0xaf, 0xf0, 0xac, 0x11, + 0x84, 0x7a, 0x6f, 0xd0, 0xc1, 0x5d, 0xde, 0x9f, 0x92, 0xed, 0xd5, 0x69, 0x3e, 0x7d, 0x28, 0x98, + 0xea, 0x2c, 0x99, 0x3f, 0x97, 0xfb, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x20, 0x1b, 0x4b, 0x4a, + 0x7e, 0x05, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -583,10 +584,10 @@ func (m *QueryGetSupplierRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) _ = i var l int _ = l - if len(m.Address) > 0 { - i -= len(m.Address) - copy(dAtA[i:], m.Address) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Address))) + if len(m.OperatorAddress) > 0 { + i -= len(m.OperatorAddress) + copy(dAtA[i:], m.OperatorAddress) + i = encodeVarintQuery(dAtA, i, uint64(len(m.OperatorAddress))) i-- dAtA[i] = 0xa } @@ -747,7 +748,7 @@ func (m *QueryGetSupplierRequest) Size() (n int) { } var l int _ = l - l = len(m.Address) + l = len(m.OperatorAddress) if l > 0 { n += 1 + l + sovQuery(uint64(l)) } @@ -967,7 +968,7 @@ func (m *QueryGetSupplierRequest) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field OperatorAddress", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -995,7 +996,7 @@ func (m *QueryGetSupplierRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Address = string(dAtA[iNdEx:postIndex]) + m.OperatorAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex diff --git a/x/supplier/types/query.pb.gw.go b/x/supplier/types/query.pb.gw.go index fef4e1a84..2114c1d77 100644 --- a/x/supplier/types/query.pb.gw.go +++ b/x/supplier/types/query.pb.gw.go @@ -62,15 +62,15 @@ func request_Query_Supplier_0(ctx context.Context, marshaler runtime.Marshaler, _ = err ) - val, ok = pathParams["address"] + val, ok = pathParams["operator_address"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "address") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "operator_address") } - protoReq.Address, err = runtime.String(val) + protoReq.OperatorAddress, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "operator_address", err) } msg, err := client.Supplier(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) @@ -89,15 +89,15 @@ func local_request_Query_Supplier_0(ctx context.Context, marshaler runtime.Marsh _ = err ) - val, ok = pathParams["address"] + val, ok = pathParams["operator_address"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "address") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "operator_address") } - protoReq.Address, err = runtime.String(val) + protoReq.OperatorAddress, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "operator_address", err) } msg, err := server.Supplier(ctx, &protoReq) @@ -323,7 +323,7 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie var ( pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"pokt-network", "poktroll", "supplier", "params"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_Supplier_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"pokt-network", "poktroll", "supplier", "address"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_Supplier_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"pokt-network", "poktroll", "supplier", "operator_address"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_AllSuppliers_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 2}, []string{"pokt-network", "poktroll", "supplier"}, "", runtime.AssumeColonVerbOpt(false))) ) diff --git a/x/supplier/types/tx.pb.go b/x/supplier/types/tx.pb.go index d7031afc5..1a396301a 100644 --- a/x/supplier/types/tx.pb.go +++ b/x/supplier/types/tx.pb.go @@ -128,11 +128,11 @@ func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo type MsgStakeSupplier struct { - Signer string `protobuf:"bytes,1,opt,name=signer,proto3" json:"signer,omitempty"` - OwnerAddress string `protobuf:"bytes,2,opt,name=owner_address,json=ownerAddress,proto3" json:"owner_address,omitempty"` - Address string `protobuf:"bytes,3,opt,name=address,proto3" json:"address,omitempty"` - Stake *types.Coin `protobuf:"bytes,4,opt,name=stake,proto3" json:"stake,omitempty"` - Services []*types1.SupplierServiceConfig `protobuf:"bytes,5,rep,name=services,proto3" json:"services,omitempty"` + Signer string `protobuf:"bytes,1,opt,name=signer,proto3" json:"signer,omitempty"` + OwnerAddress string `protobuf:"bytes,2,opt,name=owner_address,json=ownerAddress,proto3" json:"owner_address,omitempty"` + OperatorAddress string `protobuf:"bytes,3,opt,name=operator_address,json=operatorAddress,proto3" json:"operator_address,omitempty"` + Stake *types.Coin `protobuf:"bytes,4,opt,name=stake,proto3" json:"stake,omitempty"` + Services []*types1.SupplierServiceConfig `protobuf:"bytes,5,rep,name=services,proto3" json:"services,omitempty"` } func (m *MsgStakeSupplier) Reset() { *m = MsgStakeSupplier{} } @@ -182,9 +182,9 @@ func (m *MsgStakeSupplier) GetOwnerAddress() string { return "" } -func (m *MsgStakeSupplier) GetAddress() string { +func (m *MsgStakeSupplier) GetOperatorAddress() string { if m != nil { - return m.Address + return m.OperatorAddress } return "" } @@ -240,8 +240,8 @@ func (m *MsgStakeSupplierResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgStakeSupplierResponse proto.InternalMessageInfo type MsgUnstakeSupplier struct { - Signer string `protobuf:"bytes,1,opt,name=signer,proto3" json:"signer,omitempty"` - Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` + Signer string `protobuf:"bytes,1,opt,name=signer,proto3" json:"signer,omitempty"` + OperatorAddress string `protobuf:"bytes,2,opt,name=operator_address,json=operatorAddress,proto3" json:"operator_address,omitempty"` } func (m *MsgUnstakeSupplier) Reset() { *m = MsgUnstakeSupplier{} } @@ -284,9 +284,9 @@ func (m *MsgUnstakeSupplier) GetSigner() string { return "" } -func (m *MsgUnstakeSupplier) GetAddress() string { +func (m *MsgUnstakeSupplier) GetOperatorAddress() string { if m != nil { - return m.Address + return m.OperatorAddress } return "" } @@ -339,44 +339,44 @@ func init() { func init() { proto.RegisterFile("poktroll/supplier/tx.proto", fileDescriptor_63b974929807ef57) } var fileDescriptor_63b974929807ef57 = []byte{ - // 579 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x54, 0x3f, 0x8f, 0x12, 0x4f, - 0x18, 0x66, 0xe1, 0x07, 0x3f, 0x19, 0xee, 0x72, 0xde, 0xe4, 0x92, 0x5b, 0x36, 0xba, 0x12, 0x2e, - 0x1a, 0x82, 0x61, 0x47, 0x30, 0xb9, 0xe2, 0xa2, 0x85, 0x5c, 0x69, 0x48, 0x0c, 0xc4, 0xc6, 0xc2, - 0xcb, 0x00, 0xe3, 0xb0, 0x01, 0x76, 0x36, 0x33, 0x03, 0x77, 0xd7, 0x19, 0x1b, 0x13, 0x2b, 0x3f, - 0x86, 0x25, 0x85, 0x85, 0x56, 0xb6, 0x57, 0x5e, 0xac, 0xac, 0x8c, 0x81, 0x82, 0xaf, 0x61, 0x76, - 0x77, 0x06, 0x8e, 0x3f, 0x0a, 0x89, 0x0d, 0xb0, 0xf3, 0x3c, 0xcf, 0xfb, 0x3e, 0xef, 0x33, 0xef, - 0x02, 0x2c, 0x9f, 0x75, 0x25, 0x67, 0xbd, 0x1e, 0x12, 0x03, 0xdf, 0xef, 0xb9, 0x84, 0x23, 0x79, - 0xe1, 0xf8, 0x9c, 0x49, 0x06, 0xf7, 0x35, 0xe6, 0x68, 0xcc, 0xda, 0xc7, 0x7d, 0xd7, 0x63, 0x28, - 0xfc, 0x8c, 0x58, 0xd6, 0x61, 0x8b, 0x89, 0x3e, 0x13, 0xa8, 0x2f, 0x28, 0x1a, 0x96, 0x83, 0x2f, - 0x05, 0x64, 0x23, 0xe0, 0x2c, 0x7c, 0x42, 0xd1, 0x83, 0x82, 0x0e, 0x28, 0xa3, 0x2c, 0x3a, 0x0f, - 0x7e, 0xa9, 0x53, 0x5b, 0x55, 0x6a, 0x62, 0x41, 0xd0, 0xb0, 0xdc, 0x24, 0x12, 0x97, 0x51, 0x8b, - 0xb9, 0x9e, 0xc6, 0x57, 0xbd, 0xfa, 0x98, 0xe3, 0xbe, 0xae, 0x7a, 0x77, 0x8e, 0x77, 0x30, 0x27, - 0x6d, 0x24, 0x08, 0x1f, 0xba, 0x2d, 0x12, 0xc1, 0xf9, 0x6f, 0x06, 0xd8, 0xab, 0x09, 0xfa, 0xd2, - 0x6f, 0x63, 0x49, 0x5e, 0x84, 0x42, 0x78, 0x0c, 0xd2, 0x78, 0x20, 0x3b, 0x8c, 0xbb, 0xf2, 0xd2, - 0x34, 0x72, 0x46, 0x21, 0x5d, 0x35, 0xbf, 0x7f, 0x2e, 0x1d, 0x28, 0xb7, 0xcf, 0xda, 0x6d, 0x4e, - 0x84, 0x68, 0x48, 0xee, 0x7a, 0xb4, 0x3e, 0xa7, 0xc2, 0x27, 0x20, 0x15, 0xb5, 0x36, 0xe3, 0x39, - 0xa3, 0x90, 0xa9, 0x64, 0x9d, 0x95, 0xac, 0x9c, 0xa8, 0x45, 0x35, 0x7d, 0xf5, 0xf3, 0x5e, 0xec, - 0xd3, 0x74, 0x54, 0x34, 0xea, 0x4a, 0x73, 0x72, 0xfc, 0x6e, 0x3a, 0x2a, 0xce, 0xab, 0x7d, 0x98, - 0x8e, 0x8a, 0x47, 0x33, 0xef, 0x17, 0xf3, 0xe9, 0x96, 0xdc, 0xe6, 0xb3, 0xe0, 0x70, 0xe9, 0xa8, - 0x4e, 0x84, 0xcf, 0x3c, 0x41, 0xf2, 0x5f, 0xe3, 0xe0, 0x76, 0x4d, 0xd0, 0x86, 0xc4, 0x5d, 0xd2, - 0x50, 0x7a, 0xf8, 0x08, 0xa4, 0x84, 0x4b, 0x3d, 0xc2, 0x37, 0x8e, 0xa6, 0x78, 0xf0, 0x29, 0xd8, - 0x65, 0xe7, 0x1e, 0xe1, 0x67, 0x38, 0x82, 0xc3, 0xf1, 0xfe, 0x26, 0xdc, 0x09, 0xe9, 0xea, 0x0c, - 0x56, 0xc0, 0xff, 0x5a, 0x98, 0xd8, 0x20, 0xd4, 0x44, 0x88, 0x40, 0x52, 0x04, 0xae, 0xcd, 0xff, - 0x54, 0x92, 0x8a, 0x1e, 0x6c, 0x81, 0xa3, 0xb6, 0xc0, 0x39, 0x65, 0xae, 0x57, 0x8f, 0x78, 0xb0, - 0x0a, 0x6e, 0xa9, 0x8b, 0x15, 0x66, 0x32, 0x97, 0x28, 0x64, 0x2a, 0x0f, 0x6e, 0xa4, 0x1f, 0xde, - 0xbc, 0xa3, 0x23, 0x68, 0x44, 0xc4, 0x53, 0xe6, 0xbd, 0x71, 0x69, 0x7d, 0xa6, 0x3b, 0xc9, 0x04, - 0x37, 0xa0, 0x86, 0xce, 0x5b, 0xc0, 0x5c, 0x8e, 0x6e, 0x96, 0xeb, 0x7b, 0x03, 0xc0, 0x20, 0x73, - 0x4f, 0xfc, 0x63, 0xb2, 0x37, 0xa2, 0x89, 0x6f, 0x19, 0xcd, 0xa2, 0xcb, 0x3b, 0xc0, 0x5a, 0x35, - 0xa2, 0x7d, 0x56, 0xbe, 0xc4, 0x41, 0xa2, 0x26, 0x28, 0x7c, 0x0d, 0x76, 0x16, 0x16, 0x3c, 0xbf, - 0x66, 0x31, 0x97, 0x76, 0xc8, 0x2a, 0x6e, 0xe6, 0xe8, 0x3e, 0x10, 0x83, 0xdd, 0xc5, 0x1d, 0x3b, - 0x5a, 0x2f, 0x5e, 0x20, 0x59, 0x0f, 0xb7, 0x20, 0xcd, 0x5a, 0x50, 0xb0, 0xb7, 0x1c, 0xf7, 0xfd, - 0x3f, 0x38, 0x5c, 0xa4, 0x59, 0xa5, 0xad, 0x68, 0xba, 0x91, 0x95, 0x7c, 0x1b, 0xbc, 0x95, 0xd5, - 0xe7, 0x57, 0x63, 0xdb, 0xb8, 0x1e, 0xdb, 0xc6, 0xaf, 0xb1, 0x6d, 0x7c, 0x9c, 0xd8, 0xb1, 0xeb, - 0x89, 0x1d, 0xfb, 0x31, 0xb1, 0x63, 0xaf, 0xca, 0xd4, 0x95, 0x9d, 0x41, 0xd3, 0x69, 0xb1, 0x3e, - 0x0a, 0x2a, 0x97, 0x3c, 0x22, 0xcf, 0x19, 0xef, 0xa2, 0x75, 0x2f, 0xab, 0xbc, 0xf4, 0x89, 0x68, - 0xa6, 0xc2, 0xff, 0x9a, 0xc7, 0xbf, 0x03, 0x00, 0x00, 0xff, 0xff, 0x8e, 0xd0, 0xb8, 0xad, 0x58, - 0x05, 0x00, 0x00, + // 585 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x54, 0x31, 0x8f, 0x12, 0x41, + 0x18, 0x65, 0x41, 0x88, 0x0c, 0x77, 0xe1, 0x6e, 0x73, 0xc9, 0x2d, 0x1b, 0x5d, 0x09, 0x17, 0x0d, + 0xc1, 0xb0, 0x23, 0x98, 0x5c, 0x71, 0xd1, 0x42, 0x28, 0x0d, 0x89, 0x81, 0xd8, 0x58, 0x78, 0x19, + 0x60, 0x1c, 0x36, 0xc0, 0xce, 0x66, 0x66, 0xe0, 0xee, 0x3a, 0x63, 0x69, 0x65, 0xe9, 0x4f, 0xb0, + 0xa4, 0xb0, 0xb0, 0xb3, 0xbd, 0x58, 0x5d, 0xac, 0xac, 0x8c, 0x81, 0x82, 0xbf, 0x61, 0x76, 0x77, + 0x06, 0x64, 0x41, 0x39, 0x73, 0x0d, 0x30, 0xf3, 0xde, 0xfb, 0xbe, 0x37, 0x6f, 0xbe, 0x01, 0x98, + 0x1e, 0xed, 0x0b, 0x46, 0x07, 0x03, 0xc8, 0x47, 0x9e, 0x37, 0x70, 0x30, 0x83, 0xe2, 0xdc, 0xf6, + 0x18, 0x15, 0x54, 0xdf, 0x57, 0x98, 0xad, 0x30, 0x73, 0x1f, 0x0d, 0x1d, 0x97, 0xc2, 0xe0, 0x33, + 0x64, 0x99, 0x87, 0x1d, 0xca, 0x87, 0x94, 0xc3, 0x21, 0x27, 0x70, 0x5c, 0xf1, 0xbf, 0x24, 0x90, + 0x0b, 0x81, 0xd3, 0x60, 0x05, 0xc3, 0x85, 0x84, 0x0e, 0x08, 0x25, 0x34, 0xdc, 0xf7, 0x7f, 0xc9, + 0x5d, 0x4b, 0x56, 0x6a, 0x23, 0x8e, 0xe1, 0xb8, 0xd2, 0xc6, 0x02, 0x55, 0x60, 0x87, 0x3a, 0xae, + 0xc2, 0xd7, 0xbd, 0x7a, 0x88, 0xa1, 0xa1, 0xaa, 0x7a, 0x77, 0x89, 0xf7, 0x10, 0xc3, 0x5d, 0xc8, + 0x31, 0x1b, 0x3b, 0x1d, 0x1c, 0xc2, 0x85, 0xaf, 0x1a, 0xc8, 0x36, 0x38, 0x79, 0xe9, 0x75, 0x91, + 0xc0, 0x2f, 0x02, 0xa1, 0x7e, 0x0c, 0xd2, 0x68, 0x24, 0x7a, 0x94, 0x39, 0xe2, 0xc2, 0xd0, 0xf2, + 0x5a, 0x31, 0x5d, 0x33, 0xbe, 0x7f, 0x2e, 0x1f, 0x48, 0xb7, 0xcf, 0xba, 0x5d, 0x86, 0x39, 0x6f, + 0x09, 0xe6, 0xb8, 0xa4, 0xb9, 0xa4, 0xea, 0x4f, 0x40, 0x2a, 0x6c, 0x6d, 0xc4, 0xf3, 0x5a, 0x31, + 0x53, 0xcd, 0xd9, 0x6b, 0x59, 0xd9, 0x61, 0x8b, 0x5a, 0xfa, 0xf2, 0xe7, 0xbd, 0xd8, 0xa7, 0xf9, + 0xa4, 0xa4, 0x35, 0xa5, 0xe6, 0xe4, 0xf8, 0xdd, 0x7c, 0x52, 0x5a, 0x56, 0x7b, 0x3f, 0x9f, 0x94, + 0x8e, 0x16, 0xde, 0xcf, 0x97, 0xa7, 0x8b, 0xb8, 0x2d, 0xe4, 0xc0, 0x61, 0x64, 0xab, 0x89, 0xb9, + 0x47, 0x5d, 0x8e, 0x0b, 0xdf, 0xe2, 0x60, 0xaf, 0xc1, 0x49, 0x4b, 0xa0, 0x3e, 0x6e, 0x49, 0xbd, + 0xfe, 0x08, 0xa4, 0xb8, 0x43, 0x5c, 0xcc, 0xb6, 0x1e, 0x4d, 0xf2, 0xf4, 0xa7, 0x60, 0x97, 0x9e, + 0xb9, 0x98, 0x9d, 0xa2, 0x10, 0x0e, 0x8e, 0xf7, 0x2f, 0xe1, 0x4e, 0x40, 0x97, 0x7b, 0x7a, 0x1d, + 0xec, 0x51, 0x0f, 0x33, 0x24, 0xe8, 0xb2, 0x42, 0x62, 0x4b, 0x85, 0xac, 0x52, 0xa8, 0x22, 0x10, + 0x24, 0xb9, 0x7f, 0x0c, 0xe3, 0x96, 0x8c, 0x56, 0xca, 0xfc, 0xb1, 0xb0, 0xe5, 0x58, 0xd8, 0x75, + 0xea, 0xb8, 0xcd, 0x90, 0xa7, 0xd7, 0xc0, 0x6d, 0x79, 0xd3, 0xdc, 0x48, 0xe6, 0x13, 0xc5, 0x4c, + 0xf5, 0xc1, 0x1f, 0xd7, 0x11, 0x8c, 0x82, 0xad, 0x32, 0x69, 0x85, 0xc4, 0x3a, 0x75, 0xdf, 0x38, + 0xa4, 0xb9, 0xd0, 0x9d, 0x64, 0xfc, 0x2b, 0x91, 0x29, 0x14, 0x4c, 0x60, 0x44, 0xb3, 0x5c, 0x04, + 0xfd, 0x51, 0x03, 0xba, 0x7f, 0x09, 0x2e, 0xbf, 0x61, 0xd4, 0x9b, 0xb2, 0x8a, 0xff, 0x67, 0x56, + 0xab, 0xb6, 0xef, 0x00, 0x73, 0xdd, 0x99, 0x32, 0x5e, 0xfd, 0x12, 0x07, 0x89, 0x06, 0x27, 0xfa, + 0x6b, 0xb0, 0xb3, 0xf2, 0x04, 0x0a, 0x1b, 0x46, 0x37, 0x32, 0x65, 0x66, 0x69, 0x3b, 0x47, 0xf5, + 0xd1, 0x11, 0xd8, 0x5d, 0x9d, 0xc2, 0xa3, 0xcd, 0xe2, 0x15, 0x92, 0xf9, 0xf0, 0x1a, 0xa4, 0x45, + 0x0b, 0x02, 0xb2, 0xd1, 0xfc, 0xef, 0xff, 0xc5, 0xe1, 0x2a, 0xcd, 0x2c, 0x5f, 0x8b, 0xa6, 0x1a, + 0x99, 0xc9, 0xb7, 0xfe, 0xbb, 0xad, 0x3d, 0xbf, 0x9c, 0x5a, 0xda, 0xd5, 0xd4, 0xd2, 0x7e, 0x4d, + 0x2d, 0xed, 0xc3, 0xcc, 0x8a, 0x5d, 0xcd, 0xac, 0xd8, 0x8f, 0x99, 0x15, 0x7b, 0x55, 0x21, 0x8e, + 0xe8, 0x8d, 0xda, 0x76, 0x87, 0x0e, 0xa1, 0x5f, 0xb9, 0xec, 0x62, 0x71, 0x46, 0x59, 0x1f, 0x6e, + 0x7a, 0xce, 0xe2, 0xc2, 0xc3, 0xbc, 0x9d, 0x0a, 0xfe, 0x8d, 0x1e, 0xff, 0x0e, 0x00, 0x00, 0xff, + 0xff, 0x41, 0x76, 0x3c, 0x4b, 0x7a, 0x05, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -644,10 +644,10 @@ func (m *MsgStakeSupplier) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x22 } - if len(m.Address) > 0 { - i -= len(m.Address) - copy(dAtA[i:], m.Address) - i = encodeVarintTx(dAtA, i, uint64(len(m.Address))) + if len(m.OperatorAddress) > 0 { + i -= len(m.OperatorAddress) + copy(dAtA[i:], m.OperatorAddress) + i = encodeVarintTx(dAtA, i, uint64(len(m.OperatorAddress))) i-- dAtA[i] = 0x1a } @@ -711,10 +711,10 @@ func (m *MsgUnstakeSupplier) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.Address) > 0 { - i -= len(m.Address) - copy(dAtA[i:], m.Address) - i = encodeVarintTx(dAtA, i, uint64(len(m.Address))) + if len(m.OperatorAddress) > 0 { + i -= len(m.OperatorAddress) + copy(dAtA[i:], m.OperatorAddress) + i = encodeVarintTx(dAtA, i, uint64(len(m.OperatorAddress))) i-- dAtA[i] = 0x12 } @@ -800,7 +800,7 @@ func (m *MsgStakeSupplier) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } - l = len(m.Address) + l = len(m.OperatorAddress) if l > 0 { n += 1 + l + sovTx(uint64(l)) } @@ -836,7 +836,7 @@ func (m *MsgUnstakeSupplier) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } - l = len(m.Address) + l = len(m.OperatorAddress) if l > 0 { n += 1 + l + sovTx(uint64(l)) } @@ -1118,7 +1118,7 @@ func (m *MsgStakeSupplier) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field OperatorAddress", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1146,7 +1146,7 @@ func (m *MsgStakeSupplier) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Address = string(dAtA[iNdEx:postIndex]) + m.OperatorAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: if wireType != 2 { @@ -1352,7 +1352,7 @@ func (m *MsgUnstakeSupplier) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field OperatorAddress", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1380,7 +1380,7 @@ func (m *MsgUnstakeSupplier) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Address = string(dAtA[iNdEx:postIndex]) + m.OperatorAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex diff --git a/x/tokenomics/keeper/keeper_settle_pending_claims_test.go b/x/tokenomics/keeper/keeper_settle_pending_claims_test.go index 45f464689..680460ea4 100644 --- a/x/tokenomics/keeper/keeper_settle_pending_claims_test.go +++ b/x/tokenomics/keeper/keeper_settle_pending_claims_test.go @@ -53,7 +53,7 @@ type TestSuite struct { // - A keepertest.TokenomicsModuleKeepers to provide access to integrated keepers. // - An expectedComputeUnits which is the default proof_requirement_threshold. // - A claim that will require a proof via threshold, given the default proof params. -// - A proof which contains only the session header supplier address. +// - A proof which contains only the session header supplier operator address. func (s *TestSuite) SetupTest() { t := s.T() @@ -74,7 +74,7 @@ func (s *TestSuite) SetupTest() { // Create accounts in the account keeper with corresponding keys in the keyring // // for the applications and suppliers used in the tests. - supplierAddr := testkeyring.CreateOnChainAccount( + supplierOwnerAddr := testkeyring.CreateOnChainAccount( sdkCtx, t, "supplier", keyRing, @@ -98,10 +98,10 @@ func (s *TestSuite) SetupTest() { supplierStake := types.NewCoin("upokt", math.NewInt(1000000)) supplier := sharedtypes.Supplier{ - OwnerAddress: supplierAddr, - Address: supplierAddr, - Stake: &supplierStake, - Services: []*sharedtypes.SupplierServiceConfig{{Service: &service}}, + OwnerAddress: supplierOwnerAddr, + OperatorAddress: supplierOwnerAddr, + Stake: &supplierStake, + Services: []*sharedtypes.SupplierServiceConfig{{Service: &service}}, } s.keepers.SetSupplier(s.ctx, supplier) @@ -139,7 +139,7 @@ func (s *TestSuite) SetupTest() { sessionTree := testtree.NewFilledSessionTree( sdkCtx, t, s.numRelays, service.ComputeUnitsPerRelay, - "supplier", supplierAddr, + "supplier", supplierOwnerAddr, sessionHeader, sessionHeader, sessionHeader, keyRing, ringClient, @@ -154,7 +154,7 @@ func (s *TestSuite) SetupTest() { &sharedParams, sessionHeader.GetSessionEndBlockHeight(), blockHeaderHash, - supplierAddr, + supplierOwnerAddr, ) sdkCtx = sdkCtx.WithBlockHeight(claimMsgHeight).WithHeaderHash(blockHeaderHash) s.ctx = sdkCtx @@ -163,8 +163,8 @@ func (s *TestSuite) SetupTest() { require.NoError(t, err) // Prepare a claim that can be inserted - s.claim = *testtree.NewClaim(t, supplierAddr, sessionHeader, merkleRootBz) - s.proof = *testtree.NewProof(t, supplierAddr, sessionHeader, sessionTree, expectedMerkleProofPath) + s.claim = *testtree.NewClaim(t, supplierOwnerAddr, sessionHeader, merkleRootBz) + s.proof = *testtree.NewProof(t, supplierOwnerAddr, sessionHeader, sessionTree, expectedMerkleProofPath) } // TestSettleExpiringClaimsSuite tests the claim settlement process. @@ -525,7 +525,7 @@ func (s *TestSuite) TestSettlePendingClaims_ClaimPendingAfterSettlement() { sessionTwoClaim := testutilproof.BaseClaim( sessionOneClaim.GetSessionHeader().GetService().Id, sessionOneClaim.GetSessionHeader().GetApplicationAddress(), - sessionOneClaim.GetSupplierAddress(), + sessionOneClaim.GetSupplierOperatorAddress(), s.numRelays, ) diff --git a/x/tokenomics/keeper/settle_pending_claims.go b/x/tokenomics/keeper/settle_pending_claims.go index 1cafa3f4b..1666f4d37 100644 --- a/x/tokenomics/keeper/settle_pending_claims.go +++ b/x/tokenomics/keeper/settle_pending_claims.go @@ -64,7 +64,7 @@ func (k Keeper) SettlePendingClaims(ctx sdk.Context) ( sessionId := claim.SessionHeader.SessionId - proof, isProofFound := k.proofKeeper.GetProof(ctx, sessionId, claim.SupplierAddress) + proof, isProofFound := k.proofKeeper.GetProof(ctx, sessionId, claim.SupplierOperatorAddress) // Using the probabilistic proofs approach, determine if this expiring // claim required an on-chain proof proofRequirement, err = k.proofRequirementForClaim(ctx, &claim) @@ -74,7 +74,7 @@ func (k Keeper) SettlePendingClaims(ctx sdk.Context) ( logger = k.logger.With( "session_id", sessionId, - "supplier_address", claim.SupplierAddress, + "supplier_operator_address", claim.SupplierOperatorAddress, "num_claim_compute_units", numClaimComputeUnits, "num_relays_in_session_tree", numClaimRelays, "proof_requirement", proofRequirement, @@ -112,9 +112,9 @@ func (k Keeper) SettlePendingClaims(ctx sdk.Context) ( // The claim & proof are no longer necessary, so there's no need for them // to take up on-chain space. - k.proofKeeper.RemoveClaim(ctx, sessionId, claim.SupplierAddress) + k.proofKeeper.RemoveClaim(ctx, sessionId, claim.SupplierOperatorAddress) if isProofFound { - k.proofKeeper.RemoveProof(ctx, sessionId, claim.SupplierAddress) + k.proofKeeper.RemoveProof(ctx, sessionId, claim.SupplierOperatorAddress) } expiredResult.NumClaims++ @@ -158,13 +158,13 @@ func (k Keeper) SettlePendingClaims(ctx sdk.Context) ( // The claim & proof are no longer necessary, so there's no need for them // to take up on-chain space. - k.proofKeeper.RemoveClaim(ctx, sessionId, claim.SupplierAddress) + k.proofKeeper.RemoveClaim(ctx, sessionId, claim.SupplierOperatorAddress) // Whether or not the proof is required, the supplier may have submitted one // so we need to delete it either way. If we don't have the if structure, // a safe error will be printed, but it can be confusing to the operator // or developer. if isProofFound { - k.proofKeeper.RemoveProof(ctx, sessionId, claim.SupplierAddress) + k.proofKeeper.RemoveProof(ctx, sessionId, claim.SupplierOperatorAddress) } settledResult.NumClaims++ diff --git a/x/tokenomics/keeper/token_logic_modules.go b/x/tokenomics/keeper/token_logic_modules.go index 25794f7f4..fc88c3bd9 100644 --- a/x/tokenomics/keeper/token_logic_modules.go +++ b/x/tokenomics/keeper/token_logic_modules.go @@ -130,10 +130,10 @@ func (k Keeper) ProcessTokenLogicModules( return tokenomicstypes.ErrTokenomicsSessionHeaderInvalid } - // Retrieve the supplier address that will be getting rewarded; providing services - supplierAddr, err := cosmostypes.AccAddressFromBech32(claim.GetSupplierAddress()) - if err != nil || supplierAddr == nil { - return tokenomicstypes.ErrTokenomicsSupplierAddressInvalid + // Retrieve the supplier operator address that will be getting rewarded; providing services + supplierOperatorAddr, err := cosmostypes.AccAddressFromBech32(claim.GetSupplierOperatorAddress()) + if err != nil || supplierOperatorAddr == nil { + return tokenomicstypes.ErrTokenomicsSupplierOperatorAddressInvalid } // Retrieve the application address that is being charged; getting services @@ -161,9 +161,9 @@ func (k Keeper) ProcessTokenLogicModules( } // Retrieve the on-chain staked supplier record - supplier, isSupplierFound := k.supplierKeeper.GetSupplier(ctx, supplierAddr.String()) + supplier, isSupplierFound := k.supplierKeeper.GetSupplier(ctx, supplierOperatorAddr.String()) if !isSupplierFound { - logger.Warn(fmt.Sprintf("supplier for claim with address %q not found", supplierAddr)) + logger.Warn(fmt.Sprintf("supplier for claim with address %q not found", supplierOperatorAddr)) return tokenomicstypes.ErrTokenomicsSupplierNotFound } @@ -214,7 +214,7 @@ func (k Keeper) ProcessTokenLogicModules( "num_settlement_upokt", settlementCoin.Amount, "session_id", sessionHeader.GetSessionId(), "service_id", sessionHeader.GetService().Id, - "supplier", supplier.Address, + "supplier_operator", supplier.OperatorAddress, "application", application.Address, ) logger.Info(fmt.Sprintf("About to start processing TLMs for (%d) relays equaling to (%s) coins", numRelays, settlementCoin)) @@ -234,7 +234,7 @@ func (k Keeper) ProcessTokenLogicModules( // Update the suppliers's on-chain record k.supplierKeeper.SetSupplier(ctx, supplier) - logger.Info(fmt.Sprintf("updated on-chain supplier record with address %q", supplier.Address)) + logger.Info(fmt.Sprintf("updated on-chain supplier record with address %q", supplier.OperatorAddress)) // Update isSuccessful to true for telemetry isSuccessful = true @@ -281,13 +281,13 @@ func (k Keeper) TokenLogicModuleRelayBurnEqualsMint( ctx, suppliertypes.ModuleName, ownerAddr, sdk.NewCoins(settlementCoins), ); err != nil { return tokenomicstypes.ErrTokenomicsSupplierModuleSendFailed.Wrapf( - "sending (%s) to supplier with address %s: %v", + "sending (%s) to supplier with operator address %s: %v", settlementCoins, - supplier.Address, + supplier.OperatorAddress, err, ) } - logger.Info(fmt.Sprintf("sent (%v) from the supplier module to the supplier account with address %q", settlementCoins, supplier.Address)) + logger.Info(fmt.Sprintf("sent (%v) from the supplier module to the supplier account with operator address %q", settlementCoins, supplier.OperatorAddress)) // TODO_MAINNET: Decide on the behaviour here when an app is over serviced. // If an app has 10 POKT staked, but the supplier earned 20 POKT. We still @@ -361,7 +361,7 @@ func (k Keeper) TokenLogicModuleGlobalMint( if err != nil { return tokenomictypes.ErrTokenomicsSendingMindRewards.Wrapf("sending rewards to supplier: %v", err) } - logger.Debug(fmt.Sprintf("sent (%v) newley minted coins from the tokenomics module to the supplier with address %q", supplierCoins, supplier.Address)) + logger.Debug(fmt.Sprintf("sent (%v) newley minted coins from the tokenomics module to the supplier with operator address %q", supplierCoins, supplier.OperatorAddress)) // Send a portion of the rewards to the DAO daoCoins, err := k.sendRewardsToAccount(ctx, k.GetAuthority(), newMintAmtFloat, MintAllocationDAO) diff --git a/x/tokenomics/keeper/token_logic_modules_test.go b/x/tokenomics/keeper/token_logic_modules_test.go index 8959893fc..d80f825b5 100644 --- a/x/tokenomics/keeper/token_logic_modules_test.go +++ b/x/tokenomics/keeper/token_logic_modules_test.go @@ -56,9 +56,9 @@ func TestProcessTokenLogicModules_HandleAppGoingIntoDebt(t *testing.T) { // Add a new supplier supplierStake := cosmostypes.NewCoin("upokt", math.NewInt(1000000)) supplier := sharedtypes.Supplier{ - OwnerAddress: sample.AccAddress(), - Address: sample.AccAddress(), - Stake: &supplierStake, + OwnerAddress: sample.AccAddress(), + OperatorAddress: sample.AccAddress(), + Stake: &supplierStake, } keepers.SetSupplier(ctx, supplier) @@ -66,7 +66,7 @@ func TestProcessTokenLogicModules_HandleAppGoingIntoDebt(t *testing.T) { numRelays := appStake.Amount.Uint64() + 1 // More than the app stake numComputeUnits := numRelays * service.ComputeUnitsPerRelay claim := prooftypes.Claim{ - SupplierAddress: supplier.Address, + SupplierOperatorAddress: supplier.OperatorAddress, SessionHeader: &sessiontypes.SessionHeader{ ApplicationAddress: app.Address, Service: service, @@ -116,9 +116,9 @@ func TestProcessTokenLogicModules_ValidAccounting(t *testing.T) { // Add a new supplier. supplierStake := cosmostypes.NewCoin("upokt", math.NewInt(1000000)) supplier := sharedtypes.Supplier{ - OwnerAddress: sample.AccAddress(), - Address: sample.AccAddress(), - Stake: &supplierStake, + OwnerAddress: sample.AccAddress(), + OperatorAddress: sample.AccAddress(), + Stake: &supplierStake, } keepers.SetSupplier(ctx, supplier) @@ -128,7 +128,7 @@ func TestProcessTokenLogicModules_ValidAccounting(t *testing.T) { appModuleStartBalance := getBalance(t, ctx, keepers, appModuleAddress) // Query supplier balance prior to the accounting. - supplierStartBalance := getBalance(t, ctx, keepers, supplier.GetAddress()) + supplierStartBalance := getBalance(t, ctx, keepers, supplier.GetOwnerAddress()) // Query supplier module balance prior to the accounting. supplierModuleStartBalance := getBalance(t, ctx, keepers, supplierModuleAddress) @@ -137,7 +137,7 @@ func TestProcessTokenLogicModules_ValidAccounting(t *testing.T) { numRelays := numComputeUnits / service.ComputeUnitsPerRelay // The base claim whose root will be customized for testing purposes claim := prooftypes.Claim{ - SupplierAddress: supplier.Address, + SupplierOperatorAddress: supplier.OperatorAddress, SessionHeader: &sessiontypes.SessionHeader{ ApplicationAddress: app.Address, Service: service, @@ -174,8 +174,8 @@ func TestProcessTokenLogicModules_ValidAccounting(t *testing.T) { expectedSupplierBalance := supplierStartBalance.Add(expectedAppBurn) require.EqualValues(t, &expectedSupplierBalance, supplierOwnerEndBalance) - // Assert that `supplierAddress` staked balance is *unchanged* - supplier, supplierIsFound := keepers.GetSupplier(ctx, supplier.GetAddress()) + // Assert that `supplierOperatorAddress` staked balance is *unchanged* + supplier, supplierIsFound := keepers.GetSupplier(ctx, supplier.GetOperatorAddress()) require.True(t, supplierIsFound) require.Equal(t, &supplierStake, supplier.GetStake()) @@ -226,9 +226,9 @@ func TestProcessTokenLogicModules_AppStakeTooLow(t *testing.T) { // Add a new supplier. supplierStake := cosmostypes.NewCoin("upokt", math.NewInt(1000000)) supplier := sharedtypes.Supplier{ - OwnerAddress: sample.AccAddress(), - Address: sample.AccAddress(), - Stake: &supplierStake, + OwnerAddress: sample.AccAddress(), + OperatorAddress: sample.AccAddress(), + Stake: &supplierStake, } keepers.SetSupplier(ctx, supplier) @@ -245,7 +245,7 @@ func TestProcessTokenLogicModules_AppStakeTooLow(t *testing.T) { // The base claim whose root will be customized for testing purposes claim := prooftypes.Claim{ - SupplierAddress: supplier.Address, + SupplierOperatorAddress: supplier.OperatorAddress, SessionHeader: &sessiontypes.SessionHeader{ ApplicationAddress: app.Address, Service: service, @@ -282,8 +282,8 @@ func TestProcessTokenLogicModules_AppStakeTooLow(t *testing.T) { expectedSupplierBalance := supplierOwnerStartBalance.Add(expectedAppBurn) require.EqualValues(t, &expectedSupplierBalance, supplierOwnerEndBalance) - // Assert that `supplierAddress` staked balance is *unchanged* - supplier, supplierIsFound := keepers.GetSupplier(ctx, supplier.GetAddress()) + // Assert that `supplierOperatorAddress` staked balance is *unchanged* + supplier, supplierIsFound := keepers.GetSupplier(ctx, supplier.GetOperatorAddress()) require.True(t, supplierIsFound) require.Equal(t, &supplierStake, supplier.GetStake()) @@ -311,13 +311,13 @@ func TestProcessTokenLogicModules_AppStakeTooLow(t *testing.T) { } func TestProcessTokenLogicModules_AppNotFound(t *testing.T) { - keeper, ctx, _, supplierAddr, service := testkeeper.TokenomicsKeeperWithActorAddrs(t) + keeper, ctx, _, supplierOperatorAddr, service := testkeeper.TokenomicsKeeperWithActorAddrs(t) // The base claim whose root will be customized for testing purposes numRelays := uint64(42) numComputeUnits := numRelays * service.ComputeUnitsPerRelay claim := prooftypes.Claim{ - SupplierAddress: supplierAddr, + SupplierOperatorAddress: supplierOperatorAddr, SessionHeader: &sessiontypes.SessionHeader{ ApplicationAddress: sample.AccAddress(), // Random address Service: service, @@ -335,12 +335,12 @@ func TestProcessTokenLogicModules_AppNotFound(t *testing.T) { } func TestProcessTokenLogicModules_ServiceNotFound(t *testing.T) { - keeper, ctx, appAddr, supplierAddr, service := testkeeper.TokenomicsKeeperWithActorAddrs(t) + keeper, ctx, appAddr, supplierOperatorAddr, service := testkeeper.TokenomicsKeeperWithActorAddrs(t) numRelays := uint64(42) numComputeUnits := numRelays * service.ComputeUnitsPerRelay claim := prooftypes.Claim{ - SupplierAddress: supplierAddr, + SupplierOperatorAddress: supplierOperatorAddr, SessionHeader: &sessiontypes.SessionHeader{ ApplicationAddress: appAddr, Service: &sharedtypes.Service{ @@ -361,7 +361,7 @@ func TestProcessTokenLogicModules_ServiceNotFound(t *testing.T) { } func TestProcessTokenLogicModules_InvalidRoot(t *testing.T) { - keeper, ctx, appAddr, supplierAddr, service := testkeeper.TokenomicsKeeperWithActorAddrs(t) + keeper, ctx, appAddr, supplierOperatorAddr, service := testkeeper.TokenomicsKeeperWithActorAddrs(t) numRelays := uint64(42) // Define test cases @@ -414,7 +414,7 @@ func TestProcessTokenLogicModules_InvalidRoot(t *testing.T) { for _, test := range tests { t.Run(test.desc, func(t *testing.T) { // Setup claim by copying the testproof.BaseClaim and updating the root - claim := testproof.BaseClaim(service.Id, appAddr, supplierAddr, 0) + claim := testproof.BaseClaim(service.Id, appAddr, supplierOperatorAddr, 0) claim.RootHash = smt.MerkleRoot(test.root[:]) // Execute test function @@ -431,7 +431,7 @@ func TestProcessTokenLogicModules_InvalidRoot(t *testing.T) { } func TestProcessTokenLogicModules_InvalidClaim(t *testing.T) { - keeper, ctx, appAddr, supplierAddr, service := testkeeper.TokenomicsKeeperWithActorAddrs(t) + keeper, ctx, appAddr, supplierOperatorAddr, service := testkeeper.TokenomicsKeeperWithActorAddrs(t) numRelays := uint64(42) // Define test cases @@ -445,7 +445,7 @@ func TestProcessTokenLogicModules_InvalidClaim(t *testing.T) { { desc: "Valid Claim", claim: func() *prooftypes.Claim { - claim := testproof.BaseClaim(service.Id, appAddr, supplierAddr, numRelays) + claim := testproof.BaseClaim(service.Id, appAddr, supplierOperatorAddr, numRelays) return &claim }(), errExpected: false, @@ -459,7 +459,7 @@ func TestProcessTokenLogicModules_InvalidClaim(t *testing.T) { { desc: "Claim with nil session header", claim: func() *prooftypes.Claim { - claim := testproof.BaseClaim(service.Id, appAddr, supplierAddr, numRelays) + claim := testproof.BaseClaim(service.Id, appAddr, supplierOperatorAddr, numRelays) claim.SessionHeader = nil return &claim }(), @@ -469,7 +469,7 @@ func TestProcessTokenLogicModules_InvalidClaim(t *testing.T) { { desc: "Claim with invalid session id", claim: func() *prooftypes.Claim { - claim := testproof.BaseClaim(service.Id, appAddr, supplierAddr, numRelays) + claim := testproof.BaseClaim(service.Id, appAddr, supplierOperatorAddr, numRelays) claim.SessionHeader.SessionId = "" return &claim }(), @@ -479,7 +479,7 @@ func TestProcessTokenLogicModules_InvalidClaim(t *testing.T) { { desc: "Claim with invalid application address", claim: func() *prooftypes.Claim { - claim := testproof.BaseClaim(service.Id, appAddr, supplierAddr, numRelays) + claim := testproof.BaseClaim(service.Id, appAddr, supplierOperatorAddr, numRelays) claim.SessionHeader.ApplicationAddress = "invalid address" return &claim }(), @@ -487,14 +487,14 @@ func TestProcessTokenLogicModules_InvalidClaim(t *testing.T) { expectErr: tokenomicstypes.ErrTokenomicsSessionHeaderInvalid, }, { - desc: "Claim with invalid supplier address", + desc: "Claim with invalid supplier operator address", claim: func() *prooftypes.Claim { - claim := testproof.BaseClaim(service.Id, appAddr, supplierAddr, numRelays) - claim.SupplierAddress = "invalid address" + claim := testproof.BaseClaim(service.Id, appAddr, supplierOperatorAddr, numRelays) + claim.SupplierOperatorAddress = "invalid address" return &claim }(), errExpected: true, - expectErr: tokenomicstypes.ErrTokenomicsSupplierAddressInvalid, + expectErr: tokenomicstypes.ErrTokenomicsSupplierOperatorAddressInvalid, }, } diff --git a/x/tokenomics/types/errors.go b/x/tokenomics/types/errors.go index 5538516aa..1c4f6443d 100644 --- a/x/tokenomics/types/errors.go +++ b/x/tokenomics/types/errors.go @@ -6,29 +6,29 @@ import sdkerrors "cosmossdk.io/errors" // x/tokenomics module sentinel errors var ( - ErrTokenomicsInvalidSigner = sdkerrors.Register(ModuleName, 1100, "the provided authority address does not match the on-chain governance address") - ErrTokenomicsAddressInvalid = sdkerrors.Register(ModuleName, 1101, "the provided authority address is not a valid bech32 address") - ErrTokenomicsClaimNil = sdkerrors.Register(ModuleName, 1102, "provided claim is nil") - ErrTokenomicsSessionHeaderNil = sdkerrors.Register(ModuleName, 1103, "provided claim's session header is nil") - ErrTokenomicsSessionHeaderInvalid = sdkerrors.Register(ModuleName, 1104, "provided claim's session header is invalid") - ErrTokenomicsSupplierModuleSendFailed = sdkerrors.Register(ModuleName, 1105, "failed to send uPOKT to supplier module account") - ErrTokenomicsSupplierAddressInvalid = sdkerrors.Register(ModuleName, 1106, "the supplier address in the claim is not a valid bech32 address") - ErrTokenomicsSupplierNotFound = sdkerrors.Register(ModuleName, 1107, "supplier not found") - ErrTokenomicsApplicationNotFound = sdkerrors.Register(ModuleName, 1108, "application not found") - ErrTokenomicsApplicationModuleBurn = sdkerrors.Register(ModuleName, 1109, "failed to burn uPOKT from application module account") - ErrTokenomicsApplicationAddressInvalid = sdkerrors.Register(ModuleName, 1110, "the application address in the claim is not a valid bech32 address") - ErrTokenomicsParamsInvalid = sdkerrors.Register(ModuleName, 1111, "provided params are invalid") - ErrTokenomicsRootHashInvalid = sdkerrors.Register(ModuleName, 1112, "the root hash in the claim is invalid") - ErrTokenomicsApplicationNewStakeInvalid = sdkerrors.Register(ModuleName, 1113, "application stake cannot be reduced to a -ve amount") - ErrTokenomicsParamNameInvalid = sdkerrors.Register(ModuleName, 1114, "the provided param name is invalid") - ErrTokenomicsParamInvalid = sdkerrors.Register(ModuleName, 1115, "the provided param is invalid") - ErrTokenomicsUnmarshalInvalid = sdkerrors.Register(ModuleName, 1116, "failed to unmarshal the provided bytes") - ErrTokenomicsDuplicateIndex = sdkerrors.Register(ModuleName, 1117, "cannot have a duplicate index") - ErrTokenomicsMissingRelayMiningDifficulty = sdkerrors.Register(ModuleName, 1118, "missing relay mining difficulty") - ErrTokenomicsApplicationOverserviced = sdkerrors.Register(ModuleName, 1119, "application was overserviced") - ErrTokenomicsServiceNotFound = sdkerrors.Register(ModuleName, 1120, "service not found") - ErrTokenomicsModuleMintFailed = sdkerrors.Register(ModuleName, 1121, "failed to mint uPOKT to tokenomics module account") - ErrTokenomicsSendingMindRewards = sdkerrors.Register(ModuleName, 1122, "failed to send minted rewards") - ErrTokenomicsSupplierModuleMintFailed = sdkerrors.Register(ModuleName, 1123, "failed to mint uPOKT to supplier module account") - ErrTokenomicsSupplierOwnerAddressInvalid = sdkerrors.Register(ModuleName, 1124, "the supplier owner address in the claim is not a valid bech32 address") + ErrTokenomicsInvalidSigner = sdkerrors.Register(ModuleName, 1100, "the provided authority address does not match the on-chain governance address") + ErrTokenomicsAddressInvalid = sdkerrors.Register(ModuleName, 1101, "the provided authority address is not a valid bech32 address") + ErrTokenomicsClaimNil = sdkerrors.Register(ModuleName, 1102, "provided claim is nil") + ErrTokenomicsSessionHeaderNil = sdkerrors.Register(ModuleName, 1103, "provided claim's session header is nil") + ErrTokenomicsSessionHeaderInvalid = sdkerrors.Register(ModuleName, 1104, "provided claim's session header is invalid") + ErrTokenomicsSupplierModuleSendFailed = sdkerrors.Register(ModuleName, 1105, "failed to send uPOKT to supplier module account") + ErrTokenomicsSupplierOperatorAddressInvalid = sdkerrors.Register(ModuleName, 1106, "the supplier operator address in the claim is not a valid bech32 address") + ErrTokenomicsSupplierNotFound = sdkerrors.Register(ModuleName, 1107, "supplier not found") + ErrTokenomicsApplicationNotFound = sdkerrors.Register(ModuleName, 1108, "application not found") + ErrTokenomicsApplicationModuleBurn = sdkerrors.Register(ModuleName, 1109, "failed to burn uPOKT from application module account") + ErrTokenomicsApplicationAddressInvalid = sdkerrors.Register(ModuleName, 1110, "the application address in the claim is not a valid bech32 address") + ErrTokenomicsParamsInvalid = sdkerrors.Register(ModuleName, 1111, "provided params are invalid") + ErrTokenomicsRootHashInvalid = sdkerrors.Register(ModuleName, 1112, "the root hash in the claim is invalid") + ErrTokenomicsApplicationNewStakeInvalid = sdkerrors.Register(ModuleName, 1113, "application stake cannot be reduced to a -ve amount") + ErrTokenomicsParamNameInvalid = sdkerrors.Register(ModuleName, 1114, "the provided param name is invalid") + ErrTokenomicsParamInvalid = sdkerrors.Register(ModuleName, 1115, "the provided param is invalid") + ErrTokenomicsUnmarshalInvalid = sdkerrors.Register(ModuleName, 1116, "failed to unmarshal the provided bytes") + ErrTokenomicsDuplicateIndex = sdkerrors.Register(ModuleName, 1117, "cannot have a duplicate index") + ErrTokenomicsMissingRelayMiningDifficulty = sdkerrors.Register(ModuleName, 1118, "missing relay mining difficulty") + ErrTokenomicsApplicationOverserviced = sdkerrors.Register(ModuleName, 1119, "application was overserviced") + ErrTokenomicsServiceNotFound = sdkerrors.Register(ModuleName, 1120, "service not found") + ErrTokenomicsModuleMintFailed = sdkerrors.Register(ModuleName, 1121, "failed to mint uPOKT to tokenomics module account") + ErrTokenomicsSendingMindRewards = sdkerrors.Register(ModuleName, 1122, "failed to send minted rewards") + ErrTokenomicsSupplierModuleMintFailed = sdkerrors.Register(ModuleName, 1123, "failed to mint uPOKT to supplier module account") + ErrTokenomicsSupplierOwnerAddressInvalid = sdkerrors.Register(ModuleName, 1124, "the supplier owner address in the claim is not a valid bech32 address") ) diff --git a/x/tokenomics/types/expected_keepers.go b/x/tokenomics/types/expected_keepers.go index 724b91cdd..a267cbb18 100644 --- a/x/tokenomics/types/expected_keepers.go +++ b/x/tokenomics/types/expected_keepers.go @@ -46,9 +46,9 @@ type ApplicationKeeper interface { type ProofKeeper interface { GetAllClaims(ctx context.Context) []prooftypes.Claim - RemoveClaim(ctx context.Context, sessionId, supplierAddr string) - GetProof(ctx context.Context, sessionId, supplierAddr string) (proof prooftypes.Proof, isProofFound bool) - RemoveProof(ctx context.Context, sessionId, supplierAddr string) + RemoveClaim(ctx context.Context, sessionId, supplierOperatorAddr string) + GetProof(ctx context.Context, sessionId, supplierOperatorAddr string) (proof prooftypes.Proof, isProofFound bool) + RemoveProof(ctx context.Context, sessionId, supplierOperatorAddr string) AllClaims(ctx context.Context, req *prooftypes.QueryAllClaimsRequest) (*prooftypes.QueryAllClaimsResponse, error) EnsureValidProof(ctx context.Context, proof *prooftypes.Proof) error @@ -75,7 +75,7 @@ type SessionKeeper interface { } type SupplierKeeper interface { - GetSupplier(ctx context.Context, supplierAddr string) (supplier sharedtypes.Supplier, found bool) + GetSupplier(ctx context.Context, supplierOperatorAddr string) (supplier sharedtypes.Supplier, found bool) GetAllSuppliers(ctx context.Context) (suppliers []sharedtypes.Supplier) SetSupplier(ctx context.Context, supplier sharedtypes.Supplier) }