From 0b17e317d3e9fd337d8389c421aad570123cd2d4 Mon Sep 17 00:00:00 2001 From: Roy Crihfield Date: Fri, 8 Sep 2023 16:34:18 +0800 Subject: [PATCH 01/10] remove hard-coded record types, fix EIP-712 decoding rename types for clarity --- ethereum/eip712/eip712.go | 146 +- ethereum/eip712/eip712_test.go | 69 +- gql/util.go | 6 +- .../registry/v1beta1/attributes.proto | 33 - .../vulcanize/registry/v1beta1/registry.proto | 2 +- proto/vulcanize/registry/v1beta1/tx.proto | 30 +- x/registry/client/cli/query.go | 4 +- x/registry/client/cli/tx.go | 17 +- x/registry/client/testutil/grpc.go | 2 +- x/registry/client/testutil/query.go | 2 +- x/registry/client/testutil/tx.go | 4 +- x/registry/keeper/grpc_query_test.go | 10 +- x/registry/keeper/keeper.go | 89 +- x/registry/keeper/record_keeper.go | 9 +- x/registry/types/attributes.go | 5 - x/registry/types/attributes.pb.go | 1412 ----------------- x/registry/types/codec.go | 11 - x/registry/types/msg.go | 4 +- x/registry/types/record_msg.go | 13 +- x/registry/types/registry.pb.go | 240 ++- x/registry/types/tx.pb.go | 26 +- x/registry/types/types.go | 144 +- 22 files changed, 392 insertions(+), 1886 deletions(-) delete mode 100644 proto/vulcanize/registry/v1beta1/attributes.proto delete mode 100644 x/registry/types/attributes.go delete mode 100644 x/registry/types/attributes.pb.go diff --git a/ethereum/eip712/eip712.go b/ethereum/eip712/eip712.go index 72e0af82..1039f25d 100644 --- a/ethereum/eip712/eip712.go +++ b/ethereum/eip712/eip712.go @@ -2,6 +2,7 @@ package eip712 import ( "bytes" + "encoding/base64" "encoding/json" "fmt" "math/big" @@ -9,17 +10,15 @@ import ( "strings" "time" + errorsmod "cosmossdk.io/errors" sdkmath "cosmossdk.io/math" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" + sdk "github.com/cosmos/cosmos-sdk/types" + errortypes "github.com/cosmos/cosmos-sdk/types/errors" "golang.org/x/text/cases" "golang.org/x/text/language" - errorsmod "cosmossdk.io/errors" - codectypes "github.com/cosmos/cosmos-sdk/codec/types" - sdk "github.com/cosmos/cosmos-sdk/types" - errortypes "github.com/cosmos/cosmos-sdk/types/errors" - - registry "github.com/cerc-io/laconicd/x/registry/types" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/math" "github.com/ethereum/go-ethereum/signer/core/apitypes" @@ -34,24 +33,6 @@ func WrapTxToTypedData( data []byte, feeDelegation *FeeDelegationOptions, ) (apitypes.TypedData, error) { - txData := make(map[string]interface{}) - - if err := json.Unmarshal(data, &txData); err != nil { - return apitypes.TypedData{}, errorsmod.Wrap(errortypes.ErrJSONUnmarshal, "failed to JSON unmarshal data") - } - - if txData["msgs"].([]interface{})[0].(map[string]interface{})["value"].(map[string]interface{})["payload"] != nil { - setRecordMsg := msg.(*registry.MsgSetRecord) - var attr []interface{} - for _, b := range setRecordMsg.Payload.Record.Attributes.Value { - attr = append(attr, fmt.Sprintf("%v", b)) - } - - txData["msgs"].([]interface{})[0].(map[string]interface{})["value"].(map[string]interface{})["payload"].(map[string]interface{})["record"].(map[string]interface{})["attributes"] = map[string]interface{}{ //nolint:lll - "type_url": setRecordMsg.Payload.Record.Attributes.TypeUrl, - "value": attr, - } - } domain := apitypes.TypedDataDomain{ Name: "Cosmos Web3", @@ -66,22 +47,13 @@ func WrapTxToTypedData( return apitypes.TypedData{}, err } - if msgTypes["TypePayloadRecord"] != nil { - msgTypes["TypePayloadRecord"] = []apitypes.Type{ - {Name: "id", Type: "string"}, - {Name: "bond_id", Type: "string"}, - {Name: "create_time", Type: "string"}, - {Name: "expiry_time", Type: "string"}, - {Name: "deleted", Type: "bool"}, - {Name: "attributes", Type: "TypePayloadRecordAttributes"}, - } + txData := make(map[string]interface{}) + if err := json.Unmarshal(data, &txData); err != nil { + return apitypes.TypedData{}, errorsmod.Wrap(errortypes.ErrJSONUnmarshal, "failed to JSON unmarshal data") } - if msgTypes["TypePayloadRecordAttributes"] != nil { - msgTypes["TypePayloadRecordAttributes"] = []apitypes.Type{ - {Name: "type_url", Type: "string"}, - {Name: "value", Type: "uint8[]"}, - } - delete(msgTypes, "TypePayloadRecordAttributesValue") + + if err := patchTxData(txData, msgTypes, "Tx"); err != nil { + return apitypes.TypedData{}, errorsmod.Wrap(errortypes.ErrJSONUnmarshal, "failed to patch JSON data") } if feeDelegation != nil { @@ -320,10 +292,15 @@ func traverseFields( ethTyp := typToEth(fieldType) if len(ethTyp) > 0 { // Support array of uint64 - if isCollection && fieldType.Kind() != reflect.Slice && fieldType.Kind() != reflect.Array { - ethTyp += "[]" + if isCollection { + if fieldType.Kind() != reflect.Slice && fieldType.Kind() != reflect.Array { + ethTyp += "[]" + } + // convert uint8[] to bytes + if fieldType.Kind() == reflect.Uint8 { + ethTyp = "bytes" + } } - if prefix == typeDefPrefix { typeMap[rootType] = append(typeMap[rootType], apitypes.Type{ Name: fieldName, @@ -466,14 +443,13 @@ func typToEth(typ reflect.Type) string { return "uint32" case reflect.Uint64: return "uint64" - case reflect.Slice: - ethName := typToEth(typ.Elem()) - if len(ethName) > 0 { - return ethName + "[]" - } - case reflect.Array: + case reflect.Slice | reflect.Array: + // Note: this case may never be reached due to previous handling in traverseFields ethName := typToEth(typ.Elem()) if len(ethName) > 0 { + if ethName == "uint8" { + return "bytes" + } return ethName + "[]" } case reflect.Ptr: @@ -510,3 +486,77 @@ func doRecover(err *error) { *err = fmt.Errorf("%v", r) } } + +// Performs extra type conversions on JSON-decoded data accoding to the provided type definitions +// for compatibility with Geth's encoding +func patchTxData(data map[string]any, schema apitypes.Types, rootType string) error { + // Scan the data for any types that need to be converted. + // This is adapted from TypedData.EncodeData + for _, field := range schema[rootType] { + encType := field.Type + encValue := data[field.Name] + if encType[len(encType)-1:] == "]" { + arrayValue, ok := encValue.([]interface{}) + if !ok { + return dataMismatchError(encType, encValue) + } + + parsedType := strings.Split(encType, "[")[0] + if schema[parsedType] != nil { + for _, item := range arrayValue { + mapValue, ok := item.(map[string]interface{}) + if !ok { + return dataMismatchError(parsedType, item) + } + + err := patchTxData(mapValue, schema, parsedType) + if err != nil { + return err + } + } + } else { + for i, item := range arrayValue { + converted, err := handleConversion(parsedType, item) + if err != nil { + return err + } + arrayValue[i] = converted + } + } + + } else if schema[encType] != nil { + mapValue, ok := encValue.(map[string]interface{}) + if !ok { + return dataMismatchError(encType, encValue) + } + err := patchTxData(mapValue, schema, encType) + if err != nil { + return err + } + } else { + converted, err := handleConversion(encType, encValue) + if err != nil { + return err + } + data[field.Name] = converted + } + } + return nil +} + +func handleConversion(encType string, encValue any) (any, error) { + switch encType { + case "bytes": + // Protobuf encodes byte strings in base64 + if v, ok := encValue.(string); ok { + return base64.StdEncoding.DecodeString(v) + } + } + return encValue, nil +} + +// dataMismatchError generates an error for a mismatch between +// the provided type and data +func dataMismatchError(encType string, encValue any) error { + return fmt.Errorf("provided data '%v' doesn't match type '%s'", encValue, encType) +} diff --git a/ethereum/eip712/eip712_test.go b/ethereum/eip712/eip712_test.go index 9c1864d6..d51b8993 100644 --- a/ethereum/eip712/eip712_test.go +++ b/ethereum/eip712/eip712_test.go @@ -4,28 +4,25 @@ import ( "testing" "cosmossdk.io/math" - - "github.com/cerc-io/laconicd/ethereum/eip712" + registrytypes "github.com/cerc-io/laconicd/x/registry/types" "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/simapp/params" - "github.com/ethereum/go-ethereum/crypto" - - "github.com/cerc-io/laconicd/crypto/ethsecp256k1" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" + "github.com/cosmos/cosmos-sdk/simapp/params" sdk "github.com/cosmos/cosmos-sdk/types" - - "github.com/cerc-io/laconicd/app" - "github.com/cerc-io/laconicd/encoding" - banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - txtypes "github.com/cosmos/cosmos-sdk/types/tx" "github.com/cosmos/cosmos-sdk/types/tx/signing" authsigning "github.com/cosmos/cosmos-sdk/x/auth/signing" - + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" distributiontypes "github.com/cosmos/cosmos-sdk/x/distribution/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + "github.com/ethereum/go-ethereum/crypto" "github.com/stretchr/testify/suite" + + "github.com/cerc-io/laconicd/app" + "github.com/cerc-io/laconicd/crypto/ethsecp256k1" + "github.com/cerc-io/laconicd/encoding" + "github.com/cerc-io/laconicd/ethereum/eip712" ) // Unit tests for single-signer EIP-712 signature verification. Multi-signer verification tests are included @@ -332,6 +329,54 @@ func (suite *EIP712TestSuite) TestEIP712SignatureVerification() { sequence: 78, expectSuccess: false, }, + + // test laconic registry messages + { + title: "Succeeds - Standard MsgSetName", + fee: txtypes.Fee{ + Amount: suite.makeCoins("aphoton", math.NewInt(2000)), + GasLimit: 100000, + }, + memo: "", + msgs: []sdk.Msg{ + registrytypes.NewMsgSetName( + "testcrn", + "testcid", + suite.createTestAddress(), + ), + }, + accountNumber: 25, + sequence: 78, + expectSuccess: true, + }, + { + title: "Succeeds - Standard MsgSetRecord", + fee: txtypes.Fee{ + Amount: suite.makeCoins("aphoton", math.NewInt(2000)), + GasLimit: 100000, + }, + memo: "", + msgs: []sdk.Msg{ + registrytypes.NewMsgSetRecord( + registrytypes.Payload{ + Record: ®istrytypes.Record{ + Attributes: []byte("test attributes"), + }, + Signatures: []registrytypes.Signature{ + { + Sig: "fake sig", + PubKey: "fake pubkey", + }, + }, + }, + "testbondid", + suite.createTestAddress(), + ), + }, + accountNumber: 25, + sequence: 78, + expectSuccess: true, + }, } for _, tc := range testCases { diff --git a/gql/util.go b/gql/util.go index 935b293f..a6adabcb 100644 --- a/gql/util.go +++ b/gql/util.go @@ -61,7 +61,7 @@ func getGQLRecord(ctx context.Context, resolver QueryResolver, record registryty return nil, nil } - recordType := record.ToRecordType() + recordType := record.ToReadableRecord() attributes, err := getAttributes(&recordType) if err != nil { return nil, err @@ -163,7 +163,7 @@ func GetGQLAuction(auction *auctiontypes.Auction, bids []*auctiontypes.Bid) (*Au return &gqlAuction, nil } -func getReferences(ctx context.Context, resolver QueryResolver, r *registrytypes.RecordType) ([]*Record, error) { +func getReferences(ctx context.Context, resolver QueryResolver, r *registrytypes.RecordEncodable) ([]*Record, error) { var ids []string // #nosec G705 @@ -184,7 +184,7 @@ func getReferences(ctx context.Context, resolver QueryResolver, r *registrytypes return resolver.GetRecordsByIds(ctx, ids) } -func getAttributes(r *registrytypes.RecordType) ([]*KeyValue, error) { +func getAttributes(r *registrytypes.RecordEncodable) ([]*KeyValue, error) { return mapToKeyValuePairs(r.Attributes) } diff --git a/proto/vulcanize/registry/v1beta1/attributes.proto b/proto/vulcanize/registry/v1beta1/attributes.proto deleted file mode 100644 index c5d27020..00000000 --- a/proto/vulcanize/registry/v1beta1/attributes.proto +++ /dev/null @@ -1,33 +0,0 @@ -syntax = "proto3"; -package vulcanize.registry.v1beta1; - -import "gogoproto/gogo.proto"; - -option go_package = "github.com/cerc-io/laconicd/x/registry/types"; - -message ServiceProviderRegistration { - string bond_id = 1 [(gogoproto.moretags) = "json:\"bondId\" yaml:\"bondId\""]; - string laconic_id = 2 [(gogoproto.moretags) = "json:\"laconicId\" yaml:\"laconicId\""]; - X500 x500 = 3 [(gogoproto.moretags) = "json:\"x500\" yaml:\"x500\""]; - string type = 4 [(gogoproto.moretags) = "json:\"type\" yaml:\"type\""]; - string version = 6 [(gogoproto.moretags) = "json:\"version\" yaml:\"version\""]; -} - -message X500 { - string common_name = 1 [(gogoproto.moretags) = "json:\"commonName\" yaml:\"commonName\""]; - string organization_unit = 2 [(gogoproto.moretags) = "json:\"organizationUnit\" yaml:\"organizationUnit\""]; - string organization_name = 3 [(gogoproto.moretags) = "json:\"organizationName\" yaml:\"organizationName\""]; - string locality_name = 4 [(gogoproto.moretags) = "json:\"localityName\" yaml:\"localityName\""]; - string state_name = 5 [(gogoproto.moretags) = "json:\"stateName\" yaml:\"stateName\""]; - string country = 6 [(gogoproto.moretags) = "json:\"country\" yaml:\"country\""]; -} - -message WebsiteRegistrationRecord { - string url = 1 [(gogoproto.moretags) = "json:\"url\" yaml:\"url\""]; - string repo_registration_record_cid = 2 - [(gogoproto.moretags) = "json:\"repoRegistrationRecordCID\" yaml:\"repoRegistrationRecordCID\""]; - string build_artifact_cid = 3 [(gogoproto.moretags) = "json:\"buildArtifactCID\" yaml:\"buildArtifactCID\""]; - string tls_cert_cid = 4 [(gogoproto.moretags) = "json:\"TLSCertCID\" yaml:\"TLSCertCID\""]; - string type = 5 [(gogoproto.moretags) = "json:\"type\" yaml:\"type\""]; - string version = 6 [(gogoproto.moretags) = "json:\"version\" yaml:\"version\""]; -} \ No newline at end of file diff --git a/proto/vulcanize/registry/v1beta1/registry.proto b/proto/vulcanize/registry/v1beta1/registry.proto index 2c0e2804..b2c340f2 100644 --- a/proto/vulcanize/registry/v1beta1/registry.proto +++ b/proto/vulcanize/registry/v1beta1/registry.proto @@ -64,7 +64,7 @@ message Record { string expiry_time = 4 [(gogoproto.moretags) = "json:\"expiryTime\" yaml:\"expiryTime\""]; bool deleted = 5; repeated string owners = 6 [(gogoproto.moretags) = "json:\"owners\" yaml:\"owners\""]; - google.protobuf.Any attributes = 7 [(gogoproto.moretags) = "json:\"attributes\" yaml:\"attributes\""]; + bytes attributes = 7 [(gogoproto.moretags) = "json:\"attributes\" yaml:\"attributes\""]; repeated string names = 8 [(gogoproto.moretags) = "json:\"names\" yaml:\"names\""]; string type = 9 [(gogoproto.moretags) = "json:\"types\" yaml:\"types\""]; } diff --git a/proto/vulcanize/registry/v1beta1/tx.proto b/proto/vulcanize/registry/v1beta1/tx.proto index a67769dc..de300434 100644 --- a/proto/vulcanize/registry/v1beta1/tx.proto +++ b/proto/vulcanize/registry/v1beta1/tx.proto @@ -7,13 +7,13 @@ import "vulcanize/registry/v1beta1/registry.proto"; option go_package = "github.com/cerc-io/laconicd/x/registry/types"; -// Msg +// Msg is a service which exposes the registry functionality service Msg { - // SetRecord will records a new record with given payload and bond id + // SetRecord records a new record with given payload and bond id rpc SetRecord(MsgSetRecord) returns (MsgSetRecordResponse) { option (google.api.http).post = "/vulcanize/registry/v1beta1/set_record"; } - // Renew Record will renew the expire record + // Renew Record renews an expired record rpc RenewRecord(MsgRenewRecord) returns (MsgRenewRecordResponse) { option (google.api.http).post = "/vulcanize/registry/v1beta1/renew_record"; } @@ -66,8 +66,10 @@ message MsgSetRecordResponse { // Payload message Payload { Record record = 1; - repeated Signature signatures = 2 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "json:\"signatures\" yaml:\"signatures\""]; + repeated Signature signatures = 2 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "json:\"signatures\" yaml:\"signatures\"" + ]; } // MsgSetName @@ -91,7 +93,7 @@ message MsgReserveAuthority { // MsgReserveNameResponse message MsgReserveAuthorityResponse {} -// MsgSetAuthorityBond is SDK message for SetAuthorityBond +// MsgSetAuthorityBond message MsgSetAuthorityBond { string name = 1; string bond_id = 2 [(gogoproto.moretags) = "json:\"bondId\" yaml:\"bondId\""]; @@ -101,7 +103,7 @@ message MsgSetAuthorityBond { // MsgSetAuthorityBondResponse message MsgSetAuthorityBondResponse {} -// MsgDeleteNameAuthority is SDK message for DeleteNameAuthority +// MsgDeleteNameAuthority message MsgDeleteNameAuthority { string crn = 1; string signer = 2; @@ -110,7 +112,7 @@ message MsgDeleteNameAuthority { // MsgDeleteNameAuthorityResponse message MsgDeleteNameAuthorityResponse {} -// MsgRenewRecord is SDK message for Renew a record +// MsgRenewRecord message MsgRenewRecord { string record_id = 1 [(gogoproto.moretags) = "json:\"recordId\" yaml:\"recordId\""]; string signer = 2; @@ -129,30 +131,30 @@ message MsgAssociateBond { // MsgAssociateBondResponse message MsgAssociateBondResponse {} -// MsgDissociateBond is SDK message for Msg/DissociateBond +// MsgDissociateBond message MsgDissociateBond { string record_id = 1 [(gogoproto.moretags) = "json:\"recordId\" yaml:\"recordId\""]; string signer = 2; } -// MsgDissociateBondResponse is response type for MsgDissociateBond +// MsgDissociateBondResponse message MsgDissociateBondResponse {} -// MsgDissociateRecords is SDK message for Msg/DissociateRecords +// MsgDissociateRecords message MsgDissociateRecords { string bond_id = 1 [(gogoproto.moretags) = "json:\"bondId\" yaml:\"bondId\""]; string signer = 2; } -// MsgDissociateRecordsResponse is response type for MsgDissociateRecords +// MsgDissociateRecordsResponse message MsgDissociateRecordsResponse {} -// MsgReAssociateRecords is SDK message for Msg/ReAssociateRecords +// MsgReAssociateRecords message MsgReAssociateRecords { string new_bond_id = 1 [(gogoproto.moretags) = "json:\"newBondId\" yaml:\"newBondId\""]; string old_bond_id = 2 [(gogoproto.moretags) = "json:\"oldBondId\" yaml:\"oldBondId\""]; string signer = 3; } -// MsgReAssociateRecordsResponse is response type for MsgReAssociateRecords +// MsgReAssociateRecordsResponse message MsgReAssociateRecordsResponse {} diff --git a/x/registry/client/cli/query.go b/x/registry/client/cli/query.go index cd7358da..462940a6 100644 --- a/x/registry/client/cli/query.go +++ b/x/registry/client/cli/query.go @@ -161,9 +161,9 @@ $ %s query %s list } recordsList := res.GetRecords() - records := make([]types.RecordType, len(recordsList)) + records := make([]types.RecordEncodable, len(recordsList)) for i, record := range res.GetRecords() { - records[i] = record.ToRecordType() + records[i] = record.ToReadableRecord() } bytesResult, err := json.Marshal(records) if err != nil { diff --git a/x/registry/client/cli/tx.go b/x/registry/client/cli/tx.go index 1d228136..477fe643 100644 --- a/x/registry/client/cli/tx.go +++ b/x/registry/client/cli/tx.go @@ -66,17 +66,10 @@ $ %s tx %s set [payload file path] [bond-id] return err } - payload, err := payloadType.ToPayload() - if err != nil { - return err - } + payload := payloadType.ToPayload() msg := types.NewMsgSetRecord(payload, args[1], clientCtx.GetFromAddress()) - err = msg.ValidateBasic() - if err != nil { - return err - } - return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), &msg) + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) }, } @@ -269,7 +262,7 @@ $ %s tx %s set-name [crn] [cid] if err != nil { return err } - return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), &msg) + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) }, } @@ -377,8 +370,8 @@ $ %s tx %s delete-name [crn] } // GetPayloadFromFile Load payload object from YAML file. -func GetPayloadFromFile(filePath string) (*types.PayloadType, error) { - var payload types.PayloadType +func GetPayloadFromFile(filePath string) (*types.PayloadEncodable, error) { + var payload types.PayloadEncodable data, err := os.ReadFile(filePath) // #nosec G304 if err != nil { diff --git a/x/registry/client/testutil/grpc.go b/x/registry/client/testutil/grpc.go index 143dab90..835927fe 100644 --- a/x/registry/client/testutil/grpc.go +++ b/x/registry/client/testutil/grpc.go @@ -433,7 +433,7 @@ func (s *IntegrationTestSuite) TestGRPCQueryGetRecordByID() { } out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, args) sr.NoError(err) - var records []nstypes.RecordType + var records []nstypes.RecordEncodable err = json.Unmarshal(out.Bytes(), &records) sr.NoError(err) return records[0].ID diff --git a/x/registry/client/testutil/query.go b/x/registry/client/testutil/query.go index f2b09b89..9aaeab18 100644 --- a/x/registry/client/testutil/query.go +++ b/x/registry/client/testutil/query.go @@ -114,7 +114,7 @@ func (s *IntegrationTestSuite) TestGetCmdQueryForRecords() { sr.Error(err) } else { sr.NoError(err) - var records []types.RecordType + var records []types.RecordEncodable err := json.Unmarshal(out.Bytes(), &records) sr.NoError(err) sr.Equal(tc.noOfRecords, len(records)) diff --git a/x/registry/client/testutil/tx.go b/x/registry/client/testutil/tx.go index 4da1bdc2..b85634ab 100644 --- a/x/registry/client/testutil/tx.go +++ b/x/registry/client/testutil/tx.go @@ -606,7 +606,7 @@ func (s *IntegrationTestSuite) TestGetCmdDissociateBond() { cmd = cli.GetCmdList() out, err = clitestutil.ExecTestCLICmd(clientCtx, cmd, args) sr.NoError(err) - var records []nstypes.RecordType + var records []nstypes.RecordEncodable err = json.Unmarshal(out.Bytes(), &records) sr.NoError(err) return records[0].ID @@ -848,7 +848,7 @@ func (s *IntegrationTestSuite) TestGetCmdAssociateBond() { cmd = cli.GetCmdList() out, err = clitestutil.ExecTestCLICmd(clientCtx, cmd, args) sr.NoError(err) - var records []nstypes.RecordType + var records []nstypes.RecordEncodable err = json.Unmarshal(out.Bytes(), &records) sr.NoError(err) diff --git a/x/registry/keeper/grpc_query_test.go b/x/registry/keeper/grpc_query_test.go index 4e580432..bbc1038d 100644 --- a/x/registry/keeper/grpc_query_test.go +++ b/x/registry/keeper/grpc_query_test.go @@ -106,8 +106,7 @@ func (suite *KeeperTestSuite) TestGrpcGetRecordLists() { sr.NoError(err) payloadType, err := cli.GetPayloadFromFile(fmt.Sprint(dir, example)) sr.NoError(err) - payload, err := payloadType.ToPayload() - sr.NoError(err) + payload := payloadType.ToPayload() record, err := suite.app.RegistryKeeper.ProcessSetRecord(ctx, registrytypes.MsgSetRecord{ BondId: suite.bond.GetId(), Signer: suite.accounts[0].String(), @@ -129,9 +128,7 @@ func (suite *KeeperTestSuite) TestGrpcGetRecordLists() { sr.Equal(resp.GetRecords()[0].GetBondId(), suite.bond.GetId()) for _, record := range resp.GetRecords() { - bz, err := registrytypes.GetJSONBytesFromAny(*record.Attributes) - sr.NoError(err) - recAttr := helpers.UnMarshalMapFromJSONBytes(bz) + recAttr := helpers.UnMarshalMapFromJSONBytes(record.Attributes) for _, attr := range test.req.GetAttributes() { if attr.Key[:4] == "x500" { sr.Equal(keeper.GetAttributeValue(attr.Value), recAttr["x500"].(map[string]interface{})[attr.Key[4:]]) @@ -258,8 +255,7 @@ func (suite *KeeperTestSuite) TestGrpcQueryRegistryModuleBalance() { for _, example := range examples { payloadType, err := cli.GetPayloadFromFile(fmt.Sprint(dir, example)) sr.NoError(err) - payload, err := payloadType.ToPayload() - sr.NoError(err) + payload := payloadType.ToPayload() record, err := suite.app.RegistryKeeper.ProcessSetRecord(ctx, registrytypes.MsgSetRecord{ BondId: suite.bond.GetId(), Signer: suite.accounts[0].String(), diff --git a/x/registry/keeper/keeper.go b/x/registry/keeper/keeper.go index d44b13df..36d09a77 100644 --- a/x/registry/keeper/keeper.go +++ b/x/registry/keeper/keeper.go @@ -112,7 +112,8 @@ func (k Keeper) GetRecord(ctx sdk.Context, id string) (record types.Record) { store := ctx.KVStore(k.storeKey) result := store.Get(GetRecordIndexKey(id)) k.cdc.MustUnmarshal(result, &record) - return recordObjToRecord(store, record) + decodeRecordNames(store, &record) + return record } // ListRecords - get all records. @@ -125,15 +126,17 @@ func (k Keeper) ListRecords(ctx sdk.Context) []types.Record { for ; itr.Valid(); itr.Next() { bz := store.Get(itr.Key()) if bz != nil { - var obj types.Record - k.cdc.MustUnmarshal(bz, &obj) - records = append(records, recordObjToRecord(store, obj)) + var record types.Record + k.cdc.MustUnmarshal(bz, &record) + decodeRecordNames(store, &record) + records = append(records, record) } } return records } +// RecordsFromAttributes gets a list of records whose attributes match all provided values func (k Keeper) RecordsFromAttributes(ctx sdk.Context, attributes []*types.QueryListRecordsRequest_KeyValueInput, all bool) ([]types.Record, error) { resultRecordIds := []string{} for i, attr := range attributes { @@ -157,11 +160,11 @@ func (k Keeper) RecordsFromAttributes(ctx sdk.Context, attributes []*types.Query continue } store := ctx.KVStore(k.storeKey) - recordWithNames := recordObjToRecord(store, record) - if !all && len(recordWithNames.Names) == 0 { + decodeRecordNames(store, &record) + if !all && len(record.Names) == 0 { continue } - records = append(records, recordWithNames) + records = append(records, record) } return records, nil } @@ -233,9 +236,9 @@ func (k Keeper) GetRecordExpiryQueue(ctx sdk.Context) []*types.ExpiryQueueRecord } // ProcessSetRecord creates a record. -func (k Keeper) ProcessSetRecord(ctx sdk.Context, msg types.MsgSetRecord) (*types.RecordType, error) { +func (k Keeper) ProcessSetRecord(ctx sdk.Context, msg types.MsgSetRecord) (*types.RecordEncodable, error) { payload := msg.Payload.ToReadablePayload() - record := types.RecordType{Attributes: payload.Record, BondID: msg.BondId} + record := types.RecordEncodable{Attributes: payload.Record, BondID: msg.BondId} // Check signatures. resourceSignBytes, _ := record.GetSignBytes() @@ -276,11 +279,13 @@ func (k Keeper) ProcessSetRecord(ctx sdk.Context, msg types.MsgSetRecord) (*type return &record, nil } -func (k Keeper) processRecord(ctx sdk.Context, record *types.RecordType, isRenewal bool) error { +func (k Keeper) processRecord(ctx sdk.Context, record *types.RecordEncodable, isRenewal bool) error { params := k.GetParams(ctx) rent := params.RecordRent - err := k.bondKeeper.TransferCoinsToModuleAccount(ctx, record.BondID, types.RecordRentModuleAccountName, sdk.NewCoins(rent)) + err := k.bondKeeper.TransferCoinsToModuleAccount( + ctx, record.BondID, types.RecordRentModuleAccountName, sdk.NewCoins(rent), + ) if err != nil { return err } @@ -295,7 +300,15 @@ func (k Keeper) processRecord(ctx sdk.Context, record *types.RecordType, isRenew } k.PutRecord(ctx, recordObj) - if err := k.ProcessAttributes(ctx, *record); err != nil { + // TODO process type here + // recordType, ok := record.Attributes["type"].(string) + + if err := k.processAttributes(ctx, record.Attributes, record.ID, ""); err != nil { + return err + } + + expiryTimeKey := GetAttributesIndexKey(ExpiryTimeAttributeName, record.ExpiryTime) + if err := k.SetAttributeMapping(ctx, expiryTimeKey, record.ID); err != nil { return err } @@ -316,47 +329,17 @@ func (k Keeper) PutRecord(ctx sdk.Context, record types.Record) { k.updateBlockChangeSetForRecord(ctx, record.Id) } -func (k Keeper) ProcessAttributes(ctx sdk.Context, record types.RecordType) error { - switch record.Attributes["type"] { - case "ServiceProviderRegistration": - { - // #nosec G705 - for key := range record.Attributes { - if key == "x500" { - // #nosec G705 - for x500Key, x500Val := range record.Attributes[key].(map[string]interface{}) { - indexKey := GetAttributesIndexKey(fmt.Sprintf("x500%s", x500Key), x500Val) - if err := k.SetAttributeMapping(ctx, indexKey, record.ID); err != nil { - return err - } - } - } else { - indexKey := GetAttributesIndexKey(key, record.Attributes[key]) - if err := k.SetAttributeMapping(ctx, indexKey, record.ID); err != nil { - return err - } - } +func (k Keeper) processAttributes(ctx sdk.Context, attrs map[string]any, id string, prefix string) error { + for key, value := range attrs { + if subRecord, ok := value.(map[string]any); ok { + k.processAttributes(ctx, subRecord, id, key) + } else { + indexKey := GetAttributesIndexKey(prefix+key, value) + if err := k.SetAttributeMapping(ctx, indexKey, id); err != nil { + return err } } - case "WebsiteRegistrationRecord": - { - // #nosec G705 - for key := range record.Attributes { - indexKey := GetAttributesIndexKey(key, record.Attributes[key]) - if err := k.SetAttributeMapping(ctx, indexKey, record.ID); err != nil { - return err - } - } - } - default: - return fmt.Errorf("unsupported record type %s", record.Attributes["type"]) } - - expiryTimeKey := GetAttributesIndexKey(ExpiryTimeAttributeName, record.ExpiryTime) - if err := k.SetAttributeMapping(ctx, expiryTimeKey, record.ID); err != nil { - return err - } - return nil } @@ -394,7 +377,7 @@ func (k Keeper) GetAttributeMapping(ctx sdk.Context, key []byte) ([]string, erro var recordIds []string if err := json.Unmarshal(store.Get(key), &recordIds); err != nil { - return nil, fmt.Errorf("cannont unmarshal byte array, error, %w", err) + return nil, fmt.Errorf("cannot unmarshal byte array, error, %w", err) } return recordIds, nil @@ -572,7 +555,7 @@ func (k Keeper) GetModuleBalances(ctx sdk.Context) []*types.AccountBalance { return balances } -func recordObjToRecord(store sdk.KVStore, record types.Record) types.Record { +func decodeRecordNames(store sdk.KVStore, record *types.Record) { reverseNameIndexKey := GetCIDToNamesIndexKey(record.Id) if store.Has(reverseNameIndexKey) { @@ -583,6 +566,4 @@ func recordObjToRecord(store sdk.KVStore, record types.Record) types.Record { record.Names = names } - - return record } diff --git a/x/registry/keeper/record_keeper.go b/x/registry/keeper/record_keeper.go index 6d04271e..cea1be7d 100644 --- a/x/registry/keeper/record_keeper.go +++ b/x/registry/keeper/record_keeper.go @@ -147,9 +147,10 @@ func (k RecordKeeper) QueryRecordsByBond(ctx sdk.Context, bondID string) []types cid := itr.Key()[len(bondIDPrefix):] bz := store.Get(append(PrefixCIDToRecordIndex, cid...)) if bz != nil { - var obj types.Record - k.cdc.MustUnmarshal(bz, &obj) - records = append(records, recordObjToRecord(store, obj)) + var record types.Record + k.cdc.MustUnmarshal(bz, &record) + decodeRecordNames(store, &record) + records = append(records, record) } } @@ -173,7 +174,7 @@ func (k Keeper) ProcessRenewRecord(ctx sdk.Context, msg types.MsgRenewRecord) er return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "Renewal not required.") } - recordType := record.ToRecordType() + recordType := record.ToReadableRecord() err = k.processRecord(ctx, &recordType, true) if err != nil { return err diff --git a/x/registry/types/attributes.go b/x/registry/types/attributes.go deleted file mode 100644 index 00a7a785..00000000 --- a/x/registry/types/attributes.go +++ /dev/null @@ -1,5 +0,0 @@ -package types - -type Attributes interface { - GetType() string -} diff --git a/x/registry/types/attributes.pb.go b/x/registry/types/attributes.pb.go deleted file mode 100644 index e0f61a9e..00000000 --- a/x/registry/types/attributes.pb.go +++ /dev/null @@ -1,1412 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: vulcanize/registry/v1beta1/attributes.proto - -package types - -import ( - fmt "fmt" - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type ServiceProviderRegistration struct { - BondId string `protobuf:"bytes,1,opt,name=bond_id,json=bondId,proto3" json:"bond_id,omitempty" json:"bondId" yaml:"bondId"` - LaconicId string `protobuf:"bytes,2,opt,name=laconic_id,json=laconicId,proto3" json:"laconic_id,omitempty" json:"laconicId" yaml:"laconicId"` - X500 *X500 `protobuf:"bytes,3,opt,name=x500,proto3" json:"x500,omitempty" json:"x500" yaml:"x500"` - Type string `protobuf:"bytes,4,opt,name=type,proto3" json:"type,omitempty" json:"type" yaml:"type"` - Version string `protobuf:"bytes,6,opt,name=version,proto3" json:"version,omitempty" json:"version" yaml:"version"` -} - -func (m *ServiceProviderRegistration) Reset() { *m = ServiceProviderRegistration{} } -func (m *ServiceProviderRegistration) String() string { return proto.CompactTextString(m) } -func (*ServiceProviderRegistration) ProtoMessage() {} -func (*ServiceProviderRegistration) Descriptor() ([]byte, []int) { - return fileDescriptor_f305abc771332c96, []int{0} -} -func (m *ServiceProviderRegistration) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ServiceProviderRegistration) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ServiceProviderRegistration.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ServiceProviderRegistration) XXX_Merge(src proto.Message) { - xxx_messageInfo_ServiceProviderRegistration.Merge(m, src) -} -func (m *ServiceProviderRegistration) XXX_Size() int { - return m.Size() -} -func (m *ServiceProviderRegistration) XXX_DiscardUnknown() { - xxx_messageInfo_ServiceProviderRegistration.DiscardUnknown(m) -} - -var xxx_messageInfo_ServiceProviderRegistration proto.InternalMessageInfo - -func (m *ServiceProviderRegistration) GetBondId() string { - if m != nil { - return m.BondId - } - return "" -} - -func (m *ServiceProviderRegistration) GetLaconicId() string { - if m != nil { - return m.LaconicId - } - return "" -} - -func (m *ServiceProviderRegistration) GetX500() *X500 { - if m != nil { - return m.X500 - } - return nil -} - -func (m *ServiceProviderRegistration) GetType() string { - if m != nil { - return m.Type - } - return "" -} - -func (m *ServiceProviderRegistration) GetVersion() string { - if m != nil { - return m.Version - } - return "" -} - -type X500 struct { - CommonName string `protobuf:"bytes,1,opt,name=common_name,json=commonName,proto3" json:"common_name,omitempty" json:"commonName" yaml:"commonName"` - OrganizationUnit string `protobuf:"bytes,2,opt,name=organization_unit,json=organizationUnit,proto3" json:"organization_unit,omitempty" json:"organizationUnit" yaml:"organizationUnit"` - OrganizationName string `protobuf:"bytes,3,opt,name=organization_name,json=organizationName,proto3" json:"organization_name,omitempty" json:"organizationName" yaml:"organizationName"` - LocalityName string `protobuf:"bytes,4,opt,name=locality_name,json=localityName,proto3" json:"locality_name,omitempty" json:"localityName" yaml:"localityName"` - StateName string `protobuf:"bytes,5,opt,name=state_name,json=stateName,proto3" json:"state_name,omitempty" json:"stateName" yaml:"stateName"` - Country string `protobuf:"bytes,6,opt,name=country,proto3" json:"country,omitempty" json:"country" yaml:"country"` -} - -func (m *X500) Reset() { *m = X500{} } -func (m *X500) String() string { return proto.CompactTextString(m) } -func (*X500) ProtoMessage() {} -func (*X500) Descriptor() ([]byte, []int) { - return fileDescriptor_f305abc771332c96, []int{1} -} -func (m *X500) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *X500) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_X500.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *X500) XXX_Merge(src proto.Message) { - xxx_messageInfo_X500.Merge(m, src) -} -func (m *X500) XXX_Size() int { - return m.Size() -} -func (m *X500) XXX_DiscardUnknown() { - xxx_messageInfo_X500.DiscardUnknown(m) -} - -var xxx_messageInfo_X500 proto.InternalMessageInfo - -func (m *X500) GetCommonName() string { - if m != nil { - return m.CommonName - } - return "" -} - -func (m *X500) GetOrganizationUnit() string { - if m != nil { - return m.OrganizationUnit - } - return "" -} - -func (m *X500) GetOrganizationName() string { - if m != nil { - return m.OrganizationName - } - return "" -} - -func (m *X500) GetLocalityName() string { - if m != nil { - return m.LocalityName - } - return "" -} - -func (m *X500) GetStateName() string { - if m != nil { - return m.StateName - } - return "" -} - -func (m *X500) GetCountry() string { - if m != nil { - return m.Country - } - return "" -} - -type WebsiteRegistrationRecord struct { - Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty" json:"url" yaml:"url"` - RepoRegistrationRecordCid string `protobuf:"bytes,2,opt,name=repo_registration_record_cid,json=repoRegistrationRecordCid,proto3" json:"repo_registration_record_cid,omitempty" json:"repoRegistrationRecordCID" yaml:"repoRegistrationRecordCID"` - BuildArtifactCid string `protobuf:"bytes,3,opt,name=build_artifact_cid,json=buildArtifactCid,proto3" json:"build_artifact_cid,omitempty" json:"buildArtifactCID" yaml:"buildArtifactCID"` - TlsCertCid string `protobuf:"bytes,4,opt,name=tls_cert_cid,json=tlsCertCid,proto3" json:"tls_cert_cid,omitempty" json:"TLSCertCID" yaml:"TLSCertCID"` - Type string `protobuf:"bytes,5,opt,name=type,proto3" json:"type,omitempty" json:"type" yaml:"type"` - Version string `protobuf:"bytes,6,opt,name=version,proto3" json:"version,omitempty" json:"version" yaml:"version"` -} - -func (m *WebsiteRegistrationRecord) Reset() { *m = WebsiteRegistrationRecord{} } -func (m *WebsiteRegistrationRecord) String() string { return proto.CompactTextString(m) } -func (*WebsiteRegistrationRecord) ProtoMessage() {} -func (*WebsiteRegistrationRecord) Descriptor() ([]byte, []int) { - return fileDescriptor_f305abc771332c96, []int{2} -} -func (m *WebsiteRegistrationRecord) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *WebsiteRegistrationRecord) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_WebsiteRegistrationRecord.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *WebsiteRegistrationRecord) XXX_Merge(src proto.Message) { - xxx_messageInfo_WebsiteRegistrationRecord.Merge(m, src) -} -func (m *WebsiteRegistrationRecord) XXX_Size() int { - return m.Size() -} -func (m *WebsiteRegistrationRecord) XXX_DiscardUnknown() { - xxx_messageInfo_WebsiteRegistrationRecord.DiscardUnknown(m) -} - -var xxx_messageInfo_WebsiteRegistrationRecord proto.InternalMessageInfo - -func (m *WebsiteRegistrationRecord) GetUrl() string { - if m != nil { - return m.Url - } - return "" -} - -func (m *WebsiteRegistrationRecord) GetRepoRegistrationRecordCid() string { - if m != nil { - return m.RepoRegistrationRecordCid - } - return "" -} - -func (m *WebsiteRegistrationRecord) GetBuildArtifactCid() string { - if m != nil { - return m.BuildArtifactCid - } - return "" -} - -func (m *WebsiteRegistrationRecord) GetTlsCertCid() string { - if m != nil { - return m.TlsCertCid - } - return "" -} - -func (m *WebsiteRegistrationRecord) GetType() string { - if m != nil { - return m.Type - } - return "" -} - -func (m *WebsiteRegistrationRecord) GetVersion() string { - if m != nil { - return m.Version - } - return "" -} - -func init() { - proto.RegisterType((*ServiceProviderRegistration)(nil), "vulcanize.registry.v1beta1.ServiceProviderRegistration") - proto.RegisterType((*X500)(nil), "vulcanize.registry.v1beta1.X500") - proto.RegisterType((*WebsiteRegistrationRecord)(nil), "vulcanize.registry.v1beta1.WebsiteRegistrationRecord") -} - -func init() { - proto.RegisterFile("vulcanize/registry/v1beta1/attributes.proto", fileDescriptor_f305abc771332c96) -} - -var fileDescriptor_f305abc771332c96 = []byte{ - // 661 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x54, 0x4f, 0x6f, 0xd4, 0x3e, - 0x10, 0x6d, 0xba, 0xdb, 0x56, 0x75, 0xfb, 0x93, 0xfa, 0xb3, 0x40, 0x6c, 0x5b, 0xd8, 0x6c, 0x17, - 0xa1, 0x56, 0x2a, 0x6c, 0xb6, 0x54, 0x95, 0x10, 0x9c, 0xfa, 0x07, 0x44, 0x25, 0x84, 0x8a, 0x0b, - 0x02, 0x71, 0x09, 0x8e, 0x63, 0x16, 0xa3, 0x6c, 0x5c, 0x39, 0xce, 0xaa, 0xcb, 0x07, 0xe0, 0xcc, - 0xc7, 0xe2, 0xd8, 0x23, 0xa7, 0x08, 0xb5, 0x27, 0x0e, 0x5c, 0xf2, 0x09, 0x90, 0xed, 0x24, 0xeb, - 0x36, 0x2a, 0x47, 0x6e, 0x33, 0x6f, 0xde, 0x7b, 0x33, 0xc9, 0xd8, 0x06, 0x9b, 0xa3, 0x34, 0x22, - 0x38, 0x66, 0x5f, 0xa8, 0x27, 0xe8, 0x80, 0x25, 0x52, 0x8c, 0xbd, 0xd1, 0x56, 0x40, 0x25, 0xde, - 0xf2, 0xb0, 0x94, 0x82, 0x05, 0xa9, 0xa4, 0x49, 0xef, 0x44, 0x70, 0xc9, 0xe1, 0x4a, 0x45, 0xee, - 0x95, 0xe4, 0x5e, 0x41, 0x5e, 0xb9, 0x31, 0xe0, 0x03, 0xae, 0x69, 0x9e, 0x8a, 0x8c, 0xa2, 0x9b, - 0x4d, 0x83, 0xd5, 0x63, 0x2a, 0x46, 0x8c, 0xd0, 0x23, 0xc1, 0x47, 0x2c, 0xa4, 0x02, 0x19, 0x25, - 0x96, 0x8c, 0xc7, 0xf0, 0x11, 0x98, 0x0b, 0x78, 0x1c, 0xfa, 0x2c, 0x6c, 0x39, 0x1d, 0x67, 0x63, - 0x7e, 0xcf, 0xcd, 0x33, 0x77, 0xf5, 0x73, 0xc2, 0xe3, 0xc7, 0x5d, 0x55, 0x38, 0x0c, 0xbb, 0x9d, - 0x31, 0x1e, 0x46, 0x55, 0x86, 0x66, 0x4d, 0x00, 0x0f, 0x00, 0x88, 0x30, 0xe1, 0x31, 0x23, 0x4a, - 0x3c, 0xad, 0xc5, 0xf7, 0xf2, 0xcc, 0x5d, 0x33, 0xe2, 0xa2, 0x36, 0xd1, 0x4f, 0x00, 0x34, 0x5f, - 0xc5, 0xf0, 0x15, 0x68, 0x9e, 0xee, 0xf4, 0xfb, 0xad, 0x46, 0xc7, 0xd9, 0x58, 0x78, 0xd8, 0xe9, - 0x5d, 0xff, 0x81, 0xbd, 0x77, 0x3b, 0xfd, 0xfe, 0xde, 0x6a, 0x9e, 0xb9, 0xb7, 0x4c, 0x07, 0xa5, - 0x2b, 0xcd, 0x75, 0x8c, 0xb4, 0x15, 0xf4, 0x40, 0x53, 0x8e, 0x4f, 0x68, 0xab, 0xa9, 0x47, 0xb2, - 0x04, 0x0a, 0x2d, 0x05, 0x3a, 0x46, 0x9a, 0x08, 0x9f, 0x80, 0xb9, 0x11, 0x15, 0x09, 0xe3, 0x71, - 0x6b, 0x56, 0x6b, 0xd6, 0xf2, 0xcc, 0xbd, 0x63, 0x34, 0x45, 0xa1, 0x94, 0x95, 0x29, 0x2a, 0x15, - 0xdd, 0x5f, 0x0d, 0xd0, 0x54, 0x93, 0xc1, 0xe7, 0x60, 0x81, 0xf0, 0xe1, 0x90, 0xc7, 0x7e, 0x8c, - 0x87, 0xb4, 0xf8, 0x9b, 0xeb, 0x79, 0xe6, 0xde, 0x35, 0x4e, 0xa6, 0xf8, 0x12, 0x0f, 0xab, 0x19, - 0x2c, 0x04, 0x81, 0x49, 0x02, 0x3f, 0x80, 0xff, 0xb9, 0x18, 0xa8, 0xbf, 0xa0, 0x77, 0xe4, 0xa7, - 0x31, 0x93, 0xc5, 0x0f, 0xde, 0xce, 0x33, 0xd7, 0x33, 0x7e, 0x36, 0xe5, 0x4d, 0xcc, 0x64, 0xe9, - 0x5a, 0xc3, 0xd1, 0xd2, 0x55, 0xa8, 0xd6, 0x41, 0x4f, 0xdc, 0xf8, 0x5b, 0x07, 0x7b, 0xee, 0x1a, - 0x7e, 0xb9, 0x83, 0xfe, 0x86, 0x23, 0xf0, 0x5f, 0xc4, 0x09, 0x8e, 0x98, 0x1c, 0x1b, 0x77, 0xb3, - 0x8d, 0xcd, 0x3c, 0x73, 0xd7, 0x8b, 0x03, 0x52, 0x94, 0x6d, 0xe7, 0x4b, 0x18, 0x5a, 0xb4, 0x53, - 0x75, 0xde, 0x12, 0x89, 0x25, 0x35, 0x76, 0x33, 0x57, 0xcf, 0x9b, 0xae, 0xd9, 0x5e, 0x13, 0x00, - 0xcd, 0x57, 0xb1, 0xda, 0x35, 0xe1, 0x69, 0x2c, 0xc5, 0xb8, 0xbe, 0xeb, 0xa2, 0x30, 0x59, 0x8f, - 0x49, 0x51, 0xa9, 0xe8, 0xfe, 0x6e, 0x80, 0xe5, 0xb7, 0x34, 0x48, 0x98, 0xa4, 0xf6, 0x25, 0x42, - 0x94, 0x70, 0x11, 0xc2, 0x4d, 0xd0, 0x48, 0x45, 0x54, 0x2c, 0x7e, 0x39, 0xcf, 0xdc, 0x9b, 0xc6, - 0x36, 0x15, 0x51, 0x69, 0xa9, 0x42, 0xa4, 0x58, 0xf0, 0xab, 0x03, 0x6e, 0x0b, 0x7a, 0xc2, 0x7d, - 0x61, 0x19, 0xf9, 0x42, 0x3b, 0xf9, 0xa4, 0xba, 0x50, 0x4f, 0xf3, 0xcc, 0xdd, 0x35, 0x36, 0x8a, - 0x5d, 0xef, 0xba, 0x7f, 0x78, 0x50, 0x9a, 0x5f, 0x4f, 0x40, 0xcb, 0xd7, 0xd4, 0x58, 0x08, 0x31, - 0x80, 0x41, 0xca, 0xa2, 0xd0, 0xc7, 0x42, 0xb2, 0x8f, 0x98, 0x48, 0xdd, 0xbd, 0x76, 0x16, 0x34, - 0x67, 0xb7, 0xa0, 0x58, 0x4d, 0x6b, 0x38, 0x5a, 0xba, 0x0c, 0xb1, 0x10, 0x1e, 0x82, 0x45, 0x19, - 0x25, 0x3e, 0xa1, 0xc2, 0x98, 0x37, 0xaf, 0x5e, 0x8d, 0xd7, 0x2f, 0x8e, 0xf7, 0xa9, 0xb0, 0x6d, - 0x2d, 0x04, 0x01, 0x19, 0x25, 0x3a, 0x61, 0x61, 0x75, 0xb7, 0x67, 0xfe, 0xc5, 0xdd, 0xde, 0x7b, - 0xf6, 0xfd, 0xbc, 0xed, 0x9c, 0x9d, 0xb7, 0x9d, 0x9f, 0xe7, 0x6d, 0xe7, 0xdb, 0x45, 0x7b, 0xea, - 0xec, 0xa2, 0x3d, 0xf5, 0xe3, 0xa2, 0x3d, 0xf5, 0xfe, 0xfe, 0x80, 0xc9, 0x4f, 0x69, 0xd0, 0x23, - 0x7c, 0xe8, 0x11, 0x2a, 0xc8, 0x03, 0xc6, 0xbd, 0xe2, 0x51, 0x0b, 0xbd, 0xd3, 0xc9, 0x4b, 0xae, - 0x66, 0x48, 0x82, 0x59, 0xfd, 0x16, 0x6f, 0xff, 0x09, 0x00, 0x00, 0xff, 0xff, 0x86, 0xbb, 0x04, - 0x2e, 0xec, 0x05, 0x00, 0x00, -} - -func (m *ServiceProviderRegistration) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ServiceProviderRegistration) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ServiceProviderRegistration) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Version) > 0 { - i -= len(m.Version) - copy(dAtA[i:], m.Version) - i = encodeVarintAttributes(dAtA, i, uint64(len(m.Version))) - i-- - dAtA[i] = 0x32 - } - if len(m.Type) > 0 { - i -= len(m.Type) - copy(dAtA[i:], m.Type) - i = encodeVarintAttributes(dAtA, i, uint64(len(m.Type))) - i-- - dAtA[i] = 0x22 - } - if m.X500 != nil { - { - size, err := m.X500.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintAttributes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if len(m.LaconicId) > 0 { - i -= len(m.LaconicId) - copy(dAtA[i:], m.LaconicId) - i = encodeVarintAttributes(dAtA, i, uint64(len(m.LaconicId))) - i-- - dAtA[i] = 0x12 - } - if len(m.BondId) > 0 { - i -= len(m.BondId) - copy(dAtA[i:], m.BondId) - i = encodeVarintAttributes(dAtA, i, uint64(len(m.BondId))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *X500) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *X500) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *X500) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Country) > 0 { - i -= len(m.Country) - copy(dAtA[i:], m.Country) - i = encodeVarintAttributes(dAtA, i, uint64(len(m.Country))) - i-- - dAtA[i] = 0x32 - } - if len(m.StateName) > 0 { - i -= len(m.StateName) - copy(dAtA[i:], m.StateName) - i = encodeVarintAttributes(dAtA, i, uint64(len(m.StateName))) - i-- - dAtA[i] = 0x2a - } - if len(m.LocalityName) > 0 { - i -= len(m.LocalityName) - copy(dAtA[i:], m.LocalityName) - i = encodeVarintAttributes(dAtA, i, uint64(len(m.LocalityName))) - i-- - dAtA[i] = 0x22 - } - if len(m.OrganizationName) > 0 { - i -= len(m.OrganizationName) - copy(dAtA[i:], m.OrganizationName) - i = encodeVarintAttributes(dAtA, i, uint64(len(m.OrganizationName))) - i-- - dAtA[i] = 0x1a - } - if len(m.OrganizationUnit) > 0 { - i -= len(m.OrganizationUnit) - copy(dAtA[i:], m.OrganizationUnit) - i = encodeVarintAttributes(dAtA, i, uint64(len(m.OrganizationUnit))) - i-- - dAtA[i] = 0x12 - } - if len(m.CommonName) > 0 { - i -= len(m.CommonName) - copy(dAtA[i:], m.CommonName) - i = encodeVarintAttributes(dAtA, i, uint64(len(m.CommonName))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *WebsiteRegistrationRecord) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *WebsiteRegistrationRecord) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *WebsiteRegistrationRecord) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Version) > 0 { - i -= len(m.Version) - copy(dAtA[i:], m.Version) - i = encodeVarintAttributes(dAtA, i, uint64(len(m.Version))) - i-- - dAtA[i] = 0x32 - } - if len(m.Type) > 0 { - i -= len(m.Type) - copy(dAtA[i:], m.Type) - i = encodeVarintAttributes(dAtA, i, uint64(len(m.Type))) - i-- - dAtA[i] = 0x2a - } - if len(m.TlsCertCid) > 0 { - i -= len(m.TlsCertCid) - copy(dAtA[i:], m.TlsCertCid) - i = encodeVarintAttributes(dAtA, i, uint64(len(m.TlsCertCid))) - i-- - dAtA[i] = 0x22 - } - if len(m.BuildArtifactCid) > 0 { - i -= len(m.BuildArtifactCid) - copy(dAtA[i:], m.BuildArtifactCid) - i = encodeVarintAttributes(dAtA, i, uint64(len(m.BuildArtifactCid))) - i-- - dAtA[i] = 0x1a - } - if len(m.RepoRegistrationRecordCid) > 0 { - i -= len(m.RepoRegistrationRecordCid) - copy(dAtA[i:], m.RepoRegistrationRecordCid) - i = encodeVarintAttributes(dAtA, i, uint64(len(m.RepoRegistrationRecordCid))) - i-- - dAtA[i] = 0x12 - } - if len(m.Url) > 0 { - i -= len(m.Url) - copy(dAtA[i:], m.Url) - i = encodeVarintAttributes(dAtA, i, uint64(len(m.Url))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintAttributes(dAtA []byte, offset int, v uint64) int { - offset -= sovAttributes(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *ServiceProviderRegistration) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.BondId) - if l > 0 { - n += 1 + l + sovAttributes(uint64(l)) - } - l = len(m.LaconicId) - if l > 0 { - n += 1 + l + sovAttributes(uint64(l)) - } - if m.X500 != nil { - l = m.X500.Size() - n += 1 + l + sovAttributes(uint64(l)) - } - l = len(m.Type) - if l > 0 { - n += 1 + l + sovAttributes(uint64(l)) - } - l = len(m.Version) - if l > 0 { - n += 1 + l + sovAttributes(uint64(l)) - } - return n -} - -func (m *X500) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.CommonName) - if l > 0 { - n += 1 + l + sovAttributes(uint64(l)) - } - l = len(m.OrganizationUnit) - if l > 0 { - n += 1 + l + sovAttributes(uint64(l)) - } - l = len(m.OrganizationName) - if l > 0 { - n += 1 + l + sovAttributes(uint64(l)) - } - l = len(m.LocalityName) - if l > 0 { - n += 1 + l + sovAttributes(uint64(l)) - } - l = len(m.StateName) - if l > 0 { - n += 1 + l + sovAttributes(uint64(l)) - } - l = len(m.Country) - if l > 0 { - n += 1 + l + sovAttributes(uint64(l)) - } - return n -} - -func (m *WebsiteRegistrationRecord) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Url) - if l > 0 { - n += 1 + l + sovAttributes(uint64(l)) - } - l = len(m.RepoRegistrationRecordCid) - if l > 0 { - n += 1 + l + sovAttributes(uint64(l)) - } - l = len(m.BuildArtifactCid) - if l > 0 { - n += 1 + l + sovAttributes(uint64(l)) - } - l = len(m.TlsCertCid) - if l > 0 { - n += 1 + l + sovAttributes(uint64(l)) - } - l = len(m.Type) - if l > 0 { - n += 1 + l + sovAttributes(uint64(l)) - } - l = len(m.Version) - if l > 0 { - n += 1 + l + sovAttributes(uint64(l)) - } - return n -} - -func sovAttributes(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozAttributes(x uint64) (n int) { - return sovAttributes(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *ServiceProviderRegistration) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAttributes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ServiceProviderRegistration: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ServiceProviderRegistration: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BondId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAttributes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthAttributes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAttributes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.BondId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LaconicId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAttributes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthAttributes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAttributes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.LaconicId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field X500", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAttributes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthAttributes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthAttributes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.X500 == nil { - m.X500 = &X500{} - } - if err := m.X500.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAttributes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthAttributes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAttributes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Type = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAttributes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthAttributes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAttributes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Version = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipAttributes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthAttributes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *X500) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAttributes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: X500: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: X500: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CommonName", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAttributes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthAttributes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAttributes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.CommonName = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OrganizationUnit", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAttributes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthAttributes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAttributes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.OrganizationUnit = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OrganizationName", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAttributes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthAttributes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAttributes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.OrganizationName = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LocalityName", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAttributes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthAttributes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAttributes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.LocalityName = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StateName", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAttributes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthAttributes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAttributes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.StateName = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Country", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAttributes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthAttributes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAttributes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Country = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipAttributes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthAttributes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *WebsiteRegistrationRecord) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAttributes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: WebsiteRegistrationRecord: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: WebsiteRegistrationRecord: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Url", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAttributes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthAttributes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAttributes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Url = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RepoRegistrationRecordCid", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAttributes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthAttributes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAttributes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.RepoRegistrationRecordCid = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BuildArtifactCid", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAttributes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthAttributes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAttributes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.BuildArtifactCid = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TlsCertCid", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAttributes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthAttributes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAttributes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.TlsCertCid = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAttributes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthAttributes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAttributes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Type = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAttributes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthAttributes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAttributes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Version = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipAttributes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthAttributes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipAttributes(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowAttributes - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowAttributes - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowAttributes - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthAttributes - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupAttributes - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthAttributes - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthAttributes = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowAttributes = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupAttributes = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/registry/types/codec.go b/x/registry/types/codec.go index 1a9dd50e..8be2cba9 100644 --- a/x/registry/types/codec.go +++ b/x/registry/types/codec.go @@ -39,17 +39,6 @@ func RegisterInterfaces(registry types.InterfaceRegistry) { &MsgReAssociateRecords{}, ) - registry.RegisterInterface( - "vulcanize.registry.v1beta1.ServiceProvideRegistration", - (*Attributes)(nil), - &ServiceProviderRegistration{}, - ) - - registry.RegisterInterface( - "vulcanize.registry.v1beta1.WebsiteRegistrationRecord", - (*Attributes)(nil), - &WebsiteRegistrationRecord{}, - ) msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) } diff --git a/x/registry/types/msg.go b/x/registry/types/msg.go index f2b511b5..1a3640a7 100644 --- a/x/registry/types/msg.go +++ b/x/registry/types/msg.go @@ -16,8 +16,8 @@ var ( ) // NewMsgSetName is the constructor function for MsgSetName. -func NewMsgSetName(crn string, cid string, signer sdk.AccAddress) MsgSetName { - return MsgSetName{ +func NewMsgSetName(crn string, cid string, signer sdk.AccAddress) *MsgSetName { + return &MsgSetName{ Crn: crn, Cid: cid, Signer: signer.String(), diff --git a/x/registry/types/record_msg.go b/x/registry/types/record_msg.go index 9fc4ced8..46c2789f 100644 --- a/x/registry/types/record_msg.go +++ b/x/registry/types/record_msg.go @@ -2,7 +2,6 @@ package types import ( errorsmod "cosmossdk.io/errors" - cdctypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) @@ -14,13 +13,11 @@ var ( _ sdk.Msg = &MsgDissociateBond{} _ sdk.Msg = &MsgDissociateRecords{} _ sdk.Msg = &MsgReAssociateRecords{} - - _ cdctypes.UnpackInterfacesMessage = &MsgSetRecord{} ) // NewMsgSetRecord is the constructor function for MsgSetRecord. -func NewMsgSetRecord(payload Payload, bondID string, signer sdk.AccAddress) MsgSetRecord { - return MsgSetRecord{ +func NewMsgSetRecord(payload Payload, bondID string, signer sdk.AccAddress) *MsgSetRecord { + return &MsgSetRecord{ Payload: payload, BondId: bondID, Signer: signer.String(), @@ -61,12 +58,6 @@ func (msg MsgSetRecord) GetSignBytes() []byte { return sdk.MustSortJSON(bz) } -// UnpackInterfaces implements UnpackInterfacesMessage.UnpackInterfaces -func (msg MsgSetRecord) UnpackInterfaces(unpacker cdctypes.AnyUnpacker) error { - var attr Attributes - return unpacker.UnpackAny(msg.Payload.Record.Attributes, &attr) -} - // NewMsgRenewRecord is the constructor function for MsgRenewRecord. func NewMsgRenewRecord(recordID string, signer sdk.AccAddress) MsgRenewRecord { return MsgRenewRecord{ diff --git a/x/registry/types/registry.pb.go b/x/registry/types/registry.pb.go index 26e43adf..4ea365c4 100644 --- a/x/registry/types/registry.pb.go +++ b/x/registry/types/registry.pb.go @@ -5,7 +5,7 @@ package types import ( fmt "fmt" - types1 "github.com/cosmos/cosmos-sdk/codec/types" + _ "github.com/cosmos/cosmos-sdk/codec/types" types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/gogo/protobuf/proto" @@ -155,17 +155,17 @@ func (m *Params) GetAuthorityAuctionMinimumBid() types.Coin { return types.Coin{} } -// Params defines the registry module records +// Record defines a registry record type Record struct { - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty" json:"id" yaml:"id"` - BondId string `protobuf:"bytes,2,opt,name=bond_id,json=bondId,proto3" json:"bond_id,omitempty" json:"bondId" yaml:"bondId"` - CreateTime string `protobuf:"bytes,3,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty" json:"createTime" yaml:"createTime"` - ExpiryTime string `protobuf:"bytes,4,opt,name=expiry_time,json=expiryTime,proto3" json:"expiry_time,omitempty" json:"expiryTime" yaml:"expiryTime"` - Deleted bool `protobuf:"varint,5,opt,name=deleted,proto3" json:"deleted,omitempty"` - Owners []string `protobuf:"bytes,6,rep,name=owners,proto3" json:"owners,omitempty" json:"owners" yaml:"owners"` - Attributes *types1.Any `protobuf:"bytes,7,opt,name=attributes,proto3" json:"attributes,omitempty" json:"attributes" yaml:"attributes"` - Names []string `protobuf:"bytes,8,rep,name=names,proto3" json:"names,omitempty" json:"names" yaml:"names"` - Type string `protobuf:"bytes,9,opt,name=type,proto3" json:"type,omitempty" json:"types" yaml:"types"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty" json:"id" yaml:"id"` + BondId string `protobuf:"bytes,2,opt,name=bond_id,json=bondId,proto3" json:"bond_id,omitempty" json:"bondId" yaml:"bondId"` + CreateTime string `protobuf:"bytes,3,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty" json:"createTime" yaml:"createTime"` + ExpiryTime string `protobuf:"bytes,4,opt,name=expiry_time,json=expiryTime,proto3" json:"expiry_time,omitempty" json:"expiryTime" yaml:"expiryTime"` + Deleted bool `protobuf:"varint,5,opt,name=deleted,proto3" json:"deleted,omitempty"` + Owners []string `protobuf:"bytes,6,rep,name=owners,proto3" json:"owners,omitempty" json:"owners" yaml:"owners"` + Attributes []byte `protobuf:"bytes,7,opt,name=attributes,proto3" json:"attributes,omitempty" json:"attributes" yaml:"attributes"` + Names []string `protobuf:"bytes,8,rep,name=names,proto3" json:"names,omitempty" json:"names" yaml:"names"` + Type string `protobuf:"bytes,9,opt,name=type,proto3" json:"type,omitempty" json:"types" yaml:"types"` } func (m *Record) Reset() { *m = Record{} } @@ -243,7 +243,7 @@ func (m *Record) GetOwners() []string { return nil } -func (m *Record) GetAttributes() *types1.Any { +func (m *Record) GetAttributes() []byte { if m != nil { return m.Attributes } @@ -264,7 +264,7 @@ func (m *Record) GetType() string { return "" } -// AuthorityEntry defines the registry module AuthorityEntries +// AuthorityEntry defines a registry authority type AuthorityEntry struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Entry *NameAuthority `protobuf:"bytes,2,opt,name=entry,proto3" json:"entry,omitempty"` @@ -466,7 +466,7 @@ func (m *NameEntry) GetEntry() *NameRecord { return nil } -// NameRecord +// NameRecord defines a versioned name record type NameRecord struct { Latest *NameRecordEntry `protobuf:"bytes,1,opt,name=latest,proto3" json:"latest,omitempty"` History []*NameRecordEntry `protobuf:"bytes,2,rep,name=history,proto3" json:"history,omitempty"` @@ -781,92 +781,91 @@ func init() { } var fileDescriptor_5ca0f65a0e7121be = []byte{ - // 1347 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x57, 0xdd, 0x6e, 0x1b, 0x45, - 0x14, 0xce, 0xc6, 0x89, 0x13, 0x9f, 0x34, 0x01, 0x0d, 0x69, 0xeb, 0x04, 0xea, 0x0d, 0x46, 0xa5, - 0x0d, 0xa1, 0xb6, 0x4a, 0x2f, 0xca, 0xaf, 0x50, 0x36, 0x49, 0x4b, 0x84, 0x80, 0x30, 0xed, 0x0d, - 0x48, 0x95, 0x35, 0xbb, 0x3b, 0xb5, 0x87, 0x7a, 0x77, 0xad, 0xdd, 0xd9, 0x52, 0x73, 0xc7, 0x1b, - 0xe4, 0xb2, 0x48, 0xbc, 0x01, 0x48, 0x3c, 0x06, 0xbd, 0xec, 0x25, 0x42, 0xc2, 0xa0, 0xe6, 0x0d, - 0xfc, 0x04, 0x68, 0xe7, 0x67, 0xff, 0x6c, 0xd7, 0x85, 0xde, 0xcd, 0xf9, 0xfb, 0xe6, 0x9b, 0x33, - 0xe7, 0x9c, 0xd9, 0x85, 0xdd, 0x87, 0x71, 0xdf, 0x21, 0x3e, 0xfb, 0x81, 0xb6, 0x43, 0xda, 0x65, - 0x11, 0x0f, 0x87, 0xed, 0x87, 0xd7, 0x6d, 0xca, 0xc9, 0xf5, 0x54, 0xd1, 0x1a, 0x84, 0x01, 0x0f, - 0xd0, 0x76, 0xea, 0xda, 0x4a, 0x2d, 0xca, 0x75, 0xbb, 0xd1, 0x0d, 0x82, 0x6e, 0x9f, 0xb6, 0x85, - 0xa7, 0x1d, 0xdf, 0x6f, 0xbb, 0x71, 0x48, 0x38, 0x0b, 0x7c, 0x19, 0xbb, 0x6d, 0x96, 0xed, 0x9c, - 0x79, 0x34, 0xe2, 0xc4, 0x1b, 0x28, 0x87, 0xcd, 0x6e, 0xd0, 0x0d, 0xc4, 0xb2, 0x9d, 0xac, 0x94, - 0xb6, 0xe1, 0x04, 0x91, 0x17, 0x44, 0x6d, 0x9b, 0x44, 0x34, 0xa5, 0xe5, 0x04, 0x4c, 0xc3, 0x6e, - 0x95, 0x61, 0x89, 0xaf, 0xd8, 0x36, 0xff, 0x5a, 0x87, 0xea, 0x09, 0x09, 0x89, 0x17, 0x21, 0x06, - 0x6b, 0x21, 0x75, 0x82, 0xd0, 0xed, 0x84, 0xd4, 0xe7, 0x75, 0x63, 0xc7, 0xb8, 0xba, 0xf6, 0xde, - 0x56, 0x4b, 0x62, 0xb7, 0x12, 0x6c, 0x7d, 0x8e, 0xd6, 0x41, 0xc0, 0x7c, 0xeb, 0xda, 0x93, 0x91, - 0xb9, 0x30, 0x1e, 0x99, 0x97, 0xbf, 0x8b, 0x02, 0xff, 0xc3, 0x66, 0x2e, 0xb6, 0xb9, 0x33, 0x24, - 0x5e, 0xbf, 0xa8, 0xc2, 0x20, 0x25, 0x4c, 0x7d, 0x8e, 0x4e, 0x0d, 0xd8, 0xcc, 0x19, 0x3b, 0x3a, - 0x0d, 0xf5, 0x45, 0xb5, 0xa9, 0x24, 0xdc, 0xd2, 0x84, 0x5b, 0x87, 0xca, 0xc1, 0x3a, 0x50, 0x9b, - 0xde, 0x9c, 0xd8, 0x34, 0x05, 0x99, 0xb2, 0x7b, 0x66, 0x7b, 0xfc, 0xb7, 0x69, 0x60, 0x94, 0x51, - 0xd1, 0xc0, 0x28, 0x86, 0x0d, 0x12, 0xf3, 0x5e, 0x10, 0x32, 0x3e, 0x94, 0x09, 0xa8, 0xcc, 0x4b, - 0xc0, 0x0d, 0xc5, 0x65, 0x4f, 0x72, 0x29, 0x86, 0x6b, 0x16, 0x25, 0x2d, 0x5e, 0x4f, 0x15, 0x22, - 0x13, 0x3f, 0x1b, 0x70, 0xb1, 0xe8, 0x92, 0x25, 0x63, 0x69, 0x5e, 0x32, 0x8e, 0x15, 0x81, 0x4f, - 0xa6, 0x11, 0x98, 0xc8, 0xc7, 0x2c, 0xb3, 0x48, 0xc9, 0xf9, 0x02, 0xad, 0x34, 0x2b, 0x8f, 0x0d, - 0xb8, 0x90, 0xc5, 0x75, 0x43, 0xe2, 0xd0, 0xce, 0x80, 0x86, 0x2c, 0x70, 0xeb, 0xcb, 0xf3, 0xd8, - 0xdd, 0x56, 0xec, 0x3e, 0x2a, 0xb3, 0xcb, 0xc3, 0x4c, 0x92, 0x2b, 0x58, 0x05, 0xb7, 0xcd, 0xd4, - 0x78, 0x3b, 0xb1, 0x9d, 0x08, 0x13, 0xfa, 0xd1, 0x80, 0xad, 0x2c, 0x8a, 0xc4, 0x4e, 0xb2, 0x69, - 0x87, 0xfa, 0xc4, 0xee, 0x53, 0xb7, 0x5e, 0xdd, 0x31, 0xae, 0xae, 0x5a, 0x47, 0xe3, 0x91, 0xb9, - 0x5f, 0xde, 0xbe, 0xe4, 0x3a, 0xc9, 0xa0, 0xec, 0x80, 0xb3, 0x1b, 0xda, 0x97, 0xa6, 0x23, 0x69, - 0x41, 0xbf, 0x1b, 0x30, 0x25, 0xce, 0x09, 0x3c, 0x8f, 0xf1, 0x28, 0xbb, 0xc8, 0x95, 0x79, 0xa9, - 0xea, 0xa8, 0x54, 0xdd, 0x99, 0xc5, 0xb5, 0x0c, 0x39, 0x9b, 0xf4, 0x84, 0xa7, 0x48, 0xa1, 0x59, - 0x3e, 0xc1, 0x81, 0x74, 0x4b, 0x2f, 0x7a, 0xfa, 0x49, 0x42, 0xfa, 0x90, 0x92, 0x7e, 0xee, 0x24, - 0xab, 0x2f, 0x7d, 0x92, 0x32, 0xe4, 0xec, 0x93, 0x4c, 0x78, 0x4e, 0x3f, 0x09, 0x96, 0x6e, 0xe9, - 0x49, 0x7e, 0x31, 0xe0, 0x8d, 0x59, 0x69, 0xe9, 0xdc, 0xa7, 0xb4, 0x5e, 0x9b, 0xd7, 0xd7, 0x5f, - 0xa9, 0x33, 0xdc, 0x7e, 0xfe, 0x6d, 0x24, 0x60, 0xf3, 0xee, 0x41, 0xf8, 0xe0, 0xad, 0xe9, 0xd9, - 0xbf, 0x45, 0xe9, 0x0c, 0xb6, 0xf2, 0xe8, 0x82, 0x2d, 0xbc, 0x34, 0xdb, 0x0c, 0x6c, 0x5e, 0xae, - 0x67, 0xb0, 0x95, 0x19, 0x4e, 0xd8, 0xfe, 0x66, 0xc0, 0xa5, 0xc9, 0x60, 0x8f, 0xf9, 0xcc, 0x8b, - 0xbd, 0x8e, 0xcd, 0xdc, 0xfa, 0xda, 0x3c, 0xba, 0x5f, 0x2b, 0xba, 0xc7, 0xb3, 0xe8, 0xe6, 0xd0, - 0x66, 0xf3, 0xcd, 0x3b, 0xe1, 0xed, 0x32, 0xe1, 0x2f, 0xa4, 0xd5, 0x62, 0x6e, 0xf3, 0xa7, 0x25, - 0xa8, 0x62, 0x31, 0xed, 0xd1, 0x15, 0x58, 0x64, 0xae, 0x78, 0xd6, 0x6a, 0xd6, 0xc5, 0xf1, 0xc8, - 0x7c, 0x4d, 0x32, 0xc8, 0xb6, 0x49, 0xb0, 0x16, 0x99, 0x8b, 0xde, 0x87, 0x15, 0x3b, 0xf0, 0xdd, - 0x0e, 0x73, 0xc5, 0x7b, 0x54, 0xb3, 0xcc, 0xf1, 0xc8, 0x7c, 0x5d, 0x7a, 0x27, 0x86, 0xe3, 0x34, - 0x42, 0x49, 0xb8, 0x2a, 0x17, 0xe8, 0x33, 0x58, 0x73, 0x42, 0x4a, 0x38, 0xed, 0x24, 0x0f, 0xb7, - 0x78, 0x41, 0x6a, 0xd6, 0x95, 0xf1, 0xc8, 0x7c, 0x4b, 0x46, 0x4b, 0xe3, 0x5d, 0xe6, 0xa5, 0x57, - 0x91, 0xd3, 0x60, 0xc8, 0x84, 0x04, 0x89, 0x3e, 0x1a, 0xb0, 0x70, 0x28, 0x91, 0x96, 0xca, 0x48, - 0xd2, 0x98, 0x47, 0xca, 0x69, 0x30, 0x64, 0x02, 0xaa, 0xc3, 0x8a, 0x4b, 0xfb, 0x94, 0x53, 0x39, - 0xb2, 0x57, 0xb1, 0x16, 0xd1, 0x4d, 0xa8, 0x06, 0xdf, 0xfb, 0x34, 0x8c, 0xea, 0xd5, 0x9d, 0x4a, - 0xf1, 0x98, 0x52, 0xaf, 0xa1, 0x95, 0x84, 0x95, 0x3b, 0xba, 0x07, 0x40, 0x38, 0x0f, 0x99, 0x1d, - 0x73, 0x1a, 0xa9, 0xe9, 0xb6, 0x39, 0x31, 0x13, 0xf6, 0xfd, 0x61, 0x9e, 0x71, 0x16, 0x91, 0x5e, - 0x6b, 0xa6, 0xc1, 0x39, 0x40, 0x74, 0x03, 0x96, 0x7d, 0xe2, 0xd1, 0xa8, 0xbe, 0x2a, 0x68, 0x5d, - 0x1a, 0x8f, 0xcc, 0x2d, 0x89, 0x21, 0xd4, 0x3a, 0x5c, 0x0a, 0x58, 0xfa, 0xa2, 0xeb, 0xb0, 0xc4, - 0x87, 0x03, 0xd9, 0xdd, 0x85, 0x98, 0x44, 0x9b, 0xc6, 0x48, 0x01, 0x0b, 0xd7, 0x26, 0x85, 0x8d, - 0x7d, 0x5d, 0x39, 0x47, 0x3e, 0x0f, 0x87, 0x08, 0xc1, 0x52, 0x82, 0x26, 0x8b, 0x04, 0x8b, 0x35, - 0xfa, 0x14, 0x96, 0x69, 0x62, 0x54, 0xdf, 0x26, 0xbb, 0xad, 0xd9, 0xdf, 0x77, 0xad, 0x2f, 0x89, - 0x47, 0x53, 0x48, 0x2c, 0xe3, 0x9a, 0x7f, 0x56, 0x60, 0xbd, 0x60, 0x40, 0xdf, 0xc0, 0xab, 0x22, - 0x93, 0x9d, 0x41, 0x6c, 0xf7, 0x99, 0xd3, 0x79, 0x40, 0x87, 0xaa, 0x2e, 0xdb, 0xd9, 0xe7, 0x84, - 0xf0, 0x38, 0x11, 0x0e, 0x9f, 0xd3, 0x61, 0xe1, 0x2a, 0x32, 0x2d, 0xde, 0x28, 0x2a, 0xd0, 0x09, - 0xac, 0x4b, 0x68, 0xe2, 0xba, 0x21, 0x8d, 0x22, 0x55, 0xc1, 0x7b, 0xe3, 0x91, 0x79, 0x25, 0x87, - 0xbb, 0x2f, 0xad, 0x05, 0x54, 0xad, 0xc3, 0xe7, 0xf2, 0x22, 0xba, 0x00, 0xd5, 0x1e, 0x65, 0xdd, - 0x9e, 0xfc, 0x20, 0x5a, 0xc2, 0x4a, 0x4a, 0xf4, 0x11, 0x27, 0x3c, 0x8e, 0x64, 0x71, 0x62, 0x25, - 0xa1, 0x43, 0x00, 0xdd, 0xa5, 0x4c, 0x96, 0x5c, 0xcd, 0xba, 0x3c, 0x1e, 0x99, 0x6f, 0xea, 0x86, - 0x17, 0xb6, 0xe3, 0xc3, 0xac, 0xb9, 0xb5, 0x02, 0xd7, 0xf4, 0xba, 0xd0, 0x83, 0xd5, 0xa9, 0x3d, - 0x78, 0x58, 0xe8, 0xc1, 0xc3, 0xac, 0x07, 0xfb, 0xc5, 0xce, 0x91, 0xd5, 0xb9, 0x3d, 0x51, 0x9d, - 0x77, 0xf5, 0x97, 0xb5, 0xd5, 0x56, 0x13, 0xe9, 0x45, 0x3a, 0xeb, 0x34, 0x79, 0x82, 0x72, 0xdd, - 0xd5, 0xbc, 0x07, 0xb5, 0xe4, 0x6e, 0x67, 0x97, 0xcf, 0xc7, 0xc5, 0xf2, 0x79, 0x7b, 0x5e, 0xf9, - 0xc8, 0x61, 0xa5, 0x6b, 0xe7, 0xb1, 0x01, 0x90, 0x69, 0xd1, 0x01, 0x54, 0xfb, 0x84, 0xd3, 0x48, - 0x7f, 0x9d, 0xef, 0xbd, 0x18, 0x9a, 0x60, 0x87, 0x55, 0x28, 0x3a, 0x82, 0x95, 0x1e, 0x8b, 0x78, - 0x20, 0x38, 0x55, 0xfe, 0x2b, 0x8a, 0x8e, 0x6d, 0x7e, 0x00, 0xaf, 0x94, 0x6c, 0x68, 0x23, 0x9b, - 0xb0, 0x62, 0x90, 0x66, 0xa5, 0xb3, 0x98, 0x2f, 0x9d, 0x66, 0x08, 0xb5, 0x3b, 0xac, 0xeb, 0x13, - 0x1e, 0x87, 0x14, 0xed, 0x41, 0x25, 0x62, 0x5d, 0x55, 0xff, 0x5b, 0xe3, 0x91, 0x79, 0x5e, 0xde, - 0x43, 0xc4, 0xba, 0xfa, 0x02, 0x92, 0x25, 0x4e, 0xbc, 0x92, 0xb2, 0x18, 0xc4, 0xb6, 0x68, 0x98, - 0x89, 0xd1, 0x3c, 0x88, 0xed, 0x5c, 0xa3, 0x28, 0x09, 0x57, 0xd5, 0xe2, 0x74, 0x11, 0x36, 0xac, - 0x7e, 0xe0, 0x3c, 0x38, 0xe8, 0x11, 0xbf, 0x4b, 0xef, 0x50, 0x9e, 0xa3, 0x97, 0x6c, 0x5e, 0x49, - 0x2b, 0xbb, 0x0e, 0x2b, 0xf2, 0x07, 0x21, 0x12, 0x09, 0xaa, 0x61, 0x2d, 0xa2, 0x6d, 0x58, 0x55, - 0x25, 0x1a, 0xd5, 0x2b, 0xc2, 0x94, 0xca, 0xe8, 0x11, 0x9c, 0xd3, 0x75, 0x6f, 0x33, 0x37, 0xe9, - 0x8a, 0x24, 0xb7, 0xef, 0x3c, 0x2f, 0xb7, 0xea, 0xb9, 0xb2, 0x98, 0x7b, 0xec, 0xdf, 0x0f, 0xac, - 0xdd, 0xec, 0x67, 0x8a, 0xa4, 0x96, 0xa8, 0xd4, 0x27, 0x42, 0x85, 0xd7, 0x72, 0x12, 0xda, 0x81, - 0x35, 0xfd, 0x02, 0x32, 0x1a, 0xd5, 0x97, 0x05, 0xb1, 0xbc, 0x0a, 0x6d, 0xea, 0x89, 0x2a, 0x06, - 0xbd, 0x1a, 0x99, 0xcd, 0x5f, 0x8d, 0x64, 0x00, 0xe6, 0x29, 0x94, 0x9a, 0xd7, 0xf8, 0x9f, 0xcd, - 0x7b, 0x17, 0x36, 0x6c, 0xe6, 0xba, 0x13, 0x53, 0xe8, 0xda, 0x78, 0x64, 0xee, 0xaa, 0x1e, 0x16, - 0xf6, 0xd2, 0x18, 0x2a, 0x2a, 0xf1, 0x7a, 0x41, 0xb6, 0x6e, 0x3d, 0x79, 0xd6, 0x30, 0x9e, 0x3e, - 0x6b, 0x18, 0xff, 0x3c, 0x6b, 0x18, 0xa7, 0x67, 0x8d, 0x85, 0xa7, 0x67, 0x8d, 0x85, 0x3f, 0xce, - 0x1a, 0x0b, 0xdf, 0xbe, 0xdb, 0x65, 0xbc, 0x17, 0xdb, 0x2d, 0x27, 0xf0, 0xda, 0x0e, 0x0d, 0x9d, - 0x6b, 0x2c, 0x68, 0xf7, 0x89, 0x13, 0xf8, 0xcc, 0x71, 0xdb, 0x8f, 0xb2, 0x3f, 0x76, 0x31, 0xfd, - 0xed, 0xaa, 0x98, 0x01, 0x37, 0xfe, 0x0d, 0x00, 0x00, 0xff, 0xff, 0xd7, 0x03, 0x2e, 0xc4, 0xd4, - 0x0f, 0x00, 0x00, + // 1344 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x57, 0xdd, 0x6e, 0x1b, 0xc5, + 0x17, 0xcf, 0xc6, 0x89, 0x13, 0x9f, 0x34, 0xf9, 0xff, 0x35, 0xa4, 0xad, 0x13, 0xa8, 0x37, 0x18, + 0x95, 0x36, 0x84, 0xda, 0x2a, 0xbd, 0x28, 0x9f, 0x42, 0xd9, 0x24, 0x0d, 0x11, 0x02, 0xc2, 0xb4, + 0x37, 0x20, 0x21, 0x6b, 0x76, 0x77, 0x6a, 0x0f, 0xf5, 0xee, 0x5a, 0xbb, 0xb3, 0xa5, 0xe6, 0x0e, + 0xf1, 0x02, 0xb9, 0xec, 0x05, 0x6f, 0x00, 0x12, 0x8f, 0x41, 0x2f, 0x7b, 0x89, 0x90, 0x30, 0xa8, + 0x79, 0x03, 0x3f, 0x01, 0xda, 0xf9, 0xd8, 0x2f, 0xdb, 0x75, 0xa1, 0x77, 0x73, 0xbe, 0x7e, 0xf3, + 0x9b, 0x33, 0xe7, 0x9c, 0xd9, 0x85, 0xdd, 0x87, 0x71, 0xdf, 0x21, 0x3e, 0xfb, 0x9e, 0xb6, 0x43, + 0xda, 0x65, 0x11, 0x0f, 0x87, 0xed, 0x87, 0x37, 0x6d, 0xca, 0xc9, 0xcd, 0x54, 0xd1, 0x1a, 0x84, + 0x01, 0x0f, 0xd0, 0x76, 0xea, 0xda, 0x4a, 0x2d, 0xca, 0x75, 0xbb, 0xd1, 0x0d, 0x82, 0x6e, 0x9f, + 0xb6, 0x85, 0xa7, 0x1d, 0xdf, 0x6f, 0xbb, 0x71, 0x48, 0x38, 0x0b, 0x7c, 0x19, 0xbb, 0x6d, 0x96, + 0xed, 0x9c, 0x79, 0x34, 0xe2, 0xc4, 0x1b, 0x28, 0x87, 0xcd, 0x6e, 0xd0, 0x0d, 0xc4, 0xb2, 0x9d, + 0xac, 0x94, 0xb6, 0xe1, 0x04, 0x91, 0x17, 0x44, 0x6d, 0x9b, 0x44, 0x34, 0xa5, 0xe5, 0x04, 0x4c, + 0xc3, 0x6e, 0x95, 0x61, 0x89, 0xaf, 0xd8, 0x36, 0xff, 0x5c, 0x87, 0xea, 0x29, 0x09, 0x89, 0x17, + 0x21, 0x06, 0x6b, 0x21, 0x75, 0x82, 0xd0, 0xed, 0x84, 0xd4, 0xe7, 0x75, 0x63, 0xc7, 0xb8, 0xbe, + 0xf6, 0xce, 0x56, 0x4b, 0x62, 0xb7, 0x12, 0x6c, 0x7d, 0x8e, 0xd6, 0x41, 0xc0, 0x7c, 0xeb, 0xc6, + 0x93, 0x91, 0xb9, 0x30, 0x1e, 0x99, 0x57, 0xbf, 0x8d, 0x02, 0xff, 0xfd, 0x66, 0x2e, 0xb6, 0xb9, + 0x33, 0x24, 0x5e, 0xbf, 0xa8, 0xc2, 0x20, 0x25, 0x4c, 0x7d, 0x8e, 0xce, 0x0c, 0xd8, 0xcc, 0x19, + 0x3b, 0x3a, 0x0d, 0xf5, 0x45, 0xb5, 0xa9, 0x24, 0xdc, 0xd2, 0x84, 0x5b, 0x87, 0xca, 0xc1, 0x3a, + 0x50, 0x9b, 0xde, 0x9e, 0xd8, 0x34, 0x05, 0x99, 0xb2, 0x7b, 0x66, 0x7b, 0xfc, 0x97, 0x69, 0x60, + 0x94, 0x51, 0xd1, 0xc0, 0x28, 0x86, 0x0d, 0x12, 0xf3, 0x5e, 0x10, 0x32, 0x3e, 0x94, 0x09, 0xa8, + 0xcc, 0x4b, 0xc0, 0x2d, 0xc5, 0x65, 0x4f, 0x72, 0x29, 0x86, 0x6b, 0x16, 0x25, 0x2d, 0x5e, 0x4f, + 0x15, 0x22, 0x13, 0x3f, 0x19, 0x70, 0xb9, 0xe8, 0x92, 0x25, 0x63, 0x69, 0x5e, 0x32, 0x4e, 0x14, + 0x81, 0x8f, 0xa6, 0x11, 0x98, 0xc8, 0xc7, 0x2c, 0xb3, 0x48, 0xc9, 0xc5, 0x02, 0xad, 0x34, 0x2b, + 0x8f, 0x0d, 0xb8, 0x94, 0xc5, 0x75, 0x43, 0xe2, 0xd0, 0xce, 0x80, 0x86, 0x2c, 0x70, 0xeb, 0xcb, + 0xf3, 0xd8, 0x1d, 0x2b, 0x76, 0x1f, 0x94, 0xd9, 0xe5, 0x61, 0x26, 0xc9, 0x15, 0xac, 0x82, 0xdb, + 0x66, 0x6a, 0x3c, 0x4e, 0x6c, 0xa7, 0xc2, 0x84, 0x7e, 0x30, 0x60, 0x2b, 0x8b, 0x22, 0xb1, 0x93, + 0x6c, 0xda, 0xa1, 0x3e, 0xb1, 0xfb, 0xd4, 0xad, 0x57, 0x77, 0x8c, 0xeb, 0xab, 0xd6, 0xd1, 0x78, + 0x64, 0xee, 0x97, 0xb7, 0x2f, 0xb9, 0x4e, 0x32, 0x28, 0x3b, 0xe0, 0xec, 0x86, 0xf6, 0xa5, 0xe9, + 0x48, 0x5a, 0xd0, 0x6f, 0x06, 0x4c, 0x89, 0x73, 0x02, 0xcf, 0x63, 0x3c, 0xca, 0x2e, 0x72, 0x65, + 0x5e, 0xaa, 0x3a, 0x2a, 0x55, 0x77, 0x67, 0x71, 0x2d, 0x43, 0xce, 0x26, 0x3d, 0xe1, 0x29, 0x52, + 0x68, 0x96, 0x4f, 0x70, 0x20, 0xdd, 0xd2, 0x8b, 0x9e, 0x7e, 0x92, 0x90, 0x3e, 0xa4, 0xa4, 0x9f, + 0x3b, 0xc9, 0xea, 0x4b, 0x9f, 0xa4, 0x0c, 0x39, 0xfb, 0x24, 0x13, 0x9e, 0xd3, 0x4f, 0x82, 0xa5, + 0x5b, 0x7a, 0x92, 0x9f, 0x0d, 0x78, 0x6d, 0x56, 0x5a, 0x3a, 0xf7, 0x29, 0xad, 0xd7, 0xe6, 0xf5, + 0xf5, 0x17, 0xea, 0x0c, 0xc7, 0xcf, 0xbf, 0x8d, 0x04, 0x6c, 0xde, 0x3d, 0x08, 0x1f, 0xbc, 0x35, + 0x3d, 0xfb, 0x77, 0x28, 0x9d, 0xc1, 0x56, 0x1e, 0x5d, 0xb0, 0x85, 0x97, 0x66, 0x9b, 0x81, 0xcd, + 0xcb, 0xf5, 0x0c, 0xb6, 0x32, 0xc3, 0x09, 0xdb, 0x5f, 0x0d, 0xb8, 0x32, 0x19, 0xec, 0x31, 0x9f, + 0x79, 0xb1, 0xd7, 0xb1, 0x99, 0x5b, 0x5f, 0x9b, 0x47, 0xf7, 0x4b, 0x45, 0xf7, 0x64, 0x16, 0xdd, + 0x1c, 0xda, 0x6c, 0xbe, 0x79, 0x27, 0xbc, 0x5d, 0x26, 0xfc, 0x99, 0xb4, 0x5a, 0xcc, 0x6d, 0xfe, + 0xb8, 0x04, 0x55, 0x2c, 0xa6, 0x3d, 0xba, 0x06, 0x8b, 0xcc, 0x15, 0xcf, 0x5a, 0xcd, 0xba, 0x3c, + 0x1e, 0x99, 0xaf, 0x48, 0x06, 0xd9, 0x36, 0x09, 0xd6, 0x22, 0x73, 0xd1, 0xbb, 0xb0, 0x62, 0x07, + 0xbe, 0xdb, 0x61, 0xae, 0x78, 0x8f, 0x6a, 0x96, 0x39, 0x1e, 0x99, 0xaf, 0x4a, 0xef, 0xc4, 0x70, + 0x92, 0x46, 0x28, 0x09, 0x57, 0xe5, 0x02, 0x7d, 0x02, 0x6b, 0x4e, 0x48, 0x09, 0xa7, 0x9d, 0xe4, + 0xe1, 0x16, 0x2f, 0x48, 0xcd, 0xba, 0x36, 0x1e, 0x99, 0x6f, 0xc8, 0x68, 0x69, 0xbc, 0xc7, 0xbc, + 0xf4, 0x2a, 0x72, 0x1a, 0x0c, 0x99, 0x90, 0x20, 0xd1, 0x47, 0x03, 0x16, 0x0e, 0x25, 0xd2, 0x52, + 0x19, 0x49, 0x1a, 0xf3, 0x48, 0x39, 0x0d, 0x86, 0x4c, 0x40, 0x75, 0x58, 0x71, 0x69, 0x9f, 0x72, + 0x2a, 0x47, 0xf6, 0x2a, 0xd6, 0x22, 0xba, 0x0d, 0xd5, 0xe0, 0x3b, 0x9f, 0x86, 0x51, 0xbd, 0xba, + 0x53, 0x29, 0x1e, 0x53, 0xea, 0x35, 0xb4, 0x92, 0xb0, 0x72, 0x47, 0xc7, 0x00, 0x84, 0xf3, 0x90, + 0xd9, 0x31, 0xa7, 0x91, 0x98, 0x6e, 0x17, 0xf2, 0xdc, 0x32, 0x5b, 0x7a, 0x81, 0x99, 0x06, 0xe7, + 0x42, 0xd1, 0x2d, 0x58, 0xf6, 0x89, 0x47, 0xa3, 0xfa, 0xaa, 0x20, 0x70, 0x65, 0x3c, 0x32, 0xb7, + 0x24, 0x86, 0x50, 0xeb, 0x70, 0x29, 0x60, 0xe9, 0x8b, 0x6e, 0xc2, 0x12, 0x1f, 0x0e, 0x64, 0x1f, + 0x17, 0x62, 0x12, 0x6d, 0x1a, 0x23, 0x05, 0x2c, 0x5c, 0x9b, 0x14, 0x36, 0xf6, 0x75, 0x8d, 0x1c, + 0xf9, 0x3c, 0x1c, 0x22, 0x04, 0x4b, 0x09, 0x9a, 0x2c, 0x07, 0x2c, 0xd6, 0xe8, 0x63, 0x58, 0xa6, + 0x89, 0x51, 0x7d, 0x85, 0xec, 0xb6, 0x66, 0x7f, 0xc9, 0xb5, 0x3e, 0x27, 0x1e, 0x4d, 0x21, 0xb1, + 0x8c, 0x6b, 0xfe, 0x51, 0x81, 0xf5, 0x82, 0x01, 0x7d, 0x05, 0xff, 0x17, 0x39, 0xeb, 0x0c, 0x62, + 0xbb, 0xcf, 0x9c, 0xce, 0x03, 0x3a, 0x54, 0x15, 0xd8, 0xce, 0x3e, 0x1c, 0x84, 0xc7, 0xa9, 0x70, + 0xf8, 0x94, 0x0e, 0x0b, 0x49, 0xcf, 0xb4, 0x78, 0xa3, 0xa8, 0x40, 0xa7, 0xb0, 0x2e, 0xa1, 0x89, + 0xeb, 0x86, 0x34, 0x8a, 0x54, 0xad, 0xee, 0x8d, 0x47, 0xe6, 0xb5, 0x1c, 0xee, 0xbe, 0xb4, 0x16, + 0x50, 0xb5, 0x0e, 0x5f, 0xc8, 0x8b, 0xe8, 0x12, 0x54, 0x7b, 0x94, 0x75, 0x7b, 0xf2, 0xd3, 0x67, + 0x09, 0x2b, 0x29, 0xd1, 0x47, 0x9c, 0xf0, 0x38, 0x92, 0x65, 0x88, 0x95, 0x84, 0x0e, 0x01, 0x74, + 0x3f, 0x32, 0x59, 0x5c, 0x35, 0xeb, 0xea, 0x78, 0x64, 0xbe, 0xae, 0x5b, 0x5b, 0xd8, 0x4e, 0x0e, + 0xb3, 0x36, 0xd6, 0x0a, 0x5c, 0xd3, 0xeb, 0x42, 0xb7, 0x55, 0xa7, 0x76, 0xdb, 0x61, 0xa1, 0xdb, + 0x0e, 0xb3, 0x6e, 0xeb, 0x17, 0x7b, 0x44, 0xbe, 0xb2, 0xdb, 0x13, 0x6f, 0xd3, 0x3d, 0xfd, 0x0d, + 0x6d, 0xb5, 0xd5, 0xec, 0x79, 0x91, 0x1e, 0x3a, 0x4b, 0x1e, 0x9b, 0x5c, 0x1f, 0x35, 0xbf, 0x81, + 0x5a, 0x72, 0xb7, 0xb3, 0xcb, 0xe7, 0xc3, 0x62, 0xf9, 0xbc, 0x39, 0xaf, 0x7c, 0xe4, 0x58, 0xd2, + 0xb5, 0xf3, 0xd8, 0x00, 0xc8, 0xb4, 0xe8, 0x00, 0xaa, 0x7d, 0xc2, 0x69, 0xa4, 0xbf, 0xc3, 0xf7, + 0x5e, 0x0c, 0x4d, 0xb0, 0xc3, 0x2a, 0x14, 0x1d, 0xc1, 0x4a, 0x8f, 0x45, 0x3c, 0x10, 0x9c, 0x2a, + 0xff, 0x16, 0x45, 0xc7, 0x36, 0xdf, 0x83, 0xff, 0x95, 0x6c, 0x68, 0x23, 0x9b, 0xa5, 0x62, 0x64, + 0x66, 0xa5, 0xb3, 0x98, 0x2f, 0x9d, 0x66, 0x08, 0xb5, 0xbb, 0xac, 0xeb, 0x13, 0x1e, 0x87, 0x14, + 0xed, 0x41, 0x25, 0x62, 0x5d, 0x55, 0xff, 0x5b, 0xe3, 0x91, 0x79, 0x51, 0xde, 0x43, 0xc4, 0xba, + 0xfa, 0x02, 0x92, 0x25, 0x4e, 0xbc, 0x92, 0xb2, 0x18, 0xc4, 0xb6, 0x68, 0x98, 0x89, 0x21, 0x3c, + 0x88, 0xed, 0x5c, 0xa3, 0x28, 0x09, 0x57, 0xd5, 0xe2, 0x6c, 0x11, 0x36, 0xac, 0x7e, 0xe0, 0x3c, + 0x38, 0xe8, 0x11, 0xbf, 0x4b, 0xef, 0x52, 0x9e, 0xa3, 0x97, 0x6c, 0x5e, 0x49, 0x2b, 0xbb, 0x0e, + 0x2b, 0xf2, 0x57, 0x20, 0x12, 0x09, 0xaa, 0x61, 0x2d, 0xa2, 0x6d, 0x58, 0x55, 0x25, 0x1a, 0xd5, + 0x2b, 0xc2, 0x94, 0xca, 0xe8, 0x11, 0x5c, 0xd0, 0x75, 0x6f, 0x33, 0x37, 0xe9, 0x8a, 0x24, 0xb7, + 0x6f, 0x3d, 0x2f, 0xb7, 0xea, 0x61, 0xb2, 0x98, 0x7b, 0xe2, 0xdf, 0x0f, 0xac, 0xdd, 0xec, 0xb7, + 0x89, 0xa4, 0x96, 0xa8, 0xd4, 0x27, 0x42, 0x85, 0xd7, 0x72, 0x12, 0xda, 0x81, 0x35, 0xfd, 0xd6, + 0x31, 0x1a, 0xd5, 0x97, 0x05, 0xb1, 0xbc, 0x0a, 0x6d, 0xea, 0x89, 0x2a, 0x46, 0xba, 0x1a, 0x99, + 0xcd, 0x5f, 0x8c, 0x64, 0x00, 0xe6, 0x29, 0x94, 0x9a, 0xd7, 0xf8, 0x8f, 0xcd, 0x7b, 0x0f, 0x36, + 0x6c, 0xe6, 0xba, 0x13, 0x53, 0xe8, 0xc6, 0x78, 0x64, 0xee, 0xaa, 0x1e, 0x16, 0xf6, 0xd2, 0x18, + 0x2a, 0x2a, 0xf1, 0x7a, 0x41, 0xb6, 0xee, 0x3c, 0x79, 0xd6, 0x30, 0x9e, 0x3e, 0x6b, 0x18, 0x7f, + 0x3f, 0x6b, 0x18, 0x67, 0xe7, 0x8d, 0x85, 0xa7, 0xe7, 0x8d, 0x85, 0xdf, 0xcf, 0x1b, 0x0b, 0x5f, + 0xbf, 0xdd, 0x65, 0xbc, 0x17, 0xdb, 0x2d, 0x27, 0xf0, 0xda, 0x0e, 0x0d, 0x9d, 0x1b, 0x2c, 0x68, + 0xf7, 0x89, 0x13, 0xf8, 0xcc, 0x71, 0xdb, 0x8f, 0xb2, 0x7f, 0x73, 0x31, 0xfd, 0xed, 0xaa, 0x98, + 0x01, 0xb7, 0xfe, 0x09, 0x00, 0x00, 0xff, 0xff, 0x03, 0x19, 0xcc, 0xfc, 0xbe, 0x0f, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { @@ -1028,15 +1027,10 @@ func (m *Record) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0x42 } } - if m.Attributes != nil { - { - size, err := m.Attributes.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRegistry(dAtA, i, uint64(size)) - } + if len(m.Attributes) > 0 { + i -= len(m.Attributes) + copy(dAtA[i:], m.Attributes) + i = encodeVarintRegistry(dAtA, i, uint64(len(m.Attributes))) i-- dAtA[i] = 0x3a } @@ -1152,12 +1146,12 @@ func (m *NameAuthority) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - n13, err13 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.ExpiryTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.ExpiryTime):]) - if err13 != nil { - return 0, err13 + n12, err12 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.ExpiryTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.ExpiryTime):]) + if err12 != nil { + return 0, err12 } - i -= n13 - i = encodeVarintRegistry(dAtA, i, uint64(n13)) + i -= n12 + i = encodeVarintRegistry(dAtA, i, uint64(n12)) i-- dAtA[i] = 0x3a if len(m.BondId) > 0 { @@ -1555,8 +1549,8 @@ func (m *Record) Size() (n int) { n += 1 + l + sovRegistry(uint64(l)) } } - if m.Attributes != nil { - l = m.Attributes.Size() + l = len(m.Attributes) + if l > 0 { n += 1 + l + sovRegistry(uint64(l)) } if len(m.Names) > 0 { @@ -2370,7 +2364,7 @@ func (m *Record) Unmarshal(dAtA []byte) error { if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Attributes", wireType) } - var msglen int + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRegistry @@ -2380,26 +2374,24 @@ func (m *Record) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + if byteLen < 0 { return ErrInvalidLengthRegistry } - postIndex := iNdEx + msglen + postIndex := iNdEx + byteLen if postIndex < 0 { return ErrInvalidLengthRegistry } if postIndex > l { return io.ErrUnexpectedEOF } + m.Attributes = append(m.Attributes[:0], dAtA[iNdEx:postIndex]...) if m.Attributes == nil { - m.Attributes = &types1.Any{} - } - if err := m.Attributes.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + m.Attributes = []byte{} } iNdEx = postIndex case 8: diff --git a/x/registry/types/tx.pb.go b/x/registry/types/tx.pb.go index bab14347..70440c6b 100644 --- a/x/registry/types/tx.pb.go +++ b/x/registry/types/tx.pb.go @@ -385,7 +385,7 @@ func (m *MsgReserveAuthorityResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgReserveAuthorityResponse proto.InternalMessageInfo -// MsgSetAuthorityBond is SDK message for SetAuthorityBond +// MsgSetAuthorityBond type MsgSetAuthorityBond struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` BondId string `protobuf:"bytes,2,opt,name=bond_id,json=bondId,proto3" json:"bond_id,omitempty" json:"bondId" yaml:"bondId"` @@ -483,7 +483,7 @@ func (m *MsgSetAuthorityBondResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgSetAuthorityBondResponse proto.InternalMessageInfo -// MsgDeleteNameAuthority is SDK message for DeleteNameAuthority +// MsgDeleteNameAuthority type MsgDeleteNameAuthority struct { Crn string `protobuf:"bytes,1,opt,name=crn,proto3" json:"crn,omitempty"` Signer string `protobuf:"bytes,2,opt,name=signer,proto3" json:"signer,omitempty"` @@ -573,7 +573,7 @@ func (m *MsgDeleteNameAuthorityResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgDeleteNameAuthorityResponse proto.InternalMessageInfo -// MsgRenewRecord is SDK message for Renew a record +// MsgRenewRecord type MsgRenewRecord struct { RecordId string `protobuf:"bytes,1,opt,name=record_id,json=recordId,proto3" json:"record_id,omitempty" json:"recordId" yaml:"recordId"` Signer string `protobuf:"bytes,2,opt,name=signer,proto3" json:"signer,omitempty"` @@ -761,7 +761,7 @@ func (m *MsgAssociateBondResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgAssociateBondResponse proto.InternalMessageInfo -// MsgDissociateBond is SDK message for Msg/DissociateBond +// MsgDissociateBond type MsgDissociateBond struct { RecordId string `protobuf:"bytes,1,opt,name=record_id,json=recordId,proto3" json:"record_id,omitempty" json:"recordId" yaml:"recordId"` Signer string `protobuf:"bytes,2,opt,name=signer,proto3" json:"signer,omitempty"` @@ -814,7 +814,7 @@ func (m *MsgDissociateBond) GetSigner() string { return "" } -// MsgDissociateBondResponse is response type for MsgDissociateBond +// MsgDissociateBondResponse type MsgDissociateBondResponse struct { } @@ -851,7 +851,7 @@ func (m *MsgDissociateBondResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgDissociateBondResponse proto.InternalMessageInfo -// MsgDissociateRecords is SDK message for Msg/DissociateRecords +// MsgDissociateRecords type MsgDissociateRecords struct { BondId string `protobuf:"bytes,1,opt,name=bond_id,json=bondId,proto3" json:"bond_id,omitempty" json:"bondId" yaml:"bondId"` Signer string `protobuf:"bytes,2,opt,name=signer,proto3" json:"signer,omitempty"` @@ -904,7 +904,7 @@ func (m *MsgDissociateRecords) GetSigner() string { return "" } -// MsgDissociateRecordsResponse is response type for MsgDissociateRecords +// MsgDissociateRecordsResponse type MsgDissociateRecordsResponse struct { } @@ -941,7 +941,7 @@ func (m *MsgDissociateRecordsResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgDissociateRecordsResponse proto.InternalMessageInfo -// MsgReAssociateRecords is SDK message for Msg/ReAssociateRecords +// MsgReAssociateRecords type MsgReAssociateRecords struct { NewBondId string `protobuf:"bytes,1,opt,name=new_bond_id,json=newBondId,proto3" json:"new_bond_id,omitempty" json:"newBondId" yaml:"newBondId"` OldBondId string `protobuf:"bytes,2,opt,name=old_bond_id,json=oldBondId,proto3" json:"old_bond_id,omitempty" json:"oldBondId" yaml:"oldBondId"` @@ -1002,7 +1002,7 @@ func (m *MsgReAssociateRecords) GetSigner() string { return "" } -// MsgReAssociateRecordsResponse is response type for MsgReAssociateRecords +// MsgReAssociateRecordsResponse type MsgReAssociateRecordsResponse struct { } @@ -1147,9 +1147,9 @@ const _ = grpc.SupportPackageIsVersion4 // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type MsgClient interface { - // SetRecord will records a new record with given payload and bond id + // SetRecord records a new record with given payload and bond id SetRecord(ctx context.Context, in *MsgSetRecord, opts ...grpc.CallOption) (*MsgSetRecordResponse, error) - // Renew Record will renew the expire record + // Renew Record renews an expired record RenewRecord(ctx context.Context, in *MsgRenewRecord, opts ...grpc.CallOption) (*MsgRenewRecordResponse, error) // AssociateBond AssociateBond(ctx context.Context, in *MsgAssociateBond, opts ...grpc.CallOption) (*MsgAssociateBondResponse, error) @@ -1269,9 +1269,9 @@ func (c *msgClient) SetAuthorityBond(ctx context.Context, in *MsgSetAuthorityBon // MsgServer is the server API for Msg service. type MsgServer interface { - // SetRecord will records a new record with given payload and bond id + // SetRecord records a new record with given payload and bond id SetRecord(context.Context, *MsgSetRecord) (*MsgSetRecordResponse, error) - // Renew Record will renew the expire record + // Renew Record renews an expired record RenewRecord(context.Context, *MsgRenewRecord) (*MsgRenewRecordResponse, error) // AssociateBond AssociateBond(context.Context, *MsgAssociateBond) (*MsgAssociateBondResponse, error) diff --git a/x/registry/types/types.go b/x/registry/types/types.go index 69f770f2..6bd466b5 100644 --- a/x/registry/types/types.go +++ b/x/registry/types/types.go @@ -2,14 +2,9 @@ package types import ( "crypto/sha256" - "encoding/json" - "fmt" - "strings" "github.com/cerc-io/laconicd/x/registry/helpers" - codectypes "github.com/cosmos/cosmos-sdk/codec/types" canonicalJson "github.com/gibson042/canonicaljson-go" - "github.com/gogo/protobuf/proto" ) const ( @@ -18,19 +13,21 @@ const ( AuthorityUnderAuction = "auction" ) -// PayloadType represents a signed record payload that can be serialized from/to YAML. -type PayloadType struct { +// TODO if schema records are to be more permissive than allowing a map of fields, this type will +// become specific to content records. schema records will either occupy a new message or have new +// more general purpose helper types. + +// PayloadEncodable represents a signed record payload that can be serialized from/to YAML. +type PayloadEncodable struct { Record map[string]interface{} `json:"record"` Signatures []Signature `json:"signatures"` } -// ToPayload converts PayloadType to Payload object. +// ToPayload converts PayloadEncodable to Payload object. // Why? Because go-amino can't handle maps: https://github.com/tendermint/go-amino/issues/4. -func (payloadObj *PayloadType) ToPayload() (Payload, error) { - attributes, err := payLoadAttributes(payloadObj.Record) - if err != nil { - return Payload{}, err - } +func (payloadObj *PayloadEncodable) ToPayload() Payload { + // Note: record directly contains the attributes here + attributes := helpers.MarshalMapToJSONBytes(payloadObj.Record) payload := Payload{ Record: &Record{ Deleted: false, @@ -39,59 +36,23 @@ func (payloadObj *PayloadType) ToPayload() (Payload, error) { }, Signatures: payloadObj.Signatures, } - return payload, nil + // TODO rm error + return payload } -func payLoadAttributes(recordPayLoad map[string]interface{}) (*codectypes.Any, error) { - recordType, ok := recordPayLoad["type"] - if !ok { - return &codectypes.Any{}, fmt.Errorf("cannot get type from payload") - } - bz := helpers.MarshalMapToJSONBytes(recordPayLoad) +// ToReadablePayload converts Payload to a serializable object +func (payload Payload) ToReadablePayload() PayloadEncodable { + var encodable PayloadEncodable - switch recordType.(string) { - case "ServiceProviderRegistration": - { - var attributes ServiceProviderRegistration - err := json.Unmarshal(bz, &attributes) - if err != nil { - return &codectypes.Any{}, err - } - return codectypes.NewAnyWithValue(&attributes) - } - case "WebsiteRegistrationRecord": - { - var attributes WebsiteRegistrationRecord - err := json.Unmarshal(bz, &attributes) - if err != nil { - return &codectypes.Any{}, err - } - return codectypes.NewAnyWithValue(&attributes) - } - default: - return &codectypes.Any{}, fmt.Errorf("unsupported record type %s", recordType.(string)) - } + encodable.Record = helpers.UnMarshalMapFromJSONBytes(payload.Record.Attributes) + encodable.Signatures = payload.Signatures + + return encodable } -// ToReadablePayload converts Payload to PayloadType -// It will unmarshal with record attributes -func (payload Payload) ToReadablePayload() PayloadType { - var payloadType PayloadType - bz, err := GetJSONBytesFromAny(*payload.Record.Attributes) - if err != nil { - panic(err) - } - - payloadType.Record = helpers.UnMarshalMapFromJSONBytes(bz) - payloadType.Signatures = payload.Signatures - - return payloadType -} - -// Record to Record Type for human-readable attributes - -func (r *Record) ToRecordType() RecordType { - var resourceObj RecordType +// ToReadableRecord converts Record to a serializable object +func (r *Record) ToReadableRecord() RecordEncodable { + var resourceObj RecordEncodable resourceObj.ID = r.Id resourceObj.BondID = r.BondId @@ -100,55 +61,13 @@ func (r *Record) ToRecordType() RecordType { resourceObj.Deleted = r.Deleted resourceObj.Owners = r.Owners resourceObj.Names = r.Names - - bz, err := GetJSONBytesFromAny(*r.Attributes) - if err != nil { - panic(err) - } - resourceObj.Attributes = helpers.UnMarshalMapFromJSONBytes(bz) + resourceObj.Attributes = helpers.UnMarshalMapFromJSONBytes(r.Attributes) return resourceObj } -func GetJSONBytesFromAny(any codectypes.Any) ([]byte, error) { - var bz []byte - s := strings.Split(any.TypeUrl, ".") - switch s[len(s)-1] { - case "ServiceProviderRegistration": - { - var attributes ServiceProviderRegistration - err := proto.Unmarshal(any.Value, &attributes) - if err != nil { - panic("Proto unmarshal error") - } - - bz, err = json.Marshal(attributes) - if err != nil { - panic("JSON marshal error") - } - } - case "WebsiteRegistrationRecord": - { - var attributes WebsiteRegistrationRecord - err := proto.Unmarshal(any.Value, &attributes) - if err != nil { - panic("Proto unmarshal error") - } - - bz, err = json.Marshal(attributes) - if err != nil { - panic("JSON marshal error") - } - } - default: - return nil, fmt.Errorf("unsupported type %s", s[len(s)-1]) - } - - return bz, nil -} - -// RecordType represents a WNS record. -type RecordType struct { +// RecordEncodable represents a WNS record. +type RecordEncodable struct { ID string `json:"id,omitempty"` Names []string `json:"names,omitempty"` BondID string `json:"bondId,omitempty"` @@ -161,11 +80,8 @@ type RecordType struct { // ToRecordObj converts Record to RecordObj. // Why? Because go-amino can't handle maps: https://github.com/tendermint/go-amino/issues/4. -func (r *RecordType) ToRecordObj() (Record, error) { - attributes, err := payLoadAttributes(r.Attributes) - if err != nil { - return Record{}, err - } +func (r *RecordEncodable) ToRecordObj() (Record, error) { + attributes := helpers.MarshalMapToJSONBytes(r.Attributes) var resourceObj Record @@ -181,7 +97,7 @@ func (r *RecordType) ToRecordObj() (Record, error) { } // CanonicalJSON returns the canonical JSON representation of the record. -func (r *RecordType) CanonicalJSON() []byte { +func (r *RecordEncodable) CanonicalJSON() []byte { bytes, err := canonicalJson.Marshal(r.Attributes) if err != nil { panic("Record marshal error.") @@ -191,7 +107,7 @@ func (r *RecordType) CanonicalJSON() []byte { } // GetSignBytes generates a record hash to be signed. -func (r *RecordType) GetSignBytes() ([]byte, []byte) { +func (r *RecordEncodable) GetSignBytes() ([]byte, []byte) { // Double SHA256 hash. // Input to the first round of hashing. @@ -211,7 +127,7 @@ func (r *RecordType) GetSignBytes() ([]byte, []byte) { } // GetCID gets the record CID. -func (r *RecordType) GetCID() (string, error) { +func (r *RecordEncodable) GetCID() (string, error) { id, err := helpers.GetCid(r.CanonicalJSON()) if err != nil { return "", err -- 2.45.2 From e02bb5410999d3f71e1eec0c608428b106176189 Mon Sep 17 00:00:00 2001 From: Roy Crihfield Date: Wed, 18 Oct 2023 00:16:37 -0500 Subject: [PATCH 02/10] normalize logger --- x/registry/keeper/keeper.go | 6 ++++++ x/registry/keeper/naming_keeper.go | 8 ++++---- x/registry/keeper/record_keeper.go | 10 +++++----- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/x/registry/keeper/keeper.go b/x/registry/keeper/keeper.go index 36d09a77..a8bfa0df 100644 --- a/x/registry/keeper/keeper.go +++ b/x/registry/keeper/keeper.go @@ -20,6 +20,7 @@ import ( auth "github.com/cosmos/cosmos-sdk/x/auth/keeper" bank "github.com/cosmos/cosmos-sdk/x/bank/keeper" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" + "github.com/tendermint/tendermint/libs/log" ) var ( @@ -96,6 +97,11 @@ func NewKeeper(cdc codec.BinaryCodec, accountKeeper auth.AccountKeeper, bankKeep } } +// logger returns a module-specific logger. +func logger(ctx sdk.Context) log.Logger { + return ctx.Logger().With("module", types.ModuleName) +} + // GetRecordIndexKey Generates Bond ID -> Bond index key. func GetRecordIndexKey(id string) []byte { return append(PrefixCIDToRecordIndex, []byte(id)...) diff --git a/x/registry/keeper/naming_keeper.go b/x/registry/keeper/naming_keeper.go index e67a0b80..017bbd20 100644 --- a/x/registry/keeper/naming_keeper.go +++ b/x/registry/keeper/naming_keeper.go @@ -611,7 +611,7 @@ func (k Keeper) ProcessAuthorityExpiryQueue(ctx sdk.Context) { k.SetNameAuthority(ctx, name, &authority) k.DeleteAuthorityExpiryQueue(ctx, name, authority) - ctx.Logger().Info(fmt.Sprintf("Marking authority expired as no bond present: %s", name)) + logger(ctx).Info(fmt.Sprintf("Marking authority expired as no bond present: %s", name)) return } @@ -672,7 +672,7 @@ func (k Keeper) AuthorityExpiryQueueIterator(ctx sdk.Context, endTime time.Time) // TryTakeAuthorityRent tries to take rent from the authority bond. func (k Keeper) TryTakeAuthorityRent(ctx sdk.Context, name string, authority types.NameAuthority) { - ctx.Logger().Info(fmt.Sprintf("Trying to take rent for authority: %s", name)) + logger(ctx).Info(fmt.Sprintf("Trying to take rent for authority: %s", name)) params := k.GetParams(ctx) rent := params.AuthorityRent @@ -684,7 +684,7 @@ func (k Keeper) TryTakeAuthorityRent(ctx sdk.Context, name string, authority typ k.SetNameAuthority(ctx, name, &authority) k.DeleteAuthorityExpiryQueue(ctx, name, authority) - ctx.Logger().Info(fmt.Sprintf("Insufficient funds in owner account to pay authority rent, marking as expired: %s", name)) + logger(ctx).Info(fmt.Sprintf("Insufficient funds in owner account to pay authority rent, marking as expired: %s", name)) return } @@ -699,7 +699,7 @@ func (k Keeper) TryTakeAuthorityRent(ctx sdk.Context, name string, authority typ k.SetNameAuthority(ctx, name, &authority) k.AddBondToAuthorityIndexEntry(ctx, authority.BondId, name) - ctx.Logger().Info(fmt.Sprintf("Authority rent paid successfully: %s", name)) + logger(ctx).Info(fmt.Sprintf("Authority rent paid successfully: %s", name)) } // ListNameAuthorityRecords - get all name authority records. diff --git a/x/registry/keeper/record_keeper.go b/x/registry/keeper/record_keeper.go index cea1be7d..cdbd802a 100644 --- a/x/registry/keeper/record_keeper.go +++ b/x/registry/keeper/record_keeper.go @@ -39,14 +39,14 @@ func (k RecordKeeper) OnAuctionWinnerSelected(ctx sdk.Context, auctionID string) name := k.GetAuctionToAuthorityMapping(ctx, auctionID) if name == "" { // We don't know about this auction, ignore. - ctx.Logger().Info(fmt.Sprintf("Ignoring auction notification, name mapping not found: %s", auctionID)) + logger(ctx).Info(fmt.Sprintf("Ignoring auction notification, name mapping not found: %s", auctionID)) return } store := ctx.KVStore(k.storeKey) if !HasNameAuthority(store, name) { // We don't know about this authority, ignore. - ctx.Logger().Info(fmt.Sprintf("Ignoring auction notification, authority not found: %s", auctionID)) + logger(ctx).Info(fmt.Sprintf("Ignoring auction notification, authority not found: %s", auctionID)) return } @@ -71,12 +71,12 @@ func (k RecordKeeper) OnAuctionWinnerSelected(ctx sdk.Context, auctionID string) // Can be used to check if names are older than the authority itself (stale names). authority.Height = uint64(ctx.BlockHeight()) - ctx.Logger().Info(fmt.Sprintf("Winner selected, marking authority as active: %s", name)) + logger(ctx).Info(fmt.Sprintf("Winner selected, marking authority as active: %s", name)) } else { // Mark as expired. authority.Status = types.AuthorityExpired - ctx.Logger().Info(fmt.Sprintf("No winner, marking authority as expired: %s", name)) + logger(ctx).Info(fmt.Sprintf("No winner, marking authority as expired: %s", name)) } authority.AuctionId = "" @@ -85,7 +85,7 @@ func (k RecordKeeper) OnAuctionWinnerSelected(ctx sdk.Context, auctionID string) // Forget about this auction now, we no longer need it. removeAuctionToAuthorityMapping(store, auctionID) } else { - ctx.Logger().Info(fmt.Sprintf("Ignoring auction notification, status: %s", auctionObj.Status)) + logger(ctx).Info(fmt.Sprintf("Ignoring auction notification, status: %s", auctionObj.Status)) } } -- 2.45.2 From 98cc47a1a40b4ce715883cdbb18981e0011cdb3a Mon Sep 17 00:00:00 2001 From: Roy Crihfield Date: Thu, 21 Sep 2023 20:55:55 +0800 Subject: [PATCH 03/10] gql: move schema to cerc-io/ --- gql/{vulcanize/chiba-clonk => cerc-io/laconicd}/schema.graphql | 0 gql/gqlgen.yml | 2 -- 2 files changed, 2 deletions(-) rename gql/{vulcanize/chiba-clonk => cerc-io/laconicd}/schema.graphql (100%) diff --git a/gql/vulcanize/chiba-clonk/schema.graphql b/gql/cerc-io/laconicd/schema.graphql similarity index 100% rename from gql/vulcanize/chiba-clonk/schema.graphql rename to gql/cerc-io/laconicd/schema.graphql diff --git a/gql/gqlgen.yml b/gql/gqlgen.yml index a6baa943..68b9374e 100644 --- a/gql/gqlgen.yml +++ b/gql/gqlgen.yml @@ -1,5 +1,3 @@ -# .gqlgen.yml example -# # Refer to https://gqlgen.com/config/ # for detailed .gqlgen.yml documentation. -- 2.45.2 From 98b7e4198844fb46e56a7d06685025c4e16b1dab Mon Sep 17 00:00:00 2001 From: Roy Crihfield Date: Thu, 21 Sep 2023 20:56:15 +0800 Subject: [PATCH 04/10] gql schema for ipld objects --- gql/cerc-io/laconicd/schema.graphql | 90 +- gql/generated.go | 9862 +++++++++++++++++---------- gql/gqlgen.yml | 5 + gql/models_gen.go | 107 +- gql/scalar.go | 33 + gql/util.go | 267 +- x/registry/keeper/keeper.go | 2 - 7 files changed, 6381 insertions(+), 3985 deletions(-) create mode 100644 gql/scalar.go diff --git a/gql/cerc-io/laconicd/schema.graphql b/gql/cerc-io/laconicd/schema.graphql index b47b5512..d090c8c6 100644 --- a/gql/cerc-io/laconicd/schema.graphql +++ b/gql/cerc-io/laconicd/schema.graphql @@ -1,12 +1,5 @@ # Reference to another record. -type Reference { - id: String! # ID of linked record. -} - -# Reference to another record. -input ReferenceInput { - id: String! -} +scalar Link # Bonds contain funds that are used to pay rent on record registration and renewal. type Bond { @@ -37,44 +30,71 @@ type Account { balance: [Coin!] # Current balance for each coin type. } -# Value of a given type. -type Value { - null: Boolean +# Value describes a DAG-JSON compatible value. +union Value = + BooleanValue + | IntValue + | FloatValue + | StringValue + | BytesValue + | LinkValue + | ArrayValue + | MapValue - int: Int - float: Float - string: String - boolean: Boolean - json: String - - reference: Reference - - values: [Value] +type BooleanValue { + value: Boolean! } -# Value of a given type used as input to queries. -input ValueInput { - null: Boolean - int: Int - float: Float - string: String - boolean: Boolean +type IntValue { + value: Int! +} - reference: ReferenceInput +type FloatValue { + value: Float! +} - values: [ValueInput] +type StringValue { + value: String! +} + +type BytesValue { + value: String! +} + +type ArrayValue { + value: [Value]! +} + +type LinkValue { + value: Link! +} + +type MapValue { + value: [Attribute!]! } # Key/value pair. -type KeyValue { +type Attribute { key: String! - value: Value! + value: Value +} + +# Value of a given type used as input to queries. +# Note: GQL doesn't allow union input types. +input ValueInput { + int: Int + float: Float + string: String + boolean: Boolean + link: Link + array: [ValueInput] + map: [KeyValueInput!] } # Key/value pair for inputs. input KeyValueInput { key: String! - value: ValueInput! + value: ValueInput } # Status information about a node (https://docs.tendermint.com/master/rpc/#/Info/status). @@ -155,7 +175,7 @@ type Record { createTime: String! # Record create time. expiryTime: String! # Record expiry time. owners: [String!] # Addresses of record owners. - attributes: [KeyValue] # Record attributes. + attributes: [Attribute!] # Record attributes. references: [Record] # Record references. } @@ -195,7 +215,7 @@ type Query { getBondsByIds(ids: [String!]): [Bond] # Query bonds. - queryBonds(attributes: [KeyValueInput]): [Bond] + queryBonds(attributes: [KeyValueInput!]): [Bond] # Query bonds by owner. queryBondsByOwner(ownerAddresses: [String!]): [OwnerBonds] @@ -210,7 +230,7 @@ type Query { # Query records. queryRecords( # Multiple attribute conditions are in a logical AND. - attributes: [KeyValueInput] + attributes: [KeyValueInput!] # Whether to query all records, not just named ones (false by default). all: Boolean diff --git a/gql/generated.go b/gql/generated.go index 8e030164..f87895be 100644 --- a/gql/generated.go +++ b/gql/generated.go @@ -5,7 +5,9 @@ package gql import ( "bytes" "context" + "embed" "errors" + "fmt" "strconv" "sync" "sync/atomic" @@ -49,6 +51,15 @@ type ComplexityRoot struct { Sequence func(childComplexity int) int } + ArrayValue struct { + Value func(childComplexity int) int + } + + Attribute struct { + Key func(childComplexity int) int + Value func(childComplexity int) int + } + Auction struct { Bids func(childComplexity int) int CommitFee func(childComplexity int) int @@ -92,13 +103,32 @@ type ComplexityRoot struct { Owner func(childComplexity int) int } + BooleanValue struct { + Value func(childComplexity int) int + } + + BytesValue struct { + Value func(childComplexity int) int + } + Coin struct { Quantity func(childComplexity int) int Type func(childComplexity int) int } - KeyValue struct { - Key func(childComplexity int) int + FloatValue struct { + Value func(childComplexity int) int + } + + IntValue struct { + Value func(childComplexity int) int + } + + LinkValue struct { + Value func(childComplexity int) int + } + + MapValue struct { Value func(childComplexity int) int } @@ -154,10 +184,6 @@ type ComplexityRoot struct { References func(childComplexity int) int } - Reference struct { - ID func(childComplexity int) int - } - Status struct { DiskUsage func(childComplexity int) int Node func(childComplexity int) int @@ -169,6 +195,10 @@ type ComplexityRoot struct { Version func(childComplexity int) int } + StringValue struct { + Value func(childComplexity int) int + } + SyncInfo struct { CatchingUp func(childComplexity int) int LatestBlockHash func(childComplexity int) int @@ -181,17 +211,6 @@ type ComplexityRoot struct { ProposerPriority func(childComplexity int) int VotingPower func(childComplexity int) int } - - Value struct { - Boolean func(childComplexity int) int - Float func(childComplexity int) int - Int func(childComplexity int) int - JSON func(childComplexity int) int - Null func(childComplexity int) int - Reference func(childComplexity int) int - String func(childComplexity int) int - Values func(childComplexity int) int - } } type QueryResolver interface { @@ -258,6 +277,27 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Account.Sequence(childComplexity), true + case "ArrayValue.value": + if e.complexity.ArrayValue.Value == nil { + break + } + + return e.complexity.ArrayValue.Value(childComplexity), true + + case "Attribute.key": + if e.complexity.Attribute.Key == nil { + break + } + + return e.complexity.Attribute.Key(childComplexity), true + + case "Attribute.value": + if e.complexity.Attribute.Value == nil { + break + } + + return e.complexity.Attribute.Value(childComplexity), true + case "Auction.bids": if e.complexity.Auction.Bids == nil { break @@ -475,6 +515,20 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Bond.Owner(childComplexity), true + case "BooleanValue.value": + if e.complexity.BooleanValue.Value == nil { + break + } + + return e.complexity.BooleanValue.Value(childComplexity), true + + case "BytesValue.value": + if e.complexity.BytesValue.Value == nil { + break + } + + return e.complexity.BytesValue.Value(childComplexity), true + case "Coin.quantity": if e.complexity.Coin.Quantity == nil { break @@ -489,19 +543,33 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Coin.Type(childComplexity), true - case "KeyValue.key": - if e.complexity.KeyValue.Key == nil { + case "FloatValue.value": + if e.complexity.FloatValue.Value == nil { break } - return e.complexity.KeyValue.Key(childComplexity), true + return e.complexity.FloatValue.Value(childComplexity), true - case "KeyValue.value": - if e.complexity.KeyValue.Value == nil { + case "IntValue.value": + if e.complexity.IntValue.Value == nil { break } - return e.complexity.KeyValue.Value(childComplexity), true + return e.complexity.IntValue.Value(childComplexity), true + + case "LinkValue.value": + if e.complexity.LinkValue.Value == nil { + break + } + + return e.complexity.LinkValue.Value(childComplexity), true + + case "MapValue.value": + if e.complexity.MapValue.Value == nil { + break + } + + return e.complexity.MapValue.Value(childComplexity), true case "NameRecord.history": if e.complexity.NameRecord.History == nil { @@ -770,13 +838,6 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Record.References(childComplexity), true - case "Reference.id": - if e.complexity.Reference.ID == nil { - break - } - - return e.complexity.Reference.ID(childComplexity), true - case "Status.disk_usage": if e.complexity.Status.DiskUsage == nil { break @@ -833,6 +894,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Status.Version(childComplexity), true + case "StringValue.value": + if e.complexity.StringValue.Value == nil { + break + } + + return e.complexity.StringValue.Value(childComplexity), true + case "SyncInfo.catching_up": if e.complexity.SyncInfo.CatchingUp == nil { break @@ -882,62 +950,6 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.ValidatorInfo.VotingPower(childComplexity), true - case "Value.boolean": - if e.complexity.Value.Boolean == nil { - break - } - - return e.complexity.Value.Boolean(childComplexity), true - - case "Value.float": - if e.complexity.Value.Float == nil { - break - } - - return e.complexity.Value.Float(childComplexity), true - - case "Value.int": - if e.complexity.Value.Int == nil { - break - } - - return e.complexity.Value.Int(childComplexity), true - - case "Value.json": - if e.complexity.Value.JSON == nil { - break - } - - return e.complexity.Value.JSON(childComplexity), true - - case "Value.null": - if e.complexity.Value.Null == nil { - break - } - - return e.complexity.Value.Null(childComplexity), true - - case "Value.reference": - if e.complexity.Value.Reference == nil { - break - } - - return e.complexity.Value.Reference(childComplexity), true - - case "Value.string": - if e.complexity.Value.String == nil { - break - } - - return e.complexity.Value.String(childComplexity), true - - case "Value.values": - if e.complexity.Value.Values == nil { - break - } - - return e.complexity.Value.Values(childComplexity), true - } return 0, false } @@ -945,6 +957,10 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler { rc := graphql.GetOperationContext(ctx) ec := executionContext{rc, e} + inputUnmarshalMap := graphql.BuildUnmarshalerMap( + ec.unmarshalInputKeyValueInput, + ec.unmarshalInputValueInput, + ) first := true switch rc.Operation.Operation { @@ -954,6 +970,7 @@ func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler { return nil } first = false + ctx = graphql.WithUnmarshalerMap(ctx, inputUnmarshalMap) data := ec._Query(ctx, rc.Operation.SelectionSet) var buf bytes.Buffer data.MarshalGQL(&buf) @@ -987,267 +1004,19 @@ func (ec *executionContext) introspectType(name string) (*introspection.Type, er return introspection.WrapTypeFromDef(parsedSchema, parsedSchema.Types[name]), nil } +//go:embed "cerc-io/laconicd/schema.graphql" +var sourcesFS embed.FS + +func sourceData(filename string) string { + data, err := sourcesFS.ReadFile(filename) + if err != nil { + panic(fmt.Sprintf("codegen problem: %s not available", filename)) + } + return string(data) +} + var sources = []*ast.Source{ - {Name: "vulcanize/chiba-clonk/schema.graphql", Input: `# Reference to another record. -type Reference { - id: String! # ID of linked record. -} - -# Reference to another record. -input ReferenceInput { - id: String! -} - -# Bonds contain funds that are used to pay rent on record registration and renewal. -type Bond { - id: String! # Primary key, auto-generated by the server. - owner: String! # Bond owner cosmos-sdk address. - balance: [Coin!] # Current balance for each coin type. -} - -# OwnerBonds contains the bonds related the owner -type OwnerBonds { - owner: String! - bonds: [Bond!] -} - -# Mutations require payment in coins (e.g. 100wire). -# Used by the wallet to get the account balance for display and mutations. -type Coin { - type: String! # e.g. 'WIRE' - quantity: String! # e.g. 1000000 -} -# Represents an account on the blockchain. -# Mutations have to be signed by a particular account. -type Account { - address: String! # Blockchain address. - pubKey: String # Public key. - number: String! # Account number. - sequence: String! # Sequence number used to prevent replays. - balance: [Coin!] # Current balance for each coin type. -} - -# Value of a given type. -type Value { - null: Boolean - - int: Int - float: Float - string: String - boolean: Boolean - json: String - - reference: Reference - - values: [Value] -} -# Value of a given type used as input to queries. -input ValueInput { - null: Boolean - - int: Int - float: Float - string: String - boolean: Boolean - - reference: ReferenceInput - - values: [ValueInput] -} - -# Key/value pair. -type KeyValue { - key: String! - value: Value! -} - -# Key/value pair for inputs. -input KeyValueInput { - key: String! - value: ValueInput! -} - -# Status information about a node (https://docs.tendermint.com/master/rpc/#/Info/status). -type NodeInfo { - id: String! # Tendermint Node ID. - network: String! # Name of the network/blockchain. - moniker: String! # Name of the node. -} - -# Node sync status. -type SyncInfo { - latest_block_hash: String! - latest_block_height: String! - latest_block_time: String! - catching_up: Boolean! -} - -# Validator set info (https://docs.tendermint.com/master/rpc/#/Info/validators). -type ValidatorInfo { - address: String! - voting_power: String! - proposer_priority: String -} - -# Network/peer info (https://docs.tendermint.com/master/rpc/#/Info/net_info). -type PeerInfo { - node: NodeInfo! - is_outbound: Boolean! - remote_ip: String! -} - -# Vulcanize chiba-clonk status. -type Status { - version: String! - node: NodeInfo! - sync: SyncInfo! - validator: ValidatorInfo - validators: [ValidatorInfo]! - num_peers: String! - peers: [PeerInfo] - disk_usage: String! -} - - -# An auction bid. -type AuctionBid { - bidderAddress: String! - status: String! - commitHash: String! - commitTime: String! - commitFee: Coin! - revealTime: String! - revealFee: Coin! - bidAmount: Coin! -} - -# A sealed-bid, 2nd price auction. -type Auction { - id: String! # Auction ID. - status: String! # Auction status (commit, reveal, expired). - ownerAddress: String! # Auction owner time. - createTime: String! # Create time. - commitsEndTime: String! # Commit phase end time. - revealsEndTime: String! # Reveal phase end time. - commitFee: Coin! # Fee required to bid/participate in the auction. - revealFee: Coin! # Reveal fee (paid back to bidders only if they unseal/reveal the bid). - minimumBid: Coin! # Minimum bid amount. - winnerAddress: String! # Winner address. - winnerBid: Coin! # The winning bid amount. - winnerPrice: Coin! # The price that the winner actually pays (2nd highest bid). - bids: [AuctionBid] # Bids make in the auction. -} - - -# Record defines the basic properties of an entity in the graph database. -type Record { - id: String! # Computed attribute: Multibase encoded content hash (https://github.com/multiformats/multibase). - names: [String!] # Names pointing to this CID (reverse lookup). - - bondId: String! # Associated bond ID. - createTime: String! # Record create time. - expiryTime: String! # Record expiry time. - - owners: [String!] # Addresses of record owners. - attributes: [KeyValue] # Record attributes. - references: [Record] # Record references. -} - -# Name authority record. -type AuthorityRecord { - ownerAddress: String! # Owner address. - ownerPublicKey: String! # Owner public key. - height: String! # Height at which record was created. - status: String! # Status (active, auction, expired). - bondId: String! # Associated bond ID. - expiryTime: String! # Authority expiry time. - auction: Auction # Authority auction. -} - -# Name record entry, created at a particular height. -type NameRecordEntry { - id: String! # Target record ID. - height: String! # Height at which record was created. -} - -# Name record stores the latest and historical name -> record ID mappings. -type NameRecord { - latest: NameRecordEntry! # Latest mame record entry. - history: [NameRecordEntry] # Historical name record entries. -} - -type Query { - # - # Status API. - # - getStatus: Status! - - # Get blockchain accounts. - getAccounts( - addresses: [String!] - ): [Account] - - # Get bonds by IDs. - getBondsByIds( - ids: [String!] - ): [Bond] - - # Query bonds. - queryBonds( - attributes: [KeyValueInput] - ): [Bond] - - # Query bonds by owner. - queryBondsByOwner( - ownerAddresses: [String!] - ): [OwnerBonds] - - # - # GraphDB API. - # - - # Get records by IDs. - getRecordsByIds( - ids: [String!] - ): [Record] - - # Query records. - queryRecords( - # Multiple attribute conditions are in a logical AND. - attributes: [KeyValueInput] - - # Whether to query all records, not just named ones (false by default). - all: Boolean - ): [Record] - - # - # Naming API. - # - - # Lookup authority information. - lookupAuthorities( - names: [String!] - ): [AuthorityRecord]! - - # Lookup name to record mapping information. - lookupNames( - names: [String!] - ): [NameRecord]! - - # Resolve names to records. - resolveNames( - names: [String!] - ): [Record]! - - # - # Auctions API. - # - - # Get auctions by IDs. - getAuctionsByIds( - ids: [String!] - ): [Auction] -}`, BuiltIn: false}, + {Name: "cerc-io/laconicd/schema.graphql", Input: sourceData("cerc-io/laconicd/schema.graphql"), BuiltIn: false}, } var parsedSchema = gqlparser.MustLoadSchema(sources...) @@ -1381,7 +1150,7 @@ func (ec *executionContext) field_Query_queryBonds_args(ctx context.Context, raw var arg0 []*KeyValueInput if tmp, ok := rawArgs["attributes"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("attributes")) - arg0, err = ec.unmarshalOKeyValueInput2ᚕᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐKeyValueInput(ctx, tmp) + arg0, err = ec.unmarshalOKeyValueInput2ᚕᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐKeyValueInputᚄ(ctx, tmp) if err != nil { return nil, err } @@ -1396,7 +1165,7 @@ func (ec *executionContext) field_Query_queryRecords_args(ctx context.Context, r var arg0 []*KeyValueInput if tmp, ok := rawArgs["attributes"]; ok { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("attributes")) - arg0, err = ec.unmarshalOKeyValueInput2ᚕᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐKeyValueInput(ctx, tmp) + arg0, err = ec.unmarshalOKeyValueInput2ᚕᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐKeyValueInputᚄ(ctx, tmp) if err != nil { return nil, err } @@ -1468,21 +1237,17 @@ func (ec *executionContext) field___Type_fields_args(ctx context.Context, rawArg // region **************************** field.gotpl ***************************** func (ec *executionContext) _Account_address(ctx context.Context, field graphql.CollectedField, obj *Account) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Account_address(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) ret = graphql.Null } }() - fc := &graphql.FieldContext{ - Object: "Account", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Address, nil @@ -1502,22 +1267,31 @@ func (ec *executionContext) _Account_address(ctx context.Context, field graphql. return ec.marshalNString2string(ctx, field.Selections, res) } +func (ec *executionContext) fieldContext_Account_address(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Account", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + func (ec *executionContext) _Account_pubKey(ctx context.Context, field graphql.CollectedField, obj *Account) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Account_pubKey(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) ret = graphql.Null } }() - fc := &graphql.FieldContext{ - Object: "Account", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.PubKey, nil @@ -1534,22 +1308,31 @@ func (ec *executionContext) _Account_pubKey(ctx context.Context, field graphql.C return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } +func (ec *executionContext) fieldContext_Account_pubKey(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Account", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + func (ec *executionContext) _Account_number(ctx context.Context, field graphql.CollectedField, obj *Account) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Account_number(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) ret = graphql.Null } }() - fc := &graphql.FieldContext{ - Object: "Account", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Number, nil @@ -1569,22 +1352,31 @@ func (ec *executionContext) _Account_number(ctx context.Context, field graphql.C return ec.marshalNString2string(ctx, field.Selections, res) } +func (ec *executionContext) fieldContext_Account_number(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Account", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + func (ec *executionContext) _Account_sequence(ctx context.Context, field graphql.CollectedField, obj *Account) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Account_sequence(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) ret = graphql.Null } }() - fc := &graphql.FieldContext{ - Object: "Account", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Sequence, nil @@ -1604,22 +1396,31 @@ func (ec *executionContext) _Account_sequence(ctx context.Context, field graphql return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) _Account_balance(ctx context.Context, field graphql.CollectedField, obj *Account) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ +func (ec *executionContext) fieldContext_Account_sequence(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ Object: "Account", Field: field, - Args: nil, IsMethod: false, IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, } + return fc, nil +} +func (ec *executionContext) _Account_balance(ctx context.Context, field graphql.CollectedField, obj *Account) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Account_balance(ctx, field) + if err != nil { + return graphql.Null + } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Balance, nil @@ -1633,28 +1434,43 @@ func (ec *executionContext) _Account_balance(ctx context.Context, field graphql. } res := resTmp.([]*Coin) fc.Result = res - return ec.marshalOCoin2ᚕᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐCoinᚄ(ctx, field.Selections, res) + return ec.marshalOCoin2ᚕᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐCoinᚄ(ctx, field.Selections, res) } -func (ec *executionContext) _Auction_id(ctx context.Context, field graphql.CollectedField, obj *Auction) (ret graphql.Marshaler) { +func (ec *executionContext) fieldContext_Account_balance(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Account", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "type": + return ec.fieldContext_Coin_type(ctx, field) + case "quantity": + return ec.fieldContext_Coin_quantity(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Coin", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _ArrayValue_value(ctx context.Context, field graphql.CollectedField, obj *ArrayValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ArrayValue_value(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) ret = graphql.Null } }() - fc := &graphql.FieldContext{ - Object: "Auction", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.ID, nil + return obj.Value, nil }) if err != nil { ec.Error(ctx, err) @@ -1666,1138 +1482,36 @@ func (ec *executionContext) _Auction_id(ctx context.Context, field graphql.Colle } return graphql.Null } - res := resTmp.(string) + res := resTmp.([]Value) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNValue2ᚕgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐValue(ctx, field.Selections, res) } -func (ec *executionContext) _Auction_status(ctx context.Context, field graphql.CollectedField, obj *Auction) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Auction", +func (ec *executionContext) fieldContext_ArrayValue_value(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ArrayValue", Field: field, - Args: nil, IsMethod: false, IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Value does not have child fields") + }, } + return fc, nil +} - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Status, nil - }) +func (ec *executionContext) _Attribute_key(ctx context.Context, field graphql.CollectedField, obj *Attribute) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Attribute_key(ctx, field) if err != nil { - ec.Error(ctx, err) return graphql.Null } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) _Auction_ownerAddress(ctx context.Context, field graphql.CollectedField, obj *Auction) (ret graphql.Marshaler) { + ctx = graphql.WithFieldContext(ctx, fc) defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) ret = graphql.Null } }() - fc := &graphql.FieldContext{ - Object: "Auction", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.OwnerAddress, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) _Auction_createTime(ctx context.Context, field graphql.CollectedField, obj *Auction) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Auction", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.CreateTime, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) _Auction_commitsEndTime(ctx context.Context, field graphql.CollectedField, obj *Auction) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Auction", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.CommitsEndTime, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) _Auction_revealsEndTime(ctx context.Context, field graphql.CollectedField, obj *Auction) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Auction", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.RevealsEndTime, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) _Auction_commitFee(ctx context.Context, field graphql.CollectedField, obj *Auction) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Auction", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.CommitFee, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(*Coin) - fc.Result = res - return ec.marshalNCoin2ᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐCoin(ctx, field.Selections, res) -} - -func (ec *executionContext) _Auction_revealFee(ctx context.Context, field graphql.CollectedField, obj *Auction) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Auction", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.RevealFee, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(*Coin) - fc.Result = res - return ec.marshalNCoin2ᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐCoin(ctx, field.Selections, res) -} - -func (ec *executionContext) _Auction_minimumBid(ctx context.Context, field graphql.CollectedField, obj *Auction) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Auction", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.MinimumBid, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(*Coin) - fc.Result = res - return ec.marshalNCoin2ᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐCoin(ctx, field.Selections, res) -} - -func (ec *executionContext) _Auction_winnerAddress(ctx context.Context, field graphql.CollectedField, obj *Auction) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Auction", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.WinnerAddress, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) _Auction_winnerBid(ctx context.Context, field graphql.CollectedField, obj *Auction) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Auction", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.WinnerBid, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(*Coin) - fc.Result = res - return ec.marshalNCoin2ᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐCoin(ctx, field.Selections, res) -} - -func (ec *executionContext) _Auction_winnerPrice(ctx context.Context, field graphql.CollectedField, obj *Auction) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Auction", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.WinnerPrice, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(*Coin) - fc.Result = res - return ec.marshalNCoin2ᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐCoin(ctx, field.Selections, res) -} - -func (ec *executionContext) _Auction_bids(ctx context.Context, field graphql.CollectedField, obj *Auction) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Auction", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Bids, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.([]*AuctionBid) - fc.Result = res - return ec.marshalOAuctionBid2ᚕᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐAuctionBid(ctx, field.Selections, res) -} - -func (ec *executionContext) _AuctionBid_bidderAddress(ctx context.Context, field graphql.CollectedField, obj *AuctionBid) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "AuctionBid", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.BidderAddress, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) _AuctionBid_status(ctx context.Context, field graphql.CollectedField, obj *AuctionBid) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "AuctionBid", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Status, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) _AuctionBid_commitHash(ctx context.Context, field graphql.CollectedField, obj *AuctionBid) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "AuctionBid", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.CommitHash, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) _AuctionBid_commitTime(ctx context.Context, field graphql.CollectedField, obj *AuctionBid) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "AuctionBid", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.CommitTime, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) _AuctionBid_commitFee(ctx context.Context, field graphql.CollectedField, obj *AuctionBid) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "AuctionBid", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.CommitFee, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(*Coin) - fc.Result = res - return ec.marshalNCoin2ᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐCoin(ctx, field.Selections, res) -} - -func (ec *executionContext) _AuctionBid_revealTime(ctx context.Context, field graphql.CollectedField, obj *AuctionBid) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "AuctionBid", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.RevealTime, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) _AuctionBid_revealFee(ctx context.Context, field graphql.CollectedField, obj *AuctionBid) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "AuctionBid", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.RevealFee, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(*Coin) - fc.Result = res - return ec.marshalNCoin2ᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐCoin(ctx, field.Selections, res) -} - -func (ec *executionContext) _AuctionBid_bidAmount(ctx context.Context, field graphql.CollectedField, obj *AuctionBid) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "AuctionBid", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.BidAmount, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(*Coin) - fc.Result = res - return ec.marshalNCoin2ᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐCoin(ctx, field.Selections, res) -} - -func (ec *executionContext) _AuthorityRecord_ownerAddress(ctx context.Context, field graphql.CollectedField, obj *AuthorityRecord) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "AuthorityRecord", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.OwnerAddress, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) _AuthorityRecord_ownerPublicKey(ctx context.Context, field graphql.CollectedField, obj *AuthorityRecord) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "AuthorityRecord", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.OwnerPublicKey, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) _AuthorityRecord_height(ctx context.Context, field graphql.CollectedField, obj *AuthorityRecord) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "AuthorityRecord", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Height, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) _AuthorityRecord_status(ctx context.Context, field graphql.CollectedField, obj *AuthorityRecord) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "AuthorityRecord", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Status, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) _AuthorityRecord_bondId(ctx context.Context, field graphql.CollectedField, obj *AuthorityRecord) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "AuthorityRecord", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.BondID, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) _AuthorityRecord_expiryTime(ctx context.Context, field graphql.CollectedField, obj *AuthorityRecord) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "AuthorityRecord", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ExpiryTime, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) _AuthorityRecord_auction(ctx context.Context, field graphql.CollectedField, obj *AuthorityRecord) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "AuthorityRecord", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Auction, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*Auction) - fc.Result = res - return ec.marshalOAuction2ᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐAuction(ctx, field.Selections, res) -} - -func (ec *executionContext) _Bond_id(ctx context.Context, field graphql.CollectedField, obj *Bond) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Bond", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ID, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) _Bond_owner(ctx context.Context, field graphql.CollectedField, obj *Bond) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Bond", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Owner, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) _Bond_balance(ctx context.Context, field graphql.CollectedField, obj *Bond) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Bond", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Balance, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.([]*Coin) - fc.Result = res - return ec.marshalOCoin2ᚕᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐCoinᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) _Coin_type(ctx context.Context, field graphql.CollectedField, obj *Coin) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Coin", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Type, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) _Coin_quantity(ctx context.Context, field graphql.CollectedField, obj *Coin) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Coin", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Quantity, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) _KeyValue_key(ctx context.Context, field graphql.CollectedField, obj *KeyValue) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "KeyValue", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Key, nil @@ -2817,22 +1531,31 @@ func (ec *executionContext) _KeyValue_key(ctx context.Context, field graphql.Col return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) _KeyValue_value(ctx context.Context, field graphql.CollectedField, obj *KeyValue) (ret graphql.Marshaler) { +func (ec *executionContext) fieldContext_Attribute_key(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Attribute", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Attribute_value(ctx context.Context, field graphql.CollectedField, obj *Attribute) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Attribute_value(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) ret = graphql.Null } }() - fc := &graphql.FieldContext{ - Object: "KeyValue", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Value, nil @@ -2842,99 +1565,38 @@ func (ec *executionContext) _KeyValue_value(ctx context.Context, field graphql.C return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(*Value) + res := resTmp.(Value) fc.Result = res - return ec.marshalNValue2ᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐValue(ctx, field.Selections, res) + return ec.marshalOValue2githubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐValue(ctx, field.Selections, res) } -func (ec *executionContext) _NameRecord_latest(ctx context.Context, field graphql.CollectedField, obj *NameRecord) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "NameRecord", +func (ec *executionContext) fieldContext_Attribute_value(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Attribute", Field: field, - Args: nil, IsMethod: false, IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Value does not have child fields") + }, } + return fc, nil +} - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Latest, nil - }) +func (ec *executionContext) _Auction_id(ctx context.Context, field graphql.CollectedField, obj *Auction) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Auction_id(ctx, field) if err != nil { - ec.Error(ctx, err) return graphql.Null } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(*NameRecordEntry) - fc.Result = res - return ec.marshalNNameRecordEntry2ᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐNameRecordEntry(ctx, field.Selections, res) -} - -func (ec *executionContext) _NameRecord_history(ctx context.Context, field graphql.CollectedField, obj *NameRecord) (ret graphql.Marshaler) { + ctx = graphql.WithFieldContext(ctx, fc) defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) ret = graphql.Null } }() - fc := &graphql.FieldContext{ - Object: "NameRecord", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.History, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.([]*NameRecordEntry) - fc.Result = res - return ec.marshalONameRecordEntry2ᚕᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐNameRecordEntry(ctx, field.Selections, res) -} - -func (ec *executionContext) _NameRecordEntry_id(ctx context.Context, field graphql.CollectedField, obj *NameRecordEntry) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "NameRecordEntry", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.ID, nil @@ -2954,25 +1616,34 @@ func (ec *executionContext) _NameRecordEntry_id(ctx context.Context, field graph return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) _NameRecordEntry_height(ctx context.Context, field graphql.CollectedField, obj *NameRecordEntry) (ret graphql.Marshaler) { +func (ec *executionContext) fieldContext_Auction_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Auction", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Auction_status(ctx context.Context, field graphql.CollectedField, obj *Auction) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Auction_status(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) ret = graphql.Null } }() - fc := &graphql.FieldContext{ - Object: "NameRecordEntry", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Height, nil + return obj.Status, nil }) if err != nil { ec.Error(ctx, err) @@ -2989,25 +1660,34 @@ func (ec *executionContext) _NameRecordEntry_height(ctx context.Context, field g return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) _NodeInfo_id(ctx context.Context, field graphql.CollectedField, obj *NodeInfo) (ret graphql.Marshaler) { +func (ec *executionContext) fieldContext_Auction_status(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Auction", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Auction_ownerAddress(ctx context.Context, field graphql.CollectedField, obj *Auction) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Auction_ownerAddress(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) ret = graphql.Null } }() - fc := &graphql.FieldContext{ - Object: "NodeInfo", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.ID, nil + return obj.OwnerAddress, nil }) if err != nil { ec.Error(ctx, err) @@ -3024,871 +1704,31 @@ func (ec *executionContext) _NodeInfo_id(ctx context.Context, field graphql.Coll return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) _NodeInfo_network(ctx context.Context, field graphql.CollectedField, obj *NodeInfo) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "NodeInfo", +func (ec *executionContext) fieldContext_Auction_ownerAddress(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Auction", Field: field, - Args: nil, IsMethod: false, IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Network, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return fc, nil } -func (ec *executionContext) _NodeInfo_moniker(ctx context.Context, field graphql.CollectedField, obj *NodeInfo) (ret graphql.Marshaler) { +func (ec *executionContext) _Auction_createTime(ctx context.Context, field graphql.CollectedField, obj *Auction) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Auction_createTime(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) ret = graphql.Null } }() - fc := &graphql.FieldContext{ - Object: "NodeInfo", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Moniker, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) _OwnerBonds_owner(ctx context.Context, field graphql.CollectedField, obj *OwnerBonds) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "OwnerBonds", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Owner, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) _OwnerBonds_bonds(ctx context.Context, field graphql.CollectedField, obj *OwnerBonds) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "OwnerBonds", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Bonds, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.([]*Bond) - fc.Result = res - return ec.marshalOBond2ᚕᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐBondᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) _PeerInfo_node(ctx context.Context, field graphql.CollectedField, obj *PeerInfo) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "PeerInfo", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Node, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(*NodeInfo) - fc.Result = res - return ec.marshalNNodeInfo2ᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐNodeInfo(ctx, field.Selections, res) -} - -func (ec *executionContext) _PeerInfo_is_outbound(ctx context.Context, field graphql.CollectedField, obj *PeerInfo) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "PeerInfo", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.IsOutbound, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(bool) - fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) -} - -func (ec *executionContext) _PeerInfo_remote_ip(ctx context.Context, field graphql.CollectedField, obj *PeerInfo) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "PeerInfo", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.RemoteIP, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) _Query_getStatus(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Query", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: true, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().GetStatus(rctx) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(*Status) - fc.Result = res - return ec.marshalNStatus2ᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐStatus(ctx, field.Selections, res) -} - -func (ec *executionContext) _Query_getAccounts(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Query", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: true, - } - - ctx = graphql.WithFieldContext(ctx, fc) - rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field_Query_getAccounts_args(ctx, rawArgs) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - fc.Args = args - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().GetAccounts(rctx, args["addresses"].([]string)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.([]*Account) - fc.Result = res - return ec.marshalOAccount2ᚕᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐAccount(ctx, field.Selections, res) -} - -func (ec *executionContext) _Query_getBondsByIds(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Query", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: true, - } - - ctx = graphql.WithFieldContext(ctx, fc) - rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field_Query_getBondsByIds_args(ctx, rawArgs) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - fc.Args = args - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().GetBondsByIds(rctx, args["ids"].([]string)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.([]*Bond) - fc.Result = res - return ec.marshalOBond2ᚕᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐBond(ctx, field.Selections, res) -} - -func (ec *executionContext) _Query_queryBonds(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Query", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: true, - } - - ctx = graphql.WithFieldContext(ctx, fc) - rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field_Query_queryBonds_args(ctx, rawArgs) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - fc.Args = args - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().QueryBonds(rctx, args["attributes"].([]*KeyValueInput)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.([]*Bond) - fc.Result = res - return ec.marshalOBond2ᚕᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐBond(ctx, field.Selections, res) -} - -func (ec *executionContext) _Query_queryBondsByOwner(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Query", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: true, - } - - ctx = graphql.WithFieldContext(ctx, fc) - rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field_Query_queryBondsByOwner_args(ctx, rawArgs) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - fc.Args = args - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().QueryBondsByOwner(rctx, args["ownerAddresses"].([]string)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.([]*OwnerBonds) - fc.Result = res - return ec.marshalOOwnerBonds2ᚕᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐOwnerBonds(ctx, field.Selections, res) -} - -func (ec *executionContext) _Query_getRecordsByIds(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Query", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: true, - } - - ctx = graphql.WithFieldContext(ctx, fc) - rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field_Query_getRecordsByIds_args(ctx, rawArgs) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - fc.Args = args - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().GetRecordsByIds(rctx, args["ids"].([]string)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.([]*Record) - fc.Result = res - return ec.marshalORecord2ᚕᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐRecord(ctx, field.Selections, res) -} - -func (ec *executionContext) _Query_queryRecords(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Query", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: true, - } - - ctx = graphql.WithFieldContext(ctx, fc) - rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field_Query_queryRecords_args(ctx, rawArgs) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - fc.Args = args - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().QueryRecords(rctx, args["attributes"].([]*KeyValueInput), args["all"].(*bool)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.([]*Record) - fc.Result = res - return ec.marshalORecord2ᚕᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐRecord(ctx, field.Selections, res) -} - -func (ec *executionContext) _Query_lookupAuthorities(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Query", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: true, - } - - ctx = graphql.WithFieldContext(ctx, fc) - rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field_Query_lookupAuthorities_args(ctx, rawArgs) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - fc.Args = args - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().LookupAuthorities(rctx, args["names"].([]string)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.([]*AuthorityRecord) - fc.Result = res - return ec.marshalNAuthorityRecord2ᚕᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐAuthorityRecord(ctx, field.Selections, res) -} - -func (ec *executionContext) _Query_lookupNames(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Query", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: true, - } - - ctx = graphql.WithFieldContext(ctx, fc) - rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field_Query_lookupNames_args(ctx, rawArgs) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - fc.Args = args - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().LookupNames(rctx, args["names"].([]string)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.([]*NameRecord) - fc.Result = res - return ec.marshalNNameRecord2ᚕᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐNameRecord(ctx, field.Selections, res) -} - -func (ec *executionContext) _Query_resolveNames(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Query", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: true, - } - - ctx = graphql.WithFieldContext(ctx, fc) - rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field_Query_resolveNames_args(ctx, rawArgs) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - fc.Args = args - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().ResolveNames(rctx, args["names"].([]string)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.([]*Record) - fc.Result = res - return ec.marshalNRecord2ᚕᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐRecord(ctx, field.Selections, res) -} - -func (ec *executionContext) _Query_getAuctionsByIds(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Query", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: true, - } - - ctx = graphql.WithFieldContext(ctx, fc) - rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field_Query_getAuctionsByIds_args(ctx, rawArgs) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - fc.Args = args - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().GetAuctionsByIds(rctx, args["ids"].([]string)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.([]*Auction) - fc.Result = res - return ec.marshalOAuction2ᚕᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐAuction(ctx, field.Selections, res) -} - -func (ec *executionContext) _Query___type(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Query", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field_Query___type_args(ctx, rawArgs) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - fc.Args = args - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.introspectType(args["name"].(string)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*introspection.Type) - fc.Result = res - return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) -} - -func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Query", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.introspectSchema() - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*introspection.Schema) - fc.Result = res - return ec.marshalO__Schema2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx, field.Selections, res) -} - -func (ec *executionContext) _Record_id(ctx context.Context, field graphql.CollectedField, obj *Record) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Record", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ID, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) _Record_names(ctx context.Context, field graphql.CollectedField, obj *Record) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Record", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Names, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.([]string) - fc.Result = res - return ec.marshalOString2ᚕstringᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) _Record_bondId(ctx context.Context, field graphql.CollectedField, obj *Record) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Record", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.BondID, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) _Record_createTime(ctx context.Context, field graphql.CollectedField, obj *Record) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Record", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.CreateTime, nil @@ -3908,22 +1748,1062 @@ func (ec *executionContext) _Record_createTime(ctx context.Context, field graphq return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) _Record_expiryTime(ctx context.Context, field graphql.CollectedField, obj *Record) (ret graphql.Marshaler) { +func (ec *executionContext) fieldContext_Auction_createTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Auction", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Auction_commitsEndTime(ctx context.Context, field graphql.CollectedField, obj *Auction) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Auction_commitsEndTime(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) ret = graphql.Null } }() - fc := &graphql.FieldContext{ - Object: "Record", + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CommitsEndTime, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Auction_commitsEndTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Auction", Field: field, - Args: nil, IsMethod: false, IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, } + return fc, nil +} +func (ec *executionContext) _Auction_revealsEndTime(ctx context.Context, field graphql.CollectedField, obj *Auction) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Auction_revealsEndTime(ctx, field) + if err != nil { + return graphql.Null + } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.RevealsEndTime, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Auction_revealsEndTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Auction", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Auction_commitFee(ctx context.Context, field graphql.CollectedField, obj *Auction) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Auction_commitFee(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CommitFee, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*Coin) + fc.Result = res + return ec.marshalNCoin2ᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐCoin(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Auction_commitFee(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Auction", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "type": + return ec.fieldContext_Coin_type(ctx, field) + case "quantity": + return ec.fieldContext_Coin_quantity(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Coin", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Auction_revealFee(ctx context.Context, field graphql.CollectedField, obj *Auction) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Auction_revealFee(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.RevealFee, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*Coin) + fc.Result = res + return ec.marshalNCoin2ᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐCoin(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Auction_revealFee(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Auction", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "type": + return ec.fieldContext_Coin_type(ctx, field) + case "quantity": + return ec.fieldContext_Coin_quantity(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Coin", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Auction_minimumBid(ctx context.Context, field graphql.CollectedField, obj *Auction) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Auction_minimumBid(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.MinimumBid, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*Coin) + fc.Result = res + return ec.marshalNCoin2ᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐCoin(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Auction_minimumBid(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Auction", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "type": + return ec.fieldContext_Coin_type(ctx, field) + case "quantity": + return ec.fieldContext_Coin_quantity(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Coin", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Auction_winnerAddress(ctx context.Context, field graphql.CollectedField, obj *Auction) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Auction_winnerAddress(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.WinnerAddress, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Auction_winnerAddress(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Auction", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Auction_winnerBid(ctx context.Context, field graphql.CollectedField, obj *Auction) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Auction_winnerBid(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.WinnerBid, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*Coin) + fc.Result = res + return ec.marshalNCoin2ᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐCoin(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Auction_winnerBid(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Auction", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "type": + return ec.fieldContext_Coin_type(ctx, field) + case "quantity": + return ec.fieldContext_Coin_quantity(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Coin", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Auction_winnerPrice(ctx context.Context, field graphql.CollectedField, obj *Auction) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Auction_winnerPrice(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.WinnerPrice, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*Coin) + fc.Result = res + return ec.marshalNCoin2ᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐCoin(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Auction_winnerPrice(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Auction", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "type": + return ec.fieldContext_Coin_type(ctx, field) + case "quantity": + return ec.fieldContext_Coin_quantity(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Coin", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Auction_bids(ctx context.Context, field graphql.CollectedField, obj *Auction) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Auction_bids(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Bids, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*AuctionBid) + fc.Result = res + return ec.marshalOAuctionBid2ᚕᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐAuctionBid(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Auction_bids(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Auction", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "bidderAddress": + return ec.fieldContext_AuctionBid_bidderAddress(ctx, field) + case "status": + return ec.fieldContext_AuctionBid_status(ctx, field) + case "commitHash": + return ec.fieldContext_AuctionBid_commitHash(ctx, field) + case "commitTime": + return ec.fieldContext_AuctionBid_commitTime(ctx, field) + case "commitFee": + return ec.fieldContext_AuctionBid_commitFee(ctx, field) + case "revealTime": + return ec.fieldContext_AuctionBid_revealTime(ctx, field) + case "revealFee": + return ec.fieldContext_AuctionBid_revealFee(ctx, field) + case "bidAmount": + return ec.fieldContext_AuctionBid_bidAmount(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type AuctionBid", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _AuctionBid_bidderAddress(ctx context.Context, field graphql.CollectedField, obj *AuctionBid) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_AuctionBid_bidderAddress(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.BidderAddress, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_AuctionBid_bidderAddress(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "AuctionBid", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _AuctionBid_status(ctx context.Context, field graphql.CollectedField, obj *AuctionBid) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_AuctionBid_status(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Status, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_AuctionBid_status(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "AuctionBid", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _AuctionBid_commitHash(ctx context.Context, field graphql.CollectedField, obj *AuctionBid) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_AuctionBid_commitHash(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CommitHash, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_AuctionBid_commitHash(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "AuctionBid", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _AuctionBid_commitTime(ctx context.Context, field graphql.CollectedField, obj *AuctionBid) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_AuctionBid_commitTime(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CommitTime, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_AuctionBid_commitTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "AuctionBid", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _AuctionBid_commitFee(ctx context.Context, field graphql.CollectedField, obj *AuctionBid) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_AuctionBid_commitFee(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CommitFee, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*Coin) + fc.Result = res + return ec.marshalNCoin2ᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐCoin(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_AuctionBid_commitFee(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "AuctionBid", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "type": + return ec.fieldContext_Coin_type(ctx, field) + case "quantity": + return ec.fieldContext_Coin_quantity(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Coin", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _AuctionBid_revealTime(ctx context.Context, field graphql.CollectedField, obj *AuctionBid) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_AuctionBid_revealTime(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.RevealTime, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_AuctionBid_revealTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "AuctionBid", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _AuctionBid_revealFee(ctx context.Context, field graphql.CollectedField, obj *AuctionBid) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_AuctionBid_revealFee(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.RevealFee, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*Coin) + fc.Result = res + return ec.marshalNCoin2ᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐCoin(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_AuctionBid_revealFee(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "AuctionBid", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "type": + return ec.fieldContext_Coin_type(ctx, field) + case "quantity": + return ec.fieldContext_Coin_quantity(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Coin", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _AuctionBid_bidAmount(ctx context.Context, field graphql.CollectedField, obj *AuctionBid) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_AuctionBid_bidAmount(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.BidAmount, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*Coin) + fc.Result = res + return ec.marshalNCoin2ᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐCoin(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_AuctionBid_bidAmount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "AuctionBid", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "type": + return ec.fieldContext_Coin_type(ctx, field) + case "quantity": + return ec.fieldContext_Coin_quantity(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Coin", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _AuthorityRecord_ownerAddress(ctx context.Context, field graphql.CollectedField, obj *AuthorityRecord) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_AuthorityRecord_ownerAddress(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.OwnerAddress, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_AuthorityRecord_ownerAddress(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "AuthorityRecord", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _AuthorityRecord_ownerPublicKey(ctx context.Context, field graphql.CollectedField, obj *AuthorityRecord) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_AuthorityRecord_ownerPublicKey(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.OwnerPublicKey, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_AuthorityRecord_ownerPublicKey(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "AuthorityRecord", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _AuthorityRecord_height(ctx context.Context, field graphql.CollectedField, obj *AuthorityRecord) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_AuthorityRecord_height(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Height, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_AuthorityRecord_height(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "AuthorityRecord", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _AuthorityRecord_status(ctx context.Context, field graphql.CollectedField, obj *AuthorityRecord) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_AuthorityRecord_status(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Status, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_AuthorityRecord_status(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "AuthorityRecord", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _AuthorityRecord_bondId(ctx context.Context, field graphql.CollectedField, obj *AuthorityRecord) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_AuthorityRecord_bondId(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.BondID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_AuthorityRecord_bondId(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "AuthorityRecord", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _AuthorityRecord_expiryTime(ctx context.Context, field graphql.CollectedField, obj *AuthorityRecord) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_AuthorityRecord_expiryTime(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.ExpiryTime, nil @@ -3943,25 +2823,34 @@ func (ec *executionContext) _Record_expiryTime(ctx context.Context, field graphq return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) _Record_owners(ctx context.Context, field graphql.CollectedField, obj *Record) (ret graphql.Marshaler) { +func (ec *executionContext) fieldContext_AuthorityRecord_expiryTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "AuthorityRecord", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _AuthorityRecord_auction(ctx context.Context, field graphql.CollectedField, obj *AuthorityRecord) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_AuthorityRecord_auction(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) ret = graphql.Null } }() - fc := &graphql.FieldContext{ - Object: "Record", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Owners, nil + return obj.Auction, nil }) if err != nil { ec.Error(ctx, err) @@ -3970,91 +2859,64 @@ func (ec *executionContext) _Record_owners(ctx context.Context, field graphql.Co if resTmp == nil { return graphql.Null } - res := resTmp.([]string) + res := resTmp.(*Auction) fc.Result = res - return ec.marshalOString2ᚕstringᚄ(ctx, field.Selections, res) + return ec.marshalOAuction2ᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐAuction(ctx, field.Selections, res) } -func (ec *executionContext) _Record_attributes(ctx context.Context, field graphql.CollectedField, obj *Record) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Record", +func (ec *executionContext) fieldContext_AuthorityRecord_auction(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "AuthorityRecord", Field: field, - Args: nil, IsMethod: false, IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_Auction_id(ctx, field) + case "status": + return ec.fieldContext_Auction_status(ctx, field) + case "ownerAddress": + return ec.fieldContext_Auction_ownerAddress(ctx, field) + case "createTime": + return ec.fieldContext_Auction_createTime(ctx, field) + case "commitsEndTime": + return ec.fieldContext_Auction_commitsEndTime(ctx, field) + case "revealsEndTime": + return ec.fieldContext_Auction_revealsEndTime(ctx, field) + case "commitFee": + return ec.fieldContext_Auction_commitFee(ctx, field) + case "revealFee": + return ec.fieldContext_Auction_revealFee(ctx, field) + case "minimumBid": + return ec.fieldContext_Auction_minimumBid(ctx, field) + case "winnerAddress": + return ec.fieldContext_Auction_winnerAddress(ctx, field) + case "winnerBid": + return ec.fieldContext_Auction_winnerBid(ctx, field) + case "winnerPrice": + return ec.fieldContext_Auction_winnerPrice(ctx, field) + case "bids": + return ec.fieldContext_Auction_bids(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Auction", field.Name) + }, } + return fc, nil +} - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Attributes, nil - }) +func (ec *executionContext) _Bond_id(ctx context.Context, field graphql.CollectedField, obj *Bond) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Bond_id(ctx, field) if err != nil { - ec.Error(ctx, err) return graphql.Null } - if resTmp == nil { - return graphql.Null - } - res := resTmp.([]*KeyValue) - fc.Result = res - return ec.marshalOKeyValue2ᚕᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐKeyValue(ctx, field.Selections, res) -} - -func (ec *executionContext) _Record_references(ctx context.Context, field graphql.CollectedField, obj *Record) (ret graphql.Marshaler) { + ctx = graphql.WithFieldContext(ctx, fc) defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) ret = graphql.Null } }() - fc := &graphql.FieldContext{ - Object: "Record", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.References, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.([]*Record) - fc.Result = res - return ec.marshalORecord2ᚕᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐRecord(ctx, field.Selections, res) -} - -func (ec *executionContext) _Reference_id(ctx context.Context, field graphql.CollectedField, obj *Reference) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Reference", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.ID, nil @@ -4074,22 +2936,2252 @@ func (ec *executionContext) _Reference_id(ctx context.Context, field graphql.Col return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) _Status_version(ctx context.Context, field graphql.CollectedField, obj *Status) (ret graphql.Marshaler) { +func (ec *executionContext) fieldContext_Bond_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Bond", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Bond_owner(ctx context.Context, field graphql.CollectedField, obj *Bond) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Bond_owner(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) ret = graphql.Null } }() - fc := &graphql.FieldContext{ - Object: "Status", + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Owner, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Bond_owner(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Bond", Field: field, - Args: nil, IsMethod: false, IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, } + return fc, nil +} +func (ec *executionContext) _Bond_balance(ctx context.Context, field graphql.CollectedField, obj *Bond) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Bond_balance(ctx, field) + if err != nil { + return graphql.Null + } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Balance, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*Coin) + fc.Result = res + return ec.marshalOCoin2ᚕᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐCoinᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Bond_balance(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Bond", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "type": + return ec.fieldContext_Coin_type(ctx, field) + case "quantity": + return ec.fieldContext_Coin_quantity(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Coin", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _BooleanValue_value(ctx context.Context, field graphql.CollectedField, obj *BooleanValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_BooleanValue_value(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Value, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_BooleanValue_value(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "BooleanValue", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _BytesValue_value(ctx context.Context, field graphql.CollectedField, obj *BytesValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_BytesValue_value(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Value, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_BytesValue_value(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "BytesValue", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Coin_type(ctx context.Context, field graphql.CollectedField, obj *Coin) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Coin_type(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Type, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Coin_type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Coin", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Coin_quantity(ctx context.Context, field graphql.CollectedField, obj *Coin) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Coin_quantity(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Quantity, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Coin_quantity(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Coin", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _FloatValue_value(ctx context.Context, field graphql.CollectedField, obj *FloatValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_FloatValue_value(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Value, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(float64) + fc.Result = res + return ec.marshalNFloat2float64(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_FloatValue_value(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "FloatValue", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Float does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _IntValue_value(ctx context.Context, field graphql.CollectedField, obj *IntValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_IntValue_value(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Value, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_IntValue_value(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "IntValue", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Int does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _LinkValue_value(ctx context.Context, field graphql.CollectedField, obj *LinkValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_LinkValue_value(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Value, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(Link) + fc.Result = res + return ec.marshalNLink2githubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐLink(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_LinkValue_value(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "LinkValue", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Link does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _MapValue_value(ctx context.Context, field graphql.CollectedField, obj *MapValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_MapValue_value(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Value, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]*Attribute) + fc.Result = res + return ec.marshalNAttribute2ᚕᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐAttributeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_MapValue_value(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "MapValue", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "key": + return ec.fieldContext_Attribute_key(ctx, field) + case "value": + return ec.fieldContext_Attribute_value(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Attribute", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _NameRecord_latest(ctx context.Context, field graphql.CollectedField, obj *NameRecord) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_NameRecord_latest(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Latest, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*NameRecordEntry) + fc.Result = res + return ec.marshalNNameRecordEntry2ᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐNameRecordEntry(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_NameRecord_latest(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "NameRecord", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_NameRecordEntry_id(ctx, field) + case "height": + return ec.fieldContext_NameRecordEntry_height(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type NameRecordEntry", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _NameRecord_history(ctx context.Context, field graphql.CollectedField, obj *NameRecord) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_NameRecord_history(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.History, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*NameRecordEntry) + fc.Result = res + return ec.marshalONameRecordEntry2ᚕᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐNameRecordEntry(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_NameRecord_history(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "NameRecord", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_NameRecordEntry_id(ctx, field) + case "height": + return ec.fieldContext_NameRecordEntry_height(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type NameRecordEntry", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _NameRecordEntry_id(ctx context.Context, field graphql.CollectedField, obj *NameRecordEntry) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_NameRecordEntry_id(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_NameRecordEntry_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "NameRecordEntry", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _NameRecordEntry_height(ctx context.Context, field graphql.CollectedField, obj *NameRecordEntry) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_NameRecordEntry_height(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Height, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_NameRecordEntry_height(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "NameRecordEntry", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _NodeInfo_id(ctx context.Context, field graphql.CollectedField, obj *NodeInfo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_NodeInfo_id(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_NodeInfo_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "NodeInfo", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _NodeInfo_network(ctx context.Context, field graphql.CollectedField, obj *NodeInfo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_NodeInfo_network(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Network, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_NodeInfo_network(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "NodeInfo", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _NodeInfo_moniker(ctx context.Context, field graphql.CollectedField, obj *NodeInfo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_NodeInfo_moniker(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Moniker, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_NodeInfo_moniker(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "NodeInfo", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _OwnerBonds_owner(ctx context.Context, field graphql.CollectedField, obj *OwnerBonds) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OwnerBonds_owner(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Owner, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OwnerBonds_owner(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OwnerBonds", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _OwnerBonds_bonds(ctx context.Context, field graphql.CollectedField, obj *OwnerBonds) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_OwnerBonds_bonds(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Bonds, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*Bond) + fc.Result = res + return ec.marshalOBond2ᚕᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐBondᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_OwnerBonds_bonds(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "OwnerBonds", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_Bond_id(ctx, field) + case "owner": + return ec.fieldContext_Bond_owner(ctx, field) + case "balance": + return ec.fieldContext_Bond_balance(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Bond", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _PeerInfo_node(ctx context.Context, field graphql.CollectedField, obj *PeerInfo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PeerInfo_node(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Node, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*NodeInfo) + fc.Result = res + return ec.marshalNNodeInfo2ᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐNodeInfo(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_PeerInfo_node(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PeerInfo", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_NodeInfo_id(ctx, field) + case "network": + return ec.fieldContext_NodeInfo_network(ctx, field) + case "moniker": + return ec.fieldContext_NodeInfo_moniker(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type NodeInfo", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _PeerInfo_is_outbound(ctx context.Context, field graphql.CollectedField, obj *PeerInfo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PeerInfo_is_outbound(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.IsOutbound, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_PeerInfo_is_outbound(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PeerInfo", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _PeerInfo_remote_ip(ctx context.Context, field graphql.CollectedField, obj *PeerInfo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PeerInfo_remote_ip(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.RemoteIP, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_PeerInfo_remote_ip(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PeerInfo", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Query_getStatus(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_getStatus(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().GetStatus(rctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*Status) + fc.Result = res + return ec.marshalNStatus2ᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐStatus(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_getStatus(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "version": + return ec.fieldContext_Status_version(ctx, field) + case "node": + return ec.fieldContext_Status_node(ctx, field) + case "sync": + return ec.fieldContext_Status_sync(ctx, field) + case "validator": + return ec.fieldContext_Status_validator(ctx, field) + case "validators": + return ec.fieldContext_Status_validators(ctx, field) + case "num_peers": + return ec.fieldContext_Status_num_peers(ctx, field) + case "peers": + return ec.fieldContext_Status_peers(ctx, field) + case "disk_usage": + return ec.fieldContext_Status_disk_usage(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Status", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Query_getAccounts(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_getAccounts(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().GetAccounts(rctx, fc.Args["addresses"].([]string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*Account) + fc.Result = res + return ec.marshalOAccount2ᚕᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐAccount(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_getAccounts(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "address": + return ec.fieldContext_Account_address(ctx, field) + case "pubKey": + return ec.fieldContext_Account_pubKey(ctx, field) + case "number": + return ec.fieldContext_Account_number(ctx, field) + case "sequence": + return ec.fieldContext_Account_sequence(ctx, field) + case "balance": + return ec.fieldContext_Account_balance(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Account", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query_getAccounts_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Query_getBondsByIds(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_getBondsByIds(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().GetBondsByIds(rctx, fc.Args["ids"].([]string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*Bond) + fc.Result = res + return ec.marshalOBond2ᚕᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐBond(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_getBondsByIds(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_Bond_id(ctx, field) + case "owner": + return ec.fieldContext_Bond_owner(ctx, field) + case "balance": + return ec.fieldContext_Bond_balance(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Bond", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query_getBondsByIds_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Query_queryBonds(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_queryBonds(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().QueryBonds(rctx, fc.Args["attributes"].([]*KeyValueInput)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*Bond) + fc.Result = res + return ec.marshalOBond2ᚕᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐBond(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_queryBonds(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_Bond_id(ctx, field) + case "owner": + return ec.fieldContext_Bond_owner(ctx, field) + case "balance": + return ec.fieldContext_Bond_balance(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Bond", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query_queryBonds_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Query_queryBondsByOwner(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_queryBondsByOwner(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().QueryBondsByOwner(rctx, fc.Args["ownerAddresses"].([]string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*OwnerBonds) + fc.Result = res + return ec.marshalOOwnerBonds2ᚕᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐOwnerBonds(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_queryBondsByOwner(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "owner": + return ec.fieldContext_OwnerBonds_owner(ctx, field) + case "bonds": + return ec.fieldContext_OwnerBonds_bonds(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type OwnerBonds", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query_queryBondsByOwner_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Query_getRecordsByIds(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_getRecordsByIds(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().GetRecordsByIds(rctx, fc.Args["ids"].([]string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*Record) + fc.Result = res + return ec.marshalORecord2ᚕᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐRecord(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_getRecordsByIds(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_Record_id(ctx, field) + case "names": + return ec.fieldContext_Record_names(ctx, field) + case "bondId": + return ec.fieldContext_Record_bondId(ctx, field) + case "createTime": + return ec.fieldContext_Record_createTime(ctx, field) + case "expiryTime": + return ec.fieldContext_Record_expiryTime(ctx, field) + case "owners": + return ec.fieldContext_Record_owners(ctx, field) + case "attributes": + return ec.fieldContext_Record_attributes(ctx, field) + case "references": + return ec.fieldContext_Record_references(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Record", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query_getRecordsByIds_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Query_queryRecords(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_queryRecords(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().QueryRecords(rctx, fc.Args["attributes"].([]*KeyValueInput), fc.Args["all"].(*bool)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*Record) + fc.Result = res + return ec.marshalORecord2ᚕᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐRecord(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_queryRecords(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_Record_id(ctx, field) + case "names": + return ec.fieldContext_Record_names(ctx, field) + case "bondId": + return ec.fieldContext_Record_bondId(ctx, field) + case "createTime": + return ec.fieldContext_Record_createTime(ctx, field) + case "expiryTime": + return ec.fieldContext_Record_expiryTime(ctx, field) + case "owners": + return ec.fieldContext_Record_owners(ctx, field) + case "attributes": + return ec.fieldContext_Record_attributes(ctx, field) + case "references": + return ec.fieldContext_Record_references(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Record", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query_queryRecords_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Query_lookupAuthorities(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_lookupAuthorities(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().LookupAuthorities(rctx, fc.Args["names"].([]string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]*AuthorityRecord) + fc.Result = res + return ec.marshalNAuthorityRecord2ᚕᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐAuthorityRecord(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_lookupAuthorities(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "ownerAddress": + return ec.fieldContext_AuthorityRecord_ownerAddress(ctx, field) + case "ownerPublicKey": + return ec.fieldContext_AuthorityRecord_ownerPublicKey(ctx, field) + case "height": + return ec.fieldContext_AuthorityRecord_height(ctx, field) + case "status": + return ec.fieldContext_AuthorityRecord_status(ctx, field) + case "bondId": + return ec.fieldContext_AuthorityRecord_bondId(ctx, field) + case "expiryTime": + return ec.fieldContext_AuthorityRecord_expiryTime(ctx, field) + case "auction": + return ec.fieldContext_AuthorityRecord_auction(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type AuthorityRecord", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query_lookupAuthorities_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Query_lookupNames(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_lookupNames(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().LookupNames(rctx, fc.Args["names"].([]string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]*NameRecord) + fc.Result = res + return ec.marshalNNameRecord2ᚕᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐNameRecord(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_lookupNames(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "latest": + return ec.fieldContext_NameRecord_latest(ctx, field) + case "history": + return ec.fieldContext_NameRecord_history(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type NameRecord", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query_lookupNames_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Query_resolveNames(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_resolveNames(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().ResolveNames(rctx, fc.Args["names"].([]string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]*Record) + fc.Result = res + return ec.marshalNRecord2ᚕᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐRecord(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_resolveNames(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_Record_id(ctx, field) + case "names": + return ec.fieldContext_Record_names(ctx, field) + case "bondId": + return ec.fieldContext_Record_bondId(ctx, field) + case "createTime": + return ec.fieldContext_Record_createTime(ctx, field) + case "expiryTime": + return ec.fieldContext_Record_expiryTime(ctx, field) + case "owners": + return ec.fieldContext_Record_owners(ctx, field) + case "attributes": + return ec.fieldContext_Record_attributes(ctx, field) + case "references": + return ec.fieldContext_Record_references(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Record", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query_resolveNames_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Query_getAuctionsByIds(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_getAuctionsByIds(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().GetAuctionsByIds(rctx, fc.Args["ids"].([]string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*Auction) + fc.Result = res + return ec.marshalOAuction2ᚕᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐAuction(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_getAuctionsByIds(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_Auction_id(ctx, field) + case "status": + return ec.fieldContext_Auction_status(ctx, field) + case "ownerAddress": + return ec.fieldContext_Auction_ownerAddress(ctx, field) + case "createTime": + return ec.fieldContext_Auction_createTime(ctx, field) + case "commitsEndTime": + return ec.fieldContext_Auction_commitsEndTime(ctx, field) + case "revealsEndTime": + return ec.fieldContext_Auction_revealsEndTime(ctx, field) + case "commitFee": + return ec.fieldContext_Auction_commitFee(ctx, field) + case "revealFee": + return ec.fieldContext_Auction_revealFee(ctx, field) + case "minimumBid": + return ec.fieldContext_Auction_minimumBid(ctx, field) + case "winnerAddress": + return ec.fieldContext_Auction_winnerAddress(ctx, field) + case "winnerBid": + return ec.fieldContext_Auction_winnerBid(ctx, field) + case "winnerPrice": + return ec.fieldContext_Auction_winnerPrice(ctx, field) + case "bids": + return ec.fieldContext_Auction_bids(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Auction", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query_getAuctionsByIds_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Query___type(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query___type(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.introspectType(fc.Args["name"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query___type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query___type_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query___schema(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.introspectSchema() + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Schema) + fc.Result = res + return ec.marshalO__Schema2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query___schema(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "description": + return ec.fieldContext___Schema_description(ctx, field) + case "types": + return ec.fieldContext___Schema_types(ctx, field) + case "queryType": + return ec.fieldContext___Schema_queryType(ctx, field) + case "mutationType": + return ec.fieldContext___Schema_mutationType(ctx, field) + case "subscriptionType": + return ec.fieldContext___Schema_subscriptionType(ctx, field) + case "directives": + return ec.fieldContext___Schema_directives(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Schema", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Record_id(ctx context.Context, field graphql.CollectedField, obj *Record) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Record_id(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Record_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Record", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Record_names(ctx context.Context, field graphql.CollectedField, obj *Record) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Record_names(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Names, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]string) + fc.Result = res + return ec.marshalOString2ᚕstringᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Record_names(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Record", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Record_bondId(ctx context.Context, field graphql.CollectedField, obj *Record) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Record_bondId(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.BondID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Record_bondId(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Record", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Record_createTime(ctx context.Context, field graphql.CollectedField, obj *Record) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Record_createTime(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreateTime, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Record_createTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Record", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Record_expiryTime(ctx context.Context, field graphql.CollectedField, obj *Record) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Record_expiryTime(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ExpiryTime, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Record_expiryTime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Record", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Record_owners(ctx context.Context, field graphql.CollectedField, obj *Record) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Record_owners(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Owners, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]string) + fc.Result = res + return ec.marshalOString2ᚕstringᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Record_owners(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Record", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Record_attributes(ctx context.Context, field graphql.CollectedField, obj *Record) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Record_attributes(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Attributes, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*Attribute) + fc.Result = res + return ec.marshalOAttribute2ᚕᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐAttributeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Record_attributes(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Record", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "key": + return ec.fieldContext_Attribute_key(ctx, field) + case "value": + return ec.fieldContext_Attribute_value(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Attribute", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Record_references(ctx context.Context, field graphql.CollectedField, obj *Record) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Record_references(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.References, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*Record) + fc.Result = res + return ec.marshalORecord2ᚕᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐRecord(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Record_references(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Record", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_Record_id(ctx, field) + case "names": + return ec.fieldContext_Record_names(ctx, field) + case "bondId": + return ec.fieldContext_Record_bondId(ctx, field) + case "createTime": + return ec.fieldContext_Record_createTime(ctx, field) + case "expiryTime": + return ec.fieldContext_Record_expiryTime(ctx, field) + case "owners": + return ec.fieldContext_Record_owners(ctx, field) + case "attributes": + return ec.fieldContext_Record_attributes(ctx, field) + case "references": + return ec.fieldContext_Record_references(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Record", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Status_version(ctx context.Context, field graphql.CollectedField, obj *Status) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Status_version(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Version, nil @@ -4109,22 +5201,31 @@ func (ec *executionContext) _Status_version(ctx context.Context, field graphql.C return ec.marshalNString2string(ctx, field.Selections, res) } +func (ec *executionContext) fieldContext_Status_version(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Status", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + func (ec *executionContext) _Status_node(ctx context.Context, field graphql.CollectedField, obj *Status) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Status_node(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) ret = graphql.Null } }() - fc := &graphql.FieldContext{ - Object: "Status", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Node, nil @@ -4141,25 +5242,42 @@ func (ec *executionContext) _Status_node(ctx context.Context, field graphql.Coll } res := resTmp.(*NodeInfo) fc.Result = res - return ec.marshalNNodeInfo2ᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐNodeInfo(ctx, field.Selections, res) + return ec.marshalNNodeInfo2ᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐNodeInfo(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Status_node(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Status", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_NodeInfo_id(ctx, field) + case "network": + return ec.fieldContext_NodeInfo_network(ctx, field) + case "moniker": + return ec.fieldContext_NodeInfo_moniker(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type NodeInfo", field.Name) + }, + } + return fc, nil } func (ec *executionContext) _Status_sync(ctx context.Context, field graphql.CollectedField, obj *Status) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Status_sync(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) ret = graphql.Null } }() - fc := &graphql.FieldContext{ - Object: "Status", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Sync, nil @@ -4176,25 +5294,44 @@ func (ec *executionContext) _Status_sync(ctx context.Context, field graphql.Coll } res := resTmp.(*SyncInfo) fc.Result = res - return ec.marshalNSyncInfo2ᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐSyncInfo(ctx, field.Selections, res) + return ec.marshalNSyncInfo2ᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐSyncInfo(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Status_sync(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Status", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "latest_block_hash": + return ec.fieldContext_SyncInfo_latest_block_hash(ctx, field) + case "latest_block_height": + return ec.fieldContext_SyncInfo_latest_block_height(ctx, field) + case "latest_block_time": + return ec.fieldContext_SyncInfo_latest_block_time(ctx, field) + case "catching_up": + return ec.fieldContext_SyncInfo_catching_up(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type SyncInfo", field.Name) + }, + } + return fc, nil } func (ec *executionContext) _Status_validator(ctx context.Context, field graphql.CollectedField, obj *Status) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Status_validator(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) ret = graphql.Null } }() - fc := &graphql.FieldContext{ - Object: "Status", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Validator, nil @@ -4208,25 +5345,42 @@ func (ec *executionContext) _Status_validator(ctx context.Context, field graphql } res := resTmp.(*ValidatorInfo) fc.Result = res - return ec.marshalOValidatorInfo2ᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐValidatorInfo(ctx, field.Selections, res) + return ec.marshalOValidatorInfo2ᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐValidatorInfo(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Status_validator(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Status", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "address": + return ec.fieldContext_ValidatorInfo_address(ctx, field) + case "voting_power": + return ec.fieldContext_ValidatorInfo_voting_power(ctx, field) + case "proposer_priority": + return ec.fieldContext_ValidatorInfo_proposer_priority(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ValidatorInfo", field.Name) + }, + } + return fc, nil } func (ec *executionContext) _Status_validators(ctx context.Context, field graphql.CollectedField, obj *Status) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Status_validators(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) ret = graphql.Null } }() - fc := &graphql.FieldContext{ - Object: "Status", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Validators, nil @@ -4243,25 +5397,42 @@ func (ec *executionContext) _Status_validators(ctx context.Context, field graphq } res := resTmp.([]*ValidatorInfo) fc.Result = res - return ec.marshalNValidatorInfo2ᚕᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐValidatorInfo(ctx, field.Selections, res) + return ec.marshalNValidatorInfo2ᚕᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐValidatorInfo(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Status_validators(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Status", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "address": + return ec.fieldContext_ValidatorInfo_address(ctx, field) + case "voting_power": + return ec.fieldContext_ValidatorInfo_voting_power(ctx, field) + case "proposer_priority": + return ec.fieldContext_ValidatorInfo_proposer_priority(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ValidatorInfo", field.Name) + }, + } + return fc, nil } func (ec *executionContext) _Status_num_peers(ctx context.Context, field graphql.CollectedField, obj *Status) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Status_num_peers(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) ret = graphql.Null } }() - fc := &graphql.FieldContext{ - Object: "Status", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.NumPeers, nil @@ -4281,22 +5452,31 @@ func (ec *executionContext) _Status_num_peers(ctx context.Context, field graphql return ec.marshalNString2string(ctx, field.Selections, res) } +func (ec *executionContext) fieldContext_Status_num_peers(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Status", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + func (ec *executionContext) _Status_peers(ctx context.Context, field graphql.CollectedField, obj *Status) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Status_peers(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) ret = graphql.Null } }() - fc := &graphql.FieldContext{ - Object: "Status", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Peers, nil @@ -4310,25 +5490,42 @@ func (ec *executionContext) _Status_peers(ctx context.Context, field graphql.Col } res := resTmp.([]*PeerInfo) fc.Result = res - return ec.marshalOPeerInfo2ᚕᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐPeerInfo(ctx, field.Selections, res) + return ec.marshalOPeerInfo2ᚕᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐPeerInfo(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Status_peers(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Status", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "node": + return ec.fieldContext_PeerInfo_node(ctx, field) + case "is_outbound": + return ec.fieldContext_PeerInfo_is_outbound(ctx, field) + case "remote_ip": + return ec.fieldContext_PeerInfo_remote_ip(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PeerInfo", field.Name) + }, + } + return fc, nil } func (ec *executionContext) _Status_disk_usage(ctx context.Context, field graphql.CollectedField, obj *Status) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Status_disk_usage(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) ret = graphql.Null } }() - fc := &graphql.FieldContext{ - Object: "Status", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.DiskUsage, nil @@ -4348,22 +5545,75 @@ func (ec *executionContext) _Status_disk_usage(ctx context.Context, field graphq return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) _SyncInfo_latest_block_hash(ctx context.Context, field graphql.CollectedField, obj *SyncInfo) (ret graphql.Marshaler) { +func (ec *executionContext) fieldContext_Status_disk_usage(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Status", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _StringValue_value(ctx context.Context, field graphql.CollectedField, obj *StringValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_StringValue_value(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) ret = graphql.Null } }() - fc := &graphql.FieldContext{ - Object: "SyncInfo", + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Value, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_StringValue_value(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "StringValue", Field: field, - Args: nil, IsMethod: false, IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, } + return fc, nil +} +func (ec *executionContext) _SyncInfo_latest_block_hash(ctx context.Context, field graphql.CollectedField, obj *SyncInfo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SyncInfo_latest_block_hash(ctx, field) + if err != nil { + return graphql.Null + } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.LatestBlockHash, nil @@ -4383,22 +5633,31 @@ func (ec *executionContext) _SyncInfo_latest_block_hash(ctx context.Context, fie return ec.marshalNString2string(ctx, field.Selections, res) } +func (ec *executionContext) fieldContext_SyncInfo_latest_block_hash(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "SyncInfo", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + func (ec *executionContext) _SyncInfo_latest_block_height(ctx context.Context, field graphql.CollectedField, obj *SyncInfo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SyncInfo_latest_block_height(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) ret = graphql.Null } }() - fc := &graphql.FieldContext{ - Object: "SyncInfo", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.LatestBlockHeight, nil @@ -4418,22 +5677,31 @@ func (ec *executionContext) _SyncInfo_latest_block_height(ctx context.Context, f return ec.marshalNString2string(ctx, field.Selections, res) } +func (ec *executionContext) fieldContext_SyncInfo_latest_block_height(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "SyncInfo", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + func (ec *executionContext) _SyncInfo_latest_block_time(ctx context.Context, field graphql.CollectedField, obj *SyncInfo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SyncInfo_latest_block_time(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) ret = graphql.Null } }() - fc := &graphql.FieldContext{ - Object: "SyncInfo", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.LatestBlockTime, nil @@ -4453,22 +5721,31 @@ func (ec *executionContext) _SyncInfo_latest_block_time(ctx context.Context, fie return ec.marshalNString2string(ctx, field.Selections, res) } +func (ec *executionContext) fieldContext_SyncInfo_latest_block_time(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "SyncInfo", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + func (ec *executionContext) _SyncInfo_catching_up(ctx context.Context, field graphql.CollectedField, obj *SyncInfo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_SyncInfo_catching_up(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) ret = graphql.Null } }() - fc := &graphql.FieldContext{ - Object: "SyncInfo", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.CatchingUp, nil @@ -4488,22 +5765,31 @@ func (ec *executionContext) _SyncInfo_catching_up(ctx context.Context, field gra return ec.marshalNBoolean2bool(ctx, field.Selections, res) } +func (ec *executionContext) fieldContext_SyncInfo_catching_up(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "SyncInfo", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + return fc, nil +} + func (ec *executionContext) _ValidatorInfo_address(ctx context.Context, field graphql.CollectedField, obj *ValidatorInfo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ValidatorInfo_address(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) ret = graphql.Null } }() - fc := &graphql.FieldContext{ - Object: "ValidatorInfo", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Address, nil @@ -4523,22 +5809,31 @@ func (ec *executionContext) _ValidatorInfo_address(ctx context.Context, field gr return ec.marshalNString2string(ctx, field.Selections, res) } +func (ec *executionContext) fieldContext_ValidatorInfo_address(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ValidatorInfo", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + func (ec *executionContext) _ValidatorInfo_voting_power(ctx context.Context, field graphql.CollectedField, obj *ValidatorInfo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ValidatorInfo_voting_power(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) ret = graphql.Null } }() - fc := &graphql.FieldContext{ - Object: "ValidatorInfo", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.VotingPower, nil @@ -4558,22 +5853,31 @@ func (ec *executionContext) _ValidatorInfo_voting_power(ctx context.Context, fie return ec.marshalNString2string(ctx, field.Selections, res) } +func (ec *executionContext) fieldContext_ValidatorInfo_voting_power(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ValidatorInfo", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + func (ec *executionContext) _ValidatorInfo_proposer_priority(ctx context.Context, field graphql.CollectedField, obj *ValidatorInfo) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ValidatorInfo_proposer_priority(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) ret = graphql.Null } }() - fc := &graphql.FieldContext{ - Object: "ValidatorInfo", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.ProposerPriority, nil @@ -4590,278 +5894,31 @@ func (ec *executionContext) _ValidatorInfo_proposer_priority(ctx context.Context return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) _Value_null(ctx context.Context, field graphql.CollectedField, obj *Value) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Value", +func (ec *executionContext) fieldContext_ValidatorInfo_proposer_priority(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ValidatorInfo", Field: field, - Args: nil, IsMethod: false, IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Null, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*bool) - fc.Result = res - return ec.marshalOBoolean2ᚖbool(ctx, field.Selections, res) -} - -func (ec *executionContext) _Value_int(ctx context.Context, field graphql.CollectedField, obj *Value) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Value", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Int, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*int) - fc.Result = res - return ec.marshalOInt2ᚖint(ctx, field.Selections, res) -} - -func (ec *executionContext) _Value_float(ctx context.Context, field graphql.CollectedField, obj *Value) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Value", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Float, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*float64) - fc.Result = res - return ec.marshalOFloat2ᚖfloat64(ctx, field.Selections, res) -} - -func (ec *executionContext) _Value_string(ctx context.Context, field graphql.CollectedField, obj *Value) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Value", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.String, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) _Value_boolean(ctx context.Context, field graphql.CollectedField, obj *Value) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Value", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Boolean, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*bool) - fc.Result = res - return ec.marshalOBoolean2ᚖbool(ctx, field.Selections, res) -} - -func (ec *executionContext) _Value_json(ctx context.Context, field graphql.CollectedField, obj *Value) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Value", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.JSON, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) _Value_reference(ctx context.Context, field graphql.CollectedField, obj *Value) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Value", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Reference, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*Reference) - fc.Result = res - return ec.marshalOReference2ᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐReference(ctx, field.Selections, res) -} - -func (ec *executionContext) _Value_values(ctx context.Context, field graphql.CollectedField, obj *Value) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Value", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Values, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.([]*Value) - fc.Result = res - return ec.marshalOValue2ᚕᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐValue(ctx, field.Selections, res) + return fc, nil } func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Directive_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) ret = graphql.Null } }() - fc := &graphql.FieldContext{ - Object: "__Directive", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Name, nil @@ -4881,25 +5938,34 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql return ec.marshalNString2string(ctx, field.Selections, res) } +func (ec *executionContext) fieldContext___Directive_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Directive", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Directive_description(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) ret = graphql.Null } }() - fc := &graphql.FieldContext{ - Object: "__Directive", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Description, nil + return obj.Description(), nil }) if err != nil { ec.Error(ctx, err) @@ -4908,27 +5974,36 @@ func (ec *executionContext) ___Directive_description(ctx context.Context, field if resTmp == nil { return graphql.Null } - res := resTmp.(string) + res := resTmp.(*string) fc.Result = res - return ec.marshalOString2string(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Directive_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Directive", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil } func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Directive_locations(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) ret = graphql.Null } }() - fc := &graphql.FieldContext{ - Object: "__Directive", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Locations, nil @@ -4948,22 +6023,31 @@ func (ec *executionContext) ___Directive_locations(ctx context.Context, field gr return ec.marshalN__DirectiveLocation2ᚕstringᚄ(ctx, field.Selections, res) } +func (ec *executionContext) fieldContext___Directive_locations(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Directive", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type __DirectiveLocation does not have child fields") + }, + } + return fc, nil +} + func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Directive_args(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) ret = graphql.Null } }() - fc := &graphql.FieldContext{ - Object: "__Directive", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Args, nil @@ -4983,22 +6067,41 @@ func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) } +func (ec *executionContext) fieldContext___Directive_args(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Directive", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___InputValue_name(ctx, field) + case "description": + return ec.fieldContext___InputValue_description(ctx, field) + case "type": + return ec.fieldContext___InputValue_type(ctx, field) + case "defaultValue": + return ec.fieldContext___InputValue_defaultValue(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name) + }, + } + return fc, nil +} + func (ec *executionContext) ___Directive_isRepeatable(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Directive_isRepeatable(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) ret = graphql.Null } }() - fc := &graphql.FieldContext{ - Object: "__Directive", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.IsRepeatable, nil @@ -5018,22 +6121,31 @@ func (ec *executionContext) ___Directive_isRepeatable(ctx context.Context, field return ec.marshalNBoolean2bool(ctx, field.Selections, res) } +func (ec *executionContext) fieldContext___Directive_isRepeatable(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Directive", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + return fc, nil +} + func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___EnumValue_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) ret = graphql.Null } }() - fc := &graphql.FieldContext{ - Object: "__EnumValue", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Name, nil @@ -5053,25 +6165,34 @@ func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql return ec.marshalNString2string(ctx, field.Selections, res) } +func (ec *executionContext) fieldContext___EnumValue_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__EnumValue", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___EnumValue_description(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) ret = graphql.Null } }() - fc := &graphql.FieldContext{ - Object: "__EnumValue", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Description, nil + return obj.Description(), nil }) if err != nil { ec.Error(ctx, err) @@ -5080,27 +6201,36 @@ func (ec *executionContext) ___EnumValue_description(ctx context.Context, field if resTmp == nil { return graphql.Null } - res := resTmp.(string) + res := resTmp.(*string) fc.Result = res - return ec.marshalOString2string(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___EnumValue_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__EnumValue", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil } func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___EnumValue_isDeprecated(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) ret = graphql.Null } }() - fc := &graphql.FieldContext{ - Object: "__EnumValue", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.IsDeprecated(), nil @@ -5120,22 +6250,31 @@ func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field return ec.marshalNBoolean2bool(ctx, field.Selections, res) } +func (ec *executionContext) fieldContext___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__EnumValue", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + return fc, nil +} + func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___EnumValue_deprecationReason(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) ret = graphql.Null } }() - fc := &graphql.FieldContext{ - Object: "__EnumValue", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.DeprecationReason(), nil @@ -5152,22 +6291,31 @@ func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } +func (ec *executionContext) fieldContext___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__EnumValue", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) ret = graphql.Null } }() - fc := &graphql.FieldContext{ - Object: "__Field", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Name, nil @@ -5187,25 +6335,34 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col return ec.marshalNString2string(ctx, field.Selections, res) } +func (ec *executionContext) fieldContext___Field_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_description(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) ret = graphql.Null } }() - fc := &graphql.FieldContext{ - Object: "__Field", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Description, nil + return obj.Description(), nil }) if err != nil { ec.Error(ctx, err) @@ -5214,27 +6371,36 @@ func (ec *executionContext) ___Field_description(ctx context.Context, field grap if resTmp == nil { return graphql.Null } - res := resTmp.(string) + res := resTmp.(*string) fc.Result = res - return ec.marshalOString2string(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Field_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil } func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_args(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) ret = graphql.Null } }() - fc := &graphql.FieldContext{ - Object: "__Field", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Args, nil @@ -5254,22 +6420,41 @@ func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.Col return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) } +func (ec *executionContext) fieldContext___Field_args(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___InputValue_name(ctx, field) + case "description": + return ec.fieldContext___InputValue_description(ctx, field) + case "type": + return ec.fieldContext___InputValue_type(ctx, field) + case "defaultValue": + return ec.fieldContext___InputValue_defaultValue(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name) + }, + } + return fc, nil +} + func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_type(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) ret = graphql.Null } }() - fc := &graphql.FieldContext{ - Object: "__Field", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Type, nil @@ -5289,22 +6474,53 @@ func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.Col return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) } +func (ec *executionContext) fieldContext___Field_type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_isDeprecated(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) ret = graphql.Null } }() - fc := &graphql.FieldContext{ - Object: "__Field", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.IsDeprecated(), nil @@ -5324,22 +6540,31 @@ func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field gra return ec.marshalNBoolean2bool(ctx, field.Selections, res) } +func (ec *executionContext) fieldContext___Field_isDeprecated(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Boolean does not have child fields") + }, + } + return fc, nil +} + func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Field_deprecationReason(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) ret = graphql.Null } }() - fc := &graphql.FieldContext{ - Object: "__Field", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.DeprecationReason(), nil @@ -5356,22 +6581,31 @@ func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, fiel return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } +func (ec *executionContext) fieldContext___Field_deprecationReason(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Field", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) ret = graphql.Null } }() - fc := &graphql.FieldContext{ - Object: "__InputValue", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Name, nil @@ -5391,25 +6625,34 @@ func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphq return ec.marshalNString2string(ctx, field.Selections, res) } +func (ec *executionContext) fieldContext___InputValue_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_description(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) ret = graphql.Null } }() - fc := &graphql.FieldContext{ - Object: "__InputValue", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Description, nil + return obj.Description(), nil }) if err != nil { ec.Error(ctx, err) @@ -5418,27 +6661,36 @@ func (ec *executionContext) ___InputValue_description(ctx context.Context, field if resTmp == nil { return graphql.Null } - res := resTmp.(string) + res := resTmp.(*string) fc.Result = res - return ec.marshalOString2string(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___InputValue_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil } func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_type(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) ret = graphql.Null } }() - fc := &graphql.FieldContext{ - Object: "__InputValue", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Type, nil @@ -5458,22 +6710,53 @@ func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphq return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) } +func (ec *executionContext) fieldContext___InputValue_type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___InputValue_defaultValue(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) ret = graphql.Null } }() - fc := &graphql.FieldContext{ - Object: "__InputValue", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.DefaultValue, nil @@ -5490,22 +6773,72 @@ func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, fiel return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { +func (ec *executionContext) fieldContext___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) ___Schema_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_description(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) ret = graphql.Null } }() - fc := &graphql.FieldContext{ + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Schema_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ Object: "__Schema", Field: field, - Args: nil, IsMethod: true, IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, } + return fc, nil +} +func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_types(ctx, field) + if err != nil { + return graphql.Null + } ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Types(), nil @@ -5525,22 +6858,53 @@ func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.C return ec.marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) } +func (ec *executionContext) fieldContext___Schema_types(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_queryType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) ret = graphql.Null } }() - fc := &graphql.FieldContext{ - Object: "__Schema", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.QueryType(), nil @@ -5560,22 +6924,53 @@ func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graph return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) } +func (ec *executionContext) fieldContext___Schema_queryType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_mutationType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) ret = graphql.Null } }() - fc := &graphql.FieldContext{ - Object: "__Schema", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.MutationType(), nil @@ -5592,22 +6987,53 @@ func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field gr return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) } +func (ec *executionContext) fieldContext___Schema_mutationType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_subscriptionType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) ret = graphql.Null } }() - fc := &graphql.FieldContext{ - Object: "__Schema", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.SubscriptionType(), nil @@ -5624,22 +7050,53 @@ func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, fiel return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) } +func (ec *executionContext) fieldContext___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Schema_directives(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) ret = graphql.Null } }() - fc := &graphql.FieldContext{ - Object: "__Schema", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Directives(), nil @@ -5659,22 +7116,43 @@ func (ec *executionContext) ___Schema_directives(ctx context.Context, field grap return ec.marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirectiveᚄ(ctx, field.Selections, res) } +func (ec *executionContext) fieldContext___Schema_directives(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Schema", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___Directive_name(ctx, field) + case "description": + return ec.fieldContext___Directive_description(ctx, field) + case "locations": + return ec.fieldContext___Directive_locations(ctx, field) + case "args": + return ec.fieldContext___Directive_args(ctx, field) + case "isRepeatable": + return ec.fieldContext___Directive_isRepeatable(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Directive", field.Name) + }, + } + return fc, nil +} + func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_kind(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) ret = graphql.Null } }() - fc := &graphql.FieldContext{ - Object: "__Type", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Kind(), nil @@ -5694,22 +7172,31 @@ func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.Coll return ec.marshalN__TypeKind2string(ctx, field.Selections, res) } +func (ec *executionContext) fieldContext___Type_kind(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type __TypeKind does not have child fields") + }, + } + return fc, nil +} + func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) ret = graphql.Null } }() - fc := &graphql.FieldContext{ - Object: "__Type", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Name(), nil @@ -5726,22 +7213,31 @@ func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.Coll return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } +func (ec *executionContext) fieldContext___Type_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_description(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) ret = graphql.Null } }() - fc := &graphql.FieldContext{ - Object: "__Type", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Description(), nil @@ -5753,37 +7249,39 @@ func (ec *executionContext) ___Type_description(ctx context.Context, field graph if resTmp == nil { return graphql.Null } - res := resTmp.(string) + res := resTmp.(*string) fc.Result = res - return ec.marshalOString2string(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil } func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_fields(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) ret = graphql.Null } }() - fc := &graphql.FieldContext{ - Object: "__Type", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field___Type_fields_args(ctx, rawArgs) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - fc.Args = args resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Fields(args["includeDeprecated"].(bool)), nil + return obj.Fields(fc.Args["includeDeprecated"].(bool)), nil }) if err != nil { ec.Error(ctx, err) @@ -5797,22 +7295,56 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co return ec.marshalO__Field2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐFieldᚄ(ctx, field.Selections, res) } +func (ec *executionContext) fieldContext___Type_fields(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___Field_name(ctx, field) + case "description": + return ec.fieldContext___Field_description(ctx, field) + case "args": + return ec.fieldContext___Field_args(ctx, field) + case "type": + return ec.fieldContext___Field_type(ctx, field) + case "isDeprecated": + return ec.fieldContext___Field_isDeprecated(ctx, field) + case "deprecationReason": + return ec.fieldContext___Field_deprecationReason(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Field", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field___Type_fields_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_interfaces(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) ret = graphql.Null } }() - fc := &graphql.FieldContext{ - Object: "__Type", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.Interfaces(), nil @@ -5829,22 +7361,53 @@ func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphq return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) } +func (ec *executionContext) fieldContext___Type_interfaces(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_possibleTypes(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) ret = graphql.Null } }() - fc := &graphql.FieldContext{ - Object: "__Type", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.PossibleTypes(), nil @@ -5861,32 +7424,56 @@ func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field gra return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) } +func (ec *executionContext) fieldContext___Type_possibleTypes(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_enumValues(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) ret = graphql.Null } }() - fc := &graphql.FieldContext{ - Object: "__Type", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field___Type_enumValues_args(ctx, rawArgs) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - fc.Args = args resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.EnumValues(args["includeDeprecated"].(bool)), nil + return obj.EnumValues(fc.Args["includeDeprecated"].(bool)), nil }) if err != nil { ec.Error(ctx, err) @@ -5900,22 +7487,52 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq return ec.marshalO__EnumValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValueᚄ(ctx, field.Selections, res) } +func (ec *executionContext) fieldContext___Type_enumValues(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___EnumValue_name(ctx, field) + case "description": + return ec.fieldContext___EnumValue_description(ctx, field) + case "isDeprecated": + return ec.fieldContext___EnumValue_isDeprecated(ctx, field) + case "deprecationReason": + return ec.fieldContext___EnumValue_deprecationReason(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __EnumValue", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field___Type_enumValues_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_inputFields(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) ret = graphql.Null } }() - fc := &graphql.FieldContext{ - Object: "__Type", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.InputFields(), nil @@ -5932,22 +7549,41 @@ func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graph return ec.marshalO__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) } +func (ec *executionContext) fieldContext___Type_inputFields(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "name": + return ec.fieldContext___InputValue_name(ctx, field) + case "description": + return ec.fieldContext___InputValue_description(ctx, field) + case "type": + return ec.fieldContext___InputValue_type(ctx, field) + case "defaultValue": + return ec.fieldContext___InputValue_defaultValue(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name) + }, + } + return fc, nil +} + func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_ofType(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) ret = graphql.Null } }() - fc := &graphql.FieldContext{ - Object: "__Type", - Field: field, - Args: nil, - IsMethod: true, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children return obj.OfType(), nil @@ -5964,6 +7600,82 @@ func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.Co return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) } +func (ec *executionContext) fieldContext___Type_ofType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "kind": + return ec.fieldContext___Type_kind(ctx, field) + case "name": + return ec.fieldContext___Type_name(ctx, field) + case "description": + return ec.fieldContext___Type_description(ctx, field) + case "fields": + return ec.fieldContext___Type_fields(ctx, field) + case "interfaces": + return ec.fieldContext___Type_interfaces(ctx, field) + case "possibleTypes": + return ec.fieldContext___Type_possibleTypes(ctx, field) + case "enumValues": + return ec.fieldContext___Type_enumValues(ctx, field) + case "inputFields": + return ec.fieldContext___Type_inputFields(ctx, field) + case "ofType": + return ec.fieldContext___Type_ofType(ctx, field) + case "specifiedByURL": + return ec.fieldContext___Type_specifiedByURL(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) ___Type_specifiedByURL(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + fc, err := ec.fieldContext___Type_specifiedByURL(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.SpecifiedByURL(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext___Type_specifiedByURL(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "__Type", + Field: field, + IsMethod: true, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + // endregion **************************** field.gotpl ***************************** // region **************************** input.gotpl ***************************** @@ -5975,7 +7687,12 @@ func (ec *executionContext) unmarshalInputKeyValueInput(ctx context.Context, obj asMap[k] = v } - for k, v := range asMap { + fieldsInOrder := [...]string{"key", "value"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } switch k { case "key": var err error @@ -5989,30 +7706,7 @@ func (ec *executionContext) unmarshalInputKeyValueInput(ctx context.Context, obj var err error ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("value")) - it.Value, err = ec.unmarshalNValueInput2ᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐValueInput(ctx, v) - if err != nil { - return it, err - } - } - } - - return it, nil -} - -func (ec *executionContext) unmarshalInputReferenceInput(ctx context.Context, obj interface{}) (ReferenceInput, error) { - var it ReferenceInput - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v - } - - for k, v := range asMap { - switch k { - case "id": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) - it.ID, err = ec.unmarshalNString2string(ctx, v) + it.Value, err = ec.unmarshalOValueInput2ᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐValueInput(ctx, v) if err != nil { return it, err } @@ -6029,16 +7723,13 @@ func (ec *executionContext) unmarshalInputValueInput(ctx context.Context, obj in asMap[k] = v } - for k, v := range asMap { + fieldsInOrder := [...]string{"int", "float", "string", "boolean", "link", "array", "map"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } switch k { - case "null": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("null")) - it.Null, err = ec.unmarshalOBoolean2ᚖbool(ctx, v) - if err != nil { - return it, err - } case "int": var err error @@ -6071,19 +7762,27 @@ func (ec *executionContext) unmarshalInputValueInput(ctx context.Context, obj in if err != nil { return it, err } - case "reference": + case "link": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("reference")) - it.Reference, err = ec.unmarshalOReferenceInput2ᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐReferenceInput(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("link")) + it.Link, err = ec.unmarshalOLink2ᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐLink(ctx, v) if err != nil { return it, err } - case "values": + case "array": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("values")) - it.Values, err = ec.unmarshalOValueInput2ᚕᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐValueInput(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("array")) + it.Array, err = ec.unmarshalOValueInput2ᚕᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐValueInput(ctx, v) + if err != nil { + return it, err + } + case "map": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("map")) + it.Map, err = ec.unmarshalOKeyValueInput2ᚕᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐKeyValueInputᚄ(ctx, v) if err != nil { return it, err } @@ -6097,6 +7796,71 @@ func (ec *executionContext) unmarshalInputValueInput(ctx context.Context, obj in // region ************************** interface.gotpl *************************** +func (ec *executionContext) _Value(ctx context.Context, sel ast.SelectionSet, obj Value) graphql.Marshaler { + switch obj := (obj).(type) { + case nil: + return graphql.Null + case BooleanValue: + return ec._BooleanValue(ctx, sel, &obj) + case *BooleanValue: + if obj == nil { + return graphql.Null + } + return ec._BooleanValue(ctx, sel, obj) + case IntValue: + return ec._IntValue(ctx, sel, &obj) + case *IntValue: + if obj == nil { + return graphql.Null + } + return ec._IntValue(ctx, sel, obj) + case FloatValue: + return ec._FloatValue(ctx, sel, &obj) + case *FloatValue: + if obj == nil { + return graphql.Null + } + return ec._FloatValue(ctx, sel, obj) + case StringValue: + return ec._StringValue(ctx, sel, &obj) + case *StringValue: + if obj == nil { + return graphql.Null + } + return ec._StringValue(ctx, sel, obj) + case BytesValue: + return ec._BytesValue(ctx, sel, &obj) + case *BytesValue: + if obj == nil { + return graphql.Null + } + return ec._BytesValue(ctx, sel, obj) + case LinkValue: + return ec._LinkValue(ctx, sel, &obj) + case *LinkValue: + if obj == nil { + return graphql.Null + } + return ec._LinkValue(ctx, sel, obj) + case ArrayValue: + return ec._ArrayValue(ctx, sel, &obj) + case *ArrayValue: + if obj == nil { + return graphql.Null + } + return ec._ArrayValue(ctx, sel, obj) + case MapValue: + return ec._MapValue(ctx, sel, &obj) + case *MapValue: + if obj == nil { + return graphql.Null + } + return ec._MapValue(ctx, sel, obj) + default: + panic(fmt.Errorf("unexpected type %T", obj)) + } +} + // endregion ************************** interface.gotpl *************************** // region **************************** object.gotpl **************************** @@ -6105,7 +7869,6 @@ var accountImplementors = []string{"Account"} func (ec *executionContext) _Account(ctx context.Context, sel ast.SelectionSet, obj *Account) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, accountImplementors) - out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { @@ -6113,24 +7876,94 @@ func (ec *executionContext) _Account(ctx context.Context, sel ast.SelectionSet, case "__typename": out.Values[i] = graphql.MarshalString("Account") case "address": + out.Values[i] = ec._Account_address(ctx, field, obj) + if out.Values[i] == graphql.Null { invalids++ } case "pubKey": + out.Values[i] = ec._Account_pubKey(ctx, field, obj) + case "number": + out.Values[i] = ec._Account_number(ctx, field, obj) + if out.Values[i] == graphql.Null { invalids++ } case "sequence": + out.Values[i] = ec._Account_sequence(ctx, field, obj) + if out.Values[i] == graphql.Null { invalids++ } case "balance": + out.Values[i] = ec._Account_balance(ctx, field, obj) + + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var arrayValueImplementors = []string{"ArrayValue", "Value"} + +func (ec *executionContext) _ArrayValue(ctx context.Context, sel ast.SelectionSet, obj *ArrayValue) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, arrayValueImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("ArrayValue") + case "value": + + out.Values[i] = ec._ArrayValue_value(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var attributeImplementors = []string{"Attribute"} + +func (ec *executionContext) _Attribute(ctx context.Context, sel ast.SelectionSet, obj *Attribute) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, attributeImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Attribute") + case "key": + + out.Values[i] = ec._Attribute_key(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "value": + + out.Values[i] = ec._Attribute_value(ctx, field, obj) + default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -6146,7 +7979,6 @@ var auctionImplementors = []string{"Auction"} func (ec *executionContext) _Auction(ctx context.Context, sel ast.SelectionSet, obj *Auction) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, auctionImplementors) - out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { @@ -6154,67 +7986,93 @@ func (ec *executionContext) _Auction(ctx context.Context, sel ast.SelectionSet, case "__typename": out.Values[i] = graphql.MarshalString("Auction") case "id": + out.Values[i] = ec._Auction_id(ctx, field, obj) + if out.Values[i] == graphql.Null { invalids++ } case "status": + out.Values[i] = ec._Auction_status(ctx, field, obj) + if out.Values[i] == graphql.Null { invalids++ } case "ownerAddress": + out.Values[i] = ec._Auction_ownerAddress(ctx, field, obj) + if out.Values[i] == graphql.Null { invalids++ } case "createTime": + out.Values[i] = ec._Auction_createTime(ctx, field, obj) + if out.Values[i] == graphql.Null { invalids++ } case "commitsEndTime": + out.Values[i] = ec._Auction_commitsEndTime(ctx, field, obj) + if out.Values[i] == graphql.Null { invalids++ } case "revealsEndTime": + out.Values[i] = ec._Auction_revealsEndTime(ctx, field, obj) + if out.Values[i] == graphql.Null { invalids++ } case "commitFee": + out.Values[i] = ec._Auction_commitFee(ctx, field, obj) + if out.Values[i] == graphql.Null { invalids++ } case "revealFee": + out.Values[i] = ec._Auction_revealFee(ctx, field, obj) + if out.Values[i] == graphql.Null { invalids++ } case "minimumBid": + out.Values[i] = ec._Auction_minimumBid(ctx, field, obj) + if out.Values[i] == graphql.Null { invalids++ } case "winnerAddress": + out.Values[i] = ec._Auction_winnerAddress(ctx, field, obj) + if out.Values[i] == graphql.Null { invalids++ } case "winnerBid": + out.Values[i] = ec._Auction_winnerBid(ctx, field, obj) + if out.Values[i] == graphql.Null { invalids++ } case "winnerPrice": + out.Values[i] = ec._Auction_winnerPrice(ctx, field, obj) + if out.Values[i] == graphql.Null { invalids++ } case "bids": + out.Values[i] = ec._Auction_bids(ctx, field, obj) + default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -6230,7 +8088,6 @@ var auctionBidImplementors = []string{"AuctionBid"} func (ec *executionContext) _AuctionBid(ctx context.Context, sel ast.SelectionSet, obj *AuctionBid) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, auctionBidImplementors) - out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { @@ -6238,42 +8095,58 @@ func (ec *executionContext) _AuctionBid(ctx context.Context, sel ast.SelectionSe case "__typename": out.Values[i] = graphql.MarshalString("AuctionBid") case "bidderAddress": + out.Values[i] = ec._AuctionBid_bidderAddress(ctx, field, obj) + if out.Values[i] == graphql.Null { invalids++ } case "status": + out.Values[i] = ec._AuctionBid_status(ctx, field, obj) + if out.Values[i] == graphql.Null { invalids++ } case "commitHash": + out.Values[i] = ec._AuctionBid_commitHash(ctx, field, obj) + if out.Values[i] == graphql.Null { invalids++ } case "commitTime": + out.Values[i] = ec._AuctionBid_commitTime(ctx, field, obj) + if out.Values[i] == graphql.Null { invalids++ } case "commitFee": + out.Values[i] = ec._AuctionBid_commitFee(ctx, field, obj) + if out.Values[i] == graphql.Null { invalids++ } case "revealTime": + out.Values[i] = ec._AuctionBid_revealTime(ctx, field, obj) + if out.Values[i] == graphql.Null { invalids++ } case "revealFee": + out.Values[i] = ec._AuctionBid_revealFee(ctx, field, obj) + if out.Values[i] == graphql.Null { invalids++ } case "bidAmount": + out.Values[i] = ec._AuctionBid_bidAmount(ctx, field, obj) + if out.Values[i] == graphql.Null { invalids++ } @@ -6292,7 +8165,6 @@ var authorityRecordImplementors = []string{"AuthorityRecord"} func (ec *executionContext) _AuthorityRecord(ctx context.Context, sel ast.SelectionSet, obj *AuthorityRecord) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, authorityRecordImplementors) - out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { @@ -6300,37 +8172,51 @@ func (ec *executionContext) _AuthorityRecord(ctx context.Context, sel ast.Select case "__typename": out.Values[i] = graphql.MarshalString("AuthorityRecord") case "ownerAddress": + out.Values[i] = ec._AuthorityRecord_ownerAddress(ctx, field, obj) + if out.Values[i] == graphql.Null { invalids++ } case "ownerPublicKey": + out.Values[i] = ec._AuthorityRecord_ownerPublicKey(ctx, field, obj) + if out.Values[i] == graphql.Null { invalids++ } case "height": + out.Values[i] = ec._AuthorityRecord_height(ctx, field, obj) + if out.Values[i] == graphql.Null { invalids++ } case "status": + out.Values[i] = ec._AuthorityRecord_status(ctx, field, obj) + if out.Values[i] == graphql.Null { invalids++ } case "bondId": + out.Values[i] = ec._AuthorityRecord_bondId(ctx, field, obj) + if out.Values[i] == graphql.Null { invalids++ } case "expiryTime": + out.Values[i] = ec._AuthorityRecord_expiryTime(ctx, field, obj) + if out.Values[i] == graphql.Null { invalids++ } case "auction": + out.Values[i] = ec._AuthorityRecord_auction(ctx, field, obj) + default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -6346,7 +8232,6 @@ var bondImplementors = []string{"Bond"} func (ec *executionContext) _Bond(ctx context.Context, sel ast.SelectionSet, obj *Bond) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, bondImplementors) - out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { @@ -6354,17 +8239,79 @@ func (ec *executionContext) _Bond(ctx context.Context, sel ast.SelectionSet, obj case "__typename": out.Values[i] = graphql.MarshalString("Bond") case "id": + out.Values[i] = ec._Bond_id(ctx, field, obj) + if out.Values[i] == graphql.Null { invalids++ } case "owner": + out.Values[i] = ec._Bond_owner(ctx, field, obj) + if out.Values[i] == graphql.Null { invalids++ } case "balance": + out.Values[i] = ec._Bond_balance(ctx, field, obj) + + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var booleanValueImplementors = []string{"BooleanValue", "Value"} + +func (ec *executionContext) _BooleanValue(ctx context.Context, sel ast.SelectionSet, obj *BooleanValue) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, booleanValueImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("BooleanValue") + case "value": + + out.Values[i] = ec._BooleanValue_value(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var bytesValueImplementors = []string{"BytesValue", "Value"} + +func (ec *executionContext) _BytesValue(ctx context.Context, sel ast.SelectionSet, obj *BytesValue) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, bytesValueImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("BytesValue") + case "value": + + out.Values[i] = ec._BytesValue_value(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -6380,7 +8327,6 @@ var coinImplementors = []string{"Coin"} func (ec *executionContext) _Coin(ctx context.Context, sel ast.SelectionSet, obj *Coin) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, coinImplementors) - out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { @@ -6388,12 +8334,16 @@ func (ec *executionContext) _Coin(ctx context.Context, sel ast.SelectionSet, obj case "__typename": out.Values[i] = graphql.MarshalString("Coin") case "type": + out.Values[i] = ec._Coin_type(ctx, field, obj) + if out.Values[i] == graphql.Null { invalids++ } case "quantity": + out.Values[i] = ec._Coin_quantity(ctx, field, obj) + if out.Values[i] == graphql.Null { invalids++ } @@ -6408,24 +8358,104 @@ func (ec *executionContext) _Coin(ctx context.Context, sel ast.SelectionSet, obj return out } -var keyValueImplementors = []string{"KeyValue"} - -func (ec *executionContext) _KeyValue(ctx context.Context, sel ast.SelectionSet, obj *KeyValue) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, keyValueImplementors) +var floatValueImplementors = []string{"FloatValue", "Value"} +func (ec *executionContext) _FloatValue(ctx context.Context, sel ast.SelectionSet, obj *FloatValue) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, floatValueImplementors) out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("KeyValue") - case "key": - out.Values[i] = ec._KeyValue_key(ctx, field, obj) + out.Values[i] = graphql.MarshalString("FloatValue") + case "value": + + out.Values[i] = ec._FloatValue_value(ctx, field, obj) + if out.Values[i] == graphql.Null { invalids++ } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var intValueImplementors = []string{"IntValue", "Value"} + +func (ec *executionContext) _IntValue(ctx context.Context, sel ast.SelectionSet, obj *IntValue) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, intValueImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("IntValue") case "value": - out.Values[i] = ec._KeyValue_value(ctx, field, obj) + + out.Values[i] = ec._IntValue_value(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var linkValueImplementors = []string{"LinkValue", "Value"} + +func (ec *executionContext) _LinkValue(ctx context.Context, sel ast.SelectionSet, obj *LinkValue) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, linkValueImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("LinkValue") + case "value": + + out.Values[i] = ec._LinkValue_value(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var mapValueImplementors = []string{"MapValue", "Value"} + +func (ec *executionContext) _MapValue(ctx context.Context, sel ast.SelectionSet, obj *MapValue) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, mapValueImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("MapValue") + case "value": + + out.Values[i] = ec._MapValue_value(ctx, field, obj) + if out.Values[i] == graphql.Null { invalids++ } @@ -6444,7 +8474,6 @@ var nameRecordImplementors = []string{"NameRecord"} func (ec *executionContext) _NameRecord(ctx context.Context, sel ast.SelectionSet, obj *NameRecord) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, nameRecordImplementors) - out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { @@ -6452,12 +8481,16 @@ func (ec *executionContext) _NameRecord(ctx context.Context, sel ast.SelectionSe case "__typename": out.Values[i] = graphql.MarshalString("NameRecord") case "latest": + out.Values[i] = ec._NameRecord_latest(ctx, field, obj) + if out.Values[i] == graphql.Null { invalids++ } case "history": + out.Values[i] = ec._NameRecord_history(ctx, field, obj) + default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -6473,7 +8506,6 @@ var nameRecordEntryImplementors = []string{"NameRecordEntry"} func (ec *executionContext) _NameRecordEntry(ctx context.Context, sel ast.SelectionSet, obj *NameRecordEntry) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, nameRecordEntryImplementors) - out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { @@ -6481,12 +8513,16 @@ func (ec *executionContext) _NameRecordEntry(ctx context.Context, sel ast.Select case "__typename": out.Values[i] = graphql.MarshalString("NameRecordEntry") case "id": + out.Values[i] = ec._NameRecordEntry_id(ctx, field, obj) + if out.Values[i] == graphql.Null { invalids++ } case "height": + out.Values[i] = ec._NameRecordEntry_height(ctx, field, obj) + if out.Values[i] == graphql.Null { invalids++ } @@ -6505,7 +8541,6 @@ var nodeInfoImplementors = []string{"NodeInfo"} func (ec *executionContext) _NodeInfo(ctx context.Context, sel ast.SelectionSet, obj *NodeInfo) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, nodeInfoImplementors) - out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { @@ -6513,17 +8548,23 @@ func (ec *executionContext) _NodeInfo(ctx context.Context, sel ast.SelectionSet, case "__typename": out.Values[i] = graphql.MarshalString("NodeInfo") case "id": + out.Values[i] = ec._NodeInfo_id(ctx, field, obj) + if out.Values[i] == graphql.Null { invalids++ } case "network": + out.Values[i] = ec._NodeInfo_network(ctx, field, obj) + if out.Values[i] == graphql.Null { invalids++ } case "moniker": + out.Values[i] = ec._NodeInfo_moniker(ctx, field, obj) + if out.Values[i] == graphql.Null { invalids++ } @@ -6542,7 +8583,6 @@ var ownerBondsImplementors = []string{"OwnerBonds"} func (ec *executionContext) _OwnerBonds(ctx context.Context, sel ast.SelectionSet, obj *OwnerBonds) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, ownerBondsImplementors) - out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { @@ -6550,12 +8590,16 @@ func (ec *executionContext) _OwnerBonds(ctx context.Context, sel ast.SelectionSe case "__typename": out.Values[i] = graphql.MarshalString("OwnerBonds") case "owner": + out.Values[i] = ec._OwnerBonds_owner(ctx, field, obj) + if out.Values[i] == graphql.Null { invalids++ } case "bonds": + out.Values[i] = ec._OwnerBonds_bonds(ctx, field, obj) + default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -6571,7 +8615,6 @@ var peerInfoImplementors = []string{"PeerInfo"} func (ec *executionContext) _PeerInfo(ctx context.Context, sel ast.SelectionSet, obj *PeerInfo) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, peerInfoImplementors) - out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { @@ -6579,17 +8622,23 @@ func (ec *executionContext) _PeerInfo(ctx context.Context, sel ast.SelectionSet, case "__typename": out.Values[i] = graphql.MarshalString("PeerInfo") case "node": + out.Values[i] = ec._PeerInfo_node(ctx, field, obj) + if out.Values[i] == graphql.Null { invalids++ } case "is_outbound": + out.Values[i] = ec._PeerInfo_is_outbound(ctx, field, obj) + if out.Values[i] == graphql.Null { invalids++ } case "remote_ip": + out.Values[i] = ec._PeerInfo_remote_ip(ctx, field, obj) + if out.Values[i] == graphql.Null { invalids++ } @@ -6608,7 +8657,6 @@ var queryImplementors = []string{"Query"} func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, queryImplementors) - ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{ Object: "Query", }) @@ -6616,12 +8664,18 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { + innerCtx := graphql.WithRootFieldContext(ctx, &graphql.RootFieldContext{ + Object: field.Name, + Field: field, + }) + switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("Query") case "getStatus": field := field - out.Concurrently(i, func() (res graphql.Marshaler) { + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -6632,10 +8686,19 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr atomic.AddUint32(&invalids, 1) } return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + } + + out.Concurrently(i, func() graphql.Marshaler { + return rrm(innerCtx) }) case "getAccounts": field := field - out.Concurrently(i, func() (res graphql.Marshaler) { + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -6643,10 +8706,19 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr }() res = ec._Query_getAccounts(ctx, field) return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + } + + out.Concurrently(i, func() graphql.Marshaler { + return rrm(innerCtx) }) case "getBondsByIds": field := field - out.Concurrently(i, func() (res graphql.Marshaler) { + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -6654,10 +8726,19 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr }() res = ec._Query_getBondsByIds(ctx, field) return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + } + + out.Concurrently(i, func() graphql.Marshaler { + return rrm(innerCtx) }) case "queryBonds": field := field - out.Concurrently(i, func() (res graphql.Marshaler) { + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -6665,10 +8746,19 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr }() res = ec._Query_queryBonds(ctx, field) return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + } + + out.Concurrently(i, func() graphql.Marshaler { + return rrm(innerCtx) }) case "queryBondsByOwner": field := field - out.Concurrently(i, func() (res graphql.Marshaler) { + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -6676,10 +8766,19 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr }() res = ec._Query_queryBondsByOwner(ctx, field) return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + } + + out.Concurrently(i, func() graphql.Marshaler { + return rrm(innerCtx) }) case "getRecordsByIds": field := field - out.Concurrently(i, func() (res graphql.Marshaler) { + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -6687,10 +8786,19 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr }() res = ec._Query_getRecordsByIds(ctx, field) return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + } + + out.Concurrently(i, func() graphql.Marshaler { + return rrm(innerCtx) }) case "queryRecords": field := field - out.Concurrently(i, func() (res graphql.Marshaler) { + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -6698,10 +8806,19 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr }() res = ec._Query_queryRecords(ctx, field) return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + } + + out.Concurrently(i, func() graphql.Marshaler { + return rrm(innerCtx) }) case "lookupAuthorities": field := field - out.Concurrently(i, func() (res graphql.Marshaler) { + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -6712,10 +8829,19 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr atomic.AddUint32(&invalids, 1) } return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + } + + out.Concurrently(i, func() graphql.Marshaler { + return rrm(innerCtx) }) case "lookupNames": field := field - out.Concurrently(i, func() (res graphql.Marshaler) { + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -6726,10 +8852,19 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr atomic.AddUint32(&invalids, 1) } return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + } + + out.Concurrently(i, func() graphql.Marshaler { + return rrm(innerCtx) }) case "resolveNames": field := field - out.Concurrently(i, func() (res graphql.Marshaler) { + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -6740,10 +8875,19 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr atomic.AddUint32(&invalids, 1) } return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + } + + out.Concurrently(i, func() graphql.Marshaler { + return rrm(innerCtx) }) case "getAuctionsByIds": field := field - out.Concurrently(i, func() (res graphql.Marshaler) { + + innerFunc := func(ctx context.Context) (res graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -6751,11 +8895,27 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr }() res = ec._Query_getAuctionsByIds(ctx, field) return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) + } + + out.Concurrently(i, func() graphql.Marshaler { + return rrm(innerCtx) }) case "__type": - out.Values[i] = ec._Query___type(ctx, field) + + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Query___type(ctx, field) + }) + case "__schema": - out.Values[i] = ec._Query___schema(ctx, field) + + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Query___schema(ctx, field) + }) + default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -6771,7 +8931,6 @@ var recordImplementors = []string{"Record"} func (ec *executionContext) _Record(ctx context.Context, sel ast.SelectionSet, obj *Record) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, recordImplementors) - out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { @@ -6779,60 +8938,49 @@ func (ec *executionContext) _Record(ctx context.Context, sel ast.SelectionSet, o case "__typename": out.Values[i] = graphql.MarshalString("Record") case "id": + out.Values[i] = ec._Record_id(ctx, field, obj) + if out.Values[i] == graphql.Null { invalids++ } case "names": + out.Values[i] = ec._Record_names(ctx, field, obj) + case "bondId": + out.Values[i] = ec._Record_bondId(ctx, field, obj) + if out.Values[i] == graphql.Null { invalids++ } case "createTime": + out.Values[i] = ec._Record_createTime(ctx, field, obj) + if out.Values[i] == graphql.Null { invalids++ } case "expiryTime": + out.Values[i] = ec._Record_expiryTime(ctx, field, obj) + if out.Values[i] == graphql.Null { invalids++ } case "owners": + out.Values[i] = ec._Record_owners(ctx, field, obj) + case "attributes": + out.Values[i] = ec._Record_attributes(ctx, field, obj) + case "references": + out.Values[i] = ec._Record_references(ctx, field, obj) - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} -var referenceImplementors = []string{"Reference"} - -func (ec *executionContext) _Reference(ctx context.Context, sel ast.SelectionSet, obj *Reference) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, referenceImplementors) - - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("Reference") - case "id": - out.Values[i] = ec._Reference_id(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ - } default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -6848,7 +8996,6 @@ var statusImplementors = []string{"Status"} func (ec *executionContext) _Status(ctx context.Context, sel ast.SelectionSet, obj *Status) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, statusImplementors) - out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { @@ -6856,36 +9003,80 @@ func (ec *executionContext) _Status(ctx context.Context, sel ast.SelectionSet, o case "__typename": out.Values[i] = graphql.MarshalString("Status") case "version": + out.Values[i] = ec._Status_version(ctx, field, obj) + if out.Values[i] == graphql.Null { invalids++ } case "node": + out.Values[i] = ec._Status_node(ctx, field, obj) + if out.Values[i] == graphql.Null { invalids++ } case "sync": + out.Values[i] = ec._Status_sync(ctx, field, obj) + if out.Values[i] == graphql.Null { invalids++ } case "validator": + out.Values[i] = ec._Status_validator(ctx, field, obj) + case "validators": + out.Values[i] = ec._Status_validators(ctx, field, obj) + if out.Values[i] == graphql.Null { invalids++ } case "num_peers": + out.Values[i] = ec._Status_num_peers(ctx, field, obj) + if out.Values[i] == graphql.Null { invalids++ } case "peers": + out.Values[i] = ec._Status_peers(ctx, field, obj) + case "disk_usage": + out.Values[i] = ec._Status_disk_usage(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var stringValueImplementors = []string{"StringValue", "Value"} + +func (ec *executionContext) _StringValue(ctx context.Context, sel ast.SelectionSet, obj *StringValue) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, stringValueImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("StringValue") + case "value": + + out.Values[i] = ec._StringValue_value(ctx, field, obj) + if out.Values[i] == graphql.Null { invalids++ } @@ -6904,7 +9095,6 @@ var syncInfoImplementors = []string{"SyncInfo"} func (ec *executionContext) _SyncInfo(ctx context.Context, sel ast.SelectionSet, obj *SyncInfo) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, syncInfoImplementors) - out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { @@ -6912,22 +9102,30 @@ func (ec *executionContext) _SyncInfo(ctx context.Context, sel ast.SelectionSet, case "__typename": out.Values[i] = graphql.MarshalString("SyncInfo") case "latest_block_hash": + out.Values[i] = ec._SyncInfo_latest_block_hash(ctx, field, obj) + if out.Values[i] == graphql.Null { invalids++ } case "latest_block_height": + out.Values[i] = ec._SyncInfo_latest_block_height(ctx, field, obj) + if out.Values[i] == graphql.Null { invalids++ } case "latest_block_time": + out.Values[i] = ec._SyncInfo_latest_block_time(ctx, field, obj) + if out.Values[i] == graphql.Null { invalids++ } case "catching_up": + out.Values[i] = ec._SyncInfo_catching_up(ctx, field, obj) + if out.Values[i] == graphql.Null { invalids++ } @@ -6946,7 +9144,6 @@ var validatorInfoImplementors = []string{"ValidatorInfo"} func (ec *executionContext) _ValidatorInfo(ctx context.Context, sel ast.SelectionSet, obj *ValidatorInfo) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, validatorInfoImplementors) - out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { @@ -6954,55 +9151,23 @@ func (ec *executionContext) _ValidatorInfo(ctx context.Context, sel ast.Selectio case "__typename": out.Values[i] = graphql.MarshalString("ValidatorInfo") case "address": + out.Values[i] = ec._ValidatorInfo_address(ctx, field, obj) + if out.Values[i] == graphql.Null { invalids++ } case "voting_power": + out.Values[i] = ec._ValidatorInfo_voting_power(ctx, field, obj) + if out.Values[i] == graphql.Null { invalids++ } case "proposer_priority": + out.Values[i] = ec._ValidatorInfo_proposer_priority(ctx, field, obj) - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} -var valueImplementors = []string{"Value"} - -func (ec *executionContext) _Value(ctx context.Context, sel ast.SelectionSet, obj *Value) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, valueImplementors) - - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("Value") - case "null": - out.Values[i] = ec._Value_null(ctx, field, obj) - case "int": - out.Values[i] = ec._Value_int(ctx, field, obj) - case "float": - out.Values[i] = ec._Value_float(ctx, field, obj) - case "string": - out.Values[i] = ec._Value_string(ctx, field, obj) - case "boolean": - out.Values[i] = ec._Value_boolean(ctx, field, obj) - case "json": - out.Values[i] = ec._Value_json(ctx, field, obj) - case "reference": - out.Values[i] = ec._Value_reference(ctx, field, obj) - case "values": - out.Values[i] = ec._Value_values(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -7018,7 +9183,6 @@ var __DirectiveImplementors = []string{"__Directive"} func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionSet, obj *introspection.Directive) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, __DirectiveImplementors) - out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { @@ -7026,24 +9190,34 @@ func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionS case "__typename": out.Values[i] = graphql.MarshalString("__Directive") case "name": + out.Values[i] = ec.___Directive_name(ctx, field, obj) + if out.Values[i] == graphql.Null { invalids++ } case "description": + out.Values[i] = ec.___Directive_description(ctx, field, obj) + case "locations": + out.Values[i] = ec.___Directive_locations(ctx, field, obj) + if out.Values[i] == graphql.Null { invalids++ } case "args": + out.Values[i] = ec.___Directive_args(ctx, field, obj) + if out.Values[i] == graphql.Null { invalids++ } case "isRepeatable": + out.Values[i] = ec.___Directive_isRepeatable(ctx, field, obj) + if out.Values[i] == graphql.Null { invalids++ } @@ -7062,7 +9236,6 @@ var __EnumValueImplementors = []string{"__EnumValue"} func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.EnumValue) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, __EnumValueImplementors) - out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { @@ -7070,19 +9243,27 @@ func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionS case "__typename": out.Values[i] = graphql.MarshalString("__EnumValue") case "name": + out.Values[i] = ec.___EnumValue_name(ctx, field, obj) + if out.Values[i] == graphql.Null { invalids++ } case "description": + out.Values[i] = ec.___EnumValue_description(ctx, field, obj) + case "isDeprecated": + out.Values[i] = ec.___EnumValue_isDeprecated(ctx, field, obj) + if out.Values[i] == graphql.Null { invalids++ } case "deprecationReason": + out.Values[i] = ec.___EnumValue_deprecationReason(ctx, field, obj) + default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -7098,7 +9279,6 @@ var __FieldImplementors = []string{"__Field"} func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, obj *introspection.Field) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, __FieldImplementors) - out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { @@ -7106,29 +9286,41 @@ func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, case "__typename": out.Values[i] = graphql.MarshalString("__Field") case "name": + out.Values[i] = ec.___Field_name(ctx, field, obj) + if out.Values[i] == graphql.Null { invalids++ } case "description": + out.Values[i] = ec.___Field_description(ctx, field, obj) + case "args": + out.Values[i] = ec.___Field_args(ctx, field, obj) + if out.Values[i] == graphql.Null { invalids++ } case "type": + out.Values[i] = ec.___Field_type(ctx, field, obj) + if out.Values[i] == graphql.Null { invalids++ } case "isDeprecated": + out.Values[i] = ec.___Field_isDeprecated(ctx, field, obj) + if out.Values[i] == graphql.Null { invalids++ } case "deprecationReason": + out.Values[i] = ec.___Field_deprecationReason(ctx, field, obj) + default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -7144,7 +9336,6 @@ var __InputValueImplementors = []string{"__InputValue"} func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.InputValue) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, __InputValueImplementors) - out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { @@ -7152,19 +9343,27 @@ func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.Selection case "__typename": out.Values[i] = graphql.MarshalString("__InputValue") case "name": + out.Values[i] = ec.___InputValue_name(ctx, field, obj) + if out.Values[i] == graphql.Null { invalids++ } case "description": + out.Values[i] = ec.___InputValue_description(ctx, field, obj) + case "type": + out.Values[i] = ec.___InputValue_type(ctx, field, obj) + if out.Values[i] == graphql.Null { invalids++ } case "defaultValue": + out.Values[i] = ec.___InputValue_defaultValue(ctx, field, obj) + default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -7180,29 +9379,42 @@ var __SchemaImplementors = []string{"__Schema"} func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, obj *introspection.Schema) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, __SchemaImplementors) - out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("__Schema") + case "description": + + out.Values[i] = ec.___Schema_description(ctx, field, obj) + case "types": + out.Values[i] = ec.___Schema_types(ctx, field, obj) + if out.Values[i] == graphql.Null { invalids++ } case "queryType": + out.Values[i] = ec.___Schema_queryType(ctx, field, obj) + if out.Values[i] == graphql.Null { invalids++ } case "mutationType": + out.Values[i] = ec.___Schema_mutationType(ctx, field, obj) + case "subscriptionType": + out.Values[i] = ec.___Schema_subscriptionType(ctx, field, obj) + case "directives": + out.Values[i] = ec.___Schema_directives(ctx, field, obj) + if out.Values[i] == graphql.Null { invalids++ } @@ -7221,7 +9433,6 @@ var __TypeImplementors = []string{"__Type"} func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, obj *introspection.Type) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, __TypeImplementors) - out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { @@ -7229,26 +9440,48 @@ func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, o case "__typename": out.Values[i] = graphql.MarshalString("__Type") case "kind": + out.Values[i] = ec.___Type_kind(ctx, field, obj) + if out.Values[i] == graphql.Null { invalids++ } case "name": + out.Values[i] = ec.___Type_name(ctx, field, obj) + case "description": + out.Values[i] = ec.___Type_description(ctx, field, obj) + case "fields": + out.Values[i] = ec.___Type_fields(ctx, field, obj) + case "interfaces": + out.Values[i] = ec.___Type_interfaces(ctx, field, obj) + case "possibleTypes": + out.Values[i] = ec.___Type_possibleTypes(ctx, field, obj) + case "enumValues": + out.Values[i] = ec.___Type_enumValues(ctx, field, obj) + case "inputFields": + out.Values[i] = ec.___Type_inputFields(ctx, field, obj) + case "ofType": + out.Values[i] = ec.___Type_ofType(ctx, field, obj) + + case "specifiedByURL": + + out.Values[i] = ec.___Type_specifiedByURL(ctx, field, obj) + default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -7264,7 +9497,7 @@ func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, o // region ***************************** type.gotpl ***************************** -func (ec *executionContext) marshalNAuthorityRecord2ᚕᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐAuthorityRecord(ctx context.Context, sel ast.SelectionSet, v []*AuthorityRecord) graphql.Marshaler { +func (ec *executionContext) marshalNAttribute2ᚕᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐAttributeᚄ(ctx context.Context, sel ast.SelectionSet, v []*Attribute) graphql.Marshaler { ret := make(graphql.Array, len(v)) var wg sync.WaitGroup isLen1 := len(v) == 1 @@ -7288,7 +9521,61 @@ func (ec *executionContext) marshalNAuthorityRecord2ᚕᚖgithubᚗcomᚋtharsis if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalOAuthorityRecord2ᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐAuthorityRecord(ctx, sel, v[i]) + ret[i] = ec.marshalNAttribute2ᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐAttribute(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalNAttribute2ᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐAttribute(ctx context.Context, sel ast.SelectionSet, v *Attribute) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._Attribute(ctx, sel, v) +} + +func (ec *executionContext) marshalNAuthorityRecord2ᚕᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐAuthorityRecord(ctx context.Context, sel ast.SelectionSet, v []*AuthorityRecord) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalOAuthorityRecord2ᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐAuthorityRecord(ctx, sel, v[i]) } if isLen1 { f(i) @@ -7302,10 +9589,10 @@ func (ec *executionContext) marshalNAuthorityRecord2ᚕᚖgithubᚗcomᚋtharsis return ret } -func (ec *executionContext) marshalNBond2ᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐBond(ctx context.Context, sel ast.SelectionSet, v *Bond) graphql.Marshaler { +func (ec *executionContext) marshalNBond2ᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐBond(ctx context.Context, sel ast.SelectionSet, v *Bond) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "must not be null") + ec.Errorf(ctx, "the requested element is null which the schema does not allow") } return graphql.Null } @@ -7321,23 +9608,68 @@ func (ec *executionContext) marshalNBoolean2bool(ctx context.Context, sel ast.Se res := graphql.MarshalBoolean(v) if res == graphql.Null { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "must not be null") + ec.Errorf(ctx, "the requested element is null which the schema does not allow") } } return res } -func (ec *executionContext) marshalNCoin2ᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐCoin(ctx context.Context, sel ast.SelectionSet, v *Coin) graphql.Marshaler { +func (ec *executionContext) marshalNCoin2ᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐCoin(ctx context.Context, sel ast.SelectionSet, v *Coin) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "must not be null") + ec.Errorf(ctx, "the requested element is null which the schema does not allow") } return graphql.Null } return ec._Coin(ctx, sel, v) } -func (ec *executionContext) marshalNNameRecord2ᚕᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐNameRecord(ctx context.Context, sel ast.SelectionSet, v []*NameRecord) graphql.Marshaler { +func (ec *executionContext) unmarshalNFloat2float64(ctx context.Context, v interface{}) (float64, error) { + res, err := graphql.UnmarshalFloatContext(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNFloat2float64(ctx context.Context, sel ast.SelectionSet, v float64) graphql.Marshaler { + res := graphql.MarshalFloatContext(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return graphql.WrapContextMarshaler(ctx, res) +} + +func (ec *executionContext) unmarshalNInt2int(ctx context.Context, v interface{}) (int, error) { + res, err := graphql.UnmarshalInt(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNInt2int(ctx context.Context, sel ast.SelectionSet, v int) graphql.Marshaler { + res := graphql.MarshalInt(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + } + return res +} + +func (ec *executionContext) unmarshalNKeyValueInput2ᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐKeyValueInput(ctx context.Context, v interface{}) (*KeyValueInput, error) { + res, err := ec.unmarshalInputKeyValueInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNLink2githubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐLink(ctx context.Context, v interface{}) (Link, error) { + var res Link + err := res.UnmarshalGQLContext(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNLink2githubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐLink(ctx context.Context, sel ast.SelectionSet, v Link) graphql.Marshaler { + return graphql.WrapContextMarshaler(ctx, v) +} + +func (ec *executionContext) marshalNNameRecord2ᚕᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐNameRecord(ctx context.Context, sel ast.SelectionSet, v []*NameRecord) graphql.Marshaler { ret := make(graphql.Array, len(v)) var wg sync.WaitGroup isLen1 := len(v) == 1 @@ -7361,7 +9693,7 @@ func (ec *executionContext) marshalNNameRecord2ᚕᚖgithubᚗcomᚋtharsisᚋet if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalONameRecord2ᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐNameRecord(ctx, sel, v[i]) + ret[i] = ec.marshalONameRecord2ᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐNameRecord(ctx, sel, v[i]) } if isLen1 { f(i) @@ -7375,27 +9707,27 @@ func (ec *executionContext) marshalNNameRecord2ᚕᚖgithubᚗcomᚋtharsisᚋet return ret } -func (ec *executionContext) marshalNNameRecordEntry2ᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐNameRecordEntry(ctx context.Context, sel ast.SelectionSet, v *NameRecordEntry) graphql.Marshaler { +func (ec *executionContext) marshalNNameRecordEntry2ᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐNameRecordEntry(ctx context.Context, sel ast.SelectionSet, v *NameRecordEntry) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "must not be null") + ec.Errorf(ctx, "the requested element is null which the schema does not allow") } return graphql.Null } return ec._NameRecordEntry(ctx, sel, v) } -func (ec *executionContext) marshalNNodeInfo2ᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐNodeInfo(ctx context.Context, sel ast.SelectionSet, v *NodeInfo) graphql.Marshaler { +func (ec *executionContext) marshalNNodeInfo2ᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐNodeInfo(ctx context.Context, sel ast.SelectionSet, v *NodeInfo) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "must not be null") + ec.Errorf(ctx, "the requested element is null which the schema does not allow") } return graphql.Null } return ec._NodeInfo(ctx, sel, v) } -func (ec *executionContext) marshalNRecord2ᚕᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐRecord(ctx context.Context, sel ast.SelectionSet, v []*Record) graphql.Marshaler { +func (ec *executionContext) marshalNRecord2ᚕᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐRecord(ctx context.Context, sel ast.SelectionSet, v []*Record) graphql.Marshaler { ret := make(graphql.Array, len(v)) var wg sync.WaitGroup isLen1 := len(v) == 1 @@ -7419,7 +9751,7 @@ func (ec *executionContext) marshalNRecord2ᚕᚖgithubᚗcomᚋtharsisᚋetherm if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalORecord2ᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐRecord(ctx, sel, v[i]) + ret[i] = ec.marshalORecord2ᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐRecord(ctx, sel, v[i]) } if isLen1 { f(i) @@ -7433,14 +9765,14 @@ func (ec *executionContext) marshalNRecord2ᚕᚖgithubᚗcomᚋtharsisᚋetherm return ret } -func (ec *executionContext) marshalNStatus2githubᚗcomᚋtharsisᚋethermintᚋgqlᚐStatus(ctx context.Context, sel ast.SelectionSet, v Status) graphql.Marshaler { +func (ec *executionContext) marshalNStatus2githubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐStatus(ctx context.Context, sel ast.SelectionSet, v Status) graphql.Marshaler { return ec._Status(ctx, sel, &v) } -func (ec *executionContext) marshalNStatus2ᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐStatus(ctx context.Context, sel ast.SelectionSet, v *Status) graphql.Marshaler { +func (ec *executionContext) marshalNStatus2ᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐStatus(ctx context.Context, sel ast.SelectionSet, v *Status) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "must not be null") + ec.Errorf(ctx, "the requested element is null which the schema does not allow") } return graphql.Null } @@ -7456,23 +9788,23 @@ func (ec *executionContext) marshalNString2string(ctx context.Context, sel ast.S res := graphql.MarshalString(v) if res == graphql.Null { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "must not be null") + ec.Errorf(ctx, "the requested element is null which the schema does not allow") } } return res } -func (ec *executionContext) marshalNSyncInfo2ᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐSyncInfo(ctx context.Context, sel ast.SelectionSet, v *SyncInfo) graphql.Marshaler { +func (ec *executionContext) marshalNSyncInfo2ᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐSyncInfo(ctx context.Context, sel ast.SelectionSet, v *SyncInfo) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "must not be null") + ec.Errorf(ctx, "the requested element is null which the schema does not allow") } return graphql.Null } return ec._SyncInfo(ctx, sel, v) } -func (ec *executionContext) marshalNValidatorInfo2ᚕᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐValidatorInfo(ctx context.Context, sel ast.SelectionSet, v []*ValidatorInfo) graphql.Marshaler { +func (ec *executionContext) marshalNValidatorInfo2ᚕᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐValidatorInfo(ctx context.Context, sel ast.SelectionSet, v []*ValidatorInfo) graphql.Marshaler { ret := make(graphql.Array, len(v)) var wg sync.WaitGroup isLen1 := len(v) == 1 @@ -7496,7 +9828,7 @@ func (ec *executionContext) marshalNValidatorInfo2ᚕᚖgithubᚗcomᚋtharsis if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalOValidatorInfo2ᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐValidatorInfo(ctx, sel, v[i]) + ret[i] = ec.marshalOValidatorInfo2ᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐValidatorInfo(ctx, sel, v[i]) } if isLen1 { f(i) @@ -7510,19 +9842,42 @@ func (ec *executionContext) marshalNValidatorInfo2ᚕᚖgithubᚗcomᚋtharsis return ret } -func (ec *executionContext) marshalNValue2ᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐValue(ctx context.Context, sel ast.SelectionSet, v *Value) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null +func (ec *executionContext) marshalNValue2ᚕgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐValue(ctx context.Context, sel ast.SelectionSet, v []Value) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) } - return ec._Value(ctx, sel, v) -} + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalOValue2githubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐValue(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } -func (ec *executionContext) unmarshalNValueInput2ᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐValueInput(ctx context.Context, v interface{}) (*ValueInput, error) { - res, err := ec.unmarshalInputValueInput(ctx, v) - return &res, graphql.ErrorOnPath(ctx, err) + } + wg.Wait() + + return ret } func (ec *executionContext) marshalN__Directive2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirective(ctx context.Context, sel ast.SelectionSet, v introspection.Directive) graphql.Marshaler { @@ -7582,7 +9937,7 @@ func (ec *executionContext) marshalN__DirectiveLocation2string(ctx context.Conte res := graphql.MarshalString(v) if res == graphql.Null { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "must not be null") + ec.Errorf(ctx, "the requested element is null which the schema does not allow") } } return res @@ -7591,11 +9946,7 @@ func (ec *executionContext) marshalN__DirectiveLocation2string(ctx context.Conte func (ec *executionContext) unmarshalN__DirectiveLocation2ᚕstringᚄ(ctx context.Context, v interface{}) ([]string, error) { var vSlice []interface{} if v != nil { - if tmp1, ok := v.([]interface{}); ok { - vSlice = tmp1 - } else { - vSlice = []interface{}{v} - } + vSlice = graphql.CoerceList(v) } var err error res := make([]string, len(vSlice)) @@ -7760,7 +10111,7 @@ func (ec *executionContext) marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgen func (ec *executionContext) marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v *introspection.Type) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "must not be null") + ec.Errorf(ctx, "the requested element is null which the schema does not allow") } return graphql.Null } @@ -7776,13 +10127,13 @@ func (ec *executionContext) marshalN__TypeKind2string(ctx context.Context, sel a res := graphql.MarshalString(v) if res == graphql.Null { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "must not be null") + ec.Errorf(ctx, "the requested element is null which the schema does not allow") } } return res } -func (ec *executionContext) marshalOAccount2ᚕᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐAccount(ctx context.Context, sel ast.SelectionSet, v []*Account) graphql.Marshaler { +func (ec *executionContext) marshalOAccount2ᚕᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐAccount(ctx context.Context, sel ast.SelectionSet, v []*Account) graphql.Marshaler { if v == nil { return graphql.Null } @@ -7809,7 +10160,7 @@ func (ec *executionContext) marshalOAccount2ᚕᚖgithubᚗcomᚋtharsisᚋether if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalOAccount2ᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐAccount(ctx, sel, v[i]) + ret[i] = ec.marshalOAccount2ᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐAccount(ctx, sel, v[i]) } if isLen1 { f(i) @@ -7823,14 +10174,14 @@ func (ec *executionContext) marshalOAccount2ᚕᚖgithubᚗcomᚋtharsisᚋether return ret } -func (ec *executionContext) marshalOAccount2ᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐAccount(ctx context.Context, sel ast.SelectionSet, v *Account) graphql.Marshaler { +func (ec *executionContext) marshalOAccount2ᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐAccount(ctx context.Context, sel ast.SelectionSet, v *Account) graphql.Marshaler { if v == nil { return graphql.Null } return ec._Account(ctx, sel, v) } -func (ec *executionContext) marshalOAuction2ᚕᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐAuction(ctx context.Context, sel ast.SelectionSet, v []*Auction) graphql.Marshaler { +func (ec *executionContext) marshalOAttribute2ᚕᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐAttributeᚄ(ctx context.Context, sel ast.SelectionSet, v []*Attribute) graphql.Marshaler { if v == nil { return graphql.Null } @@ -7857,151 +10208,7 @@ func (ec *executionContext) marshalOAuction2ᚕᚖgithubᚗcomᚋtharsisᚋether if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalOAuction2ᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐAuction(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } - - } - wg.Wait() - - return ret -} - -func (ec *executionContext) marshalOAuction2ᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐAuction(ctx context.Context, sel ast.SelectionSet, v *Auction) graphql.Marshaler { - if v == nil { - return graphql.Null - } - return ec._Auction(ctx, sel, v) -} - -func (ec *executionContext) marshalOAuctionBid2ᚕᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐAuctionBid(ctx context.Context, sel ast.SelectionSet, v []*AuctionBid) graphql.Marshaler { - if v == nil { - return graphql.Null - } - ret := make(graphql.Array, len(v)) - var wg sync.WaitGroup - isLen1 := len(v) == 1 - if !isLen1 { - wg.Add(len(v)) - } - for i := range v { - i := i - fc := &graphql.FieldContext{ - Index: &i, - Result: &v[i], - } - ctx := graphql.WithFieldContext(ctx, fc) - f := func(i int) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = nil - } - }() - if !isLen1 { - defer wg.Done() - } - ret[i] = ec.marshalOAuctionBid2ᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐAuctionBid(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } - - } - wg.Wait() - - return ret -} - -func (ec *executionContext) marshalOAuctionBid2ᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐAuctionBid(ctx context.Context, sel ast.SelectionSet, v *AuctionBid) graphql.Marshaler { - if v == nil { - return graphql.Null - } - return ec._AuctionBid(ctx, sel, v) -} - -func (ec *executionContext) marshalOAuthorityRecord2ᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐAuthorityRecord(ctx context.Context, sel ast.SelectionSet, v *AuthorityRecord) graphql.Marshaler { - if v == nil { - return graphql.Null - } - return ec._AuthorityRecord(ctx, sel, v) -} - -func (ec *executionContext) marshalOBond2ᚕᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐBond(ctx context.Context, sel ast.SelectionSet, v []*Bond) graphql.Marshaler { - if v == nil { - return graphql.Null - } - ret := make(graphql.Array, len(v)) - var wg sync.WaitGroup - isLen1 := len(v) == 1 - if !isLen1 { - wg.Add(len(v)) - } - for i := range v { - i := i - fc := &graphql.FieldContext{ - Index: &i, - Result: &v[i], - } - ctx := graphql.WithFieldContext(ctx, fc) - f := func(i int) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = nil - } - }() - if !isLen1 { - defer wg.Done() - } - ret[i] = ec.marshalOBond2ᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐBond(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } - - } - wg.Wait() - - return ret -} - -func (ec *executionContext) marshalOBond2ᚕᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐBondᚄ(ctx context.Context, sel ast.SelectionSet, v []*Bond) graphql.Marshaler { - if v == nil { - return graphql.Null - } - ret := make(graphql.Array, len(v)) - var wg sync.WaitGroup - isLen1 := len(v) == 1 - if !isLen1 { - wg.Add(len(v)) - } - for i := range v { - i := i - fc := &graphql.FieldContext{ - Index: &i, - Result: &v[i], - } - ctx := graphql.WithFieldContext(ctx, fc) - f := func(i int) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = nil - } - }() - if !isLen1 { - defer wg.Done() - } - ret[i] = ec.marshalNBond2ᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐBond(ctx, sel, v[i]) + ret[i] = ec.marshalNAttribute2ᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐAttribute(ctx, sel, v[i]) } if isLen1 { f(i) @@ -8021,38 +10228,7 @@ func (ec *executionContext) marshalOBond2ᚕᚖgithubᚗcomᚋtharsisᚋethermin return ret } -func (ec *executionContext) marshalOBond2ᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐBond(ctx context.Context, sel ast.SelectionSet, v *Bond) graphql.Marshaler { - if v == nil { - return graphql.Null - } - return ec._Bond(ctx, sel, v) -} - -func (ec *executionContext) unmarshalOBoolean2bool(ctx context.Context, v interface{}) (bool, error) { - res, err := graphql.UnmarshalBoolean(v) - return res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalOBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler { - return graphql.MarshalBoolean(v) -} - -func (ec *executionContext) unmarshalOBoolean2ᚖbool(ctx context.Context, v interface{}) (*bool, error) { - if v == nil { - return nil, nil - } - res, err := graphql.UnmarshalBoolean(v) - return &res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalOBoolean2ᚖbool(ctx context.Context, sel ast.SelectionSet, v *bool) graphql.Marshaler { - if v == nil { - return graphql.Null - } - return graphql.MarshalBoolean(*v) -} - -func (ec *executionContext) marshalOCoin2ᚕᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐCoinᚄ(ctx context.Context, sel ast.SelectionSet, v []*Coin) graphql.Marshaler { +func (ec *executionContext) marshalOAuction2ᚕᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐAuction(ctx context.Context, sel ast.SelectionSet, v []*Auction) graphql.Marshaler { if v == nil { return graphql.Null } @@ -8079,7 +10255,231 @@ func (ec *executionContext) marshalOCoin2ᚕᚖgithubᚗcomᚋtharsisᚋethermin if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalNCoin2ᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐCoin(ctx, sel, v[i]) + ret[i] = ec.marshalOAuction2ᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐAuction(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + return ret +} + +func (ec *executionContext) marshalOAuction2ᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐAuction(ctx context.Context, sel ast.SelectionSet, v *Auction) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._Auction(ctx, sel, v) +} + +func (ec *executionContext) marshalOAuctionBid2ᚕᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐAuctionBid(ctx context.Context, sel ast.SelectionSet, v []*AuctionBid) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalOAuctionBid2ᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐAuctionBid(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + return ret +} + +func (ec *executionContext) marshalOAuctionBid2ᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐAuctionBid(ctx context.Context, sel ast.SelectionSet, v *AuctionBid) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._AuctionBid(ctx, sel, v) +} + +func (ec *executionContext) marshalOAuthorityRecord2ᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐAuthorityRecord(ctx context.Context, sel ast.SelectionSet, v *AuthorityRecord) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._AuthorityRecord(ctx, sel, v) +} + +func (ec *executionContext) marshalOBond2ᚕᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐBond(ctx context.Context, sel ast.SelectionSet, v []*Bond) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalOBond2ᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐBond(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + return ret +} + +func (ec *executionContext) marshalOBond2ᚕᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐBondᚄ(ctx context.Context, sel ast.SelectionSet, v []*Bond) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNBond2ᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐBond(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalOBond2ᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐBond(ctx context.Context, sel ast.SelectionSet, v *Bond) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._Bond(ctx, sel, v) +} + +func (ec *executionContext) unmarshalOBoolean2bool(ctx context.Context, v interface{}) (bool, error) { + res, err := graphql.UnmarshalBoolean(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler { + res := graphql.MarshalBoolean(v) + return res +} + +func (ec *executionContext) unmarshalOBoolean2ᚖbool(ctx context.Context, v interface{}) (*bool, error) { + if v == nil { + return nil, nil + } + res, err := graphql.UnmarshalBoolean(v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOBoolean2ᚖbool(ctx context.Context, sel ast.SelectionSet, v *bool) graphql.Marshaler { + if v == nil { + return graphql.Null + } + res := graphql.MarshalBoolean(*v) + return res +} + +func (ec *executionContext) marshalOCoin2ᚕᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐCoinᚄ(ctx context.Context, sel ast.SelectionSet, v []*Coin) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNCoin2ᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐCoin(ctx, sel, v[i]) } if isLen1 { f(i) @@ -8103,7 +10503,7 @@ func (ec *executionContext) unmarshalOFloat2ᚖfloat64(ctx context.Context, v in if v == nil { return nil, nil } - res, err := graphql.UnmarshalFloat(v) + res, err := graphql.UnmarshalFloatContext(ctx, v) return &res, graphql.ErrorOnPath(ctx, err) } @@ -8111,7 +10511,8 @@ func (ec *executionContext) marshalOFloat2ᚖfloat64(ctx context.Context, sel as if v == nil { return graphql.Null } - return graphql.MarshalFloat(*v) + res := graphql.MarshalFloatContext(*v) + return graphql.WrapContextMarshaler(ctx, res) } func (ec *executionContext) unmarshalOInt2ᚖint(ctx context.Context, v interface{}) (*int, error) { @@ -8126,74 +10527,23 @@ func (ec *executionContext) marshalOInt2ᚖint(ctx context.Context, sel ast.Sele if v == nil { return graphql.Null } - return graphql.MarshalInt(*v) + res := graphql.MarshalInt(*v) + return res } -func (ec *executionContext) marshalOKeyValue2ᚕᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐKeyValue(ctx context.Context, sel ast.SelectionSet, v []*KeyValue) graphql.Marshaler { - if v == nil { - return graphql.Null - } - ret := make(graphql.Array, len(v)) - var wg sync.WaitGroup - isLen1 := len(v) == 1 - if !isLen1 { - wg.Add(len(v)) - } - for i := range v { - i := i - fc := &graphql.FieldContext{ - Index: &i, - Result: &v[i], - } - ctx := graphql.WithFieldContext(ctx, fc) - f := func(i int) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = nil - } - }() - if !isLen1 { - defer wg.Done() - } - ret[i] = ec.marshalOKeyValue2ᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐKeyValue(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } - - } - wg.Wait() - - return ret -} - -func (ec *executionContext) marshalOKeyValue2ᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐKeyValue(ctx context.Context, sel ast.SelectionSet, v *KeyValue) graphql.Marshaler { - if v == nil { - return graphql.Null - } - return ec._KeyValue(ctx, sel, v) -} - -func (ec *executionContext) unmarshalOKeyValueInput2ᚕᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐKeyValueInput(ctx context.Context, v interface{}) ([]*KeyValueInput, error) { +func (ec *executionContext) unmarshalOKeyValueInput2ᚕᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐKeyValueInputᚄ(ctx context.Context, v interface{}) ([]*KeyValueInput, error) { if v == nil { return nil, nil } var vSlice []interface{} if v != nil { - if tmp1, ok := v.([]interface{}); ok { - vSlice = tmp1 - } else { - vSlice = []interface{}{v} - } + vSlice = graphql.CoerceList(v) } var err error res := make([]*KeyValueInput, len(vSlice)) for i := range vSlice { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) - res[i], err = ec.unmarshalOKeyValueInput2ᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐKeyValueInput(ctx, vSlice[i]) + res[i], err = ec.unmarshalNKeyValueInput2ᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐKeyValueInput(ctx, vSlice[i]) if err != nil { return nil, err } @@ -8201,22 +10551,30 @@ func (ec *executionContext) unmarshalOKeyValueInput2ᚕᚖgithubᚗcomᚋtharsis return res, nil } -func (ec *executionContext) unmarshalOKeyValueInput2ᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐKeyValueInput(ctx context.Context, v interface{}) (*KeyValueInput, error) { +func (ec *executionContext) unmarshalOLink2ᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐLink(ctx context.Context, v interface{}) (*Link, error) { if v == nil { return nil, nil } - res, err := ec.unmarshalInputKeyValueInput(ctx, v) - return &res, graphql.ErrorOnPath(ctx, err) + var res = new(Link) + err := res.UnmarshalGQLContext(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalONameRecord2ᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐNameRecord(ctx context.Context, sel ast.SelectionSet, v *NameRecord) graphql.Marshaler { +func (ec *executionContext) marshalOLink2ᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐLink(ctx context.Context, sel ast.SelectionSet, v *Link) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return graphql.WrapContextMarshaler(ctx, v) +} + +func (ec *executionContext) marshalONameRecord2ᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐNameRecord(ctx context.Context, sel ast.SelectionSet, v *NameRecord) graphql.Marshaler { if v == nil { return graphql.Null } return ec._NameRecord(ctx, sel, v) } -func (ec *executionContext) marshalONameRecordEntry2ᚕᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐNameRecordEntry(ctx context.Context, sel ast.SelectionSet, v []*NameRecordEntry) graphql.Marshaler { +func (ec *executionContext) marshalONameRecordEntry2ᚕᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐNameRecordEntry(ctx context.Context, sel ast.SelectionSet, v []*NameRecordEntry) graphql.Marshaler { if v == nil { return graphql.Null } @@ -8243,7 +10601,7 @@ func (ec *executionContext) marshalONameRecordEntry2ᚕᚖgithubᚗcomᚋtharsis if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalONameRecordEntry2ᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐNameRecordEntry(ctx, sel, v[i]) + ret[i] = ec.marshalONameRecordEntry2ᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐNameRecordEntry(ctx, sel, v[i]) } if isLen1 { f(i) @@ -8257,14 +10615,14 @@ func (ec *executionContext) marshalONameRecordEntry2ᚕᚖgithubᚗcomᚋtharsis return ret } -func (ec *executionContext) marshalONameRecordEntry2ᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐNameRecordEntry(ctx context.Context, sel ast.SelectionSet, v *NameRecordEntry) graphql.Marshaler { +func (ec *executionContext) marshalONameRecordEntry2ᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐNameRecordEntry(ctx context.Context, sel ast.SelectionSet, v *NameRecordEntry) graphql.Marshaler { if v == nil { return graphql.Null } return ec._NameRecordEntry(ctx, sel, v) } -func (ec *executionContext) marshalOOwnerBonds2ᚕᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐOwnerBonds(ctx context.Context, sel ast.SelectionSet, v []*OwnerBonds) graphql.Marshaler { +func (ec *executionContext) marshalOOwnerBonds2ᚕᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐOwnerBonds(ctx context.Context, sel ast.SelectionSet, v []*OwnerBonds) graphql.Marshaler { if v == nil { return graphql.Null } @@ -8291,7 +10649,7 @@ func (ec *executionContext) marshalOOwnerBonds2ᚕᚖgithubᚗcomᚋtharsisᚋet if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalOOwnerBonds2ᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐOwnerBonds(ctx, sel, v[i]) + ret[i] = ec.marshalOOwnerBonds2ᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐOwnerBonds(ctx, sel, v[i]) } if isLen1 { f(i) @@ -8305,14 +10663,14 @@ func (ec *executionContext) marshalOOwnerBonds2ᚕᚖgithubᚗcomᚋtharsisᚋet return ret } -func (ec *executionContext) marshalOOwnerBonds2ᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐOwnerBonds(ctx context.Context, sel ast.SelectionSet, v *OwnerBonds) graphql.Marshaler { +func (ec *executionContext) marshalOOwnerBonds2ᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐOwnerBonds(ctx context.Context, sel ast.SelectionSet, v *OwnerBonds) graphql.Marshaler { if v == nil { return graphql.Null } return ec._OwnerBonds(ctx, sel, v) } -func (ec *executionContext) marshalOPeerInfo2ᚕᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐPeerInfo(ctx context.Context, sel ast.SelectionSet, v []*PeerInfo) graphql.Marshaler { +func (ec *executionContext) marshalOPeerInfo2ᚕᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐPeerInfo(ctx context.Context, sel ast.SelectionSet, v []*PeerInfo) graphql.Marshaler { if v == nil { return graphql.Null } @@ -8339,7 +10697,7 @@ func (ec *executionContext) marshalOPeerInfo2ᚕᚖgithubᚗcomᚋtharsisᚋethe if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalOPeerInfo2ᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐPeerInfo(ctx, sel, v[i]) + ret[i] = ec.marshalOPeerInfo2ᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐPeerInfo(ctx, sel, v[i]) } if isLen1 { f(i) @@ -8353,14 +10711,14 @@ func (ec *executionContext) marshalOPeerInfo2ᚕᚖgithubᚗcomᚋtharsisᚋethe return ret } -func (ec *executionContext) marshalOPeerInfo2ᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐPeerInfo(ctx context.Context, sel ast.SelectionSet, v *PeerInfo) graphql.Marshaler { +func (ec *executionContext) marshalOPeerInfo2ᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐPeerInfo(ctx context.Context, sel ast.SelectionSet, v *PeerInfo) graphql.Marshaler { if v == nil { return graphql.Null } return ec._PeerInfo(ctx, sel, v) } -func (ec *executionContext) marshalORecord2ᚕᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐRecord(ctx context.Context, sel ast.SelectionSet, v []*Record) graphql.Marshaler { +func (ec *executionContext) marshalORecord2ᚕᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐRecord(ctx context.Context, sel ast.SelectionSet, v []*Record) graphql.Marshaler { if v == nil { return graphql.Null } @@ -8387,7 +10745,7 @@ func (ec *executionContext) marshalORecord2ᚕᚖgithubᚗcomᚋtharsisᚋetherm if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalORecord2ᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐRecord(ctx, sel, v[i]) + ret[i] = ec.marshalORecord2ᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐRecord(ctx, sel, v[i]) } if isLen1 { f(i) @@ -8401,48 +10759,20 @@ func (ec *executionContext) marshalORecord2ᚕᚖgithubᚗcomᚋtharsisᚋetherm return ret } -func (ec *executionContext) marshalORecord2ᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐRecord(ctx context.Context, sel ast.SelectionSet, v *Record) graphql.Marshaler { +func (ec *executionContext) marshalORecord2ᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐRecord(ctx context.Context, sel ast.SelectionSet, v *Record) graphql.Marshaler { if v == nil { return graphql.Null } return ec._Record(ctx, sel, v) } -func (ec *executionContext) marshalOReference2ᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐReference(ctx context.Context, sel ast.SelectionSet, v *Reference) graphql.Marshaler { - if v == nil { - return graphql.Null - } - return ec._Reference(ctx, sel, v) -} - -func (ec *executionContext) unmarshalOReferenceInput2ᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐReferenceInput(ctx context.Context, v interface{}) (*ReferenceInput, error) { - if v == nil { - return nil, nil - } - res, err := ec.unmarshalInputReferenceInput(ctx, v) - return &res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) unmarshalOString2string(ctx context.Context, v interface{}) (string, error) { - res, err := graphql.UnmarshalString(v) - return res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalOString2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { - return graphql.MarshalString(v) -} - func (ec *executionContext) unmarshalOString2ᚕstringᚄ(ctx context.Context, v interface{}) ([]string, error) { if v == nil { return nil, nil } var vSlice []interface{} if v != nil { - if tmp1, ok := v.([]interface{}); ok { - vSlice = tmp1 - } else { - vSlice = []interface{}{v} - } + vSlice = graphql.CoerceList(v) } var err error res := make([]string, len(vSlice)) @@ -8486,81 +10816,37 @@ func (ec *executionContext) marshalOString2ᚖstring(ctx context.Context, sel as if v == nil { return graphql.Null } - return graphql.MarshalString(*v) + res := graphql.MarshalString(*v) + return res } -func (ec *executionContext) marshalOValidatorInfo2ᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐValidatorInfo(ctx context.Context, sel ast.SelectionSet, v *ValidatorInfo) graphql.Marshaler { +func (ec *executionContext) marshalOValidatorInfo2ᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐValidatorInfo(ctx context.Context, sel ast.SelectionSet, v *ValidatorInfo) graphql.Marshaler { if v == nil { return graphql.Null } return ec._ValidatorInfo(ctx, sel, v) } -func (ec *executionContext) marshalOValue2ᚕᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐValue(ctx context.Context, sel ast.SelectionSet, v []*Value) graphql.Marshaler { - if v == nil { - return graphql.Null - } - ret := make(graphql.Array, len(v)) - var wg sync.WaitGroup - isLen1 := len(v) == 1 - if !isLen1 { - wg.Add(len(v)) - } - for i := range v { - i := i - fc := &graphql.FieldContext{ - Index: &i, - Result: &v[i], - } - ctx := graphql.WithFieldContext(ctx, fc) - f := func(i int) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = nil - } - }() - if !isLen1 { - defer wg.Done() - } - ret[i] = ec.marshalOValue2ᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐValue(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } - - } - wg.Wait() - - return ret -} - -func (ec *executionContext) marshalOValue2ᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐValue(ctx context.Context, sel ast.SelectionSet, v *Value) graphql.Marshaler { +func (ec *executionContext) marshalOValue2githubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐValue(ctx context.Context, sel ast.SelectionSet, v Value) graphql.Marshaler { if v == nil { return graphql.Null } return ec._Value(ctx, sel, v) } -func (ec *executionContext) unmarshalOValueInput2ᚕᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐValueInput(ctx context.Context, v interface{}) ([]*ValueInput, error) { +func (ec *executionContext) unmarshalOValueInput2ᚕᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐValueInput(ctx context.Context, v interface{}) ([]*ValueInput, error) { if v == nil { return nil, nil } var vSlice []interface{} if v != nil { - if tmp1, ok := v.([]interface{}); ok { - vSlice = tmp1 - } else { - vSlice = []interface{}{v} - } + vSlice = graphql.CoerceList(v) } var err error res := make([]*ValueInput, len(vSlice)) for i := range vSlice { ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) - res[i], err = ec.unmarshalOValueInput2ᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐValueInput(ctx, vSlice[i]) + res[i], err = ec.unmarshalOValueInput2ᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐValueInput(ctx, vSlice[i]) if err != nil { return nil, err } @@ -8568,7 +10854,7 @@ func (ec *executionContext) unmarshalOValueInput2ᚕᚖgithubᚗcomᚋtharsisᚋ return res, nil } -func (ec *executionContext) unmarshalOValueInput2ᚖgithubᚗcomᚋtharsisᚋethermintᚋgqlᚐValueInput(ctx context.Context, v interface{}) (*ValueInput, error) { +func (ec *executionContext) unmarshalOValueInput2ᚖgithubᚗcomᚋcercᚑioᚋlaconicdᚋgqlᚐValueInput(ctx context.Context, v interface{}) (*ValueInput, error) { if v == nil { return nil, nil } diff --git a/gql/gqlgen.yml b/gql/gqlgen.yml index 68b9374e..c98d3018 100644 --- a/gql/gqlgen.yml +++ b/gql/gqlgen.yml @@ -10,3 +10,8 @@ model: resolver: filename: resolver.go type: Resolver + +models: + Link: + model: + - github.com/cerc-io/laconicd/gql.Link diff --git a/gql/models_gen.go b/gql/models_gen.go index 4fcef293..31f2e511 100644 --- a/gql/models_gen.go +++ b/gql/models_gen.go @@ -2,6 +2,10 @@ package gql +type Value interface { + IsValue() +} + type Account struct { Address string `json:"address"` PubKey *string `json:"pubKey"` @@ -10,6 +14,17 @@ type Account struct { Balance []*Coin `json:"balance"` } +type ArrayValue struct { + Value []Value `json:"value"` +} + +func (ArrayValue) IsValue() {} + +type Attribute struct { + Key string `json:"key"` + Value Value `json:"value"` +} + type Auction struct { ID string `json:"id"` Status string `json:"status"` @@ -53,21 +68,52 @@ type Bond struct { Balance []*Coin `json:"balance"` } +type BooleanValue struct { + Value bool `json:"value"` +} + +func (BooleanValue) IsValue() {} + +type BytesValue struct { + Value string `json:"value"` +} + +func (BytesValue) IsValue() {} + type Coin struct { Type string `json:"type"` Quantity string `json:"quantity"` } -type KeyValue struct { - Key string `json:"key"` - Value *Value `json:"value"` +type FloatValue struct { + Value float64 `json:"value"` } +func (FloatValue) IsValue() {} + +type IntValue struct { + Value int `json:"value"` +} + +func (IntValue) IsValue() {} + type KeyValueInput struct { Key string `json:"key"` Value *ValueInput `json:"value"` } +type LinkValue struct { + Value Link `json:"value"` +} + +func (LinkValue) IsValue() {} + +type MapValue struct { + Value []*Attribute `json:"value"` +} + +func (MapValue) IsValue() {} + type NameRecord struct { Latest *NameRecordEntry `json:"latest"` History []*NameRecordEntry `json:"history"` @@ -96,22 +142,14 @@ type PeerInfo struct { } type Record struct { - ID string `json:"id"` - Names []string `json:"names"` - BondID string `json:"bondId"` - CreateTime string `json:"createTime"` - ExpiryTime string `json:"expiryTime"` - Owners []string `json:"owners"` - Attributes []*KeyValue `json:"attributes"` - References []*Record `json:"references"` -} - -type Reference struct { - ID string `json:"id"` -} - -type ReferenceInput struct { - ID string `json:"id"` + ID string `json:"id"` + Names []string `json:"names"` + BondID string `json:"bondId"` + CreateTime string `json:"createTime"` + ExpiryTime string `json:"expiryTime"` + Owners []string `json:"owners"` + Attributes []*Attribute `json:"attributes"` + References []*Record `json:"references"` } type Status struct { @@ -125,6 +163,12 @@ type Status struct { DiskUsage string `json:"disk_usage"` } +type StringValue struct { + Value string `json:"value"` +} + +func (StringValue) IsValue() {} + type SyncInfo struct { LatestBlockHash string `json:"latest_block_hash"` LatestBlockHeight string `json:"latest_block_height"` @@ -138,23 +182,12 @@ type ValidatorInfo struct { ProposerPriority *string `json:"proposer_priority"` } -type Value struct { - Null *bool `json:"null"` - Int *int `json:"int"` - Float *float64 `json:"float"` - String *string `json:"string"` - Boolean *bool `json:"boolean"` - JSON *string `json:"json"` - Reference *Reference `json:"reference"` - Values []*Value `json:"values"` -} - type ValueInput struct { - Null *bool `json:"null"` - Int *int `json:"int"` - Float *float64 `json:"float"` - String *string `json:"string"` - Boolean *bool `json:"boolean"` - Reference *ReferenceInput `json:"reference"` - Values []*ValueInput `json:"values"` + Int *int `json:"int"` + Float *float64 `json:"float"` + String *string `json:"string"` + Boolean *bool `json:"boolean"` + Link *Link `json:"link"` + Array []*ValueInput `json:"array"` + Map []*KeyValueInput `json:"map"` } diff --git a/gql/scalar.go b/gql/scalar.go new file mode 100644 index 00000000..c53b4149 --- /dev/null +++ b/gql/scalar.go @@ -0,0 +1,33 @@ +package gql + +import ( + "context" + "encoding/json" + "fmt" + "io" +) + +// Represents an IPLD link. Links are generally but not necessarily implemented as CIDs +type Link string + +func (l Link) String() string { + return string(l) +} + +// UnmarshalGQLContext implements the graphql.ContextUnmarshaler interface +func (l *Link) UnmarshalGQLContext(_ context.Context, v interface{}) error { + s, ok := v.(string) + if !ok { + return fmt.Errorf("Link must be a string") + } + *l = Link(s) + return nil +} + +// MarshalGQLContext implements the graphql.ContextMarshaler interface +func (l Link) MarshalGQLContext(_ context.Context, w io.Writer) error { + encodable := map[string]string{ + "/": l.String(), + } + return json.NewEncoder(w).Encode(encodable) +} diff --git a/gql/util.go b/gql/util.go index a6adabcb..aca90b8f 100644 --- a/gql/util.go +++ b/gql/util.go @@ -2,15 +2,15 @@ package gql import ( "context" - "encoding/json" - "fmt" - "reflect" // #nosec G702 + "fmt" // #nosec G702 "strconv" auctiontypes "github.com/cerc-io/laconicd/x/auction/types" bondtypes "github.com/cerc-io/laconicd/x/bond/types" registrytypes "github.com/cerc-io/laconicd/x/registry/types" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/ipld/go-ipld-prime" + "github.com/ipld/go-ipld-prime/codec/dagjson" ) // OwnerAttributeName denotes the owner attribute name for a bond. @@ -61,13 +61,21 @@ func getGQLRecord(ctx context.Context, resolver QueryResolver, record registryty return nil, nil } - recordType := record.ToReadableRecord() - attributes, err := getAttributes(&recordType) + node, err := ipld.Decode(record.Attributes, dagjson.Decode) + if err != nil { + return nil, err + } + if node.Kind() != ipld.Kind_Map { + return nil, fmt.Errorf("invalid record attributes") + } + + var links []string + attributes, err := resolveIPLDNode(node, &links) if err != nil { return nil, err } - references, err := getReferences(ctx, resolver, &recordType) + references, err := resolver.GetRecordsByIds(ctx, links) if err != nil { return nil, err } @@ -79,11 +87,96 @@ func getGQLRecord(ctx context.Context, resolver QueryResolver, record registryty ExpiryTime: record.GetExpiryTime(), Owners: record.GetOwners(), Names: record.GetNames(), - Attributes: attributes, + Attributes: attributes.(MapValue).Value, References: references, }, nil } +func resolveIPLDNode(node ipld.Node, links *[]string) (Value, error) { + switch node.Kind() { + case ipld.Kind_Map: + var entries []*Attribute + for itr := node.MapIterator(); !itr.Done(); { + k, v, err := itr.Next() + if err != nil { + return nil, err + } + if k.Kind() != ipld.Kind_String { + return nil, fmt.Errorf("invalid record attribute key type: %s", k.Kind()) + } + s, err := k.AsString() + if err != nil { + return nil, err + } + val, err := resolveIPLDNode(v, links) + if err != nil { + return nil, err + } + entries = append(entries, &Attribute{ + Key: s, + Value: val, + }) + } + return MapValue{entries}, nil + case ipld.Kind_List: + var values []Value + for itr := node.ListIterator(); !itr.Done(); { + _, v, err := itr.Next() + if err != nil { + return nil, err + } + val, err := resolveIPLDNode(v, links) + if err != nil { + return nil, err + } + values = append(values, val) + } + return ArrayValue{values}, nil + case ipld.Kind_Null: + return nil, nil + case ipld.Kind_Bool: + val, err := node.AsBool() + if err != nil { + return nil, err + } + return BooleanValue{val}, nil + case ipld.Kind_Int: + val, err := node.AsInt() + if err != nil { + return nil, err + } + // TODO: handle bigger ints + return IntValue{int(val)}, nil + case ipld.Kind_Float: + val, err := node.AsFloat() + if err != nil { + return nil, err + } + return FloatValue{val}, nil + case ipld.Kind_String: + val, err := node.AsString() + if err != nil { + return nil, err + } + return StringValue{val}, nil + case ipld.Kind_Bytes: + val, err := node.AsBytes() + if err != nil { + return nil, err + } + return BytesValue{string(val)}, nil + case ipld.Kind_Link: + val, err := node.AsLink() + if err != nil { + return nil, err + } + *links = append(*links, val.String()) + return LinkValue{Link(val.String())}, nil + default: + return nil, fmt.Errorf("invalid node kind") + } +} + func getGQLNameRecord(record *registrytypes.NameRecord) (*NameRecord, error) { if record == nil { return nil, fmt.Errorf("got nil record") @@ -163,136 +256,64 @@ func GetGQLAuction(auction *auctiontypes.Auction, bids []*auctiontypes.Bid) (*Au return &gqlAuction, nil } -func getReferences(ctx context.Context, resolver QueryResolver, r *registrytypes.RecordEncodable) ([]*Record, error) { - var ids []string +func parseRequestValue(value *ValueInput) *registrytypes.QueryListRecordsRequest_ValueInput { + if value == nil { + return nil + } + var val registrytypes.QueryListRecordsRequest_ValueInput - // #nosec G705 - for key := range r.Attributes { - //nolint: all - switch r.Attributes[key].(type) { - case interface{}: - if obj, ok := r.Attributes[key].(map[string]interface{}); ok { - if _, ok := obj["/"]; ok && len(obj) == 1 { - if _, ok := obj["/"].(string); ok { - ids = append(ids, obj["/"].(string)) - } - } - } - } + if value.String != nil { + val.String_ = *value.String + val.Type = "string" } - return resolver.GetRecordsByIds(ctx, ids) -} - -func getAttributes(r *registrytypes.RecordEncodable) ([]*KeyValue, error) { - return mapToKeyValuePairs(r.Attributes) -} - -func mapToKeyValuePairs(attrs map[string]interface{}) ([]*KeyValue, error) { - kvPairs := []*KeyValue{} - - trueVal := true - falseVal := false - - // #nosec G705 - for key, value := range attrs { - kvPair := &KeyValue{ - Key: key, - Value: &Value{}, - } - - switch val := value.(type) { - case nil: - kvPair.Value.Null = &trueVal - case int: - kvPair.Value.Int = &val - case float64: - kvPair.Value.Float = &val - case string: - kvPair.Value.String = &val - case bool: - kvPair.Value.Boolean = &val - case interface{}: - if obj, ok := value.(map[string]interface{}); ok { - if _, ok := obj["/"]; ok && len(obj) == 1 { - if _, ok := obj["/"].(string); ok { - kvPair.Value.Reference = &Reference{ - ID: obj["/"].(string), - } - } - } else { - bytes, err := json.Marshal(obj) - if err != nil { - return nil, err - } - - jsonStr := string(bytes) - kvPair.Value.JSON = &jsonStr - } - } - } - - if kvPair.Value.Null == nil { - kvPair.Value.Null = &falseVal - } - - valueType := reflect.ValueOf(value) - if valueType.Kind() == reflect.Slice { - bytes, err := json.Marshal(value) - if err != nil { - return nil, err - } - - jsonStr := string(bytes) - kvPair.Value.JSON = &jsonStr - } - - kvPairs = append(kvPairs, kvPair) + if value.Int != nil { + val.Int = int64(*value.Int) + val.Type = "int" } - return kvPairs, nil + if value.Float != nil { + val.Float = *value.Float + val.Type = "float" + } + + if value.Boolean != nil { + val.Boolean = *value.Boolean + val.Type = "boolean" + } + + if value.Link != nil { + reference := ®istrytypes.QueryListRecordsRequest_ReferenceInput{ + Id: value.Link.String(), + } + + val.Reference = reference + val.Type = "reference" + } + + // handle arrays + if value.Array != nil { + values := []*registrytypes.QueryListRecordsRequest_ValueInput{} + for _, v := range value.Array { + val := parseRequestValue(v) + values = append(values, val) + } + val.Values = values + val.Type = "array" + } + + return &val } func parseRequestAttributes(attrs []*KeyValueInput) []*registrytypes.QueryListRecordsRequest_KeyValueInput { kvPairs := []*registrytypes.QueryListRecordsRequest_KeyValueInput{} for _, value := range attrs { + parsedValue := parseRequestValue(value.Value) kvPair := ®istrytypes.QueryListRecordsRequest_KeyValueInput{ Key: value.Key, - Value: ®istrytypes.QueryListRecordsRequest_ValueInput{}, + Value: parsedValue, } - - if value.Value.String != nil { - kvPair.Value.String_ = *value.Value.String - kvPair.Value.Type = "string" - } - - if value.Value.Int != nil { - kvPair.Value.Int = int64(*value.Value.Int) - kvPair.Value.Type = "int" - } - - if value.Value.Float != nil { - kvPair.Value.Float = *value.Value.Float - kvPair.Value.Type = "float" - } - - if value.Value.Boolean != nil { - kvPair.Value.Boolean = *value.Value.Boolean - kvPair.Value.Type = "boolean" - } - - if value.Value.Reference != nil { - reference := ®istrytypes.QueryListRecordsRequest_ReferenceInput{ - Id: value.Value.Reference.ID, - } - - kvPair.Value.Reference = reference - kvPair.Value.Type = "reference" - } - - // TODO: Handle arrays. - kvPairs = append(kvPairs, kvPair) } diff --git a/x/registry/keeper/keeper.go b/x/registry/keeper/keeper.go index a8bfa0df..a0bc009a 100644 --- a/x/registry/keeper/keeper.go +++ b/x/registry/keeper/keeper.go @@ -362,8 +362,6 @@ func (k Keeper) SetAttributeMapping(ctx sdk.Context, key []byte, recordID string if err != nil { return fmt.Errorf("cannot unmarshal byte array, error, %w", err) } - } else { - recordIds = []string{} } recordIds = append(recordIds, recordID) bz, err := json.Marshal(recordIds) -- 2.45.2 From 4adce81981b9ce988d267e6826c801cbf672320b Mon Sep 17 00:00:00 2001 From: Roy Crihfield Date: Wed, 18 Oct 2023 19:03:21 -0500 Subject: [PATCH 05/10] gql -> rpc dag-json encoding --- gql/resolver.go | 2 +- gql/util.go | 73 +++++++++++----------------- x/registry/keeper/grpc_query_test.go | 6 +-- x/registry/keeper/keeper.go | 11 +++++ 4 files changed, 42 insertions(+), 50 deletions(-) diff --git a/gql/resolver.go b/gql/resolver.go index 0c41bbb0..a3b49da0 100644 --- a/gql/resolver.go +++ b/gql/resolver.go @@ -121,7 +121,7 @@ func (q queryResolver) QueryRecords(ctx context.Context, attributes []*KeyValueI res, err := nsQueryClient.ListRecords( context.Background(), ®istrytypes.QueryListRecordsRequest{ - Attributes: parseRequestAttributes(attributes), + Attributes: toRpcAttributes(attributes), All: (all != nil && *all), }, ) diff --git a/gql/util.go b/gql/util.go index aca90b8f..cc53a1d5 100644 --- a/gql/util.go +++ b/gql/util.go @@ -256,60 +256,43 @@ func GetGQLAuction(auction *auctiontypes.Auction, bids []*auctiontypes.Bid) (*Au return &gqlAuction, nil } -func parseRequestValue(value *ValueInput) *registrytypes.QueryListRecordsRequest_ValueInput { - if value == nil { +func toRpcValue(value *ValueInput) *registrytypes.QueryListRecordsRequest_ValueInput { + var rpcval registrytypes.QueryListRecordsRequest_ValueInput + + switch { + case value == nil: return nil - } - var val registrytypes.QueryListRecordsRequest_ValueInput - - if value.String != nil { - val.String_ = *value.String - val.Type = "string" - } - - if value.Int != nil { - val.Int = int64(*value.Int) - val.Type = "int" - } - - if value.Float != nil { - val.Float = *value.Float - val.Type = "float" - } - - if value.Boolean != nil { - val.Boolean = *value.Boolean - val.Type = "boolean" - } - - if value.Link != nil { - reference := ®istrytypes.QueryListRecordsRequest_ReferenceInput{ - Id: value.Link.String(), + case value.Int != nil: + rpcval.Value = ®istrytypes.QueryListRecordsRequest_ValueInput_Int{int64(*value.Int)} + case value.Float != nil: + rpcval.Value = ®istrytypes.QueryListRecordsRequest_ValueInput_Float{*value.Float} + case value.String != nil: + rpcval.Value = ®istrytypes.QueryListRecordsRequest_ValueInput_String_{*value.String} + case value.Boolean != nil: + rpcval.Value = ®istrytypes.QueryListRecordsRequest_ValueInput_Boolean{*value.Boolean} + case value.Link != nil: + rpcval.Value = ®istrytypes.QueryListRecordsRequest_ValueInput_Link{value.Link.String()} + case value.Array != nil: + var contents registrytypes.QueryListRecordsRequest_ArrayInput + for _, val := range value.Array { + contents.Values = append(contents.Values, toRpcValue(val)) } - - val.Reference = reference - val.Type = "reference" - } - - // handle arrays - if value.Array != nil { - values := []*registrytypes.QueryListRecordsRequest_ValueInput{} - for _, v := range value.Array { - val := parseRequestValue(v) - values = append(values, val) + rpcval.Value = ®istrytypes.QueryListRecordsRequest_ValueInput_Array{&contents} + case value.Map != nil: + var contents registrytypes.QueryListRecordsRequest_MapInput + for _, kv := range value.Map { + contents.Values[kv.Key] = toRpcValue(kv.Value) } - val.Values = values - val.Type = "array" + rpcval.Value = ®istrytypes.QueryListRecordsRequest_ValueInput_Map{&contents} } - - return &val + return &rpcval } -func parseRequestAttributes(attrs []*KeyValueInput) []*registrytypes.QueryListRecordsRequest_KeyValueInput { +func toRpcAttributes(attrs []*KeyValueInput) []*registrytypes.QueryListRecordsRequest_KeyValueInput { kvPairs := []*registrytypes.QueryListRecordsRequest_KeyValueInput{} for _, value := range attrs { - parsedValue := parseRequestValue(value.Value) + parsedValue := toRpcValue(value.Value) kvPair := ®istrytypes.QueryListRecordsRequest_KeyValueInput{ Key: value.Key, Value: parsedValue, diff --git a/x/registry/keeper/grpc_query_test.go b/x/registry/keeper/grpc_query_test.go index bbc1038d..5edaf647 100644 --- a/x/registry/keeper/grpc_query_test.go +++ b/x/registry/keeper/grpc_query_test.go @@ -68,8 +68,7 @@ func (suite *KeeperTestSuite) TestGrpcGetRecordLists() { { Key: "type", Value: ®istrytypes.QueryListRecordsRequest_ValueInput{ - Type: "string", - String_: "WebsiteRegistrationRecord", + Value: ®istrytypes.QueryListRecordsRequest_ValueInput_String_{"WebsiteRegistrationRecord"}, }, }, }, @@ -86,8 +85,7 @@ func (suite *KeeperTestSuite) TestGrpcGetRecordLists() { { Key: "x500state_name", Value: ®istrytypes.QueryListRecordsRequest_ValueInput{ - Type: "string", - String_: "california", + Value: ®istrytypes.QueryListRecordsRequest_ValueInput_String_{"california"}, }, }, }, diff --git a/x/registry/keeper/keeper.go b/x/registry/keeper/keeper.go index a0bc009a..81664785 100644 --- a/x/registry/keeper/keeper.go +++ b/x/registry/keeper/keeper.go @@ -21,6 +21,9 @@ import ( bank "github.com/cosmos/cosmos-sdk/x/bank/keeper" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" "github.com/tendermint/tendermint/libs/log" + + "github.com/ipld/go-ipld-prime/codec/dagjson" + basicnode "github.com/ipld/go-ipld-prime/node/basic" ) var ( @@ -336,6 +339,14 @@ func (k Keeper) PutRecord(ctx sdk.Context, record types.Record) { } func (k Keeper) processAttributes(ctx sdk.Context, attrs map[string]any, id string, prefix string) error { + np := basicnode.Prototype.Any // Pick a stle for the in-memory data. + nb := np.NewBuilder() // Create a builder. + err := dagjson.Decode(nb, bytes.NewReader(content)) // Hand the builder to decoding -- decoding will fill it in! + if err != nil { + return "", err + } + n := nb.Build() // Call 'Build' to get the resulting Node. (It's immutable!) + for key, value := range attrs { if subRecord, ok := value.(map[string]any); ok { k.processAttributes(ctx, subRecord, id, key) -- 2.45.2 From 16d9291bc233f5b74b815ca4f7e7822faa5fe207 Mon Sep 17 00:00:00 2001 From: Roy Crihfield Date: Wed, 18 Oct 2023 19:29:37 -0500 Subject: [PATCH 06/10] use sum type in protobuf query --- proto/vulcanize/registry/v1beta1/query.proto | 24 +- x/registry/keeper/keeper.go | 34 +- x/registry/types/query.pb.go | 1379 +++++++++++++----- 3 files changed, 1052 insertions(+), 385 deletions(-) diff --git a/proto/vulcanize/registry/v1beta1/query.proto b/proto/vulcanize/registry/v1beta1/query.proto index f30fdb44..fc8c5d2b 100644 --- a/proto/vulcanize/registry/v1beta1/query.proto +++ b/proto/vulcanize/registry/v1beta1/query.proto @@ -67,17 +67,25 @@ message QueryParamsResponse { // QueryListRecordsRequest is request type for registry records list message QueryListRecordsRequest { - message ReferenceInput { + message LinkInput { string id = 1; } + message ArrayInput { + repeated ValueInput values = 1; + } + message MapInput { + map values = 1; + } message ValueInput { - string type = 1; - string string = 2; - int64 int = 3; - double float = 4; - bool boolean = 5; - ReferenceInput reference = 6; - repeated ValueInput values = 7; + oneof value { + string string = 1; + int64 int = 2; + double float = 3; + bool boolean = 4; + string link = 5; + ArrayInput array = 6; + MapInput map = 7; + } } message KeyValueInput { string key = 1; diff --git a/x/registry/keeper/keeper.go b/x/registry/keeper/keeper.go index 81664785..a96f31a8 100644 --- a/x/registry/keeper/keeper.go +++ b/x/registry/keeper/keeper.go @@ -179,22 +179,26 @@ func (k Keeper) RecordsFromAttributes(ctx sdk.Context, attributes []*types.Query } func GetAttributeValue(input *types.QueryListRecordsRequest_ValueInput) interface{} { - if input.Type == "int" { - return input.GetInt() + switch value := input.GetValue().(type) { + case *types.QueryListRecordsRequest_ValueInput_String_: + return value.String_ + case *types.QueryListRecordsRequest_ValueInput_Int: + return value.Int + case *types.QueryListRecordsRequest_ValueInput_Float: + return value.Float + case *types.QueryListRecordsRequest_ValueInput_Boolean: + return value.Boolean + case *types.QueryListRecordsRequest_ValueInput_Link: + return value.Link + case *types.QueryListRecordsRequest_ValueInput_Array: + return value.Array + case *types.QueryListRecordsRequest_ValueInput_Map: + return value.Map + case nil: + return nil + default: + return fmt.Errorf("Value has unepxpected type %T", value) } - if input.Type == "float" { - return input.GetFloat() - } - if input.Type == "string" { - return input.GetString_() - } - if input.Type == "boolean" { - return input.GetBoolean() - } - if input.Type == "reference" { - return input.GetReference().GetId() - } - return nil } func getIntersection(a []string, b []string) []string { diff --git a/x/registry/types/query.pb.go b/x/registry/types/query.pb.go index e3760364..f037ab32 100644 --- a/x/registry/types/query.pb.go +++ b/x/registry/types/query.pb.go @@ -177,24 +177,22 @@ func (m *QueryListRecordsRequest) GetPagination() *query.PageRequest { return nil } -type QueryListRecordsRequest_ReferenceInput struct { +type QueryListRecordsRequest_LinkInput struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` } -func (m *QueryListRecordsRequest_ReferenceInput) Reset() { - *m = QueryListRecordsRequest_ReferenceInput{} -} -func (m *QueryListRecordsRequest_ReferenceInput) String() string { return proto.CompactTextString(m) } -func (*QueryListRecordsRequest_ReferenceInput) ProtoMessage() {} -func (*QueryListRecordsRequest_ReferenceInput) Descriptor() ([]byte, []int) { +func (m *QueryListRecordsRequest_LinkInput) Reset() { *m = QueryListRecordsRequest_LinkInput{} } +func (m *QueryListRecordsRequest_LinkInput) String() string { return proto.CompactTextString(m) } +func (*QueryListRecordsRequest_LinkInput) ProtoMessage() {} +func (*QueryListRecordsRequest_LinkInput) Descriptor() ([]byte, []int) { return fileDescriptor_dfadc1ce52446f26, []int{2, 0} } -func (m *QueryListRecordsRequest_ReferenceInput) XXX_Unmarshal(b []byte) error { +func (m *QueryListRecordsRequest_LinkInput) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryListRecordsRequest_ReferenceInput) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryListRecordsRequest_LinkInput) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryListRecordsRequest_ReferenceInput.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryListRecordsRequest_LinkInput.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -204,40 +202,139 @@ func (m *QueryListRecordsRequest_ReferenceInput) XXX_Marshal(b []byte, determini return b[:n], nil } } -func (m *QueryListRecordsRequest_ReferenceInput) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryListRecordsRequest_ReferenceInput.Merge(m, src) +func (m *QueryListRecordsRequest_LinkInput) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryListRecordsRequest_LinkInput.Merge(m, src) } -func (m *QueryListRecordsRequest_ReferenceInput) XXX_Size() int { +func (m *QueryListRecordsRequest_LinkInput) XXX_Size() int { return m.Size() } -func (m *QueryListRecordsRequest_ReferenceInput) XXX_DiscardUnknown() { - xxx_messageInfo_QueryListRecordsRequest_ReferenceInput.DiscardUnknown(m) +func (m *QueryListRecordsRequest_LinkInput) XXX_DiscardUnknown() { + xxx_messageInfo_QueryListRecordsRequest_LinkInput.DiscardUnknown(m) } -var xxx_messageInfo_QueryListRecordsRequest_ReferenceInput proto.InternalMessageInfo +var xxx_messageInfo_QueryListRecordsRequest_LinkInput proto.InternalMessageInfo -func (m *QueryListRecordsRequest_ReferenceInput) GetId() string { +func (m *QueryListRecordsRequest_LinkInput) GetId() string { if m != nil { return m.Id } return "" } +// message ValueInput { +// string type = 1; +// string string = 2; +// int64 int = 3; +// double float = 4; +// bool boolean = 5; +// LinkInput reference = 6; +// repeated ValueInput values = 7; +// } +type QueryListRecordsRequest_ArrayInput struct { + Values []*QueryListRecordsRequest_ValueInput `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"` +} + +func (m *QueryListRecordsRequest_ArrayInput) Reset() { *m = QueryListRecordsRequest_ArrayInput{} } +func (m *QueryListRecordsRequest_ArrayInput) String() string { return proto.CompactTextString(m) } +func (*QueryListRecordsRequest_ArrayInput) ProtoMessage() {} +func (*QueryListRecordsRequest_ArrayInput) Descriptor() ([]byte, []int) { + return fileDescriptor_dfadc1ce52446f26, []int{2, 1} +} +func (m *QueryListRecordsRequest_ArrayInput) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryListRecordsRequest_ArrayInput) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryListRecordsRequest_ArrayInput.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryListRecordsRequest_ArrayInput) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryListRecordsRequest_ArrayInput.Merge(m, src) +} +func (m *QueryListRecordsRequest_ArrayInput) XXX_Size() int { + return m.Size() +} +func (m *QueryListRecordsRequest_ArrayInput) XXX_DiscardUnknown() { + xxx_messageInfo_QueryListRecordsRequest_ArrayInput.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryListRecordsRequest_ArrayInput proto.InternalMessageInfo + +func (m *QueryListRecordsRequest_ArrayInput) GetValues() []*QueryListRecordsRequest_ValueInput { + if m != nil { + return m.Values + } + return nil +} + +type QueryListRecordsRequest_MapInput struct { + Values map[string]*QueryListRecordsRequest_ValueInput `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (m *QueryListRecordsRequest_MapInput) Reset() { *m = QueryListRecordsRequest_MapInput{} } +func (m *QueryListRecordsRequest_MapInput) String() string { return proto.CompactTextString(m) } +func (*QueryListRecordsRequest_MapInput) ProtoMessage() {} +func (*QueryListRecordsRequest_MapInput) Descriptor() ([]byte, []int) { + return fileDescriptor_dfadc1ce52446f26, []int{2, 2} +} +func (m *QueryListRecordsRequest_MapInput) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryListRecordsRequest_MapInput) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryListRecordsRequest_MapInput.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryListRecordsRequest_MapInput) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryListRecordsRequest_MapInput.Merge(m, src) +} +func (m *QueryListRecordsRequest_MapInput) XXX_Size() int { + return m.Size() +} +func (m *QueryListRecordsRequest_MapInput) XXX_DiscardUnknown() { + xxx_messageInfo_QueryListRecordsRequest_MapInput.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryListRecordsRequest_MapInput proto.InternalMessageInfo + +func (m *QueryListRecordsRequest_MapInput) GetValues() map[string]*QueryListRecordsRequest_ValueInput { + if m != nil { + return m.Values + } + return nil +} + type QueryListRecordsRequest_ValueInput struct { - Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` - String_ string `protobuf:"bytes,2,opt,name=string,proto3" json:"string,omitempty"` - Int int64 `protobuf:"varint,3,opt,name=int,proto3" json:"int,omitempty"` - Float float64 `protobuf:"fixed64,4,opt,name=float,proto3" json:"float,omitempty"` - Boolean bool `protobuf:"varint,5,opt,name=boolean,proto3" json:"boolean,omitempty"` - Reference *QueryListRecordsRequest_ReferenceInput `protobuf:"bytes,6,opt,name=reference,proto3" json:"reference,omitempty"` - Values []*QueryListRecordsRequest_ValueInput `protobuf:"bytes,7,rep,name=values,proto3" json:"values,omitempty"` + // Types that are valid to be assigned to Value: + // *QueryListRecordsRequest_ValueInput_String_ + // *QueryListRecordsRequest_ValueInput_Int + // *QueryListRecordsRequest_ValueInput_Float + // *QueryListRecordsRequest_ValueInput_Boolean + // *QueryListRecordsRequest_ValueInput_Link + // *QueryListRecordsRequest_ValueInput_Array + // *QueryListRecordsRequest_ValueInput_Map + Value isQueryListRecordsRequest_ValueInput_Value `protobuf_oneof:"value"` } func (m *QueryListRecordsRequest_ValueInput) Reset() { *m = QueryListRecordsRequest_ValueInput{} } func (m *QueryListRecordsRequest_ValueInput) String() string { return proto.CompactTextString(m) } func (*QueryListRecordsRequest_ValueInput) ProtoMessage() {} func (*QueryListRecordsRequest_ValueInput) Descriptor() ([]byte, []int) { - return fileDescriptor_dfadc1ce52446f26, []int{2, 1} + return fileDescriptor_dfadc1ce52446f26, []int{2, 3} } func (m *QueryListRecordsRequest_ValueInput) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -266,55 +363,111 @@ func (m *QueryListRecordsRequest_ValueInput) XXX_DiscardUnknown() { var xxx_messageInfo_QueryListRecordsRequest_ValueInput proto.InternalMessageInfo -func (m *QueryListRecordsRequest_ValueInput) GetType() string { +type isQueryListRecordsRequest_ValueInput_Value interface { + isQueryListRecordsRequest_ValueInput_Value() + MarshalTo([]byte) (int, error) + Size() int +} + +type QueryListRecordsRequest_ValueInput_String_ struct { + String_ string `protobuf:"bytes,1,opt,name=string,proto3,oneof" json:"string,omitempty"` +} +type QueryListRecordsRequest_ValueInput_Int struct { + Int int64 `protobuf:"varint,2,opt,name=int,proto3,oneof" json:"int,omitempty"` +} +type QueryListRecordsRequest_ValueInput_Float struct { + Float float64 `protobuf:"fixed64,3,opt,name=float,proto3,oneof" json:"float,omitempty"` +} +type QueryListRecordsRequest_ValueInput_Boolean struct { + Boolean bool `protobuf:"varint,4,opt,name=boolean,proto3,oneof" json:"boolean,omitempty"` +} +type QueryListRecordsRequest_ValueInput_Link struct { + Link string `protobuf:"bytes,5,opt,name=link,proto3,oneof" json:"link,omitempty"` +} +type QueryListRecordsRequest_ValueInput_Array struct { + Array *QueryListRecordsRequest_ArrayInput `protobuf:"bytes,6,opt,name=array,proto3,oneof" json:"array,omitempty"` +} +type QueryListRecordsRequest_ValueInput_Map struct { + Map *QueryListRecordsRequest_MapInput `protobuf:"bytes,7,opt,name=map,proto3,oneof" json:"map,omitempty"` +} + +func (*QueryListRecordsRequest_ValueInput_String_) isQueryListRecordsRequest_ValueInput_Value() {} +func (*QueryListRecordsRequest_ValueInput_Int) isQueryListRecordsRequest_ValueInput_Value() {} +func (*QueryListRecordsRequest_ValueInput_Float) isQueryListRecordsRequest_ValueInput_Value() {} +func (*QueryListRecordsRequest_ValueInput_Boolean) isQueryListRecordsRequest_ValueInput_Value() {} +func (*QueryListRecordsRequest_ValueInput_Link) isQueryListRecordsRequest_ValueInput_Value() {} +func (*QueryListRecordsRequest_ValueInput_Array) isQueryListRecordsRequest_ValueInput_Value() {} +func (*QueryListRecordsRequest_ValueInput_Map) isQueryListRecordsRequest_ValueInput_Value() {} + +func (m *QueryListRecordsRequest_ValueInput) GetValue() isQueryListRecordsRequest_ValueInput_Value { if m != nil { - return m.Type + return m.Value } - return "" + return nil } func (m *QueryListRecordsRequest_ValueInput) GetString_() string { - if m != nil { - return m.String_ + if x, ok := m.GetValue().(*QueryListRecordsRequest_ValueInput_String_); ok { + return x.String_ } return "" } func (m *QueryListRecordsRequest_ValueInput) GetInt() int64 { - if m != nil { - return m.Int + if x, ok := m.GetValue().(*QueryListRecordsRequest_ValueInput_Int); ok { + return x.Int } return 0 } func (m *QueryListRecordsRequest_ValueInput) GetFloat() float64 { - if m != nil { - return m.Float + if x, ok := m.GetValue().(*QueryListRecordsRequest_ValueInput_Float); ok { + return x.Float } return 0 } func (m *QueryListRecordsRequest_ValueInput) GetBoolean() bool { - if m != nil { - return m.Boolean + if x, ok := m.GetValue().(*QueryListRecordsRequest_ValueInput_Boolean); ok { + return x.Boolean } return false } -func (m *QueryListRecordsRequest_ValueInput) GetReference() *QueryListRecordsRequest_ReferenceInput { - if m != nil { - return m.Reference +func (m *QueryListRecordsRequest_ValueInput) GetLink() string { + if x, ok := m.GetValue().(*QueryListRecordsRequest_ValueInput_Link); ok { + return x.Link + } + return "" +} + +func (m *QueryListRecordsRequest_ValueInput) GetArray() *QueryListRecordsRequest_ArrayInput { + if x, ok := m.GetValue().(*QueryListRecordsRequest_ValueInput_Array); ok { + return x.Array } return nil } -func (m *QueryListRecordsRequest_ValueInput) GetValues() []*QueryListRecordsRequest_ValueInput { - if m != nil { - return m.Values +func (m *QueryListRecordsRequest_ValueInput) GetMap() *QueryListRecordsRequest_MapInput { + if x, ok := m.GetValue().(*QueryListRecordsRequest_ValueInput_Map); ok { + return x.Map } return nil } +// XXX_OneofWrappers is for the internal use of the proto package. +func (*QueryListRecordsRequest_ValueInput) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*QueryListRecordsRequest_ValueInput_String_)(nil), + (*QueryListRecordsRequest_ValueInput_Int)(nil), + (*QueryListRecordsRequest_ValueInput_Float)(nil), + (*QueryListRecordsRequest_ValueInput_Boolean)(nil), + (*QueryListRecordsRequest_ValueInput_Link)(nil), + (*QueryListRecordsRequest_ValueInput_Array)(nil), + (*QueryListRecordsRequest_ValueInput_Map)(nil), + } +} + type QueryListRecordsRequest_KeyValueInput struct { Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` Value *QueryListRecordsRequest_ValueInput `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` @@ -324,7 +477,7 @@ func (m *QueryListRecordsRequest_KeyValueInput) Reset() { *m = QueryList func (m *QueryListRecordsRequest_KeyValueInput) String() string { return proto.CompactTextString(m) } func (*QueryListRecordsRequest_KeyValueInput) ProtoMessage() {} func (*QueryListRecordsRequest_KeyValueInput) Descriptor() ([]byte, []int) { - return fileDescriptor_dfadc1ce52446f26, []int{2, 2} + return fileDescriptor_dfadc1ce52446f26, []int{2, 4} } func (m *QueryListRecordsRequest_KeyValueInput) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1381,7 +1534,10 @@ func init() { proto.RegisterType((*QueryParamsRequest)(nil), "vulcanize.registry.v1beta1.QueryParamsRequest") proto.RegisterType((*QueryParamsResponse)(nil), "vulcanize.registry.v1beta1.QueryParamsResponse") proto.RegisterType((*QueryListRecordsRequest)(nil), "vulcanize.registry.v1beta1.QueryListRecordsRequest") - proto.RegisterType((*QueryListRecordsRequest_ReferenceInput)(nil), "vulcanize.registry.v1beta1.QueryListRecordsRequest.ReferenceInput") + proto.RegisterType((*QueryListRecordsRequest_LinkInput)(nil), "vulcanize.registry.v1beta1.QueryListRecordsRequest.LinkInput") + proto.RegisterType((*QueryListRecordsRequest_ArrayInput)(nil), "vulcanize.registry.v1beta1.QueryListRecordsRequest.ArrayInput") + proto.RegisterType((*QueryListRecordsRequest_MapInput)(nil), "vulcanize.registry.v1beta1.QueryListRecordsRequest.MapInput") + proto.RegisterMapType((map[string]*QueryListRecordsRequest_ValueInput)(nil), "vulcanize.registry.v1beta1.QueryListRecordsRequest.MapInput.ValuesEntry") proto.RegisterType((*QueryListRecordsRequest_ValueInput)(nil), "vulcanize.registry.v1beta1.QueryListRecordsRequest.ValueInput") proto.RegisterType((*QueryListRecordsRequest_KeyValueInput)(nil), "vulcanize.registry.v1beta1.QueryListRecordsRequest.KeyValueInput") proto.RegisterType((*QueryListRecordsResponse)(nil), "vulcanize.registry.v1beta1.QueryListRecordsResponse") @@ -1412,96 +1568,100 @@ func init() { } var fileDescriptor_dfadc1ce52446f26 = []byte{ - // 1411 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x58, 0xcb, 0x6f, 0xdc, 0x54, - 0x17, 0xcf, 0x4d, 0x32, 0x93, 0xe6, 0xe4, 0x6b, 0xfa, 0xf5, 0x12, 0xb5, 0x53, 0x53, 0x26, 0xa9, - 0xfb, 0x9a, 0xa4, 0x1d, 0x9b, 0x24, 0x2d, 0x2d, 0x2d, 0xa0, 0x66, 0x4a, 0x1b, 0x55, 0x94, 0x47, - 0xac, 0x52, 0x24, 0x58, 0x14, 0x8f, 0xe7, 0x76, 0xea, 0xd6, 0xf1, 0x9d, 0xfa, 0x91, 0x76, 0xa8, - 0xba, 0x01, 0x89, 0x25, 0x42, 0x42, 0x08, 0x04, 0x6b, 0x1e, 0xea, 0x86, 0x0d, 0xac, 0x79, 0xac, - 0x2a, 0xb1, 0xa9, 0xc4, 0x86, 0x55, 0x41, 0x0d, 0x12, 0xfb, 0xfe, 0x05, 0xc8, 0xf7, 0xe1, 0xb1, - 0x93, 0x79, 0x78, 0xa6, 0x41, 0x62, 0x35, 0xd7, 0xd7, 0xe7, 0x77, 0xce, 0xef, 0x3c, 0xee, 0xb9, - 0xc7, 0x03, 0x87, 0xd6, 0x42, 0xc7, 0x32, 0x5d, 0xfb, 0x3d, 0xa2, 0x7b, 0xa4, 0x6e, 0xfb, 0x81, - 0xd7, 0xd4, 0xd7, 0xe6, 0xab, 0x24, 0x30, 0xe7, 0xf5, 0x9b, 0x21, 0xf1, 0x9a, 0x5a, 0xc3, 0xa3, - 0x01, 0xc5, 0x4a, 0x2c, 0xa7, 0x49, 0x39, 0x4d, 0xc8, 0x29, 0xb3, 0x5d, 0x74, 0xc4, 0xc2, 0x4c, - 0x8d, 0xb2, 0xb7, 0x4e, 0x69, 0xdd, 0x21, 0xba, 0xd9, 0xb0, 0x75, 0xd3, 0x75, 0x69, 0x60, 0x06, - 0x36, 0x75, 0x7d, 0xf1, 0x76, 0xce, 0xa2, 0xfe, 0x2a, 0xf5, 0xf5, 0xaa, 0xe9, 0x13, 0x6e, 0x3d, - 0xd6, 0xd3, 0x30, 0xeb, 0xb6, 0xcb, 0x84, 0x85, 0xec, 0x54, 0x9d, 0xd6, 0x29, 0x5b, 0xea, 0xd1, - 0x4a, 0xec, 0x16, 0x93, 0x1a, 0x24, 0xd6, 0xa2, 0xb6, 0x40, 0xa9, 0x53, 0x80, 0x57, 0x22, 0xbd, - 0x6f, 0x98, 0x9e, 0xb9, 0xea, 0x1b, 0xe4, 0x66, 0x48, 0xfc, 0x40, 0x5d, 0x81, 0xa7, 0x52, 0xbb, - 0x7e, 0x83, 0xba, 0x3e, 0xc1, 0xa7, 0x20, 0xdf, 0x60, 0x3b, 0x05, 0x34, 0x83, 0x4a, 0x13, 0x0b, - 0xaa, 0xd6, 0x39, 0x08, 0x9a, 0xc0, 0x0a, 0x84, 0xfa, 0x6d, 0x0e, 0x76, 0x33, 0x9d, 0x17, 0x6d, - 0x3f, 0x30, 0x88, 0x45, 0xbd, 0x9a, 0x34, 0x87, 0x4d, 0x00, 0x33, 0x08, 0x3c, 0xbb, 0x1a, 0x06, - 0x24, 0xd2, 0x3d, 0x52, 0x9a, 0x58, 0x58, 0xea, 0xa6, 0xbb, 0x83, 0x22, 0xed, 0x15, 0xd2, 0xbc, - 0x6c, 0x3a, 0x21, 0xb9, 0xe0, 0x36, 0xc2, 0xc0, 0x48, 0x28, 0xc5, 0xff, 0x87, 0x11, 0xd3, 0x71, - 0x0a, 0xc3, 0x33, 0xa8, 0xb4, 0xcd, 0x88, 0x96, 0xf8, 0x3c, 0x40, 0x2b, 0x86, 0x85, 0x11, 0xe6, - 0xd0, 0x21, 0x8d, 0x87, 0x4b, 0x8b, 0xc2, 0xa5, 0xf1, 0x74, 0xb7, 0xfc, 0xa9, 0x13, 0x61, 0xc7, - 0x48, 0x20, 0x95, 0x19, 0x98, 0x34, 0xc8, 0x55, 0xe2, 0x11, 0xd7, 0xe2, 0x76, 0xf1, 0x24, 0x0c, - 0xdb, 0x35, 0x16, 0xa2, 0x71, 0x63, 0xd8, 0xae, 0x29, 0xdf, 0x0f, 0x03, 0xb4, 0x68, 0x61, 0x0c, - 0xa3, 0x41, 0xb3, 0x41, 0x84, 0x00, 0x5b, 0xe3, 0x5d, 0x90, 0xf7, 0x03, 0xcf, 0x76, 0xeb, 0x8c, - 0xe1, 0xb8, 0x21, 0x9e, 0x22, 0xda, 0xb6, 0x1b, 0x30, 0x76, 0x23, 0x46, 0xb4, 0xc4, 0x53, 0x90, - 0xbb, 0xea, 0x50, 0x33, 0x28, 0x8c, 0xce, 0xa0, 0x12, 0x32, 0xf8, 0x03, 0x2e, 0xc0, 0x58, 0x95, - 0x52, 0x87, 0x98, 0x6e, 0x21, 0xc7, 0x5c, 0x94, 0x8f, 0xf8, 0x5d, 0x18, 0xf7, 0x24, 0xbd, 0x42, - 0x9e, 0x79, 0x59, 0x19, 0x24, 0xb4, 0x69, 0x1f, 0x8d, 0x96, 0x52, 0x7c, 0x19, 0xf2, 0x6b, 0x91, - 0x77, 0x7e, 0x61, 0x8c, 0x65, 0xee, 0xa5, 0x41, 0xd4, 0x27, 0xd2, 0x26, 0xb4, 0x29, 0xb7, 0x60, - 0x7b, 0x2a, 0x9f, 0x51, 0x30, 0x6e, 0x90, 0xa6, 0x88, 0x5b, 0xb4, 0xc4, 0x97, 0x20, 0xc7, 0x84, - 0x59, 0xd4, 0x9e, 0xdc, 0x32, 0x57, 0xa6, 0x7e, 0x83, 0xa0, 0xb0, 0x59, 0x5a, 0x9c, 0x81, 0x0a, - 0x8c, 0x79, 0x7c, 0x4b, 0x14, 0x6a, 0xd7, 0x43, 0xc0, 0xd1, 0x95, 0xd1, 0xfb, 0x0f, 0xa7, 0x87, - 0x0c, 0x09, 0xc4, 0xcb, 0xa9, 0xd2, 0xe3, 0xdc, 0x0f, 0xf7, 0x2c, 0x3d, 0x4e, 0x20, 0x59, 0x7b, - 0x6a, 0x09, 0x76, 0x31, 0xa2, 0xc2, 0x4c, 0xf3, 0xc2, 0xcb, 0xf2, 0x48, 0x6d, 0xa8, 0x41, 0xf5, - 0x1d, 0x71, 0xfa, 0x92, 0x92, 0xc2, 0xa3, 0x33, 0x90, 0xe7, 0xc4, 0xb2, 0x9c, 0xea, 0x94, 0x43, - 0x02, 0xa7, 0x06, 0xa0, 0xa4, 0x94, 0x57, 0xa8, 0x5b, 0xeb, 0x48, 0x65, 0xc3, 0xc1, 0x1b, 0x1e, - 0xf4, 0xe0, 0xa9, 0xf7, 0x10, 0x3c, 0xdd, 0xd6, 0xec, 0x7f, 0x31, 0x53, 0xfb, 0x60, 0x7a, 0x99, - 0x04, 0x86, 0xb0, 0xfa, 0x2a, 0xad, 0x85, 0x0e, 0xa9, 0x98, 0x8e, 0xe9, 0x5a, 0xd2, 0x37, 0xf5, - 0x3a, 0xcc, 0x74, 0x16, 0x11, 0x3e, 0x9d, 0x87, 0x6d, 0x55, 0xbe, 0x25, 0x9d, 0x9a, 0xeb, 0xe6, - 0xd4, 0x92, 0x65, 0xd1, 0xd0, 0x0d, 0xa4, 0x96, 0x18, 0xab, 0xfe, 0x8d, 0x60, 0x32, 0xfd, 0x12, - 0x5f, 0x84, 0xff, 0x99, 0x7c, 0xe7, 0x8a, 0x6b, 0xae, 0x8a, 0xf6, 0x54, 0x99, 0x7d, 0xfc, 0x70, - 0xfa, 0xe0, 0x75, 0x9f, 0xba, 0xa7, 0x54, 0xf1, 0xf6, 0x35, 0x73, 0x95, 0xa8, 0x33, 0x4d, 0x73, - 0xd5, 0x49, 0x6f, 0x19, 0x13, 0x89, 0x27, 0xfc, 0x21, 0x82, 0x31, 0x61, 0xad, 0x30, 0xc2, 0x88, - 0xee, 0x49, 0x85, 0x4d, 0x32, 0x3c, 0x4b, 0x6d, 0xb7, 0xb2, 0x12, 0x05, 0xfd, 0xf1, 0xc3, 0xe9, - 0x67, 0xb8, 0x21, 0x81, 0x93, 0x46, 0xe4, 0xe3, 0xbd, 0x3f, 0xa6, 0x4b, 0x75, 0x3b, 0xb8, 0x16, - 0x56, 0x35, 0x8b, 0xae, 0xea, 0xe2, 0x62, 0xe3, 0x3f, 0x65, 0xbf, 0x76, 0x43, 0x8f, 0x3a, 0xa9, - 0xcf, 0x34, 0xfa, 0x86, 0x34, 0xae, 0x12, 0x51, 0x24, 0xd1, 0x59, 0x8e, 0x98, 0x6d, 0xb8, 0x7a, - 0xd2, 0xc5, 0x88, 0x9e, 0xa4, 0x18, 0xf7, 0xb6, 0xb7, 0x23, 0x32, 0xb7, 0x04, 0xb9, 0x28, 0xac, - 0x32, 0x6d, 0x07, 0xbb, 0xa5, 0x2d, 0xc2, 0x9f, 0x73, 0x03, 0xaf, 0x29, 0xca, 0x91, 0x23, 0xb7, - 0xae, 0x18, 0x0f, 0xc3, 0x4e, 0xc6, 0xf5, 0xad, 0x6b, 0xd4, 0x8e, 0x23, 0x81, 0x61, 0xb4, 0x95, - 0x77, 0x83, 0xad, 0xd5, 0x2f, 0x90, 0x18, 0x0f, 0x84, 0xa4, 0xf0, 0xe5, 0x03, 0x04, 0x93, 0xd1, - 0xfb, 0x2b, 0x66, 0x18, 0x5c, 0xa3, 0x9e, 0x1d, 0x34, 0x45, 0xe4, 0x66, 0x7b, 0x79, 0xb5, 0x24, - 0x01, 0x95, 0x79, 0x91, 0xf3, 0x59, 0x9e, 0x73, 0x37, 0xf9, 0x52, 0x66, 0x3e, 0xbd, 0x69, 0x6c, - 0x4f, 0x3f, 0xab, 0x30, 0xc9, 0x23, 0x4e, 0xe9, 0x8d, 0xb0, 0x71, 0xd6, 0x73, 0xa3, 0x0b, 0xc2, - 0xf2, 0x5c, 0x79, 0x41, 0x58, 0x9e, 0xab, 0x5e, 0x12, 0x0d, 0x32, 0x96, 0x49, 0xcc, 0x32, 0x2d, - 0x77, 0xa3, 0x94, 0xf7, 0x20, 0xce, 0xd3, 0x29, 0xc2, 0xb2, 0x1f, 0x76, 0x88, 0xc6, 0xe3, 0x53, - 0x67, 0x8d, 0xb4, 0x37, 0xfd, 0x66, 0xdc, 0x71, 0xa5, 0x50, 0x72, 0x8e, 0xea, 0xb7, 0xe3, 0xc6, - 0xbd, 0xd6, 0x82, 0x3d, 0x4c, 0x2d, 0x6b, 0x15, 0xd1, 0xce, 0xb9, 0xdb, 0x0d, 0xdb, 0x6b, 0xae, - 0x84, 0x24, 0x24, 0x5b, 0x56, 0xcd, 0x3f, 0x20, 0xd8, 0xd7, 0xd1, 0x4a, 0xec, 0xc6, 0xf2, 0xc6, - 0x06, 0x5b, 0xee, 0xe6, 0x47, 0x4a, 0x03, 0x73, 0x69, 0xeb, 0xbb, 0xec, 0xf3, 0xb0, 0x73, 0x93, - 0x99, 0x4d, 0xf7, 0xcf, 0x54, 0x6b, 0x68, 0x18, 0x29, 0x8d, 0xcb, 0x4b, 0xff, 0xaa, 0x38, 0xbf, - 0xcb, 0x24, 0x88, 0x4b, 0xec, 0xdf, 0x08, 0xed, 0x4f, 0x08, 0x0e, 0x74, 0x33, 0x14, 0x47, 0xf7, - 0x75, 0x98, 0x90, 0xc7, 0xcb, 0x26, 0x03, 0x46, 0x38, 0xa9, 0x61, 0xcb, 0xa2, 0xbc, 0xf0, 0xd1, - 0x0e, 0xc8, 0x31, 0x17, 0xf0, 0xa7, 0x08, 0xf2, 0x7c, 0xce, 0xc7, 0x5a, 0xcf, 0xd9, 0x2b, 0xf5, - 0x89, 0xa1, 0xe8, 0x99, 0xe5, 0x39, 0x03, 0x75, 0xee, 0xfd, 0xdf, 0xfe, 0xfa, 0x64, 0xf8, 0x00, - 0x56, 0xf5, 0x2e, 0x5f, 0x57, 0xfc, 0x63, 0x03, 0x7f, 0x85, 0x60, 0x22, 0x31, 0xbc, 0xe1, 0xc5, - 0x01, 0x06, 0x43, 0xe5, 0x58, 0x7f, 0x20, 0x41, 0xf3, 0x08, 0xa3, 0x79, 0x10, 0xef, 0xd7, 0xbb, - 0x7e, 0x04, 0x72, 0x5e, 0x5f, 0x23, 0x18, 0x8f, 0x8f, 0x18, 0x5e, 0xe8, 0x69, 0x70, 0xd3, 0x9c, - 0xa7, 0x2c, 0xf6, 0x85, 0x11, 0x1c, 0x9f, 0x65, 0x1c, 0xe7, 0x70, 0x29, 0x03, 0x47, 0xfd, 0x8e, - 0x5d, 0xbb, 0x8b, 0x7f, 0x46, 0xb0, 0x33, 0x26, 0x2a, 0x27, 0x2d, 0xfc, 0x5c, 0x66, 0xe3, 0xa9, - 0x89, 0x50, 0x39, 0xd1, 0x37, 0x4e, 0x10, 0x3f, 0xcd, 0x88, 0x1f, 0xc7, 0x8b, 0x19, 0x88, 0x97, - 0xab, 0xcd, 0x72, 0x95, 0xba, 0xb5, 0xb2, 0x5d, 0xe3, 0x3e, 0xfc, 0x82, 0xa0, 0xd0, 0x69, 0xc0, - 0xc2, 0xa7, 0xbb, 0x51, 0xea, 0x31, 0xb9, 0x29, 0x2f, 0x0c, 0x06, 0xee, 0xa7, 0x62, 0xc4, 0x38, - 0x83, 0xbf, 0x43, 0xb0, 0x63, 0xc3, 0x88, 0x81, 0x4f, 0x64, 0x2a, 0xd4, 0xcd, 0xc3, 0x8f, 0x72, - 0xb2, 0x7f, 0xa0, 0xe0, 0x3c, 0xcb, 0x38, 0xef, 0xc7, 0xfb, 0xba, 0x71, 0xe6, 0x53, 0xcb, 0xe7, - 0x08, 0x72, 0x6c, 0x7c, 0xc0, 0xe5, 0x9e, 0xe6, 0x92, 0x03, 0x89, 0xa2, 0x65, 0x15, 0xef, 0xa7, - 0xaa, 0x6f, 0x45, 0x10, 0xfd, 0x4e, 0x44, 0xed, 0x2e, 0xfe, 0x0c, 0xc1, 0x78, 0x6b, 0x7a, 0x98, - 0xeb, 0x1d, 0x0d, 0x29, 0xab, 0x2c, 0x64, 0x97, 0xed, 0xaf, 0x81, 0x39, 0x0c, 0x86, 0xbf, 0x44, - 0x00, 0x89, 0xe9, 0xe2, 0x48, 0x86, 0x03, 0x23, 0x85, 0x33, 0xb5, 0x84, 0x8d, 0x23, 0x49, 0xd6, - 0xb6, 0xc5, 0x70, 0xf8, 0x47, 0x04, 0x53, 0x6d, 0xe7, 0x8f, 0xe3, 0x3d, 0x4d, 0xb7, 0x83, 0x29, - 0x2f, 0x0e, 0x04, 0x8b, 0xb9, 0xcf, 0x33, 0xee, 0x47, 0xf0, 0x6c, 0xef, 0xae, 0x50, 0x26, 0x0c, - 0x8f, 0x7f, 0x45, 0xb0, 0xbb, 0xd3, 0x4d, 0x7f, 0x32, 0x0b, 0x9b, 0x76, 0x48, 0xe5, 0xcc, 0xa0, - 0xc8, 0xd8, 0x95, 0x63, 0xcc, 0x15, 0x0d, 0x1f, 0xed, 0xe6, 0x4a, 0x3c, 0x75, 0x0b, 0x6f, 0x2a, - 0xe7, 0xef, 0x3f, 0x2a, 0xa2, 0x07, 0x8f, 0x8a, 0xe8, 0xcf, 0x47, 0x45, 0xf4, 0xf1, 0x7a, 0x71, - 0xe8, 0xc1, 0x7a, 0x71, 0xe8, 0xf7, 0xf5, 0xe2, 0xd0, 0xdb, 0x47, 0x93, 0x1f, 0x4c, 0xc4, 0xb3, - 0xca, 0x36, 0xd5, 0x1d, 0xd3, 0xa2, 0xae, 0x6d, 0xd5, 0xf4, 0xdb, 0x2d, 0xd5, 0xec, 0xd3, 0xa9, - 0x9a, 0x67, 0xff, 0x09, 0x2e, 0xfe, 0x13, 0x00, 0x00, 0xff, 0xff, 0x6a, 0xbd, 0x35, 0xd0, 0x04, - 0x15, 0x00, 0x00, + // 1483 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x58, 0x4f, 0x6c, 0x13, 0xc7, + 0x1a, 0xf7, 0xd8, 0xb1, 0x43, 0xbe, 0x3c, 0xc2, 0x63, 0x5e, 0x04, 0x66, 0xe1, 0x39, 0x61, 0xf9, + 0xe7, 0x04, 0xec, 0x7d, 0x49, 0xe0, 0x41, 0x81, 0x56, 0xc4, 0x14, 0x12, 0x54, 0x68, 0xc9, 0x8a, + 0x52, 0xa9, 0x3d, 0xd0, 0xf1, 0x7a, 0x30, 0x4b, 0xd6, 0x3b, 0x66, 0x77, 0x1d, 0x70, 0x11, 0x97, + 0x56, 0xea, 0xb1, 0xaa, 0x54, 0x55, 0xad, 0xda, 0x73, 0x5b, 0x89, 0x4b, 0x4f, 0x55, 0x8f, 0xfd, + 0x73, 0x42, 0xea, 0x05, 0xa9, 0x97, 0x9e, 0x68, 0x05, 0x95, 0xb8, 0x73, 0xe8, 0xb9, 0xda, 0x99, + 0xd9, 0xf5, 0xae, 0x13, 0xff, 0x25, 0xad, 0x7a, 0xf2, 0xce, 0xcc, 0xf7, 0xe7, 0xf7, 0xfb, 0xbe, + 0x99, 0x6f, 0xbe, 0x31, 0x1c, 0x5c, 0x6b, 0x58, 0x06, 0xb1, 0xcd, 0x77, 0xa8, 0xe6, 0xd0, 0xaa, + 0xe9, 0x7a, 0x4e, 0x53, 0x5b, 0x9b, 0x2b, 0x53, 0x8f, 0xcc, 0x69, 0xb7, 0x1a, 0xd4, 0x69, 0x16, + 0xeb, 0x0e, 0xf3, 0x18, 0x56, 0x42, 0xb9, 0x62, 0x20, 0x57, 0x94, 0x72, 0xca, 0x4c, 0x17, 0x1b, + 0xa1, 0x30, 0x37, 0xa3, 0xec, 0xa9, 0x32, 0x56, 0xb5, 0xa8, 0x46, 0xea, 0xa6, 0x46, 0x6c, 0x9b, + 0x79, 0xc4, 0x33, 0x99, 0xed, 0xca, 0xd5, 0x59, 0x83, 0xb9, 0x35, 0xe6, 0x6a, 0x65, 0xe2, 0x52, + 0xe1, 0x3d, 0xb4, 0x53, 0x27, 0x55, 0xd3, 0xe6, 0xc2, 0x52, 0x76, 0xb2, 0xca, 0xaa, 0x8c, 0x7f, + 0x6a, 0xfe, 0x97, 0x9c, 0xcd, 0x45, 0x2d, 0x04, 0xba, 0x06, 0x33, 0xa5, 0x96, 0x3a, 0x09, 0x78, + 0xc5, 0xb7, 0x7b, 0x99, 0x38, 0xa4, 0xe6, 0xea, 0xf4, 0x56, 0x83, 0xba, 0x9e, 0xba, 0x02, 0xff, + 0x89, 0xcd, 0xba, 0x75, 0x66, 0xbb, 0x14, 0x9f, 0x84, 0x4c, 0x9d, 0xcf, 0x64, 0xd1, 0x34, 0xca, + 0x8f, 0xcf, 0xab, 0xc5, 0xce, 0x41, 0x28, 0x4a, 0x5d, 0xa9, 0xa1, 0xfe, 0x31, 0x0a, 0x3b, 0xb9, + 0xcd, 0x8b, 0xa6, 0xeb, 0xe9, 0xd4, 0x60, 0x4e, 0x25, 0x70, 0x87, 0x09, 0x00, 0xf1, 0x3c, 0xc7, + 0x2c, 0x37, 0x3c, 0xea, 0xdb, 0x4e, 0xe5, 0xc7, 0xe7, 0x17, 0xbb, 0xd9, 0xee, 0x60, 0xa8, 0xf8, + 0x0a, 0x6d, 0x5e, 0x25, 0x56, 0x83, 0x5e, 0xb0, 0xeb, 0x0d, 0x4f, 0x8f, 0x18, 0xc5, 0xff, 0x86, + 0x14, 0xb1, 0xac, 0x6c, 0x72, 0x1a, 0xe5, 0xb7, 0xe8, 0xfe, 0x27, 0x3e, 0x0f, 0xd0, 0x8a, 0x61, + 0x36, 0xc5, 0x09, 0x1d, 0x2c, 0x8a, 0x70, 0x15, 0xfd, 0x70, 0x15, 0x45, 0xba, 0x5b, 0x7c, 0xaa, + 0x54, 0xfa, 0xd1, 0x23, 0x9a, 0xca, 0x6e, 0x18, 0xbb, 0x68, 0xda, 0xab, 0xdc, 0x25, 0x9e, 0x80, + 0xa4, 0x59, 0xe1, 0xd1, 0x19, 0xd3, 0x93, 0x66, 0x45, 0xa9, 0x00, 0x2c, 0x3a, 0x0e, 0x69, 0x8a, + 0xd5, 0xab, 0x90, 0x59, 0xf3, 0xe1, 0x05, 0x1c, 0x5f, 0x1a, 0x86, 0x63, 0x84, 0xa0, 0xb4, 0xa6, + 0x3c, 0x45, 0xb0, 0xe5, 0x12, 0xa9, 0x0b, 0x27, 0x6f, 0xb7, 0x39, 0x59, 0x1e, 0xc6, 0x49, 0x60, + 0x4d, 0x78, 0x73, 0xcf, 0xd9, 0x9e, 0xd3, 0x0c, 0xdd, 0x35, 0x61, 0x3c, 0x32, 0xed, 0x87, 0x76, + 0x95, 0x36, 0x25, 0x69, 0xff, 0x13, 0x5f, 0x81, 0x34, 0x17, 0xe5, 0xe1, 0x7e, 0x7e, 0x9a, 0xc2, + 0xd8, 0xc9, 0xe4, 0x09, 0xa4, 0x7c, 0x9b, 0x04, 0x68, 0xad, 0xe0, 0x2c, 0x64, 0x5c, 0xcf, 0x31, + 0xed, 0xaa, 0xf0, 0xbe, 0x9c, 0xd0, 0xe5, 0x18, 0x63, 0x48, 0x99, 0xb6, 0xc7, 0x01, 0xa4, 0x96, + 0x13, 0xba, 0x3f, 0xc0, 0x3b, 0x20, 0x7d, 0xdd, 0x62, 0xc4, 0xe3, 0xc9, 0x46, 0xcb, 0x09, 0x5d, + 0x0c, 0xb1, 0x02, 0xa3, 0x65, 0xc6, 0x2c, 0x4a, 0xec, 0xec, 0x88, 0xbf, 0x3f, 0x96, 0x13, 0x7a, + 0x30, 0x81, 0x27, 0x61, 0xc4, 0x32, 0xed, 0xd5, 0x6c, 0x5a, 0xda, 0xe7, 0x23, 0x7c, 0x15, 0xd2, + 0xc4, 0x4f, 0x6b, 0x36, 0x33, 0x3c, 0xc1, 0xd6, 0xbe, 0xf0, 0x91, 0x70, 0x73, 0xf8, 0x32, 0xa4, + 0x6a, 0xa4, 0x9e, 0x1d, 0xe5, 0x56, 0x4f, 0x3f, 0x4f, 0xe2, 0x7c, 0xce, 0x35, 0x52, 0x2f, 0x8d, + 0xca, 0x54, 0x28, 0xb7, 0x61, 0x6b, 0xec, 0x74, 0xfc, 0x5d, 0x69, 0x53, 0xbf, 0x42, 0x90, 0x5d, + 0x2f, 0x2d, 0x2b, 0x4a, 0x09, 0x46, 0x1d, 0x31, 0x25, 0x77, 0x6b, 0xd7, 0x92, 0x22, 0xb4, 0x4b, + 0x23, 0x0f, 0x1e, 0x4d, 0x25, 0xf4, 0x40, 0x11, 0x2f, 0xc5, 0x0e, 0xb2, 0xc0, 0x7e, 0xa8, 0xe7, + 0x41, 0x16, 0x00, 0xa2, 0x27, 0x59, 0xcd, 0xc3, 0x0e, 0x0e, 0x54, 0xba, 0x69, 0x5e, 0x78, 0x39, + 0x28, 0x50, 0x6d, 0xc7, 0x5a, 0x7d, 0x4b, 0xd6, 0xb2, 0xa8, 0xa4, 0x64, 0x74, 0x06, 0x32, 0x02, + 0x58, 0x3f, 0x35, 0x32, 0x46, 0x48, 0xea, 0xa9, 0x1e, 0x28, 0x31, 0xe3, 0x25, 0x66, 0x57, 0x3a, + 0x42, 0x69, 0x2b, 0x63, 0xc9, 0x61, 0xcb, 0x98, 0x7a, 0x1f, 0xc1, 0xee, 0x0d, 0xdd, 0xfe, 0x13, + 0x33, 0xb5, 0x17, 0xa6, 0x96, 0xa8, 0xa7, 0x4b, 0xaf, 0x97, 0x58, 0xa5, 0x61, 0xd1, 0x12, 0xb1, + 0x88, 0x6d, 0x04, 0xdc, 0xd4, 0x9b, 0x30, 0xdd, 0x59, 0x44, 0x72, 0x3a, 0x0f, 0x5b, 0xca, 0x62, + 0x2a, 0x20, 0x35, 0xdb, 0x8d, 0xd4, 0xa2, 0x61, 0xb0, 0x86, 0xed, 0x05, 0x56, 0x42, 0x5d, 0xf5, + 0x29, 0x82, 0x89, 0xf8, 0x22, 0xbe, 0x08, 0xff, 0x22, 0x62, 0xe6, 0x9a, 0x4d, 0x6a, 0x54, 0x24, + 0xac, 0x34, 0xf3, 0xec, 0xd1, 0xd4, 0x81, 0x9b, 0x2e, 0xb3, 0x4f, 0xaa, 0x72, 0xf5, 0x55, 0x52, + 0xa3, 0xea, 0x74, 0x93, 0xd4, 0xac, 0xf8, 0x94, 0x3e, 0x1e, 0x19, 0xe1, 0xf7, 0x11, 0x8c, 0x4a, + 0x6f, 0xd9, 0x14, 0x07, 0xba, 0x2b, 0x16, 0xb6, 0x00, 0xe1, 0x59, 0x66, 0xda, 0xa5, 0x15, 0x3f, + 0xe8, 0xcf, 0x1e, 0x4d, 0xfd, 0x57, 0x38, 0x92, 0x7a, 0x81, 0x93, 0x60, 0x78, 0xff, 0xd7, 0xa9, + 0x7c, 0xd5, 0xf4, 0x6e, 0x34, 0xca, 0x45, 0x83, 0xd5, 0x34, 0xd9, 0x26, 0x88, 0x9f, 0x82, 0x5b, + 0x59, 0xd5, 0xbc, 0x66, 0x9d, 0xba, 0xdc, 0xa2, 0xab, 0x07, 0xce, 0x55, 0x2a, 0x37, 0x89, 0x7f, + 0x96, 0x7d, 0x64, 0x6d, 0x17, 0x79, 0x7c, 0x33, 0xa2, 0xe7, 0xd9, 0x8c, 0x7b, 0x36, 0xf6, 0x23, + 0x33, 0xb7, 0x08, 0x69, 0x3f, 0xac, 0x41, 0xda, 0x0e, 0x74, 0x4b, 0x9b, 0xaf, 0xcf, 0x6f, 0x2a, + 0xb9, 0x1d, 0x85, 0xe6, 0xe6, 0x6d, 0xc6, 0x43, 0xb0, 0x9d, 0x63, 0x7d, 0xe3, 0x06, 0x33, 0xc3, + 0x48, 0x60, 0x18, 0x69, 0xe5, 0x5d, 0xe7, 0xdf, 0xea, 0x67, 0x48, 0x36, 0x5b, 0x52, 0x52, 0x72, + 0x79, 0x0f, 0xc1, 0x84, 0xbf, 0x7e, 0x8d, 0x34, 0xbc, 0x1b, 0xcc, 0x31, 0xbd, 0xa6, 0x8c, 0xdc, + 0x4c, 0x2f, 0x56, 0x8b, 0x81, 0x42, 0x69, 0x4e, 0xe6, 0x7c, 0x46, 0xe4, 0xdc, 0x8e, 0x2e, 0x06, + 0x99, 0x8f, 0x4f, 0xea, 0x5b, 0xe3, 0x63, 0x15, 0x26, 0x44, 0xc4, 0x19, 0x5b, 0x6d, 0xd4, 0xcf, + 0x3a, 0xb6, 0x7f, 0x41, 0x18, 0x8e, 0x1d, 0x5c, 0x10, 0x86, 0x63, 0xab, 0x57, 0x64, 0x81, 0x0c, + 0x65, 0x22, 0x9d, 0x61, 0x8b, 0xae, 0x9f, 0xf2, 0x1e, 0xc0, 0x45, 0x3a, 0x65, 0x58, 0xf6, 0xc1, + 0x36, 0x59, 0x78, 0x5c, 0x66, 0xad, 0xd1, 0x8d, 0x5d, 0xbf, 0x1e, 0x56, 0xdc, 0x40, 0x28, 0xda, + 0x95, 0x0e, 0x5a, 0x71, 0xc3, 0x5a, 0x6b, 0xc0, 0x2e, 0x6e, 0x96, 0x97, 0x0a, 0x7f, 0xe6, 0xdc, + 0x9d, 0xba, 0xe9, 0x34, 0x57, 0x1a, 0xb4, 0x41, 0x37, 0x6d, 0x37, 0x7f, 0x83, 0x60, 0x6f, 0x47, + 0x2f, 0x21, 0x8d, 0xa5, 0xf6, 0x02, 0x5b, 0xe8, 0xc6, 0x23, 0x66, 0x81, 0x53, 0xda, 0xfc, 0x2a, + 0xfb, 0x02, 0x6c, 0x5f, 0xe7, 0x66, 0xdd, 0xfd, 0x33, 0xd9, 0x6a, 0x1a, 0x52, 0xf9, 0xb1, 0xe0, + 0xd2, 0xbf, 0x2e, 0xcf, 0xef, 0x12, 0xf5, 0xc2, 0x2d, 0xf6, 0x57, 0x84, 0xf6, 0x7b, 0x04, 0xfb, + 0xbb, 0x39, 0x0a, 0xa3, 0xfb, 0x1a, 0x8c, 0x07, 0xc7, 0xcb, 0xa4, 0x43, 0x46, 0x38, 0x6a, 0x61, + 0xd3, 0xa2, 0x3c, 0xff, 0xc1, 0x36, 0x48, 0x73, 0x0a, 0xf8, 0x63, 0x04, 0x19, 0xf1, 0x6a, 0xc2, + 0xc5, 0x9e, 0xbd, 0x57, 0xec, 0xc1, 0xa6, 0x68, 0x7d, 0xcb, 0x0b, 0x04, 0xea, 0xec, 0xbb, 0x3f, + 0xff, 0xfe, 0x51, 0x72, 0x3f, 0x56, 0xb5, 0x2e, 0x6f, 0x55, 0xf1, 0x74, 0xc3, 0x5f, 0x20, 0x18, + 0x8f, 0x34, 0x6f, 0x78, 0x61, 0x88, 0xc6, 0x50, 0x39, 0x3a, 0x98, 0x92, 0x84, 0x79, 0x98, 0xc3, + 0x3c, 0x80, 0xf7, 0x69, 0x5d, 0x9f, 0xd4, 0x02, 0xd7, 0x97, 0x08, 0xc6, 0xc2, 0x23, 0x86, 0xe7, + 0x7b, 0x3a, 0x5c, 0xd7, 0xe7, 0x29, 0x0b, 0x03, 0xe9, 0x48, 0x8c, 0xff, 0xe3, 0x18, 0x67, 0x71, + 0xbe, 0x0f, 0x8c, 0xda, 0x5d, 0xb3, 0x72, 0x0f, 0xff, 0x80, 0x60, 0x7b, 0x08, 0x34, 0xe8, 0xb4, + 0xf0, 0xff, 0xfb, 0x76, 0x1e, 0xeb, 0x08, 0x95, 0xe3, 0x03, 0xeb, 0x49, 0xe0, 0xa7, 0x38, 0xf0, + 0x63, 0x78, 0xa1, 0x0f, 0xe0, 0x85, 0x72, 0xb3, 0x50, 0x66, 0x76, 0xa5, 0x60, 0x56, 0x04, 0x87, + 0x1f, 0x11, 0x64, 0x3b, 0x35, 0x58, 0xf8, 0x54, 0x37, 0x48, 0x3d, 0x3a, 0x37, 0xe5, 0xf4, 0x70, + 0xca, 0x83, 0xec, 0x18, 0xd9, 0xce, 0xe0, 0xaf, 0x11, 0x6c, 0x6b, 0x6b, 0x31, 0xf0, 0xf1, 0xbe, + 0x36, 0xea, 0xfa, 0xe6, 0x47, 0x39, 0x31, 0xb8, 0xa2, 0xc4, 0x3c, 0xc3, 0x31, 0xef, 0xc3, 0x7b, + 0xbb, 0x61, 0x16, 0x5d, 0xcb, 0xa7, 0x08, 0xd2, 0xbc, 0x7d, 0xc0, 0x85, 0x9e, 0xee, 0xa2, 0x0d, + 0x89, 0x52, 0xec, 0x57, 0x7c, 0x90, 0x5d, 0x7d, 0xdb, 0x57, 0xd1, 0xee, 0xfa, 0xd0, 0xee, 0xe1, + 0x4f, 0x10, 0x8c, 0xb5, 0xba, 0x87, 0xd9, 0xde, 0xd1, 0x08, 0x64, 0x95, 0xf9, 0xfe, 0x65, 0x07, + 0x2b, 0x60, 0x16, 0x57, 0xc3, 0x9f, 0x23, 0x80, 0x48, 0x77, 0x71, 0xb8, 0x8f, 0x03, 0x13, 0x08, + 0xf7, 0x55, 0x12, 0xda, 0x5b, 0x92, 0x7e, 0xcb, 0x16, 0xd7, 0xc3, 0xdf, 0x21, 0x98, 0xdc, 0xb0, + 0xff, 0x38, 0xd6, 0xd3, 0xf5, 0x46, 0x6a, 0xca, 0x8b, 0x43, 0xa9, 0x85, 0xd8, 0xe7, 0x38, 0xf6, + 0xc3, 0x78, 0xa6, 0x77, 0x55, 0x28, 0x50, 0xae, 0x8f, 0x7f, 0x42, 0xb0, 0xb3, 0xd3, 0x4d, 0x7f, + 0xa2, 0x1f, 0x34, 0x1b, 0x69, 0x2a, 0x67, 0x86, 0xd5, 0x0c, 0xa9, 0x1c, 0xe5, 0x54, 0x8a, 0xf8, + 0x48, 0x37, 0x2a, 0x61, 0xd7, 0x2d, 0xd9, 0x94, 0xce, 0x3f, 0x78, 0x9c, 0x43, 0x0f, 0x1f, 0xe7, + 0xd0, 0x6f, 0x8f, 0x73, 0xe8, 0xc3, 0x27, 0xb9, 0xc4, 0xc3, 0x27, 0xb9, 0xc4, 0x2f, 0x4f, 0x72, + 0x89, 0x37, 0x8f, 0x44, 0x1f, 0x4c, 0xd4, 0x31, 0x0a, 0x26, 0xd3, 0x2c, 0x62, 0x30, 0xdb, 0x34, + 0x2a, 0xda, 0x9d, 0x96, 0x69, 0xfe, 0x74, 0x2a, 0x67, 0xf8, 0x3f, 0xac, 0x0b, 0x7f, 0x06, 0x00, + 0x00, 0xff, 0xff, 0x66, 0xb8, 0xf3, 0x95, 0x52, 0x16, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -2083,7 +2243,7 @@ func (m *QueryListRecordsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } -func (m *QueryListRecordsRequest_ReferenceInput) Marshal() (dAtA []byte, err error) { +func (m *QueryListRecordsRequest_LinkInput) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2093,12 +2253,12 @@ func (m *QueryListRecordsRequest_ReferenceInput) Marshal() (dAtA []byte, err err return dAtA[:n], nil } -func (m *QueryListRecordsRequest_ReferenceInput) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryListRecordsRequest_LinkInput) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryListRecordsRequest_ReferenceInput) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryListRecordsRequest_LinkInput) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -2113,6 +2273,92 @@ func (m *QueryListRecordsRequest_ReferenceInput) MarshalToSizedBuffer(dAtA []byt return len(dAtA) - i, nil } +func (m *QueryListRecordsRequest_ArrayInput) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryListRecordsRequest_ArrayInput) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryListRecordsRequest_ArrayInput) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Values) > 0 { + for iNdEx := len(m.Values) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Values[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryListRecordsRequest_MapInput) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryListRecordsRequest_MapInput) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryListRecordsRequest_MapInput) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Values) > 0 { + for k := range m.Values { + v := m.Values[k] + baseI := i + if v != nil { + { + size, err := v.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintQuery(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintQuery(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + func (m *QueryListRecordsRequest_ValueInput) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -2133,23 +2379,98 @@ func (m *QueryListRecordsRequest_ValueInput) MarshalToSizedBuffer(dAtA []byte) ( _ = i var l int _ = l - if len(m.Values) > 0 { - for iNdEx := len(m.Values) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Values[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) + if m.Value != nil { + { + size := m.Value.Size() + i -= size + if _, err := m.Value.MarshalTo(dAtA[i:]); err != nil { + return 0, err } - i-- - dAtA[i] = 0x3a } } - if m.Reference != nil { + return len(dAtA) - i, nil +} + +func (m *QueryListRecordsRequest_ValueInput_String_) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryListRecordsRequest_ValueInput_String_) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.String_) + copy(dAtA[i:], m.String_) + i = encodeVarintQuery(dAtA, i, uint64(len(m.String_))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} +func (m *QueryListRecordsRequest_ValueInput_Int) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryListRecordsRequest_ValueInput_Int) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i = encodeVarintQuery(dAtA, i, uint64(m.Int)) + i-- + dAtA[i] = 0x10 + return len(dAtA) - i, nil +} +func (m *QueryListRecordsRequest_ValueInput_Float) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryListRecordsRequest_ValueInput_Float) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= 8 + encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.Float)))) + i-- + dAtA[i] = 0x19 + return len(dAtA) - i, nil +} +func (m *QueryListRecordsRequest_ValueInput_Boolean) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryListRecordsRequest_ValueInput_Boolean) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i-- + if m.Boolean { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + return len(dAtA) - i, nil +} +func (m *QueryListRecordsRequest_ValueInput_Link) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryListRecordsRequest_ValueInput_Link) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.Link) + copy(dAtA[i:], m.Link) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Link))) + i-- + dAtA[i] = 0x2a + return len(dAtA) - i, nil +} +func (m *QueryListRecordsRequest_ValueInput_Array) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryListRecordsRequest_ValueInput_Array) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Array != nil { { - size, err := m.Reference.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Array.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -2159,44 +2480,29 @@ func (m *QueryListRecordsRequest_ValueInput) MarshalToSizedBuffer(dAtA []byte) ( i-- dAtA[i] = 0x32 } - if m.Boolean { - i-- - if m.Boolean { - dAtA[i] = 1 - } else { - dAtA[i] = 0 + return len(dAtA) - i, nil +} +func (m *QueryListRecordsRequest_ValueInput_Map) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryListRecordsRequest_ValueInput_Map) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Map != nil { + { + size, err := m.Map.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x28 - } - if m.Float != 0 { - i -= 8 - encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.Float)))) - i-- - dAtA[i] = 0x21 - } - if m.Int != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.Int)) - i-- - dAtA[i] = 0x18 - } - if len(m.String_) > 0 { - i -= len(m.String_) - copy(dAtA[i:], m.String_) - i = encodeVarintQuery(dAtA, i, uint64(len(m.String_))) - i-- - dAtA[i] = 0x12 - } - if len(m.Type) > 0 { - i -= len(m.Type) - copy(dAtA[i:], m.Type) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Type))) - i-- - dAtA[i] = 0xa + dAtA[i] = 0x3a } return len(dAtA) - i, nil } - func (m *QueryListRecordsRequest_KeyValueInput) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -3085,7 +3391,7 @@ func (m *QueryListRecordsRequest) Size() (n int) { return n } -func (m *QueryListRecordsRequest_ReferenceInput) Size() (n int) { +func (m *QueryListRecordsRequest_LinkInput) Size() (n int) { if m == nil { return 0 } @@ -3098,33 +3404,12 @@ func (m *QueryListRecordsRequest_ReferenceInput) Size() (n int) { return n } -func (m *QueryListRecordsRequest_ValueInput) Size() (n int) { +func (m *QueryListRecordsRequest_ArrayInput) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.Type) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.String_) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - if m.Int != 0 { - n += 1 + sovQuery(uint64(m.Int)) - } - if m.Float != 0 { - n += 9 - } - if m.Boolean { - n += 2 - } - if m.Reference != nil { - l = m.Reference.Size() - n += 1 + l + sovQuery(uint64(l)) - } if len(m.Values) > 0 { for _, e := range m.Values { l = e.Size() @@ -3134,6 +3419,111 @@ func (m *QueryListRecordsRequest_ValueInput) Size() (n int) { return n } +func (m *QueryListRecordsRequest_MapInput) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Values) > 0 { + for k, v := range m.Values { + _ = k + _ = v + l = 0 + if v != nil { + l = v.Size() + l += 1 + sovQuery(uint64(l)) + } + mapEntrySize := 1 + len(k) + sovQuery(uint64(len(k))) + l + n += mapEntrySize + 1 + sovQuery(uint64(mapEntrySize)) + } + } + return n +} + +func (m *QueryListRecordsRequest_ValueInput) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Value != nil { + n += m.Value.Size() + } + return n +} + +func (m *QueryListRecordsRequest_ValueInput_String_) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.String_) + n += 1 + l + sovQuery(uint64(l)) + return n +} +func (m *QueryListRecordsRequest_ValueInput_Int) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += 1 + sovQuery(uint64(m.Int)) + return n +} +func (m *QueryListRecordsRequest_ValueInput_Float) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += 9 + return n +} +func (m *QueryListRecordsRequest_ValueInput_Boolean) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += 2 + return n +} +func (m *QueryListRecordsRequest_ValueInput_Link) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Link) + n += 1 + l + sovQuery(uint64(l)) + return n +} +func (m *QueryListRecordsRequest_ValueInput_Array) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Array != nil { + l = m.Array.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} +func (m *QueryListRecordsRequest_ValueInput_Map) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Map != nil { + l = m.Map.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} func (m *QueryListRecordsRequest_KeyValueInput) Size() (n int) { if m == nil { return 0 @@ -3746,7 +4136,7 @@ func (m *QueryListRecordsRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryListRecordsRequest_ReferenceInput) Unmarshal(dAtA []byte) error { +func (m *QueryListRecordsRequest_LinkInput) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3769,10 +4159,10 @@ func (m *QueryListRecordsRequest_ReferenceInput) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ReferenceInput: wiretype end group for non-group") + return fmt.Errorf("proto: LinkInput: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ReferenceInput: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: LinkInput: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -3828,7 +4218,7 @@ func (m *QueryListRecordsRequest_ReferenceInput) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryListRecordsRequest_ValueInput) Unmarshal(dAtA []byte) error { +func (m *QueryListRecordsRequest_ArrayInput) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3851,163 +4241,13 @@ func (m *QueryListRecordsRequest_ValueInput) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ValueInput: wiretype end group for non-group") + return fmt.Errorf("proto: ArrayInput: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ValueInput: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ArrayInput: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Type = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field String_", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.String_ = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Int", wireType) - } - m.Int = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Int |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field Float", wireType) - } - var v uint64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) - iNdEx += 8 - m.Float = float64(math.Float64frombits(v)) - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Boolean", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Boolean = bool(v != 0) - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Reference", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Reference == nil { - m.Reference = &QueryListRecordsRequest_ReferenceInput{} - } - if err := m.Reference.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Values", wireType) } @@ -4062,6 +4302,421 @@ func (m *QueryListRecordsRequest_ValueInput) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryListRecordsRequest_MapInput) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MapInput: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MapInput: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Values", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Values == nil { + m.Values = make(map[string]*QueryListRecordsRequest_ValueInput) + } + var mapkey string + var mapvalue *QueryListRecordsRequest_ValueInput + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthQuery + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthQuery + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthQuery + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthQuery + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &QueryListRecordsRequest_ValueInput{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Values[mapkey] = mapvalue + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryListRecordsRequest_ValueInput) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ValueInput: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ValueInput: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field String_", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Value = &QueryListRecordsRequest_ValueInput_String_{string(dAtA[iNdEx:postIndex])} + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Int", wireType) + } + var v int64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Value = &QueryListRecordsRequest_ValueInput_Int{v} + case 3: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field Float", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + m.Value = &QueryListRecordsRequest_ValueInput_Float{float64(math.Float64frombits(v))} + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Boolean", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + b := bool(v != 0) + m.Value = &QueryListRecordsRequest_ValueInput_Boolean{b} + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Link", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Value = &QueryListRecordsRequest_ValueInput_Link{string(dAtA[iNdEx:postIndex])} + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Array", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &QueryListRecordsRequest_ArrayInput{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Value = &QueryListRecordsRequest_ValueInput_Array{v} + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Map", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &QueryListRecordsRequest_MapInput{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Value = &QueryListRecordsRequest_ValueInput_Map{v} + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *QueryListRecordsRequest_KeyValueInput) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 -- 2.45.2 From 7d43cd3ee4312c369ef0f0a26d7036b97947f838 Mon Sep 17 00:00:00 2001 From: Roy Crihfield Date: Thu, 19 Oct 2023 08:47:21 -0500 Subject: [PATCH 07/10] encoding of query attrs --- x/registry/keeper/grpc_query_test.go | 4 +- x/registry/keeper/keeper.go | 89 +++++++++++++++++++++------- x/registry/types/types.go | 40 +++++++------ 3 files changed, 91 insertions(+), 42 deletions(-) diff --git a/x/registry/keeper/grpc_query_test.go b/x/registry/keeper/grpc_query_test.go index 5edaf647..e51a9326 100644 --- a/x/registry/keeper/grpc_query_test.go +++ b/x/registry/keeper/grpc_query_test.go @@ -129,9 +129,9 @@ func (suite *KeeperTestSuite) TestGrpcGetRecordLists() { recAttr := helpers.UnMarshalMapFromJSONBytes(record.Attributes) for _, attr := range test.req.GetAttributes() { if attr.Key[:4] == "x500" { - sr.Equal(keeper.GetAttributeValue(attr.Value), recAttr["x500"].(map[string]interface{})[attr.Key[4:]]) + sr.Equal(keeper.EncodeAttributeValue(attr.Value), recAttr["x500"].(map[string]interface{})[attr.Key[4:]]) } else { - sr.Equal(keeper.GetAttributeValue(attr.Value), recAttr[attr.Key]) + sr.Equal(keeper.EncodeAttributeValue(attr.Value), recAttr[attr.Key]) } } } diff --git a/x/registry/keeper/keeper.go b/x/registry/keeper/keeper.go index a96f31a8..da0cca85 100644 --- a/x/registry/keeper/keeper.go +++ b/x/registry/keeper/keeper.go @@ -22,7 +22,10 @@ import ( paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" "github.com/tendermint/tendermint/libs/log" + cid "github.com/ipfs/go-cid" + "github.com/ipld/go-ipld-prime" "github.com/ipld/go-ipld-prime/codec/dagjson" + cidlink "github.com/ipld/go-ipld-prime/linking/cid" basicnode "github.com/ipld/go-ipld-prime/node/basic" ) @@ -147,10 +150,20 @@ func (k Keeper) ListRecords(ctx sdk.Context) []types.Record { // RecordsFromAttributes gets a list of records whose attributes match all provided values func (k Keeper) RecordsFromAttributes(ctx sdk.Context, attributes []*types.QueryListRecordsRequest_KeyValueInput, all bool) ([]types.Record, error) { + log := logger(ctx).With("function", "RecordsFromAttributes") + resultRecordIds := []string{} for i, attr := range attributes { - val := GetAttributeValue(attr.Value) + val, err := EncodeAttributeValue2(attr.Value) + if err != nil { + return nil, err + } attributeIndex := GetAttributesIndexKey(attr.Key, val) + log.Debug("attribute index", + "key", attr.Key, + "value", val, + "value_type", fmt.Sprintf("%T", val), + "index", attributeIndex) recordIds, err := k.GetAttributeMapping(ctx, attributeIndex) if err != nil { return nil, err @@ -178,27 +191,38 @@ func (k Keeper) RecordsFromAttributes(ctx sdk.Context, attributes []*types.Query return records, nil } -func GetAttributeValue(input *types.QueryListRecordsRequest_ValueInput) interface{} { +// TODO non recursive +func EncodeAttributeValue2(input *types.QueryListRecordsRequest_ValueInput) ([]byte, error) { + np := basicnode.Prototype.Any + nb := np.NewBuilder() + switch value := input.GetValue().(type) { case *types.QueryListRecordsRequest_ValueInput_String_: - return value.String_ + nb.AssignString(value.String_) case *types.QueryListRecordsRequest_ValueInput_Int: - return value.Int + nb.AssignInt(value.Int) case *types.QueryListRecordsRequest_ValueInput_Float: - return value.Float + nb.AssignFloat(value.Float) case *types.QueryListRecordsRequest_ValueInput_Boolean: - return value.Boolean + nb.AssignBool(value.Boolean) case *types.QueryListRecordsRequest_ValueInput_Link: - return value.Link + link := cidlink.Link{Cid: cid.MustParse(value.Link)} + nb.AssignLink(link) case *types.QueryListRecordsRequest_ValueInput_Array: - return value.Array + // TODO case *types.QueryListRecordsRequest_ValueInput_Map: - return value.Map - case nil: - return nil + // TODO default: - return fmt.Errorf("Value has unepxpected type %T", value) + return nil, fmt.Errorf("Value has unepxpected type %T", value) } + + n := nb.Build() + var buf bytes.Buffer + if err := dagjson.Encode(n, &buf); err != nil { + return nil, err + } + value := buf.Bytes() + return value, nil } func getIntersection(a []string, b []string) []string { @@ -251,7 +275,7 @@ func (k Keeper) GetRecordExpiryQueue(ctx sdk.Context) []*types.ExpiryQueueRecord // ProcessSetRecord creates a record. func (k Keeper) ProcessSetRecord(ctx sdk.Context, msg types.MsgSetRecord) (*types.RecordEncodable, error) { payload := msg.Payload.ToReadablePayload() - record := types.RecordEncodable{Attributes: payload.Record, BondID: msg.BondId} + record := types.RecordEncodable{Attributes: payload.RecordAttributes, BondID: msg.BondId} // Check signatures. resourceSignBytes, _ := record.GetSignBytes() @@ -342,19 +366,40 @@ func (k Keeper) PutRecord(ctx sdk.Context, record types.Record) { k.updateBlockChangeSetForRecord(ctx, record.Id) } -func (k Keeper) processAttributes(ctx sdk.Context, attrs map[string]any, id string, prefix string) error { - np := basicnode.Prototype.Any // Pick a stle for the in-memory data. - nb := np.NewBuilder() // Create a builder. - err := dagjson.Decode(nb, bytes.NewReader(content)) // Hand the builder to decoding -- decoding will fill it in! +func (k Keeper) processAttributes(ctx sdk.Context, attrs []byte, id string, prefix string) error { + np := basicnode.Prototype.Map + nb := np.NewBuilder() + err := dagjson.Decode(nb, bytes.NewReader(attrs)) if err != nil { - return "", err + return err } - n := nb.Build() // Call 'Build' to get the resulting Node. (It's immutable!) + n := nb.Build() + if n.Kind() != ipld.Kind_Map { + return fmt.Errorf("Record attributes must be a map, not %T", n.Kind()) + } + return k.processAttributeMap(ctx, n, id, prefix) +} - for key, value := range attrs { - if subRecord, ok := value.(map[string]any); ok { - k.processAttributes(ctx, subRecord, id, key) +func (k Keeper) processAttributeMap(ctx sdk.Context, n ipld.Node, id string, prefix string) error { + for it := n.MapIterator(); !it.Done(); { + keynode, valuenode, err := it.Next() + if err != nil { + return err + } + key, err := keynode.AsString() + if err != nil { + return err + } + + // for key, value := range attrs { + if valuenode.Kind() == ipld.Kind_Map { + k.processAttributeMap(ctx, valuenode, id, key) } else { + var buf bytes.Buffer + if err := dagjson.Encode(valuenode, &buf); err != nil { + return err + } + value := buf.Bytes() indexKey := GetAttributesIndexKey(prefix+key, value) if err := k.SetAttributeMapping(ctx, indexKey, id); err != nil { return err diff --git a/x/registry/types/types.go b/x/registry/types/types.go index 6bd466b5..2c7d5bb4 100644 --- a/x/registry/types/types.go +++ b/x/registry/types/types.go @@ -17,17 +17,23 @@ const ( // become specific to content records. schema records will either occupy a new message or have new // more general purpose helper types. +type DagJsonBlob []byte + +func (b DagJsonBlob) MarshalJSON() ([]byte, error) { + return b, nil +} + // PayloadEncodable represents a signed record payload that can be serialized from/to YAML. type PayloadEncodable struct { - Record map[string]interface{} `json:"record"` - Signatures []Signature `json:"signatures"` + RecordAttributes DagJsonBlob `json:"record"` + Signatures []Signature `json:"signatures"` } // ToPayload converts PayloadEncodable to Payload object. // Why? Because go-amino can't handle maps: https://github.com/tendermint/go-amino/issues/4. func (payloadObj *PayloadEncodable) ToPayload() Payload { // Note: record directly contains the attributes here - attributes := helpers.MarshalMapToJSONBytes(payloadObj.Record) + attributes := payloadObj.RecordAttributes payload := Payload{ Record: &Record{ Deleted: false, @@ -36,7 +42,6 @@ func (payloadObj *PayloadEncodable) ToPayload() Payload { }, Signatures: payloadObj.Signatures, } - // TODO rm error return payload } @@ -44,7 +49,7 @@ func (payloadObj *PayloadEncodable) ToPayload() Payload { func (payload Payload) ToReadablePayload() PayloadEncodable { var encodable PayloadEncodable - encodable.Record = helpers.UnMarshalMapFromJSONBytes(payload.Record.Attributes) + encodable.RecordAttributes = payload.Record.Attributes encodable.Signatures = payload.Signatures return encodable @@ -61,28 +66,27 @@ func (r *Record) ToReadableRecord() RecordEncodable { resourceObj.Deleted = r.Deleted resourceObj.Owners = r.Owners resourceObj.Names = r.Names - resourceObj.Attributes = helpers.UnMarshalMapFromJSONBytes(r.Attributes) + resourceObj.Attributes = r.Attributes return resourceObj } // RecordEncodable represents a WNS record. type RecordEncodable struct { - ID string `json:"id,omitempty"` - Names []string `json:"names,omitempty"` - BondID string `json:"bondId,omitempty"` - CreateTime string `json:"createTime,omitempty"` - ExpiryTime string `json:"expiryTime,omitempty"` - Deleted bool `json:"deleted,omitempty"` - Owners []string `json:"owners,omitempty"` - Attributes map[string]interface{} `json:"attributes,omitempty"` + ID string `json:"id,omitempty"` + Names []string `json:"names,omitempty"` + BondID string `json:"bondId,omitempty"` + CreateTime string `json:"createTime,omitempty"` + ExpiryTime string `json:"expiryTime,omitempty"` + Deleted bool `json:"deleted,omitempty"` + Owners []string `json:"owners,omitempty"` + // Attributes map[string]interface{} `json:"attributes,omitempty"` + Attributes DagJsonBlob `json:"attributes,omitempty"` } // ToRecordObj converts Record to RecordObj. // Why? Because go-amino can't handle maps: https://github.com/tendermint/go-amino/issues/4. func (r *RecordEncodable) ToRecordObj() (Record, error) { - attributes := helpers.MarshalMapToJSONBytes(r.Attributes) - var resourceObj Record resourceObj.Id = r.ID @@ -91,7 +95,7 @@ func (r *RecordEncodable) ToRecordObj() (Record, error) { resourceObj.ExpiryTime = r.ExpiryTime resourceObj.Deleted = r.Deleted resourceObj.Owners = r.Owners - resourceObj.Attributes = attributes + resourceObj.Attributes = r.Attributes return resourceObj, nil } @@ -100,7 +104,7 @@ func (r *RecordEncodable) ToRecordObj() (Record, error) { func (r *RecordEncodable) CanonicalJSON() []byte { bytes, err := canonicalJson.Marshal(r.Attributes) if err != nil { - panic("Record marshal error.") + panic("Record marshal error: " + err.Error()) } return bytes -- 2.45.2 From 21aa925758a3f0f9584ced63f72a756320f95083 Mon Sep 17 00:00:00 2001 From: Roy Crihfield Date: Thu, 19 Oct 2023 09:13:47 -0500 Subject: [PATCH 08/10] clean up --- x/registry/keeper/keeper.go | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/x/registry/keeper/keeper.go b/x/registry/keeper/keeper.go index da0cca85..645a9820 100644 --- a/x/registry/keeper/keeper.go +++ b/x/registry/keeper/keeper.go @@ -150,20 +150,13 @@ func (k Keeper) ListRecords(ctx sdk.Context) []types.Record { // RecordsFromAttributes gets a list of records whose attributes match all provided values func (k Keeper) RecordsFromAttributes(ctx sdk.Context, attributes []*types.QueryListRecordsRequest_KeyValueInput, all bool) ([]types.Record, error) { - log := logger(ctx).With("function", "RecordsFromAttributes") - resultRecordIds := []string{} for i, attr := range attributes { - val, err := EncodeAttributeValue2(attr.Value) + suffix, err := EncodeQueryValue(attr.Value) if err != nil { return nil, err } - attributeIndex := GetAttributesIndexKey(attr.Key, val) - log.Debug("attribute index", - "key", attr.Key, - "value", val, - "value_type", fmt.Sprintf("%T", val), - "index", attributeIndex) + attributeIndex := GetAttributesIndexKey(attr.Key, suffix) recordIds, err := k.GetAttributeMapping(ctx, attributeIndex) if err != nil { return nil, err @@ -191,8 +184,8 @@ func (k Keeper) RecordsFromAttributes(ctx sdk.Context, attributes []*types.Query return records, nil } -// TODO non recursive -func EncodeAttributeValue2(input *types.QueryListRecordsRequest_ValueInput) ([]byte, error) { +// TODO not recursive, and only should be if we want to support querying with whole sub-objects +func EncodeQueryValue(input *types.QueryListRecordsRequest_ValueInput) ([]byte, error) { np := basicnode.Prototype.Any nb := np.NewBuilder() @@ -344,7 +337,7 @@ func (k Keeper) processRecord(ctx sdk.Context, record *types.RecordEncodable, is return err } - expiryTimeKey := GetAttributesIndexKey(ExpiryTimeAttributeName, record.ExpiryTime) + expiryTimeKey := GetAttributesIndexKey(ExpiryTimeAttributeName, []byte(record.ExpiryTime)) if err := k.SetAttributeMapping(ctx, expiryTimeKey, record.ID); err != nil { return err } @@ -391,7 +384,6 @@ func (k Keeper) processAttributeMap(ctx sdk.Context, n ipld.Node, id string, pre return err } - // for key, value := range attrs { if valuenode.Kind() == ipld.Kind_Map { k.processAttributeMap(ctx, valuenode, id, key) } else { @@ -409,9 +401,10 @@ func (k Keeper) processAttributeMap(ctx sdk.Context, n ipld.Node, id string, pre return nil } -func GetAttributesIndexKey(key string, value interface{}) []byte { - keyString := fmt.Sprintf("%s%s", key, value) +func GetAttributesIndexKey(key string, suffix []byte) []byte { + keyString := fmt.Sprintf("%s%s", key, suffix) return append(PrefixAttributesIndex, []byte(keyString)...) + // return append(append(PrefixAttributesIndex, key...), suffix...) } func (k Keeper) SetAttributeMapping(ctx sdk.Context, key []byte, recordID string) error { -- 2.45.2 From d64e80f963ef2db234c3efd83cd6b14725904b5d Mon Sep 17 00:00:00 2001 From: Roy Crihfield Date: Thu, 26 Oct 2023 08:45:08 -0500 Subject: [PATCH 09/10] clean up --- x/registry/helpers/helpers.go | 14 ++--- x/registry/keeper/grpc_query_test.go | 10 ++-- x/registry/keeper/keeper.go | 50 ++++++++++-------- x/registry/types/types.go | 79 +++++++++++++--------------- 4 files changed, 77 insertions(+), 76 deletions(-) diff --git a/x/registry/helpers/helpers.go b/x/registry/helpers/helpers.go index 07041252..3d993f80 100644 --- a/x/registry/helpers/helpers.go +++ b/x/registry/helpers/helpers.go @@ -47,24 +47,20 @@ func Int64ToBytes(num int64) []byte { return buf.Bytes() } -// MarshalMapToJSONBytes converts map[string]interface{} to bytes. -func MarshalMapToJSONBytes(val map[string]interface{}) (bytes []byte) { +func MustMarshalJSON[T any](val T) (bytes []byte) { bytes, err := json.Marshal(val) if err != nil { - panic("Marshal error.") + panic("JSON marshal error:" + err.Error()) } - return } -// UnMarshalMapFromJSONBytes converts bytes to map[string]interface{}. -func UnMarshalMapFromJSONBytes(bytes []byte) map[string]interface{} { - var val map[string]interface{} +func MustUnmarshalJSON[T any](bytes []byte) T { + var val T err := json.Unmarshal(bytes, &val) if err != nil { - panic("Unmarshal error.") + panic("JSON unmarshal error:" + err.Error()) } - return val } diff --git a/x/registry/keeper/grpc_query_test.go b/x/registry/keeper/grpc_query_test.go index e51a9326..ca48f179 100644 --- a/x/registry/keeper/grpc_query_test.go +++ b/x/registry/keeper/grpc_query_test.go @@ -126,12 +126,16 @@ func (suite *KeeperTestSuite) TestGrpcGetRecordLists() { sr.Equal(resp.GetRecords()[0].GetBondId(), suite.bond.GetId()) for _, record := range resp.GetRecords() { - recAttr := helpers.UnMarshalMapFromJSONBytes(record.Attributes) + recAttr := helpers.MustUnmarshalJSON[registrytypes.AttributeMap](record.Attributes) + for _, attr := range test.req.GetAttributes() { + enc, err := keeper.QueryValueToJSON(attr.Value) + sr.NoError(err) + expected := helpers.MustUnmarshalJSON[any](enc) if attr.Key[:4] == "x500" { - sr.Equal(keeper.EncodeAttributeValue(attr.Value), recAttr["x500"].(map[string]interface{})[attr.Key[4:]]) + sr.Equal(expected, recAttr["x500"].(map[string]interface{})[attr.Key[4:]]) } else { - sr.Equal(keeper.EncodeAttributeValue(attr.Value), recAttr[attr.Key]) + sr.Equal(expected, recAttr[attr.Key]) } } } diff --git a/x/registry/keeper/keeper.go b/x/registry/keeper/keeper.go index 645a9820..4eaac851 100644 --- a/x/registry/keeper/keeper.go +++ b/x/registry/keeper/keeper.go @@ -8,10 +8,6 @@ import ( "time" errorsmod "cosmossdk.io/errors" - auctionkeeper "github.com/cerc-io/laconicd/x/auction/keeper" - bondkeeper "github.com/cerc-io/laconicd/x/bond/keeper" - "github.com/cerc-io/laconicd/x/registry/helpers" - "github.com/cerc-io/laconicd/x/registry/types" "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/legacy" storetypes "github.com/cosmos/cosmos-sdk/store/types" @@ -20,13 +16,18 @@ import ( auth "github.com/cosmos/cosmos-sdk/x/auth/keeper" bank "github.com/cosmos/cosmos-sdk/x/bank/keeper" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - "github.com/tendermint/tendermint/libs/log" - + "github.com/gibson042/canonicaljson-go" cid "github.com/ipfs/go-cid" "github.com/ipld/go-ipld-prime" "github.com/ipld/go-ipld-prime/codec/dagjson" cidlink "github.com/ipld/go-ipld-prime/linking/cid" basicnode "github.com/ipld/go-ipld-prime/node/basic" + "github.com/tendermint/tendermint/libs/log" + + auctionkeeper "github.com/cerc-io/laconicd/x/auction/keeper" + bondkeeper "github.com/cerc-io/laconicd/x/bond/keeper" + "github.com/cerc-io/laconicd/x/registry/helpers" + "github.com/cerc-io/laconicd/x/registry/types" ) var ( @@ -152,7 +153,7 @@ func (k Keeper) ListRecords(ctx sdk.Context) []types.Record { func (k Keeper) RecordsFromAttributes(ctx sdk.Context, attributes []*types.QueryListRecordsRequest_KeyValueInput, all bool) ([]types.Record, error) { resultRecordIds := []string{} for i, attr := range attributes { - suffix, err := EncodeQueryValue(attr.Value) + suffix, err := QueryValueToJSON(attr.Value) if err != nil { return nil, err } @@ -184,8 +185,9 @@ func (k Keeper) RecordsFromAttributes(ctx sdk.Context, attributes []*types.Query return records, nil } -// TODO not recursive, and only should be if we want to support querying with whole sub-objects -func EncodeQueryValue(input *types.QueryListRecordsRequest_ValueInput) ([]byte, error) { +// TODO not recursive, and only should be if we want to support querying with whole sub-objects, +// which seems unnecessary. +func QueryValueToJSON(input *types.QueryListRecordsRequest_ValueInput) ([]byte, error) { np := basicnode.Prototype.Any nb := np.NewBuilder() @@ -202,20 +204,19 @@ func EncodeQueryValue(input *types.QueryListRecordsRequest_ValueInput) ([]byte, link := cidlink.Link{Cid: cid.MustParse(value.Link)} nb.AssignLink(link) case *types.QueryListRecordsRequest_ValueInput_Array: - // TODO + return nil, fmt.Errorf("Recursive query values are not supported") case *types.QueryListRecordsRequest_ValueInput_Map: - // TODO + return nil, fmt.Errorf("Recursive query values are not supported") default: - return nil, fmt.Errorf("Value has unepxpected type %T", value) + return nil, fmt.Errorf("Value has unexpected type %T", value) } n := nb.Build() var buf bytes.Buffer if err := dagjson.Encode(n, &buf); err != nil { - return nil, err + return nil, fmt.Errorf("encoding value to JSON failed: %w", err) } - value := buf.Bytes() - return value, nil + return buf.Bytes(), nil } func getIntersection(a []string, b []string) []string { @@ -288,14 +289,12 @@ func (k Keeper) ProcessSetRecord(ctx sdk.Context, msg types.MsgSetRecord) (*type for _, sig := range payload.Signatures { pubKey, err := legacy.PubKeyFromBytes(helpers.BytesFromBase64(sig.PubKey)) if err != nil { - fmt.Println("Error decoding pubKey from bytes: ", err) - return nil, errorsmod.Wrap(sdkerrors.ErrUnauthorized, "Invalid public key.") + return nil, errorsmod.Wrap(sdkerrors.ErrUnauthorized, fmt.Sprint("Error decoding pubKey from bytes: ", err)) } sigOK := pubKey.VerifySignature(resourceSignBytes, helpers.BytesFromBase64(sig.Sig)) if !sigOK { - fmt.Println("Signature mismatch: ", sig.PubKey) - return nil, errorsmod.Wrap(sdkerrors.ErrUnauthorized, "Invalid signature.") + return nil, errorsmod.Wrap(sdkerrors.ErrUnauthorized, fmt.Sprint("Signature mismatch: ", sig.PubKey)) } record.Owners = append(record.Owners, pubKey.Address().String()) } @@ -359,17 +358,25 @@ func (k Keeper) PutRecord(ctx sdk.Context, record types.Record) { k.updateBlockChangeSetForRecord(ctx, record.Id) } -func (k Keeper) processAttributes(ctx sdk.Context, attrs []byte, id string, prefix string) error { +func (k Keeper) processAttributes(ctx sdk.Context, attrs types.AttributeMap, id string, prefix string) error { np := basicnode.Prototype.Map nb := np.NewBuilder() - err := dagjson.Decode(nb, bytes.NewReader(attrs)) + encAttrs, err := canonicaljson.Marshal(attrs) if err != nil { return err } + if len(attrs) == 0 { + encAttrs = []byte("{}") + } + err = dagjson.Decode(nb, bytes.NewReader(encAttrs)) + if err != nil { + return fmt.Errorf("failed to decode attributes: %w", err) + } n := nb.Build() if n.Kind() != ipld.Kind_Map { return fmt.Errorf("Record attributes must be a map, not %T", n.Kind()) } + return k.processAttributeMap(ctx, n, id, prefix) } @@ -404,7 +411,6 @@ func (k Keeper) processAttributeMap(ctx sdk.Context, n ipld.Node, id string, pre func GetAttributesIndexKey(key string, suffix []byte) []byte { keyString := fmt.Sprintf("%s%s", key, suffix) return append(PrefixAttributesIndex, []byte(keyString)...) - // return append(append(PrefixAttributesIndex, key...), suffix...) } func (k Keeper) SetAttributeMapping(ctx sdk.Context, key []byte, recordID string) error { diff --git a/x/registry/types/types.go b/x/registry/types/types.go index 2c7d5bb4..9bb4fb71 100644 --- a/x/registry/types/types.go +++ b/x/registry/types/types.go @@ -4,7 +4,7 @@ import ( "crypto/sha256" "github.com/cerc-io/laconicd/x/registry/helpers" - canonicalJson "github.com/gibson042/canonicaljson-go" + "github.com/gibson042/canonicaljson-go" ) const ( @@ -17,16 +17,24 @@ const ( // become specific to content records. schema records will either occupy a new message or have new // more general purpose helper types. -type DagJsonBlob []byte - -func (b DagJsonBlob) MarshalJSON() ([]byte, error) { - return b, nil -} +type AttributeMap map[string]interface{} // PayloadEncodable represents a signed record payload that can be serialized from/to YAML. type PayloadEncodable struct { - RecordAttributes DagJsonBlob `json:"record"` - Signatures []Signature `json:"signatures"` + RecordAttributes AttributeMap `json:"record" yaml:"record"` + Signatures []Signature `json:"signatures" yaml:"signatures"` +} + +// RecordEncodable represents a WNS record. +type RecordEncodable struct { + ID string `json:"id,omitempty"` + Names []string `json:"names,omitempty"` + BondID string `json:"bondId,omitempty"` + CreateTime string `json:"createTime,omitempty"` + ExpiryTime string `json:"expiryTime,omitempty"` + Deleted bool `json:"deleted,omitempty"` + Owners []string `json:"owners,omitempty"` + Attributes AttributeMap `json:"attributes,omitempty"` } // ToPayload converts PayloadEncodable to Payload object. @@ -38,7 +46,7 @@ func (payloadObj *PayloadEncodable) ToPayload() Payload { Record: &Record{ Deleted: false, Owners: nil, - Attributes: attributes, + Attributes: helpers.MustMarshalJSON(attributes), }, Signatures: payloadObj.Signatures, } @@ -49,41 +57,12 @@ func (payloadObj *PayloadEncodable) ToPayload() Payload { func (payload Payload) ToReadablePayload() PayloadEncodable { var encodable PayloadEncodable - encodable.RecordAttributes = payload.Record.Attributes + encodable.RecordAttributes = helpers.MustUnmarshalJSON[AttributeMap](payload.Record.Attributes) encodable.Signatures = payload.Signatures return encodable } -// ToReadableRecord converts Record to a serializable object -func (r *Record) ToReadableRecord() RecordEncodable { - var resourceObj RecordEncodable - - resourceObj.ID = r.Id - resourceObj.BondID = r.BondId - resourceObj.CreateTime = r.CreateTime - resourceObj.ExpiryTime = r.ExpiryTime - resourceObj.Deleted = r.Deleted - resourceObj.Owners = r.Owners - resourceObj.Names = r.Names - resourceObj.Attributes = r.Attributes - - return resourceObj -} - -// RecordEncodable represents a WNS record. -type RecordEncodable struct { - ID string `json:"id,omitempty"` - Names []string `json:"names,omitempty"` - BondID string `json:"bondId,omitempty"` - CreateTime string `json:"createTime,omitempty"` - ExpiryTime string `json:"expiryTime,omitempty"` - Deleted bool `json:"deleted,omitempty"` - Owners []string `json:"owners,omitempty"` - // Attributes map[string]interface{} `json:"attributes,omitempty"` - Attributes DagJsonBlob `json:"attributes,omitempty"` -} - // ToRecordObj converts Record to RecordObj. // Why? Because go-amino can't handle maps: https://github.com/tendermint/go-amino/issues/4. func (r *RecordEncodable) ToRecordObj() (Record, error) { @@ -95,16 +74,32 @@ func (r *RecordEncodable) ToRecordObj() (Record, error) { resourceObj.ExpiryTime = r.ExpiryTime resourceObj.Deleted = r.Deleted resourceObj.Owners = r.Owners - resourceObj.Attributes = r.Attributes + resourceObj.Attributes = helpers.MustMarshalJSON(r.Attributes) return resourceObj, nil } +// ToReadableRecord converts Record to a serializable object +func (r *Record) ToReadableRecord() RecordEncodable { + var resourceObj RecordEncodable + + resourceObj.ID = r.Id + resourceObj.BondID = r.BondId + resourceObj.CreateTime = r.CreateTime + resourceObj.ExpiryTime = r.ExpiryTime + resourceObj.Deleted = r.Deleted + resourceObj.Owners = r.Owners + resourceObj.Names = r.Names + resourceObj.Attributes = helpers.MustUnmarshalJSON[AttributeMap](r.Attributes) + + return resourceObj +} + // CanonicalJSON returns the canonical JSON representation of the record. func (r *RecordEncodable) CanonicalJSON() []byte { - bytes, err := canonicalJson.Marshal(r.Attributes) + bytes, err := canonicaljson.Marshal(r.Attributes) if err != nil { - panic("Record marshal error: " + err.Error()) + panic("error marshalling record: " + err.Error()) } return bytes -- 2.45.2 From 596c309e1f9b8d181a413bb923295fdfbc81505e Mon Sep 17 00:00:00 2001 From: Roy Crihfield Date: Thu, 26 Oct 2023 08:46:57 -0500 Subject: [PATCH 10/10] type rename --- x/registry/client/cli/query.go | 2 +- x/registry/client/cli/tx.go | 4 ++-- x/registry/client/testutil/grpc.go | 2 +- x/registry/client/testutil/query.go | 2 +- x/registry/client/testutil/tx.go | 4 ++-- x/registry/keeper/keeper.go | 6 +++--- x/registry/types/types.go | 26 +++++++++++++------------- 7 files changed, 23 insertions(+), 23 deletions(-) diff --git a/x/registry/client/cli/query.go b/x/registry/client/cli/query.go index 462940a6..90d5eecc 100644 --- a/x/registry/client/cli/query.go +++ b/x/registry/client/cli/query.go @@ -161,7 +161,7 @@ $ %s query %s list } recordsList := res.GetRecords() - records := make([]types.RecordEncodable, len(recordsList)) + records := make([]types.ReadableRecord, len(recordsList)) for i, record := range res.GetRecords() { records[i] = record.ToReadableRecord() } diff --git a/x/registry/client/cli/tx.go b/x/registry/client/cli/tx.go index 477fe643..50981772 100644 --- a/x/registry/client/cli/tx.go +++ b/x/registry/client/cli/tx.go @@ -370,8 +370,8 @@ $ %s tx %s delete-name [crn] } // GetPayloadFromFile Load payload object from YAML file. -func GetPayloadFromFile(filePath string) (*types.PayloadEncodable, error) { - var payload types.PayloadEncodable +func GetPayloadFromFile(filePath string) (*types.ReadablePayload, error) { + var payload types.ReadablePayload data, err := os.ReadFile(filePath) // #nosec G304 if err != nil { diff --git a/x/registry/client/testutil/grpc.go b/x/registry/client/testutil/grpc.go index 835927fe..72eaa36f 100644 --- a/x/registry/client/testutil/grpc.go +++ b/x/registry/client/testutil/grpc.go @@ -433,7 +433,7 @@ func (s *IntegrationTestSuite) TestGRPCQueryGetRecordByID() { } out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, args) sr.NoError(err) - var records []nstypes.RecordEncodable + var records []nstypes.ReadableRecord err = json.Unmarshal(out.Bytes(), &records) sr.NoError(err) return records[0].ID diff --git a/x/registry/client/testutil/query.go b/x/registry/client/testutil/query.go index 9aaeab18..e0a433ff 100644 --- a/x/registry/client/testutil/query.go +++ b/x/registry/client/testutil/query.go @@ -114,7 +114,7 @@ func (s *IntegrationTestSuite) TestGetCmdQueryForRecords() { sr.Error(err) } else { sr.NoError(err) - var records []types.RecordEncodable + var records []types.ReadableRecord err := json.Unmarshal(out.Bytes(), &records) sr.NoError(err) sr.Equal(tc.noOfRecords, len(records)) diff --git a/x/registry/client/testutil/tx.go b/x/registry/client/testutil/tx.go index b85634ab..f7e2bea0 100644 --- a/x/registry/client/testutil/tx.go +++ b/x/registry/client/testutil/tx.go @@ -606,7 +606,7 @@ func (s *IntegrationTestSuite) TestGetCmdDissociateBond() { cmd = cli.GetCmdList() out, err = clitestutil.ExecTestCLICmd(clientCtx, cmd, args) sr.NoError(err) - var records []nstypes.RecordEncodable + var records []nstypes.ReadableRecord err = json.Unmarshal(out.Bytes(), &records) sr.NoError(err) return records[0].ID @@ -848,7 +848,7 @@ func (s *IntegrationTestSuite) TestGetCmdAssociateBond() { cmd = cli.GetCmdList() out, err = clitestutil.ExecTestCLICmd(clientCtx, cmd, args) sr.NoError(err) - var records []nstypes.RecordEncodable + var records []nstypes.ReadableRecord err = json.Unmarshal(out.Bytes(), &records) sr.NoError(err) diff --git a/x/registry/keeper/keeper.go b/x/registry/keeper/keeper.go index 4eaac851..aab98ba7 100644 --- a/x/registry/keeper/keeper.go +++ b/x/registry/keeper/keeper.go @@ -267,9 +267,9 @@ func (k Keeper) GetRecordExpiryQueue(ctx sdk.Context) []*types.ExpiryQueueRecord } // ProcessSetRecord creates a record. -func (k Keeper) ProcessSetRecord(ctx sdk.Context, msg types.MsgSetRecord) (*types.RecordEncodable, error) { +func (k Keeper) ProcessSetRecord(ctx sdk.Context, msg types.MsgSetRecord) (*types.ReadableRecord, error) { payload := msg.Payload.ToReadablePayload() - record := types.RecordEncodable{Attributes: payload.RecordAttributes, BondID: msg.BondId} + record := types.ReadableRecord{Attributes: payload.RecordAttributes, BondID: msg.BondId} // Check signatures. resourceSignBytes, _ := record.GetSignBytes() @@ -308,7 +308,7 @@ func (k Keeper) ProcessSetRecord(ctx sdk.Context, msg types.MsgSetRecord) (*type return &record, nil } -func (k Keeper) processRecord(ctx sdk.Context, record *types.RecordEncodable, isRenewal bool) error { +func (k Keeper) processRecord(ctx sdk.Context, record *types.ReadableRecord, isRenewal bool) error { params := k.GetParams(ctx) rent := params.RecordRent diff --git a/x/registry/types/types.go b/x/registry/types/types.go index 9bb4fb71..b14a69f0 100644 --- a/x/registry/types/types.go +++ b/x/registry/types/types.go @@ -19,14 +19,14 @@ const ( type AttributeMap map[string]interface{} -// PayloadEncodable represents a signed record payload that can be serialized from/to YAML. -type PayloadEncodable struct { +// ReadablePayload represents a signed record payload that can be serialized from/to YAML. +type ReadablePayload struct { RecordAttributes AttributeMap `json:"record" yaml:"record"` Signatures []Signature `json:"signatures" yaml:"signatures"` } -// RecordEncodable represents a WNS record. -type RecordEncodable struct { +// ReadableRecord represents a WNS record. +type ReadableRecord struct { ID string `json:"id,omitempty"` Names []string `json:"names,omitempty"` BondID string `json:"bondId,omitempty"` @@ -39,7 +39,7 @@ type RecordEncodable struct { // ToPayload converts PayloadEncodable to Payload object. // Why? Because go-amino can't handle maps: https://github.com/tendermint/go-amino/issues/4. -func (payloadObj *PayloadEncodable) ToPayload() Payload { +func (payloadObj *ReadablePayload) ToPayload() Payload { // Note: record directly contains the attributes here attributes := payloadObj.RecordAttributes payload := Payload{ @@ -54,8 +54,8 @@ func (payloadObj *PayloadEncodable) ToPayload() Payload { } // ToReadablePayload converts Payload to a serializable object -func (payload Payload) ToReadablePayload() PayloadEncodable { - var encodable PayloadEncodable +func (payload Payload) ToReadablePayload() ReadablePayload { + var encodable ReadablePayload encodable.RecordAttributes = helpers.MustUnmarshalJSON[AttributeMap](payload.Record.Attributes) encodable.Signatures = payload.Signatures @@ -65,7 +65,7 @@ func (payload Payload) ToReadablePayload() PayloadEncodable { // ToRecordObj converts Record to RecordObj. // Why? Because go-amino can't handle maps: https://github.com/tendermint/go-amino/issues/4. -func (r *RecordEncodable) ToRecordObj() (Record, error) { +func (r *ReadableRecord) ToRecordObj() (Record, error) { var resourceObj Record resourceObj.Id = r.ID @@ -80,8 +80,8 @@ func (r *RecordEncodable) ToRecordObj() (Record, error) { } // ToReadableRecord converts Record to a serializable object -func (r *Record) ToReadableRecord() RecordEncodable { - var resourceObj RecordEncodable +func (r *Record) ToReadableRecord() ReadableRecord { + var resourceObj ReadableRecord resourceObj.ID = r.Id resourceObj.BondID = r.BondId @@ -96,7 +96,7 @@ func (r *Record) ToReadableRecord() RecordEncodable { } // CanonicalJSON returns the canonical JSON representation of the record. -func (r *RecordEncodable) CanonicalJSON() []byte { +func (r *ReadableRecord) CanonicalJSON() []byte { bytes, err := canonicaljson.Marshal(r.Attributes) if err != nil { panic("error marshalling record: " + err.Error()) @@ -106,7 +106,7 @@ func (r *RecordEncodable) CanonicalJSON() []byte { } // GetSignBytes generates a record hash to be signed. -func (r *RecordEncodable) GetSignBytes() ([]byte, []byte) { +func (r *ReadableRecord) GetSignBytes() ([]byte, []byte) { // Double SHA256 hash. // Input to the first round of hashing. @@ -126,7 +126,7 @@ func (r *RecordEncodable) GetSignBytes() ([]byte, []byte) { } // GetCID gets the record CID. -func (r *RecordEncodable) GetCID() (string, error) { +func (r *ReadableRecord) GetCID() (string, error) { id, err := helpers.GetCid(r.CanonicalJSON()) if err != nil { return "", err -- 2.45.2